| Top |
| LwRange * | lw_range_copy () |
| void | lw_range_free () |
| #define | lw_range_clamp() |
| #define | lw_range_clampf() |
| #define | lw_range_rand() |
| #define | lw_range_randf() |
| gboolean | lw_range_get_range_mapping () |
| GVariant * | lw_range_set_range_mapping () |
LwRange is used to give a plugin more diversity by using random values between a specific minimum and maximum value. The advantage of LwRange is, that you only have to handle one property instead of two.
The main purpose of LwRange is to get a minimum and a maximum value from the configurator, so the first step is to create such a key in your
GSettings schema file.The next step is to create a property that can hold a LwRange and bind
the property to the key from the schema file by using lw_settings_bind_range().
You have to create the property with g_param_spec_boxed() to hold a LwRange.
The example plugins hold some example code for how to use a LwRange.
LwRange *
lw_range_copy (const LwRange *range);
Makes a copy of a LwRange structure.
Since: 0.4
void
lw_range_free (LwRange *range);
Frees a LwRange structure created with lw_range_copy().
Since: 0.4
gboolean lw_range_get_range_mapping (GValue *value,GVariant *variant,gpointer p);
This function is used to convert a GSettings key to a LwRange.
Use this function as get mapping function of g_settings_bind_with_mapping()
or take a look at the lw_settings_bind_range() macro.
value |
Return location for the property value |
|
variant |
The GVariant |
|
p |
User data that was specified when the binding was created |
Since: 0.4
GVariant * lw_range_set_range_mapping (const GValue *value,const GVariantType *type,gpointer p);
This function is used to convert a LwRange to a GSettings key.
Use this function as set mapping function of g_settings_bind_with_mapping()
or take a look at the lw_settings_bind_range() macro.
value |
A GValue containing the property value to map |
|
type |
The GVariantType to create |
|
p |
User data that was specified when the binding was created |
Since: 0.4