]> Pileus Git - ~andy/gtk/blob - gdk-pixbuf/gdk-pixbuf-animation.h
Remove GLIB_DIVERT_BEFORE_HELP() on initialization of gdktarget, that was
[~andy/gtk] / gdk-pixbuf / gdk-pixbuf-animation.h
1 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */
2 /* GdkPixbuf library - Animation support
3  *
4  * Copyright (C) 1999 The Free Software Foundation
5  *
6  * Authors: Mark Crichton <crichton@gimp.org>
7  *          Miguel de Icaza <miguel@gnu.org>
8  *          Federico Mena-Quintero <federico@gimp.org>
9  *          Havoc Pennington <hp@redhat.com>
10  *
11  * This library is free software; you can redistribute it and/or
12  * modify it under the terms of the GNU Lesser General Public
13  * License as published by the Free Software Foundation; either
14  * version 2 of the License, or (at your option) any later version.
15  *
16  * This library is distributed in the hope that it will be useful,
17  * but WITHOUT ANY WARRANTY; without even the implied warranty of
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
19  * Lesser General Public License for more details.
20  *
21  * You should have received a copy of the GNU Lesser General Public
22  * License along with this library; if not, write to the
23  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
24  * Boston, MA 02111-1307, USA.
25  */
26
27 #ifndef GDK_PIXBUF_ANIMATION_H
28 #define GDK_PIXBUF_ANIMATION_H
29
30 #include <glib.h>
31 #include <glib-object.h>
32 #include <gdk-pixbuf/gdk-pixbuf-core.h>
33
34 G_BEGIN_DECLS
35
36 /* Animation support */
37
38 typedef struct _GdkPixbufAnimation GdkPixbufAnimation;
39 typedef struct _GdkPixbufAnimationIter GdkPixbufAnimationIter;
40
41 #define GDK_TYPE_PIXBUF_ANIMATION              (gdk_pixbuf_animation_get_type ())
42 #define GDK_PIXBUF_ANIMATION(object)           (G_TYPE_CHECK_INSTANCE_CAST ((object), GDK_TYPE_PIXBUF_ANIMATION, GdkPixbufAnimation))
43 #define GDK_IS_PIXBUF_ANIMATION(object)        (G_TYPE_CHECK_INSTANCE_TYPE ((object), GDK_TYPE_PIXBUF_ANIMATION))
44
45 #define GDK_TYPE_PIXBUF_ANIMATION_ITER              (gdk_pixbuf_animation_iter_get_type ())
46 #define GDK_PIXBUF_ANIMATION_ITER(object)           (G_TYPE_CHECK_INSTANCE_CAST ((object), GDK_TYPE_PIXBUF_ANIMATION_ITER, GdkPixbufAnimationIter))
47 #define GDK_IS_PIXBUF_ANIMATION_ITER(object)        (G_TYPE_CHECK_INSTANCE_TYPE ((object), GDK_TYPE_PIXBUF_ANIMATION_ITER))
48
49 GType               gdk_pixbuf_animation_get_type        (void) G_GNUC_CONST;
50
51 #ifdef G_OS_WIN32
52 #define gdk_pixbuf_animation_new_from_file gdk_pixbuf_animation_new_from_file_utf8
53 #endif
54
55 GdkPixbufAnimation *gdk_pixbuf_animation_new_from_file   (const char         *filename,
56                                                           GError            **error);
57
58 #ifndef GDK_PIXBUF_DISABLE_DEPRECATED
59 GdkPixbufAnimation *gdk_pixbuf_animation_ref             (GdkPixbufAnimation *animation);
60 void                gdk_pixbuf_animation_unref           (GdkPixbufAnimation *animation);
61 #endif
62
63 int                 gdk_pixbuf_animation_get_width       (GdkPixbufAnimation *animation);
64 int                 gdk_pixbuf_animation_get_height      (GdkPixbufAnimation *animation);
65 gboolean            gdk_pixbuf_animation_is_static_image  (GdkPixbufAnimation *animation);
66 GdkPixbuf          *gdk_pixbuf_animation_get_static_image (GdkPixbufAnimation *animation);
67
68 GdkPixbufAnimationIter *gdk_pixbuf_animation_get_iter                        (GdkPixbufAnimation     *animation,
69                                                                               const GTimeVal         *start_time);
70 GType                   gdk_pixbuf_animation_iter_get_type                   (void) G_GNUC_CONST;
71 int                     gdk_pixbuf_animation_iter_get_delay_time             (GdkPixbufAnimationIter *iter);
72 GdkPixbuf              *gdk_pixbuf_animation_iter_get_pixbuf                 (GdkPixbufAnimationIter *iter);
73 gboolean                gdk_pixbuf_animation_iter_on_currently_loading_frame (GdkPixbufAnimationIter *iter);
74 gboolean                gdk_pixbuf_animation_iter_advance                    (GdkPixbufAnimationIter *iter,
75                                                                               const GTimeVal         *current_time);
76
77
78 #ifdef GDK_PIXBUF_ENABLE_BACKEND
79
80 \f
81
82 typedef struct _GdkPixbufAnimationClass GdkPixbufAnimationClass;
83
84 #define GDK_PIXBUF_ANIMATION_CLASS(klass)      (G_TYPE_CHECK_CLASS_CAST ((klass), GDK_TYPE_PIXBUF_ANIMATION, GdkPixbufAnimationClass))
85 #define GDK_IS_PIXBUF_ANIMATION_CLASS(klass)   (G_TYPE_CHECK_CLASS_TYPE ((klass), GDK_TYPE_PIXBUF_ANIMATION))
86 #define GDK_PIXBUF_ANIMATION_GET_CLASS(obj)    (G_TYPE_INSTANCE_GET_CLASS ((obj), GDK_TYPE_PIXBUF_ANIMATION, GdkPixbufAnimationClass))
87
88 /* Private part of the GdkPixbufAnimation structure */
89 struct _GdkPixbufAnimation {
90         GObject parent_instance;
91
92 };
93
94 struct _GdkPixbufAnimationClass {
95         GObjectClass parent_class;
96
97         /*< public >*/
98
99         gboolean                (*is_static_image)  (GdkPixbufAnimation *anim);
100
101         GdkPixbuf*              (*get_static_image) (GdkPixbufAnimation *anim);
102         
103         void                    (*get_size) (GdkPixbufAnimation *anim,
104                                              int                 *width,
105                                              int                 *height);
106         
107         GdkPixbufAnimationIter* (*get_iter) (GdkPixbufAnimation *anim,
108                                              const GTimeVal     *start_time);
109
110 };
111
112 \f
113
114 typedef struct _GdkPixbufAnimationIterClass GdkPixbufAnimationIterClass;
115
116 #define GDK_PIXBUF_ANIMATION_ITER_CLASS(klass)      (G_TYPE_CHECK_CLASS_CAST ((klass), GDK_TYPE_PIXBUF_ANIMATION_ITER, GdkPixbufAnimationIterClass))
117 #define GDK_IS_PIXBUF_ANIMATION_ITER_CLASS(klass)   (G_TYPE_CHECK_CLASS_TYPE ((klass), GDK_TYPE_PIXBUF_ANIMATION_ITER))
118 #define GDK_PIXBUF_ANIMATION_ITER_GET_CLASS(obj)    (G_TYPE_INSTANCE_GET_CLASS ((obj), GDK_TYPE_PIXBUF_ANIMATION_ITER, GdkPixbufAnimationIterClass))
119
120 struct _GdkPixbufAnimationIter {
121         GObject parent_instance;
122
123 };
124
125 struct _GdkPixbufAnimationIterClass {
126         GObjectClass parent_class;
127
128         /*< public >*/
129
130         int        (*get_delay_time)   (GdkPixbufAnimationIter *iter);
131
132         GdkPixbuf* (*get_pixbuf)       (GdkPixbufAnimationIter *iter);
133
134         gboolean   (*on_currently_loading_frame) (GdkPixbufAnimationIter *iter);
135
136         gboolean   (*advance)          (GdkPixbufAnimationIter *iter,
137                                         const GTimeVal         *current_time);
138 };
139       
140
141 GdkPixbufAnimation* gdk_pixbuf_non_anim_new (GdkPixbuf *pixbuf);
142
143 #endif /* GDK_PIXBUF_ENABLE_BACKEND */
144
145 G_END_DECLS
146
147 #endif /* GDK_PIXBUF_ANIMATION_H */