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

source code of include/glib-2.0/gobject/gparamspecs.h