[mutter] clutter/timeline: Remove deprecated 'loop' property
- From: Georges Basile Stavracas Neto <gbsneto src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [mutter] clutter/timeline: Remove deprecated 'loop' property
- Date: Fri, 5 Jun 2020 21:55:32 +0000 (UTC)
commit 08b30d6fe25758e8c54c383e2f2ff4c2dd398e3b
Author: Jonas Ã…dahl <jadahl gmail com>
Date: Thu Apr 16 10:04:04 2020 +0200
clutter/timeline: Remove deprecated 'loop' property
It was since long ago replaced by a 'repeat-count' property.
https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1289
clutter/clutter/clutter-timeline.c | 87 +---------------------
clutter/clutter/deprecated/clutter-timeline.h | 7 --
src/tests/clutter/conform/timeline-interpolate.c | 2 +-
.../clutter/interactive/test-cogl-tex-polygon.c | 2 +-
src/tests/clutter/interactive/test-cogl-tex-tile.c | 2 +-
5 files changed, 4 insertions(+), 96 deletions(-)
---
diff --git a/clutter/clutter/clutter-timeline.c b/clutter/clutter/clutter-timeline.c
index e561ecfcf4..13d6f09ea6 100644
--- a/clutter/clutter/clutter-timeline.c
+++ b/clutter/clutter/clutter-timeline.c
@@ -172,7 +172,6 @@ enum
{
PROP_0,
- PROP_LOOP,
PROP_DELAY,
PROP_DURATION,
PROP_DIRECTION,
@@ -290,23 +289,6 @@ clutter_timeline_add_marker_internal (ClutterTimeline *timeline,
g_hash_table_insert (priv->markers_by_name, marker->name, marker);
}
-static inline void
-clutter_timeline_set_loop_internal (ClutterTimeline *timeline,
- gboolean loop)
-{
- gint old_repeat_count;
-
- old_repeat_count = timeline->priv->repeat_count;
-
- if (loop)
- clutter_timeline_set_repeat_count (timeline, -1);
- else
- clutter_timeline_set_repeat_count (timeline, 0);
-
- if (old_repeat_count != timeline->priv->repeat_count)
- g_object_notify_by_pspec (G_OBJECT (timeline), obj_props[PROP_LOOP]);
-}
-
/* Scriptable */
typedef struct _ParseClosure {
ClutterTimeline *timeline;
@@ -448,10 +430,6 @@ clutter_timeline_set_property (GObject *object,
switch (prop_id)
{
- case PROP_LOOP:
- clutter_timeline_set_loop_internal (timeline, g_value_get_boolean (value));
- break;
-
case PROP_DELAY:
clutter_timeline_set_delay (timeline, g_value_get_uint (value));
break;
@@ -493,10 +471,6 @@ clutter_timeline_get_property (GObject *object,
switch (prop_id)
{
- case PROP_LOOP:
- g_value_set_boolean (value, priv->repeat_count != 0);
- break;
-
case PROP_DELAY:
g_value_set_uint (value, priv->delay);
break;
@@ -572,25 +546,6 @@ clutter_timeline_class_init (ClutterTimelineClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
- /**
- * ClutterTimeline:loop:
- *
- * Whether the timeline should automatically rewind and restart.
- *
- * As a side effect, setting this property to %TRUE will set the
- * #ClutterTimeline:repeat-count property to -1, while setting this
- * property to %FALSE will set the #ClutterTimeline:repeat-count
- * property to 0.
- *
- * Deprecated: 1.10: Use the #ClutterTimeline:repeat-count property instead.
- */
- obj_props[PROP_LOOP] =
- g_param_spec_boolean ("loop",
- P_("Loop"),
- P_("Should the timeline automatically restart"),
- FALSE,
- CLUTTER_PARAM_READWRITE | G_PARAM_DEPRECATED);
-
/**
* ClutterTimeline:delay:
*
@@ -1251,45 +1206,6 @@ clutter_timeline_stop (ClutterTimeline *timeline)
g_signal_emit (timeline, timeline_signals[STOPPED], 0, FALSE);
}
-/**
- * clutter_timeline_set_loop:
- * @timeline: a #ClutterTimeline
- * @loop: %TRUE for enable looping
- *
- * Sets whether @timeline should loop.
- *
- * This function is equivalent to calling clutter_timeline_set_repeat_count()
- * with -1 if @loop is %TRUE, and with 0 if @loop is %FALSE.
- *
- * Deprecated: 1.10: Use clutter_timeline_set_repeat_count() instead.
- */
-void
-clutter_timeline_set_loop (ClutterTimeline *timeline,
- gboolean loop)
-{
- g_return_if_fail (CLUTTER_IS_TIMELINE (timeline));
-
- clutter_timeline_set_loop_internal (timeline, loop);
-}
-
-/**
- * clutter_timeline_get_loop:
- * @timeline: a #ClutterTimeline
- *
- * Gets whether @timeline is looping
- *
- * Return value: %TRUE if the timeline is looping
- *
- * Deprecated: 1.10: Use clutter_timeline_get_repeat_count() instead.
- */
-gboolean
-clutter_timeline_get_loop (ClutterTimeline *timeline)
-{
- g_return_val_if_fail (CLUTTER_IS_TIMELINE (timeline), FALSE);
-
- return timeline->priv->repeat_count != 0;
-}
-
/**
* clutter_timeline_rewind:
* @timeline: A #ClutterTimeline
@@ -1418,7 +1334,6 @@ clutter_timeline_is_playing (ClutterTimeline *timeline)
* The only cloned properties are:
*
* - #ClutterTimeline:duration
- * - #ClutterTimeline:loop
* - #ClutterTimeline:delay
* - #ClutterTimeline:direction
*
@@ -1437,7 +1352,7 @@ clutter_timeline_clone (ClutterTimeline *timeline)
return g_object_new (CLUTTER_TYPE_TIMELINE,
"duration", timeline->priv->duration,
- "loop", timeline->priv->repeat_count != 0,
+ "repeat-count", timeline->priv->repeat_count,
"delay", timeline->priv->delay,
"direction", timeline->priv->direction,
NULL);
diff --git a/clutter/clutter/deprecated/clutter-timeline.h b/clutter/clutter/deprecated/clutter-timeline.h
index 950362e903..5c3a578efa 100644
--- a/clutter/clutter/deprecated/clutter-timeline.h
+++ b/clutter/clutter/deprecated/clutter-timeline.h
@@ -29,13 +29,6 @@ G_BEGIN_DECLS
CLUTTER_DEPRECATED_FOR(clutter_timeline_new)
ClutterTimeline * clutter_timeline_clone (ClutterTimeline *timeline);
-CLUTTER_DEPRECATED_FOR(clutter_timeline_set_repeat_count)
-void clutter_timeline_set_loop (ClutterTimeline *timeline,
- gboolean loop);
-
-CLUTTER_DEPRECATED_FOR(clutter_timeline_get_repeat_count)
-gboolean clutter_timeline_get_loop (ClutterTimeline *timeline);
-
G_END_DECLS
#endif /* __CLUTTER_TIMELINE_PRIVATE_H__ */
diff --git a/src/tests/clutter/conform/timeline-interpolate.c
b/src/tests/clutter/conform/timeline-interpolate.c
index e60f72b2ef..8d3ceeef86 100644
--- a/src/tests/clutter/conform/timeline-interpolate.c
+++ b/src/tests/clutter/conform/timeline-interpolate.c
@@ -136,7 +136,7 @@ timeline_interpolation (void)
state.timeline =
clutter_timeline_new (TEST_TIMELINE_DURATION);
- clutter_timeline_set_loop (state.timeline, TRUE);
+ clutter_timeline_set_repeat_count (state.timeline, -1);
g_signal_connect (G_OBJECT(state.timeline),
"new-frame",
G_CALLBACK(new_frame_cb),
diff --git a/src/tests/clutter/interactive/test-cogl-tex-polygon.c
b/src/tests/clutter/interactive/test-cogl-tex-polygon.c
index 654401b4d6..5fbb6df54f 100644
--- a/src/tests/clutter/interactive/test-cogl-tex-polygon.c
+++ b/src/tests/clutter/interactive/test-cogl-tex-polygon.c
@@ -410,7 +410,7 @@ test_cogl_tex_polygon_main (int argc, char *argv[])
/* Timeline for animation */
timeline = clutter_timeline_new (6000);
- clutter_timeline_set_loop (timeline, TRUE);
+ clutter_timeline_set_repeat_count (timeline, -1);
g_signal_connect (timeline, "new-frame", G_CALLBACK (frame_cb), coglbox);
clutter_timeline_start (timeline);
diff --git a/src/tests/clutter/interactive/test-cogl-tex-tile.c
b/src/tests/clutter/interactive/test-cogl-tex-tile.c
index 9948696a41..a522da4593 100644
--- a/src/tests/clutter/interactive/test-cogl-tex-tile.c
+++ b/src/tests/clutter/interactive/test-cogl-tex-tile.c
@@ -216,7 +216,7 @@ test_cogl_tex_tile_main (int argc, char *argv[])
/* Timeline for animation */
timeline = clutter_timeline_new (6000); /* 6 second duration */
- clutter_timeline_set_loop (timeline, TRUE);
+ clutter_timeline_set_repeat_count (timeline, -1);
g_signal_connect (timeline, "new-frame", G_CALLBACK (frame_cb), coglbox);
clutter_timeline_start (timeline);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]