ParamSpec

gobject.ParamSpec is an object structure that encapsulates the metadata required to specify parameters, such as e.g. GObject properties.

Parameter names # {[canonical-parameter-name|canonical-parameter-names]}

A property name consists of 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 g_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.

Constructors

this
this(GParamSpec* gParamSpec, bool ownedRef)

Sets our main struct and passes it to the parent class.

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 gobject.ParamSpec

getDefaultValue
Value getDefaultValue()

Gets the default value of pspec as a pointer to a gobject.Value

getName
string getName()

Get the name of a gobject.ParamSpec

getNameQuark
GQuark getNameQuark()

Gets the GQuark for the name.

getNick
string getNick()

Get the nickname of a gobject.ParamSpec

getParamSpecStruct
GParamSpec* getParamSpecStruct(bool transferOwnership)

Get the main Gtk struct

getQdata
void* getQdata(GQuark quark)

Gets back user data pointers stored via ParamSpec.setQdata.

getRedirectTarget
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 ObjectClass.overrideProperty for an example of the use of this capability.

getStruct
void* getStruct()

the main Gtk struct as a void*

refSink
ParamSpec refSink()

Convenience function to ref and sink a gobject.ParamSpec

ref_
ParamSpec ref_()

Increments the reference count of pspec.

setQdata
void setQdata(GQuark quark, void* data)

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

setQdataFull
void setQdataFull(GQuark quark, void* data, GDestroyNotify destroy)

This function works like ParamSpec.setQdata, but in addition, a void (*destroy) (gpointer) function may be specified which is called with data as argument when the pspec is finalized, or the data is being overwritten by a call to ParamSpec.setQdata with the same quark.

sink
void sink()

The initial reference count of a newly created gobject.ParamSpec is 1, even though no one has explicitly called 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(GQuark quark)

Gets back user data pointers stored via 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.

unref
void unref()

Decrements the reference count of a pspec.

Static functions

internal
ParamSpec internal(GType paramType, string name, string nick, string blurb, GParamFlags flags)

Creates a new gobject.ParamSpec instance.

paramTypeRegisterStatic
GType paramTypeRegisterStatic(string name, GParamSpecTypeInfo* pspecInfo)

Registers name as the name of a new static type derived from G_TYPE_PARAM The type system uses the information contained in the GParamSpecTypeInfo structure pointed to by info to manage the gobject.ParamSpec type and its instances.

paramValueConvert
bool paramValueConvert(ParamSpec pspec, Value srcValue, Value destValue, bool strictValidation)

Transforms src_value into dest_value if possible, and then validates dest_value, in order for it to conform to pspec. If strict_validation is TRUE this function will only succeed if the transformed dest_value complied to pspec without modifications.

paramValueDefaults
bool paramValueDefaults(ParamSpec pspec, Value value)

Checks whether value contains the default value as specified in pspec.

paramValueSetDefault
void paramValueSetDefault(ParamSpec pspec, Value value)

Sets value to its default value as specified in pspec.

paramValueValidate
bool paramValueValidate(ParamSpec pspec, Value value)

Ensures that the contents of value comply with the specifications set out by pspec. For example, a GParamSpecInt might require that integers stored in value may not be smaller than -42 and not be greater than +42. If value contains an integer outside of this range, it is modified accordingly, so the resulting value will fit into the range -42 .. +42.

paramValuesCmp
int paramValuesCmp(ParamSpec pspec, Value value1, Value value2)

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

Variables

gParamSpec
GParamSpec* gParamSpec;

the main Gtk struct