From a5fc90d4d99cf904abd60ed0be0356ecb1efb40a Mon Sep 17 00:00:00 2001 From: Emmanuele Bassi Date: Mon, 11 Oct 2010 15:20:25 +0100 Subject: [PATCH] actor-box: Register a progress function So that we can animate properties storing ClutterActorBox. --- clutter/clutter-actor.c | 32 ++++++++++++++++++++++++++++---- 1 file changed, 28 insertions(+), 4 deletions(-) diff --git a/clutter/clutter-actor.c b/clutter/clutter-actor.c index a9d3aba6c..326cd570b 100644 --- a/clutter/clutter-actor.c +++ b/clutter/clutter-actor.c @@ -9362,16 +9362,40 @@ clutter_actor_box_free (ClutterActorBox *box) g_slice_free (ClutterActorBox, box); } +static gboolean +clutter_actor_box_progress (const GValue *a, + const GValue *b, + gdouble factor, + GValue *retval) +{ + ClutterActorBox res = { 0, }; + + clutter_actor_box_interpolate (g_value_get_boxed (a), + g_value_get_boxed (b), + factor, + &res); + + g_value_set_boxed (retval, &res); + + return TRUE; +} + GType clutter_actor_box_get_type (void) { static GType our_type = 0; if (G_UNLIKELY (our_type == 0)) - our_type = - g_boxed_type_register_static (I_("ClutterActorBox"), - (GBoxedCopyFunc) clutter_actor_box_copy, - (GBoxedFreeFunc) clutter_actor_box_free); + { + our_type = + g_boxed_type_register_static (I_("ClutterActorBox"), + (GBoxedCopyFunc) clutter_actor_box_copy, + (GBoxedFreeFunc) clutter_actor_box_free); + + clutter_interval_register_progress_func (our_type, + clutter_actor_box_progress); + } + return our_type; }