2 (:use :cl :glib :cffi :tg :bordeaux-threads :iter :closer-mop :gobject.ffi :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
69 #:registered-object-type-by-name
74 #:boxed-c-structure-name
81 #:g-type-interface-prerequisites
93 #:g-type-interface-prerequisites
96 #:g-class-property-definition
97 #:g-class-property-definition-name
98 #:g-class-property-definition-type
99 #:g-class-property-definition-readable
100 #:g-class-property-definition-writable
101 #:g-class-property-definition-constructor
102 #:g-class-property-definition-constructor-only
103 #:g-class-property-definition-owner-type
106 #:interface-properties
118 "CL-GTK2-GOBJECT is a binding to GObject type system.
119 For information on GObject, see its @a[http://library.gnome.org/devel/gobject/stable/]{documentation}.
121 CL-GTK2-GOBJECT is structured as follows:
123 @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.}
124 @item{GObject wrapper that bridges Lisp language with GObject API.}
127 @begin[GObject instrospection API]{section}
128 The base of GObject type system is GType. GType is a numerical value that is the unique identifier of a registered type.
129 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}.
131 There are several predefined GType values that correspond to fundamental or base types.
133 @item{@variable{+g-type-invalid+}}
134 @item{@variable{+g-type-void+}}
135 @item{@variable{+g-type-interface+}}
136 @item{@variable{+g-type-char+}}
137 @item{@variable{+g-type-uchar+}}
138 @item{@variable{+g-type-boolean+}}
139 @item{@variable{+g-type-int+}}
140 @item{@variable{+g-type-uint+}}
141 @item{@variable{+g-type-long+}}
142 @item{@variable{+g-type-ulong+}}
143 @item{@variable{+g-type-int64+}}
144 @item{@variable{+g-type-uint64+}}
145 @item{@variable{+g-type-enum+}}
146 @item{@variable{+g-type-flags+}}
147 @item{@variable{+g-type-float+}}
148 @item{@variable{+g-type-double+}}
149 @item{@variable{+g-type-string+}}
150 @item{@variable{+g-type-pointer+}}
151 @item{@variable{+g-type-boxed+}}
152 @item{@variable{+g-type-param+}}
153 @item{@variable{+g-type-object+}}
156 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.
158 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.
160 //TODO: document and refactor signals
164 @begin[GValue]{section}
165 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.
168 (in-package :gobject)
170 (defvar *gobject-debug* nil)
172 (defun debugf (&rest args)
173 (when *gobject-debug*
174 (apply 'format t args)))