mirror of
https://github.com/brl/mutter.git
synced 2024-12-23 03:22:04 +00:00
2008-04-17 Emmanuele Bassi <ebassi@openedhand.com>
* clutter/clutter-fixed.c: (clutter_value_transform_fixed_int), (clutter_value_transform_fixed_double), (clutter_value_transform_fixed_float), (clutter_fixed_get_type): Add GValue transformation functions for ClutterFixed; copying a CLUTTER_TYPE_FIXED GValue into a G_TYPE_FLOAT/G_TYPE_DOUBLE one will automatically transform the fixed point representation into a floating point one. Also add the G_TYPE_INT transformation function to do a plain fixed->int copy. * clutter/clutter-units.c: (clutter_value_transform_unit_int), (clutter_unit_get_type): Add a unit->int transformation function.
This commit is contained in:
parent
fa3b3e7f55
commit
fd70c7df49
17
ChangeLog
17
ChangeLog
@ -1,3 +1,20 @@
|
||||
2008-04-17 Emmanuele Bassi <ebassi@openedhand.com>
|
||||
|
||||
* clutter/clutter-fixed.c:
|
||||
(clutter_value_transform_fixed_int),
|
||||
(clutter_value_transform_fixed_double),
|
||||
(clutter_value_transform_fixed_float),
|
||||
(clutter_fixed_get_type): Add GValue transformation functions
|
||||
for ClutterFixed; copying a CLUTTER_TYPE_FIXED GValue into
|
||||
a G_TYPE_FLOAT/G_TYPE_DOUBLE one will automatically transform
|
||||
the fixed point representation into a floating point one. Also
|
||||
add the G_TYPE_INT transformation function to do a plain
|
||||
fixed->int copy.
|
||||
|
||||
* clutter/clutter-units.c:
|
||||
(clutter_value_transform_unit_int),
|
||||
(clutter_unit_get_type): Add a unit->int transformation function.
|
||||
|
||||
2008-04-17 Emmanuele Bassi <ebassi@openedhand.com>
|
||||
|
||||
* clutter/clutter-fixed.c (clutter_value_get_fixed): Fix typo
|
||||
|
@ -1031,6 +1031,27 @@ clutter_value_lcopy_fixed (const GValue *value,
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static void
|
||||
clutter_value_transform_fixed_int (const GValue *src,
|
||||
GValue *dest)
|
||||
{
|
||||
dest->data[0].v_int = src->data[0].v_int;
|
||||
}
|
||||
|
||||
static void
|
||||
clutter_value_transform_fixed_double (const GValue *src,
|
||||
GValue *dest)
|
||||
{
|
||||
dest->data[0].v_double = CLUTTER_FIXED_TO_DOUBLE (src->data[0].v_int);
|
||||
}
|
||||
|
||||
static void
|
||||
clutter_value_transform_fixed_float (const GValue *src,
|
||||
GValue *dest)
|
||||
{
|
||||
dest->data[0].v_float = CLUTTER_FIXED_TO_FLOAT (src->data[0].v_int);
|
||||
}
|
||||
|
||||
static const GTypeValueTable _clutter_fixed_value_table = {
|
||||
clutter_value_init_fixed,
|
||||
NULL,
|
||||
@ -1054,6 +1075,13 @@ clutter_fixed_get_type (void)
|
||||
g_type_register_fundamental (g_type_fundamental_next (),
|
||||
I_("ClutterFixed"),
|
||||
&_info, &_finfo, 0);
|
||||
|
||||
g_value_register_transform_func (_clutter_fixed_type, G_TYPE_INT,
|
||||
clutter_value_transform_fixed_int);
|
||||
g_value_register_transform_func (_clutter_fixed_type, G_TYPE_FLOAT,
|
||||
clutter_value_transform_fixed_float);
|
||||
g_value_register_transform_func (_clutter_fixed_type, G_TYPE_DOUBLE,
|
||||
clutter_value_transform_fixed_double);
|
||||
}
|
||||
|
||||
return _clutter_fixed_type;
|
||||
|
@ -110,6 +110,13 @@ clutter_value_lcopy_unit (const GValue *value,
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static void
|
||||
clutter_value_transform_unit_int (const GValue *src,
|
||||
GValue *dest)
|
||||
{
|
||||
dest->data[0].v_int = src->data[0].v_int;
|
||||
}
|
||||
|
||||
static const GTypeValueTable _clutter_unit_value_table = {
|
||||
clutter_value_init_unit,
|
||||
NULL,
|
||||
@ -133,6 +140,9 @@ clutter_unit_get_type (void)
|
||||
g_type_register_fundamental (g_type_fundamental_next (),
|
||||
I_("ClutterUnit"),
|
||||
&_info, &_finfo, 0);
|
||||
|
||||
g_value_register_transform_func (_clutter_unit_type, G_TYPE_INT,
|
||||
clutter_value_transform_unit_int);
|
||||
}
|
||||
|
||||
return _clutter_unit_type;
|
||||
|
Loading…
Reference in New Issue
Block a user