summaryrefslogtreecommitdiff
path: root/plugins/mouse/gsd-timeline.c
diff options
context:
space:
mode:
authorhaxar <[email protected]>2012-02-21 20:13:04 -0800
committerhaxar <[email protected]>2012-02-21 20:13:04 -0800
commitddaceb232c8b537a7d29a9708928d3a3671b98e5 (patch)
treed874e557f2999f9550ad2b710f0231ed06f50ba8 /plugins/mouse/gsd-timeline.c
parentecd8a153901507f5d210d6f85103693ef81d49c3 (diff)
downloadmate-settings-daemon-ddaceb232c8b537a7d29a9708928d3a3671b98e5.tar.bz2
mate-settings-daemon-ddaceb232c8b537a7d29a9708928d3a3671b98e5.tar.xz
gsd to msd complete rename patch by NiceandGently; code changes commit
Diffstat (limited to 'plugins/mouse/gsd-timeline.c')
-rw-r--r--plugins/mouse/gsd-timeline.c376
1 files changed, 188 insertions, 188 deletions
diff --git a/plugins/mouse/gsd-timeline.c b/plugins/mouse/gsd-timeline.c
index 748a0ad..9bcfd2f 100644
--- a/plugins/mouse/gsd-timeline.c
+++ b/plugins/mouse/gsd-timeline.c
@@ -1,4 +1,4 @@
-/* gsd-timeline.c
+/* msd-timeline.c
*
* Copyright (C) 2008 Carlos Garnacho <[email protected]>
*
@@ -20,16 +20,16 @@
#include <glib.h>
#include <gtk/gtk.h>
#include <math.h>
-#include "gsd-timeline.h"
+#include "msd-timeline.h"
-#define GSD_TIMELINE_GET_PRIV(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), GSD_TYPE_TIMELINE, GsdTimelinePriv))
+#define MSD_TIMELINE_GET_PRIV(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), MSD_TYPE_TIMELINE, MsdTimelinePriv))
#define MSECS_PER_SEC 1000
#define FRAME_INTERVAL(nframes) (MSECS_PER_SEC / nframes)
#define DEFAULT_FPS 30
-typedef struct GsdTimelinePriv GsdTimelinePriv;
+typedef struct MsdTimelinePriv MsdTimelinePriv;
-struct GsdTimelinePriv
+struct MsdTimelinePriv
{
guint duration;
guint fps;
@@ -38,8 +38,8 @@ struct GsdTimelinePriv
GTimer *timer;
GdkScreen *screen;
- GsdTimelineProgressType progress_type;
- GsdTimelineProgressFunc progress_func;
+ MsdTimelineProgressType progress_type;
+ MsdTimelineProgressFunc progress_func;
guint loop : 1;
guint direction : 1;
@@ -66,67 +66,67 @@ enum {
static guint signals [LAST_SIGNAL] = { 0, };
-static void gsd_timeline_set_property (GObject *object,
+static void msd_timeline_set_property (GObject *object,
guint prop_id,
const GValue *value,
GParamSpec *pspec);
-static void gsd_timeline_get_property (GObject *object,
+static void msd_timeline_get_property (GObject *object,
guint prop_id,
GValue *value,
GParamSpec *pspec);
-static void gsd_timeline_finalize (GObject *object);
+static void msd_timeline_finalize (GObject *object);
-G_DEFINE_TYPE (GsdTimeline, gsd_timeline, G_TYPE_OBJECT)
+G_DEFINE_TYPE (MsdTimeline, msd_timeline, G_TYPE_OBJECT)
GType
-gsd_timeline_direction_get_type (void)
+msd_timeline_direction_get_type (void)
{
static GType type = 0;
if (G_UNLIKELY (type == 0))
{
static const GEnumValue values[] = {
- { GSD_TIMELINE_DIRECTION_FORWARD, "GSD_TIMELINE_DIRECTION_FORWARD", "forward" },
- { GSD_TIMELINE_DIRECTION_BACKWARD, "GSD_TIMELINE_DIRECTION_BACKWARD", "backward" },
+ { MSD_TIMELINE_DIRECTION_FORWARD, "MSD_TIMELINE_DIRECTION_FORWARD", "forward" },
+ { MSD_TIMELINE_DIRECTION_BACKWARD, "MSD_TIMELINE_DIRECTION_BACKWARD", "backward" },
{ 0, NULL, NULL }
};
- type = g_enum_register_static (g_intern_static_string ("GsdTimelineDirection"), values);
+ type = g_enum_register_static (g_intern_static_string ("MsdTimelineDirection"), values);
}
return type;
}
GType
-gsd_timeline_progress_type_get_type (void)
+msd_timeline_progress_type_get_type (void)
{
static GType type = 0;
if (G_UNLIKELY (type == 0))
{
static const GEnumValue values[] = {
- { GSD_TIMELINE_PROGRESS_LINEAR, "GSD_TIMELINE_PROGRESS_LINEAR", "linear" },
- { GSD_TIMELINE_PROGRESS_SINUSOIDAL, "GSD_TIMELINE_PROGRESS_SINUSOIDAL", "sinusoidal" },
- { GSD_TIMELINE_PROGRESS_EXPONENTIAL, "GSD_TIMELINE_PROGRESS_EXPONENTIAL", "exponential" },
+ { MSD_TIMELINE_PROGRESS_LINEAR, "MSD_TIMELINE_PROGRESS_LINEAR", "linear" },
+ { MSD_TIMELINE_PROGRESS_SINUSOIDAL, "MSD_TIMELINE_PROGRESS_SINUSOIDAL", "sinusoidal" },
+ { MSD_TIMELINE_PROGRESS_EXPONENTIAL, "MSD_TIMELINE_PROGRESS_EXPONENTIAL", "exponential" },
{ 0, NULL, NULL }
};
- type = g_enum_register_static (g_intern_static_string ("GsdTimelineProgressType"), values);
+ type = g_enum_register_static (g_intern_static_string ("MsdTimelineProgressType"), values);
}
return type;
}
static void
-gsd_timeline_class_init (GsdTimelineClass *class)
+msd_timeline_class_init (MsdTimelineClass *class)
{
GObjectClass *object_class = G_OBJECT_CLASS (class);
- object_class->set_property = gsd_timeline_set_property;
- object_class->get_property = gsd_timeline_get_property;
- object_class->finalize = gsd_timeline_finalize;
+ object_class->set_property = msd_timeline_set_property;
+ object_class->get_property = msd_timeline_get_property;
+ object_class->finalize = msd_timeline_finalize;
g_object_class_install_property (object_class,
PROP_FPS,
@@ -158,16 +158,16 @@ gsd_timeline_class_init (GsdTimelineClass *class)
g_param_spec_enum ("direction",
"Direction",
"Whether the timeline moves forward or backward in time",
- GSD_TYPE_TIMELINE_DIRECTION,
- GSD_TIMELINE_DIRECTION_FORWARD,
+ MSD_TYPE_TIMELINE_DIRECTION,
+ MSD_TIMELINE_DIRECTION_FORWARD,
G_PARAM_READWRITE));
g_object_class_install_property (object_class,
PROP_DIRECTION,
g_param_spec_enum ("progress-type",
"Progress type",
"Type of progress through the timeline",
- GSD_TYPE_TIMELINE_PROGRESS_TYPE,
- GSD_TIMELINE_PROGRESS_LINEAR,
+ MSD_TYPE_TIMELINE_PROGRESS_TYPE,
+ MSD_TIMELINE_PROGRESS_LINEAR,
G_PARAM_READWRITE));
g_object_class_install_property (object_class,
PROP_SCREEN,
@@ -181,7 +181,7 @@ gsd_timeline_class_init (GsdTimelineClass *class)
g_signal_new ("started",
G_TYPE_FROM_CLASS (object_class),
G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (GsdTimelineClass, started),
+ G_STRUCT_OFFSET (MsdTimelineClass, started),
NULL, NULL,
g_cclosure_marshal_VOID__VOID,
G_TYPE_NONE, 0);
@@ -190,7 +190,7 @@ gsd_timeline_class_init (GsdTimelineClass *class)
g_signal_new ("paused",
G_TYPE_FROM_CLASS (object_class),
G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (GsdTimelineClass, paused),
+ G_STRUCT_OFFSET (MsdTimelineClass, paused),
NULL, NULL,
g_cclosure_marshal_VOID__VOID,
G_TYPE_NONE, 0);
@@ -199,7 +199,7 @@ gsd_timeline_class_init (GsdTimelineClass *class)
g_signal_new ("finished",
G_TYPE_FROM_CLASS (object_class),
G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (GsdTimelineClass, finished),
+ G_STRUCT_OFFSET (MsdTimelineClass, finished),
NULL, NULL,
g_cclosure_marshal_VOID__VOID,
G_TYPE_NONE, 0);
@@ -208,60 +208,60 @@ gsd_timeline_class_init (GsdTimelineClass *class)
g_signal_new ("frame",
G_TYPE_FROM_CLASS (object_class),
G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (GsdTimelineClass, frame),
+ G_STRUCT_OFFSET (MsdTimelineClass, frame),
NULL, NULL,
g_cclosure_marshal_VOID__DOUBLE,
G_TYPE_NONE, 1,
G_TYPE_DOUBLE);
- g_type_class_add_private (class, sizeof (GsdTimelinePriv));
+ g_type_class_add_private (class, sizeof (MsdTimelinePriv));
}
static void
-gsd_timeline_init (GsdTimeline *timeline)
+msd_timeline_init (MsdTimeline *timeline)
{
- GsdTimelinePriv *priv;
+ MsdTimelinePriv *priv;
- priv = GSD_TIMELINE_GET_PRIV (timeline);
+ priv = MSD_TIMELINE_GET_PRIV (timeline);
priv->fps = DEFAULT_FPS;
priv->duration = 0;
- priv->direction = GSD_TIMELINE_DIRECTION_FORWARD;
+ priv->direction = MSD_TIMELINE_DIRECTION_FORWARD;
priv->screen = gdk_screen_get_default ();
}
static void
-gsd_timeline_set_property (GObject *object,
+msd_timeline_set_property (GObject *object,
guint prop_id,
const GValue *value,
GParamSpec *pspec)
{
- GsdTimeline *timeline;
- GsdTimelinePriv *priv;
+ MsdTimeline *timeline;
+ MsdTimelinePriv *priv;
- timeline = GSD_TIMELINE (object);
- priv = GSD_TIMELINE_GET_PRIV (timeline);
+ timeline = MSD_TIMELINE (object);
+ priv = MSD_TIMELINE_GET_PRIV (timeline);
switch (prop_id)
{
case PROP_FPS:
- gsd_timeline_set_fps (timeline, g_value_get_uint (value));
+ msd_timeline_set_fps (timeline, g_value_get_uint (value));
break;
case PROP_DURATION:
- gsd_timeline_set_duration (timeline, g_value_get_uint (value));
+ msd_timeline_set_duration (timeline, g_value_get_uint (value));
break;
case PROP_LOOP:
- gsd_timeline_set_loop (timeline, g_value_get_boolean (value));
+ msd_timeline_set_loop (timeline, g_value_get_boolean (value));
break;
case PROP_DIRECTION:
- gsd_timeline_set_direction (timeline, g_value_get_enum (value));
+ msd_timeline_set_direction (timeline, g_value_get_enum (value));
break;
case PROP_SCREEN:
- gsd_timeline_set_screen (timeline,
+ msd_timeline_set_screen (timeline,
GDK_SCREEN (g_value_get_object (value)));
break;
case PROP_PROGRESS_TYPE:
- gsd_timeline_set_progress_type (timeline, g_value_get_enum (value));
+ msd_timeline_set_progress_type (timeline, g_value_get_enum (value));
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
@@ -269,16 +269,16 @@ gsd_timeline_set_property (GObject *object,
}
static void
-gsd_timeline_get_property (GObject *object,
+msd_timeline_get_property (GObject *object,
guint prop_id,
GValue *value,
GParamSpec *pspec)
{
- GsdTimeline *timeline;
- GsdTimelinePriv *priv;
+ MsdTimeline *timeline;
+ MsdTimelinePriv *priv;
- timeline = GSD_TIMELINE (object);
- priv = GSD_TIMELINE_GET_PRIV (timeline);
+ timeline = MSD_TIMELINE (object);
+ priv = MSD_TIMELINE_GET_PRIV (timeline);
switch (prop_id)
{
@@ -306,11 +306,11 @@ gsd_timeline_get_property (GObject *object,
}
static void
-gsd_timeline_finalize (GObject *object)
+msd_timeline_finalize (GObject *object)
{
- GsdTimelinePriv *priv;
+ MsdTimelinePriv *priv;
- priv = GSD_TIMELINE_GET_PRIV (object);
+ priv = MSD_TIMELINE_GET_PRIV (object);
if (priv->source_id)
{
@@ -321,7 +321,7 @@ gsd_timeline_finalize (GObject *object)
if (priv->timer)
g_timer_destroy (priv->timer);
- G_OBJECT_CLASS (gsd_timeline_parent_class)->finalize (object);
+ G_OBJECT_CLASS (msd_timeline_parent_class)->finalize (object);
}
/* Sinusoidal progress */
@@ -337,27 +337,27 @@ exponential_progress (gdouble progress)
return progress * progress;
}
-static GsdTimelineProgressFunc
-progress_type_to_func (GsdTimelineProgressType type)
+static MsdTimelineProgressFunc
+progress_type_to_func (MsdTimelineProgressType type)
{
- if (type == GSD_TIMELINE_PROGRESS_SINUSOIDAL)
+ if (type == MSD_TIMELINE_PROGRESS_SINUSOIDAL)
return sinusoidal_progress;
- else if (type == GSD_TIMELINE_PROGRESS_EXPONENTIAL)
+ else if (type == MSD_TIMELINE_PROGRESS_EXPONENTIAL)
return exponential_progress;
return NULL;
}
static gboolean
-gsd_timeline_run_frame (GsdTimeline *timeline,
+msd_timeline_run_frame (MsdTimeline *timeline,
gboolean enable_animations)
{
- GsdTimelinePriv *priv;
+ MsdTimelinePriv *priv;
gdouble linear_progress, progress;
guint elapsed_time;
- GsdTimelineProgressFunc progress_func = NULL;
+ MsdTimelineProgressFunc progress_func = NULL;
- priv = GSD_TIMELINE_GET_PRIV (timeline);
+ priv = MSD_TIMELINE_GET_PRIV (timeline);
if (enable_animations)
{
@@ -365,7 +365,7 @@ gsd_timeline_run_frame (GsdTimeline *timeline,
linear_progress = (gdouble) elapsed_time / priv->duration;
- if (priv->direction == GSD_TIMELINE_DIRECTION_BACKWARD)
+ if (priv->direction == MSD_TIMELINE_DIRECTION_BACKWARD)
linear_progress = 1 - linear_progress;
linear_progress = CLAMP (linear_progress, 0., 1.);
@@ -381,13 +381,13 @@ gsd_timeline_run_frame (GsdTimeline *timeline,
progress = linear_progress;
}
else
- progress = (priv->direction == GSD_TIMELINE_DIRECTION_FORWARD) ? 1.0 : 0.0;
+ progress = (priv->direction == MSD_TIMELINE_DIRECTION_FORWARD) ? 1.0 : 0.0;
g_signal_emit (timeline, signals [FRAME], 0,
CLAMP (progress, 0.0, 1.0));
- if ((priv->direction == GSD_TIMELINE_DIRECTION_FORWARD && progress >= 1.0) ||
- (priv->direction == GSD_TIMELINE_DIRECTION_BACKWARD && progress <= 0.0))
+ if ((priv->direction == MSD_TIMELINE_DIRECTION_FORWARD && progress >= 1.0) ||
+ (priv->direction == MSD_TIMELINE_DIRECTION_BACKWARD && progress <= 0.0))
{
if (!priv->loop)
{
@@ -401,60 +401,60 @@ gsd_timeline_run_frame (GsdTimeline *timeline,
return FALSE;
}
else
- gsd_timeline_rewind (timeline);
+ msd_timeline_rewind (timeline);
}
return TRUE;
}
static gboolean
-gsd_timeline_frame_idle_func (GsdTimeline *timeline)
+msd_timeline_frame_idle_func (MsdTimeline *timeline)
{
- return gsd_timeline_run_frame (timeline, TRUE);
+ return msd_timeline_run_frame (timeline, TRUE);
}
/**
- * gsd_timeline_new:
+ * msd_timeline_new:
* @duration: duration in milliseconds for the timeline
*
- * Creates a new #GsdTimeline with the specified number of frames.
+ * Creates a new #MsdTimeline with the specified number of frames.
*
- * Return Value: the newly created #GsdTimeline
+ * Return Value: the newly created #MsdTimeline
**/
-GsdTimeline *
-gsd_timeline_new (guint duration)
+MsdTimeline *
+msd_timeline_new (guint duration)
{
- return g_object_new (GSD_TYPE_TIMELINE,
+ return g_object_new (MSD_TYPE_TIMELINE,
"duration", duration,
NULL);
}
-GsdTimeline *
-gsd_timeline_new_for_screen (guint duration,
+MsdTimeline *
+msd_timeline_new_for_screen (guint duration,
GdkScreen *screen)
{
- return g_object_new (GSD_TYPE_TIMELINE,
+ return g_object_new (MSD_TYPE_TIMELINE,
"duration", duration,
"screen", screen,
NULL);
}
/**
- * gsd_timeline_start:
- * @timeline: A #GsdTimeline
+ * msd_timeline_start:
+ * @timeline: A #MsdTimeline
*
* Runs the timeline from the current frame.
**/
void
-gsd_timeline_start (GsdTimeline *timeline)
+msd_timeline_start (MsdTimeline *timeline)
{
- GsdTimelinePriv *priv;
+ MsdTimelinePriv *priv;
GtkSettings *settings;
gboolean enable_animations = FALSE;
- g_return_if_fail (GSD_IS_TIMELINE (timeline));
+ g_return_if_fail (MSD_IS_TIMELINE (timeline));
- priv = GSD_TIMELINE_GET_PRIV (timeline);
+ priv = MSD_TIMELINE_GET_PRIV (timeline);
if (priv->screen)
{
@@ -477,7 +477,7 @@ gsd_timeline_start (GsdTimeline *timeline)
g_signal_emit (timeline, signals [STARTED], 0);
priv->source_id = gdk_threads_add_timeout (FRAME_INTERVAL (priv->fps),
- (GSourceFunc) gsd_timeline_frame_idle_func,
+ (GSourceFunc) msd_timeline_frame_idle_func,
timeline);
}
}
@@ -490,24 +490,24 @@ gsd_timeline_start (GsdTimeline *timeline)
* loop into this animation again.
*/
g_signal_emit (timeline, signals [STARTED], 0);
- gsd_timeline_run_frame (timeline, FALSE);
+ msd_timeline_run_frame (timeline, FALSE);
}
}
/**
- * gsd_timeline_pause:
- * @timeline: A #GsdTimeline
+ * msd_timeline_pause:
+ * @timeline: A #MsdTimeline
*
* Pauses the timeline.
**/
void
-gsd_timeline_pause (GsdTimeline *timeline)
+msd_timeline_pause (MsdTimeline *timeline)
{
- GsdTimelinePriv *priv;
+ MsdTimelinePriv *priv;
- g_return_if_fail (GSD_IS_TIMELINE (timeline));
+ g_return_if_fail (MSD_IS_TIMELINE (timeline));
- priv = GSD_TIMELINE_GET_PRIV (timeline);
+ priv = MSD_TIMELINE_GET_PRIV (timeline);
if (priv->source_id)
{
@@ -519,26 +519,26 @@ gsd_timeline_pause (GsdTimeline *timeline)
}
/**
- * gsd_timeline_rewind:
- * @timeline: A #GsdTimeline
+ * msd_timeline_rewind:
+ * @timeline: A #MsdTimeline
*
* Rewinds the timeline.
**/
void
-gsd_timeline_rewind (GsdTimeline *timeline)
+msd_timeline_rewind (MsdTimeline *timeline)
{
- GsdTimelinePriv *priv;
+ MsdTimelinePriv *priv;
- g_return_if_fail (GSD_IS_TIMELINE (timeline));
+ g_return_if_fail (MSD_IS_TIMELINE (timeline));
- priv = GSD_TIMELINE_GET_PRIV (timeline);
+ priv = MSD_TIMELINE_GET_PRIV (timeline);
/* destroy and re-create timer if neccesary */
if (priv->timer)
{
g_timer_destroy (priv->timer);
- if (gsd_timeline_is_running (timeline))
+ if (msd_timeline_is_running (timeline))
priv->timer = g_timer_new ();
else
priv->timer = NULL;
@@ -546,70 +546,70 @@ gsd_timeline_rewind (GsdTimeline *timeline)
}
/**
- * gsd_timeline_is_running:
- * @timeline: A #GsdTimeline
+ * msd_timeline_is_running:
+ * @timeline: A #MsdTimeline
*
* Returns whether the timeline is running or not.
*
* Return Value: %TRUE if the timeline is running
**/
gboolean
-gsd_timeline_is_running (GsdTimeline *timeline)
+msd_timeline_is_running (MsdTimeline *timeline)
{
- GsdTimelinePriv *priv;
+ MsdTimelinePriv *priv;
- g_return_val_if_fail (GSD_IS_TIMELINE (timeline), FALSE);
+ g_return_val_if_fail (MSD_IS_TIMELINE (timeline), FALSE);
- priv = GSD_TIMELINE_GET_PRIV (timeline);
+ priv = MSD_TIMELINE_GET_PRIV (timeline);
return (priv->source_id != 0);
}
/**
- * gsd_timeline_get_fps:
- * @timeline: A #GsdTimeline
+ * msd_timeline_get_fps:
+ * @timeline: A #MsdTimeline
*
* Returns the number of frames per second.
*
* Return Value: frames per second
**/
guint
-gsd_timeline_get_fps (GsdTimeline *timeline)
+msd_timeline_get_fps (MsdTimeline *timeline)
{
- GsdTimelinePriv *priv;
+ MsdTimelinePriv *priv;
- g_return_val_if_fail (GSD_IS_TIMELINE (timeline), 1);
+ g_return_val_if_fail (MSD_IS_TIMELINE (timeline), 1);
- priv = GSD_TIMELINE_GET_PRIV (timeline);
+ priv = MSD_TIMELINE_GET_PRIV (timeline);
return priv->fps;
}
/**
- * gsd_timeline_set_fps:
- * @timeline: A #GsdTimeline
+ * msd_timeline_set_fps:
+ * @timeline: A #MsdTimeline
* @fps: frames per second
*
* Sets the number of frames per second that
* the timeline will play.
**/
void
-gsd_timeline_set_fps (GsdTimeline *timeline,
+msd_timeline_set_fps (MsdTimeline *timeline,
guint fps)
{
- GsdTimelinePriv *priv;
+ MsdTimelinePriv *priv;
- g_return_if_fail (GSD_IS_TIMELINE (timeline));
+ g_return_if_fail (MSD_IS_TIMELINE (timeline));
g_return_if_fail (fps > 0);
- priv = GSD_TIMELINE_GET_PRIV (timeline);
+ priv = MSD_TIMELINE_GET_PRIV (timeline);
priv->fps = fps;
- if (gsd_timeline_is_running (timeline))
+ if (msd_timeline_is_running (timeline))
{
g_source_remove (priv->source_id);
priv->source_id = gdk_threads_add_timeout (FRAME_INTERVAL (priv->fps),
- (GSourceFunc) gsd_timeline_run_frame,
+ (GSourceFunc) msd_timeline_run_frame,
timeline);
}
@@ -617,8 +617,8 @@ gsd_timeline_set_fps (GsdTimeline *timeline,
}
/**
- * gsd_timeline_get_loop:
- * @timeline: A #GsdTimeline
+ * msd_timeline_get_loop:
+ * @timeline: A #MsdTimeline
*
* Returns whether the timeline loops to the
* beginning when it has reached the end.
@@ -626,47 +626,47 @@ gsd_timeline_set_fps (GsdTimeline *timeline,
* Return Value: %TRUE if the timeline loops
**/
gboolean
-gsd_timeline_get_loop (GsdTimeline *timeline)
+msd_timeline_get_loop (MsdTimeline *timeline)
{
- GsdTimelinePriv *priv;
+ MsdTimelinePriv *priv;
- g_return_val_if_fail (GSD_IS_TIMELINE (timeline), FALSE);
+ g_return_val_if_fail (MSD_IS_TIMELINE (timeline), FALSE);
- priv = GSD_TIMELINE_GET_PRIV (timeline);
+ priv = MSD_TIMELINE_GET_PRIV (timeline);
return priv->loop;
}
/**
- * gsd_timeline_set_loop:
- * @timeline: A #GsdTimeline
+ * msd_timeline_set_loop:
+ * @timeline: A #MsdTimeline
* @loop: %TRUE to make the timeline loop
*
* Sets whether the timeline loops to the beginning
* when it has reached the end.
**/
void
-gsd_timeline_set_loop (GsdTimeline *timeline,
+msd_timeline_set_loop (MsdTimeline *timeline,
gboolean loop)
{
- GsdTimelinePriv *priv;
+ MsdTimelinePriv *priv;
- g_return_if_fail (GSD_IS_TIMELINE (timeline));
+ g_return_if_fail (MSD_IS_TIMELINE (timeline));
- priv = GSD_TIMELINE_GET_PRIV (timeline);
+ priv = MSD_TIMELINE_GET_PRIV (timeline);
priv->loop = loop;
g_object_notify (G_OBJECT (timeline), "loop");
}
void
-gsd_timeline_set_duration (GsdTimeline *timeline,
+msd_timeline_set_duration (MsdTimeline *timeline,
guint duration)
{
- GsdTimelinePriv *priv;
+ MsdTimelinePriv *priv;
- g_return_if_fail (GSD_IS_TIMELINE (timeline));
+ g_return_if_fail (MSD_IS_TIMELINE (timeline));
- priv = GSD_TIMELINE_GET_PRIV (timeline);
+ priv = MSD_TIMELINE_GET_PRIV (timeline);
priv->duration = duration;
@@ -674,78 +674,78 @@ gsd_timeline_set_duration (GsdTimeline *timeline,
}
guint
-gsd_timeline_get_duration (GsdTimeline *timeline)
+msd_timeline_get_duration (MsdTimeline *timeline)
{
- GsdTimelinePriv *priv;
+ MsdTimelinePriv *priv;
- g_return_val_if_fail (GSD_IS_TIMELINE (timeline), 0);
+ g_return_val_if_fail (MSD_IS_TIMELINE (timeline), 0);
- priv = GSD_TIMELINE_GET_PRIV (timeline);
+ priv = MSD_TIMELINE_GET_PRIV (timeline);
return priv->duration;
}
/**
- * gsd_timeline_get_direction:
- * @timeline: A #GsdTimeline
+ * msd_timeline_get_direction:
+ * @timeline: A #MsdTimeline
*
* Returns the direction of the timeline.
*
* Return Value: direction
**/
-GsdTimelineDirection
-gsd_timeline_get_direction (GsdTimeline *timeline)
+MsdTimelineDirection
+msd_timeline_get_direction (MsdTimeline *timeline)
{
- GsdTimelinePriv *priv;
+ MsdTimelinePriv *priv;
- g_return_val_if_fail (GSD_IS_TIMELINE (timeline), GSD_TIMELINE_DIRECTION_FORWARD);
+ g_return_val_if_fail (MSD_IS_TIMELINE (timeline), MSD_TIMELINE_DIRECTION_FORWARD);
- priv = GSD_TIMELINE_GET_PRIV (timeline);
+ priv = MSD_TIMELINE_GET_PRIV (timeline);
return priv->direction;
}
/**
- * gsd_timeline_set_direction:
- * @timeline: A #GsdTimeline
+ * msd_timeline_set_direction:
+ * @timeline: A #MsdTimeline
* @direction: direction
*
* Sets the direction of the timeline.
**/
void
-gsd_timeline_set_direction (GsdTimeline *timeline,
- GsdTimelineDirection direction)
+msd_timeline_set_direction (MsdTimeline *timeline,
+ MsdTimelineDirection direction)
{
- GsdTimelinePriv *priv;
+ MsdTimelinePriv *priv;
- g_return_if_fail (GSD_IS_TIMELINE (timeline));
+ g_return_if_fail (MSD_IS_TIMELINE (timeline));
- priv = GSD_TIMELINE_GET_PRIV (timeline);
+ priv = MSD_TIMELINE_GET_PRIV (timeline);
priv->direction = direction;
g_object_notify (G_OBJECT (timeline), "direction");
}
GdkScreen *
-gsd_timeline_get_screen (GsdTimeline *timeline)
+msd_timeline_get_screen (MsdTimeline *timeline)
{
- GsdTimelinePriv *priv;
+ MsdTimelinePriv *priv;
- g_return_val_if_fail (GSD_IS_TIMELINE (timeline), NULL);
+ g_return_val_if_fail (MSD_IS_TIMELINE (timeline), NULL);
- priv = GSD_TIMELINE_GET_PRIV (timeline);
+ priv = MSD_TIMELINE_GET_PRIV (timeline);
return priv->screen;
}
void
-gsd_timeline_set_screen (GsdTimeline *timeline,
+msd_timeline_set_screen (MsdTimeline *timeline,
GdkScreen *screen)
{
- GsdTimelinePriv *priv;
+ MsdTimelinePriv *priv;
- g_return_if_fail (GSD_IS_TIMELINE (timeline));
+ g_return_if_fail (MSD_IS_TIMELINE (timeline));
g_return_if_fail (GDK_IS_SCREEN (screen));
- priv = GSD_TIMELINE_GET_PRIV (timeline);
+ priv = MSD_TIMELINE_GET_PRIV (timeline);
if (priv->screen)
g_object_unref (priv->screen);
@@ -756,38 +756,38 @@ gsd_timeline_set_screen (GsdTimeline *timeline,
}
void
-gsd_timeline_set_progress_type (GsdTimeline *timeline,
- GsdTimelineProgressType type)
+msd_timeline_set_progress_type (MsdTimeline *timeline,
+ MsdTimelineProgressType type)
{
- GsdTimelinePriv *priv;
+ MsdTimelinePriv *priv;
- g_return_if_fail (GSD_IS_TIMELINE (timeline));
+ g_return_if_fail (MSD_IS_TIMELINE (timeline));
- priv = GSD_TIMELINE_GET_PRIV (timeline);
+ priv = MSD_TIMELINE_GET_PRIV (timeline);
priv->progress_type = type;
g_object_notify (G_OBJECT (timeline), "progress-type");
}
-GsdTimelineProgressType
-gsd_timeline_get_progress_type (GsdTimeline *timeline)
+MsdTimelineProgressType
+msd_timeline_get_progress_type (MsdTimeline *timeline)
{
- GsdTimelinePriv *priv;
+ MsdTimelinePriv *priv;
- g_return_val_if_fail (GSD_IS_TIMELINE (timeline), GSD_TIMELINE_PROGRESS_LINEAR);
+ g_return_val_if_fail (MSD_IS_TIMELINE (timeline), MSD_TIMELINE_PROGRESS_LINEAR);
- priv = GSD_TIMELINE_GET_PRIV (timeline);
+ priv = MSD_TIMELINE_GET_PRIV (timeline);
if (priv->progress_func)
- return GSD_TIMELINE_PROGRESS_LINEAR;
+ return MSD_TIMELINE_PROGRESS_LINEAR;
return priv->progress_type;
}
/**
- * gsd_timeline_set_progress_func:
- * @timeline: A #GsdTimeline
+ * msd_timeline_set_progress_func:
+ * @timeline: A #MsdTimeline
* @progress_func: progress function
*
* Sets the progress function. This function will be used to calculate
@@ -799,28 +799,28 @@ gsd_timeline_get_progress_type (GsdTimeline *timeline)
* All progresses are in the [0.0, 1.0] range.
**/
void
-gsd_timeline_set_progress_func (GsdTimeline *timeline,
- GsdTimelineProgressFunc progress_func)
+msd_timeline_set_progress_func (MsdTimeline *timeline,
+ MsdTimelineProgressFunc progress_func)
{
- GsdTimelinePriv *priv;
+ MsdTimelinePriv *priv;
- g_return_if_fail (GSD_IS_TIMELINE (timeline));
+ g_return_if_fail (MSD_IS_TIMELINE (timeline));
- priv = GSD_TIMELINE_GET_PRIV (timeline);
+ priv = MSD_TIMELINE_GET_PRIV (timeline);
priv->progress_func = progress_func;
}
gdouble
-gsd_timeline_get_progress (GsdTimeline *timeline)
+msd_timeline_get_progress (MsdTimeline *timeline)
{
- GsdTimelinePriv *priv;
- GsdTimelineProgressFunc progress_func = NULL;
+ MsdTimelinePriv *priv;
+ MsdTimelineProgressFunc progress_func = NULL;
gdouble linear_progress, progress;
guint elapsed_time;
- g_return_val_if_fail (GSD_IS_TIMELINE (timeline), 0.0);
+ g_return_val_if_fail (MSD_IS_TIMELINE (timeline), 0.0);
- priv = GSD_TIMELINE_GET_PRIV (timeline);
+ priv = MSD_TIMELINE_GET_PRIV (timeline);
if (!priv->timer)
return 0.;
@@ -829,7 +829,7 @@ gsd_timeline_get_progress (GsdTimeline *timeline)
linear_progress = (gdouble) elapsed_time / priv->duration;
- if (priv->direction == GSD_TIMELINE_DIRECTION_BACKWARD)
+ if (priv->direction == MSD_TIMELINE_DIRECTION_BACKWARD)
linear_progress = 1 - linear_progress;
linear_progress = CLAMP (linear_progress, 0., 1.);