1/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */
2/* GdkPixbuf library - ANI loader declarations
3 *
4 * Copyright (C) 2002 The Free Software Foundation
5 *
6 * Author: Matthias Clasen <maclas@gmx.de>
7 *
8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Lesser General Public
10 * License as published by the Free Software Foundation; either
11 * version 2 of the License, or (at your option) any later version.
12 *
13 * This library is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * Lesser General Public License for more details.
17 *
18 * You should have received a copy of the GNU Lesser General Public
19 * License along with this library; if not, see <http://www.gnu.org/licenses/>.
20 */
21
22#ifndef GDK_PIXBUF_ANI_ANIMATION_H
23#define GDK_PIXBUF_ANI_ANIMATION_H
24
25#include <glib/gi18n-lib.h>
26#include "gdk-pixbuf-animation.h"
27
28typedef struct _GdkPixbufAniAnim GdkPixbufAniAnim;
29typedef struct _GdkPixbufAniAnimClass GdkPixbufAniAnimClass;
30
31#define GDK_TYPE_PIXBUF_ANI_ANIM (gdk_pixbuf_ani_anim_get_type ())
32#define GDK_PIXBUF_ANI_ANIM(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), GDK_TYPE_PIXBUF_ANI_ANIM, GdkPixbufAniAnim))
33#define GDK_IS_PIXBUF_ANI_ANIM(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), GDK_TYPE_PIXBUF_ANI_ANIM))
34
35#define GDK_PIXBUF_ANI_ANIM_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GDK_TYPE_PIXBUF_ANI_ANIM, GdkPixbufAniAnimClass))
36#define GDK_IS_PIXBUF_ANI_ANIM_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GDK_TYPE_PIXBUF_ANI_ANIM))
37#define GDK_PIXBUF_ANI_ANIM_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GDK_TYPE_PIXBUF_ANI_ANIM, GdkPixbufAniAnimClass))
38
39/* Private part of the GdkPixbufAniAnim structure */
40struct _GdkPixbufAniAnim {
41 GdkPixbufAnimation parent_instance;
42
43 /* Total length of animation */
44 int total_time;
45
46 /* Number of frames */
47 int n_frames;
48
49 /* Number of pixbufs */
50 int n_pixbufs;
51
52 GdkPixbuf **pixbufs;
53
54 /* Maps frame number to pixbuf */
55 int *sequence;
56
57 /* The duration of each frame, in milliseconds */
58 int *delay;
59
60 /* bounding box size */
61 int width, height;
62};
63
64struct _GdkPixbufAniAnimClass {
65 GdkPixbufAnimationClass parent_class;
66
67};
68
69GType gdk_pixbuf_ani_anim_get_type (void) G_GNUC_CONST;
70
71
72
73typedef struct _GdkPixbufAniAnimIter GdkPixbufAniAnimIter;
74typedef struct _GdkPixbufAniAnimIterClass GdkPixbufAniAnimIterClass;
75
76
77#define GDK_TYPE_PIXBUF_ANI_ANIM_ITER (gdk_pixbuf_ani_anim_iter_get_type ())
78#define GDK_PIXBUF_ANI_ANIM_ITER(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), GDK_TYPE_PIXBUF_ANI_ANIM_ITER, GdkPixbufAniAnimIter))
79#define GDK_IS_PIXBUF_ANI_ANIM_ITER(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), GDK_TYPE_PIXBUF_ANI_ANIM_ITER))
80
81#define GDK_PIXBUF_ANI_ANIM_ITER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GDK_TYPE_PIXBUF_ANI_ANIM_ITER, GdkPixbufAniAnimIterClass))
82#define GDK_IS_PIXBUF_ANI_ANIM_ITER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GDK_TYPE_PIXBUF_ANI_ANIM_ITER))
83#define GDK_PIXBUF_ANI_ANIM_ITER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GDK_TYPE_PIXBUF_ANI_ANIM_ITER, GdkPixbufAniAnimIterClass))
84
85G_GNUC_BEGIN_IGNORE_DEPRECATIONS
86struct _GdkPixbufAniAnimIter {
87 GdkPixbufAnimationIter parent_instance;
88
89 GdkPixbufAniAnim *ani_anim;
90
91 GTimeVal start_time;
92 GTimeVal current_time;
93
94 /* Time in milliseconds into this run of the animation */
95 gint position;
96
97 /* Index of the current frame */
98 gint current_frame;
99
100 /* Time in milliseconds from the start of the animation till the
101 begin of the current frame */
102 gint elapsed;
103};
104G_GNUC_END_IGNORE_DEPRECATIONS
105
106struct _GdkPixbufAniAnimIterClass {
107 GdkPixbufAnimationIterClass parent_class;
108
109};
110
111GType gdk_pixbuf_ani_anim_iter_get_type (void) G_GNUC_CONST;
112
113#endif
114

source code of gtk/subprojects/gdk-pixbuf/gdk-pixbuf/io-ani-animation.h