]> Pileus Git - ~andy/gtk/blob - gdk-pixbuf/io-gdip-animation.h
Import the GDI+ gdk-pixbuf loaders for Windows by Dominic Lachowicz and
[~andy/gtk] / gdk-pixbuf / io-gdip-animation.h
1 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */
2 /* GdkPixbuf library - GDIP loader declarations
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_GDIP_H
28 #define GDK_PIXBUF_GDIP_H
29
30 #include <gdk-pixbuf/gdk-pixbuf-animation.h>
31
32 typedef struct _GdkPixbufGdipAnim GdkPixbufGdipAnim;
33 typedef struct _GdkPixbufGdipAnimClass GdkPixbufGdipAnimClass;
34 typedef struct _GdkPixbufFrame GdkPixbufFrame;
35
36 #define GDK_TYPE_PIXBUF_GDIP_ANIM              (gdk_pixbuf_gdip_anim_get_type ())
37 #define GDK_PIXBUF_GDIP_ANIM(object)           (G_TYPE_CHECK_INSTANCE_CAST ((object), GDK_TYPE_PIXBUF_GDIP_ANIM, GdkPixbufGdipAnim))
38 #define GDK_IS_PIXBUF_GDIP_ANIM(object)        (G_TYPE_CHECK_INSTANCE_TYPE ((object), GDK_TYPE_PIXBUF_GDIP_ANIM))
39
40 #define GDK_PIXBUF_GDIP_ANIM_CLASS(klass)      (G_TYPE_CHECK_CLASS_CAST ((klass), GDK_TYPE_PIXBUF_GDIP_ANIM, GdkPixbufGdipAnimClass))
41 #define GDK_IS_PIXBUF_GDIP_ANIM_CLASS(klass)   (G_TYPE_CHECK_CLASS_TYPE ((klass), GDK_TYPE_PIXBUF_GDIP_ANIM))
42 #define GDK_PIXBUF_GDIP_ANIM_GET_CLASS(obj)    (G_TYPE_INSTANCE_GET_CLASS ((obj), GDK_TYPE_PIXBUF_GDIP_ANIM, GdkPixbufGdipAnimClass))
43
44 /* Private part of the GdkPixbufGdipAnim structure */
45 struct _GdkPixbufGdipAnim {
46         GdkPixbufAnimation parent_instance;
47
48         /* Number of frames */
49         int n_frames;
50
51         /* Total length of animation */
52         int total_time;
53         
54         /* List of GdkPixbufFrame structures */
55         GList *frames;
56
57         /* bounding box size */
58         int width, height;
59         
60         int loop;
61         gboolean loading;
62 };
63
64 struct _GdkPixbufGdipAnimClass {
65         GdkPixbufAnimationClass parent_class;
66         
67 };
68
69 GType gdk_pixbuf_gdip_anim_get_type (void) G_GNUC_CONST;
70
71 typedef struct _GdkPixbufGdipAnimIter GdkPixbufGdipAnimIter;
72 typedef struct _GdkPixbufGdipAnimIterClass GdkPixbufGdipAnimIterClass;
73
74
75 #define GDK_TYPE_PIXBUF_GDIP_ANIM_ITER              (gdk_pixbuf_gdip_anim_iter_get_type ())
76 #define GDK_PIXBUF_GDIP_ANIM_ITER(object)           (G_TYPE_CHECK_INSTANCE_CAST ((object), GDK_TYPE_PIXBUF_GDIP_ANIM_ITER, GdkPixbufGdipAnimIter))
77 #define GDK_IS_PIXBUF_GDIP_ANIM_ITER(object)        (G_TYPE_CHECK_INSTANCE_TYPE ((object), GDK_TYPE_PIXBUF_GDIP_ANIM_ITER))
78
79 #define GDK_PIXBUF_GDIP_ANIM_ITER_CLASS(klass)      (G_TYPE_CHECK_CLASS_CAST ((klass), GDK_TYPE_PIXBUF_GDIP_ANIM_ITER, GdkPixbufGdipAnimIterClass))
80 #define GDK_IS_PIXBUF_GDIP_ANIM_ITER_CLASS(klass)   (G_TYPE_CHECK_CLASS_TYPE ((klass), GDK_TYPE_PIXBUF_GDIP_ANIM_ITER))
81 #define GDK_PIXBUF_GDIP_ANIM_ITER_GET_CLASS(obj)    (G_TYPE_INSTANCE_GET_CLASS ((obj), GDK_TYPE_PIXBUF_GDIP_ANIM_ITER, GdkPixbufGdipAnimIterClass))
82
83 struct _GdkPixbufGdipAnimIter {
84         GdkPixbufAnimationIter parent_instance;
85         
86         GdkPixbufGdipAnim   *gdip_anim;
87
88         GTimeVal            start_time;
89         GTimeVal            current_time;
90
91         /* Time in milliseconds into this run of the animation */
92         gint                position;
93         
94         GList              *current_frame;
95         
96         gint                first_loop_slowness;
97 };
98
99 struct _GdkPixbufGdipAnimIterClass {
100         GdkPixbufAnimationIterClass parent_class;
101
102 };
103
104 GType gdk_pixbuf_gdip_anim_iter_get_type (void) G_GNUC_CONST;
105
106 struct _GdkPixbufFrame {
107         /* The pixbuf with this frame's image data */
108         GdkPixbuf *pixbuf;
109
110         /* Frame duration in ms */
111         int delay_time;
112
113         /* Sum of preceding delay times */
114         int elapsed;        
115 };
116
117 #endif