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