Add missing G_HAVE_GINT64 conditionalization.
[platform/upstream/glib.git] / gobject / gparamspecs.h
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 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/gboxed.h>
28 #include        <gobject/gobject.h>
29
30 G_BEGIN_DECLS
31
32 /* --- type macros --- */
33 #define G_IS_PARAM_SPEC_CHAR(pspec)        (G_TYPE_CHECK_INSTANCE_TYPE ((pspec), G_TYPE_PARAM_CHAR))
34 #define G_PARAM_SPEC_CHAR(pspec)           (G_TYPE_CHECK_INSTANCE_CAST ((pspec), G_TYPE_PARAM_CHAR, GParamSpecChar))
35 #define G_IS_PARAM_SPEC_UCHAR(pspec)       (G_TYPE_CHECK_INSTANCE_TYPE ((pspec), G_TYPE_PARAM_UCHAR))
36 #define G_PARAM_SPEC_UCHAR(pspec)          (G_TYPE_CHECK_INSTANCE_CAST ((pspec), G_TYPE_PARAM_UCHAR, GParamSpecUChar))
37 #define G_IS_PARAM_SPEC_BOOLEAN(pspec)     (G_TYPE_CHECK_INSTANCE_TYPE ((pspec), G_TYPE_PARAM_BOOLEAN))
38 #define G_PARAM_SPEC_BOOLEAN(pspec)        (G_TYPE_CHECK_INSTANCE_CAST ((pspec), G_TYPE_PARAM_BOOLEAN, GParamSpecBoolean))
39 #define G_IS_PARAM_SPEC_INT(pspec)         (G_TYPE_CHECK_INSTANCE_TYPE ((pspec), G_TYPE_PARAM_INT))
40 #define G_PARAM_SPEC_INT(pspec)            (G_TYPE_CHECK_INSTANCE_CAST ((pspec), G_TYPE_PARAM_INT, GParamSpecInt))
41 #define G_IS_PARAM_SPEC_UINT(pspec)        (G_TYPE_CHECK_INSTANCE_TYPE ((pspec), G_TYPE_PARAM_UINT))
42 #define G_PARAM_SPEC_UINT(pspec)           (G_TYPE_CHECK_INSTANCE_CAST ((pspec), G_TYPE_PARAM_UINT, GParamSpecUInt))
43 #define G_IS_PARAM_SPEC_LONG(pspec)        (G_TYPE_CHECK_INSTANCE_TYPE ((pspec), G_TYPE_PARAM_LONG))
44 #define G_PARAM_SPEC_LONG(pspec)           (G_TYPE_CHECK_INSTANCE_CAST ((pspec), G_TYPE_PARAM_LONG, GParamSpecLong))
45 #define G_IS_PARAM_SPEC_ULONG(pspec)       (G_TYPE_CHECK_INSTANCE_TYPE ((pspec), G_TYPE_PARAM_ULONG))
46 #define G_PARAM_SPEC_UNICHAR(pspec)        (G_TYPE_CHECK_INSTANCE_CAST ((pspec), G_TYPE_PARAM_UNICHAR, GParamSpecUnichar))
47 #define G_IS_PARAM_SPEC_UNICHAR(pspec)     (G_TYPE_CHECK_INSTANCE_TYPE ((pspec), G_TYPE_PARAM_UNICHAR))
48 #define G_PARAM_SPEC_ULONG(pspec)          (G_TYPE_CHECK_INSTANCE_CAST ((pspec), G_TYPE_PARAM_ULONG, GParamSpecULong))
49 #define G_IS_PARAM_SPEC_ENUM(pspec)        (G_TYPE_CHECK_INSTANCE_TYPE ((pspec), G_TYPE_PARAM_ENUM))
50 #define G_PARAM_SPEC_ENUM(pspec)           (G_TYPE_CHECK_INSTANCE_CAST ((pspec), G_TYPE_PARAM_ENUM, GParamSpecEnum))
51 #define G_IS_PARAM_SPEC_FLAGS(pspec)       (G_TYPE_CHECK_INSTANCE_TYPE ((pspec), G_TYPE_PARAM_FLAGS))
52 #define G_PARAM_SPEC_FLAGS(pspec)          (G_TYPE_CHECK_INSTANCE_CAST ((pspec), G_TYPE_PARAM_FLAGS, GParamSpecFlags))
53 #define G_IS_PARAM_SPEC_FLOAT(pspec)       (G_TYPE_CHECK_INSTANCE_TYPE ((pspec), G_TYPE_PARAM_FLOAT))
54 #define G_PARAM_SPEC_FLOAT(pspec)          (G_TYPE_CHECK_INSTANCE_CAST ((pspec), G_TYPE_PARAM_FLOAT, GParamSpecFloat))
55 #define G_IS_PARAM_SPEC_DOUBLE(pspec)      (G_TYPE_CHECK_INSTANCE_TYPE ((pspec), G_TYPE_PARAM_DOUBLE))
56 #define G_PARAM_SPEC_DOUBLE(pspec)         (G_TYPE_CHECK_INSTANCE_CAST ((pspec), G_TYPE_PARAM_DOUBLE, GParamSpecDouble))
57 #define G_IS_PARAM_SPEC_STRING(pspec)      (G_TYPE_CHECK_INSTANCE_TYPE ((pspec), G_TYPE_PARAM_STRING))
58 #define G_PARAM_SPEC_STRING(pspec)         (G_TYPE_CHECK_INSTANCE_CAST ((pspec), G_TYPE_PARAM_STRING, GParamSpecString))
59 #define G_IS_PARAM_SPEC_PARAM(pspec)       (G_TYPE_CHECK_INSTANCE_TYPE ((pspec), G_TYPE_PARAM_PARAM))
60 #define G_PARAM_SPEC_PARAM(pspec)          (G_TYPE_CHECK_INSTANCE_CAST ((pspec), G_TYPE_PARAM_PARAM, GParamSpecParam))
61 #define G_IS_PARAM_SPEC_BOXED(pspec)       (G_TYPE_CHECK_INSTANCE_TYPE ((pspec), G_TYPE_PARAM_BOXED))
62 #define G_PARAM_SPEC_BOXED(pspec)          (G_TYPE_CHECK_INSTANCE_CAST ((pspec), G_TYPE_PARAM_BOXED, GParamSpecBoxed))
63 #define G_IS_PARAM_SPEC_POINTER(pspec)     (G_TYPE_CHECK_INSTANCE_TYPE ((pspec), G_TYPE_PARAM_POINTER))
64 #define G_PARAM_SPEC_POINTER(pspec)        (G_TYPE_CHECK_INSTANCE_CAST ((pspec), G_TYPE_PARAM_POINTER, GParamSpecPointer))
65 #define G_IS_PARAM_SPEC_VALUE_ARRAY(pspec) (G_TYPE_CHECK_INSTANCE_TYPE ((pspec), G_TYPE_PARAM_VALUE_ARRAY))
66 #define G_PARAM_SPEC_VALUE_ARRAY(pspec)    (G_TYPE_CHECK_INSTANCE_CAST ((pspec), G_TYPE_PARAM_VALUE_ARRAY, GParamSpecValueArray))
67 #define G_IS_PARAM_SPEC_CLOSURE(pspec)     (G_TYPE_CHECK_INSTANCE_TYPE ((pspec), G_TYPE_PARAM_CLOSURE))
68 #define G_PARAM_SPEC_CLOSURE(pspec)        (G_TYPE_CHECK_INSTANCE_CAST ((pspec), G_TYPE_PARAM_CLOSURE, GParamSpecClosure))
69 #define G_IS_PARAM_SPEC_OBJECT(pspec)      (G_TYPE_CHECK_INSTANCE_TYPE ((pspec), G_TYPE_PARAM_OBJECT))
70 #define G_PARAM_SPEC_OBJECT(pspec)         (G_TYPE_CHECK_INSTANCE_CAST ((pspec), G_TYPE_PARAM_OBJECT, GParamSpecObject))
71
72
73 /* --- typedefs & structures --- */
74 typedef struct _GParamSpecChar       GParamSpecChar;
75 typedef struct _GParamSpecUChar      GParamSpecUChar;
76 typedef struct _GParamSpecBoolean    GParamSpecBoolean;
77 typedef struct _GParamSpecInt        GParamSpecInt;
78 typedef struct _GParamSpecUInt       GParamSpecUInt;
79 typedef struct _GParamSpecLong       GParamSpecLong;
80 typedef struct _GParamSpecULong      GParamSpecULong;
81 typedef struct _GParamSpecUnichar    GParamSpecUnichar;
82 typedef struct _GParamSpecEnum       GParamSpecEnum;
83 typedef struct _GParamSpecFlags      GParamSpecFlags;
84 typedef struct _GParamSpecFloat      GParamSpecFloat;
85 typedef struct _GParamSpecDouble     GParamSpecDouble;
86 typedef struct _GParamSpecString     GParamSpecString;
87 typedef struct _GParamSpecParam      GParamSpecParam;
88 typedef struct _GParamSpecBoxed      GParamSpecBoxed;
89 typedef struct _GParamSpecPointer    GParamSpecPointer;
90 typedef struct _GParamSpecValueArray GParamSpecValueArray;
91 typedef struct _GParamSpecClosure    GParamSpecClosure;
92 typedef struct _GParamSpecObject     GParamSpecObject;
93 #ifdef G_HAVE_GINT64
94 typedef struct _GParamSpecInt64      GParamSpecInt64;
95 typedef struct _GParamSpecUInt64     GParamSpecUInt64;
96 #endif /* G_HAVE_GINT64 */
97
98 struct _GParamSpecChar
99 {
100   GParamSpec    parent_instance;
101   
102   gint8         minimum;
103   gint8         maximum;
104   gint8         default_value;
105 };
106 struct _GParamSpecUChar
107 {
108   GParamSpec    parent_instance;
109   
110   guint8        minimum;
111   guint8        maximum;
112   guint8        default_value;
113 };
114 struct _GParamSpecBoolean
115 {
116   GParamSpec    parent_instance;
117   
118   gboolean      default_value;
119 };
120 struct _GParamSpecInt
121 {
122   GParamSpec    parent_instance;
123   
124   gint          minimum;
125   gint          maximum;
126   gint          default_value;
127 };
128 struct _GParamSpecUInt
129 {
130   GParamSpec    parent_instance;
131   
132   guint         minimum;
133   guint         maximum;
134   guint         default_value;
135 };
136 struct _GParamSpecLong
137 {
138   GParamSpec    parent_instance;
139   
140   glong         minimum;
141   glong         maximum;
142   glong         default_value;
143 };
144 struct _GParamSpecULong
145 {
146   GParamSpec    parent_instance;
147   
148   gulong        minimum;
149   gulong        maximum;
150   gulong        default_value;
151 };
152 struct _GParamSpecUnichar
153 {
154   GParamSpec    parent_instance;
155   
156   gunichar      default_value;
157 };
158 struct _GParamSpecEnum
159 {
160   GParamSpec    parent_instance;
161   
162   GEnumClass   *enum_class;
163   gint          default_value;
164 };
165 struct _GParamSpecFlags
166 {
167   GParamSpec    parent_instance;
168   
169   GFlagsClass  *flags_class;
170   guint         default_value;
171 };
172 struct _GParamSpecFloat
173 {
174   GParamSpec    parent_instance;
175   
176   gfloat        minimum;
177   gfloat        maximum;
178   gfloat        default_value;
179   gfloat        epsilon;
180 };
181 struct _GParamSpecDouble
182 {
183   GParamSpec    parent_instance;
184   
185   gdouble       minimum;
186   gdouble       maximum;
187   gdouble       default_value;
188   gdouble       epsilon;
189 };
190 struct _GParamSpecString
191 {
192   GParamSpec    parent_instance;
193   
194   gchar        *default_value;
195   gchar        *cset_first;
196   gchar        *cset_nth;
197   gchar         substitutor;
198   guint         null_fold_if_empty : 1;
199   guint         ensure_non_null : 1;
200 };
201 struct _GParamSpecParam
202 {
203   GParamSpec    parent_instance;
204 };
205 struct _GParamSpecBoxed
206 {
207   GParamSpec    parent_instance;
208 };
209 struct _GParamSpecPointer
210 {
211   GParamSpec    parent_instance;
212 };
213 struct _GParamSpecValueArray
214 {
215   GParamSpec    parent_instance;
216   GParamSpec   *element_spec;
217   guint         fixed_n_elements;
218 };
219 struct _GParamSpecClosure
220 {
221   GParamSpec    parent_instance;
222 };
223 struct _GParamSpecObject
224 {
225   GParamSpec    parent_instance;
226 };
227 #ifdef G_HAVE_GINT64
228 struct _GParamSpecInt64
229 {
230   GParamSpec    parent_instance;
231   
232   gint64        minimum;
233   gint64        maximum;
234   gint64        default_value;
235 };
236 struct _GParamSpecUInt64
237 {
238   GParamSpec    parent_instance;
239   
240   guint64       minimum;
241   guint64       maximum;
242   guint64       default_value;
243 };
244 #endif /* G_HAVE_GINT64 */
245
246 /* --- GParamSpec prototypes --- */
247 GParamSpec*     g_param_spec_char        (const gchar    *name,
248                                           const gchar    *nick,
249                                           const gchar    *blurb,
250                                           gint8           minimum,
251                                           gint8           maximum,
252                                           gint8           default_value,
253                                           GParamFlags     flags);
254 GParamSpec*     g_param_spec_uchar       (const gchar    *name,
255                                           const gchar    *nick,
256                                           const gchar    *blurb,
257                                           guint8          minimum,
258                                           guint8          maximum,
259                                           guint8          default_value,
260                                           GParamFlags     flags);
261 GParamSpec*     g_param_spec_boolean     (const gchar    *name,
262                                           const gchar    *nick,
263                                           const gchar    *blurb,
264                                           gboolean        default_value,
265                                           GParamFlags     flags);
266 GParamSpec*     g_param_spec_int         (const gchar    *name,
267                                           const gchar    *nick,
268                                           const gchar    *blurb,
269                                           gint            minimum,
270                                           gint            maximum,
271                                           gint            default_value,
272                                           GParamFlags     flags);
273 GParamSpec*     g_param_spec_uint        (const gchar    *name,
274                                           const gchar    *nick,
275                                           const gchar    *blurb,
276                                           guint           minimum,
277                                           guint           maximum,
278                                           guint           default_value,
279                                           GParamFlags     flags);
280 GParamSpec*     g_param_spec_long        (const gchar    *name,
281                                           const gchar    *nick,
282                                           const gchar    *blurb,
283                                           glong           minimum,
284                                           glong           maximum,
285                                           glong           default_value,
286                                           GParamFlags     flags);
287 GParamSpec*     g_param_spec_ulong       (const gchar    *name,
288                                           const gchar    *nick,
289                                           const gchar    *blurb,
290                                           gulong          minimum,
291                                           gulong          maximum,
292                                           gulong          default_value,
293                                           GParamFlags     flags);
294 GParamSpec*    g_param_spec_unichar      (const gchar    *name,
295                                           const gchar    *nick,
296                                           const gchar    *blurb,
297                                           gunichar        default_value,
298                                           GParamFlags     flags);
299 GParamSpec*     g_param_spec_enum        (const gchar    *name,
300                                           const gchar    *nick,
301                                           const gchar    *blurb,
302                                           GType           enum_type,
303                                           gint            default_value,
304                                           GParamFlags     flags);
305 GParamSpec*     g_param_spec_flags       (const gchar    *name,
306                                           const gchar    *nick,
307                                           const gchar    *blurb,
308                                           GType           flags_type,
309                                           guint           default_value,
310                                           GParamFlags     flags);
311 GParamSpec*     g_param_spec_float       (const gchar    *name,
312                                           const gchar    *nick,
313                                           const gchar    *blurb,
314                                           gfloat          minimum,
315                                           gfloat          maximum,
316                                           gfloat          default_value,
317                                           GParamFlags     flags);
318 GParamSpec*     g_param_spec_double      (const gchar    *name,
319                                           const gchar    *nick,
320                                           const gchar    *blurb,
321                                           gdouble         minimum,
322                                           gdouble         maximum,
323                                           gdouble         default_value,
324                                           GParamFlags     flags);
325 GParamSpec*     g_param_spec_string      (const gchar    *name,
326                                           const gchar    *nick,
327                                           const gchar    *blurb,
328                                           const gchar    *default_value,
329                                           GParamFlags     flags);
330 GParamSpec*     g_param_spec_param       (const gchar    *name,
331                                           const gchar    *nick,
332                                           const gchar    *blurb,
333                                           GType           param_type,
334                                           GParamFlags     flags);
335 GParamSpec*     g_param_spec_boxed       (const gchar    *name,
336                                           const gchar    *nick,
337                                           const gchar    *blurb,
338                                           GType           boxed_type,
339                                           GParamFlags     flags);
340 GParamSpec*     g_param_spec_pointer     (const gchar    *name,
341                                           const gchar    *nick,
342                                           const gchar    *blurb,
343                                           GParamFlags     flags);
344 GParamSpec*     g_param_spec_value_array (const gchar    *name,
345                                           const gchar    *nick,
346                                           const gchar    *blurb,
347                                           GParamSpec     *element_spec,
348                                           GParamFlags     flags);
349 GParamSpec*     g_param_spec_closure     (const gchar    *name,
350                                           const gchar    *nick,
351                                           const gchar    *blurb,
352                                           GParamFlags     flags);
353 GParamSpec*     g_param_spec_object      (const gchar    *name,
354                                           const gchar    *nick,
355                                           const gchar    *blurb,
356                                           GType           object_type,
357                                           GParamFlags     flags);
358
359 #ifdef G_HAVE_GINT64
360 GParamSpec*     g_param_spec_int64       (const gchar    *name,
361                                           const gchar    *nick,
362                                           const gchar    *blurb,
363                                           gint64          minimum,
364                                           gint64          maximum,
365                                           gint64          default_value,
366                                           GParamFlags     flags);
367 GParamSpec*     g_param_spec_uint64      (const gchar    *name,
368                                           const gchar    *nick,
369                                           const gchar    *blurb,
370                                           guint64         minimum,
371                                           guint64         maximum,
372                                           guint64         default_value,
373                                           GParamFlags     flags);
374 #endif /* G_HAVE_GINT64 */
375
376 G_END_DECLS
377
378 #endif /* __G_PARAMSPECS_H__ */