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
This commit is contained in:
parent
aa34f6ad7c
commit
4b8bb4608c
@ -17916,7 +17916,7 @@ _clutter_actor_create_transition (ClutterActor *actor,
|
|||||||
clos = g_hash_table_lookup (info->transitions, pspec->name);
|
clos = g_hash_table_lookup (info->transitions, pspec->name);
|
||||||
if (clos == NULL)
|
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);
|
clutter_transition_set_remove_on_complete (res, TRUE);
|
||||||
|
|
||||||
|
@ -82,7 +82,7 @@ CLUTTER_EXPORT
|
|||||||
ClutterTransition * clutter_property_transition_new_for_actor (ClutterActor *actor,
|
ClutterTransition * clutter_property_transition_new_for_actor (ClutterActor *actor,
|
||||||
const char *property_name);
|
const char *property_name);
|
||||||
|
|
||||||
CLUTTER_DEPRECATED_FOR(clutter_transition_new_for_actor)
|
CLUTTER_EXPORT
|
||||||
ClutterTransition * clutter_property_transition_new (const char *property_name);
|
ClutterTransition * clutter_property_transition_new (const char *property_name);
|
||||||
|
|
||||||
CLUTTER_EXPORT
|
CLUTTER_EXPORT
|
||||||
|
@ -369,9 +369,7 @@ clutter_scroll_actor_scroll_to_point (ClutterScrollActor *actor,
|
|||||||
|
|
||||||
if (priv->transition == NULL)
|
if (priv->transition == NULL)
|
||||||
{
|
{
|
||||||
priv->transition =
|
priv->transition = clutter_property_transition_new ("scroll-to");
|
||||||
clutter_property_transition_new_for_actor (CLUTTER_ACTOR (actor),
|
|
||||||
"scroll-to");
|
|
||||||
clutter_transition_set_animatable (priv->transition,
|
clutter_transition_set_animatable (priv->transition,
|
||||||
CLUTTER_ANIMATABLE (actor));
|
CLUTTER_ANIMATABLE (actor));
|
||||||
clutter_transition_set_remove_on_complete (priv->transition, TRUE);
|
clutter_transition_set_remove_on_complete (priv->transition, TRUE);
|
||||||
|
@ -3662,8 +3662,7 @@ clutter_text_set_color_animated (ClutterText *self,
|
|||||||
|
|
||||||
if (transition == NULL)
|
if (transition == NULL)
|
||||||
{
|
{
|
||||||
transition = clutter_property_transition_new_for_actor (actor,
|
transition = clutter_property_transition_new (pspec->name);
|
||||||
pspec->name);
|
|
||||||
clutter_transition_set_animatable (transition,
|
clutter_transition_set_animatable (transition,
|
||||||
CLUTTER_ANIMATABLE (self));
|
CLUTTER_ANIMATABLE (self));
|
||||||
clutter_transition_set_remove_on_complete (transition, TRUE);
|
clutter_transition_set_remove_on_complete (transition, TRUE);
|
||||||
|
@ -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
|
static void
|
||||||
clutter_timeline_finalize (GObject *object)
|
clutter_timeline_finalize (GObject *object)
|
||||||
{
|
{
|
||||||
@ -844,7 +833,6 @@ clutter_timeline_class_init (ClutterTimelineClass *klass)
|
|||||||
|
|
||||||
object_class->dispose = clutter_timeline_dispose;
|
object_class->dispose = clutter_timeline_dispose;
|
||||||
object_class->finalize = clutter_timeline_finalize;
|
object_class->finalize = clutter_timeline_finalize;
|
||||||
object_class->constructed = clutter_timeline_constructed;
|
|
||||||
object_class->set_property = clutter_timeline_set_property;
|
object_class->set_property = clutter_timeline_set_property;
|
||||||
object_class->get_property = clutter_timeline_get_property;
|
object_class->get_property = clutter_timeline_get_property;
|
||||||
g_object_class_install_properties (object_class, PROP_LAST, obj_props);
|
g_object_class_install_properties (object_class, PROP_LAST, obj_props);
|
||||||
@ -1340,6 +1328,8 @@ clutter_timeline_start (ClutterTimeline *timeline)
|
|||||||
if (priv->duration == 0)
|
if (priv->duration == 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
g_warn_if_fail (priv->actor || priv->frame_clock);
|
||||||
|
|
||||||
if (priv->delay)
|
if (priv->delay)
|
||||||
priv->delay_id = clutter_threads_add_timeout (priv->delay,
|
priv->delay_id = clutter_threads_add_timeout (priv->delay,
|
||||||
delay_timeout_func,
|
delay_timeout_func,
|
||||||
|
@ -364,6 +364,7 @@ clutter_transition_set_animatable (ClutterTransition *transition,
|
|||||||
ClutterAnimatable *animatable)
|
ClutterAnimatable *animatable)
|
||||||
{
|
{
|
||||||
ClutterTransitionPrivate *priv;
|
ClutterTransitionPrivate *priv;
|
||||||
|
ClutterActor *actor;
|
||||||
|
|
||||||
g_return_if_fail (CLUTTER_IS_TRANSITION (transition));
|
g_return_if_fail (CLUTTER_IS_TRANSITION (transition));
|
||||||
g_return_if_fail (animatable == NULL || CLUTTER_IS_ANIMATABLE (animatable));
|
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);
|
priv->animatable = g_object_ref (animatable);
|
||||||
clutter_transition_attach (transition, priv->animatable);
|
clutter_transition_attach (transition, priv->animatable);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
actor = clutter_animatable_get_actor (animatable);
|
||||||
|
clutter_timeline_set_actor (CLUTTER_TIMELINE (transition), actor);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user