Update.
[platform/upstream/glib.git] / docs / reference / gobject / tmpl / gparamspec.sgml
1 <!-- ##### SECTION Title ##### -->
2 GParamSpec
3
4 <!-- ##### SECTION Short_Description ##### -->
5 Meta data object for parameter specifications.
6
7 <!-- ##### SECTION Long_Description ##### -->
8 <para>
9 #GParamSpec is an object structure that encapsulates the meta data
10 required to specify parameters, such as e.g. #GObject properties.
11 </para>
12
13 <!-- ##### SECTION See_Also ##### -->
14 <para>
15 g_object_class_install_property(), g_object_set(), g_object_get(),
16 g_object_set_property(), g_object_get_property(), g_value_register_transform_func()
17 </para>
18
19 <!-- ##### MACRO G_TYPE_IS_PARAM ##### -->
20 <para>
21 Returns whether @type "is a" %G_TYPE_PARAM.
22 </para>
23
24 @type: a #GType ID
25
26
27 <!-- ##### MACRO G_PARAM_SPEC ##### -->
28 <para>
29 Cast a derived #GParamSpec object (e.g. of type #GParamSpecInt) into
30 a #GParamSpec object.
31 </para>
32
33 @pspec: a valid #GParamSpec
34
35
36 <!-- ##### MACRO G_IS_PARAM_SPEC ##### -->
37 <para>
38 Check whether @pspec "is a" valid #GParamSpec structure of type %G_TYPE_PARAM
39 or derived.
40 </para>
41
42 @pspec: a #GParamSpec
43
44
45 <!-- ##### MACRO G_PARAM_SPEC_CLASS ##### -->
46 <para>
47 Cast a derived #GParamSpecClass structure into a #GParamSpecClass structure.
48 </para>
49
50 @pclass: a valid #GParamSpecClass
51
52
53 <!-- ##### MACRO G_IS_PARAM_SPEC_CLASS ##### -->
54 <para>
55 Check whether @pclass "is a" valid #GParamSpecClass structure of type %G_TYPE_PARAM
56 or derived.
57 </para>
58
59 @pclass: a #GParamSpecClass
60
61
62 <!-- ##### MACRO G_PARAM_SPEC_GET_CLASS ##### -->
63 <para>
64 Retrieve the #GParamSpecClass of a #GParamSpec.
65 </para>
66
67 @pspec: a valid #GParamSpec
68
69
70 <!-- ##### MACRO G_PARAM_SPEC_TYPE ##### -->
71 <para>
72 Retrive the #GType of this @pspec.
73 </para>
74
75 @pspec: a valid #GParamSpec
76
77
78 <!-- ##### MACRO G_PARAM_SPEC_TYPE_NAME ##### -->
79 <para>
80 Retrive the #GType name of this @pspec.
81 </para>
82
83 @pspec: a valid #GParamSpec
84
85
86 <!-- ##### MACRO G_PARAM_SPEC_VALUE_TYPE ##### -->
87 <para>
88 Retrive the #GType to intiialize a #GValue for this parameter.
89 </para>
90
91 @pspec: a valid #GParamSpec
92
93
94 <!-- ##### STRUCT GParamSpec ##### -->
95 <para>
96
97 </para>
98
99 @g_type_instance: private #GTypeInstance portion
100 @name:            name of this parameter
101 @flags:           #GParamFlags flags for this parameter
102 @value_type:      the #GValue type for this parameter
103 @owner_type:      #GType type that uses (introduces) this paremeter
104
105 <!-- ##### STRUCT GParamSpecClass ##### -->
106 <para>
107
108 </para>
109
110
111 <!-- ##### ENUM GParamFlags ##### -->
112 <para>
113 Through the #GParamFlags flag values, certain aspects of parameters
114 can be configured.
115 </para>
116
117 @G_PARAM_READABLE:       the parameter is readable
118 @G_PARAM_WRITABLE:       the parameter is writable
119 @G_PARAM_CONSTRUCT:      the parameter will be set upon object construction
120 @G_PARAM_CONSTRUCT_ONLY: the parameter will only be set upon object construction
121 @G_PARAM_LAX_VALIDATION: upon parameter conversion (see g_param_value_convert())
122                          strict validation is not required
123 @G_PARAM_PRIVATE: 
124
125 <!-- ##### MACRO G_PARAM_READWRITE ##### -->
126 <para>
127 #GParamFlags value alias for %G_PARAM_READABLE | %G_PARAM_WRITABLE.
128 </para>
129
130
131
132 <!-- ##### MACRO G_PARAM_MASK ##### -->
133 <para>
134 Mask containing the bits of #GParamSpec.flags which are reserved for GLib.
135 </para>
136
137
138
139 <!-- ##### MACRO G_PARAM_USER_SHIFT ##### -->
140 <para>
141 Minimum shift count to be used for user defined flags, to be stored in
142 #GParamSpec.flags.
143 </para>
144
145
146
147 <!-- ##### FUNCTION g_param_spec_ref ##### -->
148 <para>
149 Increment the reference count of @pspec.
150 </para>
151
152 @pspec:   a valid #GParamSpec
153 @Returns: the #GParamSpec that was passed into this function
154
155
156 <!-- ##### FUNCTION g_param_spec_unref ##### -->
157 <para>
158 Decrement the reference count of a @pspec.
159 </para>
160
161 @pspec: a valid #GParamSpec
162
163
164 <!-- ##### FUNCTION g_param_spec_sink ##### -->
165 <para>
166 The initial reference count of a newly created #GParamSpec is 1,
167 eventhough no one has explicitely called g_param_spec_ref() on it yet.
168 So the einital reference count is flagged as "floating", untill someone
169 calls: g_param_spec_ref (@pspec); g_param_spec_sink (@pspec);
170 in sequence on it, taking over the initial reference count (thus
171 ending up with a @pspec that has a reference count of 1 still, but is
172 not flagged "floating" anymore).
173 </para>
174
175 @pspec: a valid #GParamSpec
176
177
178 <!-- ##### FUNCTION g_param_value_set_default ##### -->
179 <para>
180 Set @value to its default value as specified in @pspec.
181 </para>
182
183 @pspec: a valid #GParamSpec
184 @value: a #GValue of correct type for @pspec
185
186
187 <!-- ##### FUNCTION g_param_value_defaults ##### -->
188 <para>
189 Check whether @value contains the default value as specified in @pspec.
190 </para>
191
192 @pspec:   a valid #GParamSpec
193 @value:   a #GValue of correct type for @pspec
194 @Returns: whether @value contains the canonical defualt for this @pspec
195
196
197 <!-- ##### FUNCTION g_param_value_validate ##### -->
198 <para>
199 Ensure that the contents of @value comply with the specifications
200 set out by @pspec. For example, a #GParamSpecInt might require
201 that integers stored in @value may not be smaller than -42 and not be
202 greater than +42. If @value contains an integer outside of this range,
203 it is modified accordingly, so the resulting value will fit into the
204 range -42 .. +42.
205 </para>
206
207 @pspec:   a valid #GParamSpec
208 @value:   a #GValue of correct type for @pspec
209 @Returns: whether modifying @value was necessary to ensure validity
210
211
212 <!-- ##### FUNCTION g_param_value_convert ##### -->
213 <para>
214 This function transforms @src_value into @dest_value if possible,
215 and then validates @dest_value, in order for it to conform to
216 @pspec.
217 If @strict_validation is %TRUE this function will only suceed if
218 the transformed @dest_value complied to @pspec without modifications.
219
220 See also g_value_type_transformable(), g_value_transform() and
221 g_param_value_validate().
222 </para>
223
224 @pspec:             a valid #GParamSpec
225 @src_value:         souce #GValue
226 @dest_value:        destination #GValue of correct type for @pspec
227 @strict_validation: $TRUE requires @dest_value to conform to @pspec without modifications
228 @Returns:           %TRUE if transformation and validation were successfull,
229                     %FALSE otherwise and @dest_value is left untouched.
230
231
232 <!-- ##### FUNCTION g_param_values_cmp ##### -->
233 <para>
234 Compare @value1 with @value2 according to @pspec, and return -1, 0 or +1,
235 if @value1 is found to be less than, equal to or greater than @value2, respectively.
236 </para>
237
238 @pspec:   a valid #GParamSpec
239 @value1:  a #GValue of correct type for @pspec
240 @value2:  a #GValue of correct type for @pspec
241 @Returns: -1, 0 or +1, for a less than, equal to or greater than result
242
243
244 <!-- ##### FUNCTION g_param_spec_get_name ##### -->
245 <para>
246
247 </para>
248
249 @pspec: 
250 @Returns: 
251
252
253 <!-- ##### FUNCTION g_param_spec_get_nick ##### -->
254 <para>
255
256 </para>
257
258 @pspec: 
259 @Returns: 
260
261
262 <!-- ##### FUNCTION g_param_spec_get_blurb ##### -->
263 <para>
264
265 </para>
266
267 @pspec: 
268 @Returns: 
269
270
271 <!-- ##### FUNCTION g_param_spec_get_qdata ##### -->
272 <para>
273
274 </para>
275
276 @pspec: 
277 @quark: 
278 @Returns: 
279
280
281 <!-- ##### FUNCTION g_param_spec_set_qdata ##### -->
282 <para>
283
284 </para>
285
286 @pspec: 
287 @quark: 
288 @data: 
289
290
291 <!-- ##### FUNCTION g_param_spec_set_qdata_full ##### -->
292 <para>
293
294 </para>
295
296 @pspec: 
297 @quark: 
298 @data: 
299 @destroy: 
300
301
302 <!-- ##### FUNCTION g_param_spec_steal_qdata ##### -->
303 <para>
304
305 </para>
306
307 @pspec: 
308 @quark: 
309 @Returns: 
310
311
312 <!-- ##### FUNCTION g_param_spec_internal ##### -->
313 <para>
314
315 </para>
316
317 @param_type: 
318 @name: 
319 @nick: 
320 @blurb: 
321 @flags: 
322 @Returns: 
323
324
325 <!-- ##### STRUCT GParamSpecTypeInfo ##### -->
326 <para>
327
328 </para>
329
330 @instance_size: 
331 @n_preallocs: 
332 @instance_init: 
333 @value_type: 
334 @finalize: 
335 @value_set_default: 
336 @value_validate: 
337 @values_cmp: 
338
339 <!-- ##### FUNCTION g_param_type_register_static ##### -->
340 <para>
341
342 </para>
343
344 @name: 
345 @pspec_info: 
346 @Returns: 
347
348
349 <!-- ##### STRUCT GParamSpecPool ##### -->
350 <para>
351
352 </para>
353
354
355 <!-- ##### FUNCTION g_param_spec_pool_new ##### -->
356 <para>
357
358 </para>
359
360 @type_prefixing: 
361 @Returns: 
362
363
364 <!-- ##### FUNCTION g_param_spec_pool_insert ##### -->
365 <para>
366
367 </para>
368
369 @pool: 
370 @pspec: 
371 @owner_type: 
372
373
374 <!-- ##### FUNCTION g_param_spec_pool_remove ##### -->
375 <para>
376
377 </para>
378
379 @pool: 
380 @pspec: 
381
382
383 <!-- ##### FUNCTION g_param_spec_pool_lookup ##### -->
384 <para>
385
386 </para>
387
388 @pool: 
389 @param_name: 
390 @owner_type: 
391 @walk_ancestors: 
392 @Returns: 
393 <!-- # Unused Parameters # -->
394 @trailer_p: 
395
396
397 <!-- ##### FUNCTION g_param_spec_pool_list ##### -->
398 <para>
399
400 </para>
401
402 @pool: 
403 @owner_type: 
404 @n_pspecs_p: 
405 @Returns: 
406
407
408 <!-- ##### FUNCTION g_param_spec_pool_list_owned ##### -->
409 <para>
410
411 </para>
412
413 @pool: 
414 @owner_type: 
415 @Returns: 
416
417