define gstring in terms of gchar*. this typedef reflects the type name of
[platform/upstream/glib.git] / gobject / gparamspecs.h
1 /* GObject - GLib Type, Object, Parameter and Signal Library
2  * Copyright (C) 1997, 1998, 1999, 2000 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
25 #include        <gobject/gvalue.h>
26 #include        <gobject/genums.h>
27 #include        <gobject/gobject.h>
28
29
30 #ifdef __cplusplus
31 extern "C" {
32 #endif /* __cplusplus */
33
34
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))
62
63
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
79 {
80   GParamSpec    parent_instance;
81   
82   gint8         minimum;
83   gint8         maximum;
84   gint8         default_value;
85 };
86 struct _GParamSpecUChar
87 {
88   GParamSpec    parent_instance;
89   
90   guint8        minimum;
91   guint8        maximum;
92   guint8        default_value;
93 };
94 struct _GParamSpecBoolean
95 {
96   GParamSpec    parent_instance;
97   
98   gboolean      default_value;
99 };
100 struct _GParamSpecInt
101 {
102   GParamSpec    parent_instance;
103   
104   gint          minimum;
105   gint          maximum;
106   gint          default_value;
107 };
108 struct _GParamSpecUInt
109 {
110   GParamSpec    parent_instance;
111   
112   guint         minimum;
113   guint         maximum;
114   guint         default_value;
115 };
116 struct _GParamSpecLong
117 {
118   GParamSpec    parent_instance;
119   
120   glong         minimum;
121   glong         maximum;
122   glong         default_value;
123 };
124 struct _GParamSpecULong
125 {
126   GParamSpec    parent_instance;
127   
128   gulong        minimum;
129   gulong        maximum;
130   gulong        default_value;
131 };
132 struct _GParamSpecEnum
133 {
134   GParamSpec    parent_instance;
135   
136   GEnumClass   *enum_class;
137   glong         default_value;
138 };
139 struct _GParamSpecFlags
140 {
141   GParamSpec    parent_instance;
142   
143   GFlagsClass  *flags_class;
144   gulong        default_value;
145 };
146 struct _GParamSpecFloat
147 {
148   GParamSpec    parent_instance;
149   
150   gfloat        minimum;
151   gfloat        maximum;
152   gfloat        default_value;
153   gfloat        epsilon;
154 };
155 struct _GParamSpecDouble
156 {
157   GParamSpec    parent_instance;
158   
159   gdouble       minimum;
160   gdouble       maximum;
161   gdouble       default_value;
162   gdouble       epsilon;
163 };
164 struct _GParamSpecString
165 {
166   GParamSpec    parent_instance;
167   
168   gchar        *default_value;
169   gchar        *cset_first;
170   gchar        *cset_nth;
171   gchar         substitutor;
172   guint         null_fold_if_empty : 1;
173   guint         ensure_non_null : 1;
174 };
175 struct _GParamSpecObject
176 {
177   GParamSpec    parent_instance;
178   
179   GType         object_type;
180 };
181
182
183 /* --- GParamSpec prototypes --- */
184 GParamSpec*     g_param_spec_char       (const gchar    *name,
185                                          const gchar    *nick,
186                                          const gchar    *blurb,
187                                          gint8           minimum,
188                                          gint8           maximum,
189                                          gint8           default_value,
190                                          GParamFlags     flags);
191 GParamSpec*     g_param_spec_uchar      (const gchar    *name,
192                                          const gchar    *nick,
193                                          const gchar    *blurb,
194                                          guint8          minimum,
195                                          guint8          maximum,
196                                          guint8          default_value,
197                                          GParamFlags     flags);
198 GParamSpec*     g_param_spec_boolean    (const gchar    *name,
199                                          const gchar    *nick,
200                                          const gchar    *blurb,
201                                          gboolean        default_value,
202                                          GParamFlags     flags);
203 GParamSpec*     g_param_spec_int        (const gchar    *name,
204                                          const gchar    *nick,
205                                          const gchar    *blurb,
206                                          gint            minimum,
207                                          gint            maximum,
208                                          gint            default_value,
209                                          GParamFlags     flags);
210 GParamSpec*     g_param_spec_uint       (const gchar    *name,
211                                          const gchar    *nick,
212                                          const gchar    *blurb,
213                                          guint           minimum,
214                                          guint           maximum,
215                                          guint           default_value,
216                                          GParamFlags     flags);
217 GParamSpec*     g_param_spec_long       (const gchar    *name,
218                                          const gchar    *nick,
219                                          const gchar    *blurb,
220                                          glong           minimum,
221                                          glong           maximum,
222                                          glong           default_value,
223                                          GParamFlags     flags);
224 GParamSpec*     g_param_spec_ulong      (const gchar    *name,
225                                          const gchar    *nick,
226                                          const gchar    *blurb,
227                                          gulong          minimum,
228                                          gulong          maximum,
229                                          gulong          default_value,
230                                          GParamFlags     flags);
231 GParamSpec*     g_param_spec_enum       (const gchar    *name,
232                                          const gchar    *nick,
233                                          const gchar    *blurb,
234                                          GType           enum_type,
235                                          gint            default_value,
236                                          GParamFlags     flags);
237 GParamSpec*     g_param_spec_flags      (const gchar    *name,
238                                          const gchar    *nick,
239                                          const gchar    *blurb,
240                                          GType           flags_type,
241                                          guint           default_value,
242                                          GParamFlags     flags);
243 GParamSpec*     g_param_spec_float      (const gchar    *name,
244                                          const gchar    *nick,
245                                          const gchar    *blurb,
246                                          gfloat          minimum,
247                                          gfloat          maximum,
248                                          gfloat          default_value,
249                                          GParamFlags     flags);
250 GParamSpec*     g_param_spec_double     (const gchar    *name,
251                                          const gchar    *nick,
252                                          const gchar    *blurb,
253                                          gdouble         minimum,
254                                          gdouble         maximum,
255                                          gdouble         default_value,
256                                          GParamFlags     flags);
257 GParamSpec*     g_param_spec_string     (const gchar    *name,
258                                          const gchar    *nick,
259                                          const gchar    *blurb,
260                                          const gchar    *default_value,
261                                          GParamFlags     flags);
262 GParamSpec*     g_param_spec_string_c   (const gchar    *name,
263                                          const gchar    *nick,
264                                          const gchar    *blurb,
265                                          const gchar    *default_value,
266                                          GParamFlags     flags);
267 GParamSpec*     g_param_spec_object     (const gchar    *name,
268                                          const gchar    *nick,
269                                          const gchar    *blurb,
270                                          GType           object_type,
271                                          GParamFlags     flags);
272
273
274 #ifdef __cplusplus
275 }
276 #endif /* __cplusplus */
277
278 #endif /* __G_PARAMSPECS_H__ */