[clutter] timeline: Deprecate the clone() method
- From: Emmanuele Bassi <ebassi src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [clutter] timeline: Deprecate the clone() method
- Date: Mon, 13 Feb 2012 18:25:26 +0000 (UTC)
commit 42774689282a5d13210ab5943bbb75e6a3a0e047
Author: Emmanuele Bassi <ebassi linux intel com>
Date: Mon Feb 13 13:44:52 2012 +0000
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.
clutter/clutter-timeline.c | 19 +++++++++++++------
clutter/clutter-timeline.h | 1 +
2 files changed, 14 insertions(+), 6 deletions(-)
---
diff --git a/clutter/clutter-timeline.c b/clutter/clutter-timeline.c
index c6f68ca..93ffdd9 100644
--- a/clutter/clutter-timeline.c
+++ b/clutter/clutter-timeline.c
@@ -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;
}
/**
diff --git a/clutter/clutter-timeline.h b/clutter/clutter-timeline.h
index b0272de..7365288 100644
--- a/clutter/clutter-timeline.h
+++ b/clutter/clutter-timeline.h
@@ -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
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]