libinstpatch Reference Manual | ||||
---|---|---|---|---|
Top | Description |
enum IpatchSplitsType; void (*IpatchTypePropGetFunc) (GType type
,GParamSpec *spec
,GValue *value
,GObject *object
); void ipatch_type_install_property (GParamSpec *prop_spec
); GParamSpec * ipatch_type_find_property (const char *name
); GParamSpec ** ipatch_type_list_properties (guint *n_properties
); GType * ipatch_type_find_types_with_property (const char *name
,const GValue *value
,guint *n_types
); void ipatch_type_set (GType type
,const char *first_property_name
,...
); void ipatch_type_set_valist (GType type
,const char *first_property_name
,va_list args
); void ipatch_type_set_property (GType type
,const char *property_name
,const GValue *value
); void ipatch_type_get (GType type
,const char *first_property_name
,...
); void ipatch_type_get_valist (GType type
,const char *first_property_name
,va_list args
); void ipatch_type_get_property (GType type
,const char *property_name
,GValue *value
); void ipatch_type_object_get (GObject *object
,const char *first_property_name
,...
); void ipatch_type_object_get_valist (GObject *object
,const char *first_property_name
,va_list args
); void ipatch_type_object_get_property (GObject *object
,const char *property_name
,GValue *value
); void ipatch_type_set_dynamic_func (GType type
,const char *property_name
,IpatchTypePropGetFunc func
); IpatchTypePropGetFunc ipatch_type_get_dynamic_func (GType type
,const char *property_name
);
Provides a registry system for adding GObject style properties to GTypes. This is used to describe certain properties of different objects, such as "category".
typedef enum { IPATCH_SPLITS_NONE, /* type does not have splits */ IPATCH_SPLITS_NORMAL, /* normal splits */ IPATCH_SPLITS_NO_OVERLAP /* splits do not overlap */ } IpatchSplitsType;
void (*IpatchTypePropGetFunc) (GType type
,GParamSpec *spec
,GValue *value
,GObject *object
);
A function type used for active type property callbacks. Allows for dynamic type properties that can return values depending on an object's state.
|
The GType of the type property |
|
The parameter specification |
|
Initialized value to store the type prop value in |
|
Object instance (might be NULL )
|
void ipatch_type_install_property (GParamSpec *prop_spec
);
Install a new GType property which can be used to associate arbitrary information to GTypes.
|
Specification for the new GType 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_type_find_property (const char *name
);
Lookup a GType property by name.
|
Name of GType property |
Returns : |
The matching GParamSpec or NULL if not found. The GParamSpec is
internal and should NOT be modified or freed.
|
GParamSpec ** ipatch_type_list_properties (guint *n_properties
);
Get a list of all registered GType properties.
|
Output: Length of returned array |
Returns : |
An array of GParamSpecs which should be freed when finished. |
GType * ipatch_type_find_types_with_property (const char *name
,const GValue *value
,guint *n_types
);
Get an array of types which have the given type property assigned and match
value
(optional, NULL
matches any value).
|
Name of type property |
|
Optional value to match to type property values (NULL to match any value)
|
|
Location to store count of types in returned array or NULL to ignore
|
Returns : |
Newly allocated 0 terminated array of types which have the named
property set or NULL if type property not found.
|
void ipatch_type_set (GType type
,const char *first_property_name
,...
);
Set GType properties. GType properties are used to associate arbitrary information with GTypes.
|
GType to set 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_type_set_valist (GType type
,const char *first_property_name
,va_list args
);
Like ipatch_type_set()
but uses a va_list.
|
GType to set 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_type_set_property (GType type
,const char *property_name
,const GValue *value
);
Set a single property of a GType.
|
GType to set property of |
|
Name of property to set |
|
Value to set the the property to. The value's type must be the same as the GType property's type. |
void ipatch_type_get (GType type
,const char *first_property_name
,...
);
Get GType property values.
|
GType to get 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_type_get_valist (GType type
,const char *first_property_name
,va_list args
);
Like ipatch_type_get()
but uses a va_list.
|
GType to get 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_type_get_property (GType type
,const char *property_name
,GValue *value
);
Get a single property from a GType.
|
GType to get 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. |
void ipatch_type_object_get (GObject *object
,const char *first_property_name
,...
);
Get GType property values. Like ipatch_type_get()
but takes an object
instance which can be used by any registered dynamic type property
functions.
|
Object instance to get type property 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_type_object_get_valist (GObject *object
,const char *first_property_name
,va_list args
);
void ipatch_type_object_get_property (GObject *object
,const char *property_name
,GValue *value
);
Get a single type property from an object
instance.
|
Object instance to get type 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. |
void ipatch_type_set_dynamic_func (GType type
,const char *property_name
,IpatchTypePropGetFunc func
);
Registers a callback function for dynamically getting the value of a type property.
Example: A dynamic property is created for SoundFont presets to return a different "virtual-parent-type" depending on if its a percussion or melodic preset (determined from a preset's bank number).
|
GType of the type property |
|
Name of a previously registered type property |
|
Callback function used for getting values for this type property |
IpatchTypePropGetFunc ipatch_type_get_dynamic_func (GType type
,const char *property_name
);
Get a the dynamic function registered for a given type
and property_name
with ipatch_type_set_dynamic_func()
. Also can be used as an indicator of
whether a type property is dynamic or not.
|
GType of the type property |
|
Name of a previously registered type property |
Returns : |
Pointer to the registered function or NULL if no function
registered (not a dynamic type property).
|