4 * An OpenGL based 'interactive canvas' library.
6 * Authored By Matthew Allum <mallum@openedhand.com>
8 * Copyright (C) 2006 OpenedHand
10 * This library is free software; you can redistribute it and/or
11 * modify it under the terms of the GNU Lesser General Public
12 * License as published by the Free Software Foundation; either
13 * version 2 of the License, or (at your option) any later version.
15 * This library is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 * Lesser General Public License for more details.
20 * You should have received a copy of the GNU Lesser General Public
21 * License along with this library. If not, see <http://www.gnu.org/licenses/>.
24 #if !defined(__CLUTTER_H_INSIDE__) && !defined(CLUTTER_COMPILATION)
25 #error "Only <clutter/clutter.h> can be included directly."
28 #ifndef __CLUTTER_TIMELINE_H__
29 #define __CLUTTER_TIMELINE_H__
31 #include <clutter/clutter-types.h>
35 #define CLUTTER_TYPE_TIMELINE (clutter_timeline_get_type ())
36 #define CLUTTER_TIMELINE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CLUTTER_TYPE_TIMELINE, ClutterTimeline))
37 #define CLUTTER_TIMELINE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CLUTTER_TYPE_TIMELINE, ClutterTimelineClass))
38 #define CLUTTER_IS_TIMELINE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CLUTTER_TYPE_TIMELINE))
39 #define CLUTTER_IS_TIMELINE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CLUTTER_TYPE_TIMELINE))
40 #define CLUTTER_TIMELINE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), CLUTTER_TYPE_TIMELINE, ClutterTimelineClass))
42 typedef struct _ClutterTimelineClass ClutterTimelineClass;
43 typedef struct _ClutterTimelinePrivate ClutterTimelinePrivate;
46 * ClutterTimelineProgressFunc:
47 * @timeline: a #ClutterTimeline
48 * @elapsed: the elapsed time, in milliseconds
49 * @total: the total duration of the timeline, in milliseconds,
50 * @user_data: data passed to the function
52 * A function for defining a custom progress.
54 * Return value: the progress, as a floating point value between -1.0 and 2.0.
58 typedef gdouble (* ClutterTimelineProgressFunc) (ClutterTimeline *timeline,
66 * The #ClutterTimeline structure contains only private data
67 * and should be accessed using the provided API
71 struct _ClutterTimeline
74 GObject parent_instance;
76 ClutterTimelinePrivate *priv;
80 * ClutterTimelineClass:
81 * @started: class handler for the #ClutterTimeline::started signal
82 * @completed: class handler for the #ClutterTimeline::completed signal
83 * @paused: class handler for the #ClutterTimeline::paused signal
84 * @new_frame: class handler for the #ClutterTimeline::new-frame signal
85 * @marker_reached: class handler for the #ClutterTimeline::marker-reached signal
86 * @stopped: class handler for the #ClutterTimeline::stopped signal
88 * The #ClutterTimelineClass structure contains only private data
92 struct _ClutterTimelineClass
95 GObjectClass parent_class;
98 void (*started) (ClutterTimeline *timeline);
99 void (*completed) (ClutterTimeline *timeline);
100 void (*paused) (ClutterTimeline *timeline);
102 void (*new_frame) (ClutterTimeline *timeline,
105 void (*marker_reached) (ClutterTimeline *timeline,
106 const gchar *marker_name,
108 void (*stopped) (ClutterTimeline *timeline,
109 gboolean is_finished);
112 void (*_clutter_timeline_1) (void);
113 void (*_clutter_timeline_2) (void);
114 void (*_clutter_timeline_3) (void);
115 void (*_clutter_timeline_4) (void);
118 GType clutter_timeline_get_type (void) G_GNUC_CONST;
120 ClutterTimeline * clutter_timeline_new (guint msecs);
122 guint clutter_timeline_get_duration (ClutterTimeline *timeline);
123 void clutter_timeline_set_duration (ClutterTimeline *timeline,
125 ClutterTimelineDirection clutter_timeline_get_direction (ClutterTimeline *timeline);
126 void clutter_timeline_set_direction (ClutterTimeline *timeline,
127 ClutterTimelineDirection direction);
128 void clutter_timeline_start (ClutterTimeline *timeline);
129 void clutter_timeline_pause (ClutterTimeline *timeline);
130 void clutter_timeline_stop (ClutterTimeline *timeline);
131 void clutter_timeline_set_auto_reverse (ClutterTimeline *timeline,
133 gboolean clutter_timeline_get_auto_reverse (ClutterTimeline *timeline);
134 CLUTTER_AVAILABLE_IN_1_10
135 void clutter_timeline_set_repeat_count (ClutterTimeline *timeline,
137 CLUTTER_AVAILABLE_IN_1_10
138 gint clutter_timeline_get_repeat_count (ClutterTimeline *timeline);
139 void clutter_timeline_rewind (ClutterTimeline *timeline);
140 void clutter_timeline_skip (ClutterTimeline *timeline,
142 void clutter_timeline_advance (ClutterTimeline *timeline,
144 guint clutter_timeline_get_elapsed_time (ClutterTimeline *timeline);
145 gdouble clutter_timeline_get_progress (ClutterTimeline *timeline);
146 gboolean clutter_timeline_is_playing (ClutterTimeline *timeline);
147 void clutter_timeline_set_delay (ClutterTimeline *timeline,
149 guint clutter_timeline_get_delay (ClutterTimeline *timeline);
150 guint clutter_timeline_get_delta (ClutterTimeline *timeline);
151 void clutter_timeline_add_marker_at_time (ClutterTimeline *timeline,
152 const gchar *marker_name,
154 void clutter_timeline_remove_marker (ClutterTimeline *timeline,
155 const gchar *marker_name);
156 gchar ** clutter_timeline_list_markers (ClutterTimeline *timeline,
158 gsize *n_markers) G_GNUC_MALLOC;
159 gboolean clutter_timeline_has_marker (ClutterTimeline *timeline,
160 const gchar *marker_name);
161 void clutter_timeline_advance_to_marker (ClutterTimeline *timeline,
162 const gchar *marker_name);
163 CLUTTER_AVAILABLE_IN_1_10
164 void clutter_timeline_set_progress_func (ClutterTimeline *timeline,
165 ClutterTimelineProgressFunc func,
167 GDestroyNotify notify);
168 CLUTTER_AVAILABLE_IN_1_10
169 void clutter_timeline_set_progress_mode (ClutterTimeline *timeline,
170 ClutterAnimationMode mode);
171 CLUTTER_AVAILABLE_IN_1_10
172 ClutterAnimationMode clutter_timeline_get_progress_mode (ClutterTimeline *timeline);
174 CLUTTER_AVAILABLE_IN_1_10
175 gint64 clutter_timeline_get_duration_hint (ClutterTimeline *timeline);
176 CLUTTER_AVAILABLE_IN_1_10
177 gint clutter_timeline_get_current_repeat (ClutterTimeline *timeline);
181 #endif /* _CLUTTER_TIMELINE_H__ */