2 (:use :cl :glib :cffi :tg :bordeaux-threads :iter :closer-mop :gobject.type-info)
3 (:export #:+g-type-invalid+
30 #:define-g-object-class
34 #:define-g-boxed-class
45 #:allocate-stable-pointer
47 #:get-stable-pointer-value
53 #:register-object-type-implementation
63 #:g-class-property-definition
64 #:g-class-property-definition-name
65 #:g-class-property-definition-type
66 #:g-class-property-definition-readable
67 #:g-class-property-definition-writable
68 #:g-class-property-definition-constructor
69 #:g-class-property-definition-constructor-only
70 #:g-class-property-definition-owner-type
72 #:interface-properties
90 #:registered-object-type-by-name
95 #:boxed-c-structure-name
102 #:g-type-interface-prerequisites)
104 "CL-GTK2-GOBJECT is a binding to GObject type system.
105 For information on GObject, see its @a[http://library.gnome.org/devel/gobject/stable/]{documentation}.
107 CL-GTK2-GOBJECT is structured as follows:
109 @item{Binding to GObject API, providing low-level means to use functionality of GObject. This includes introspection facilities and means to invoke functionality of GObject.}
110 @item{GObject wrapper that bridges Lisp language with GObject API.}
113 @begin[GObject instrospection API]{section}
114 The base of GObject type system is GType. GType is a numerical value that is the unique identifier of a registered type.
115 Each GType has a name that is retrieved with @fun{g-type-name}. Conversely, GType can be retrieved from its name via @fun{g-type-from-name}.
117 There are several predefined GType values that correspond to fundamental or base types.
119 @item{@variable{+g-type-invalid+}}
120 @item{@variable{+g-type-void+}}
121 @item{@variable{+g-type-interface+}}
122 @item{@variable{+g-type-char+}}
123 @item{@variable{+g-type-uchar+}}
124 @item{@variable{+g-type-boolean+}}
125 @item{@variable{+g-type-int+}}
126 @item{@variable{+g-type-uint+}}
127 @item{@variable{+g-type-long+}}
128 @item{@variable{+g-type-ulong+}}
129 @item{@variable{+g-type-int64+}}
130 @item{@variable{+g-type-uint64+}}
131 @item{@variable{+g-type-enum+}}
132 @item{@variable{+g-type-flags+}}
133 @item{@variable{+g-type-float+}}
134 @item{@variable{+g-type-double+}}
135 @item{@variable{+g-type-string+}}
136 @item{@variable{+g-type-pointer+}}
137 @item{@variable{+g-type-boxed+}}
138 @item{@variable{+g-type-param+}}
139 @item{@variable{+g-type-object+}}
142 GType values form type hierarchies via signle inheritance. Functions @fun{g-type-parent} and @fun{g-type-children} enable to traverse through the type hierarchy.
144 For some types, additional information is available. Functions @fun{class-properties} and @fun{interface-properties} return properties of classes and interfaces. Functions @fun{get-enum-items} and @fun{get-flags-items} return members of enum and flags types.
146 //TODO: document and refactor signals
150 @begin[GValue]{section}
151 GObject uses GValues as a generic way to pass values. It is used when calling closures, emitting signals, setting and getting properties' values, passing values to object constructors. @class{g-value} foreign structure is used for holding GValue. It used like all foreign structures: either with @code{cffi:foreign-alloc} or with @code{cffi:with-foreign-object}. Before first use, @class{g-value} should be zeroed with @fun{g-value-zero}. Zeroed @class{g-value} may be configured to hold a GValue of a given type with @fun{g-value-init}. @fun{parse-g-value} retrieves the Lisp object corresponding to the value stored in GValue. @fun{set-g-value} sets the GValue from Lisp object.
154 (in-package :gobject)
156 (defvar *gobject-debug* nil)
158 (defun debugf (&rest args)
159 (when *gobject-debug*
160 (apply 'format t args)))