From c291d5a660f4ebac3dc57acad79b8153686a47f0 Mon Sep 17 00:00:00 2001 From: Emmanuele Bassi Date: Thu, 25 Feb 2010 14:08:57 +0000 Subject: [PATCH] animator: Add a :timeline property It would be useful to be able to share the Timeline across different animator instances, or with different animation constructs. Also this allows sharing definitions of Timelines in ClutterScript. --- clutter/clutter-animator.c | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/clutter/clutter-animator.c b/clutter/clutter-animator.c index 3b6596d3d..9df1657c1 100644 --- a/clutter/clutter-animator.c +++ b/clutter/clutter-animator.c @@ -160,7 +160,8 @@ enum { PROP_0, - PROP_DURATION + PROP_DURATION, + PROP_TIMELINE }; static void clutter_scriptable_init (ClutterScriptableIface *iface); @@ -1630,6 +1631,10 @@ clutter_animator_set_property (GObject *gobject, clutter_animator_set_duration (self, g_value_get_uint (value)); break; + case PROP_TIMELINE: + clutter_animator_set_timeline (self, g_value_get_object (value)); + break; + default: G_OBJECT_WARN_INVALID_PROPERTY_ID (gobject, prop_id, pspec); break; @@ -1650,6 +1655,10 @@ clutter_animator_get_property (GObject *gobject, g_value_set_uint (value, clutter_timeline_get_duration (priv->timeline)); break; + case PROP_TIMELINE: + g_value_set_object (value, priv->timeline); + break; + default: G_OBJECT_WARN_INVALID_PROPERTY_ID (gobject, prop_id, pspec); break; @@ -1683,6 +1692,21 @@ clutter_animator_class_init (ClutterAnimatorClass *klass) 2000, CLUTTER_PARAM_READWRITE); g_object_class_install_property (gobject_class, PROP_DURATION, pspec); + + /** + * ClutterAnimator:timeline: + * + * The #ClutterTimeline used by the #ClutterAnimator to drive the + * animation + * + * Since: 1.2 + */ + pspec = g_param_spec_object ("timeline", + "Timeline", + "The timeline of the animation", + CLUTTER_TYPE_TIMELINE, + CLUTTER_PARAM_READWRITE); + g_object_class_install_property (gobject_class, PROP_TIMELINE, pspec); } static void