]> Pileus Git - ~andy/gtk/blob - gdk-pixbuf/io-ani-animation.h
Adds authentication support of CUPS backend
[~andy/gtk] / gdk-pixbuf / io-ani-animation.h
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, write to the
20  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
21  * Boston, MA 02111-1307, USA.
22  */
23
24 #ifndef GDK_PIXBUF_ANI_ANIMATION_H
25 #define GDK_PIXBUF_ANI_ANIMATION_H
26
27 #include "gdk-pixbuf-private.h"
28 #include "gdk-pixbuf-animation.h"
29
30 typedef struct _GdkPixbufAniAnim GdkPixbufAniAnim;
31 typedef struct _GdkPixbufAniAnimClass GdkPixbufAniAnimClass;
32
33 #define GDK_TYPE_PIXBUF_ANI_ANIM              (gdk_pixbuf_ani_anim_get_type ())
34 #define GDK_PIXBUF_ANI_ANIM(object)           (G_TYPE_CHECK_INSTANCE_CAST ((object), GDK_TYPE_PIXBUF_ANI_ANIM, GdkPixbufAniAnim))
35 #define GDK_IS_PIXBUF_ANI_ANIM(object)        (G_TYPE_CHECK_INSTANCE_TYPE ((object), GDK_TYPE_PIXBUF_ANI_ANIM))
36
37 #define GDK_PIXBUF_ANI_ANIM_CLASS(klass)      (G_TYPE_CHECK_CLASS_CAST ((klass), GDK_TYPE_PIXBUF_ANI_ANIM, GdkPixbufAniAnimClass))
38 #define GDK_IS_PIXBUF_ANI_ANIM_CLASS(klass)   (G_TYPE_CHECK_CLASS_TYPE ((klass), GDK_TYPE_PIXBUF_ANI_ANIM))
39 #define GDK_PIXBUF_ANI_ANIM_GET_CLASS(obj)    (G_TYPE_INSTANCE_GET_CLASS ((obj), GDK_TYPE_PIXBUF_ANI_ANIM, GdkPixbufAniAnimClass))
40
41 /* Private part of the GdkPixbufAniAnim structure */
42 struct _GdkPixbufAniAnim {
43         GdkPixbufAnimation parent_instance;
44
45         /* Total length of animation */
46         int total_time;
47         
48         /* Number of frames */
49         int n_frames;
50         
51         /* Number of pixbufs */
52         int n_pixbufs;
53         
54         GdkPixbuf **pixbufs;
55         
56         /* Maps frame number to pixbuf */
57         int *sequence;
58         
59         /* The duration of each frame, in milliseconds */
60         int *delay;
61         
62         /* bounding box size */
63         int width, height;
64 };
65
66 struct _GdkPixbufAniAnimClass {
67         GdkPixbufAnimationClass parent_class;
68         
69 };
70
71 GType gdk_pixbuf_ani_anim_get_type (void) G_GNUC_CONST;
72
73 \f
74
75 typedef struct _GdkPixbufAniAnimIter GdkPixbufAniAnimIter;
76 typedef struct _GdkPixbufAniAnimIterClass GdkPixbufAniAnimIterClass;
77
78
79 #define GDK_TYPE_PIXBUF_ANI_ANIM_ITER              (gdk_pixbuf_ani_anim_iter_get_type ())
80 #define GDK_PIXBUF_ANI_ANIM_ITER(object)           (G_TYPE_CHECK_INSTANCE_CAST ((object), GDK_TYPE_PIXBUF_ANI_ANIM_ITER, GdkPixbufAniAnimIter))
81 #define GDK_IS_PIXBUF_ANI_ANIM_ITER(object)        (G_TYPE_CHECK_INSTANCE_TYPE ((object), GDK_TYPE_PIXBUF_ANI_ANIM_ITER))
82
83 #define GDK_PIXBUF_ANI_ANIM_ITER_CLASS(klass)      (G_TYPE_CHECK_CLASS_CAST ((klass), GDK_TYPE_PIXBUF_ANI_ANIM_ITER, GdkPixbufAniAnimIterClass))
84 #define GDK_IS_PIXBUF_ANI_ANIM_ITER_CLASS(klass)   (G_TYPE_CHECK_CLASS_TYPE ((klass), GDK_TYPE_PIXBUF_ANI_ANIM_ITER))
85 #define GDK_PIXBUF_ANI_ANIM_ITER_GET_CLASS(obj)    (G_TYPE_INSTANCE_GET_CLASS ((obj), GDK_TYPE_PIXBUF_ANI_ANIM_ITER, GdkPixbufAniAnimIterClass))
86
87 struct _GdkPixbufAniAnimIter {
88         GdkPixbufAnimationIter parent_instance;
89         
90         GdkPixbufAniAnim   *ani_anim;
91
92         GTimeVal            start_time;
93         GTimeVal            current_time;
94
95         /* Time in milliseconds into this run of the animation */
96         gint                position;
97
98         /* Index of the current frame */
99         gint                current_frame;
100
101         /* Time in milliseconds from the start of the animation till the
102            begin of the current frame */
103         gint                elapsed;
104 };
105
106 struct _GdkPixbufAniAnimIterClass {
107         GdkPixbufAnimationIterClass parent_class;
108
109 };
110
111 GType gdk_pixbuf_ani_anim_iter_get_type (void) G_GNUC_CONST;
112
113 #endif