2 (:use
:c2cl
:glib
:cffi
:tg
:bordeaux-threads
:iter
:closer-mop
:gobject.ffi
)
15 #:g-type-interface-prerequisites
18 #:g-class-property-definition
19 #:g-class-property-definition-name
20 #:g-class-property-definition-type
21 #:g-class-property-definition-readable
22 #:g-class-property-definition-writable
23 #:g-class-property-definition-constructor
24 #:g-class-property-definition-constructor-only
25 #:g-class-property-definition-owner-type
28 #:interface-properties
42 #:signal-info-owner-type
44 #:signal-info-return-type
45 #:signal-info-param-types
76 #:define-g-object-class
89 #:allocate-stable-pointer
91 #:get-stable-pointer-value
97 #:register-object-type-implementation
113 #:registered-object-type-by-name
118 #:boxed-c-structure-name
125 #:g-type-interface-prerequisites
136 #:g-type-interface-prerequisites
139 #:g-class-property-definition
140 #:g-class-property-definition-name
141 #:g-class-property-definition-type
142 #:g-class-property-definition-readable
143 #:g-class-property-definition-writable
144 #:g-class-property-definition-constructor
145 #:g-class-property-definition-constructor-only
146 #:g-class-property-definition-owner-type
149 #:interface-properties
160 #:stable-pointer-value
162 #:g-object-call-constructor
163 #:g-object-call-get-property
164 #:g-object-call-set-property
166 #:register-flags-type
167 #:register-object-type
168 #:generate-types-hierarchy-to-file
169 #:get-g-flags-definition
170 #:get-g-enum-definition
171 #:get-g-interface-definition
172 #:get-g-class-definition
174 #:*lisp-name-exceptions
*
175 #:*additional-properties
*
178 #:define-g-boxed-cstruct
179 #:define-g-boxed-opaque
181 #:g-boxed-opaque-pointer
182 #:define-g-boxed-variant-cstruct
184 #:boxed-related-symbols
185 #:define-boxed-opaque-accessor
187 #:create-signal-handler-closure
188 #:save-handler-to-object
189 #:retrieve-handler-from-object
190 #:delete-handler-from-object
194 #:copy-boxed-slots-to-foreign
195 #:with-foreign-boxed-array
196 #:get-g-type-definition
)
198 "CL-GTK2-GOBJECT is a binding to GObject type system.
199 For information on GObject, see its @a[http://library.gnome.org/devel/gobject/stable/]{documentation}.
201 CL-GTK2-GOBJECT is structured as follows:
203 @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.}
204 @item{GObject wrapper that bridges Lisp language with GObject API.}
207 @begin[GObject instrospection API]{section}
208 The base of GObject type system is GType. GType is a numerical value that is the unique identifier of a registered type.
209 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}.
211 There are several predefined GType values that correspond to fundamental or base types.
213 @item{@variable{+g-type-invalid+}}
214 @item{@variable{+g-type-void+}}
215 @item{@variable{+g-type-interface+}}
216 @item{@variable{+g-type-char+}}
217 @item{@variable{+g-type-uchar+}}
218 @item{@variable{+g-type-boolean+}}
219 @item{@variable{+g-type-int+}}
220 @item{@variable{+g-type-uint+}}
221 @item{@variable{+g-type-long+}}
222 @item{@variable{+g-type-ulong+}}
223 @item{@variable{+g-type-int64+}}
224 @item{@variable{+g-type-uint64+}}
225 @item{@variable{+g-type-enum+}}
226 @item{@variable{+g-type-flags+}}
227 @item{@variable{+g-type-float+}}
228 @item{@variable{+g-type-double+}}
229 @item{@variable{+g-type-string+}}
230 @item{@variable{+g-type-pointer+}}
231 @item{@variable{+g-type-boxed+}}
232 @item{@variable{+g-type-param+}}
233 @item{@variable{+g-type-object+}}
236 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.
238 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.
240 //TODO: document and refactor signals
244 @begin[GValue]{section}
245 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.
248 (in-package :gobject
)
250 (defvar *gobject-debug
* nil
)
252 (defvar *debug-gc
* nil
)
253 (defvar *debug-subclass
* nil
)
255 (defvar *debug-stream
* t
)
257 (defmacro log-for
(categories control-string
&rest args
)
258 (let ((vars (iter (for sym in
(if (listp categories
) categories
(list categories
)))
259 (collect (intern (format nil
"*DEBUG-~A*" (symbol-name sym
)) (find-package :gobject
))))))
262 (format *debug-stream
* ,control-string
,@args
))