1/* GObject - GLib Type, Object, Parameter and Signal Library
2 * Copyright (C) 1997-1999, 2000-2001 Tim Janik and Red Hat, Inc.
3 *
4 * SPDX-License-Identifier: LGPL-2.1-or-later
5 *
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
10 *
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
15 *
16 * You should have received a copy of the GNU Lesser General
17 * Public License along with this library; if not, see <http://www.gnu.org/licenses/>.
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
33G_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]) GOBJECT_DEPRECATED_MACRO_IN_2_32
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)) GOBJECT_DEPRECATED_MACRO_IN_2_32
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)) GOBJECT_DEPRECATED_MACRO_IN_2_32
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 --- */
588typedef struct _GParamSpecChar GParamSpecChar;
589typedef struct _GParamSpecUChar GParamSpecUChar;
590typedef struct _GParamSpecBoolean GParamSpecBoolean;
591typedef struct _GParamSpecInt GParamSpecInt;
592typedef struct _GParamSpecUInt GParamSpecUInt;
593typedef struct _GParamSpecLong GParamSpecLong;
594typedef struct _GParamSpecULong GParamSpecULong;
595typedef struct _GParamSpecInt64 GParamSpecInt64;
596typedef struct _GParamSpecUInt64 GParamSpecUInt64;
597typedef struct _GParamSpecUnichar GParamSpecUnichar;
598typedef struct _GParamSpecEnum GParamSpecEnum;
599typedef struct _GParamSpecFlags GParamSpecFlags;
600typedef struct _GParamSpecFloat GParamSpecFloat;
601typedef struct _GParamSpecDouble GParamSpecDouble;
602typedef struct _GParamSpecString GParamSpecString;
603typedef struct _GParamSpecParam GParamSpecParam;
604typedef struct _GParamSpecBoxed GParamSpecBoxed;
605typedef struct _GParamSpecPointer GParamSpecPointer;
606typedef struct _GParamSpecValueArray GParamSpecValueArray;
607typedef struct _GParamSpecObject GParamSpecObject;
608typedef struct _GParamSpecOverride GParamSpecOverride;
609typedef struct _GParamSpecGType GParamSpecGType;
610typedef 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 */
621struct _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 */
638struct _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 */
653struct _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 */
668struct _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 */
685struct _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 */
702struct _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 */
719struct _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 */
736struct _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 */
753struct _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 */
768struct _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 */
783struct _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 */
799struct _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 */
817struct _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 */
837struct _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 */
859struct _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 */
877struct _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 */
887struct _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 */
897struct _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 */
909struct _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 */
921struct _GParamSpecObject
922{
923 GParamSpec parent_instance;
924};
925/**
926 * GParamSpecOverride:
927 *
928 * A #GParamSpec derived structure that redirects operations to
929 * other types of #GParamSpec.
930 *
931 * All operations other than getting or setting the value are redirected,
932 * including accessing the nick and blurb, validating a value, and so
933 * forth.
934 *
935 * See g_param_spec_get_redirect_target() for retrieving the overridden
936 * property. #GParamSpecOverride is used in implementing
937 * g_object_class_override_property(), and will not be directly useful
938 * unless you are implementing a new base type similar to GObject.
939 *
940 * Since: 2.4
941 */
942struct _GParamSpecOverride
943{
944 /*< private >*/
945 GParamSpec parent_instance;
946 GParamSpec *overridden;
947};
948/**
949 * GParamSpecGType:
950 * @parent_instance: private #GParamSpec portion
951 * @is_a_type: a #GType whose subtypes can occur as values
952 *
953 * A #GParamSpec derived structure that contains the meta data for #GType properties.
954 *
955 * Since: 2.10
956 */
957struct _GParamSpecGType
958{
959 GParamSpec parent_instance;
960 GType is_a_type;
961};
962/**
963 * GParamSpecVariant:
964 * @parent_instance: private #GParamSpec portion
965 * @type: a #GVariantType, or %NULL
966 * @default_value: a #GVariant, or %NULL
967 *
968 * A #GParamSpec derived structure that contains the meta data for #GVariant properties.
969 *
970 * When comparing values with g_param_values_cmp(), scalar values with the same
971 * type will be compared with g_variant_compare(). Other non-%NULL variants will
972 * be checked for equality with g_variant_equal(), and their sort order is
973 * otherwise undefined. %NULL is ordered before non-%NULL variants. Two %NULL
974 * values compare equal.
975 *
976 * Since: 2.26
977 */
978struct _GParamSpecVariant
979{
980 GParamSpec parent_instance;
981 GVariantType *type;
982 GVariant *default_value;
983
984 /*< private >*/
985 gpointer padding[4];
986};
987
988/* --- GParamSpec prototypes --- */
989GOBJECT_AVAILABLE_IN_ALL
990GParamSpec* g_param_spec_char (const gchar *name,
991 const gchar *nick,
992 const gchar *blurb,
993 gint8 minimum,
994 gint8 maximum,
995 gint8 default_value,
996 GParamFlags flags);
997GOBJECT_AVAILABLE_IN_ALL
998GParamSpec* g_param_spec_uchar (const gchar *name,
999 const gchar *nick,
1000 const gchar *blurb,
1001 guint8 minimum,
1002 guint8 maximum,
1003 guint8 default_value,
1004 GParamFlags flags);
1005GOBJECT_AVAILABLE_IN_ALL
1006GParamSpec* g_param_spec_boolean (const gchar *name,
1007 const gchar *nick,
1008 const gchar *blurb,
1009 gboolean default_value,
1010 GParamFlags flags);
1011GOBJECT_AVAILABLE_IN_ALL
1012GParamSpec* g_param_spec_int (const gchar *name,
1013 const gchar *nick,
1014 const gchar *blurb,
1015 gint minimum,
1016 gint maximum,
1017 gint default_value,
1018 GParamFlags flags);
1019GOBJECT_AVAILABLE_IN_ALL
1020GParamSpec* g_param_spec_uint (const gchar *name,
1021 const gchar *nick,
1022 const gchar *blurb,
1023 guint minimum,
1024 guint maximum,
1025 guint default_value,
1026 GParamFlags flags);
1027GOBJECT_AVAILABLE_IN_ALL
1028GParamSpec* g_param_spec_long (const gchar *name,
1029 const gchar *nick,
1030 const gchar *blurb,
1031 glong minimum,
1032 glong maximum,
1033 glong default_value,
1034 GParamFlags flags);
1035GOBJECT_AVAILABLE_IN_ALL
1036GParamSpec* g_param_spec_ulong (const gchar *name,
1037 const gchar *nick,
1038 const gchar *blurb,
1039 gulong minimum,
1040 gulong maximum,
1041 gulong default_value,
1042 GParamFlags flags);
1043GOBJECT_AVAILABLE_IN_ALL
1044GParamSpec* g_param_spec_int64 (const gchar *name,
1045 const gchar *nick,
1046 const gchar *blurb,
1047 gint64 minimum,
1048 gint64 maximum,
1049 gint64 default_value,
1050 GParamFlags flags);
1051GOBJECT_AVAILABLE_IN_ALL
1052GParamSpec* g_param_spec_uint64 (const gchar *name,
1053 const gchar *nick,
1054 const gchar *blurb,
1055 guint64 minimum,
1056 guint64 maximum,
1057 guint64 default_value,
1058 GParamFlags flags);
1059GOBJECT_AVAILABLE_IN_ALL
1060GParamSpec* g_param_spec_unichar (const gchar *name,
1061 const gchar *nick,
1062 const gchar *blurb,
1063 gunichar default_value,
1064 GParamFlags flags);
1065GOBJECT_AVAILABLE_IN_ALL
1066GParamSpec* g_param_spec_enum (const gchar *name,
1067 const gchar *nick,
1068 const gchar *blurb,
1069 GType enum_type,
1070 gint default_value,
1071 GParamFlags flags);
1072GOBJECT_AVAILABLE_IN_ALL
1073GParamSpec* g_param_spec_flags (const gchar *name,
1074 const gchar *nick,
1075 const gchar *blurb,
1076 GType flags_type,
1077 guint default_value,
1078 GParamFlags flags);
1079GOBJECT_AVAILABLE_IN_ALL
1080GParamSpec* g_param_spec_float (const gchar *name,
1081 const gchar *nick,
1082 const gchar *blurb,
1083 gfloat minimum,
1084 gfloat maximum,
1085 gfloat default_value,
1086 GParamFlags flags);
1087GOBJECT_AVAILABLE_IN_ALL
1088GParamSpec* g_param_spec_double (const gchar *name,
1089 const gchar *nick,
1090 const gchar *blurb,
1091 gdouble minimum,
1092 gdouble maximum,
1093 gdouble default_value,
1094 GParamFlags flags);
1095GOBJECT_AVAILABLE_IN_ALL
1096GParamSpec* g_param_spec_string (const gchar *name,
1097 const gchar *nick,
1098 const gchar *blurb,
1099 const gchar *default_value,
1100 GParamFlags flags);
1101GOBJECT_AVAILABLE_IN_ALL
1102GParamSpec* g_param_spec_param (const gchar *name,
1103 const gchar *nick,
1104 const gchar *blurb,
1105 GType param_type,
1106 GParamFlags flags);
1107GOBJECT_AVAILABLE_IN_ALL
1108GParamSpec* g_param_spec_boxed (const gchar *name,
1109 const gchar *nick,
1110 const gchar *blurb,
1111 GType boxed_type,
1112 GParamFlags flags);
1113GOBJECT_AVAILABLE_IN_ALL
1114GParamSpec* g_param_spec_pointer (const gchar *name,
1115 const gchar *nick,
1116 const gchar *blurb,
1117 GParamFlags flags);
1118GOBJECT_AVAILABLE_IN_ALL
1119GParamSpec* g_param_spec_value_array (const gchar *name,
1120 const gchar *nick,
1121 const gchar *blurb,
1122 GParamSpec *element_spec,
1123 GParamFlags flags);
1124GOBJECT_AVAILABLE_IN_ALL
1125GParamSpec* g_param_spec_object (const gchar *name,
1126 const gchar *nick,
1127 const gchar *blurb,
1128 GType object_type,
1129 GParamFlags flags);
1130GOBJECT_AVAILABLE_IN_ALL
1131GParamSpec* g_param_spec_override (const gchar *name,
1132 GParamSpec *overridden);
1133GOBJECT_AVAILABLE_IN_ALL
1134GParamSpec* g_param_spec_gtype (const gchar *name,
1135 const gchar *nick,
1136 const gchar *blurb,
1137 GType is_a_type,
1138 GParamFlags flags);
1139GOBJECT_AVAILABLE_IN_ALL
1140GParamSpec* g_param_spec_variant (const gchar *name,
1141 const gchar *nick,
1142 const gchar *blurb,
1143 const GVariantType *type,
1144 GVariant *default_value,
1145 GParamFlags flags);
1146
1147GOBJECT_VAR GType *g_param_spec_types;
1148
1149G_END_DECLS
1150
1151#endif /* __G_PARAMSPECS_H__ */
1152