various: add GLIB_AVAILABLE_IN_ALL everywhere else
[platform/upstream/glib.git] / gobject / gparamspecs.h
1 /* GObject - GLib Type, Object, Parameter and Signal Library
2  * Copyright (C) 1997-1999, 2000-2001 Tim Janik and Red Hat, Inc.
3  *
4  * This library is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Lesser General Public
6  * License as published by the Free Software Foundation; either
7  * version 2 of the License, or (at your option) any later version.
8  *
9  * This library is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12  * Lesser General Public License for more details.
13  *
14  * You should have received a copy of the GNU Lesser General
15  * Public License along with this library; if not, write to the
16  * Free Software Foundation, Inc., 59 Temple Place, Suite 330,
17  * Boston, MA 02111-1307, USA.
18  *
19  * gparamspecs.h: GLib default param specs
20  */
21 #ifndef __G_PARAMSPECS_H__
22 #define __G_PARAMSPECS_H__
23
24 #if !defined (__GLIB_GOBJECT_H_INSIDE__) && !defined (GOBJECT_COMPILATION)
25 #error "Only <glib-object.h> can be included directly."
26 #endif
27
28 #include        <gobject/gvalue.h>
29 #include        <gobject/genums.h>
30 #include        <gobject/gboxed.h>
31 #include        <gobject/gobject.h>
32
33 G_BEGIN_DECLS
34
35 /* --- type macros --- */
36 /**
37  * G_TYPE_PARAM_CHAR:
38  * 
39  * The #GType of #GParamSpecChar.
40  */
41 #define G_TYPE_PARAM_CHAR                  (g_param_spec_types[0])
42 /**
43  * G_IS_PARAM_SPEC_CHAR:
44  * @pspec: a valid #GParamSpec instance
45  * 
46  * Checks whether the given #GParamSpec is of type %G_TYPE_PARAM_CHAR.
47  * 
48  * Returns: %TRUE on success.
49  */
50 #define G_IS_PARAM_SPEC_CHAR(pspec)        (G_TYPE_CHECK_INSTANCE_TYPE ((pspec), G_TYPE_PARAM_CHAR))
51 /**
52  * G_PARAM_SPEC_CHAR:
53  * @pspec: a valid #GParamSpec instance
54  * 
55  * Cast a #GParamSpec instance into a #GParamSpecChar.
56  */
57 #define G_PARAM_SPEC_CHAR(pspec)           (G_TYPE_CHECK_INSTANCE_CAST ((pspec), G_TYPE_PARAM_CHAR, GParamSpecChar))
58
59 /**
60  * G_TYPE_PARAM_UCHAR:
61  * 
62  * The #GType of #GParamSpecUChar.
63  */
64 #define G_TYPE_PARAM_UCHAR                 (g_param_spec_types[1])
65 /**
66  * G_IS_PARAM_SPEC_UCHAR:
67  * @pspec: a valid #GParamSpec instance
68  * 
69  * Checks whether the given #GParamSpec is of type %G_TYPE_PARAM_UCHAR.
70  * 
71  * Returns: %TRUE on success.
72  */
73 #define G_IS_PARAM_SPEC_UCHAR(pspec)       (G_TYPE_CHECK_INSTANCE_TYPE ((pspec), G_TYPE_PARAM_UCHAR))
74 /**
75  * G_PARAM_SPEC_UCHAR:
76  * @pspec: a valid #GParamSpec instance
77  * 
78  * Cast a #GParamSpec instance into a #GParamSpecUChar.
79  */
80 #define G_PARAM_SPEC_UCHAR(pspec)          (G_TYPE_CHECK_INSTANCE_CAST ((pspec), G_TYPE_PARAM_UCHAR, GParamSpecUChar))
81
82 /**
83  * G_TYPE_PARAM_BOOLEAN:
84  * 
85  * The #GType of #GParamSpecBoolean.
86  */
87 #define G_TYPE_PARAM_BOOLEAN               (g_param_spec_types[2])
88 /**
89  * G_IS_PARAM_SPEC_BOOLEAN:
90  * @pspec: a valid #GParamSpec instance
91  * 
92  * Checks whether the given #GParamSpec is of type %G_TYPE_PARAM_BOOLEAN.
93  * 
94  * Returns: %TRUE on success.
95  */
96 #define G_IS_PARAM_SPEC_BOOLEAN(pspec)     (G_TYPE_CHECK_INSTANCE_TYPE ((pspec), G_TYPE_PARAM_BOOLEAN))
97 /**
98  * G_PARAM_SPEC_BOOLEAN:
99  * @pspec: a valid #GParamSpec instance
100  * 
101  * Cast a #GParamSpec instance into a #GParamSpecBoolean.
102  */
103 #define G_PARAM_SPEC_BOOLEAN(pspec)        (G_TYPE_CHECK_INSTANCE_CAST ((pspec), G_TYPE_PARAM_BOOLEAN, GParamSpecBoolean))
104
105 /**
106  * G_TYPE_PARAM_INT:
107  * 
108  * The #GType of #GParamSpecInt.
109  */
110 #define G_TYPE_PARAM_INT                   (g_param_spec_types[3])
111 /**
112  * G_IS_PARAM_SPEC_INT:
113  * @pspec: a valid #GParamSpec instance
114  * 
115  * Checks whether the given #GParamSpec is of type %G_TYPE_PARAM_INT.
116  * 
117  * Returns: %TRUE on success.
118  */
119 #define G_IS_PARAM_SPEC_INT(pspec)         (G_TYPE_CHECK_INSTANCE_TYPE ((pspec), G_TYPE_PARAM_INT))
120 /**
121  * G_PARAM_SPEC_INT:
122  * @pspec: a valid #GParamSpec instance
123  * 
124  * Cast a #GParamSpec instance into a #GParamSpecInt.
125  */
126 #define G_PARAM_SPEC_INT(pspec)            (G_TYPE_CHECK_INSTANCE_CAST ((pspec), G_TYPE_PARAM_INT, GParamSpecInt))
127
128 /**
129  * G_TYPE_PARAM_UINT:
130  * 
131  * The #GType of #GParamSpecUInt.
132  */
133 #define G_TYPE_PARAM_UINT                  (g_param_spec_types[4])
134 /**
135  * G_IS_PARAM_SPEC_UINT:
136  * @pspec: a valid #GParamSpec instance
137  * 
138  * Checks whether the given #GParamSpec is of type %G_TYPE_PARAM_UINT.
139  * 
140  * Returns: %TRUE on success.
141  */
142 #define G_IS_PARAM_SPEC_UINT(pspec)        (G_TYPE_CHECK_INSTANCE_TYPE ((pspec), G_TYPE_PARAM_UINT))
143 /**
144  * G_PARAM_SPEC_UINT:
145  * @pspec: a valid #GParamSpec instance
146  * 
147  * Cast a #GParamSpec instance into a #GParamSpecUInt.
148  */
149 #define G_PARAM_SPEC_UINT(pspec)           (G_TYPE_CHECK_INSTANCE_CAST ((pspec), G_TYPE_PARAM_UINT, GParamSpecUInt))
150
151 /**
152  * G_TYPE_PARAM_LONG:
153  * 
154  * The #GType of #GParamSpecLong.
155  */
156 #define G_TYPE_PARAM_LONG                  (g_param_spec_types[5])
157 /**
158  * G_IS_PARAM_SPEC_LONG:
159  * @pspec: a valid #GParamSpec instance
160  * 
161  * Checks whether the given #GParamSpec is of type %G_TYPE_PARAM_LONG.
162  * 
163  * Returns: %TRUE on success.
164  */
165 #define G_IS_PARAM_SPEC_LONG(pspec)        (G_TYPE_CHECK_INSTANCE_TYPE ((pspec), G_TYPE_PARAM_LONG))
166 /**
167  * G_PARAM_SPEC_LONG:
168  * @pspec: a valid #GParamSpec instance
169  * 
170  * Cast a #GParamSpec instance into a #GParamSpecLong.
171  */
172 #define G_PARAM_SPEC_LONG(pspec)           (G_TYPE_CHECK_INSTANCE_CAST ((pspec), G_TYPE_PARAM_LONG, GParamSpecLong))
173
174 /**
175  * G_TYPE_PARAM_ULONG:
176  * 
177  * The #GType of #GParamSpecULong.
178  */
179 #define G_TYPE_PARAM_ULONG                 (g_param_spec_types[6])
180 /**
181  * G_IS_PARAM_SPEC_ULONG:
182  * @pspec: a valid #GParamSpec instance
183  * 
184  * Checks whether the given #GParamSpec is of type %G_TYPE_PARAM_ULONG.
185  * 
186  * Returns: %TRUE on success.
187  */
188 #define G_IS_PARAM_SPEC_ULONG(pspec)       (G_TYPE_CHECK_INSTANCE_TYPE ((pspec), G_TYPE_PARAM_ULONG))
189 /**
190  * G_PARAM_SPEC_ULONG:
191  * @pspec: a valid #GParamSpec instance
192  * 
193  * Cast a #GParamSpec instance into a #GParamSpecULong.
194  */
195 #define G_PARAM_SPEC_ULONG(pspec)          (G_TYPE_CHECK_INSTANCE_CAST ((pspec), G_TYPE_PARAM_ULONG, GParamSpecULong))
196
197 /**
198  * G_TYPE_PARAM_INT64:
199  * 
200  * The #GType of #GParamSpecInt64.
201  */
202 #define G_TYPE_PARAM_INT64                 (g_param_spec_types[7])
203 /**
204  * G_IS_PARAM_SPEC_INT64:
205  * @pspec: a valid #GParamSpec instance
206  * 
207  * Checks whether the given #GParamSpec is of type %G_TYPE_PARAM_INT64.
208  *
209  * Returns: %TRUE on success.
210  */
211 #define G_IS_PARAM_SPEC_INT64(pspec)       (G_TYPE_CHECK_INSTANCE_TYPE ((pspec), G_TYPE_PARAM_INT64))
212 /**
213  * G_PARAM_SPEC_INT64:
214  * @pspec: a valid #GParamSpec instance
215  * 
216  * Cast a #GParamSpec instance into a #GParamSpecInt64.
217  */
218 #define G_PARAM_SPEC_INT64(pspec)          (G_TYPE_CHECK_INSTANCE_CAST ((pspec), G_TYPE_PARAM_INT64, GParamSpecInt64))
219
220 /**
221  * G_TYPE_PARAM_UINT64:
222  * 
223  * The #GType of #GParamSpecUInt64.
224  */
225 #define G_TYPE_PARAM_UINT64                (g_param_spec_types[8])
226 /**
227  * G_IS_PARAM_SPEC_UINT64:
228  * @pspec: a valid #GParamSpec instance
229  * 
230  * Checks whether the given #GParamSpec is of type %G_TYPE_PARAM_UINT64.
231  * 
232  * Returns: %TRUE on success.
233  */
234 #define G_IS_PARAM_SPEC_UINT64(pspec)      (G_TYPE_CHECK_INSTANCE_TYPE ((pspec), G_TYPE_PARAM_UINT64))
235 /**
236  * G_PARAM_SPEC_UINT64:
237  * @pspec: a valid #GParamSpec instance
238  * 
239  * Cast a #GParamSpec instance into a #GParamSpecUInt64.
240  */
241 #define G_PARAM_SPEC_UINT64(pspec)         (G_TYPE_CHECK_INSTANCE_CAST ((pspec), G_TYPE_PARAM_UINT64, GParamSpecUInt64))
242
243 /**
244  * G_TYPE_PARAM_UNICHAR:
245  * 
246  * The #GType of #GParamSpecUnichar.
247  */
248 #define G_TYPE_PARAM_UNICHAR               (g_param_spec_types[9])
249 /**
250  * G_PARAM_SPEC_UNICHAR:
251  * @pspec: a valid #GParamSpec instance
252  * 
253  * Cast a #GParamSpec instance into a #GParamSpecUnichar.
254  */
255 #define G_PARAM_SPEC_UNICHAR(pspec)        (G_TYPE_CHECK_INSTANCE_CAST ((pspec), G_TYPE_PARAM_UNICHAR, GParamSpecUnichar))
256 /**
257  * G_IS_PARAM_SPEC_UNICHAR:
258  * @pspec: a valid #GParamSpec instance
259  * 
260  * Checks whether the given #GParamSpec is of type %G_TYPE_PARAM_UNICHAR.
261  * 
262  * Returns: %TRUE on success.
263  */
264 #define G_IS_PARAM_SPEC_UNICHAR(pspec)     (G_TYPE_CHECK_INSTANCE_TYPE ((pspec), G_TYPE_PARAM_UNICHAR))
265
266 /**
267  * G_TYPE_PARAM_ENUM:
268  * 
269  * The #GType of #GParamSpecEnum.
270  */
271 #define G_TYPE_PARAM_ENUM                  (g_param_spec_types[10])
272 /**
273  * G_IS_PARAM_SPEC_ENUM:
274  * @pspec: a valid #GParamSpec instance
275  * 
276  * Checks whether the given #GParamSpec is of type %G_TYPE_PARAM_ENUM.
277  * 
278  * Returns: %TRUE on success.
279  */
280 #define G_IS_PARAM_SPEC_ENUM(pspec)        (G_TYPE_CHECK_INSTANCE_TYPE ((pspec), G_TYPE_PARAM_ENUM))
281 /**
282  * G_PARAM_SPEC_ENUM:
283  * @pspec: a valid #GParamSpec instance
284  * 
285  * Cast a #GParamSpec instance into a #GParamSpecEnum.
286  */
287 #define G_PARAM_SPEC_ENUM(pspec)           (G_TYPE_CHECK_INSTANCE_CAST ((pspec), G_TYPE_PARAM_ENUM, GParamSpecEnum))
288
289 /**
290  * G_TYPE_PARAM_FLAGS:
291  * 
292  * The #GType of #GParamSpecFlags.
293  */
294 #define G_TYPE_PARAM_FLAGS                 (g_param_spec_types[11])
295 /**
296  * G_IS_PARAM_SPEC_FLAGS:
297  * @pspec: a valid #GParamSpec instance
298  * 
299  * Checks whether the given #GParamSpec is of type %G_TYPE_PARAM_FLAGS.
300  * 
301  * Returns: %TRUE on success.
302  */
303 #define G_IS_PARAM_SPEC_FLAGS(pspec)       (G_TYPE_CHECK_INSTANCE_TYPE ((pspec), G_TYPE_PARAM_FLAGS))
304 /**
305  * G_PARAM_SPEC_FLAGS:
306  * @pspec: a valid #GParamSpec instance
307  * 
308  * Cast a #GParamSpec instance into a #GParamSpecFlags.
309  */
310 #define G_PARAM_SPEC_FLAGS(pspec)          (G_TYPE_CHECK_INSTANCE_CAST ((pspec), G_TYPE_PARAM_FLAGS, GParamSpecFlags))
311
312 /**
313  * G_TYPE_PARAM_FLOAT:
314  * 
315  * The #GType of #GParamSpecFloat.
316  */
317 #define G_TYPE_PARAM_FLOAT                 (g_param_spec_types[12])
318 /**
319  * G_IS_PARAM_SPEC_FLOAT:
320  * @pspec: a valid #GParamSpec instance
321  * 
322  * Checks whether the given #GParamSpec is of type %G_TYPE_PARAM_FLOAT.
323  * 
324  * Returns: %TRUE on success.
325  */
326 #define G_IS_PARAM_SPEC_FLOAT(pspec)       (G_TYPE_CHECK_INSTANCE_TYPE ((pspec), G_TYPE_PARAM_FLOAT))
327 /**
328  * G_PARAM_SPEC_FLOAT:
329  * @pspec: a valid #GParamSpec instance
330  * 
331  * Cast a #GParamSpec instance into a #GParamSpecFloat.
332  */
333 #define G_PARAM_SPEC_FLOAT(pspec)          (G_TYPE_CHECK_INSTANCE_CAST ((pspec), G_TYPE_PARAM_FLOAT, GParamSpecFloat))
334
335 /**
336  * G_TYPE_PARAM_DOUBLE:
337  * 
338  * The #GType of #GParamSpecDouble.
339  */
340 #define G_TYPE_PARAM_DOUBLE                (g_param_spec_types[13])
341 /**
342  * G_IS_PARAM_SPEC_DOUBLE:
343  * @pspec: a valid #GParamSpec instance
344  * 
345  * Checks whether the given #GParamSpec is of type %G_TYPE_PARAM_DOUBLE.
346  * 
347  * Returns: %TRUE on success.
348  */
349 #define G_IS_PARAM_SPEC_DOUBLE(pspec)      (G_TYPE_CHECK_INSTANCE_TYPE ((pspec), G_TYPE_PARAM_DOUBLE))
350 /**
351  * G_PARAM_SPEC_DOUBLE:
352  * @pspec: a valid #GParamSpec instance
353  * 
354  * Cast a #GParamSpec instance into a #GParamSpecDouble.
355  */
356 #define G_PARAM_SPEC_DOUBLE(pspec)         (G_TYPE_CHECK_INSTANCE_CAST ((pspec), G_TYPE_PARAM_DOUBLE, GParamSpecDouble))
357
358 /**
359  * G_TYPE_PARAM_STRING:
360  * 
361  * The #GType of #GParamSpecString.
362  */
363 #define G_TYPE_PARAM_STRING                (g_param_spec_types[14])
364 /**
365  * G_IS_PARAM_SPEC_STRING:
366  * @pspec: a valid #GParamSpec instance
367  * 
368  * Checks whether the given #GParamSpec is of type %G_TYPE_PARAM_STRING.
369  * 
370  * Returns: %TRUE on success.
371  */
372 #define G_IS_PARAM_SPEC_STRING(pspec)      (G_TYPE_CHECK_INSTANCE_TYPE ((pspec), G_TYPE_PARAM_STRING))
373 /**
374  * G_PARAM_SPEC_STRING:
375  * @pspec: a valid #GParamSpec instance
376  * 
377  * Casts a #GParamSpec instance into a #GParamSpecString.
378  */
379 #define G_PARAM_SPEC_STRING(pspec)         (G_TYPE_CHECK_INSTANCE_CAST ((pspec), G_TYPE_PARAM_STRING, GParamSpecString))
380
381 /**
382  * G_TYPE_PARAM_PARAM:
383  * 
384  * The #GType of #GParamSpecParam.
385  */
386 #define G_TYPE_PARAM_PARAM                 (g_param_spec_types[15])
387 /**
388  * G_IS_PARAM_SPEC_PARAM:
389  * @pspec: a valid #GParamSpec instance
390  * 
391  * Checks whether the given #GParamSpec is of type %G_TYPE_PARAM_PARAM.
392  * 
393  * Returns: %TRUE on success.
394  */
395 #define G_IS_PARAM_SPEC_PARAM(pspec)       (G_TYPE_CHECK_INSTANCE_TYPE ((pspec), G_TYPE_PARAM_PARAM))
396 /**
397  * G_PARAM_SPEC_PARAM:
398  * @pspec: a valid #GParamSpec instance
399  * 
400  * Casts a #GParamSpec instance into a #GParamSpecParam.
401  */
402 #define G_PARAM_SPEC_PARAM(pspec)          (G_TYPE_CHECK_INSTANCE_CAST ((pspec), G_TYPE_PARAM_PARAM, GParamSpecParam))
403
404 /**
405  * G_TYPE_PARAM_BOXED:
406  * 
407  * The #GType of #GParamSpecBoxed.
408  */
409 #define G_TYPE_PARAM_BOXED                 (g_param_spec_types[16])
410 /**
411  * G_IS_PARAM_SPEC_BOXED:
412  * @pspec: a valid #GParamSpec instance
413  * 
414  * Checks whether the given #GParamSpec is of type %G_TYPE_PARAM_BOXED.
415  * 
416  * Returns: %TRUE on success.
417  */
418 #define G_IS_PARAM_SPEC_BOXED(pspec)       (G_TYPE_CHECK_INSTANCE_TYPE ((pspec), G_TYPE_PARAM_BOXED))
419 /**
420  * G_PARAM_SPEC_BOXED:
421  * @pspec: a valid #GParamSpec instance
422  * 
423  * Cast a #GParamSpec instance into a #GParamSpecBoxed.
424  */
425 #define G_PARAM_SPEC_BOXED(pspec)          (G_TYPE_CHECK_INSTANCE_CAST ((pspec), G_TYPE_PARAM_BOXED, GParamSpecBoxed))
426
427 /**
428  * G_TYPE_PARAM_POINTER:
429  * 
430  * The #GType of #GParamSpecPointer.
431  */
432 #define G_TYPE_PARAM_POINTER               (g_param_spec_types[17])
433 /**
434  * G_IS_PARAM_SPEC_POINTER:
435  * @pspec: a valid #GParamSpec instance
436  * 
437  * Checks whether the given #GParamSpec is of type %G_TYPE_PARAM_POINTER.
438  * 
439  * Returns: %TRUE on success.
440  */
441 #define G_IS_PARAM_SPEC_POINTER(pspec)     (G_TYPE_CHECK_INSTANCE_TYPE ((pspec), G_TYPE_PARAM_POINTER))
442 /**
443  * G_PARAM_SPEC_POINTER:
444  * @pspec: a valid #GParamSpec instance
445  * 
446  * Casts a #GParamSpec instance into a #GParamSpecPointer.
447  */
448 #define G_PARAM_SPEC_POINTER(pspec)        (G_TYPE_CHECK_INSTANCE_CAST ((pspec), G_TYPE_PARAM_POINTER, GParamSpecPointer))
449
450 /**
451  * G_TYPE_PARAM_VALUE_ARRAY:
452  * 
453  * The #GType of #GParamSpecValueArray.
454  *
455  * Deprecated: 2.32: Use #GArray instead of #GValueArray
456  */
457 #define G_TYPE_PARAM_VALUE_ARRAY           (g_param_spec_types[18])
458 /**
459  * G_IS_PARAM_SPEC_VALUE_ARRAY:
460  * @pspec: a valid #GParamSpec instance
461  * 
462  * Checks whether the given #GParamSpec is of type %G_TYPE_PARAM_VALUE_ARRAY.
463  * 
464  * Returns: %TRUE on success.
465  *
466  * Deprecated: 2.32: Use #GArray instead of #GValueArray
467  */
468 #define G_IS_PARAM_SPEC_VALUE_ARRAY(pspec) (G_TYPE_CHECK_INSTANCE_TYPE ((pspec), G_TYPE_PARAM_VALUE_ARRAY))
469 /**
470  * G_PARAM_SPEC_VALUE_ARRAY:
471  * @pspec: a valid #GParamSpec instance
472  * 
473  * Cast a #GParamSpec instance into a #GParamSpecValueArray.
474  *
475  * Deprecated: 2.32: Use #GArray instead of #GValueArray
476  */
477 #define G_PARAM_SPEC_VALUE_ARRAY(pspec)    (G_TYPE_CHECK_INSTANCE_CAST ((pspec), G_TYPE_PARAM_VALUE_ARRAY, GParamSpecValueArray))
478
479 /**
480  * G_TYPE_PARAM_OBJECT:
481  * 
482  * The #GType of #GParamSpecObject.
483  */
484 #define G_TYPE_PARAM_OBJECT                (g_param_spec_types[19])
485 /**
486  * G_IS_PARAM_SPEC_OBJECT:
487  * @pspec: a valid #GParamSpec instance
488  * 
489  * Checks whether the given #GParamSpec is of type %G_TYPE_PARAM_OBJECT.
490  * 
491  * Returns: %TRUE on success.
492  */
493 #define G_IS_PARAM_SPEC_OBJECT(pspec)      (G_TYPE_CHECK_INSTANCE_TYPE ((pspec), G_TYPE_PARAM_OBJECT))
494 /**
495  * G_PARAM_SPEC_OBJECT:
496  * @pspec: a valid #GParamSpec instance
497  * 
498  * Casts a #GParamSpec instance into a #GParamSpecObject.
499  */
500 #define G_PARAM_SPEC_OBJECT(pspec)         (G_TYPE_CHECK_INSTANCE_CAST ((pspec), G_TYPE_PARAM_OBJECT, GParamSpecObject))
501
502 /**
503  * G_TYPE_PARAM_OVERRIDE:
504  * 
505  * The #GType of #GParamSpecOverride.
506  * 
507  * Since: 2.4
508  */
509 #define G_TYPE_PARAM_OVERRIDE              (g_param_spec_types[20])
510 /**
511  * G_IS_PARAM_SPEC_OVERRIDE:
512  * @pspec: a #GParamSpec
513  * 
514  * Checks whether the given #GParamSpec is of type %G_TYPE_PARAM_OVERRIDE.
515  * 
516  * Since: 2.4
517  * Returns: %TRUE on success.
518  */
519 #define G_IS_PARAM_SPEC_OVERRIDE(pspec)    (G_TYPE_CHECK_INSTANCE_TYPE ((pspec), G_TYPE_PARAM_OVERRIDE))
520 /**
521  * G_PARAM_SPEC_OVERRIDE:
522  * @pspec: a #GParamSpec
523  * 
524  * Casts a #GParamSpec into a #GParamSpecOverride.
525  * 
526  * Since: 2.4
527  */
528 #define G_PARAM_SPEC_OVERRIDE(pspec)       (G_TYPE_CHECK_INSTANCE_CAST ((pspec), G_TYPE_PARAM_OVERRIDE, GParamSpecOverride))
529
530 /**
531  * G_TYPE_PARAM_GTYPE:
532  * 
533  * The #GType of #GParamSpecGType.
534  * 
535  * Since: 2.10
536  */
537 #define G_TYPE_PARAM_GTYPE                 (g_param_spec_types[21])
538 /**
539  * G_IS_PARAM_SPEC_GTYPE:
540  * @pspec: a #GParamSpec
541  * 
542  * Checks whether the given #GParamSpec is of type %G_TYPE_PARAM_GTYPE.
543  * 
544  * Since: 2.10
545  * Returns: %TRUE on success. 
546  */
547 #define G_IS_PARAM_SPEC_GTYPE(pspec)       (G_TYPE_CHECK_INSTANCE_TYPE ((pspec), G_TYPE_PARAM_GTYPE))
548 /**
549  * G_PARAM_SPEC_GTYPE:
550  * @pspec: a #GParamSpec
551  * 
552  * Casts a #GParamSpec into a #GParamSpecGType.
553  * 
554  * Since: 2.10
555  */
556 #define G_PARAM_SPEC_GTYPE(pspec)          (G_TYPE_CHECK_INSTANCE_CAST ((pspec), G_TYPE_PARAM_GTYPE, GParamSpecGType))
557
558 /**
559  * G_TYPE_PARAM_VARIANT:
560  *
561  * The #GType of #GParamSpecVariant.
562  *
563  * Since: 2.26
564  */
565 #define G_TYPE_PARAM_VARIANT                (g_param_spec_types[22])
566 /**
567  * G_IS_PARAM_SPEC_VARIANT:
568  * @pspec: a #GParamSpec
569  *
570  * Checks whether the given #GParamSpec is of type %G_TYPE_PARAM_VARIANT.
571  *
572  * Returns: %TRUE on success
573  *
574  * Since: 2.26
575  */
576 #define G_IS_PARAM_SPEC_VARIANT(pspec)      (G_TYPE_CHECK_INSTANCE_TYPE ((pspec), G_TYPE_PARAM_VARIANT))
577 /**
578  * G_PARAM_SPEC_VARIANT:
579  * @pspec: a #GParamSpec
580  *
581  * Casts a #GParamSpec into a #GParamSpecVariant.
582  *
583  * Since: 2.26
584  */
585 #define G_PARAM_SPEC_VARIANT(pspec)         (G_TYPE_CHECK_INSTANCE_CAST ((pspec), G_TYPE_PARAM_VARIANT, GParamSpecVariant))
586
587 /* --- typedefs & structures --- */
588 typedef struct _GParamSpecChar       GParamSpecChar;
589 typedef struct _GParamSpecUChar      GParamSpecUChar;
590 typedef struct _GParamSpecBoolean    GParamSpecBoolean;
591 typedef struct _GParamSpecInt        GParamSpecInt;
592 typedef struct _GParamSpecUInt       GParamSpecUInt;
593 typedef struct _GParamSpecLong       GParamSpecLong;
594 typedef struct _GParamSpecULong      GParamSpecULong;
595 typedef struct _GParamSpecInt64      GParamSpecInt64;
596 typedef struct _GParamSpecUInt64     GParamSpecUInt64;
597 typedef struct _GParamSpecUnichar    GParamSpecUnichar;
598 typedef struct _GParamSpecEnum       GParamSpecEnum;
599 typedef struct _GParamSpecFlags      GParamSpecFlags;
600 typedef struct _GParamSpecFloat      GParamSpecFloat;
601 typedef struct _GParamSpecDouble     GParamSpecDouble;
602 typedef struct _GParamSpecString     GParamSpecString;
603 typedef struct _GParamSpecParam      GParamSpecParam;
604 typedef struct _GParamSpecBoxed      GParamSpecBoxed;
605 typedef struct _GParamSpecPointer    GParamSpecPointer;
606 typedef struct _GParamSpecValueArray GParamSpecValueArray;
607 typedef struct _GParamSpecObject     GParamSpecObject;
608 typedef struct _GParamSpecOverride   GParamSpecOverride;
609 typedef struct _GParamSpecGType      GParamSpecGType;
610 typedef struct _GParamSpecVariant    GParamSpecVariant;
611
612 /**
613  * GParamSpecChar:
614  * @parent_instance: private #GParamSpec portion
615  * @minimum: minimum value for the property specified
616  * @maximum: maximum value for the property specified
617  * @default_value: default value for the property specified
618  * 
619  * A #GParamSpec derived structure that contains the meta data for character properties.
620  */
621 struct _GParamSpecChar
622 {
623   GParamSpec    parent_instance;
624   
625   gint8         minimum;
626   gint8         maximum;
627   gint8         default_value;
628 };
629 /**
630  * GParamSpecUChar:
631  * @parent_instance: private #GParamSpec portion
632  * @minimum: minimum value for the property specified
633  * @maximum: maximum value for the property specified
634  * @default_value: default value for the property specified
635  * 
636  * A #GParamSpec derived structure that contains the meta data for unsigned character properties.
637  */
638 struct _GParamSpecUChar
639 {
640   GParamSpec    parent_instance;
641   
642   guint8        minimum;
643   guint8        maximum;
644   guint8        default_value;
645 };
646 /**
647  * GParamSpecBoolean:
648  * @parent_instance: private #GParamSpec portion
649  * @default_value: default value for the property specified
650  * 
651  * A #GParamSpec derived structure that contains the meta data for boolean properties.
652  */
653 struct _GParamSpecBoolean
654 {
655   GParamSpec    parent_instance;
656   
657   gboolean      default_value;
658 };
659 /**
660  * GParamSpecInt:
661  * @parent_instance: private #GParamSpec portion
662  * @minimum: minimum value for the property specified
663  * @maximum: maximum value for the property specified
664  * @default_value: default value for the property specified
665  * 
666  * A #GParamSpec derived structure that contains the meta data for integer properties.
667  */
668 struct _GParamSpecInt
669 {
670   GParamSpec    parent_instance;
671   
672   gint          minimum;
673   gint          maximum;
674   gint          default_value;
675 };
676 /**
677  * GParamSpecUInt:
678  * @parent_instance: private #GParamSpec portion
679  * @minimum: minimum value for the property specified
680  * @maximum: maximum value for the property specified
681  * @default_value: default value for the property specified
682  * 
683  * A #GParamSpec derived structure that contains the meta data for unsigned integer properties.
684  */
685 struct _GParamSpecUInt
686 {
687   GParamSpec    parent_instance;
688   
689   guint         minimum;
690   guint         maximum;
691   guint         default_value;
692 };
693 /**
694  * GParamSpecLong:
695  * @parent_instance: private #GParamSpec portion
696  * @minimum: minimum value for the property specified
697  * @maximum: maximum value for the property specified
698  * @default_value: default value for the property specified
699  * 
700  * A #GParamSpec derived structure that contains the meta data for long integer properties.
701  */
702 struct _GParamSpecLong
703 {
704   GParamSpec    parent_instance;
705   
706   glong         minimum;
707   glong         maximum;
708   glong         default_value;
709 };
710 /**
711  * GParamSpecULong:
712  * @parent_instance: private #GParamSpec portion
713  * @minimum: minimum value for the property specified
714  * @maximum: maximum value for the property specified
715  * @default_value: default value for the property specified
716  * 
717  * A #GParamSpec derived structure that contains the meta data for unsigned long integer properties.
718  */
719 struct _GParamSpecULong
720 {
721   GParamSpec    parent_instance;
722   
723   gulong        minimum;
724   gulong        maximum;
725   gulong        default_value;
726 };
727 /**
728  * GParamSpecInt64:
729  * @parent_instance: private #GParamSpec portion
730  * @minimum: minimum value for the property specified
731  * @maximum: maximum value for the property specified
732  * @default_value: default value for the property specified
733  * 
734  * A #GParamSpec derived structure that contains the meta data for 64bit integer properties.
735  */
736 struct _GParamSpecInt64
737 {
738   GParamSpec    parent_instance;
739   
740   gint64        minimum;
741   gint64        maximum;
742   gint64        default_value;
743 };
744 /**
745  * GParamSpecUInt64:
746  * @parent_instance: private #GParamSpec portion
747  * @minimum: minimum value for the property specified
748  * @maximum: maximum value for the property specified
749  * @default_value: default value for the property specified
750  * 
751  * A #GParamSpec derived structure that contains the meta data for unsigned 64bit integer properties.
752  */
753 struct _GParamSpecUInt64
754 {
755   GParamSpec    parent_instance;
756   
757   guint64       minimum;
758   guint64       maximum;
759   guint64       default_value;
760 };
761 /**
762  * GParamSpecUnichar:
763  * @parent_instance: private #GParamSpec portion
764  * @default_value: default value for the property specified
765  * 
766  * A #GParamSpec derived structure that contains the meta data for unichar (unsigned integer) properties.
767  */
768 struct _GParamSpecUnichar
769 {
770   GParamSpec    parent_instance;
771   
772   gunichar      default_value;
773 };
774 /**
775  * GParamSpecEnum:
776  * @parent_instance: private #GParamSpec portion
777  * @enum_class: the #GEnumClass for the enum
778  * @default_value: default value for the property specified
779  * 
780  * A #GParamSpec derived structure that contains the meta data for enum 
781  * properties.
782  */
783 struct _GParamSpecEnum
784 {
785   GParamSpec    parent_instance;
786   
787   GEnumClass   *enum_class;
788   gint          default_value;
789 };
790 /**
791  * GParamSpecFlags:
792  * @parent_instance: private #GParamSpec portion
793  * @flags_class: the #GFlagsClass for the flags
794  * @default_value: default value for the property specified
795  * 
796  * A #GParamSpec derived structure that contains the meta data for flags
797  * properties.
798  */
799 struct _GParamSpecFlags
800 {
801   GParamSpec    parent_instance;
802   
803   GFlagsClass  *flags_class;
804   guint         default_value;
805 };
806 /**
807  * GParamSpecFloat:
808  * @parent_instance: private #GParamSpec portion
809  * @minimum: minimum value for the property specified
810  * @maximum: maximum value for the property specified
811  * @default_value: default value for the property specified
812  * @epsilon: values closer than @epsilon will be considered identical
813  *  by g_param_values_cmp(); the default value is 1e-30.
814  * 
815  * A #GParamSpec derived structure that contains the meta data for float properties.
816  */
817 struct _GParamSpecFloat
818 {
819   GParamSpec    parent_instance;
820   
821   gfloat        minimum;
822   gfloat        maximum;
823   gfloat        default_value;
824   gfloat        epsilon;
825 };
826 /**
827  * GParamSpecDouble:
828  * @parent_instance: private #GParamSpec portion
829  * @minimum: minimum value for the property specified
830  * @maximum: maximum value for the property specified
831  * @default_value: default value for the property specified
832  * @epsilon: values closer than @epsilon will be considered identical
833  *  by g_param_values_cmp(); the default value is 1e-90.
834  * 
835  * A #GParamSpec derived structure that contains the meta data for double properties.
836  */
837 struct _GParamSpecDouble
838 {
839   GParamSpec    parent_instance;
840   
841   gdouble       minimum;
842   gdouble       maximum;
843   gdouble       default_value;
844   gdouble       epsilon;
845 };
846 /**
847  * GParamSpecString:
848  * @parent_instance: private #GParamSpec portion
849  * @default_value: default value for the property specified
850  * @cset_first: a string containing the allowed values for the first byte
851  * @cset_nth: a string containing the allowed values for the subsequent bytes
852  * @substitutor: the replacement byte for bytes which don't match @cset_first or @cset_nth.
853  * @null_fold_if_empty: replace empty string by %NULL
854  * @ensure_non_null: replace %NULL strings by an empty string
855  * 
856  * A #GParamSpec derived structure that contains the meta data for string
857  * properties.
858  */
859 struct _GParamSpecString
860 {
861   GParamSpec    parent_instance;
862   
863   gchar        *default_value;
864   gchar        *cset_first;
865   gchar        *cset_nth;
866   gchar         substitutor;
867   guint         null_fold_if_empty : 1;
868   guint         ensure_non_null : 1;
869 };
870 /**
871  * GParamSpecParam:
872  * @parent_instance: private #GParamSpec portion
873  * 
874  * A #GParamSpec derived structure that contains the meta data for %G_TYPE_PARAM
875  * properties.
876  */
877 struct _GParamSpecParam
878 {
879   GParamSpec    parent_instance;
880 };
881 /**
882  * GParamSpecBoxed:
883  * @parent_instance: private #GParamSpec portion
884  * 
885  * A #GParamSpec derived structure that contains the meta data for boxed properties.
886  */
887 struct _GParamSpecBoxed
888 {
889   GParamSpec    parent_instance;
890 };
891 /**
892  * GParamSpecPointer:
893  * @parent_instance: private #GParamSpec portion
894  * 
895  * A #GParamSpec derived structure that contains the meta data for pointer properties.
896  */
897 struct _GParamSpecPointer
898 {
899   GParamSpec    parent_instance;
900 };
901 /**
902  * GParamSpecValueArray:
903  * @parent_instance: private #GParamSpec portion
904  * @element_spec: a #GParamSpec describing the elements contained in arrays of this property, may be %NULL
905  * @fixed_n_elements: if greater than 0, arrays of this property will always have this many elements
906  * 
907  * A #GParamSpec derived structure that contains the meta data for #GValueArray properties.
908  */
909 struct _GParamSpecValueArray
910 {
911   GParamSpec    parent_instance;
912   GParamSpec   *element_spec;
913   guint         fixed_n_elements;
914 };
915 /**
916  * GParamSpecObject:
917  * @parent_instance: private #GParamSpec portion
918  * 
919  * A #GParamSpec derived structure that contains the meta data for object properties.
920  */
921 struct _GParamSpecObject
922 {
923   GParamSpec    parent_instance;
924 };
925 /**
926  * GParamSpecOverride:
927  * 
928  * This is a type of #GParamSpec type that simply redirects operations to
929  * another paramspec.  All operations other than getting or
930  * setting the value are redirected, including accessing the nick and
931  * blurb, validating a value, and so forth. See
932  * g_param_spec_get_redirect_target() for retrieving the overidden
933  * property. #GParamSpecOverride is used in implementing
934  * g_object_class_override_property(), and will not be directly useful
935  * unless you are implementing a new base type similar to GObject.
936  * 
937  * Since: 2.4
938  */
939 struct _GParamSpecOverride
940 {
941   /*< private >*/
942   GParamSpec    parent_instance;
943   GParamSpec   *overridden;
944 };
945 /**
946  * GParamSpecGType:
947  * @parent_instance: private #GParamSpec portion
948  * @is_a_type: a #GType whose subtypes can occur as values
949  * 
950  * A #GParamSpec derived structure that contains the meta data for #GType properties.
951  * 
952  * Since: 2.10
953  */
954 struct _GParamSpecGType
955 {
956   GParamSpec    parent_instance;
957   GType         is_a_type;
958 };
959 /**
960  * GParamSpecVariant:
961  * @parent_instance: private #GParamSpec portion
962  * @type: a #GVariantType, or %NULL
963  * @default_value: a #GVariant, or %NULL
964  *
965  * A #GParamSpec derived structure that contains the meta data for #GVariant properties.
966  *
967  * Since: 2.26
968  */
969 struct _GParamSpecVariant
970 {
971   GParamSpec    parent_instance;
972   GVariantType *type;
973   GVariant     *default_value;
974
975   /*< private >*/
976   gpointer      padding[4];
977 };
978
979 /* --- GParamSpec prototypes --- */
980 GLIB_AVAILABLE_IN_ALL
981 GParamSpec*     g_param_spec_char        (const gchar    *name,
982                                           const gchar    *nick,
983                                           const gchar    *blurb,
984                                           gint8           minimum,
985                                           gint8           maximum,
986                                           gint8           default_value,
987                                           GParamFlags     flags);
988 GLIB_AVAILABLE_IN_ALL
989 GParamSpec*     g_param_spec_uchar       (const gchar    *name,
990                                           const gchar    *nick,
991                                           const gchar    *blurb,
992                                           guint8          minimum,
993                                           guint8          maximum,
994                                           guint8          default_value,
995                                           GParamFlags     flags);
996 GLIB_AVAILABLE_IN_ALL
997 GParamSpec*     g_param_spec_boolean     (const gchar    *name,
998                                           const gchar    *nick,
999                                           const gchar    *blurb,
1000                                           gboolean        default_value,
1001                                           GParamFlags     flags);
1002 GLIB_AVAILABLE_IN_ALL
1003 GParamSpec*     g_param_spec_int         (const gchar    *name,
1004                                           const gchar    *nick,
1005                                           const gchar    *blurb,
1006                                           gint            minimum,
1007                                           gint            maximum,
1008                                           gint            default_value,
1009                                           GParamFlags     flags);
1010 GLIB_AVAILABLE_IN_ALL
1011 GParamSpec*     g_param_spec_uint        (const gchar    *name,
1012                                           const gchar    *nick,
1013                                           const gchar    *blurb,
1014                                           guint           minimum,
1015                                           guint           maximum,
1016                                           guint           default_value,
1017                                           GParamFlags     flags);
1018 GLIB_AVAILABLE_IN_ALL
1019 GParamSpec*     g_param_spec_long        (const gchar    *name,
1020                                           const gchar    *nick,
1021                                           const gchar    *blurb,
1022                                           glong           minimum,
1023                                           glong           maximum,
1024                                           glong           default_value,
1025                                           GParamFlags     flags);
1026 GLIB_AVAILABLE_IN_ALL
1027 GParamSpec*     g_param_spec_ulong       (const gchar    *name,
1028                                           const gchar    *nick,
1029                                           const gchar    *blurb,
1030                                           gulong          minimum,
1031                                           gulong          maximum,
1032                                           gulong          default_value,
1033                                           GParamFlags     flags);
1034 GLIB_AVAILABLE_IN_ALL
1035 GParamSpec*     g_param_spec_int64       (const gchar    *name,
1036                                           const gchar    *nick,
1037                                           const gchar    *blurb,
1038                                           gint64          minimum,
1039                                           gint64          maximum,
1040                                           gint64          default_value,
1041                                           GParamFlags     flags);
1042 GLIB_AVAILABLE_IN_ALL
1043 GParamSpec*     g_param_spec_uint64      (const gchar    *name,
1044                                           const gchar    *nick,
1045                                           const gchar    *blurb,
1046                                           guint64         minimum,
1047                                           guint64         maximum,
1048                                           guint64         default_value,
1049                                           GParamFlags     flags);
1050 GLIB_AVAILABLE_IN_ALL
1051 GParamSpec*     g_param_spec_unichar      (const gchar    *name,
1052                                           const gchar    *nick,
1053                                           const gchar    *blurb,
1054                                           gunichar        default_value,
1055                                           GParamFlags     flags);
1056 GLIB_AVAILABLE_IN_ALL
1057 GParamSpec*     g_param_spec_enum        (const gchar    *name,
1058                                           const gchar    *nick,
1059                                           const gchar    *blurb,
1060                                           GType           enum_type,
1061                                           gint            default_value,
1062                                           GParamFlags     flags);
1063 GLIB_AVAILABLE_IN_ALL
1064 GParamSpec*     g_param_spec_flags       (const gchar    *name,
1065                                           const gchar    *nick,
1066                                           const gchar    *blurb,
1067                                           GType           flags_type,
1068                                           guint           default_value,
1069                                           GParamFlags     flags);
1070 GLIB_AVAILABLE_IN_ALL
1071 GParamSpec*     g_param_spec_float       (const gchar    *name,
1072                                           const gchar    *nick,
1073                                           const gchar    *blurb,
1074                                           gfloat          minimum,
1075                                           gfloat          maximum,
1076                                           gfloat          default_value,
1077                                           GParamFlags     flags);
1078 GLIB_AVAILABLE_IN_ALL
1079 GParamSpec*     g_param_spec_double      (const gchar    *name,
1080                                           const gchar    *nick,
1081                                           const gchar    *blurb,
1082                                           gdouble         minimum,
1083                                           gdouble         maximum,
1084                                           gdouble         default_value,
1085                                           GParamFlags     flags);
1086 GLIB_AVAILABLE_IN_ALL
1087 GParamSpec*     g_param_spec_string      (const gchar    *name,
1088                                           const gchar    *nick,
1089                                           const gchar    *blurb,
1090                                           const gchar    *default_value,
1091                                           GParamFlags     flags);
1092 GLIB_AVAILABLE_IN_ALL
1093 GParamSpec*     g_param_spec_param       (const gchar    *name,
1094                                           const gchar    *nick,
1095                                           const gchar    *blurb,
1096                                           GType           param_type,
1097                                           GParamFlags     flags);
1098 GLIB_AVAILABLE_IN_ALL
1099 GParamSpec*     g_param_spec_boxed       (const gchar    *name,
1100                                           const gchar    *nick,
1101                                           const gchar    *blurb,
1102                                           GType           boxed_type,
1103                                           GParamFlags     flags);
1104 GLIB_AVAILABLE_IN_ALL
1105 GParamSpec*     g_param_spec_pointer     (const gchar    *name,
1106                                           const gchar    *nick,
1107                                           const gchar    *blurb,
1108                                           GParamFlags     flags);
1109 GLIB_AVAILABLE_IN_ALL
1110 GParamSpec*     g_param_spec_value_array (const gchar    *name,
1111                                           const gchar    *nick,
1112                                           const gchar    *blurb,
1113                                           GParamSpec     *element_spec,
1114                                           GParamFlags     flags);
1115 GLIB_AVAILABLE_IN_ALL
1116 GParamSpec*     g_param_spec_object      (const gchar    *name,
1117                                           const gchar    *nick,
1118                                           const gchar    *blurb,
1119                                           GType           object_type,
1120                                           GParamFlags     flags);
1121 GLIB_AVAILABLE_IN_ALL
1122 GParamSpec*     g_param_spec_override    (const gchar    *name,
1123                                           GParamSpec     *overridden);
1124 GLIB_AVAILABLE_IN_ALL
1125 GParamSpec*     g_param_spec_gtype       (const gchar    *name,
1126                                           const gchar    *nick,
1127                                           const gchar    *blurb,
1128                                           GType           is_a_type,
1129                                           GParamFlags     flags);
1130 GLIB_AVAILABLE_IN_ALL
1131 GParamSpec*     g_param_spec_variant     (const gchar        *name,
1132                                           const gchar        *nick,
1133                                           const gchar        *blurb,
1134                                           const GVariantType *type,
1135                                           GVariant           *default_value,
1136                                           GParamFlags         flags);
1137
1138 /* --- internal --- */
1139 /* We prefix variable declarations so they can
1140  * properly get exported in windows dlls.
1141  */
1142 #ifndef GOBJECT_VAR
1143 #  ifdef G_PLATFORM_WIN32
1144 #    ifdef GOBJECT_STATIC_COMPILATION
1145 #      define GOBJECT_VAR extern
1146 #    else /* !GOBJECT_STATIC_COMPILATION */
1147 #      ifdef GOBJECT_COMPILATION
1148 #        ifdef DLL_EXPORT
1149 #          define GOBJECT_VAR __declspec(dllexport)
1150 #        else /* !DLL_EXPORT */
1151 #          define GOBJECT_VAR extern
1152 #        endif /* !DLL_EXPORT */
1153 #      else /* !GOBJECT_COMPILATION */
1154 #        define GOBJECT_VAR extern __declspec(dllimport)
1155 #      endif /* !GOBJECT_COMPILATION */
1156 #    endif /* !GOBJECT_STATIC_COMPILATION */
1157 #  else /* !G_PLATFORM_WIN32 */
1158 #    define GOBJECT_VAR extern
1159 #  endif /* !G_PLATFORM_WIN32 */
1160 #endif /* GOBJECT_VAR */
1161
1162 GOBJECT_VAR GType *g_param_spec_types;
1163
1164 G_END_DECLS
1165
1166 #endif /* __G_PARAMSPECS_H__ */