Codex

Glib::ParamSpec

Section: User Contributed Perl Documentation (3pm)

Updated: 2014-08-29

Index?action=index Return to Main Contents


NAME

Glib::ParamSpec - Wrapper to encapsulate metadate needed to specify parameters

HIERARCHY

void DESTROY (GParamSpec * pspec)

    CODE: g_param_spec_unref (pspec);

DESCRIPTION

Glib::ParamSpec encapsulates the metadata required to specify parameters. You will see these most often when creating new Glib::Object types; see and Glib::Object::Subclass.

Parameter specifications allow you to provide limits for validation as well as nicknames and blurbs to document the parameters. Blurbs show up in reference documentation such as this page or the gtk+ C API reference; i'm not really sure where the nicknames get used. The Perl bindings for the most part ignore the difference between dashes and underscores in the paramspec names, which typically find use as the actual keys for object parameters.

It's worth noting that Glib offers various sizes of integer and floating point values, while Perl really only deals with full integers and double precision floating point values. The size distinction is important for the underlying C libraries.

METHODS

paramspec = Glib::ParamSpec->IV ($name, $nick, $blurb, $minimum, $maximum, $default_value, $flags)

(string):
(string):
(string):
(integer):
(integer):
(integer):
(Glib::ParamFlags):

paramspec = Glib::ParamSpec->UV ($name, $nick, $blurb, $minimum, $maximum, $default_value, $flags)

(string):
(string):
(string):
(unsigned):
(unsigned):
(unsigned):
(Glib::ParamFlags):

string = $pspec->get_blurb

paramspec = Glib::ParamSpec->boolean ($name, $nick, $blurb, $default_value, $flags)

(string):
(string):
(string):
(boolean):
(Glib::ParamFlags):

paramspec = Glib::ParamSpec->boxed ($name, $nick, $blurb, $package, $flags)

(string):
(string):
(string):
(string) name of the class, derived from Glib::Boxed, of the objects this property will hold.:
(Glib::ParamFlags):

paramspec = Glib::ParamSpec->char ($name, $nick, $blurb, $minimum, $maximum, $default_value, $flags)

(string):
(string):
(string):
(integer):
(integer):
(integer):
(Glib::ParamFlags):

scalar = $pspec->get_default_value

(This is the C level function.)
Note that on a the return is a single-char string. This is the same as the constructor , but it's not the same as / , so an conversion is needed if passing the default value to a unichar .

paramspec = Glib::ParamSpec->double ($name, $nick, $blurb, $minimum, $maximum, $default_value, $flags)

(string):
(string):
(string):
(double):
(double):
(double):
(Glib::ParamFlags):

paramspec = Glib::ParamSpec->enum ($name, $nick, $blurb, $enum_type, $default_value, $flags)

(string):
(string):
(string):
(string):
(scalar):
(Glib::ParamFlags):

paramspec = Glib::ParamSpec->flags ($name, $nick, $blurb, $flags_type, $default_value, $flags)

(string):
(string):
(string):
(string):
(scalar):
(Glib::ParamFlags):

paramflags = $pspec->get_flags

paramspec = Glib::ParamSpec->float ($name, $nick, $blurb, $minimum, $maximum, $default_value, $flags)

(string):
(string):
(string):
(double):
(double):
(double):
(Glib::ParamFlags):

paramspec = Glib::ParamSpec->gtype ($name, $nick, $blurb, $is_a_type, $flags)

(string):
(string):
(string):
(string or undef) The name of a class whose subtypes are allowed as values of the property. Use to allow any type.:
(Glib::ParamFlags):

Since: glib 2.10

paramspec = Glib::ParamSpec->int ($name, $nick, $blurb, $minimum, $maximum, $default_value, $flags)

(string):
(string):
(string):
(integer):
(integer):
(integer):
(Glib::ParamFlags):

paramspec = Glib::ParamSpec->int64 ($name, $nick, $blurb, $minimum, $maximum, $default_value, $flags)

(string):
(string):
(string):
(64 bit integer):
(64 bit integer):
(64 bit integer):
(Glib::ParamFlags):

paramspec = Glib::ParamSpec->long ($name, $nick, $blurb, $minimum, $maximum, $default_value, $flags)

(string):
(string):
(string):
(integer):
(integer):
(integer):
(Glib::ParamFlags):

string = $paramspec->get_name

Dashes in the name are converted to underscores.

string = $pspec->get_nick

paramspec = Glib::ParamSpec->object ($name, $nick, $blurb, $package, $flags)

(string):
(string):
(string):
(string) name of the class, derived from Glib::Object, of the objects this property will hold.:
(Glib::ParamFlags):

paramspec = Glib::ParamSpec->override ($name, $overridden)

(string):
(Glib::ParamSpec):

Since: glib 2.4

string = $pspec->get_owner_type

paramspec = Glib::ParamSpec->param_spec ($name, $nick, $blurb, $package, $flags)

(string):
(string):
(string):
(string) name of the class, derived from Glib::ParamSpec, of the objects this property will hold.:
(Glib::ParamFlags):

paramspec or undef = $pspec->get_redirect_target

Since: glib 2.4

paramspec = Glib::ParamSpec->scalar ($name, $nick, $blurb, $flags)

(string):
(string):
(string):
(Glib::ParamFlags):

ParamSpec to be used for any generic perl scalar, including references to complex objects.

