]> Pileus Git - ~andy/gtk/blob - gdk-pixbuf/gdk-pixbuf-io.h
Make gdk-pixbuf.loaders file depend on the loaders (#97096, Jeff Waugh)
[~andy/gtk] / gdk-pixbuf / gdk-pixbuf-io.h
1 /* GdkPixbuf library - Io handling.  This is an internal header for 
2  * GdkPixbuf. You should never use it unless you are doing development for 
3  * GdkPixbuf itself.
4  *
5  * Copyright (C) 1999 The Free Software Foundation
6  *
7  * Authors: Mark Crichton <crichton@gimp.org>
8  *          Miguel de Icaza <miguel@gnu.org>
9  *          Federico Mena-Quintero <federico@gimp.org>
10  *          Jonathan Blandford <jrb@redhat.com>
11  *          Michael Fulbright <drmike@redhat.com>
12  *
13  * This library is free software; you can redistribute it and/or
14  * modify it under the terms of the GNU Lesser General Public
15  * License as published by the Free Software Foundation; either
16  * version 2 of the License, or (at your option) any later version.
17  *
18  * This library is distributed in the hope that it will be useful,
19  * but WITHOUT ANY WARRANTY; without even the implied warranty of
20  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
21  * Lesser General Public License for more details.
22  *
23  * You should have received a copy of the GNU Lesser General Public
24  * License along with this library; if not, write to the
25  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
26  * Boston, MA 02111-1307, USA.
27  */
28
29 #ifndef GDK_PIXBUF_IO_H
30 #define GDK_PIXBUF_IO_H
31
32 #include "gdk-pixbuf/gdk-pixbuf.h"
33 #include <gmodule.h>
34 #include <stdio.h>
35
36 G_BEGIN_DECLS
37
38 #ifdef GDK_PIXBUF_ENABLE_BACKEND
39
40 \f
41
42 typedef void (* GdkPixbufModuleSizeFunc)           (gint *width, 
43                                                     gint *height, 
44                                                     gpointer user_data);
45
46 typedef void (* GdkPixbufModulePreparedFunc) (GdkPixbuf          *pixbuf,
47                                               GdkPixbufAnimation *anim,
48                                               gpointer            user_data);
49 typedef void (* GdkPixbufModuleUpdatedFunc)  (GdkPixbuf *pixbuf,
50                                               int        x,
51                                               int        y,
52                                               int        width,
53                                               int        height,
54                                               gpointer   user_data);
55
56 typedef struct _GdkPixbufModulePattern GdkPixbufModulePattern;
57 struct _GdkPixbufModulePattern {
58         unsigned char *prefix;
59         unsigned char *mask;
60         int relevance;
61 };
62
63 typedef struct _GdkPixbufModule GdkPixbufModule;
64 struct _GdkPixbufModule {
65         char *module_name;
66         char *module_path;
67         GModule *module;
68         GdkPixbufFormat *info;
69         
70         GdkPixbuf *(* load) (FILE    *f,
71                              GError **error);
72         GdkPixbuf *(* load_xpm_data) (const char **data);
73
74         /* Incremental loading */
75
76         gpointer (* begin_load)     (GdkPixbufModuleSizeFunc size_func,
77                                      GdkPixbufModulePreparedFunc prepare_func,
78                                      GdkPixbufModuleUpdatedFunc update_func,
79                                      gpointer user_data,
80                                      GError **error);
81         gboolean (* stop_load)      (gpointer context,
82                                      GError **error);
83         gboolean (* load_increment) (gpointer      context,
84                                      const guchar *buf,
85                                      guint         size,
86                                      GError      **error);
87
88         /* Animation loading */
89         GdkPixbufAnimation *(* load_animation) (FILE    *f,
90                                                 GError **error);
91
92         gboolean (* save) (FILE      *f,
93                            GdkPixbuf *pixbuf,
94                            gchar    **param_keys,
95                            gchar    **param_values,
96                            GError   **error);
97   
98         void (*_reserved1) (void); 
99         void (*_reserved2) (void); 
100         void (*_reserved3) (void); 
101         void (*_reserved4) (void); 
102         void (*_reserved5) (void); 
103         void (*_reserved6) (void); 
104
105 };
106
107 typedef void (* GdkPixbufModuleFillVtableFunc) (GdkPixbufModule *module);
108 typedef void (* GdkPixbufModuleFillInfoFunc) (GdkPixbufFormat *info);
109
110 /*  key/value pairs that can be attached by the pixbuf loader  */
111
112 gboolean gdk_pixbuf_set_option  (GdkPixbuf   *pixbuf,
113                                  const gchar *key,
114                                  const gchar *value);
115
116 typedef enum /*< skip >*/
117 {
118   GDK_PIXBUF_FORMAT_WRITABLE = 1 << 0
119 } GdkPixbufFormatFlags;
120
121 struct _GdkPixbufFormat {
122   gchar *name;
123   GdkPixbufModulePattern *signature;
124   gchar *domain;
125   gchar *description;
126   gchar **mime_types;
127   gchar **extensions;
128   guint32 flags;
129 };
130
131
132 #endif /* GDK_PIXBUF_ENABLE_BACKEND */
133
134 G_END_DECLS
135
136 #endif /* GDK_PIXBUF_IO_H */