]> Pileus Git - ~andy/gtk/blob - gdk-pixbuf/gdk-pixbuf-private.h
use gdk_pixbuf_new_from_stream(). fixed up item factory so inlined pixbufs
[~andy/gtk] / gdk-pixbuf / gdk-pixbuf-private.h
1 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */
2 /* GdkPixbuf library - Private 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_PRIVATE_H
28 #define GDK_PIXBUF_PRIVATE_H
29
30 #include "gdk-pixbuf.h"
31
32 \f
33
34 typedef struct _GdkPixbufClass GdkPixbufClass;
35
36 #define GDK_PIXBUF_CLASS(klass)      (G_TYPE_CHECK_CLASS_CAST ((klass), GDK_TYPE_PIXBUF, GdkPixbufClass))
37 #define GDK_IS_PIXBUF_CLASS(klass)   (G_TYPE_CHECK_CLASS_TYPE ((klass), GDK_TYPE_PIXBUF))
38 #define GDK_PIXBUF_GET_CLASS(obj)    (G_TYPE_INSTANCE_GET_CLASS ((obj), GDK_TYPE_PIXBUF, GdkPixbufClass))
39
40 /* Private part of the GdkPixbuf structure */
41 struct _GdkPixbuf {
42         GObject parent_instance;
43
44         /* Color space */
45         GdkColorspace colorspace;
46
47         /* Number of channels, alpha included */
48         int n_channels;
49
50         /* Bits per channel */
51         int bits_per_sample;
52
53         /* Size */
54         int width, height;
55
56         /* Offset between rows */
57         int rowstride;
58
59         /* The pixel array */
60         guchar *pixels;
61
62         /* Destroy notification function; it is supposed to free the pixel array */
63         GdkPixbufDestroyNotify destroy_fn;
64
65         /* User data for the destroy notification function */
66         gpointer destroy_fn_data;
67
68         /* Do we have an alpha channel? */
69         guint has_alpha : 1;
70 };
71
72 struct _GdkPixbufClass {
73         GObjectClass parent_class;
74
75 };
76
77 typedef struct _GdkPixbufAnimationClass GdkPixbufAnimationClass;
78
79 #define GDK_PIXBUF_ANIMATION_CLASS(klass)      (G_TYPE_CHECK_CLASS_CAST ((klass), GDK_TYPE_PIXBUF_ANIMATION, GdkPixbufAnimationClass))
80 #define GDK_IS_PIXBUF_ANIMATION_CLASS(klass)   (G_TYPE_CHECK_CLASS_TYPE ((klass), GDK_TYPE_PIXBUF_ANIMATION))
81 #define GDK_PIXBUF_ANIMATION_GET_CLASS(obj)    (G_TYPE_INSTANCE_GET_CLASS ((obj), GDK_TYPE_PIXBUF_ANIMATION, GdkPixbufAnimationClass))
82
83 /* Private part of the GdkPixbufAnimation structure */
84 struct _GdkPixbufAnimation {
85         GObject parent_instance;
86
87 };
88
89 struct _GdkPixbufAnimationClass {
90         GObjectClass parent_class;
91
92         gboolean                (*is_static_image)  (GdkPixbufAnimation *anim);
93
94         GdkPixbuf*              (*get_static_image) (GdkPixbufAnimation *anim);
95         
96         void                    (*get_size) (GdkPixbufAnimation *anim,
97                                              int                 *width,
98                                              int                 *height);
99         
100         GdkPixbufAnimationIter* (*get_iter) (GdkPixbufAnimation *anim,
101                                              const GTimeVal     *start_time);
102
103 };
104
105 \f
106
107 typedef struct _GdkPixbufAnimationIterClass GdkPixbufAnimationIterClass;
108
109 #define GDK_PIXBUF_ANIMATION_ITER_CLASS(klass)      (G_TYPE_CHECK_CLASS_CAST ((klass), GDK_TYPE_PIXBUF_ANIMATION_ITER, GdkPixbufAnimationIterClass))
110 #define GDK_IS_PIXBUF_ANIMATION_ITER_CLASS(klass)   (G_TYPE_CHECK_CLASS_TYPE ((klass), GDK_TYPE_PIXBUF_ANIMATION_ITER))
111 #define GDK_PIXBUF_ANIMATION_ITER_GET_CLASS(obj)    (G_TYPE_INSTANCE_GET_CLASS ((obj), GDK_TYPE_PIXBUF_ANIMATION_ITER, GdkPixbufAnimationIterClass))
112
113 struct _GdkPixbufAnimationIter {
114         GObject parent_instance;
115
116 };
117
118 struct _GdkPixbufAnimationIterClass {
119         GObjectClass parent_class;
120
121         int        (*get_delay_time)   (GdkPixbufAnimationIter *iter);
122
123         GdkPixbuf* (*get_pixbuf)       (GdkPixbufAnimationIter *iter);
124
125         gboolean (*on_currently_loading_frame) (GdkPixbufAnimationIter *iter);
126
127         gboolean (*advance)            (GdkPixbufAnimationIter *iter,
128                                         const GTimeVal         *current_time);
129 };
130       
131 \f
132
133 GdkPixbufAnimation* gdk_pixbuf_non_anim_new (GdkPixbuf *pixbuf);
134
135 #endif