4.1 Introduction

GObject is a part of GLib library that implements the type system. The CL-GTK2-GObject is a Common Lisp binding for relevant parts of GObject.

The purpose of CL-GTK2-GObject is to ease the creation of binding for libraries based on GObject.

Please bear in mind that this is the documentation for a work-in-progress library and is a snapshot of current situation. API and functionality may (and will) change. Largely unfinished parts are working with GBoxed types, subclassing GObjects and implementing GInterfaces.

CL-GTK2-GObject is logically split into several layers:

FFI code. FFI (foreign functions interface) layer is a glue between Lisp code and libglib, libgobject, libgthread. This code includes basic wrapper around GType designator (it is used everywhere and should be defined first) and definitions of foreign structures and imports foreign functions.

Low-level GObject integration. These are facilities provided by GObject that capture specific aspects of type system, object system and cross-language runtime. This includes types information, GValues (generic containers for value of any type supported by GObject type system), closures, means to create and use objects. This layer also includes some non-GObject facilities: stable pointers.

High-level GObject integration. This layer includes support for interoperability between CLOS and GObject and automatic generation of corresponding definitions.

Naturally, users of CL-GTK2-GObject should use the high-level GObject integration, but occasionaly it may be necessary to use lower-level functionality.