libswami Reference Manual | ||||
---|---|---|---|---|
Top | Description |
void (*SwamiValueTransform) (const GValue *src
,GValue *dest
,gpointer user_data
); gboolean swami_param_get_limits (GParamSpec *pspec
,gdouble *min
,gdouble *max
,gdouble *def
,gboolean *integer
); gboolean swami_param_set_limits (GParamSpec *pspec
,gdouble min
,gdouble max
,gdouble def
); gboolean swami_param_type_has_limits (GType param_type
); gboolean swami_param_convert (GParamSpec *dest
,GParamSpec *src
); GParamSpec * swami_param_convert_new (GParamSpec *pspec
,GType value_type
); gboolean swami_param_type_transformable (GType src_type
,GType dest_type
); gboolean swami_param_type_transformable_value (GType src_valtype
,GType dest_valtype
); gboolean swami_param_transform (GParamSpec *dest
,GParamSpec *src
,SwamiValueTransform trans
,gpointer user_data
); GParamSpec * swami_param_transform_new (GParamSpec *dest
,GType value_type
,SwamiValueTransform trans
,gpointer user_data
); GType swami_param_type_from_value_type (GType value_type
);
void (*SwamiValueTransform) (const GValue *src
,GValue *dest
,gpointer user_data
);
Prototype for value transform function. The transform function should handle any value conversions required.
|
Source value to transform from |
|
Destination value to store to |
|
User defined data (set when transform was connected for example) |
gboolean swami_param_get_limits (GParamSpec *pspec
,gdouble *min
,gdouble *max
,gdouble *def
,gboolean *integer
);
Get limits of a numeric parameter specification.
|
GParamSpec to get limits of |
|
Output: Minimum value of parameter specification |
|
Output: Maximum value of parameter specification |
|
Output: Default value of parameter specification |
|
Output: TRUE if integer parameter spec, FALSE if floating point
|
Returns : |
TRUE if pspec is numeric, FALSE otherwise (in which case
output variables are undefined)
|
gboolean swami_param_set_limits (GParamSpec *pspec
,gdouble min
,gdouble max
,gdouble def
);
Set limits of a numeric parameter specification.
gboolean swami_param_type_has_limits (GType param_type
);
Check if a given GParamSpec type can be used with swami_param_get_limits()
and swami_param_set_limits()
.
|
GParamSpec type |
Returns : |
TRUE if can get/set limits, FALSE otherwise
|
gboolean swami_param_convert (GParamSpec *dest
,GParamSpec *src
);
Convert parameter limits between two numeric parameter specifications, also
copies the "unit-type" and "float-digit" parameter properties. Sets
"float-digits" to 0 on the dest
parameter spec if the source is an integer
type.
GParamSpec * swami_param_convert_new (GParamSpec *pspec
,GType value_type
);
Create a new parameter spec using values of value_type
and convert
pspec
to the new parameter spec.
|
Source parameter spec to convert |
|
Value type of new parameter spec |
Returns : |
New parameter spec that uses value_type or NULL on error
(unable to convert pspec to value_type )
|
gboolean swami_param_type_transformable (GType src_type
,GType dest_type
);
Check if a source GParamSpec type is transformable to a destination type.
|
Source GParamSpec type. |
|
Destination GParamSpec type. |
Returns : |
TRUE on success, FALSE otherwise
|
gboolean swami_param_type_transformable_value (GType src_valtype
,GType dest_valtype
);
Check if a source GParamSpec type is transformable to a destination type by corresponding GValue types.
gboolean swami_param_transform (GParamSpec *dest
,GParamSpec *src
,SwamiValueTransform trans
,gpointer user_data
);
Convert parameter limits between two numeric parameter specifications using
a custom transform function. The trans
parameter specifies the transform
function which is called for the min, max and default values of the src
parameter spec, which are then assigned to dest
. The source and destination
GValue parameters to the transform function are of G_TYPE_DOUBLE.
|
Source param specification to get limits from |
|
Destination param specification to set limits of |
|
Transform function |
|
User defined data passed to transform function |
Returns : |
TRUE if both parameter specs are numeric, FALSE otherwise
(in which case dest will be unchanged).
|
GParamSpec * swami_param_transform_new (GParamSpec *dest
,GType value_type
,SwamiValueTransform trans
,gpointer user_data
);
Create a new parameter spec using values of value_type
and transform
pspec
to the new parameter spec using a custom transform function.
See swami_param_transform()
for more details.
|
Source parameter spec to convert |
|
Value type of new parameter spec |
|
Transform function |
|
User defined data passed to transform function |
Returns : |
New parameter spec that uses value_type or NULL on error
(error message is then printed)
|