]> Pileus Git - ~andy/gtk/blob - gdk-pixbuf/gdk-pixbuf-private.h
Support for separately installed loaders. (#77486)
[~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 #include "gdk-pixbuf-io.h"
32 #include "gdk-pixbuf-i18n.h"
33 #include <stdio.h>
34
35 \f
36
37 typedef struct _GdkPixbufClass GdkPixbufClass;
38
39 #define GDK_PIXBUF_CLASS(klass)      (G_TYPE_CHECK_CLASS_CAST ((klass), GDK_TYPE_PIXBUF, GdkPixbufClass))
40 #define GDK_IS_PIXBUF_CLASS(klass)   (G_TYPE_CHECK_CLASS_TYPE ((klass), GDK_TYPE_PIXBUF))
41 #define GDK_PIXBUF_GET_CLASS(obj)    (G_TYPE_INSTANCE_GET_CLASS ((obj), GDK_TYPE_PIXBUF, GdkPixbufClass))
42
43 /* Private part of the GdkPixbuf structure */
44 struct _GdkPixbuf {
45         GObject parent_instance;
46
47         /* Color space */
48         GdkColorspace colorspace;
49
50         /* Number of channels, alpha included */
51         int n_channels;
52
53         /* Bits per channel */
54         int bits_per_sample;
55
56         /* Size */
57         int width, height;
58
59         /* Offset between rows */
60         int rowstride;
61
62         /* The pixel array */
63         guchar *pixels;
64
65         /* Destroy notification function; it is supposed to free the pixel array */
66         GdkPixbufDestroyNotify destroy_fn;
67
68         /* User data for the destroy notification function */
69         gpointer destroy_fn_data;
70
71         /* Do we have an alpha channel? */
72         guint has_alpha : 1;
73 };
74
75 struct _GdkPixbufClass {
76         GObjectClass parent_class;
77
78 };
79
80 #ifdef GDK_PIXBUF_ENABLE_BACKEND
81
82 GdkPixbufModule *_gdk_pixbuf_get_module (guchar *buffer, guint size,
83                                          const gchar *filename,
84                                          GError **error);
85 GdkPixbufModule *_gdk_pixbuf_get_named_module (const char *name,
86                                                GError **error);
87 gboolean _gdk_pixbuf_load_module (GdkPixbufModule *image_module,
88                                   GError **error);
89
90 GdkPixbuf *_gdk_pixbuf_generic_image_load (GdkPixbufModule *image_module,
91                                            FILE *f,
92                                            GError **error);
93
94 GdkPixbufFormat *_gdk_pixbuf_get_format (GdkPixbufModule *image_module);
95
96 #ifdef USE_GMODULE
97 #define MODULE_ENTRY(type,function) function
98 #else
99 #define MODULE_ENTRY(type,function) _gdk_pixbuf__ ## type ## _ ## function
100 #endif
101
102 #endif /* GDK_PIXBUF_ENABLE_BACKEND */
103
104 #endif /* GDK_PIXBUF_PRIVATE_H */
105
106