1 /* GObject - GLib Type, Object, Parameter and Signal Library
2 * Copyright (C) 1997-1999, 2000-2001 Tim Janik and Red Hat, Inc.
3 * Portions copyright (c) 2006 Nokia Corporation. All rights reserved.
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version.
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
15 * You should have received a copy of the GNU Lesser General
16 * Public License along with this library; if not, write to the
17 * Free Software Foundation, Inc., 59 Temple Place, Suite 330,
18 * Boston, MA 02111-1307, USA.
20 * gparamspecs.h: GLib default param specs
22 #if !defined (__GLIB_GOBJECT_H_INSIDE__) && !defined (GOBJECT_COMPILATION)
23 #error "Only <glib-object.h> can be included directly."
26 #ifndef __G_PARAMSPECS_H__
27 #define __G_PARAMSPECS_H__
30 #include <gobject/gvalue.h>
31 #include <gobject/genums.h>
32 #include <gobject/gboxed.h>
33 #include <gobject/gobject.h>
37 /* --- type macros --- */
38 #define G_TYPE_PARAM_CHAR (g_param_spec_types[0])
39 #define G_IS_PARAM_SPEC_CHAR(pspec) (G_TYPE_CHECK_INSTANCE_TYPE ((pspec), G_TYPE_PARAM_CHAR))
40 #define G_PARAM_SPEC_CHAR(pspec) (G_TYPE_CHECK_INSTANCE_CAST ((pspec), G_TYPE_PARAM_CHAR, GParamSpecChar))
41 #define G_TYPE_PARAM_UCHAR (g_param_spec_types[1])
42 #define G_IS_PARAM_SPEC_UCHAR(pspec) (G_TYPE_CHECK_INSTANCE_TYPE ((pspec), G_TYPE_PARAM_UCHAR))
43 #define G_PARAM_SPEC_UCHAR(pspec) (G_TYPE_CHECK_INSTANCE_CAST ((pspec), G_TYPE_PARAM_UCHAR, GParamSpecUChar))
44 #define G_TYPE_PARAM_BOOLEAN (g_param_spec_types[2])
45 #define G_IS_PARAM_SPEC_BOOLEAN(pspec) (G_TYPE_CHECK_INSTANCE_TYPE ((pspec), G_TYPE_PARAM_BOOLEAN))
46 #define G_PARAM_SPEC_BOOLEAN(pspec) (G_TYPE_CHECK_INSTANCE_CAST ((pspec), G_TYPE_PARAM_BOOLEAN, GParamSpecBoolean))
47 #define G_TYPE_PARAM_INT (g_param_spec_types[3])
48 #define G_IS_PARAM_SPEC_INT(pspec) (G_TYPE_CHECK_INSTANCE_TYPE ((pspec), G_TYPE_PARAM_INT))
49 #define G_PARAM_SPEC_INT(pspec) (G_TYPE_CHECK_INSTANCE_CAST ((pspec), G_TYPE_PARAM_INT, GParamSpecInt))
50 #define G_TYPE_PARAM_UINT (g_param_spec_types[4])
51 #define G_IS_PARAM_SPEC_UINT(pspec) (G_TYPE_CHECK_INSTANCE_TYPE ((pspec), G_TYPE_PARAM_UINT))
52 #define G_PARAM_SPEC_UINT(pspec) (G_TYPE_CHECK_INSTANCE_CAST ((pspec), G_TYPE_PARAM_UINT, GParamSpecUInt))
53 #define G_TYPE_PARAM_LONG (g_param_spec_types[5])
54 #define G_IS_PARAM_SPEC_LONG(pspec) (G_TYPE_CHECK_INSTANCE_TYPE ((pspec), G_TYPE_PARAM_LONG))
55 #define G_PARAM_SPEC_LONG(pspec) (G_TYPE_CHECK_INSTANCE_CAST ((pspec), G_TYPE_PARAM_LONG, GParamSpecLong))
56 #define G_TYPE_PARAM_ULONG (g_param_spec_types[6])
57 #define G_IS_PARAM_SPEC_ULONG(pspec) (G_TYPE_CHECK_INSTANCE_TYPE ((pspec), G_TYPE_PARAM_ULONG))
58 #define G_PARAM_SPEC_ULONG(pspec) (G_TYPE_CHECK_INSTANCE_CAST ((pspec), G_TYPE_PARAM_ULONG, GParamSpecULong))
59 #define G_TYPE_PARAM_INT64 (g_param_spec_types[7])
60 #define G_IS_PARAM_SPEC_INT64(pspec) (G_TYPE_CHECK_INSTANCE_TYPE ((pspec), G_TYPE_PARAM_INT64))
61 #define G_PARAM_SPEC_INT64(pspec) (G_TYPE_CHECK_INSTANCE_CAST ((pspec), G_TYPE_PARAM_INT64, GParamSpecInt64))
62 #define G_TYPE_PARAM_UINT64 (g_param_spec_types[8])
63 #define G_IS_PARAM_SPEC_UINT64(pspec) (G_TYPE_CHECK_INSTANCE_TYPE ((pspec), G_TYPE_PARAM_UINT64))
64 #define G_PARAM_SPEC_UINT64(pspec) (G_TYPE_CHECK_INSTANCE_CAST ((pspec), G_TYPE_PARAM_UINT64, GParamSpecUInt64))
65 #define G_TYPE_PARAM_UNICHAR (g_param_spec_types[9])
66 #define G_PARAM_SPEC_UNICHAR(pspec) (G_TYPE_CHECK_INSTANCE_CAST ((pspec), G_TYPE_PARAM_UNICHAR, GParamSpecUnichar))
67 #define G_IS_PARAM_SPEC_UNICHAR(pspec) (G_TYPE_CHECK_INSTANCE_TYPE ((pspec), G_TYPE_PARAM_UNICHAR))
68 #define G_TYPE_PARAM_ENUM (g_param_spec_types[10])
69 #define G_IS_PARAM_SPEC_ENUM(pspec) (G_TYPE_CHECK_INSTANCE_TYPE ((pspec), G_TYPE_PARAM_ENUM))
70 #define G_PARAM_SPEC_ENUM(pspec) (G_TYPE_CHECK_INSTANCE_CAST ((pspec), G_TYPE_PARAM_ENUM, GParamSpecEnum))
71 #define G_TYPE_PARAM_FLAGS (g_param_spec_types[11])
72 #define G_IS_PARAM_SPEC_FLAGS(pspec) (G_TYPE_CHECK_INSTANCE_TYPE ((pspec), G_TYPE_PARAM_FLAGS))
73 #define G_PARAM_SPEC_FLAGS(pspec) (G_TYPE_CHECK_INSTANCE_CAST ((pspec), G_TYPE_PARAM_FLAGS, GParamSpecFlags))
74 #define G_TYPE_PARAM_FLOAT (g_param_spec_types[12])
75 #define G_IS_PARAM_SPEC_FLOAT(pspec) (G_TYPE_CHECK_INSTANCE_TYPE ((pspec), G_TYPE_PARAM_FLOAT))
76 #define G_PARAM_SPEC_FLOAT(pspec) (G_TYPE_CHECK_INSTANCE_CAST ((pspec), G_TYPE_PARAM_FLOAT, GParamSpecFloat))
77 #define G_TYPE_PARAM_DOUBLE (g_param_spec_types[13])
78 #define G_IS_PARAM_SPEC_DOUBLE(pspec) (G_TYPE_CHECK_INSTANCE_TYPE ((pspec), G_TYPE_PARAM_DOUBLE))
79 #define G_PARAM_SPEC_DOUBLE(pspec) (G_TYPE_CHECK_INSTANCE_CAST ((pspec), G_TYPE_PARAM_DOUBLE, GParamSpecDouble))
80 #define G_TYPE_PARAM_STRING (g_param_spec_types[14])
81 #define G_IS_PARAM_SPEC_STRING(pspec) (G_TYPE_CHECK_INSTANCE_TYPE ((pspec), G_TYPE_PARAM_STRING))
82 #define G_PARAM_SPEC_STRING(pspec) (G_TYPE_CHECK_INSTANCE_CAST ((pspec), G_TYPE_PARAM_STRING, GParamSpecString))
83 #define G_TYPE_PARAM_PARAM (g_param_spec_types[15])
84 #define G_IS_PARAM_SPEC_PARAM(pspec) (G_TYPE_CHECK_INSTANCE_TYPE ((pspec), G_TYPE_PARAM_PARAM))
85 #define G_PARAM_SPEC_PARAM(pspec) (G_TYPE_CHECK_INSTANCE_CAST ((pspec), G_TYPE_PARAM_PARAM, GParamSpecParam))
86 #define G_TYPE_PARAM_BOXED (g_param_spec_types[16])
87 #define G_IS_PARAM_SPEC_BOXED(pspec) (G_TYPE_CHECK_INSTANCE_TYPE ((pspec), G_TYPE_PARAM_BOXED))
88 #define G_PARAM_SPEC_BOXED(pspec) (G_TYPE_CHECK_INSTANCE_CAST ((pspec), G_TYPE_PARAM_BOXED, GParamSpecBoxed))
89 #define G_TYPE_PARAM_POINTER (g_param_spec_types[17])
90 #define G_IS_PARAM_SPEC_POINTER(pspec) (G_TYPE_CHECK_INSTANCE_TYPE ((pspec), G_TYPE_PARAM_POINTER))
91 #define G_PARAM_SPEC_POINTER(pspec) (G_TYPE_CHECK_INSTANCE_CAST ((pspec), G_TYPE_PARAM_POINTER, GParamSpecPointer))
92 #define G_TYPE_PARAM_VALUE_ARRAY (g_param_spec_types[18])
93 #define G_IS_PARAM_SPEC_VALUE_ARRAY(pspec) (G_TYPE_CHECK_INSTANCE_TYPE ((pspec), G_TYPE_PARAM_VALUE_ARRAY))
94 #define G_PARAM_SPEC_VALUE_ARRAY(pspec) (G_TYPE_CHECK_INSTANCE_CAST ((pspec), G_TYPE_PARAM_VALUE_ARRAY, GParamSpecValueArray))
95 #define G_TYPE_PARAM_OBJECT (g_param_spec_types[19])
96 #define G_IS_PARAM_SPEC_OBJECT(pspec) (G_TYPE_CHECK_INSTANCE_TYPE ((pspec), G_TYPE_PARAM_OBJECT))
97 #define G_PARAM_SPEC_OBJECT(pspec) (G_TYPE_CHECK_INSTANCE_CAST ((pspec), G_TYPE_PARAM_OBJECT, GParamSpecObject))
98 #define G_TYPE_PARAM_OVERRIDE (g_param_spec_types[20])
99 #define G_IS_PARAM_SPEC_OVERRIDE(pspec) (G_TYPE_CHECK_INSTANCE_TYPE ((pspec), G_TYPE_PARAM_OVERRIDE))
100 #define G_PARAM_SPEC_OVERRIDE(pspec) (G_TYPE_CHECK_INSTANCE_CAST ((pspec), G_TYPE_PARAM_OVERRIDE, GParamSpecOverride))
101 #define G_TYPE_PARAM_GTYPE (g_param_spec_types[21])
102 #define G_IS_PARAM_SPEC_GTYPE(pspec) (G_TYPE_CHECK_INSTANCE_TYPE ((pspec), G_TYPE_PARAM_GTYPE))
103 #define G_PARAM_SPEC_GTYPE(pspec) (G_TYPE_CHECK_INSTANCE_CAST ((pspec), G_TYPE_PARAM_GTYPE, GParamSpecGType))
106 /* --- typedefs & structures --- */
107 typedef struct _GParamSpecChar GParamSpecChar;
108 typedef struct _GParamSpecUChar GParamSpecUChar;
109 typedef struct _GParamSpecBoolean GParamSpecBoolean;
110 typedef struct _GParamSpecInt GParamSpecInt;
111 typedef struct _GParamSpecUInt GParamSpecUInt;
112 typedef struct _GParamSpecLong GParamSpecLong;
113 typedef struct _GParamSpecULong GParamSpecULong;
114 typedef struct _GParamSpecInt64 GParamSpecInt64;
115 typedef struct _GParamSpecUInt64 GParamSpecUInt64;
116 typedef struct _GParamSpecUnichar GParamSpecUnichar;
117 typedef struct _GParamSpecEnum GParamSpecEnum;
118 typedef struct _GParamSpecFlags GParamSpecFlags;
119 typedef struct _GParamSpecFloat GParamSpecFloat;
120 typedef struct _GParamSpecDouble GParamSpecDouble;
121 typedef struct _GParamSpecString GParamSpecString;
122 typedef struct _GParamSpecParam GParamSpecParam;
123 typedef struct _GParamSpecBoxed GParamSpecBoxed;
124 typedef struct _GParamSpecPointer GParamSpecPointer;
125 typedef struct _GParamSpecValueArray GParamSpecValueArray;
126 typedef struct _GParamSpecObject GParamSpecObject;
127 typedef struct _GParamSpecOverride GParamSpecOverride;
128 typedef struct _GParamSpecGType GParamSpecGType;
130 struct _GParamSpecChar
132 GParamSpec parent_instance;
138 struct _GParamSpecUChar
140 GParamSpec parent_instance;
144 guint8 default_value;
146 struct _GParamSpecBoolean
148 GParamSpec parent_instance;
150 gboolean default_value;
152 struct _GParamSpecInt
154 GParamSpec parent_instance;
160 struct _GParamSpecUInt
162 GParamSpec parent_instance;
168 struct _GParamSpecLong
170 GParamSpec parent_instance;
176 struct _GParamSpecULong
178 GParamSpec parent_instance;
182 gulong default_value;
184 struct _GParamSpecInt64
186 GParamSpec parent_instance;
190 gint64 default_value;
192 struct _GParamSpecUInt64
194 GParamSpec parent_instance;
198 guint64 default_value;
200 struct _GParamSpecUnichar
202 GParamSpec parent_instance;
204 gunichar default_value;
206 struct _GParamSpecEnum
208 GParamSpec parent_instance;
210 GEnumClass *enum_class;
213 struct _GParamSpecFlags
215 GParamSpec parent_instance;
217 GFlagsClass *flags_class;
220 struct _GParamSpecFloat
222 GParamSpec parent_instance;
226 gfloat default_value;
229 struct _GParamSpecDouble
231 GParamSpec parent_instance;
235 gdouble default_value;
238 struct _GParamSpecString
240 GParamSpec parent_instance;
242 gchar *default_value;
246 guint null_fold_if_empty : 1;
247 guint ensure_non_null : 1;
249 struct _GParamSpecParam
251 GParamSpec parent_instance;
253 struct _GParamSpecBoxed
255 GParamSpec parent_instance;
257 struct _GParamSpecPointer
259 GParamSpec parent_instance;
261 struct _GParamSpecValueArray
263 GParamSpec parent_instance;
264 GParamSpec *element_spec;
265 guint fixed_n_elements;
267 struct _GParamSpecObject
269 GParamSpec parent_instance;
271 struct _GParamSpecOverride
274 GParamSpec parent_instance;
275 GParamSpec *overridden;
277 struct _GParamSpecGType
279 GParamSpec parent_instance;
283 /* --- GParamSpec prototypes --- */
284 IMPORT_C GParamSpec* g_param_spec_char (const gchar *name,
291 IMPORT_C GParamSpec* g_param_spec_uchar (const gchar *name,
296 guint8 default_value,
298 IMPORT_C GParamSpec* g_param_spec_boolean (const gchar *name,
301 gboolean default_value,
303 IMPORT_C GParamSpec* g_param_spec_int (const gchar *name,
310 IMPORT_C GParamSpec* g_param_spec_uint (const gchar *name,
317 IMPORT_C GParamSpec* g_param_spec_long (const gchar *name,
324 IMPORT_C GParamSpec* g_param_spec_ulong (const gchar *name,
329 gulong default_value,
331 IMPORT_C GParamSpec* g_param_spec_int64 (const gchar *name,
336 gint64 default_value,
338 IMPORT_C GParamSpec* g_param_spec_uint64 (const gchar *name,
343 guint64 default_value,
345 IMPORT_C GParamSpec* g_param_spec_unichar (const gchar *name,
348 gunichar default_value,
350 IMPORT_C GParamSpec* g_param_spec_enum (const gchar *name,
356 IMPORT_C GParamSpec* g_param_spec_flags (const gchar *name,
362 IMPORT_C GParamSpec* g_param_spec_float (const gchar *name,
367 gfloat default_value,
369 IMPORT_C GParamSpec* g_param_spec_double (const gchar *name,
374 gdouble default_value,
376 IMPORT_C GParamSpec* g_param_spec_string (const gchar *name,
379 const gchar *default_value,
381 IMPORT_C GParamSpec* g_param_spec_param (const gchar *name,
386 IMPORT_C GParamSpec* g_param_spec_boxed (const gchar *name,
391 IMPORT_C GParamSpec* g_param_spec_pointer (const gchar *name,
395 IMPORT_C GParamSpec* g_param_spec_value_array (const gchar *name,
398 GParamSpec *element_spec,
400 IMPORT_C GParamSpec* g_param_spec_object (const gchar *name,
405 IMPORT_C GParamSpec* g_param_spec_override (const gchar *name,
406 GParamSpec *overridden);
407 IMPORT_C GParamSpec* g_param_spec_gtype (const gchar *name,
413 /* --- internal --- */
414 /* We prefix variable declarations so they can
415 * properly get exported in windows dlls.
418 # ifdef G_PLATFORM_WIN32
419 # ifdef GOBJECT_STATIC_COMPILATION
420 # define GOBJECT_VAR extern
421 # else /* !GOBJECT_STATIC_COMPILATION */
422 # ifdef GOBJECT_COMPILATION
424 # define GOBJECT_VAR __declspec(dllexport)
425 # else /* !DLL_EXPORT */
426 # define GOBJECT_VAR extern
427 # endif /* !DLL_EXPORT */
428 # else /* !GOBJECT_COMPILATION */
429 # define GOBJECT_VAR extern __declspec(dllimport)
430 # endif /* !GOBJECT_COMPILATION */
431 # endif /* !GOBJECT_STATIC_COMPILATION */
432 # else /* !G_PLATFORM_WIN32 */
433 # define GOBJECT_VAR extern
434 # endif /* !G_PLATFORM_WIN32 */
435 #endif /* GOBJECT_VAR */
438 IMPORT_C GType ** _g_param_spec_types();
439 #endif /*__SYMBIAN32__ */
440 GOBJECT_VAR GType *g_param_spec_types;
444 #endif /* __G_PARAMSPECS_H__ */