]> Pileus Git - ~andy/gtk/blob - gtk/gtktimeline.h
5a69e43e5fc5af0502f6425a4ec78ba9cc560e90
[~andy/gtk] / gtk / gtktimeline.h
1 /* GTK - The GIMP Toolkit
2  * Copyright (C) 2007 Carlos Garnacho <carlos@imendio.com>
3  *
4  * This library is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Library General Public
6  * License as published by the Free Software Foundation; either
7  * version 2 of the License, or (at your option) any later version.
8  *
9  * This library is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12  * Library General Public License for more details.
13  *
14  * You should have received a copy of the GNU Library General Public
15  * License along with this library. If not, see <http://www.gnu.org/licenses/>.
16  */
17
18 #ifndef __GTK_TIMELINE_H__
19 #define __GTK_TIMELINE_H__
20
21 #include <glib-object.h>
22 #include <gtk/gtkenums.h>
23 #include <gtk/gtkwidget.h>
24 #include <gdk/gdk.h>
25
26 G_BEGIN_DECLS
27
28 #define GTK_TYPE_TIMELINE                 (gtk_timeline_get_type ())
29 #define GTK_TIMELINE(obj)                 (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_TIMELINE, GtkTimeline))
30 #define GTK_TIMELINE_CLASS(klass)         (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_TIMELINE, GtkTimelineClass))
31 #define GTK_IS_TIMELINE(obj)              (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_TIMELINE))
32 #define GTK_IS_TIMELINE_CLASS(klass)      (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_TIMELINE))
33 #define GTK_TIMELINE_GET_CLASS(obj)       (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_TIMELINE, GtkTimelineClass))
34
35 typedef struct GtkTimeline      GtkTimeline;
36 typedef struct GtkTimelineClass GtkTimelineClass;
37
38 typedef enum {
39   GTK_TIMELINE_DIRECTION_FORWARD,
40   GTK_TIMELINE_DIRECTION_BACKWARD
41 } GtkTimelineDirection;
42
43 typedef enum {
44   GTK_TIMELINE_PROGRESS_LINEAR,
45   GTK_TIMELINE_PROGRESS_EASE,
46   GTK_TIMELINE_PROGRESS_EASE_IN,
47   GTK_TIMELINE_PROGRESS_EASE_OUT,
48   GTK_TIMELINE_PROGRESS_EASE_IN_OUT
49 } GtkTimelineProgressType;
50
51 struct GtkTimeline
52 {
53   GObject parent_instance;
54   gpointer priv;
55 };
56
57 struct GtkTimelineClass
58 {
59   GObjectClass parent_class;
60
61   void (* started)           (GtkTimeline *timeline);
62   void (* finished)          (GtkTimeline *timeline);
63   void (* paused)            (GtkTimeline *timeline);
64
65   void (* frame)             (GtkTimeline *timeline,
66                               gdouble      progress);
67
68   void (* __gtk_reserved1) (void);
69   void (* __gtk_reserved2) (void);
70   void (* __gtk_reserved3) (void);
71   void (* __gtk_reserved4) (void);
72 };
73
74
75 GType                   gtk_timeline_get_type          (void) G_GNUC_CONST;
76
77 GtkTimeline *           gtk_timeline_new               (GtkWidget               *widget,
78                                                         guint                    duration);
79
80 void                    gtk_timeline_start             (GtkTimeline             *timeline);
81 void                    gtk_timeline_pause             (GtkTimeline             *timeline);
82 void                    gtk_timeline_rewind            (GtkTimeline             *timeline);
83
84 gboolean                gtk_timeline_is_running        (GtkTimeline             *timeline);
85 guint                   gtk_timeline_get_elapsed_time  (GtkTimeline             *timeline);
86
87 gboolean                gtk_timeline_get_loop          (GtkTimeline             *timeline);
88 void                    gtk_timeline_set_loop          (GtkTimeline             *timeline,
89                                                         gboolean                 loop);
90
91 guint                   gtk_timeline_get_duration      (GtkTimeline             *timeline);
92 void                    gtk_timeline_set_duration      (GtkTimeline             *timeline,
93                                                         guint                    duration);
94
95 GdkFrameClock *         gtk_timeline_get_frame_clock   (GtkTimeline             *timeline);
96 void                    gtk_timeline_set_frame_clock   (GtkTimeline             *timeline,
97                                                         GdkFrameClock           *frame_clock);
98
99 GdkScreen *             gtk_timeline_get_screen        (GtkTimeline             *timeline);
100 void                    gtk_timeline_set_screen        (GtkTimeline             *timeline,
101                                                         GdkScreen               *screen);
102
103 GtkWidget *             gtk_timeline_get_widget        (GtkTimeline             *timeline);
104 void                    gtk_timeline_set_widget        (GtkTimeline             *timeline,
105                                                         GtkWidget               *widget);
106
107 GtkTimelineDirection    gtk_timeline_get_direction     (GtkTimeline             *timeline);
108 void                    gtk_timeline_set_direction     (GtkTimeline             *timeline,
109                                                         GtkTimelineDirection     direction);
110
111 gdouble                 gtk_timeline_get_progress      (GtkTimeline             *timeline);
112
113 GtkTimelineProgressType gtk_timeline_get_progress_type (GtkTimeline             *timeline);
114 void                    gtk_timeline_set_progress_type (GtkTimeline             *timeline,
115                                                         GtkTimelineProgressType  progress_type);
116
117 G_END_DECLS
118
119 #endif /* _GTK_TIMELINE_H__ */