GObject.ParamSpec¶
Methods¶
| class | is_valid_name (name) |
get_blurb () |
|
get_default_value () |
|
get_name () |
|
get_name_quark () |
|
get_nick () |
|
get_qdata (quark) |
|
get_redirect_target () |
|
set_qdata (quark, data) |
|
sink () |
|
steal_qdata (quark) |
Virtual Methods¶
do_finalize () |
|
do_value_set_default (value) |
|
do_value_validate (value) |
|
do_values_cmp (value1, value2) |
Fields¶
| Name | Type | Access | Description |
|---|---|---|---|
| flags | GObject.ParamFlags |
r | GObject.ParamFlags flags for this parameter |
| g_type_instance | GObject.TypeInstance |
r | private GObject.TypeInstance portion |
| name | str |
r | name of this parameter: always an interned string |
| owner_type | GObject.GType |
r | GObject.GType type that uses (introduces) this parameter |
| param_id | int |
r | |
| qdata | GLib.Data |
r | |
| ref_count | int |
r | |
| value_type | GObject.GType |
r | the GObject.Value type for this parameter |
Class Details¶
-
class
GObject.ParamSpec¶ Abstract: Yes Structure: GObject.ParamSpecClassGObject.ParamSpecis an object structure that encapsulates the metadata required to specify parameters, such as e.g.GObject.Objectproperties.- Parameter names
A property name consists of one or more segments consisting of ASCII letters and digits, separated by either the
-or_character. The first character of a property name must be a letter. These are the same rules as for signal naming (seeGObject.signal_new()).When creating and looking up a
GObject.ParamSpec, either separator can be used, but they cannot be mixed. Using-is considerably more efficient, and is the ‘canonical form’. Using_is discouraged.-
classmethod
is_valid_name(name)[source]¶ Parameters: name ( str) – the canonical name of the propertyReturns: Trueif name is a valid property name,Falseotherwise.Return type: boolValidate a property name for a
GObject.ParamSpec. This can be useful for dynamically-generated properties which need to be validated at run-time before actually trying to create them.See canonical parameter names for details of the rules for valid names.
New in version 2.66.
-
get_blurb()[source]¶ Returns: the short description of self. Return type: strGet the short description of a
GObject.ParamSpec.
-
get_default_value()[source]¶ Returns: a pointer to a GObject.Valuewhich must not be modifiedReturn type: GObject.ValueGets the default value of self as a pointer to a
GObject.Value.The
GObject.Valuewill remain valid for the life of self.New in version 2.38.
-
get_name()[source]¶ Returns: the name of self. Return type: strGet the name of a
GObject.ParamSpec.The name is always an “interned” string (as per
GLib.intern_string()). This allows for pointer-value comparisons.
-
get_name_quark()[source]¶ Returns: the GQuark for self->name. Return type: intGets the GQuark for the name.
New in version 2.46.
-
get_nick()[source]¶ Returns: the nickname of self. Return type: strGet the nickname of a
GObject.ParamSpec.
-
get_qdata(quark)[source]¶ Parameters: quark ( int) – a #GQuark, naming the user data pointerReturns: the user data pointer set, or NoneReturn type: objectorNoneGets back user data pointers stored via
GObject.ParamSpec.set_qdata().
-
get_redirect_target()[source]¶ Returns: paramspec to which requests on this paramspec should be redirected, or Noneif none.Return type: GObject.ParamSpecIf the paramspec redirects operations to another paramspec, returns that paramspec. Redirect is used typically for providing a new implementation of a property in a derived type while preserving all the properties from the parent type. Redirection is established by creating a property of type
GObject.ParamSpecOverride. SeeGObject.ObjectClass.override_property() for an example of the use of this capability.New in version 2.4.
-
set_qdata(quark, data)[source]¶ Parameters: Sets an opaque, named pointer on a
GObject.ParamSpec. The name is specified through a #GQuark (retrieved e.g. viaGLib.quark_from_static_string()), and the pointer can be gotten back from the self withGObject.ParamSpec.get_qdata(). Setting a previously set user data pointer, overrides (frees) the old pointer set, usingNoneas pointer essentially removes the data stored.
-
sink()[source]¶ The initial reference count of a newly created
GObject.ParamSpecis 1, even though no one has explicitly called g_param_spec_ref() on it yet. So the initial reference count is flagged as “floating”, until someone callsg_param_spec_ref (pspec); g_param_spec_sink (pspec);in sequence on it, taking over the initial reference count (thus ending up with a self that has a reference count of 1 still, but is not flagged “floating” anymore).
-
steal_qdata(quark)[source]¶ Parameters: quark ( int) – a #GQuark, naming the user data pointerReturns: the user data pointer set, or NoneReturn type: objectorNoneGets back user data pointers stored via
GObject.ParamSpec.set_qdata() and removes the data from self without invoking its destroy() function (if any was set). Usually, calling this function is only required to update user data pointers with a destroy notifier.
-
do_finalize() virtual¶
-
do_value_set_default(value) virtual¶ Parameters: value ( GObject.Value) –
-
do_value_validate(value) virtual¶ Parameters: value ( GObject.Value) –Return type: bool
-
do_values_cmp(value1, value2) virtual¶ Parameters: - value1 (
GObject.Value) – - value2 (
GObject.Value) –
Return type: - value1 (