2 (:use :cl :glib :cffi :tg :bordeaux-threads :iter :closer-mop)
9 #:define-g-object-class
13 #:define-g-boxed-class
24 #:allocate-stable-pointer
26 #:get-stable-pointer-value
32 #:register-object-type-implementation
42 #:g-class-property-definition
43 #:g-class-property-definition-name
44 #:g-class-property-definition-type
45 #:g-class-property-definition-readable
46 #:g-class-property-definition-writable
47 #:g-class-property-definition-constructor
48 #:g-class-property-definition-constructor-only
49 #:g-class-property-definition-owner-type
57 #:registered-object-type-by-name
62 #:boxed-c-structure-name)
64 "This package contains bindings to GLib object system called GObject.
70 @item{utilities for memory management}
73 @begin[GObject type system querying]{section}
74 GObject type information can queried. Type is identified by GType — an integer.
76 Function @fun{g-type-from-name} returns GType by its name, and function @fun{g-type-name} returns the name of a GType. Function @fun{ensure-g-type} is a convenience function that returns GType from either GType or its name.
78 Functions @fun{g-type-parent} and @fun{g-type-children} inspect type hierarchy.
81 @begin[GValue]{section}
82 GValue is a GObject's \"variant\"-like type. It can contain value of any type that GObject supports. The GValue is used for passing parameters to signal handlers, properties' getters and setters. Functions @fun{g-value-init}, @fun{g-value-unset}, @fun{g-value-zero}, @fun{parse-gvalue} and @fun{set-g-value} are used to init, reset, retrieve and assign GValue structures.
85 @begin[Utilities]{section}
86 GObject contains implementation of stable pointers. Stable pointer is a reference that can be passed between FFI boundaries. Stable pointer is an integer that is allocated with @fun{allocate-stable-pointer}. This integer can be passed to other code and back. The value of this pointer (that is retrieved with @fun{get-stable-pointer-value}) is stable, staying the same until the pointer is freed with @fun{free-stable-pointer}. For convenience, @fun{with-stable-pointer} macro is provided.
91 (eval-when (:compile-toplevel :load-toplevel :execute)
92 (define-foreign-library gobject
93 (:unix (:or "libgobject-2.0.so.0" "libgobject-2.0.so"))
94 (t "libgobject-2.0")))
96 (use-foreign-library gobject)
98 (defvar *gobject-debug* nil)
100 (defun debugf (&rest args)
101 (when *gobject-debug*
102 (apply 'format t args)))