export g-value-unset and g-value-zero
[cl-gtk2.git] / glib / gobject.structs.lisp
1 (in-package :gobject)
2
3 (defctype g-type gsize)
4
5 (defcstruct g-type-interface
6   (type g-type)
7   (instance-type g-type))
8
9 (defcstruct g-type-class
10   (type g-type))
11
12 (defcstruct g-type-instance
13   (class (:pointer g-type-class)))
14
15 (defcstruct g-type-info
16   (class-size :uint16)
17   (base-init-fn :pointer)
18   (base-finalize-fn :pointer)
19   (class-init-fn :pointer)
20   (class-finalize-fn :pointer)
21   (class-data :pointer)
22   (instance-size :uint16)
23   (n-preallocs :uint16)
24   (instance-init-fn :pointer)
25   (value-table :pointer))
26
27 (defcstruct g-type-query
28   (type g-type)
29   (type-name (:string :free-from-foreign nil))
30   (class-size :uint)
31   (instance-size :uint))
32
33 (defbitfield g-type-fundamental-flags
34   :classed
35   :instantiatable
36   :derivable
37   :deep-derivable)
38
39 (defcstruct g-type-fundamental-info
40   (type-flags g-type-fundamental-flags))
41
42 (defcstruct g-interface-info
43   (interface-init :pointer)
44   (interface-finalize :pointer)
45   (interface-data :pointer))
46
47 (defcstruct g-type-value-table
48   (value-init :pointer)
49   (value-free :pointer)
50   (value-copy :pointer)
51   (value-peek-pointer :pointer)
52   (collect-format (:string :free-from-foreign nil :free-to-foreign nil))
53   (collect-value :pointer)
54   (lcopy-format (:string :free-from-foreign nil :free-to-foreign nil))
55   (lcopy-value :pointer))
56
57 (defbitfield g-type-flags
58   (:abstract #. (ash 1 4))
59   :value-abstract)
60
61 (eval-when (:load-toplevel :compile-toplevel)
62   (defun gtype-make-fundamental-type (x)
63     (ash x 2)))
64
65 (defconstant +g-type-invalid+ (gtype-make-fundamental-type 0))
66 (defconstant +g-type-void+ (gtype-make-fundamental-type 1))
67 (defconstant +g-type-interface+ (gtype-make-fundamental-type 2))
68 (defconstant +g-type-char+ (gtype-make-fundamental-type 3))
69 (defconstant +g-type-uchar+ (gtype-make-fundamental-type 4))
70 (defconstant +g-type-boolean+ (gtype-make-fundamental-type 5))
71 (defconstant +g-type-int+ (gtype-make-fundamental-type 6))
72 (defconstant +g-type-uint+ (gtype-make-fundamental-type 7))
73 (defconstant +g-type-long+ (gtype-make-fundamental-type 8))
74 (defconstant +g-type-ulong+ (gtype-make-fundamental-type 9))
75 (defconstant +g-type-int64+ (gtype-make-fundamental-type 10))
76 (defconstant +g-type-uint64+ (gtype-make-fundamental-type 11))
77 (defconstant +g-type-enum+ (gtype-make-fundamental-type 12))
78 (defconstant +g-type-flags+ (gtype-make-fundamental-type 13))
79 (defconstant +g-type-float+ (gtype-make-fundamental-type 14))
80 (defconstant +g-type-double+ (gtype-make-fundamental-type 15))
81 (defconstant +g-type-string+ (gtype-make-fundamental-type 16))
82 (defconstant +g-type-pointer+ (gtype-make-fundamental-type 17))
83 (defconstant +g-type-boxed+ (gtype-make-fundamental-type 18))
84 (defconstant +g-type-param+ (gtype-make-fundamental-type 19))
85 (defconstant +g-type-object+ (gtype-make-fundamental-type 20))
86
87 (defcstruct %g-object
88   (type-instance g-type-instance)
89   (ref-count :uint)
90   (data :pointer))
91
92 (defcstruct g-object-class
93   (type-class g-type-class)
94   (construct-properties :pointer)
95   (constructor :pointer)
96   (set-property :pointer)
97   (get-property :pointer)
98   (dispose :pointer)
99   (finalize :pointer)
100   (dispatch-properties-changed :pointer)
101   (notify :pointer)
102   (constructed :pointer)
103   (pdummy :pointer :count 7))
104
105 (defbitfield g-param-flags
106   :readable
107   :writable
108   :construct
109   :construct-only
110   :lax-validation
111   :static-name
112   :nick
113   :blurb)
114
115 (defcstruct g-param-spec
116   (type-instance g-type-instance)
117   (name (:string :free-from-foreign nil :free-to-foreign nil))
118   (flags g-param-flags)
119   (value-type g-type)
120   (owner-type g-type))
121
122 (defcunion g-value-data
123   (int :int)
124   (uint :uint)
125   (long :long)
126   (ulong :ulong)
127   (int64 :int64)
128   (uint64 :uint64)
129   (float :float)
130   (double :double)
131   (pointer :pointer))
132
133 (defcstruct g-value
134   (type g-type)
135   (data g-value-data :count 2))
136
137 (defcstruct g-object-construct-param
138   (param-spec (:pointer g-param-spec))
139   (value (:pointer g-value)))
140
141 (defcstruct g-parameter
142   (name (:string :free-from-foreign nil :free-to-foreign nil))
143   (value g-value))
144
145 (defcstruct g-enum-value
146   (value :int)
147   (name (:string :free-from-foreign nil :free-to-foreign nil))
148   (nick (:string :free-from-foreign nil :free-to-foreign nil)))
149
150 (defcstruct g-enum-class
151   (type-class g-type-class)
152   (minimum :int)
153   (maximum :int)
154   (n-values :uint)
155   (values (:pointer g-enum-value)))
156
157 (defcstruct g-flags-value
158   (value :uint)
159   (name (:string :free-from-foreign nil :free-to-foreign nil))
160   (nick (:string :free-from-foreign nil :free-to-foreign nil)))
161
162 (defcstruct g-flags-class
163   (type-class g-type-class)
164   (mask :uint)
165   (n-values :uint)
166   (values (:pointer g-flags-value)))
167
168 (defcstruct g-param-spec-boolean
169   (parent-instance g-param-spec)
170   (default-value :boolean))
171
172 (defcstruct g-param-spec-char
173   (parent-instance g-param-spec)
174   (minimum :int8)
175   (maximum :int8)
176   (default-value :int8))
177
178 (defcstruct g-param-spec-uchar
179   (parent-instance g-param-spec)
180   (minimum :uint8)
181   (maximum :uint8)
182   (default-value :uint8))
183
184 (defcstruct g-param-spec-int
185   (parent-instance g-param-spec)
186   (minimum :int)
187   (maximum :int)
188   (default-value :int))
189
190 (defcstruct g-param-spec-uint
191   (parent-instance g-param-spec)
192   (minimum :uint)
193   (maximum :uint)
194   (default-value :uint))
195
196 (defcstruct g-param-spec-long
197   (parent-instance g-param-spec)
198   (minimum :long)
199   (maximum :long)
200   (default-value :ulong))
201
202 (defcstruct g-param-spec-ulong
203   (parent-instance g-param-spec)
204   (minimum :ulong)
205   (maximum :ulong)
206   (default-value :ulong))
207
208 (defcstruct g-param-spec-int64
209   (parent-instance g-param-spec)
210   (minimum :uint64)
211   (maximum :uint64)
212   (default-value :uint64))
213
214 (defcstruct g-param-spec-uint64
215   (parent-instance g-param-spec)
216   (minimum :uint64)
217   (maximum :uint64)
218   (default-value :uint64))
219
220 (defcstruct g-param-spec-float
221   (parent-instance g-param-spec)
222   (minimum :float)
223   (maximum :float)
224   (default-value :float)
225   (epsilon :float))
226
227 (defcstruct g-param-spec-double
228   (parent-instance g-param-spec)
229   (minimum :double)
230   (maximum :double)
231   (default-value :double)
232   (epsilon :double))
233
234 (defcstruct g-param-spec-enum
235   (parent-instance g-param-spec)
236   (enum-class (:pointer g-enum-class))
237   (default-value :int))
238
239 (defcstruct g-param-spec-flags
240   (parent-instance g-param-spec)
241   (flags-class (:pointer g-flags-class))
242   (default-value :uint))
243
244 (defcstruct g-param-spec-string
245   (parent-instance g-param-spec)
246   (default-value (:string :free-to-foreign nil :free-from-foreign nil))
247   (cset-first (:string :free-to-foreign nil :free-from-foreign nil))
248   (cset-nth (:string :free-to-foreign nil :free-from-foreign nil))
249   (substitutor :char)
250   (flags-for-null :uint))
251
252 (defcstruct g-param-spec-param
253   (parent-instance g-param-spec))
254
255 (defcstruct g-param-spec-boxed
256   (parent-instance g-param-spec))
257
258 (defcstruct g-param-spec-pointer
259   (parent-instance g-param-spec))
260
261 (defcstruct g-param-spec-object
262   (parent-instance g-param-spec))
263
264 (defcstruct g-param-spec-value-array
265   (parent-instance g-param-spec)
266   (element-spec (:pointer g-param-spec))
267   (fixed-n-elements :uint))
268
269 (defcstruct g-param-spec-g-type
270   (parent-instance g-param-spec)
271   (types-root g-type))
272
273 (defcstruct g-param-spec-class
274   (type-class g-type-class)
275   (value-type g-type)
276   (finalize :pointer)
277   (value-set-default :pointer)
278   (value-validate :pointer)
279   (values-cmp :pointer))
280
281 (defcstruct g-closure
282   (private-data :uint32)
283   (marshal :pointer)
284   (data :pointer)
285   (notifiers :pointer))