Github User Fetcher 1.0.0
C Application with Server and GUI
Loading...
Searching...
No Matches
gdk-pixbuf-animation.h
Go to the documentation of this file.
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, see <http://www.gnu.org/licenses/>.
23 */
24
25#ifndef GDK_PIXBUF_ANIMATION_H
26#define GDK_PIXBUF_ANIMATION_H
27
28#if defined(GDK_PIXBUF_DISABLE_SINGLE_INCLUDES) && !defined (GDK_PIXBUF_H_INSIDE) && !defined (GDK_PIXBUF_COMPILATION)
29#error "Only <gdk-pixbuf/gdk-pixbuf.h> can be included directly."
30#endif
31
32#include <glib-object.h>
34
36
37/* Animation support */
38
39typedef struct _GdkPixbufAnimation GdkPixbufAnimation;
40
41
42typedef struct _GdkPixbufAnimationIter GdkPixbufAnimationIter;
43
44#define GDK_TYPE_PIXBUF_ANIMATION (gdk_pixbuf_animation_get_type ())
45#define GDK_PIXBUF_ANIMATION(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), GDK_TYPE_PIXBUF_ANIMATION, GdkPixbufAnimation))
46#define GDK_IS_PIXBUF_ANIMATION(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), GDK_TYPE_PIXBUF_ANIMATION))
47
48#define GDK_TYPE_PIXBUF_ANIMATION_ITER (gdk_pixbuf_animation_iter_get_type ())
49#define GDK_PIXBUF_ANIMATION_ITER(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), GDK_TYPE_PIXBUF_ANIMATION_ITER, GdkPixbufAnimationIter))
50#define GDK_IS_PIXBUF_ANIMATION_ITER(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), GDK_TYPE_PIXBUF_ANIMATION_ITER))
51
54
55#ifdef G_OS_WIN32
56/* API/ABI compat, see gdk-pixbuf-core.h for details */
58GdkPixbufAnimation *gdk_pixbuf_animation_new_from_file_utf8 (const char *filename,
59 GError **error);
60#endif
61
64 GError **error);
67 GCancellable *cancellable,
68 GError **error);
71 GCancellable *cancellable,
72 GAsyncReadyCallback callback,
73 gpointer user_data);
76 GError **error);
79 GError **error);
80
81#ifndef GDK_PIXBUF_DISABLE_DEPRECATED
82
87#endif
88
97
101 const GTimeVal *start_time);
103
115 const GTimeVal *current_time);
117
118
119#ifdef GDK_PIXBUF_ENABLE_BACKEND
120
121
122
123/**
124 * GdkPixbufAnimationClass:
125 * @parent_class: the parent class
126 * @is_static_image: returns whether the given animation is just a static image.
127 * @get_static_image: returns a static image representing the given animation.
128 * @get_size: fills @width and @height with the frame size of the animation.
129 * @get_iter: returns an iterator for the given animation.
130 *
131 * Modules supporting animations must derive a type from
132 * #GdkPixbufAnimation, providing suitable implementations of the
133 * virtual functions.
134 */
135typedef struct _GdkPixbufAnimationClass GdkPixbufAnimationClass;
136
137#define GDK_PIXBUF_ANIMATION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GDK_TYPE_PIXBUF_ANIMATION, GdkPixbufAnimationClass))
138#define GDK_IS_PIXBUF_ANIMATION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GDK_TYPE_PIXBUF_ANIMATION))
139#define GDK_PIXBUF_ANIMATION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GDK_TYPE_PIXBUF_ANIMATION, GdkPixbufAnimationClass))
140
141/* Private part of the GdkPixbufAnimation structure */
142struct _GdkPixbufAnimation {
143 GObject parent_instance;
144
145};
146
148struct _GdkPixbufAnimationClass {
149 GObjectClass parent_class;
150
151 /*< public >*/
152
153 gboolean (*is_static_image) (GdkPixbufAnimation *animation);
154
155 GdkPixbuf* (*get_static_image) (GdkPixbufAnimation *animation);
156
157 void (*get_size) (GdkPixbufAnimation *animation,
158 int *width,
159 int *height);
160
161 GdkPixbufAnimationIter* (*get_iter) (GdkPixbufAnimation *animation,
162 const GTimeVal *start_time);
163};
165
166
167
168/**
169 * GdkPixbufAnimationIterClass:
170 * @parent_class: the parent class
171 * @get_delay_time: returns the time in milliseconds that the current frame
172 * should be shown.
173 * @get_pixbuf: returns the current frame.
174 * @on_currently_loading_frame: returns whether the current frame of @iter is
175 * being loaded.
176 * @advance: advances the iterator to @current_time, possibly changing the
177 * current frame.
178 *
179 * Modules supporting animations must derive a type from
180 * #GdkPixbufAnimationIter, providing suitable implementations of the
181 * virtual functions.
182 */
183typedef struct _GdkPixbufAnimationIterClass GdkPixbufAnimationIterClass;
184
185#define GDK_PIXBUF_ANIMATION_ITER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GDK_TYPE_PIXBUF_ANIMATION_ITER, GdkPixbufAnimationIterClass))
186#define GDK_IS_PIXBUF_ANIMATION_ITER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GDK_TYPE_PIXBUF_ANIMATION_ITER))
187#define GDK_PIXBUF_ANIMATION_ITER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GDK_TYPE_PIXBUF_ANIMATION_ITER, GdkPixbufAnimationIterClass))
188
189struct _GdkPixbufAnimationIter {
190 GObject parent_instance;
191
192};
193
195struct _GdkPixbufAnimationIterClass {
196 GObjectClass parent_class;
197
198 /*< public >*/
199
200 int (*get_delay_time) (GdkPixbufAnimationIter *iter);
201
202 GdkPixbuf* (*get_pixbuf) (GdkPixbufAnimationIter *iter);
203
204 gboolean (*on_currently_loading_frame) (GdkPixbufAnimationIter *iter);
205
206 gboolean (*advance) (GdkPixbufAnimationIter *iter,
207 const GTimeVal *current_time);
208};
210
211
213GType gdk_pixbuf_non_anim_get_type (void) G_GNUC_CONST;
215GdkPixbufAnimation* gdk_pixbuf_non_anim_new (GdkPixbuf *pixbuf);
216
217#endif /* GDK_PIXBUF_ENABLE_BACKEND */
218
220
221#endif /* GDK_PIXBUF_ANIMATION_H */
GDK_PIXBUF_AVAILABLE_IN_2_28 GdkPixbufAnimation * gdk_pixbuf_animation_new_from_resource(const char *resource_path, GError **error)
G_GNUC_BEGIN_IGNORE_DEPRECATIONS GDK_PIXBUF_AVAILABLE_IN_ALL GdkPixbufAnimationIter * gdk_pixbuf_animation_get_iter(GdkPixbufAnimation *animation, const GTimeVal *start_time)
G_GNUC_BEGIN_IGNORE_DEPRECATIONS GDK_PIXBUF_AVAILABLE_IN_ALL gboolean gdk_pixbuf_animation_iter_advance(GdkPixbufAnimationIter *iter, const GTimeVal *current_time)
GDK_PIXBUF_AVAILABLE_IN_ALL GdkPixbufAnimation * gdk_pixbuf_animation_new_from_file(const char *filename, GError **error)
GDK_PIXBUF_AVAILABLE_IN_2_28 GdkPixbufAnimation * gdk_pixbuf_animation_new_from_stream_finish(GAsyncResult *async_result, GError **error)
typedefG_BEGIN_DECLS struct _GdkPixbufAnimation GdkPixbufAnimation
GDK_PIXBUF_AVAILABLE_IN_ALL gboolean gdk_pixbuf_animation_iter_on_currently_loading_frame(GdkPixbufAnimationIter *iter)
GDK_PIXBUF_AVAILABLE_IN_ALL GdkPixbuf * gdk_pixbuf_animation_get_static_image(GdkPixbufAnimation *animation)
void gdk_pixbuf_animation_unref(GdkPixbufAnimation *animation)
GDK_PIXBUF_AVAILABLE_IN_ALL gboolean gdk_pixbuf_animation_is_static_image(GdkPixbufAnimation *animation)
GDK_PIXBUF_AVAILABLE_IN_ALL int gdk_pixbuf_animation_iter_get_delay_time(GdkPixbufAnimationIter *iter)
G_GNUC_END_IGNORE_DEPRECATIONS GDK_PIXBUF_AVAILABLE_IN_ALL GType gdk_pixbuf_animation_iter_get_type(void) G_GNUC_CONST
GDK_PIXBUF_AVAILABLE_IN_2_28 void gdk_pixbuf_animation_new_from_stream_async(GInputStream *stream, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data)
GdkPixbufAnimation * gdk_pixbuf_animation_ref(GdkPixbufAnimation *animation)
GDK_PIXBUF_AVAILABLE_IN_ALL GType gdk_pixbuf_animation_get_type(void) G_GNUC_CONST
struct _GdkPixbufAnimationIter GdkPixbufAnimationIter
GDK_PIXBUF_AVAILABLE_IN_ALL int gdk_pixbuf_animation_get_width(GdkPixbufAnimation *animation)
GDK_PIXBUF_AVAILABLE_IN_2_28 GdkPixbufAnimation * gdk_pixbuf_animation_new_from_stream(GInputStream *stream, GCancellable *cancellable, GError **error)
GDK_PIXBUF_AVAILABLE_IN_ALL GdkPixbuf * gdk_pixbuf_animation_iter_get_pixbuf(GdkPixbufAnimationIter *iter)
GDK_PIXBUF_AVAILABLE_IN_ALL int gdk_pixbuf_animation_get_height(GdkPixbufAnimation *animation)
struct _GdkPixbuf GdkPixbuf
#define GDK_PIXBUF_AVAILABLE_IN_ALL
#define GDK_PIXBUF_AVAILABLE_IN_2_28
#define GDK_PIXBUF_DEPRECATED_IN_2_0_FOR(f)
struct _GAsyncResult GAsyncResult
Definition giotypes.h:36
void(* GAsyncReadyCallback)(GObject *source_object, GAsyncResult *res, gpointer data)
Definition giotypes.h:190
#define G_END_DECLS
Definition gmacros.h:910
#define G_BEGIN_DECLS
Definition gmacros.h:909
#define G_GNUC_BEGIN_IGNORE_DEPRECATIONS
Definition gmacros.h:771
#define G_GNUC_CONST
Definition gmacros.h:637
#define G_GNUC_END_IGNORE_DEPRECATIONS
Definition gmacros.h:772
GOBJECT_AVAILABLE_IN_ALL gpointer g_object_ref(gpointer object)
GOBJECT_AVAILABLE_IN_ALL void g_object_unref(gpointer object)
gsize GType
Definition gtype.h:427
gint gboolean
Definition gtypes.h:56
void * gpointer
Definition gtypes.h:109
static void error(LoadState *S, const char *why)