gobject.ParamSpec.ParamSpec Class Reference

List of all members.

Detailed Description

Description GParamSpec is an object structure that encapsulates the metadata required to specify parameters, such as e.g.

GObject properties. Parameter names need to start with a letter (a-z or A-Z). Subsequent characters can be letters, numbers or a '-'. All other characters are replaced by a '-' during construction. The result of this replacement is called the canonical name of the parameter.


Public Member Functions

GParamSpecgetParamSpecStruct ()
 this (GParamSpec *gParamSpec)
 Sets our main struct and passes it to the parent class.
ParamSpec ref ()
 Increments the reference count of pspec.
void unref ()
 Decrements the reference count of a pspec.
void sink ()
 The initial reference count of a newly created GParamSpec is 1, even though no one has explicitly called g_param_spec_ref() on it yet.
ParamSpec refSink ()
 Convenience function to ref and sink a GParamSpec.
void gParamValueSetDefault (Value value)
 Sets value to its default value as specified in pspec.
int gParamValueDefaults (Value value)
 Checks whether value contains the default value as specified in pspec.
int gParamValueValidate (Value value)
 Ensures that the contents of value comply with the specifications set out by pspec.
int gParamValueConvert (Value srcValue, Value destValue, int strictValidation)
 Transforms src_value into dest_value if possible, and then validates dest_value, in order for it to conform to pspec.
