[mutter] clutter/transition: Get timeline actor from animatable
- From: Georges Basile Stavracas Neto <gbsneto src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [mutter] clutter/transition: Get timeline actor from animatable
- Date: Thu, 2 Jul 2020 20:55:43 +0000 (UTC)
commit 4b8bb4608caa3c05615505fe7d86ae58ea6a806a
Author: Jonas Ã…dahl <jadahl gmail com>
Date: Tue Jun 16 21:58:30 2020 +0200
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
clutter/clutter/clutter-actor.c | 2 +-
clutter/clutter/clutter-property-transition.h | 2 +-
clutter/clutter/clutter-scroll-actor.c | 4 +---
clutter/clutter/clutter-text.c | 3 +--
clutter/clutter/clutter-timeline.c | 14 ++------------
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 354d36a426..3662689ff8 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 872f46a54e..5670746fac 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 57e91a54bd..969ba53708 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 9ad99e3179..2fef356cd3 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 2cf460d5f2..25d9aad95c 100644
--- a/clutter/clutter/clutter-timeline.c
+++ b/clutter/clutter/clutter-timeline.c
@@ -659,17 +659,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)
{
@@ -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 34f357c48f..146c525460 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);
}
/**
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]