Struct
ClutterUnits
since: 13
Description [src]
struct ClutterUnits {
/* No available fields */
}
A logical distance unit
ClutterUnits is a structure holding a logical distance value along with
its type, expressed as a value of the ClutterUnitType enumeration. It is
possible to use ClutterUnits to store a position or a size in units
different than pixels, and convert them whenever needed (for instance
inside the Clutter.ActorClass.allocate virtual function, or inside the
Clutter.ActorClass.get_preferred_width and Clutter.ActorClass.get_preferred_height
virtual functions.
In order to register a ClutterUnits property, the ClutterParamSpecUnit
GParamSpec sub-class should be used:
GParamSpec *pspec;
pspec = clutter_param_spec_units ("active-width", NULL, NULL,
CLUTTER_UNIT_MM,
0.0, 12.0,
12.0,
G_PARAM_READWRITE);
g_object_class_install_property (gobject_class, PROP_WIDTH, pspec);
A GValue holding units can be manipulated using clutter_value_set_units()
and clutter_value_get_units(). GValues containing a ClutterUnits
value can also be transformed to GValues initialized with
G_TYPE_INT, G_TYPE_FLOAT and G_TYPE_STRING through implicit conversion
and using g_value_transform().
Available since: 13