diff --git a/clutter/clutter-effect.c b/clutter/clutter-effect.c index 076fe8996..b753fc3b6 100644 --- a/clutter/clutter-effect.c +++ b/clutter/clutter-effect.c @@ -253,7 +253,7 @@ clutter_effect_closure_new (ClutterEffectTemplate *template, c->template = template; c->actor = actor; - c->timeline = clutter_timeline_copy (priv->timeline); + c->timeline = clutter_timeline_clone (priv->timeline); c->alpha = clutter_alpha_new_full (c->timeline, priv->alpha_func, NULL, NULL); diff --git a/clutter/clutter-timeline.c b/clutter/clutter-timeline.c index c408d8ed3..68cf80442 100644 --- a/clutter/clutter-timeline.c +++ b/clutter/clutter-timeline.c @@ -631,28 +631,30 @@ clutter_timeline_is_playing (ClutterTimeline *timeline) } /** - * clutter_timeline_copy: + * clutter_timeline_clone: * @timeline: #ClutterTimeline to duplicate. * * Create a new #ClutterTimeline instance which has property values - * matching that of supplied timeline. + * matching that of supplied timeline. The cloned timeline will not + * be started and will not be positioned to the current position of + * @timeline: you will have to start it with clutter_timeline_start(). * - * Return Value: a new #ClutterTimeline + * Return Value: a new #ClutterTimeline, cloned from @timeline * * Since 0.4 */ -ClutterTimeline* -clutter_timeline_copy (ClutterTimeline *timeline) +ClutterTimeline * +clutter_timeline_clone (ClutterTimeline *timeline) { ClutterTimeline *copy; g_return_val_if_fail (CLUTTER_IS_TIMELINE (timeline), NULL); - copy = g_object_new (CLUTTER_TYPE_TIMELINE, NULL); - - copy->priv->fps = timeline->priv->fps; - copy->priv->n_frames = timeline->priv->n_frames; - copy->priv->loop = timeline->priv->loop; + copy = g_object_new (CLUTTER_TYPE_TIMELINE, + "fps", clutter_timeline_get_speed (timeline), + "num-frames", clutter_timeline_get_n_frames (timeline), + "loop", clutter_timeline_get_loop (timeline), + NULL); return copy; } diff --git a/clutter/clutter-timeline.h b/clutter/clutter-timeline.h index 92f077635..9d980afd2 100644 --- a/clutter/clutter-timeline.h +++ b/clutter/clutter-timeline.h @@ -87,6 +87,8 @@ GType clutter_timeline_get_type (void) G_GNUC_CONST; ClutterTimeline *clutter_timeline_new (guint n_frames, guint fps); +ClutterTimeline *clutter_timeline_clone (ClutterTimeline *timeline); + guint clutter_timeline_get_speed (ClutterTimeline *timeline); void clutter_timeline_set_speed (ClutterTimeline *timeline, guint fps); @@ -106,7 +108,6 @@ void clutter_timeline_set_n_frames (ClutterTimeline *timeline, guint n_frames); guint clutter_timeline_get_n_frames (ClutterTimeline *timeline); gboolean clutter_timeline_is_playing (ClutterTimeline *timeline); -ClutterTimeline* clutter_timeline_copy (ClutterTimeline *timeline); G_END_DECLS diff --git a/doc/reference/clutter-sections.txt b/doc/reference/clutter-sections.txt index db388c170..08990c3eb 100644 --- a/doc/reference/clutter-sections.txt +++ b/doc/reference/clutter-sections.txt @@ -384,7 +384,7 @@ clutter_perspective_get_type ClutterTimeline ClutterTimelineClass clutter_timeline_new -clutter_timeline_copy +clutter_timeline_clone clutter_timeline_set_speed clutter_timeline_get_speed clutter_timeline_start