1Glib::ParamSpec(3)    User Contributed Perl Documentation   Glib::ParamSpec(3)
2
3
4

NAME

6       Glib::ParamSpec
7

DESCRIPTION

9       Glib::ParamSpec encapsulates the metadata required to specify
10       parameters.  You will see these most often when creating new
11       Glib::Object types; see "Glib::Type->register" and
12       Glib::Object::Subclass.
13
14       Parameter specifications allow you to provide limits for validation as
15       well as nicknames and blurbs to document the parameters.  Blurbs show
16       up in reference documentation such as this page or the gtk+ C API
17       reference; i'm not really sure where the nicknames get used.  The Perl
18       bindings for the most part ignore the difference between dashes and
19       underscores in the paramspec names, which typically find use as the
20       actual keys for object parameters.
21
22       It's worth noting that Glib offers various sizes of integer and
23       floating point values, while Perl really only deals with full integers
24       and double precision floating point values.  The size distinction is
25       important for the underlying C libraries.
26

HIERARCHY

28         Glib::ParamSpec
29

METHODS

31   paramspec = Glib::ParamSpec->IV ($name, $nick, $blurb, $minimum, $maximum,
32       $default_value, $flags)
33       ·   $name (string)
34
35       ·   $nick (string)
36
37       ·   $blurb (string)
38
39       ·   $minimum (integer)
40
41       ·   $maximum (integer)
42
43       ·   $default_value (integer)
44
45       ·   $flags (Glib::ParamFlags)
46
47   paramspec = Glib::ParamSpec->UV ($name, $nick, $blurb, $minimum, $maximum,
48       $default_value, $flags)
49       ·   $name (string)
50
51       ·   $nick (string)
52
53       ·   $blurb (string)
54
55       ·   $minimum (unsigned)
56
57       ·   $maximum (unsigned)
58
59       ·   $default_value (unsigned)
60
61       ·   $flags (Glib::ParamFlags)
62
63   string = $pspec->get_blurb
64   paramspec = Glib::ParamSpec->boolean ($name, $nick, $blurb, $default_value,
65       $flags)
66       ·   $name (string)
67
68       ·   $nick (string)
69
70       ·   $blurb (string)
71
72       ·   $default_value (boolean)
73
74       ·   $flags (Glib::ParamFlags)
75
76   paramspec = Glib::ParamSpec->boxed ($name, $nick, $blurb, $package, $flags)
77       ·   $name (string)
78
79       ·   $nick (string)
80
81       ·   $blurb (string)
82
83       ·   $package (string) name of the class, derived from Glib::Boxed, of
84           the objects this property will hold.
85
86       ·   $flags (Glib::ParamFlags)
87
88   paramspec = Glib::ParamSpec->char ($name, $nick, $blurb, $minimum,
89       $maximum, $default_value, $flags)
90       ·   $name (string)
91
92       ·   $nick (string)
93
94       ·   $blurb (string)
95
96       ·   $minimum (integer)
97
98       ·   $maximum (integer)
99
100       ·   $default_value (integer)
101
102       ·   $flags (Glib::ParamFlags)
103
104   paramspec = Glib::ParamSpec->double ($name, $nick, $blurb, $minimum,
105       $maximum, $default_value, $flags)
106       ·   $name (string)
107
108       ·   $nick (string)
109
110       ·   $blurb (string)
111
112       ·   $minimum (double)
113
114       ·   $maximum (double)
115
116       ·   $default_value (double)
117
118       ·   $flags (Glib::ParamFlags)
119
120   paramspec = Glib::ParamSpec->enum ($name, $nick, $blurb, $enum_type,
121       $default_value, $flags)
122       ·   $name (string)
123
124       ·   $nick (string)
125
126       ·   $blurb (string)
127
128       ·   $enum_type (string)
129
130       ·   $default_value (scalar)
131
132       ·   $flags (Glib::ParamFlags)
133
134   paramspec = Glib::ParamSpec->flags ($name, $nick, $blurb, $flags_type,
135       $default_value, $flags)
136       ·   $name (string)
137
138       ·   $nick (string)
139
140       ·   $blurb (string)
141
142       ·   $flags_type (string)
143
144       ·   $default_value (scalar)
145
146       ·   $flags (Glib::ParamFlags)
147
148   paramflags = $pspec->get_flags
149   paramspec = Glib::ParamSpec->float ($name, $nick, $blurb, $minimum,
150       $maximum, $default_value, $flags)
151       ·   $name (string)
152
153       ·   $nick (string)
154
155       ·   $blurb (string)
156
157       ·   $minimum (double)
158
159       ·   $maximum (double)
160
161       ·   $default_value (double)
162
163       ·   $flags (Glib::ParamFlags)
164
165   paramspec = Glib::ParamSpec->int ($name, $nick, $blurb, $minimum, $maximum,
166       $default_value, $flags)
167       ·   $name (string)
168
169       ·   $nick (string)
170
171       ·   $blurb (string)
172
173       ·   $minimum (integer)
174
175       ·   $maximum (integer)
176
177       ·   $default_value (integer)
178
179       ·   $flags (Glib::ParamFlags)
180
181   paramspec = Glib::ParamSpec->int64 ($name, $nick, $blurb, $minimum,
182       $maximum, $default_value, $flags)
183       ·   $name (string)
184
185       ·   $nick (string)
186
187       ·   $blurb (string)
188
189       ·   $minimum (Glib::Int64)
190
191       ·   $maximum (Glib::Int64)
192
193       ·   $default_value (Glib::Int64)
194
195       ·   $flags (Glib::ParamFlags)
196
197   paramspec = Glib::ParamSpec->long ($name, $nick, $blurb, $minimum,
198       $maximum, $default_value, $flags)
199       ·   $name (string)
200
201       ·   $nick (string)
202
203       ·   $blurb (string)
204
205       ·   $minimum (integer)
206
207       ·   $maximum (integer)
208
209       ·   $default_value (integer)
210
211       ·   $flags (Glib::ParamFlags)
212
213   string = $paramspec->get_name
214       Dashes in the name are converted to underscores.
215
216   string = $pspec->get_nick
217   paramspec = Glib::ParamSpec->object ($name, $nick, $blurb, $package,
218       $flags)
219       ·   $name (string)
220
221       ·   $nick (string)
222
223       ·   $blurb (string)
224
225       ·   $package (string) name of the class, derived from Glib::Object, of
226           the objects this property will hold.
227
228       ·   $flags (Glib::ParamFlags)
229
230   string = $pspec->get_owner_type
231   paramspec = Glib::ParamSpec->param_spec ($name, $nick, $blurb, $package,
232       $flags)
233       ·   $name (string)
234
235       ·   $nick (string)
236
237       ·   $blurb (string)
238
239       ·   $package (string) name of the class, derived from Glib::ParamSpec,
240           of the objects this property will hold.
241
242       ·   $flags (Glib::ParamFlags)
243
244   paramspec = Glib::ParamSpec->scalar ($name, $nick, $blurb, $flags)
245       ·   $name (string)
246
247       ·   $nick (string)
248
249       ·   $blurb (string)
250
251       ·   $flags (Glib::ParamFlags)
252
253       ParamSpec to be used for any generic perl scalar, including references
254       to complex objects.
255
256   paramspec = Glib::ParamSpec->string ($name, $nick, $blurb, $default_value,
257       $flags)
258       ·   $name (string)
259
260       ·   $nick (string)
261
262       ·   $blurb (string)
263
264       ·   $default_value (string)
265
266       ·   $flags (Glib::ParamFlags)
267
268   paramspec = Glib::ParamSpec->uchar ($name, $nick, $blurb, $minimum,
269       $maximum, $default_value, $flags)
270       ·   $name (string)
271
272       ·   $nick (string)
273
274       ·   $blurb (string)
275
276       ·   $minimum (unsigned)
277
278       ·   $maximum (unsigned)
279
280       ·   $default_value (unsigned)
281
282       ·   $flags (Glib::ParamFlags)
283
284   paramspec = Glib::ParamSpec->uint ($name, $nick, $blurb, $minimum,
285       $maximum, $default_value, $flags)
286       ·   $name (string)
287
288       ·   $nick (string)
289
290       ·   $blurb (string)
291
292       ·   $minimum (unsigned)
293
294       ·   $maximum (unsigned)
295
296       ·   $default_value (unsigned)
297
298       ·   $flags (Glib::ParamFlags)
299
300   paramspec = Glib::ParamSpec->uint64 ($name, $nick, $blurb, $minimum,
301       $maximum, $default_value, $flags)
302       ·   $name (string)
303
304       ·   $nick (string)
305
306       ·   $blurb (string)
307
308       ·   $minimum (Glib::UInt64)
309
310       ·   $maximum (Glib::UInt64)
311
312       ·   $default_value (Glib::UInt64)
313
314       ·   $flags (Glib::ParamFlags)
315
316   paramspec = Glib::ParamSpec->ulong ($name, $nick, $blurb, $minimum,
317       $maximum, $default_value, $flags)
318       ·   $name (string)
319
320       ·   $nick (string)
321
322       ·   $blurb (string)
323
324       ·   $minimum (unsigned)
325
326       ·   $maximum (unsigned)
327
328       ·   $default_value (unsigned)
329
330       ·   $flags (Glib::ParamFlags)
331
332   paramspec = Glib::ParamSpec->unichar ($name, $nick, $blurb, $default_value,
333       $flags)
334       ·   $name (string)
335
336       ·   $nick (string)
337
338       ·   $blurb (string)
339
340       ·   $default_value (character)
341
342       ·   $flags (Glib::ParamFlags)
343
344   string = $pspec->get_value_type
345   bool = $paramspec->value_validate ($value)
346   (bool, newval) = $paramspec->value_validate ($value)
347       ·   $value (scalar)
348
349       In scalar context return true if $value must be modified to be valid
350       for $paramspec, or false if it's valid already.  In array context
351       return also a new value which is $value made valid.
352
353       $value must be the right type for $paramspec (with usual stringizing,
354       numizing, etc).  "value_validate" checks the further restrictions such
355       as minimum and maximum for a numeric type or allowed characters in a
356       string.  The "made valid" return is then for instance clamped to the
357       min/max, or offending chars replaced by a substitutor.
358
359   integer = $pspec->values_cmp ($value1, $value2)
360       ·   $value1 (scalar)
361
362       ·   $value2 (scalar)
363
364       Compares value1 with value2 according to pspec, and returns -1, 0 or
365       +1, if value1 is found to be less than, equal to or greater than
366       value2, respectively.
367

ENUMS AND FLAGS

369   flags Glib::ParamFlags
370       ·   'readable' / 'G_PARAM_READABLE'
371
372       ·   'writable' / 'G_PARAM_WRITABLE'
373
374       ·   'construct' / 'G_PARAM_CONSTRUCT'
375
376       ·   'construct-only' / 'G_PARAM_CONSTRUCT_ONLY'
377
378       ·   'lax-validation' / 'G_PARAM_LAX_VALIDATION'
379
380       ·   'private' / 'G_PARAM_PRIVATE'
381

SEE ALSO

383       Glib
384
386       Copyright (C) 2003-2009 by the gtk2-perl team.
387
388       This software is licensed under the LGPL.  See Glib for a full notice.
389
390
391
392perl v5.12.1                      2010-07-07                Glib::ParamSpec(3)
Impressum