Currently cannot set object properties of this type (there's no hooks for property value parsing, as of Gtk 2.20), so prefer the builtin types if buildable support for an object matters. A of can give an array of strings. A signal handler callback can do most of what a coderef might.

paramspec = Glib::ParamSpec->string ($name, $nick, $blurb, $default_value, $flags)

(string):
(string):
(string):
(string or undef):
(Glib::ParamFlags):

paramspec = Glib::ParamSpec->uchar ($name, $nick, $blurb, $minimum, $maximum, $default_value, $flags)

(string):
(string):
(string):
(unsigned):
(unsigned):
(unsigned):
(Glib::ParamFlags):

paramspec = Glib::ParamSpec->uint ($name, $nick, $blurb, $minimum, $maximum, $default_value, $flags)

(string):
(string):
(string):
(unsigned):
(unsigned):
(unsigned):
(Glib::ParamFlags):

paramspec = Glib::ParamSpec->uint64 ($name, $nick, $blurb, $minimum, $maximum, $default_value, $flags)

(string):
(string):
(string):
(64 bit unsigned):
(64 bit unsigned):
(64 bit unsigned):
(Glib::ParamFlags):

paramspec = Glib::ParamSpec->ulong ($name, $nick, $blurb, $minimum, $maximum, $default_value, $flags)

(string):
(string):
(string):
(unsigned):
(unsigned):
(unsigned):
(Glib::ParamFlags):

paramspec = Glib::ParamSpec->unichar ($name, $nick, $blurb, $default_value, $flags)

(string):
(string):
(string):
(character):
(Glib::ParamFlags):

string = $pspec->get_value_type

bool = $paramspec->value_validate ($value)

(bool, newval) = $paramspec->value_validate ($value)

(scalar):
In scalar context return true if must be modified to be valid for , or false if it's valid already. In array context return also a new value which is made valid.
must be the right type for (with usual stringizing, numizing, etc). checks the further restrictions such as minimum and maximum for a numeric type or allowed characters in a string. The ``made valid'' return is then for instance clamped to the min/max, or offending chars replaced by a substitutor.

integer = $pspec->values_cmp ($value1, $value2)

(scalar):
(scalar):

Compares value1 with value2 according to pspec, and returns -1, 0 or +1, if value1 is found to be less than, equal to or greater than value2, respectively.

ENUMS AND FLAGS

flags Glib::ParamFlags

'readable' / 'G_PARAM_READABLE':
'writable' / 'G_PARAM_WRITABLE':
'construct' / 'G_PARAM_CONSTRUCT':
'construct-only' / 'G_PARAM_CONSTRUCT_ONLY':
'lax-validation' / 'G_PARAM_LAX_VALIDATION':
'private' / 'G_PARAM_PRIVATE':

SEE ALSO

Glib

COPYRIGHT

Copyright (C) 2003-2011 by the gtk2-perl team.

This software is licensed under the LGPL. See Glib for a full notice.


Index

NAME

HIERARCHY

DESCRIPTION

METHODS

paramspec = Glib::ParamSpec->IV ($name, $nick, $blurb, $minimum, $maximum, $default_value, $flags)

paramspec = Glib::ParamSpec->UV ($name, $nick, $blurb, $minimum, $maximum, $default_value, $flags)

string = $pspec->get_blurb

paramspec = Glib::ParamSpec->boolean ($name, $nick, $blurb, $default_value, $flags)

paramspec = Glib::ParamSpec->boxed ($name, $nick, $blurb, $package, $flags)

paramspec = Glib::ParamSpec->char ($name, $nick, $blurb, $minimum, $maximum, $default_value, $flags)

scalar = $pspec->get_default_value

paramspec = Glib::ParamSpec->double ($name, $nick, $blurb, $minimum, $maximum, $default_value, $flags)

paramspec = Glib::ParamSpec->enum ($name, $nick, $blurb, $enum_type, $default_value, $flags)

paramspec = Glib::ParamSpec->flags ($name, $nick, $blurb, $flags_type, $default_value, $flags)

paramflags = $pspec->get_flags

paramspec = Glib::ParamSpec->float ($name, $nick, $blurb, $minimum, $maximum, $default_value, $flags)

paramspec = Glib::ParamSpec->gtype ($name, $nick, $blurb, $is_a_type, $flags)

paramspec = Glib::ParamSpec->int ($name, $nick, $blurb, $minimum, $maximum, $default_value, $flags)

paramspec = Glib::ParamSpec->int64 ($name, $nick, $blurb, $minimum, $maximum, $default_value, $flags)

paramspec = Glib::ParamSpec->long ($name, $nick, $blurb, $minimum, $maximum, $default_value, $flags)

string = $paramspec->get_name

string = $pspec->get_nick

paramspec = Glib::ParamSpec->object ($name, $nick, $blurb, $package, $flags)

paramspec = Glib::ParamSpec->override ($name, $overridden)

string = $pspec->get_owner_type

paramspec = Glib::ParamSpec->param_spec ($name, $nick, $blurb, $package, $flags)

paramspec or undef = $pspec->get_redirect_target

paramspec = Glib::ParamSpec->scalar ($name, $nick, $blurb, $flags)

paramspec = Glib::ParamSpec->string ($name, $nick, $blurb, $default_value, $flags)

paramspec = Glib::ParamSpec->uchar ($name, $nick, $blurb, $minimum, $maximum, $default_value, $flags)

paramspec = Glib::ParamSpec->uint ($name, $nick, $blurb, $minimum, $maximum, $default_value, $flags)

paramspec = Glib::ParamSpec->uint64 ($name, $nick, $blurb, $minimum, $maximum, $default_value, $flags)

paramspec = Glib::ParamSpec->ulong ($name, $nick, $blurb, $minimum, $maximum, $default_value, $flags)

paramspec = Glib::ParamSpec->unichar ($name, $nick, $blurb, $default_value, $flags)

string = $pspec->get_value_type

bool = $paramspec->value_validate ($value)

(bool, newval) = $paramspec->value_validate ($value)

integer = $pspec->values_cmp ($value1, $value2)

ENUMS AND FLAGS

flags Glib::ParamFlags

SEE ALSO

COPYRIGHT