gdk-pixbuf-io.h 2.69 KB
Newer Older
1 2
/* GdkPixbuf library - Io handling.  This is an internal header for gdk-pixbuf.
 * You should never use it unless you are doing developement for gdkpixbuf itself.
3 4 5 6 7 8 9
 *
 * Copyright (C) 1999 The Free Software Foundation
 *
 * Authors: Mark Crichton <crichton@gimp.org>
 *          Miguel de Icaza <miguel@gnu.org>
 *          Federico Mena-Quintero <federico@gimp.org>
 *          Jonathan Blandford <jrb@redhat.com>
10
 *          Michael Fulbright <drmike@redhat.com>
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Library General Public
 * License as published by the Free Software Foundation; either
 * version 2 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Library General Public License for more details.
 *
 * You should have received a copy of the GNU Library General Public
 * License along with this library; if not, write to the
 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
 * Boston, MA 02111-1307, USA.
 */
27 28 29 30

#ifndef GDK_PIXBUF_IO_H
#define GDK_PIXBUF_IO_H

31 32
#include <gmodule.h>
#include <stdio.h>
33
#include "gdk-pixbuf.h"
34

35 36 37 38
#ifdef __cplusplus
extern "C" {
#endif

39 40


Havoc Pennington's avatar
Havoc Pennington committed
41
typedef void (* ModulePreparedNotifyFunc) (GdkPixbuf *pixbuf, gpointer user_data);
42
typedef void (* ModuleUpdatedNotifyFunc) (GdkPixbuf *pixbuf,
43
					  guint x, guint y,
44 45 46
					  guint width, guint height,
					  gpointer user_data);
/* Needed only for animated images. */
47
typedef void (* ModuleFrameDoneNotifyFunc) (GdkPixbufFrame *frame,
48 49 50
					    gpointer user_data);
typedef void (* ModuleAnimationDoneNotifyFunc) (GdkPixbuf *pixbuf,
						gpointer user_data);
Havoc Pennington's avatar
Havoc Pennington committed
51

52 53
typedef struct _GdkPixbufModule GdkPixbufModule;
struct _GdkPixbufModule {
54
	char *module_name;
55
	gboolean (* format_check) (guchar *buffer, int size);
56
	GModule *module;
57
	GdkPixbuf *(* load) (FILE *f);
58
        GdkPixbuf *(* load_xpm_data) (const char **data);
Havoc Pennington's avatar
Havoc Pennington committed
59 60

        /* Incremental loading */
61 62 63

        gpointer (* begin_load) (ModulePreparedNotifyFunc prepare_func,
				 ModuleUpdatedNotifyFunc update_func,
64 65
				 ModuleFrameDoneNotifyFunc frame_done_func,
				 ModuleAnimationDoneNotifyFunc anim_done_func,
66 67 68
				 gpointer user_data);
        void (* stop_load) (gpointer context);
        gboolean (* load_increment) (gpointer context, const guchar *buf, guint size);
69 70 71

	/* Animation loading */
	GdkPixbufAnimation *(* load_animation) (FILE *f);
72 73 74
};


75 76
GdkPixbufModule *gdk_pixbuf_get_module (guchar *buffer, guint size);
void gdk_pixbuf_load_module (GdkPixbufModule *image_module);
Havoc Pennington's avatar
Havoc Pennington committed
77

78 79 80 81 82 83 84


#ifdef __cplusplus
}
#endif

#endif