1
0
Fork 0

timeline: Deprecate the clone() method

The clutter_timeline_clone() method was a pretty dumb idea when it was
introduced, back when we still had the ClutterEffectTemplate and the
clutter_effect_* animation API. It has since become an API wart: we
cannot change or add new properties to be cloned without the risk of
breaking existing code. All in all, cloning a GObject is just a matter
of calling g_object_new() with the wanted properties.

Let's deprecate this throwback of the Olden Days™, so that we can remove
it for good once we break for 2.0.
This commit is contained in:
Emmanuele Bassi 2012-02-13 13:44:52 +00:00
parent bc2e4ac6c2
commit 4277468928
2 changed files with 14 additions and 6 deletions

View file

@ -1220,26 +1220,33 @@ clutter_timeline_is_playing (ClutterTimeline *timeline)
* 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: (transfer full): a new #ClutterTimeline, cloned
* <note><para>The only cloned properties are:</para>
* <itemizedlist>
* <listitem><simpara>#ClutterTimeline:duration</simpara></listitem>
* <listitem><simpara>#ClutterTimeline:loop</simpara></listitem>
* <listitem><simpara>#ClutterTimeline:delay</simpara></listitem>
* <listitem><simpara>#ClutterTimeline:direction</simpara></listitem>
* </itemizedlist></note>
*
* Return value: (transfer full): a new #ClutterTimeline, cloned
* from @timeline
*
* Since: 0.4
*
* Deprecated: 1.10: Use clutter_timeline_new() or g_object_new()
* instead
*/
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,
return g_object_new (CLUTTER_TYPE_TIMELINE,
"duration", clutter_timeline_get_duration (timeline),
"loop", clutter_timeline_get_loop (timeline),
"delay", clutter_timeline_get_delay (timeline),
"direction", clutter_timeline_get_direction (timeline),
NULL);
return copy;
}
/**

View file

@ -138,6 +138,7 @@ gboolean clutter_timeline_has_marker (Clutter
void clutter_timeline_advance_to_marker (ClutterTimeline *timeline,
const gchar *marker_name);
CLUTTER_DEPRECATED_FOR(clutter_timeline_new)
ClutterTimeline * clutter_timeline_clone (ClutterTimeline *timeline);
G_END_DECLS