diff options
author | Owen W. Taylor <otaylor@fishsoup.net> | 2011-11-10 18:01:44 -0500 |
---|---|---|
committer | Owen W. Taylor <otaylor@fishsoup.net> | 2013-02-14 17:19:49 -0500 |
commit | cbce5bcd0b09195b79d0c29b44768fd037296df0 (patch) | |
tree | 93f9e403f6a45a4f09cb5ec47dcdf59daecb26a7 /gtk/gtktimeline.c | |
parent | db89b600e0a4256fe3d30164b30c03fb5ae13474 (diff) | |
download | gtk+-cbce5bcd0b09195b79d0c29b44768fd037296df0.tar.gz |
GtkTimeline: remove settable FPS
The frames-per-second for an animation should be controlled by how
fast we can process frames and the the frame-rate of the display; it's not
a meaningful app-settable property.
https://bugzilla.gnome.org/show_bug.cgi?id=685460
Diffstat (limited to 'gtk/gtktimeline.c')
-rw-r--r-- | gtk/gtktimeline.c | 73 |
1 files changed, 1 insertions, 72 deletions
diff --git a/gtk/gtktimeline.c b/gtk/gtktimeline.c index 2202e7907f..b56b699e57 100644 --- a/gtk/gtktimeline.c +++ b/gtk/gtktimeline.c @@ -29,7 +29,6 @@ typedef struct GtkTimelinePriv GtkTimelinePriv; struct GtkTimelinePriv { guint duration; - guint fps; guint source_id; GTimer *timer; @@ -49,7 +48,6 @@ struct GtkTimelinePriv enum { PROP_0, - PROP_FPS, PROP_DURATION, PROP_LOOP, PROP_DIRECTION, @@ -91,14 +89,6 @@ gtk_timeline_class_init (GtkTimelineClass *klass) object_class->finalize = gtk_timeline_finalize; g_object_class_install_property (object_class, - PROP_FPS, - g_param_spec_uint ("fps", - "FPS", - "Frames per second for the timeline", - 1, G_MAXUINT, - DEFAULT_FPS, - G_PARAM_READWRITE)); - g_object_class_install_property (object_class, PROP_DURATION, g_param_spec_uint ("duration", "Animation Duration", @@ -170,7 +160,6 @@ gtk_timeline_init (GtkTimeline *timeline) GTK_TYPE_TIMELINE, GtkTimelinePriv); - priv->fps = DEFAULT_FPS; priv->duration = 0.0; priv->direction = GTK_TIMELINE_DIRECTION_FORWARD; priv->screen = gdk_screen_get_default (); @@ -190,9 +179,6 @@ gtk_timeline_set_property (GObject *object, switch (prop_id) { - case PROP_FPS: - _gtk_timeline_set_fps (timeline, g_value_get_uint (value)); - break; case PROP_DURATION: gtk_timeline_set_duration (timeline, g_value_get_uint (value)); break; @@ -225,9 +211,6 @@ gtk_timeline_get_property (GObject *object, switch (prop_id) { - case PROP_FPS: - g_value_set_uint (value, priv->fps); - break; case PROP_DURATION: g_value_set_uint (value, priv->duration); break; @@ -416,9 +399,6 @@ gtk_timeline_start (GtkTimeline *timeline) else priv->timer = g_timer_new (); - /* sanity check */ - g_assert (priv->fps > 0); - if (priv->screen) { settings = gtk_settings_get_for_screen (priv->screen); @@ -430,7 +410,7 @@ gtk_timeline_start (GtkTimeline *timeline) g_signal_emit (timeline, signals [STARTED], 0); if (enable_animations) - priv->source_id = gdk_threads_add_timeout (FRAME_INTERVAL (priv->fps), + priv->source_id = gdk_threads_add_timeout (FRAME_INTERVAL (DEFAULT_FPS), (GSourceFunc) gtk_timeline_run_frame, timeline); else @@ -532,57 +512,6 @@ gtk_timeline_get_elapsed_time (GtkTimeline *timeline) return priv->elapsed_time; } -/* - * gtk_timeline_get_fps: - * @timeline: A #GtkTimeline - * - * Returns the number of frames per second. - * - * Return Value: frames per second - */ -guint -gtk_timeline_get_fps (GtkTimeline *timeline) -{ - GtkTimelinePriv *priv; - - g_return_val_if_fail (GTK_IS_TIMELINE (timeline), 1); - - priv = timeline->priv; - return priv->fps; -} - -/* - * gtk_timeline_set_fps: - * @timeline: A #GtkTimeline - * @fps: frames per second - * - * Sets the number of frames per second that - * the timeline will play. - */ -void -gtk_timeline_set_fps (GtkTimeline *timeline, - guint fps) -{ - GtkTimelinePriv *priv; - - g_return_if_fail (GTK_IS_TIMELINE (timeline)); - g_return_if_fail (fps > 0); - - priv = timeline->priv; - - priv->fps = fps; - - if (gtk_timeline_is_running (timeline)) - { - g_source_remove (priv->source_id); - priv->source_id = gdk_threads_add_timeout (FRAME_INTERVAL (priv->fps), - (GSourceFunc) gtk_timeline_run_frame, - timeline); - } - - g_object_notify (G_OBJECT (timeline), "fps"); -} - /** * gtk_timeline_get_loop: * @timeline: A #GtkTimeline |