libinstpatch Reference Manual | ||||
---|---|---|---|---|
Top | Description |
#define IPATCH_PARAM_USER_SHIFT void ipatch_param_install_property (GParamSpec *prop_spec
); GParamSpec * ipatch_param_find_property (const char *name
); GParamSpec ** ipatch_param_list_properties (guint *n_properties
); GParamSpec * ipatch_param_set (GParamSpec *spec
,const char *first_property_name
,...
); void ipatch_param_set_valist (GParamSpec *spec
,const char *first_property_name
,va_list args
); void ipatch_param_set_property (GParamSpec *spec
,const char *property_name
,const GValue *value
); void ipatch_param_get (GParamSpec *spec
,const char *first_property_name
,...
); void ipatch_param_get_valist (GParamSpec *spec
,const char *first_property_name
,va_list args
); gboolean ipatch_param_get_property (GParamSpec *spec
,const char *property_name
,GValue *value
);
Extensions to standard GParamSpec include flags (for compact single bit data extensions) and GValue based extensions. An example of usage is the IPATCH_PARAM_UNIQUE flag which indicates a parameter that should be unique amongst sibling items and the "string-max-length" integer GValue which specifies a max length of a GParamSpecString parameter.
void ipatch_param_install_property (GParamSpec *prop_spec
);
Install a new GParamSpec property which can be used to extend existing GParamSpec types or define common parameters shared by all types. An example property is the "string-max-length" property which defines a max length for use with GParamSpecString properties.
|
Specification for the new GParamSpec property. Ownership of the GParamSpec is taken over by this function. The name field of the GParamSpec should be a static string and is used as the property's ID. |
GParamSpec * ipatch_param_find_property (const char *name
);
Lookup a GParamSpec property by name.
|
Name of GParamSpec property |
Returns : |
The matching GParamSpec or NULL if not found. The GParamSpec is
internal and should NOT be modified or freed.
|
GParamSpec ** ipatch_param_list_properties (guint *n_properties
);
Get a list of all registered GParamSpec properties.
|
Output: Length of returned array |
Returns : |
An array of GParamSpecs which should be freed when finished. |
GParamSpec * ipatch_param_set (GParamSpec *spec
,const char *first_property_name
,...
);
Set extended parameter properties. Parameter properties are used to extend existing GParamSpec types. "string-max-length" is an example of an extended property, which is used for GParamSpecString parameters to define the max allowed length.
|
Parameter spec to set extended properties of |
|
Name of first property to set |
|
Value of first property to set and optionally followed by more
property name/value pairs, terminated with NULL name.
|
Returns : |
The spec pointer for convenience, makes it easy to create/install
a parameter spec and set its properties at the same time.
|
void ipatch_param_set_valist (GParamSpec *spec
,const char *first_property_name
,va_list args
);
Like ipatch_param_set()
but uses a va_list.
|
Parameter spec to set extended properties of |
|
Name of first property to set |
|
Value of first property to set and optionally followed by more
property name/value pairs, terminated with NULL name.
|
void ipatch_param_set_property (GParamSpec *spec
,const char *property_name
,const GValue *value
);
Set a single extended parameter property of a GParamSpec.
|
Parameter spec to set an extended property of |
|
Name of property to set |
|
Value to set the the property to. The value's type must be the same as the parameter property's type. |
void ipatch_param_get (GParamSpec *spec
,const char *first_property_name
,...
);
Get extended parameter properties. Parameter properties are used to extend existing GParamSpec types. "string-max-length" is an example of an extended property, which is used for GParamSpecString parameters to define the max allowed length.
|
Parameter spec to get extended properties from |
|
Name of first property to get |
|
Pointer to store first property value and optionally followed
by more property name/value pairs, terminated with NULL name.
|
void ipatch_param_get_valist (GParamSpec *spec
,const char *first_property_name
,va_list args
);
Like ipatch_param_get()
but uses a va_list.
|
Parameter spec to get extended properties from |
|
Name of first property to get |
|
Pointer to store first property value and optionally followed
by more property name/value pairs, terminated with NULL name.
|
gboolean ipatch_param_get_property (GParamSpec *spec
,const char *property_name
,GValue *value
);
Get a single extended parameter property from a GParamSpec.
|
Parameter spec to get an extended property from |
|
Name of property to get |
|
An initialized value to store the property value in. The value's type must be a type that the property can be transformed to. |
Returns : |
TRUE if the parameter property is set, FALSE otherwise (in which
case value will contain the default value for this property).
|