Added some docstrings and changed exports
[cl-gtk2.git] / glib / gobject.package.lisp
1 (defpackage :gobject
2   (:use :cl :glib :cffi :tg :bordeaux-threads :iter :closer-mop)
3   (:export #:g-object
4            #:pointer
5            #:g-type-from-object
6            #:g-type-name
7            #:g-type-from-name
8            #:g-signal-connect
9            #:define-g-object-class
10            #:g-initially-unowned
11            #:define-g-enum
12            #:*lisp-name-package*
13            #:define-g-boxed-class
14            #:define-g-flags
15            #:fixed-array
16            #:g-boxed-inline
17            #:g-boxed-ptr
18            #:define-g-interface
19            #:release
20            #:using
21            #:using*
22            #:define-g-boxed-ref
23            #:g-boxed-ref
24            #:allocate-stable-pointer
25            #:free-stable-pointer
26            #:get-stable-pointer-value
27            #:with-stable-pointer
28            #:release*
29            #:disown-boxed-ref
30            #:g-type-interface
31            #:g-value
32            #:register-object-type-implementation
33            #:ensure-g-type
34            #:define-vtable
35            #:g-type
36            #:set-g-value
37            #:parse-gvalue
38            #:emit-signal
39            #:g-value-unset
40            #:g-value-zero
41            #:g-value-init
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
50            #:g-type-class-ref
51            #:g-object-class
52            #:gobject-class
53            #:g-param-spec
54            #:type-instance
55            #:parse-g-param-spec
56            #:g-type-class-unref
57            #:registered-object-type-by-name
58            #:g-type-children
59            #:g-signal-lookup
60            #:g-type-parent
61            #:connect-signal
62            #:boxed-c-structure-name)
63   (:documentation
64 "This package contains bindings to GLib object system called GObject.
65
66 It contains:
67 @begin{itemize}
68 @item{type system}
69 @item{object system}
70 @item{utilities for memory management}
71 @end{itemize}
72
73 @begin[GObject type system querying]{section}
74 GObject type information can queried. Type is identified by GType — an integer.
75
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.
77
78 Functions @fun{g-type-parent} and @fun{g-type-children} inspect type hierarchy.
79 @end{section}
80
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.
83 @end{section}
84
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.
87 @end{section}"))
88
89 (in-package :gobject)
90
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")))
95
96 (use-foreign-library gobject)
97
98 (defvar *gobject-debug* nil)
99
100 (defun debugf (&rest args)
101   (when *gobject-debug*
102     (apply 'format t args)))