]> Pileus Git - ~andy/gtk/blob - gdk-pixbuf/gdk-pixbuf-io.h
Fixes for #78258
[~andy/gtk] / gdk-pixbuf / gdk-pixbuf-io.h
1 /* GdkPixbuf library - Io handling.  This is an internal header for gdk-pixbuf.
2  * You should never use it unless you are doing developement for gdkpixbuf itself.
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  *          Jonathan Blandford <jrb@redhat.com>
10  *          Michael Fulbright <drmike@redhat.com>
11  *
12  * This library is free software; you can redistribute it and/or
13  * modify it under the terms of the GNU Lesser General Public
14  * License as published by the Free Software Foundation; either
15  * version 2 of the License, or (at your option) any later version.
16  *
17  * This library is distributed in the hope that it will be useful,
18  * but WITHOUT ANY WARRANTY; without even the implied warranty of
19  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
20  * Lesser General Public License for more details.
21  *
22  * You should have received a copy of the GNU Lesser General Public
23  * License along with this library; if not, write to the
24  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
25  * Boston, MA 02111-1307, USA.
26  */
27
28 #ifndef GDK_PIXBUF_IO_H
29 #define GDK_PIXBUF_IO_H
30
31 #include <gmodule.h>
32 #include <stdio.h>
33 #include "gdk-pixbuf.h"
34 #include "gdk-pixbuf-i18n.h"
35
36 G_BEGIN_DECLS
37
38 \f
39
40 typedef void (* ModulePreparedNotifyFunc) (GdkPixbuf          *pixbuf,
41                                            GdkPixbufAnimation *anim,
42                                            gpointer            user_data);
43 typedef void (* ModuleUpdatedNotifyFunc)  (GdkPixbuf *pixbuf,
44                                            int        x,
45                                            int        y,
46                                            int        width,
47                                            int        height,
48                                            gpointer   user_data);
49
50 typedef struct _GdkPixbufModule GdkPixbufModule;
51 struct _GdkPixbufModule {
52         char *module_name;
53         gboolean (* format_check) (guchar *buffer, int size);
54         GModule *module;
55         GdkPixbuf *(* load) (FILE    *f,
56                              GError **error);
57         GdkPixbuf *(* load_xpm_data) (const char **data);
58
59         /* Incremental loading */
60
61         gpointer (* begin_load)     (ModulePreparedNotifyFunc prepare_func,
62                                      ModuleUpdatedNotifyFunc update_func,
63                                      gpointer user_data,
64                                      GError **error);
65         gboolean (* stop_load)      (gpointer context,
66                                      GError **error);
67         gboolean (* load_increment) (gpointer      context,
68                                      const guchar *buf,
69                                      guint         size,
70                                      GError      **error);
71
72         /* Animation loading */
73         GdkPixbufAnimation *(* load_animation) (FILE    *f,
74                                                 GError **error);
75
76         gboolean (* save) (FILE      *f,
77                            GdkPixbuf *pixbuf,
78                            gchar    **param_keys,
79                            gchar    **param_values,
80                            GError   **error);
81 };
82
83 typedef void (* ModuleFillVtableFunc) (GdkPixbufModule *module);
84
85 GdkPixbufModule *_gdk_pixbuf_get_module (guchar *buffer, guint size,
86                                          const gchar *filename,
87                                          GError **error);
88 GdkPixbufModule *_gdk_pixbuf_get_named_module (const char *name,
89                                                GError **error);
90 gboolean _gdk_pixbuf_load_module (GdkPixbufModule *image_module,
91                                   GError **error);
92
93 \f
94
95 G_END_DECLS
96
97 #endif