Portability: add definition of gsize for x86; add other names of libraries
[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 (defctype %g-initially-unowned %g-object)
93
94 (defcstruct g-object-class
95   (type-class g-type-class)
96   (construct-properties :pointer)
97   (constructor :pointer)
98   (set-property :pointer)
99   (get-property :pointer)
100   (dispose :pointer)
101   (finalize :pointer)
102   (dispatch-properties-changed :pointer)
103   (notify :pointer)
104   (constructed :pointer)
105   (pdummy :pointer :count 7))
106
107 (defbitfield g-param-flags
108   :readable
109   :writable
110   :construct
111   :construct-only
112   :lax-validation
113   :static-name
114   :nick
115   :blurb)
116
117 (defcstruct g-param-spec
118   (type-instance g-type-instance)
119   (name (:string :free-from-foreign nil :free-to-foreign nil))
120   (flags g-param-flags)
121   (value-type g-type)
122   (owner-type g-type))
123
124 (defcunion g-value-data
125   (int :int)
126   (uint :uint)
127   (long :long)
128   (ulong :ulong)
129   (int64 :int64)
130   (uint64 :uint64)
131   (float :float)
132   (double :double)
133   (pointer :pointer))
134
135 (defcstruct g-value
136   (type g-type)
137   (data g-value-data :count 2))
138
139 (defcstruct g-object-construct-param
140   (param-spec (:pointer g-param-spec))
141   (value (:pointer g-value)))
142
143 (defcstruct g-parameter
144   (name (:string :free-from-foreign nil :free-to-foreign nil))
145   (value g-value))
146
147 (defcstruct g-enum-value
148   (value :int)
149   (name (:string :free-from-foreign nil :free-to-foreign nil))
150   (nick (:string :free-from-foreign nil :free-to-foreign nil)))
151
152 (defcstruct g-enum-class
153   (type-class g-type-class)
154   (minimum :int)
155   (maximum :int)
156   (n-values :uint)
157   (values (:pointer g-enum-value)))
158
159 (defcstruct g-flags-value
160   (value :uint)
161   (name (:string :free-from-foreign nil :free-to-foreign nil))
162   (nick (:string :free-from-foreign nil :free-to-foreign nil)))
163
164 (defcstruct g-flags-class
165   (type-class g-type-class)
166   (mask :uint)
167   (n-values :uint)
168   (values (:pointer g-flags-value)))
169
170 (defcstruct g-param-spec-boolean
171   (parent-instance g-param-spec)
172   (default-value :boolean))
173
174 (defcstruct g-param-spec-char
175   (parent-instance g-param-spec)
176   (minimum :int8)
177   (maximum :int8)
178   (default-value :int8))
179
180 (defcstruct g-param-spec-uchar
181   (parent-instance g-param-spec)
182   (minimum :uint8)
183   (maximum :uint8)
184   (default-value :uint8))
185
186 (defcstruct g-param-spec-int
187   (parent-instance g-param-spec)
188   (minimum :int)
189   (maximum :int)
190   (default-value :int))
191
192 (defcstruct g-param-spec-uint
193   (parent-instance g-param-spec)
194   (minimum :uint)
195   (maximum :uint)
196   (default-value :uint))
197
198 (defcstruct g-param-spec-long
199   (parent-instance g-param-spec)
200   (minimum :long)
201   (maximum :long)
202   (default-value :ulong))
203
204 (defcstruct g-param-spec-ulong
205   (parent-instance g-param-spec)
206   (minimum :ulong)
207   (maximum :ulong)
208   (default-value :ulong))
209
210 (defcstruct g-param-spec-int64
211   (parent-instance g-param-spec)
212   (minimum :uint64)
213   (maximum :uint64)
214   (default-value :uint64))
215
216 (defcstruct g-param-spec-uint64
217   (parent-instance g-param-spec)
218   (minimum :uint64)
219   (maximum :uint64)
220   (default-value :uint64))
221
222 (defcstruct g-param-spec-float
223   (parent-instance g-param-spec)
224   (minimum :float)
225   (maximum :float)
226   (default-value :float)
227   (epsilon :float))
228
229 (defcstruct g-param-spec-double
230   (parent-instance g-param-spec)
231   (minimum :double)
232   (maximum :double)
233   (default-value :double)
234   (epsilon :double))
235
236 (defcstruct g-param-spec-enum
237   (parent-instance g-param-spec)
238   (enum-class (:pointer g-enum-class))
239   (default-value :int))
240
241 (defcstruct g-param-spec-flags
242   (parent-instance g-param-spec)
243   (flags-class (:pointer g-flags-class))
244   (default-value :uint))
245
246 (defcstruct g-param-spec-string
247   (parent-instance g-param-spec)
248   (default-value (:string :free-to-foreign nil :free-from-foreign nil))
249   (cset-first (:string :free-to-foreign nil :free-from-foreign nil))
250   (cset-nth (:string :free-to-foreign nil :free-from-foreign nil))
251   (substitutor :char)
252   (flags-for-null :uint))
253
254 (defcstruct g-param-spec-param
255   (parent-instance g-param-spec))
256
257 (defcstruct g-param-spec-boxed
258   (parent-instance g-param-spec))
259
260 (defcstruct g-param-spec-pointer
261   (parent-instance g-param-spec))
262
263 (defcstruct g-param-spec-object
264   (parent-instance g-param-spec))
265
266 (defcstruct g-param-spec-value-array
267   (parent-instance g-param-spec)
268   (element-spec (:pointer g-param-spec))
269   (fixed-n-elements :uint))
270
271 (defcstruct g-param-spec-g-type
272   (parent-instance g-param-spec)
273   (types-root g-type))
274
275 (defcstruct g-param-spec-class
276   (type-class g-type-class)
277   (value-type g-type)
278   (finalize :pointer)
279   (value-set-default :pointer)
280   (value-validate :pointer)
281   (values-cmp :pointer))
282
283 (defcstruct g-closure
284   (private-data :uint32)
285   (marshal :pointer)
286   (data :pointer)
287   (notifiers :pointer))