[clutter] property-transition: Remove animatable from the ctor



commit 15952f26cba2446599eb2a38cc6e97c6aa40cf07
Author: Emmanuele Bassi <ebassi linux intel com>
Date:   Tue Mar 20 11:47:41 2012 +0000

    property-transition: Remove animatable from the ctor
    
    Should not have been there in the first place: the animatable will be
    set either using ClutterTransition API, or when adding the transition
    to a ClutterActor.

 clutter/clutter-actor.c               |    5 +++--
 clutter/clutter-property-transition.c |    8 +++-----
 clutter/clutter-property-transition.h |    3 +--
 3 files changed, 7 insertions(+), 9 deletions(-)
---
diff --git a/clutter/clutter-actor.c b/clutter/clutter-actor.c
index a092332..d067ae5 100644
--- a/clutter/clutter-actor.c
+++ b/clutter/clutter-actor.c
@@ -17124,8 +17124,7 @@ _clutter_actor_create_transition (ClutterActor *actor,
       g_value_unset (&initial);
       g_value_unset (&final);
 
-      res = clutter_property_transition_new (CLUTTER_ANIMATABLE (actor),
-                                             pspec->name);
+      res = clutter_property_transition_new (pspec->name);
 
       clutter_transition_set_interval (res, interval);
       clutter_transition_set_remove_on_complete (res, TRUE);
@@ -17210,6 +17209,8 @@ clutter_actor_add_transition (ClutterActor      *self,
       return;
     }
 
+  clutter_transition_set_animatable (transition, CLUTTER_ANIMATABLE (self));
+
   timeline = CLUTTER_TIMELINE (transition);
 
   clutter_timeline_set_delay (timeline, info->cur_state->easing_delay);
diff --git a/clutter/clutter-property-transition.c b/clutter/clutter-property-transition.c
index 0bd32bd..302e165 100644
--- a/clutter/clutter-property-transition.c
+++ b/clutter/clutter-property-transition.c
@@ -97,6 +97,7 @@ clutter_property_transition_compute_value (ClutterTransition *transition,
   GValue value = G_VALUE_INIT;
   gboolean res;
 
+  /* if we have a GParamSpec we also have an animatable instance */
   if (priv->pspec == NULL)
     return;
 
@@ -210,10 +211,9 @@ clutter_property_transition_init (ClutterPropertyTransition *self)
 
 /**
  * clutter_property_transition_new:
- * @animatable: (allow-none): a #ClutterAnimatable, or %NULL
  * @property_name: (allow-none): a property of @animatable, or %NULL
  *
- * Creates a new #ClutterPropertyTransition for @animatable.
+ * Creates a new #ClutterPropertyTransition.
  *
  * Return value: (transfer full): the newly created #ClutterPropertyTransition.
  *   Use g_object_unref() when done
@@ -221,11 +221,9 @@ clutter_property_transition_init (ClutterPropertyTransition *self)
  * Since: 1.10
  */
 ClutterTransition *
-clutter_property_transition_new (ClutterAnimatable *animatable,
-                                 const char        *property_name)
+clutter_property_transition_new (const char *property_name)
 {
   return g_object_new (CLUTTER_TYPE_PROPERTY_TRANSITION,
-                       "animatable", animatable,
                        "property-name", property_name,
                        NULL);
 }
diff --git a/clutter/clutter-property-transition.h b/clutter/clutter-property-transition.h
index 09b0a95..0d32f16 100644
--- a/clutter/clutter-property-transition.h
+++ b/clutter/clutter-property-transition.h
@@ -79,8 +79,7 @@ CLUTTER_AVAILABLE_IN_1_10
 GType clutter_property_transition_get_type (void) G_GNUC_CONST;
 
 CLUTTER_AVAILABLE_IN_1_10
-ClutterTransition *     clutter_property_transition_new                 (ClutterAnimatable         *animatable,
-                                                                         const char                *property_name);
+ClutterTransition *     clutter_property_transition_new                 (const char                *property_name);
 CLUTTER_AVAILABLE_IN_1_10
 void                    clutter_property_transition_set_property_name   (ClutterPropertyTransition *transition,
                                                                          const char                *property_name);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]