diff options
author | Jonas Ådahl <jadahl@gmail.com> | 2020-06-16 21:58:30 +0200 |
---|---|---|
committer | Jonas Ådahl <jadahl@gmail.com> | 2020-07-02 19:36:51 +0200 |
commit | 4b8bb4608caa3c05615505fe7d86ae58ea6a806a (patch) | |
tree | 52bdaddf721eded81dad8bfda321a44195ce635c | |
parent | aa34f6ad7cb6b34c08d51ca3b209b938e728fa57 (diff) | |
download | mutter-4b8bb4608caa3c05615505fe7d86ae58ea6a806a.tar.gz |
clutter/transition: Get timeline actor from animatable
Undeprecate the non-actor carrying transition constructor, and instead
rely on set_animatable() to give us a source for an actor to derive a
view and frame clock from.
https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1285
-rw-r--r-- | clutter/clutter/clutter-actor.c | 2 | ||||
-rw-r--r-- | clutter/clutter/clutter-property-transition.h | 2 | ||||
-rw-r--r-- | clutter/clutter/clutter-scroll-actor.c | 4 | ||||
-rw-r--r-- | clutter/clutter/clutter-text.c | 3 | ||||
-rw-r--r-- | clutter/clutter/clutter-timeline.c | 14 | ||||
-rw-r--r-- | clutter/clutter/clutter-transition.c | 4 |
6 files changed, 10 insertions, 19 deletions
diff --git a/clutter/clutter/clutter-actor.c b/clutter/clutter/clutter-actor.c index 354d36a42..3662689ff 100644 --- a/clutter/clutter/clutter-actor.c +++ b/clutter/clutter/clutter-actor.c @@ -17916,7 +17916,7 @@ _clutter_actor_create_transition (ClutterActor *actor, clos = g_hash_table_lookup (info->transitions, pspec->name); if (clos == NULL) { - res = clutter_property_transition_new_for_actor (actor, pspec->name); + res = clutter_property_transition_new (pspec->name); clutter_transition_set_remove_on_complete (res, TRUE); diff --git a/clutter/clutter/clutter-property-transition.h b/clutter/clutter/clutter-property-transition.h index 872f46a54..5670746fa 100644 --- a/clutter/clutter/clutter-property-transition.h +++ b/clutter/clutter/clutter-property-transition.h @@ -82,7 +82,7 @@ CLUTTER_EXPORT ClutterTransition * clutter_property_transition_new_for_actor (ClutterActor *actor, const char *property_name); -CLUTTER_DEPRECATED_FOR(clutter_transition_new_for_actor) +CLUTTER_EXPORT ClutterTransition * clutter_property_transition_new (const char *property_name); CLUTTER_EXPORT diff --git a/clutter/clutter/clutter-scroll-actor.c b/clutter/clutter/clutter-scroll-actor.c index 57e91a54b..969ba5370 100644 --- a/clutter/clutter/clutter-scroll-actor.c +++ b/clutter/clutter/clutter-scroll-actor.c @@ -369,9 +369,7 @@ clutter_scroll_actor_scroll_to_point (ClutterScrollActor *actor, if (priv->transition == NULL) { - priv->transition = - clutter_property_transition_new_for_actor (CLUTTER_ACTOR (actor), - "scroll-to"); + priv->transition = clutter_property_transition_new ("scroll-to"); clutter_transition_set_animatable (priv->transition, CLUTTER_ANIMATABLE (actor)); clutter_transition_set_remove_on_complete (priv->transition, TRUE); diff --git a/clutter/clutter/clutter-text.c b/clutter/clutter/clutter-text.c index 9ad99e317..2fef356cd 100644 --- a/clutter/clutter/clutter-text.c +++ b/clutter/clutter/clutter-text.c @@ -3662,8 +3662,7 @@ clutter_text_set_color_animated (ClutterText *self, if (transition == NULL) { - transition = clutter_property_transition_new_for_actor (actor, - pspec->name); + transition = clutter_property_transition_new (pspec->name); clutter_transition_set_animatable (transition, CLUTTER_ANIMATABLE (self)); clutter_transition_set_remove_on_complete (transition, TRUE); diff --git a/clutter/clutter/clutter-timeline.c b/clutter/clutter/clutter-timeline.c index 2cf460d5f..25d9aad95 100644 --- a/clutter/clutter/clutter-timeline.c +++ b/clutter/clutter/clutter-timeline.c @@ -660,17 +660,6 @@ clutter_timeline_get_property (GObject *object, } static void -clutter_timeline_constructed (GObject *object) -{ - ClutterTimeline *timeline = CLUTTER_TIMELINE (object); - ClutterTimelinePrivate *priv = timeline->priv; - - g_warn_if_fail (priv->actor || priv->frame_clock); - - G_OBJECT_CLASS (clutter_timeline_parent_class)->constructed (object); -} - -static void clutter_timeline_finalize (GObject *object) { ClutterTimeline *self = CLUTTER_TIMELINE (object); @@ -844,7 +833,6 @@ clutter_timeline_class_init (ClutterTimelineClass *klass) object_class->dispose = clutter_timeline_dispose; object_class->finalize = clutter_timeline_finalize; - object_class->constructed = clutter_timeline_constructed; object_class->set_property = clutter_timeline_set_property; object_class->get_property = clutter_timeline_get_property; g_object_class_install_properties (object_class, PROP_LAST, obj_props); @@ -1340,6 +1328,8 @@ clutter_timeline_start (ClutterTimeline *timeline) if (priv->duration == 0) return; + g_warn_if_fail (priv->actor || priv->frame_clock); + if (priv->delay) priv->delay_id = clutter_threads_add_timeout (priv->delay, delay_timeout_func, diff --git a/clutter/clutter/clutter-transition.c b/clutter/clutter/clutter-transition.c index 34f357c48..146c52546 100644 --- a/clutter/clutter/clutter-transition.c +++ b/clutter/clutter/clutter-transition.c @@ -364,6 +364,7 @@ clutter_transition_set_animatable (ClutterTransition *transition, ClutterAnimatable *animatable) { ClutterTransitionPrivate *priv; + ClutterActor *actor; g_return_if_fail (CLUTTER_IS_TRANSITION (transition)); g_return_if_fail (animatable == NULL || CLUTTER_IS_ANIMATABLE (animatable)); @@ -383,6 +384,9 @@ clutter_transition_set_animatable (ClutterTransition *transition, priv->animatable = g_object_ref (animatable); clutter_transition_attach (transition, priv->animatable); } + + actor = clutter_animatable_get_actor (animatable); + clutter_timeline_set_actor (CLUTTER_TIMELINE (transition), actor); } /** |