Release Clutter 1.11.4 (snapshot)
[profile/ivi/clutter.git] / clutter / clutter-timeline.h
1 /*
2  * Clutter.
3  *
4  * An OpenGL based 'interactive canvas' library.
5  *
6  * Authored By Matthew Allum  <mallum@openedhand.com>
7  *
8  * Copyright (C) 2006 OpenedHand
9  *
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.
14  *
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.
19  *
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/>.
22  */
23
24 #if !defined(__CLUTTER_H_INSIDE__) && !defined(CLUTTER_COMPILATION)
25 #error "Only <clutter/clutter.h> can be included directly."
26 #endif
27
28 #ifndef __CLUTTER_TIMELINE_H__
29 #define __CLUTTER_TIMELINE_H__
30
31 #include <clutter/clutter-types.h>
32
33 G_BEGIN_DECLS
34
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))
41
42 typedef struct _ClutterTimelineClass   ClutterTimelineClass; 
43 typedef struct _ClutterTimelinePrivate ClutterTimelinePrivate;
44
45 /**
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
51  *
52  * A function for defining a custom progress.
53  *
54  * Return value: the progress, as a floating point value between -1.0 and 2.0.
55  *
56  * Since: 1.10
57  */
58 typedef gdouble (* ClutterTimelineProgressFunc) (ClutterTimeline *timeline,
59                                                  gdouble          elapsed,
60                                                  gdouble          total,
61                                                  gpointer         user_data);
62
63 /**
64  * ClutterTimeline:
65  *
66  * The #ClutterTimeline structure contains only private data
67  * and should be accessed using the provided API
68  *
69  * Since: 0.2
70  */
71 struct _ClutterTimeline
72 {
73   /*< private >*/
74   GObject parent_instance;
75
76   ClutterTimelinePrivate *priv;
77 };
78
79 /**
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
87  *
88  * The #ClutterTimelineClass structure contains only private data
89  *
90  * Since: 0.2
91  */
92 struct _ClutterTimelineClass
93 {
94   /*< private >*/
95   GObjectClass parent_class;
96   
97   /*< public >*/
98   void (*started)        (ClutterTimeline *timeline);
99   void (*completed)      (ClutterTimeline *timeline);
100   void (*paused)         (ClutterTimeline *timeline);
101   
102   void (*new_frame)      (ClutterTimeline *timeline,
103                           gint             msecs);
104
105   void (*marker_reached) (ClutterTimeline *timeline,
106                           const gchar     *marker_name,
107                           gint             msecs);
108   void (*stopped)        (ClutterTimeline *timeline,
109                           gboolean         is_finished);
110
111   /*< private >*/
112   void (*_clutter_timeline_1) (void);
113   void (*_clutter_timeline_2) (void);
114   void (*_clutter_timeline_3) (void);
115   void (*_clutter_timeline_4) (void);
116 };
117
118 GType clutter_timeline_get_type (void) G_GNUC_CONST;
119
120 ClutterTimeline *               clutter_timeline_new                    (guint                     msecs);
121
122 guint                           clutter_timeline_get_duration           (ClutterTimeline          *timeline);
123 void                            clutter_timeline_set_duration           (ClutterTimeline          *timeline,
124                                                                          guint                     msecs);
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,
132                                                                          gboolean                  reverse);
133 gboolean                        clutter_timeline_get_auto_reverse       (ClutterTimeline          *timeline);
134 CLUTTER_AVAILABLE_IN_1_10
135 void                            clutter_timeline_set_repeat_count       (ClutterTimeline          *timeline,
136                                                                          gint                      count);
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,
141                                                                          guint                     msecs);
142 void                            clutter_timeline_advance                (ClutterTimeline          *timeline,
143                                                                          guint                     msecs);
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,
148                                                                          guint                     msecs);
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,
153                                                                          guint                     msecs);
154 void                            clutter_timeline_remove_marker          (ClutterTimeline          *timeline,
155                                                                          const gchar              *marker_name);
156 gchar **                        clutter_timeline_list_markers           (ClutterTimeline          *timeline,
157                                                                          gint                      msecs,
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,
166                                                                          gpointer                  data,
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);
173
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);
178
179 G_END_DECLS
180
181 #endif /* _CLUTTER_TIMELINE_H__ */