ParamSpec

gobject.param_spec.ParamSpec encapsulates the metadata required to specify parameters, such as gobject.object.ObjectG properties.

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 (see func@GObject.signal_new).

When creating and looking up a gobject.param_spec.ParamSpec, either separator can be used, but they cannot be mixed. Using - is considerably more efficient, and is the ‘canonical form’. Using _ is discouraged.

Destructor

A destructor is present on this object, but not explicitly documented in the source.

Members

Functions

getBlurb
string getBlurb()

Get the short description of a #GParamSpec.

getDefaultValue
gobject.value.Value getDefaultValue()

Gets the default value of pspec as a pointer to a #GValue.

getName
string getName()

Get the name of a #GParamSpec.

getNameQuark
glib.types.Quark getNameQuark()

Gets the GQuark for the name.

getNick
string getNick()

Get the nickname of a #GParamSpec.

getQdata
void* getQdata(glib.types.Quark quark)

Gets back user data pointers stored via gobject.param_spec.ParamSpec.setQdata.

getRedirectTarget
gobject.param_spec.ParamSpec getRedirectTarget()

If 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 #GParamSpecOverride. See gobject.object_class.ObjectClass.overrideProperty for an example of the use of this capability.

setQdata
void setQdata(glib.types.Quark quark, void* data)

Sets an opaque, named pointer on a #GParamSpec. The name is specified through a #GQuark (retrieved e.g. via glib.global.quarkFromStaticString), and the pointer can be gotten back from the pspec with gobject.param_spec.ParamSpec.getQdata. Setting a previously set user data pointer, overrides (frees) the old pointer set, using null as pointer essentially removes the data stored.

sink
void sink()

The initial reference count of a newly created #GParamSpec is 1, even though no one has explicitly called gobject.param_spec.ParamSpec.ref_ on it yet. So the initial reference count is flagged as "floating", until someone calls `g_param_spec_ref (pspec); g_param_spec_sink (pspec);` in sequence on it, taking over the initial reference count (thus ending up with a pspec that has a reference count of 1 still, but is not flagged "floating" anymore).

stealQdata
void* stealQdata(glib.types.Quark quark)

Gets back user data pointers stored via gobject.param_spec.ParamSpec.setQdata and removes the data from pspec 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.

Static functions

isValidName
bool isValidName(string name)

Validate a property name for a #GParamSpec. This can be useful for dynamically-generated properties which need to be validated at run-time before actually trying to create them.