int gParamValuesCmp (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.
char[] getName ()
 Returns the name of a GParamSpec.
char[] getNick ()
 Returns the nickname of a GParamSpec.
char[] getBlurb ()
 Returns the short description of a GParamSpec.
void * getQdata (GQuark quark)
 Gets back user data pointers stored via g_param_spec_set_qdata().
void setQdata (GQuark quark, void *data)
 Sets an opaque, named pointer on a GParamSpec.
void setQdataFull (GQuark quark, void *data, GDestroyNotify destroy)
 This function works like g_param_spec_set_qdata(), 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 g_param_spec_set_qdata() with the same quark.
void * stealQdata (GQuark quark)
 Gets back user data pointers stored via g_param_spec_set_qdata() and removes the data from pspec without invoking it's destroy() function (if any was set).
ParamSpec getRedirectTarget ()
 If the paramspec redirects operations to another paramspec, returns that paramspec.

Static Public Member Functions

static void * internal (GType paramType, char[] name, char[] nick, char[] blurb, GParamFlags flags)
 Creates a new GParamSpec instance.
static GType gParamTypeRegisterStatic (char[] name, GParamSpecTypeInfo *pspecInfo)
 Registers name as the name of a new static type derived from G_TYPE_PARAM.
static GParamSpecPoolpoolNew (int typePrefixing)
 Creates a new GParamSpecPool.
static void poolInsert (GParamSpecPool *pool, ParamSpec pspec, GType ownerType)
 Inserts a GParamSpec in the pool.
static void poolRemove (GParamSpecPool *pool, ParamSpec pspec)
 Removes a GParamSpec from the pool.
static ParamSpec poolLookup (GParamSpecPool *pool, char[] paramName, GType ownerType, int walkAncestors)
 Looks up a GParamSpec in the pool.
static GParamSpec ** poolList (GParamSpecPool *pool, GType ownerType, uint *nPspecsP)
 Gets an array of all GParamSpecs owned by owner_type in the pool.
static ListG poolListOwned (GParamSpecPool *pool, GType ownerType)
 Gets an GList of all GParamSpecs owned by owner_type in the pool.

Protected Member Functions

void * getStruct ()
 the main Gtk struct as a void*

Protected Attributes

GParamSpecgParamSpec
 the main Gtk struct


Constructor & Destructor Documentation

gobject.ParamSpec.ParamSpec.this ( GParamSpec gParamSpec  ) 

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


Member Function Documentation

char [] gobject.ParamSpec.ParamSpec.getBlurb (  ) 

Returns the short description of a GParamSpec.

pspec: a valid GParamSpec Returns: the short description of pspec.

char [] gobject.ParamSpec.ParamSpec.getName (  ) 

Returns the name of a GParamSpec.

pspec: a valid GParamSpec Returns: the name of pspec.

char [] gobject.ParamSpec.ParamSpec.getNick (  ) 

Returns the nickname of a GParamSpec.

pspec: a valid GParamSpec Returns: the nickname of pspec.

GParamSpec* gobject.ParamSpec.ParamSpec.getParamSpecStruct (  ) 

void* gobject.ParamSpec.ParamSpec.getQdata ( GQuark  quark  ) 

Gets back user data pointers stored via g_param_spec_set_qdata().

pspec: a valid GParamSpec quark: a GQuark, naming the user data pointer Returns: the user data pointer set, or NULL

ParamSpec gobject.ParamSpec.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 g_object_override_property() for an example of the use of this capability. pspec: a GParamSpec Returns: paramspec to which requests on this paramspec should be redirected, or NULL if none. Since 2.4

void* gobject.ParamSpec.ParamSpec.getStruct (  )  [protected]

the main Gtk struct as a void*

static GType gobject.ParamSpec.ParamSpec.gParamTypeRegisterStatic ( char[]  name,
GParamSpecTypeInfo pspecInfo 
) [static]

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 GParamSpec type and its instances. name: 0-terminated string used as the name of the new GParamSpec type. pspec_info: The GParamSpecTypeInfo for this GParamSpec type. Returns: The new type identifier.

int gobject.ParamSpec.ParamSpec.gParamValueConvert ( Value  srcValue,
Value  destValue,
int  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. See also g_value_type_transformable(), g_value_transform() and g_param_value_validate(). pspec: a valid GParamSpec src_value: souce GValue dest_value: destination GValue of correct type for pspec strict_validation: TRUE requires dest_value to conform to pspec without modifications Returns: TRUE if transformation and validation were successful, FALSE otherwise and dest_value is left untouched.

int gobject.ParamSpec.ParamSpec.gParamValueDefaults ( Value  value  ) 

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

pspec: a valid GParamSpec value: a GValue of correct type for pspec Returns: whether value contains the canonical default for this pspec

int gobject.ParamSpec.ParamSpec.gParamValuesCmp ( 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.

pspec: a valid GParamSpec value1: a GValue of correct type for pspec value2: a GValue of correct type for pspec Returns: -1, 0 or +1, for a less than, equal to or greater than result

void gobject.ParamSpec.ParamSpec.gParamValueSetDefault ( Value  value  ) 

Sets value to its default value as specified in pspec.

pspec: a valid GParamSpec value: a GValue of correct type for pspec

int gobject.ParamSpec.ParamSpec.gParamValueValidate ( 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. pspec: a valid GParamSpec value: a GValue of correct type for pspec Returns: whether modifying value was necessary to ensure validity

static void* gobject.ParamSpec.ParamSpec.internal ( GType  paramType,
char[]  name,
char[]  nick,
char[]  blurb,
GParamFlags  flags 
) [static]

Creates a new GParamSpec instance.

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. Names which violate these rules lead to undefined behaviour. When creating and looking up a GParamSpec, either separator can be used, but they cannot be mixed. Using '-' is considerably more efficient and in fact required when using property names as detail strings for signals. param_type: the GType for the property; must be derived from G_TYPE_PARAM name: the canonical name of the property nick: the nickname of the property blurb: a short description of the property flags: a combination of GParamFlags Returns: a newly allocated GParamSpec instance

static void gobject.ParamSpec.ParamSpec.poolInsert ( GParamSpecPool pool,
ParamSpec  pspec,
GType  ownerType 
) [static]

Inserts a GParamSpec in the pool.

pool: a GParamSpecPool. pspec: the GParamSpec to insert owner_type: a GType identifying the owner of pspec

static GParamSpec** gobject.ParamSpec.ParamSpec.poolList ( GParamSpecPool pool,
GType  ownerType,
uint nPspecsP 
) [static]

Gets an array of all GParamSpecs owned by owner_type in the pool.

pool: a GParamSpecPool owner_type: the owner to look for n_pspecs_p: return location for the length of the returned array Returns: a newly allocated array containing pointers to all GParamSpecs owned by owner_type in the pool

static ListG gobject.ParamSpec.ParamSpec.poolListOwned ( GParamSpecPool pool,
GType  ownerType 
) [static]

Gets an GList of all GParamSpecs owned by owner_type in the pool.

pool: a GParamSpecPool owner_type: the owner to look for Returns: a GList of all GParamSpecs owned by owner_type in the poolGParamSpecs. See Also g_object_class_install_property(), g_object_set(), g_object_get(), g_object_set_property(), g_object_get_property(), g_value_register_transform_func()

static ParamSpec gobject.ParamSpec.ParamSpec.poolLookup ( GParamSpecPool pool,
char[]  paramName,
GType  ownerType,
int  walkAncestors 
) [static]

Looks up a GParamSpec in the pool.

pool: a GParamSpecPool param_name: the name to look for owner_type: the owner to look for walk_ancestors: If TRUE, also try to find a GParamSpec with param_name owned by an ancestor of owner_type. Returns: The found GParamSpec, or NULL if no matching GParamSpec was found.

static GParamSpecPool* gobject.ParamSpec.ParamSpec.poolNew ( int  typePrefixing  )  [static]

Creates a new GParamSpecPool.

If type_prefixing is TRUE, lookups in the newly created pool will allow to specify the owner as a colon-separated prefix of the property name, like "GtkContainer:border-width". This feature is deprecated, so you should always set type_prefixing to FALSE. type_prefixing: Whether the pool will support type-prefixed property names. Returns: a newly allocated GParamSpecPool.

static void gobject.ParamSpec.ParamSpec.poolRemove ( GParamSpecPool pool,
ParamSpec  pspec 
) [static]

Removes a GParamSpec from the pool.

pool: a GParamSpecPool pspec: the GParamSpec to remove

ParamSpec gobject.ParamSpec.ParamSpec.ref (  ) 

Increments the reference count of pspec.

pspec: a valid GParamSpec Returns: the GParamSpec that was passed into this function

ParamSpec gobject.ParamSpec.ParamSpec.refSink (  ) 

Convenience function to ref and sink a GParamSpec.

pspec: a valid GParamSpec Returns: the GParamSpec that was passed into this function Since 2.10

void gobject.ParamSpec.ParamSpec.setQdata ( GQuark  quark,
void *  data 
)

Sets an opaque, named pointer on a GParamSpec.

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 g_param_spec_get_qdata(). Setting a previously set user data pointer, overrides (frees) the old pointer set, using NULL as pointer essentially removes the data stored. pspec: the GParamSpec to set store a user data pointer quark: a GQuark, naming the user data pointer data: an opaque user data pointer

void gobject.ParamSpec.ParamSpec.setQdataFull ( GQuark  quark,
void *  data,
GDestroyNotify  destroy 
)

This function works like g_param_spec_set_qdata(), 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 g_param_spec_set_qdata() with the same quark.

pspec: the GParamSpec to set store a user data pointer quark: a GQuark, naming the user data pointer data: an opaque user data pointer destroy: function to invoke with data as argument, when data needs to be freed

void gobject.ParamSpec.ParamSpec.sink (  ) 

The initial reference count of a newly created GParamSpec is 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 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). pspec: a valid GParamSpec

void* gobject.ParamSpec.ParamSpec.stealQdata ( GQuark  quark  ) 

Gets back user data pointers stored via g_param_spec_set_qdata() and removes the data from pspec without invoking it's destroy() function (if any was set).

Usually, calling this function is only required to update user data pointers with a destroy notifier. pspec: the GParamSpec to get a stored user data pointer from quark: a GQuark, naming the user data pointer Returns: the user data pointer set, or NULL

void gobject.ParamSpec.ParamSpec.unref (  ) 

Decrements the reference count of a pspec.

pspec: a valid GParamSpec


Member Data Documentation

GParamSpec* gobject.ParamSpec.ParamSpec.gParamSpec [protected]

the main Gtk struct


SourceForge.net Logo DSource.org Logo digitalmars.com Logo