Commit 47107959 authored by Matthias Clasen's avatar Matthias Clasen

Support for separately installed loaders. (#77486)

	* Makefile.am gdk-pixbuf-animation.c gdk-pixbuf-data.c
	gdk-pixbuf-io.c gdk-pixbuf-io.h gdk-pixbuf-loader.c
	gdk-pixbuf-loader.h gdk-pixbuf-private.h gdk-pixbuf.h
	gdk-pixdata.c io-ani-animation.h io-ani.c io-bmp.c
	io-gif-animation.c io-gif-animation.h io-gif.c io-ico.c
	io-jpeg.c io-png.c io-pnm.c io-ras.c io-tga.c io-tiff.c
	io-wbmp.c io-xbm.c io-xpm.c pixbufloader_ani.def
	pixbufloader_bmp.def pixbufloader_gif.def pixbufloader_ico.def
	pixbufloader_jpeg.def pixbufloader_png.def
	pixbufloader_pnm.def pixbufloader_ras.def pixbufloader_tga.def
	pixbufloader_tiff.def pixbufloader_wbmp.def
	pixbufloader_xbm.def pixbufloader_xpm.def test-gdk-pixbuf.c
	gdk-pixbuf-animation.h queryloaders.c: Support for separately
	installed loaders.  (#77486)
parent e99adacd
......@@ -243,6 +243,7 @@ INCLUDES = @STRIP_BEGIN@ \
-I$(top_srcdir) -I$(top_builddir) \
-I$(top_srcdir)/gdk-pixbuf \
-I$(top_builddir)/gdk-pixbuf \
-DGTK_SYSCONFDIR=\"$(sysconfdir)\" \
-DGTK_VERSION=\"@GTK_VERSION@\" \
-DGTK_BINARY_VERSION=\"@GTK_BINARY_VERSION@\" \
-DG_DISABLE_DEPRECATED \
......@@ -250,6 +251,7 @@ INCLUDES = @STRIP_BEGIN@ \
@INCLUDED_LOADER_DEFINE@ \
@GTK_DEBUG_FLAGS@ \
@GDK_PIXBUF_DEP_CFLAGS@ \
-DGDK_PIXBUF_ENABLE_BACKEND \
@STRIP_END@
AM_CPPFLAGS = "-DPIXBUF_LIBDIR=\"$(loaderdir)\"" "-DBUILT_MODULES_DIR=\"$(srcdir)/.libs\""
......@@ -258,10 +260,16 @@ LDADDS = libgdk_pixbuf-$(GTK_API_VERSION).la
noinst_PROGRAMS = test-gdk-pixbuf
test_gdk_pixbuf_LDADD = $(LDADDS)
bin_PROGRAMS = gdk-pixbuf-csource
bin_PROGRAMS = gdk-pixbuf-csource gdk-pixbuf-query-loaders
gdk_pixbuf_csource_SOURCES = gdk-pixbuf-csource.c
gdk_pixbuf_csource_LDADD = $(LDADDS)
gdk_pixbuf_query_loaders_DEPENDENCIES = $(DEPS)
gdk_pixbuf_query_loaders_LDADD = $(LDADDS)
gdk_pixbuf_query_loaders_SOURCES = queryloaders.c
#
# manual pages to install
#
......@@ -296,6 +304,8 @@ libgdk_pixbuf_2_0_la_DEPENDENCIES = pixops/libpixops.la $(builtin_objs) $(gdk_pi
gdk_pixbuf_headers = \
gdk-pixbuf.h \
gdk-pixbuf-io.h \
gdk-pixbuf-animation.h \
gdk-pixbuf-loader.h
libgdk_pixbufinclude_HEADERS = \
......@@ -305,7 +315,6 @@ libgdk_pixbufinclude_HEADERS = \
gdk-pixdata.h
noinst_HEADERS = \
gdk-pixbuf-io.h \
gdk-pixbuf-private.h
gdk_pixbuf_built_headers = gdk-pixbuf-enum-types.h gdk-pixbuf-marshal.h
......@@ -405,6 +414,37 @@ EXTRA_DIST = \
pixbufloader_xbm.def \
pixbufloader_tga.def
if CROSS_COMPILING
RUN_QUERY_LOADER_TEST=false
else
RUN_QUERY_LOADER_TEST=test -z "$(DESTDIR)"
endif
# Running this if cross compiling or if DESTDIR is set is going to
# not work at all, so skip it
install-data-local: install-ms-lib install-libtool-import-lib
@if $(RUN_QUERY_LOADER_TEST) ; then \
$(mkinstalldirs) $(DESTDIR)$(sysconfdir)/gtk-2.0 ; \
$(top_builddir)/gdk-pixbuf/gdk-pixbuf-query-loaders > $(DESTDIR)$(sysconfdir)/gtk-2.0/gdk-pixbuf.loaders ; \
else \
echo "***" ; \
echo "*** Warning: gdk-pixbuf.loaders not built" ; \
echo "***" ; \
echo "*** Generate this file manually on on host" ; \
echo "*** system using gdk-pixbuf-query-loaders" ; \
echo "***" ; \
fi
all-local: gdk-pixbuf.loaders
gdk-pixbuf.loaders:
if find . -name 'libpixbufloader-*.so' | grep 'so' > /dev/null ; then \
echo "Writing a gdk-pixbuf.loader file to use when running examples before installing gdk-pixbuf."; \
GDK_PIXBUF_MODULEDIR=.libs $(top_builddir)/gdk-pixbuf/gdk-pixbuf-query-loaders > ./gdk-pixbuf.loaders ;\
else \
echo "No dynamic modules found; will use only static modules for uninstalled example programs."; \
touch gdk-pixbuf.loaders; \
fi
uninstall-local: uninstall-ms-lib uninstall-libtool-import-lib
......@@ -24,8 +24,10 @@
#include <config.h>
#include <errno.h>
#include "gdk-pixbuf-io.h"
#include "gdk-pixbuf-private.h"
#include "gdk-pixbuf-io.h"
#include "gdk-pixbuf-i18n.h"
#include "gdk-pixbuf-animation.h"
typedef struct _GdkPixbufNonAnim GdkPixbufNonAnim;
typedef struct _GdkPixbufNonAnimClass GdkPixbufNonAnimClass;
......
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */
/* GdkPixbuf library - Private declarations
*
* 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>
* Havoc Pennington <hp@redhat.com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser 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.
*/
#ifndef GDK_PIXBUF_ANIMATION_H
#define GDK_PIXBUF_ANIMATION_H
#include "gdk-pixbuf/gdk-pixbuf.h"
G_BEGIN_DECLS
#ifdef GDK_PIXBUF_ENABLE_BACKEND
typedef struct _GdkPixbufAnimationClass GdkPixbufAnimationClass;
#define GDK_PIXBUF_ANIMATION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GDK_TYPE_PIXBUF_ANIMATION, GdkPixbufAnimationClass))
#define GDK_IS_PIXBUF_ANIMATION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GDK_TYPE_PIXBUF_ANIMATION))
#define GDK_PIXBUF_ANIMATION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GDK_TYPE_PIXBUF_ANIMATION, GdkPixbufAnimationClass))
/* Private part of the GdkPixbufAnimation structure */
struct _GdkPixbufAnimation {
GObject parent_instance;
};
struct _GdkPixbufAnimationClass {
GObjectClass parent_class;
gboolean (*is_static_image) (GdkPixbufAnimation *anim);
GdkPixbuf* (*get_static_image) (GdkPixbufAnimation *anim);
void (*get_size) (GdkPixbufAnimation *anim,
int *width,
int *height);
GdkPixbufAnimationIter* (*get_iter) (GdkPixbufAnimation *anim,
const GTimeVal *start_time);
};
typedef struct _GdkPixbufAnimationIterClass GdkPixbufAnimationIterClass;
#define GDK_PIXBUF_ANIMATION_ITER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GDK_TYPE_PIXBUF_ANIMATION_ITER, GdkPixbufAnimationIterClass))
#define GDK_IS_PIXBUF_ANIMATION_ITER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GDK_TYPE_PIXBUF_ANIMATION_ITER))
#define GDK_PIXBUF_ANIMATION_ITER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GDK_TYPE_PIXBUF_ANIMATION_ITER, GdkPixbufAnimationIterClass))
struct _GdkPixbufAnimationIter {
GObject parent_instance;
};
struct _GdkPixbufAnimationIterClass {
GObjectClass parent_class;
int (*get_delay_time) (GdkPixbufAnimationIter *iter);
GdkPixbuf* (*get_pixbuf) (GdkPixbufAnimationIter *iter);
gboolean (*on_currently_loading_frame) (GdkPixbufAnimationIter *iter);
gboolean (*advance) (GdkPixbufAnimationIter *iter,
const GTimeVal *current_time);
};
GdkPixbufAnimation* gdk_pixbuf_non_anim_new (GdkPixbuf *pixbuf);
#endif /* GDK_PIXBUF_ENABLE_BACKEND */
G_END_DECLS
#endif /* GDK_PIXBUF_ANIMATION_H */
......@@ -23,7 +23,6 @@
#include <config.h>
#include "gdk-pixbuf.h"
#include "gdk-pixbuf-private.h"
#include "gdk-pixbuf-i18n.h"
#include <stdlib.h>
#include <string.h>
......
This diff is collapsed.
/* 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.
/* GdkPixbuf library - Io handling. This is an internal header for
* GdkPixbuf. You should never use it unless you are doing development for
* GdkPixbuf itself.
*
* Copyright (C) 1999 The Free Software Foundation
*
......@@ -28,43 +29,53 @@
#ifndef GDK_PIXBUF_IO_H
#define GDK_PIXBUF_IO_H
#include "gdk-pixbuf/gdk-pixbuf.h"
#include <gmodule.h>
#include <stdio.h>
#include "gdk-pixbuf.h"
#include "gdk-pixbuf-i18n.h"
G_BEGIN_DECLS
#ifdef GDK_PIXBUF_ENABLE_BACKEND
typedef void (* ModuleSizeFunc) (gint *width,
gint *height,
gpointer user_data);
typedef void (* ModulePreparedNotifyFunc) (GdkPixbuf *pixbuf,
GdkPixbufAnimation *anim,
gpointer user_data);
typedef void (* ModuleUpdatedNotifyFunc) (GdkPixbuf *pixbuf,
int x,
int y,
int width,
int height,
gpointer user_data);
typedef void (* GdkPixbufModuleSizeFunc) (gint *width,
gint *height,
gpointer user_data);
typedef void (* GdkPixbufModulePreparedFunc) (GdkPixbuf *pixbuf,
GdkPixbufAnimation *anim,
gpointer user_data);
typedef void (* GdkPixbufModuleUpdatedFunc) (GdkPixbuf *pixbuf,
int x,
int y,
int width,
int height,
gpointer user_data);
typedef struct _GdkPixbufModulePattern GdkPixbufModulePattern;
struct _GdkPixbufModulePattern {
unsigned char *prefix;
unsigned char *mask;
int relevance;
};
typedef struct _GdkPixbufModule GdkPixbufModule;
struct _GdkPixbufModule {
char *module_name;
gboolean (* format_check) (guchar *buffer, int size);
char *module_path;
GModule *module;
GdkPixbufFormat *info;
GdkPixbuf *(* load) (FILE *f,
GError **error);
GdkPixbuf *(* load_xpm_data) (const char **data);
/* Incremental loading */
gpointer (* begin_load) (ModuleSizeFunc size_func,
ModulePreparedNotifyFunc prepare_func,
ModuleUpdatedNotifyFunc update_func,
gpointer (* begin_load) (GdkPixbufModuleSizeFunc size_func,
GdkPixbufModulePreparedFunc prepare_func,
GdkPixbufModuleUpdatedFunc update_func,
gpointer user_data,
GError **error);
gboolean (* stop_load) (gpointer context,
......@@ -83,24 +94,44 @@ struct _GdkPixbufModule {
gchar **param_keys,
gchar **param_values,
GError **error);
};
void (*_reserved1) (void);
void (*_reserved2) (void);
void (*_reserved3) (void);
void (*_reserved4) (void);
void (*_reserved5) (void);
void (*_reserved6) (void);
typedef void (* ModuleFillVtableFunc) (GdkPixbufModule *module);
};
GdkPixbufModule *_gdk_pixbuf_get_module (guchar *buffer, guint size,
const gchar *filename,
GError **error);
GdkPixbufModule *_gdk_pixbuf_get_named_module (const char *name,
GError **error);
gboolean _gdk_pixbuf_load_module (GdkPixbufModule *image_module,
GError **error);
typedef void (* GdkPixbufModuleFillVtableFunc) (GdkPixbufModule *module);
typedef void (* GdkPixbufModuleFillInfoFunc) (GdkPixbufFormat *info);
typedef const GdkPixbufModulePattern *(* GdkPixbufModuleGetSignatureFunc) (void);
/* key/value pairs that can be attached by the pixbuf loader */
gboolean gdk_pixbuf_set_option (GdkPixbuf *pixbuf,
const gchar *key,
const gchar *value);
typedef enum /*< skip >*/
{
GDK_PIXBUF_FORMAT_WRITABLE = 1 << 0
} GdkPixbufFormatFlags;
struct _GdkPixbufFormat {
gchar *name;
GdkPixbufModulePattern *signature;
gchar *domain;
gchar *description;
gchar **mime_types;
gchar **extensions;
guint32 flags;
};
GdkPixbuf *_gdk_pixbuf_generic_image_load (GdkPixbufModule *image_module,
FILE *f,
GError **error);
#endif /* GDK_PIXBUF_ENABLE_BACKEND */
G_END_DECLS
#endif
#endif /* GDK_PIXBUF_IO_H */
......@@ -26,8 +26,9 @@
#include <string.h>
#include "gdk-pixbuf-private.h"
#include "gdk-pixbuf-loader.h"
#include "gdk-pixbuf-animation.h"
#include "gdk-pixbuf-io.h"
#include "gdk-pixbuf-loader.h"
#include "gdk-pixbuf-marshal.h"
enum {
......@@ -645,7 +646,32 @@ gdk_pixbuf_loader_close (GdkPixbufLoader *loader,
return retval;
}
/**
* gdk_pixbuf_loader_get_format:
* @loader: A pixbuf loader.
*
* Obtains the available information about the format of the
* currently loading image file.
*
* Returns: A #GdkPixbufFormat or %NULL. The return value is owned
* by GdkPixbuf and should not be freed.
*/
GdkPixbufFormat *
gdk_pixbuf_loader_get_format (GdkPixbufLoader *loader)
{
GdkPixbufLoaderPrivate *priv;
gboolean retval = TRUE;
g_return_val_if_fail (loader != NULL, NULL);
g_return_val_if_fail (GDK_IS_PIXBUF_LOADER (loader), NULL);
priv = loader->priv;
if (priv->image_module)
return _gdk_pixbuf_get_format (priv->image_module);
else
return NULL;
}
......
......@@ -81,7 +81,7 @@ GdkPixbuf * gdk_pixbuf_loader_get_pixbuf (GdkPixbufLoader *loader);
GdkPixbufAnimation * gdk_pixbuf_loader_get_animation (GdkPixbufLoader *loader);
gboolean gdk_pixbuf_loader_close (GdkPixbufLoader *loader,
GError **error);
GdkPixbufFormat *gdk_pixbuf_loader_get_format (GdkPixbufLoader *loader);
G_END_DECLS
......
......@@ -28,6 +28,9 @@
#define GDK_PIXBUF_PRIVATE_H
#include "gdk-pixbuf.h"
#include "gdk-pixbuf-io.h"
#include "gdk-pixbuf-i18n.h"
#include <stdio.h>
......@@ -74,70 +77,30 @@ struct _GdkPixbufClass {
};
typedef struct _GdkPixbufAnimationClass GdkPixbufAnimationClass;
#ifdef GDK_PIXBUF_ENABLE_BACKEND
#define GDK_PIXBUF_ANIMATION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GDK_TYPE_PIXBUF_ANIMATION, GdkPixbufAnimationClass))
#define GDK_IS_PIXBUF_ANIMATION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GDK_TYPE_PIXBUF_ANIMATION))
#define GDK_PIXBUF_ANIMATION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GDK_TYPE_PIXBUF_ANIMATION, GdkPixbufAnimationClass))
GdkPixbufModule *_gdk_pixbuf_get_module (guchar *buffer, guint size,
const gchar *filename,
GError **error);
GdkPixbufModule *_gdk_pixbuf_get_named_module (const char *name,
GError **error);
gboolean _gdk_pixbuf_load_module (GdkPixbufModule *image_module,
GError **error);
/* Private part of the GdkPixbufAnimation structure */
struct _GdkPixbufAnimation {
GObject parent_instance;
};
struct _GdkPixbufAnimationClass {
GObjectClass parent_class;
gboolean (*is_static_image) (GdkPixbufAnimation *anim);
GdkPixbuf* (*get_static_image) (GdkPixbufAnimation *anim);
void (*get_size) (GdkPixbufAnimation *anim,
int *width,
int *height);
GdkPixbufAnimationIter* (*get_iter) (GdkPixbufAnimation *anim,
const GTimeVal *start_time);
GdkPixbuf *_gdk_pixbuf_generic_image_load (GdkPixbufModule *image_module,
FILE *f,
GError **error);
};
typedef struct _GdkPixbufAnimationIterClass GdkPixbufAnimationIterClass;
#define GDK_PIXBUF_ANIMATION_ITER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GDK_TYPE_PIXBUF_ANIMATION_ITER, GdkPixbufAnimationIterClass))
#define GDK_IS_PIXBUF_ANIMATION_ITER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GDK_TYPE_PIXBUF_ANIMATION_ITER))
#define GDK_PIXBUF_ANIMATION_ITER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GDK_TYPE_PIXBUF_ANIMATION_ITER, GdkPixbufAnimationIterClass))
struct _GdkPixbufAnimationIter {
GObject parent_instance;
GdkPixbufFormat *_gdk_pixbuf_get_format (GdkPixbufModule *image_module);
};
struct _GdkPixbufAnimationIterClass {
GObjectClass parent_class;
int (*get_delay_time) (GdkPixbufAnimationIter *iter);
GdkPixbuf* (*get_pixbuf) (GdkPixbufAnimationIter *iter);
gboolean (*on_currently_loading_frame) (GdkPixbufAnimationIter *iter);
gboolean (*advance) (GdkPixbufAnimationIter *iter,
const GTimeVal *current_time);
};
GdkPixbufAnimation* gdk_pixbuf_non_anim_new (GdkPixbuf *pixbuf);
#ifdef USE_GMODULE
#define MODULE_ENTRY(type,function) function
#else
#define MODULE_ENTRY(type,function) _gdk_pixbuf__ ## type ## _ ## function
#endif
/* key/value pairs that can be attached by the pixbuf loader */
#endif /* GDK_PIXBUF_ENABLE_BACKEND */
gboolean gdk_pixbuf_set_option (GdkPixbuf *pixbuf,
const gchar *key,
const gchar *value);
#endif /* GDK_PIXBUF_PRIVATE_H */
#endif
......@@ -287,7 +287,16 @@ G_CONST_RETURN gchar * gdk_pixbuf_get_option (GdkPixbuf *pixbuf,
const gchar *key);
typedef struct _GdkPixbufFormat GdkPixbufFormat;
GSList *gdk_pixbuf_get_formats (void);
gchar *gdk_pixbuf_format_get_name (GdkPixbufFormat *format);
gchar *gdk_pixbuf_format_get_description (GdkPixbufFormat *format);
gchar **gdk_pixbuf_format_get_mime_types (GdkPixbufFormat *format);
gchar **gdk_pixbuf_format_get_extensions (GdkPixbufFormat *format);
gboolean gdk_pixbuf_format_is_writable (GdkPixbufFormat *format);
G_END_DECLS
#include <gdk-pixbuf/gdk-pixbuf-loader.h>
......
......@@ -19,7 +19,6 @@
#include "gdk-pixdata.h"
#include "gdk-pixbuf-private.h"
#include "gdk-pixbuf-i18n.h"
#include <string.h>
#define APPEND g_string_append_printf
......
......@@ -25,6 +25,7 @@
#define GDK_PIXBUF_ANI_ANIMATION_H
#include "gdk-pixbuf-private.h"
#include "gdk-pixbuf-animation.h"
typedef struct _GdkPixbufAniAnim GdkPixbufAniAnim;
typedef struct _GdkPixbufAniAnimClass GdkPixbufAniAnimClass;
......
......@@ -60,8 +60,8 @@ typedef struct _AniLoaderContext
guint n_bytes;
guint buffer_size;
ModulePreparedNotifyFunc prepared_func;
ModuleUpdatedNotifyFunc updated_func;
GdkPixbufModulePreparedFunc prepared_func;
GdkPixbufModuleUpdatedFunc updated_func;
gpointer user_data;
guint32 data_size;
......@@ -556,9 +556,9 @@ gdk_pixbuf__ani_image_load_increment (gpointer data,
}
static gpointer
gdk_pixbuf__ani_image_begin_load (ModuleSizeFunc size_func,
ModulePreparedNotifyFunc prepared_func,
ModuleUpdatedNotifyFunc updated_func,
gdk_pixbuf__ani_image_begin_load (GdkPixbufModuleSizeFunc size_func,
GdkPixbufModulePreparedFunc prepared_func,
GdkPixbufModuleUpdatedFunc updated_func,
gpointer user_data,
GError **error)
{
......@@ -647,10 +647,38 @@ gdk_pixbuf__ani_image_load_animation (FILE *f, GError **error)
}
void
gdk_pixbuf__ani_fill_vtable (GdkPixbufModule *module)
MODULE_ENTRY (ani, fill_vtable) (GdkPixbufModule *module)
{
module->load_animation = gdk_pixbuf__ani_image_load_animation;
module->begin_load = gdk_pixbuf__ani_image_begin_load;
module->stop_load = gdk_pixbuf__ani_image_stop_load;
module->load_increment = gdk_pixbuf__ani_image_load_increment;
}
void
MODULE_ENTRY (ani, fill_info) (GdkPixbufFormat *info)
{
static GdkPixbufModulePattern signature[] = {
{ "RIFF ACON", " xxxx ", 100 },
{ NULL, NULL, 0 }
};
static gchar * mime_types[] = {
"application/x-navi-animation",
NULL
};
static gchar * extensions[] = {
"ani",
NULL
};
info->name = "ani";
info->signature = signature;
info->description = N_("The ANI image format");
info->mime_types = mime_types;
info->extensions = extensions;
info->flags = 0;
}
/* -*- mode: C; c-file-style: "linux" -*- */
/* GdkPixbuf library - Windows Bitmap image loader
*
* Copyright (C) 1999 The Free Software Foundation
......@@ -143,8 +144,8 @@ struct bmp_compression_state {
/* Progressive loading */
struct bmp_progressive_state {
ModulePreparedNotifyFunc prepared_func;
ModuleUpdatedNotifyFunc updated_func;
GdkPixbufModulePreparedFunc prepared_func;
GdkPixbufModuleUpdatedFunc updated_func;
gpointer user_data;
ReadState read_state;
......@@ -181,9 +182,9 @@ struct bmp_progressive_state {
};
static gpointer
gdk_pixbuf__bmp_image_begin_load(ModuleSizeFunc size_func,
ModulePreparedNotifyFunc prepared_func,
ModuleUpdatedNotifyFunc updated_func,
gdk_pixbuf__bmp_image_begin_load(GdkPixbufModuleSizeFunc size_func,
GdkPixbufModulePreparedFunc prepared_func,
GdkPixbufModuleUpdatedFunc updated_func,
gpointer user_data,
GError **error);
......@@ -475,9 +476,9 @@ decode_bitmasks (guchar *buf,
*/
static gpointer
gdk_pixbuf__bmp_image_begin_load(ModuleSizeFunc size_func,
ModulePreparedNotifyFunc prepared_func,
ModuleUpdatedNotifyFunc updated_func,
gdk_pixbuf__bmp_image_begin_load(GdkPixbufModuleSizeFunc size_func,
GdkPixbufModulePreparedFunc prepared_func,
GdkPixbufModuleUpdatedFunc updated_func,
gpointer user_data,
GError **error)
{
......@@ -1045,9 +1046,36 @@ gdk_pixbuf__bmp_image_load_increment(gpointer data,
}
void
gdk_pixbuf__bmp_fill_vtable (GdkPixbufModule *module)
MODULE_ENTRY (bmp, fill_vtable) (GdkPixbufModule *module)
{
module->begin_load = gdk_pixbuf__bmp_image_begin_load;
module->stop_load = gdk_pixbuf__bmp_image_stop_load;
module->load_increment = gdk_pixbuf__bmp_image_load_increment;
module->begin_load = gdk_pixbuf__bmp_image_begin_load;
module->stop_load = gdk_pixbuf__bmp_image_stop_load;
module->load_increment = gdk_pixbuf__bmp_image_load_increment;
}
void
MODULE_ENTRY (bmp, fill_info) (GdkPixbufFormat *info)
{
static GdkPixbufModulePattern signature[] = {
{ "BM", NULL, 100 },
{ NULL, NULL, 0 }
};
static gchar * mime_types[] = {
"image/bmp",
"image/x-bmp",
"image/x-MS-bmp",
NULL
};
static gchar * extensions[] = {
"bmp",
NULL
};
info->name = "bmp";
info->signature = signature;
info->description = N_("The BMP image format");
info->mime_types = mime_types;
info->extensions = extensions;
info->flags = 0;
}
......@@ -24,7 +24,6 @@
#include <config.h>
#include <errno.h>
#include "gdk-pixbuf-io.h"
#include "gdk-pixbuf-private.h"
#include "io-gif-animation.h"
......
......@@ -27,7 +27,7 @@
#ifndef GDK_PIXBUF_GIF_H
#define GDK_PIXBUF_GIF_H
#include "gdk-pixbuf-private.h"
#include "gdk-pixbuf-animation.h"
typedef enum {
/* Keep this frame and composite next frame over it */
......
......@@ -138,8 +138,8 @@ struct _GifContext
FILE *file;
/* progressive read, only. */
ModulePreparedNotifyFunc prepare_func;
ModuleUpdatedNotifyFunc update_func;
GdkPixbufModulePreparedFunc prepare_func;
GdkPixbufModuleUpdatedFunc update_func;
gpointer user_data;
guchar *buf;
guint ptr;
......@@ -1396,9 +1396,9 @@ gdk_pixbuf__gif_image_load (FILE *file, GError **error)
}
static gpointer
gdk_pixbuf__gif_image_begin_load (ModuleSizeFunc size_func,
ModulePreparedNotifyFunc prepare_func,
ModuleUpdatedNotifyFunc update_func,
gdk_pixbuf__gif_image_begin_load (GdkPixbufModuleSizeFunc size_func,
GdkPixbufModulePreparedFunc prepare_func,
GdkPixbufModuleUpdatedFunc update_func,
gpointer user_data,
GError **error)
{
......@@ -1560,11 +1560,35 @@ gdk_pixbuf__gif_image_load_animation (FILE *file,
}
void
gdk_pixbuf__gif_fill_vtable (GdkPixbufModule *module)
MODULE_ENTRY (gif, fill_vtable) (GdkPixbufModule *module)
{
module->load = gdk_pixbuf__gif_image_load;
module->begin_load = gdk_pixbuf__gif_image_begin_load;
module->stop_load = gdk_pixbuf__gif_image_stop_load;
module->load_increment = gdk_pixbuf__gif_image_load_increment;
module->load_animation = gdk_pixbuf__gif_image_load_animation;
module->load = gdk_pixbuf__gif_image_load;
module->begin_load = gdk_pixbuf__gif_image_begin_load;
module->stop_load = gdk_pixbuf__gif_image_stop_load;
module->load_increment = gdk_pixbuf__gif_image_load_increment;
module->load_animation = gdk_pixbuf__gif_image_load_animation;