1 /* GObject - GLib Type, Object, Parameter and Signal Library
2 * Copyright (C) 1997, 1998, 1999, 2000 Tim Janik and Red Hat, Inc.
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.
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.
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.
19 * gparamspecs.h: GLib default param specs
21 #ifndef __G_PARAMSPECS_H__
22 #define __G_PARAMSPECS_H__
25 #include <gobject/gvalue.h>
26 #include <gobject/genums.h>
27 #include <gobject/gobject.h>
32 #endif /* __cplusplus */
35 /* --- type macros --- */
36 #define G_IS_PARAM_SPEC_CHAR(pspec) (G_TYPE_CHECK_INSTANCE_TYPE ((pspec), G_TYPE_PARAM_CHAR))
37 #define G_PARAM_SPEC_CHAR(pspec) (G_TYPE_CHECK_INSTANCE_CAST ((pspec), G_TYPE_PARAM_CHAR, GParamSpecChar))
38 #define G_IS_PARAM_SPEC_UCHAR(pspec) (G_TYPE_CHECK_INSTANCE_TYPE ((pspec), G_TYPE_PARAM_UCHAR))
39 #define G_PARAM_SPEC_UCHAR(pspec) (G_TYPE_CHECK_INSTANCE_CAST ((pspec), G_TYPE_PARAM_UCHAR, GParamSpecUChar))
40 #define G_IS_PARAM_SPEC_BOOLEAN(pspec) (G_TYPE_CHECK_INSTANCE_TYPE ((pspec), G_TYPE_PARAM_BOOLEAN))
41 #define G_PARAM_SPEC_BOOLEAN(pspec) (G_TYPE_CHECK_INSTANCE_CAST ((pspec), G_TYPE_PARAM_BOOLEAN, GParamSpecBoolean))
42 #define G_IS_PARAM_SPEC_INT(pspec) (G_TYPE_CHECK_INSTANCE_TYPE ((pspec), G_TYPE_PARAM_INT))
43 #define G_PARAM_SPEC_INT(pspec) (G_TYPE_CHECK_INSTANCE_CAST ((pspec), G_TYPE_PARAM_INT, GParamSpecInt))
44 #define G_IS_PARAM_SPEC_UINT(pspec) (G_TYPE_CHECK_INSTANCE_TYPE ((pspec), G_TYPE_PARAM_UINT))
45 #define G_PARAM_SPEC_UINT(pspec) (G_TYPE_CHECK_INSTANCE_CAST ((pspec), G_TYPE_PARAM_UINT, GParamSpecUInt))
46 #define G_IS_PARAM_SPEC_LONG(pspec) (G_TYPE_CHECK_INSTANCE_TYPE ((pspec), G_TYPE_PARAM_LONG))
47 #define G_PARAM_SPEC_LONG(pspec) (G_TYPE_CHECK_INSTANCE_CAST ((pspec), G_TYPE_PARAM_LONG, GParamSpecLong))
48 #define G_IS_PARAM_SPEC_ULONG(pspec) (G_TYPE_CHECK_INSTANCE_TYPE ((pspec), G_TYPE_PARAM_ULONG))
49 #define G_PARAM_SPEC_ULONG(pspec) (G_TYPE_CHECK_INSTANCE_CAST ((pspec), G_TYPE_PARAM_ULONG, GParamSpecULong))
50 #define G_IS_PARAM_SPEC_ENUM(pspec) (G_TYPE_CHECK_INSTANCE_TYPE ((pspec), G_TYPE_PARAM_ENUM))
51 #define G_PARAM_SPEC_ENUM(pspec) (G_TYPE_CHECK_INSTANCE_CAST ((pspec), G_TYPE_PARAM_ENUM, GParamSpecEnum))
52 #define G_IS_PARAM_SPEC_FLAGS(pspec) (G_TYPE_CHECK_INSTANCE_TYPE ((pspec), G_TYPE_PARAM_FLAGS))
53 #define G_PARAM_SPEC_FLAGS(pspec) (G_TYPE_CHECK_INSTANCE_CAST ((pspec), G_TYPE_PARAM_FLAGS, GParamSpecFlags))
54 #define G_IS_PARAM_SPEC_FLOAT(pspec) (G_TYPE_CHECK_INSTANCE_TYPE ((pspec), G_TYPE_PARAM_FLOAT))
55 #define G_PARAM_SPEC_FLOAT(pspec) (G_TYPE_CHECK_INSTANCE_CAST ((pspec), G_TYPE_PARAM_FLOAT, GParamSpecFloat))
56 #define G_IS_PARAM_SPEC_DOUBLE(pspec) (G_TYPE_CHECK_INSTANCE_TYPE ((pspec), G_TYPE_PARAM_DOUBLE))
57 #define G_PARAM_SPEC_DOUBLE(pspec) (G_TYPE_CHECK_INSTANCE_CAST ((pspec), G_TYPE_PARAM_DOUBLE, GParamSpecDouble))
58 #define G_IS_PARAM_SPEC_STRING(pspec) (G_TYPE_CHECK_INSTANCE_TYPE ((pspec), G_TYPE_PARAM_STRING))
59 #define G_PARAM_SPEC_STRING(pspec) (G_TYPE_CHECK_INSTANCE_CAST ((pspec), G_TYPE_PARAM_STRING, GParamSpecString))
60 #define G_IS_PARAM_SPEC_OBJECT(pspec) (G_TYPE_CHECK_INSTANCE_TYPE ((pspec), G_TYPE_PARAM_OBJECT))
61 #define G_PARAM_SPEC_OBJECT(pspec) (G_TYPE_CHECK_INSTANCE_CAST ((pspec), G_TYPE_PARAM_OBJECT, GParamSpecObject))
64 /* --- typedefs & structures --- */
65 typedef struct _GParamSpecChar GParamSpecChar;
66 typedef struct _GParamSpecUChar GParamSpecUChar;
67 typedef struct _GParamSpecBoolean GParamSpecBoolean;
68 typedef struct _GParamSpecInt GParamSpecInt;
69 typedef struct _GParamSpecUInt GParamSpecUInt;
70 typedef struct _GParamSpecLong GParamSpecLong;
71 typedef struct _GParamSpecULong GParamSpecULong;
72 typedef struct _GParamSpecEnum GParamSpecEnum;
73 typedef struct _GParamSpecFlags GParamSpecFlags;
74 typedef struct _GParamSpecFloat GParamSpecFloat;
75 typedef struct _GParamSpecDouble GParamSpecDouble;
76 typedef struct _GParamSpecString GParamSpecString;
77 typedef struct _GParamSpecObject GParamSpecObject;
78 struct _GParamSpecChar
80 GParamSpec parent_instance;
86 struct _GParamSpecUChar
88 GParamSpec parent_instance;
94 struct _GParamSpecBoolean
96 GParamSpec parent_instance;
98 gboolean default_value;
100 struct _GParamSpecInt
102 GParamSpec parent_instance;
108 struct _GParamSpecUInt
110 GParamSpec parent_instance;
116 struct _GParamSpecLong
118 GParamSpec parent_instance;
124 struct _GParamSpecULong
126 GParamSpec parent_instance;
130 gulong default_value;
132 struct _GParamSpecEnum
134 GParamSpec parent_instance;
136 GEnumClass *enum_class;
139 struct _GParamSpecFlags
141 GParamSpec parent_instance;
143 GFlagsClass *flags_class;
144 gulong default_value;
146 struct _GParamSpecFloat
148 GParamSpec parent_instance;
152 gfloat default_value;
155 struct _GParamSpecDouble
157 GParamSpec parent_instance;
161 gdouble default_value;
164 struct _GParamSpecString
166 GParamSpec parent_instance;
168 gchar *default_value;
172 guint null_fold_if_empty : 1;
173 guint ensure_non_null : 1;
175 struct _GParamSpecObject
177 GParamSpec parent_instance;
183 /* --- GParamSpec prototypes --- */
184 GParamSpec* g_param_spec_char (const gchar *name,
191 GParamSpec* g_param_spec_uchar (const gchar *name,
196 guint8 default_value,
198 GParamSpec* g_param_spec_boolean (const gchar *name,
201 gboolean default_value,
203 GParamSpec* g_param_spec_int (const gchar *name,
210 GParamSpec* g_param_spec_uint (const gchar *name,
217 GParamSpec* g_param_spec_long (const gchar *name,
224 GParamSpec* g_param_spec_ulong (const gchar *name,
229 gulong default_value,
231 GParamSpec* g_param_spec_enum (const gchar *name,
237 GParamSpec* g_param_spec_flags (const gchar *name,
243 GParamSpec* g_param_spec_float (const gchar *name,
248 gfloat default_value,
250 GParamSpec* g_param_spec_double (const gchar *name,
255 gdouble default_value,
257 GParamSpec* g_param_spec_string (const gchar *name,
260 const gchar *default_value,
262 GParamSpec* g_param_spec_string_c (const gchar *name,
265 const gchar *default_value,
267 GParamSpec* g_param_spec_object (const gchar *name,
276 #endif /* __cplusplus */
278 #endif /* __G_PARAMSPECS_H__ */