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)
This commit is contained in:
Matthias Clasen 2002-10-03 22:39:51 +00:00
parent 71277f4075
commit 45f7541f42
42 changed files with 1486 additions and 613 deletions

View File

@ -1,3 +1,20 @@
2002-10-04 Matthias Clasen <maclas@gmx.de>
* 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)
Thu Oct 3 18:25:57 2002 Owen Taylor <otaylor@redhat.com>
* io-jpeg.c (gdk_pixbuf__jpeg_image_save):

View File

@ -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

View File

@ -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;

View File

@ -0,0 +1,99 @@
/* -*- 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 */

View File

@ -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>

File diff suppressed because it is too large Load Diff

View File

@ -1,5 +1,6 @@
/* 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 (* GdkPixbufModuleSizeFunc) (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 (* 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);
typedef void (* GdkPixbufModuleFillVtableFunc) (GdkPixbufModule *module);
typedef void (* GdkPixbufModuleFillInfoFunc) (GdkPixbufFormat *info);
typedef const GdkPixbufModulePattern *(* GdkPixbufModuleGetSignatureFunc) (void);
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);
/* key/value pairs that can be attached by the pixbuf loader */
GdkPixbuf *_gdk_pixbuf_generic_image_load (GdkPixbufModule *image_module,
FILE *f,
GError **error);
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;
};
#endif /* GDK_PIXBUF_ENABLE_BACKEND */
G_END_DECLS
#endif
#endif /* GDK_PIXBUF_IO_H */

View File

@ -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;
}

View File

@ -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

View File

@ -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);
};
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);
/* key/value pairs that can be attached by the pixbuf loader */
gboolean gdk_pixbuf_set_option (GdkPixbuf *pixbuf,
const gchar *key,
const gchar *value);
GdkPixbuf *_gdk_pixbuf_generic_image_load (GdkPixbufModule *image_module,
FILE *f,
GError **error);
GdkPixbufFormat *_gdk_pixbuf_get_format (GdkPixbufModule *image_module);
#ifdef USE_GMODULE
#define MODULE_ENTRY(type,function) function
#else
#define MODULE_ENTRY(type,function) _gdk_pixbuf__ ## type ## _ ## function
#endif
#endif /* GDK_PIXBUF_ENABLE_BACKEND */
#endif /* GDK_PIXBUF_PRIVATE_H */

View File

@ -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>

View File

@ -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

View File

@ -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;

View File

@ -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;
}

View File

@ -1,3 +1,4 @@
/* -*- 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;
}

View File

@ -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"

View File

@ -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 */

View File

@ -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;
}
void
MODULE_ENTRY (gif, fill_info) (GdkPixbufFormat *info)
{
static GdkPixbufModulePattern signature[] = {
{ "GIF8", NULL, 100 },
{ NULL, NULL, 0 }
};
static gchar * mime_types[] = {
"image/gif",
NULL
};
static gchar * extensions[] = {
"gif",
NULL
};
info->name = "gif";
info->signature = signature;
info->description = N_("The GIF image format");
info->mime_types = mime_types;
info->extensions = extensions;
info->flags = 0;
}

View File

@ -1,3 +1,4 @@
/* -*- mode: C; c-file-style: "linux" -*- */
/* GdkPixbuf library - Windows Icon/Cursor image loader
*
* Copyright (C) 1999 The Free Software Foundation
@ -23,7 +24,7 @@
* Boston, MA 02111-1307, USA.
*/
#undef DUMPBIH
#define DUMPBIH
/*
Icons are just like BMP's, except for the header.
@ -124,8 +125,8 @@ struct headerpair {
};
struct ico_progressive_state {
ModulePreparedNotifyFunc prepared_func;
ModuleUpdatedNotifyFunc updated_func;
GdkPixbufModulePreparedFunc prepared_func;
GdkPixbufModuleUpdatedFunc updated_func;
gpointer user_data;
gint HeaderSize; /* The size of the header-part (incl colormap) */
@ -160,9 +161,9 @@ struct ico_progressive_state {
};
static gpointer
gdk_pixbuf__ico_image_begin_load(ModuleSizeFunc size_func,
ModulePreparedNotifyFunc prepared_func,
ModuleUpdatedNotifyFunc updated_func,
gdk_pixbuf__ico_image_begin_load(GdkPixbufModuleSizeFunc size_func,
GdkPixbufModulePreparedFunc prepared_func,
GdkPixbufModuleUpdatedFunc updated_func,
gpointer user_data,
GError **error);
static gboolean gdk_pixbuf__ico_image_stop_load(gpointer data, GError **error);
@ -442,9 +443,9 @@ static void DecodeHeader(guchar *Data, gint Bytes,
*/
static gpointer
gdk_pixbuf__ico_image_begin_load(ModuleSizeFunc size_func,
ModulePreparedNotifyFunc prepared_func,
ModuleUpdatedNotifyFunc updated_func,
gdk_pixbuf__ico_image_begin_load(GdkPixbufModuleSizeFunc size_func,
GdkPixbufModulePreparedFunc prepared_func,
GdkPixbufModuleUpdatedFunc updated_func,
gpointer user_data,
GError **error)
{
@ -840,9 +841,39 @@ gdk_pixbuf__ico_image_load_increment(gpointer data,
}
void
gdk_pixbuf__ico_fill_vtable (GdkPixbufModule *module)
MODULE_ENTRY (ico, fill_vtable) (GdkPixbufModule *module)
{
module->begin_load = gdk_pixbuf__ico_image_begin_load;
module->stop_load = gdk_pixbuf__ico_image_stop_load;
module->load_increment = gdk_pixbuf__ico_image_load_increment;
module->begin_load = gdk_pixbuf__ico_image_begin_load;
module->stop_load = gdk_pixbuf__ico_image_stop_load;
module->load_increment = gdk_pixbuf__ico_image_load_increment;
}
void
MODULE_ENTRY (ico, fill_info) (GdkPixbufFormat *info)
{
static GdkPixbufModulePattern signature[] = {
{ " \x1 ", "zz znz", 100 },
{ " \x2 ", "zz znz", 100 },
{ NULL, NULL, 0 }
};
static gchar * mime_types[] = {
"image/x-icon",
NULL
};
static gchar * extensions[] = {
"ico",
"cur",
NULL
};
info->name = "ico";
info->signature = signature;
info->description = N_("The ICO image format");
info->mime_types = mime_types;
info->extensions = extensions;
info->flags = 0;
}

View File

@ -65,10 +65,10 @@ struct error_handler_data {
/* progressive loader context */
typedef struct {
ModuleSizeFunc size_func;
ModuleUpdatedNotifyFunc updated_func;
ModulePreparedNotifyFunc prepared_func;
gpointer user_data;
GdkPixbufModuleSizeFunc size_func;
GdkPixbufModuleUpdatedFunc updated_func;
GdkPixbufModulePreparedFunc prepared_func;
gpointer user_data;
GdkPixbuf *pixbuf;
guchar *dptr; /* current position in pixbuf */
@ -82,9 +82,9 @@ typedef struct {
} JpegProgContext;
static GdkPixbuf *gdk_pixbuf__jpeg_image_load (FILE *f, GError **error);
static gpointer gdk_pixbuf__jpeg_image_begin_load (ModuleSizeFunc func0,
ModulePreparedNotifyFunc func1,
ModuleUpdatedNotifyFunc func2,
static gpointer gdk_pixbuf__jpeg_image_begin_load (GdkPixbufModuleSizeFunc func0,
GdkPixbufModulePreparedFunc func1,
GdkPixbufModuleUpdatedFunc func2,
gpointer user_data,
GError **error);
static gboolean gdk_pixbuf__jpeg_image_stop_load (gpointer context, GError **error);
@ -450,9 +450,9 @@ skip_input_data (j_decompress_ptr cinfo, long num_bytes)
*/
gpointer
gdk_pixbuf__jpeg_image_begin_load (ModuleSizeFunc size_func,
ModulePreparedNotifyFunc prepared_func,
ModuleUpdatedNotifyFunc updated_func,
gdk_pixbuf__jpeg_image_begin_load (GdkPixbufModuleSizeFunc size_func,
GdkPixbufModulePreparedFunc prepared_func,
GdkPixbufModuleUpdatedFunc updated_func,
gpointer user_data,
GError **error)
{
@ -908,11 +908,37 @@ gdk_pixbuf__jpeg_image_save (FILE *f,
}
void
gdk_pixbuf__jpeg_fill_vtable (GdkPixbufModule *module)
MODULE_ENTRY (jpeg, fill_vtable) (GdkPixbufModule *module)
{
module->load = gdk_pixbuf__jpeg_image_load;
module->begin_load = gdk_pixbuf__jpeg_image_begin_load;
module->stop_load = gdk_pixbuf__jpeg_image_stop_load;
module->load_increment = gdk_pixbuf__jpeg_image_load_increment;
module->save = gdk_pixbuf__jpeg_image_save;
module->load = gdk_pixbuf__jpeg_image_load;
module->begin_load = gdk_pixbuf__jpeg_image_begin_load;
module->stop_load = gdk_pixbuf__jpeg_image_stop_load;
module->load_increment = gdk_pixbuf__jpeg_image_load_increment;
module->save = gdk_pixbuf__jpeg_image_save;
}
void
MODULE_ENTRY (jpeg, fill_info) (GdkPixbufFormat *info)
{
static GdkPixbufModulePattern signature[] = {
{ "\xff\xd8", NULL, 100 },
{ NULL, NULL, 0 }
};
static gchar * mime_types[] = {
"image/jpeg",
NULL
};
static gchar * extensions[] = {
"jpeg",
"jpe",
"jpg",
NULL
};
info->name = "jpeg";
info->signature = signature;
info->description = N_("The JPEG image format");
info->mime_types = mime_types;
info->extensions = extensions;
info->flags = GDK_PIXBUF_FORMAT_WRITABLE;
}

View File

@ -358,8 +358,8 @@ struct _LoadContext {
png_structp png_read_ptr;
png_infop png_info_ptr;
ModulePreparedNotifyFunc prepare_func;
ModuleUpdatedNotifyFunc update_func;
GdkPixbufModulePreparedFunc prepare_func;
GdkPixbufModuleUpdatedFunc update_func;
gpointer notify_user_data;
GdkPixbuf* pixbuf;
@ -386,9 +386,9 @@ struct _LoadContext {
};
static gpointer
gdk_pixbuf__png_image_begin_load (ModuleSizeFunc size_func,
ModulePreparedNotifyFunc prepare_func,
ModuleUpdatedNotifyFunc update_func,
gdk_pixbuf__png_image_begin_load (GdkPixbufModuleSizeFunc size_func,
GdkPixbufModulePreparedFunc prepare_func,
GdkPixbufModuleUpdatedFunc update_func,
gpointer user_data,
GError **error)
{
@ -888,14 +888,36 @@ cleanup:
return success;
}
void
MODULE_ENTRY (png, fill_vtable) (GdkPixbufModule *module)
{
module->load = gdk_pixbuf__png_image_load;
module->begin_load = gdk_pixbuf__png_image_begin_load;
module->stop_load = gdk_pixbuf__png_image_stop_load;
module->load_increment = gdk_pixbuf__png_image_load_increment;
module->save = gdk_pixbuf__png_image_save;
}
void
gdk_pixbuf__png_fill_vtable (GdkPixbufModule *module)
MODULE_ENTRY (png, fill_info) (GdkPixbufFormat *info)
{
module->load = gdk_pixbuf__png_image_load;
module->begin_load = gdk_pixbuf__png_image_begin_load;
module->stop_load = gdk_pixbuf__png_image_stop_load;
module->load_increment = gdk_pixbuf__png_image_load_increment;
module->save = gdk_pixbuf__png_image_save;
static GdkPixbufModulePattern signature[] = {
{ "\x89PNG\r\n\x1a\x0a", NULL, 100 },
{ NULL, NULL, 0 }
};
static gchar * mime_types[] = {
"image/png",
NULL
};
static gchar * extensions[] = {
"png",
NULL
};
info->name = "png";
info->signature = signature;
info->description = N_("The PNG image format");
info->mime_types = mime_types;
info->extensions = extensions;
info->flags = GDK_PIXBUF_FORMAT_WRITABLE;
}

View File

@ -53,8 +53,8 @@ typedef struct {
} PnmIOBuffer;
typedef struct {
ModuleUpdatedNotifyFunc updated_func;
ModulePreparedNotifyFunc prepared_func;
GdkPixbufModuleUpdatedFunc updated_func;
GdkPixbufModulePreparedFunc prepared_func;
gpointer user_data;
GdkPixbuf *pixbuf;
@ -81,9 +81,9 @@ typedef struct {
} PnmLoaderContext;
static GdkPixbuf *gdk_pixbuf__pnm_image_load (FILE *f, GError **error);
static gpointer gdk_pixbuf__pnm_image_begin_load (ModuleSizeFunc size_func,
ModulePreparedNotifyFunc func,
ModuleUpdatedNotifyFunc func2,
static gpointer gdk_pixbuf__pnm_image_begin_load (GdkPixbufModuleSizeFunc size_func,
GdkPixbufModulePreparedFunc func,
GdkPixbufModuleUpdatedFunc func2,
gpointer user_data,
GError **error);
static gboolean gdk_pixbuf__pnm_image_stop_load (gpointer context, GError **error);
@ -804,9 +804,9 @@ gdk_pixbuf__pnm_image_load (FILE *f, GError **error)
*/
static gpointer
gdk_pixbuf__pnm_image_begin_load (ModuleSizeFunc size_func,
ModulePreparedNotifyFunc prepared_func,
ModuleUpdatedNotifyFunc updated_func,
gdk_pixbuf__pnm_image_begin_load (GdkPixbufModuleSizeFunc size_func,
GdkPixbufModulePreparedFunc prepared_func,
GdkPixbufModuleUpdatedFunc updated_func,
gpointer user_data,
GError **error)
{
@ -1030,10 +1030,45 @@ gdk_pixbuf__pnm_image_load_increment (gpointer data,
}
void
gdk_pixbuf__pnm_fill_vtable (GdkPixbufModule *module)
MODULE_ENTRY (pnm, fill_vtable) (GdkPixbufModule *module)
{
module->load = gdk_pixbuf__pnm_image_load;
module->begin_load = gdk_pixbuf__pnm_image_begin_load;
module->stop_load = gdk_pixbuf__pnm_image_stop_load;
module->load_increment = gdk_pixbuf__pnm_image_load_increment;
module->load = gdk_pixbuf__pnm_image_load;
module->begin_load = gdk_pixbuf__pnm_image_begin_load;
module->stop_load = gdk_pixbuf__pnm_image_stop_load;
module->load_increment = gdk_pixbuf__pnm_image_load_increment;
}
void
MODULE_ENTRY (pnm, fill_info) (GdkPixbufFormat *info)
{
static GdkPixbufModulePattern signature[] = {
{ "P1", NULL, 100 },
{ "P2", NULL, 100 },
{ "P3", NULL, 100 },
{ "P4", NULL, 100 },
{ "P5", NULL, 100 },
{ "P6", NULL, 100 },
{ NULL, NULL, 0 }
};
static gchar * mime_types[] = {
"image/x-portable-anymap",
"image/x-portable-bitmap",
"image/x-portable-graymap",
"image/x-portable-pixmap",
NULL
};
static gchar * extensions[] = {
"pnm",
"pbm",
"pgm",
"ppm",
NULL
};
info->name = "pnm";
info->signature = signature;
info->description = N_("The PNM/PBM/PGM/PPM image format family");
info->mime_types = mime_types;
info->extensions = extensions;
info->flags = 0;
}

View File

@ -1,3 +1,4 @@
/* -*- mode: C; c-file-style: "linux" -*- */
/* GdkPixbuf library - SUNRAS image loader
*
* Copyright (C) 1999 The Free Software Foundation
@ -67,8 +68,8 @@ struct rasterfile {
/* Progressive loading */
struct ras_progressive_state {
ModulePreparedNotifyFunc prepared_func;
ModuleUpdatedNotifyFunc updated_func;
GdkPixbufModulePreparedFunc prepared_func;
GdkPixbufModuleUpdatedFunc updated_func;
gpointer user_data;
gint HeaderSize; /* The size of the header-part (incl colormap) */
@ -94,9 +95,9 @@ struct ras_progressive_state {
};
static gpointer
gdk_pixbuf__ras_image_begin_load(ModuleSizeFunc size_func,
ModulePreparedNotifyFunc prepared_func,
ModuleUpdatedNotifyFunc updated_func,
gdk_pixbuf__ras_image_begin_load(GdkPixbufModuleSizeFunc size_func,
GdkPixbufModulePreparedFunc prepared_func,
GdkPixbufModuleUpdatedFunc updated_func,
gpointer user_data,
GError **error);
static gboolean gdk_pixbuf__ras_image_stop_load(gpointer data, GError **error);
@ -217,9 +218,9 @@ static gboolean RAS2State(struct rasterfile *RAS,
*/
static gpointer
gdk_pixbuf__ras_image_begin_load(ModuleSizeFunc size_func,
ModulePreparedNotifyFunc prepared_func,
ModuleUpdatedNotifyFunc updated_func,
gdk_pixbuf__ras_image_begin_load(GdkPixbufModuleSizeFunc size_func,
GdkPixbufModulePreparedFunc prepared_func,
GdkPixbufModuleUpdatedFunc updated_func,
gpointer user_data,
GError **error)
{
@ -502,10 +503,35 @@ gdk_pixbuf__ras_image_load_increment(gpointer data,
}
void
gdk_pixbuf__ras_fill_vtable (GdkPixbufModule *module)
MODULE_ENTRY (ras, fill_vtable) (GdkPixbufModule *module)
{
module->begin_load = gdk_pixbuf__ras_image_begin_load;
module->stop_load = gdk_pixbuf__ras_image_stop_load;
module->load_increment = gdk_pixbuf__ras_image_load_increment;
module->begin_load = gdk_pixbuf__ras_image_begin_load;
module->stop_load = gdk_pixbuf__ras_image_stop_load;
module->load_increment = gdk_pixbuf__ras_image_load_increment;
}
void
MODULE_ENTRY (ras, fill_info) (GdkPixbufFormat *info)
{
static GdkPixbufModulePattern signature[] = {
{ "\x59\xa6\x6a\x95", NULL, 100 },
{ NULL, NULL, 0 }
};
static gchar * mime_types[] = {
"image/x-cmu-raster",
"image/x-sun-raster",
NULL
};
static gchar * extensions[] = {
"ras",
NULL
};
info->name = "ras";
info->signature = signature;
info->description = N_("The Sun raster image format");
info->mime_types = mime_types;
info->extensions = extensions;
info->flags = 0;
}

View File

@ -1,3 +1,4 @@
/* -*- mode: C; c-file-style: "linux" -*- */
/*
* GdkPixbuf library - TGA image loader
* Copyright (C) 1999 Nicola Girardi <nikke@swlibero.org>
@ -38,9 +39,8 @@
#include <stdio.h>
#include <string.h>
#include "gdk-pixbuf.h"
#include "gdk-pixbuf-io.h"
#include "gdk-pixbuf-private.h"
#include "gdk-pixbuf-io.h"
#undef DEBUG_TGA
@ -139,8 +139,8 @@ struct _TGAContext {
gboolean prepared;
gboolean done;
ModulePreparedNotifyFunc pfunc;
ModuleUpdatedNotifyFunc ufunc;
GdkPixbufModulePreparedFunc pfunc;
GdkPixbufModuleUpdatedFunc ufunc;
gpointer udata;
};
@ -802,9 +802,9 @@ static gboolean try_preload(TGAContext *ctx, GError **err)
return TRUE;
}
static gpointer gdk_pixbuf__tga_begin_load(ModuleSizeFunc f0,
ModulePreparedNotifyFunc f1,
ModuleUpdatedNotifyFunc f2,
static gpointer gdk_pixbuf__tga_begin_load(GdkPixbufModuleSizeFunc f0,
GdkPixbufModulePreparedFunc f1,
GdkPixbufModuleUpdatedFunc f2,
gpointer udata, GError **err)
{
TGAContext *ctx;
@ -1335,10 +1335,40 @@ static GdkPixbuf *gdk_pixbuf__tga_load(FILE *f, GError **err)
}
void
gdk_pixbuf__tga_fill_vtable (GdkPixbufModule *module)
MODULE_ENTRY (tga, fill_vtable) (GdkPixbufModule *module)
{
module->load = gdk_pixbuf__tga_load;
module->begin_load = gdk_pixbuf__tga_begin_load;
module->stop_load = gdk_pixbuf__tga_stop_load;
module->load_increment = gdk_pixbuf__tga_load_increment;
}
void
MODULE_ENTRY (tga, fill_info) (GdkPixbufFormat *info)
{
static GdkPixbufModulePattern signature[] = {
{ " \x1\x1", "x ", 100 },
{ " \x1\x9", "x ", 100 },
{ " \x2", "xz ", 99 }, /* only 99 since .CUR also matches this */
{ " \x3", "xz ", 100 },
{ " \xa", "xz ", 100 },
{ " \xb", "xz ", 100 },
{ NULL, NULL, 0 }
};
static gchar * mime_types[] = {
"image/x-tga",
NULL
};
static gchar * extensions[] = {
"tga",
"targa",
NULL
};
info->name = "tga";
info->signature = signature;
info->description = N_("The Targa image format");
info->mime_types = mime_types;
info->extensions = extensions;
info->flags = 0;
}

View File

@ -47,8 +47,8 @@
typedef struct _TiffContext TiffContext;
struct _TiffContext
{
ModulePreparedNotifyFunc prepare_func;
ModuleUpdatedNotifyFunc update_func;
GdkPixbufModulePreparedFunc prepare_func;
GdkPixbufModuleUpdatedFunc update_func;
gpointer user_data;
guchar *buffer;
@ -361,9 +361,9 @@ gdk_pixbuf__tiff_image_load (FILE *f, GError **error)
/* Progressive loader */
static gpointer
gdk_pixbuf__tiff_image_begin_load (ModuleSizeFunc size_func,
ModulePreparedNotifyFunc prepare_func,
ModuleUpdatedNotifyFunc update_func,
gdk_pixbuf__tiff_image_begin_load (GdkPixbufModuleSizeFunc size_func,
GdkPixbufModulePreparedFunc prepare_func,
GdkPixbufModuleUpdatedFunc update_func,
gpointer user_data,
GError **error)
{
@ -560,10 +560,36 @@ gdk_pixbuf__tiff_image_load_increment (gpointer data, const guchar *buf,
}
void
gdk_pixbuf__tiff_fill_vtable (GdkPixbufModule *module)
MODULE_ENTRY (tiff, fill_vtable) (GdkPixbufModule *module)
{
module->load = gdk_pixbuf__tiff_image_load;
module->begin_load = gdk_pixbuf__tiff_image_begin_load;
module->stop_load = gdk_pixbuf__tiff_image_stop_load;
module->load_increment = gdk_pixbuf__tiff_image_load_increment;
}
void
MODULE_ENTRY (tiff, fill_info) (GdkPixbufFormat *info)
{
static GdkPixbufModulePattern signature[] = {
{ "MM \x2a", " z ", 100 },
{ "II\x2a ", " z", 100 },
{ NULL, NULL, 0 }
};
static gchar * mime_types[] = {
"image/tiff",
NULL
};
static gchar * extensions[] = {
"tiff",
"tif",
NULL
};
info->name = "tiff";
info->signature = signature;
info->description = N_("The TIFF image format");
info->mime_types = mime_types;
info->extensions = extensions;
info->flags = 0;
}

View File

@ -1,3 +1,4 @@
/* -*- mode: C; c-file-style: "linux" -*- */
/* GdkPixbuf library - Wireless Bitmap image loader
*
* Copyright (C) 2000 Red Hat, Inc.
@ -42,8 +43,8 @@ Known bugs:
/* Progressive loading */
struct wbmp_progressive_state {
ModulePreparedNotifyFunc prepared_func;
ModuleUpdatedNotifyFunc updated_func;
GdkPixbufModulePreparedFunc prepared_func;
GdkPixbufModuleUpdatedFunc updated_func;
gpointer user_data;
gboolean need_type : 1;
@ -63,9 +64,9 @@ struct wbmp_progressive_state {
};
static gpointer
gdk_pixbuf__wbmp_image_begin_load(ModuleSizeFunc size_func,
ModulePreparedNotifyFunc prepared_func,
ModuleUpdatedNotifyFunc updated_func,
gdk_pixbuf__wbmp_image_begin_load(GdkPixbufModuleSizeFunc size_func,
GdkPixbufModulePreparedFunc prepared_func,
GdkPixbufModuleUpdatedFunc updated_func,
gpointer user_data,
GError **error);
@ -82,9 +83,9 @@ static gboolean gdk_pixbuf__wbmp_image_load_increment(gpointer data,
*/
static gpointer
gdk_pixbuf__wbmp_image_begin_load(ModuleSizeFunc size_func,
ModulePreparedNotifyFunc prepared_func,
ModuleUpdatedNotifyFunc updated_func,
gdk_pixbuf__wbmp_image_begin_load(GdkPixbufModuleSizeFunc size_func,
GdkPixbufModulePreparedFunc prepared_func,
GdkPixbufModuleUpdatedFunc updated_func,
gpointer user_data,
GError **error)
{
@ -339,9 +340,33 @@ static gboolean gdk_pixbuf__wbmp_image_load_increment(gpointer data,
}
void
gdk_pixbuf__wbmp_fill_vtable (GdkPixbufModule *module)
MODULE_ENTRY (wbmp, fill_vtable) (GdkPixbufModule *module)
{
module->begin_load = gdk_pixbuf__wbmp_image_begin_load;
module->stop_load = gdk_pixbuf__wbmp_image_stop_load;
module->load_increment = gdk_pixbuf__wbmp_image_load_increment;
module->begin_load = gdk_pixbuf__wbmp_image_begin_load;
module->stop_load = gdk_pixbuf__wbmp_image_stop_load;
module->load_increment = gdk_pixbuf__wbmp_image_load_increment;
}
void
MODULE_ENTRY (wbmp, fill_info) (GdkPixbufFormat *info)
{
static GdkPixbufModulePattern signature[] = {
{ " ", "z", 1 },
{ NULL, NULL, 0 }
};
static gchar * mime_types[] = {
"image/vnd.wap.wbmp",
NULL
};
static gchar * extensions[] = {
"wbmp",
NULL
};
info->name = "wbmp";
info->signature = signature;
info->description = N_("The WBMP image format");
info->mime_types = mime_types;
info->extensions = extensions;
info->flags = 0;
}

View File

@ -1,3 +1,4 @@
/* -*- mode: C; c-file-style: "linux" -*- */
/* GdkPixbuf library - XBM image loader
*
* Copyright (C) 1999 Mark Crichton
@ -42,8 +43,8 @@
typedef struct _XBMData XBMData;
struct _XBMData
{
ModulePreparedNotifyFunc prepare_func;
ModuleUpdatedNotifyFunc update_func;
GdkPixbufModulePreparedFunc prepare_func;
GdkPixbufModuleUpdatedFunc update_func;
gpointer user_data;
gchar *tempname;
@ -361,9 +362,9 @@ gdk_pixbuf__xbm_image_load (FILE *f, GError **error)
*/
static gpointer
gdk_pixbuf__xbm_image_begin_load (ModuleSizeFunc size_func,
ModulePreparedNotifyFunc prepare_func,
ModuleUpdatedNotifyFunc update_func,
gdk_pixbuf__xbm_image_begin_load (GdkPixbufModuleSizeFunc size_func,
GdkPixbufModulePreparedFunc prepare_func,
GdkPixbufModuleUpdatedFunc update_func,
gpointer user_data,
GError **error)
{
@ -443,10 +444,35 @@ gdk_pixbuf__xbm_image_load_increment (gpointer data,
}
void
gdk_pixbuf__xbm_fill_vtable (GdkPixbufModule *module)
MODULE_ENTRY (xbm, fill_vtable) (GdkPixbufModule *module)
{
module->load = gdk_pixbuf__xbm_image_load;
module->begin_load = gdk_pixbuf__xbm_image_begin_load;
module->stop_load = gdk_pixbuf__xbm_image_stop_load;
module->load_increment = gdk_pixbuf__xbm_image_load_increment;
module->load = gdk_pixbuf__xbm_image_load;
module->begin_load = gdk_pixbuf__xbm_image_begin_load;
module->stop_load = gdk_pixbuf__xbm_image_stop_load;
module->load_increment = gdk_pixbuf__xbm_image_load_increment;
}
void
MODULE_ENTRY (xbm, fill_info) (GdkPixbufFormat *info)
{
static GdkPixbufModulePattern signature[] = {
{ "#define ", NULL, 100 },
{ "/*", NULL, 50 },
{ NULL, NULL, 0 }
};
static gchar * mime_types[] = {
"image/x-xbitmap",
NULL
};
static gchar * extensions[] = {
"xbm",
NULL
};
info->name = "xbm";
info->signature = signature;
info->description = N_("The XBM image format");
info->mime_types = mime_types;
info->extensions = extensions;
info->flags = 0;
}

View File

@ -1409,8 +1409,8 @@ gdk_pixbuf__xpm_image_load_xpm_data (const gchar **data)
typedef struct _XPMContext XPMContext;
struct _XPMContext
{
ModulePreparedNotifyFunc prepare_func;
ModuleUpdatedNotifyFunc update_func;
GdkPixbufModulePreparedFunc prepare_func;
GdkPixbufModuleUpdatedFunc update_func;
gpointer user_data;
gchar *tempname;
@ -1425,9 +1425,9 @@ struct _XPMContext
* in the future.
*/
static gpointer
gdk_pixbuf__xpm_image_begin_load (ModuleSizeFunc size_func,
ModulePreparedNotifyFunc prepare_func,
ModuleUpdatedNotifyFunc update_func,
gdk_pixbuf__xpm_image_begin_load (GdkPixbufModuleSizeFunc size_func,
GdkPixbufModulePreparedFunc prepare_func,
GdkPixbufModuleUpdatedFunc update_func,
gpointer user_data,
GError **error)
{
@ -1513,11 +1513,35 @@ gdk_pixbuf__xpm_image_load_increment (gpointer data,
}
void
gdk_pixbuf__xpm_fill_vtable (GdkPixbufModule *module)
MODULE_ENTRY (xpm, fill_vtable) (GdkPixbufModule *module)
{
module->load = gdk_pixbuf__xpm_image_load;
module->load_xpm_data = gdk_pixbuf__xpm_image_load_xpm_data;
module->begin_load = gdk_pixbuf__xpm_image_begin_load;
module->stop_load = gdk_pixbuf__xpm_image_stop_load;
module->load_increment = gdk_pixbuf__xpm_image_load_increment;
module->load = gdk_pixbuf__xpm_image_load;
module->load_xpm_data = gdk_pixbuf__xpm_image_load_xpm_data;
module->begin_load = gdk_pixbuf__xpm_image_begin_load;
module->stop_load = gdk_pixbuf__xpm_image_stop_load;
module->load_increment = gdk_pixbuf__xpm_image_load_increment;
}
void
MODULE_ENTRY (xpm, fill_info) (GdkPixbufFormat *info)
{
static GdkPixbufModulePattern signature[] = {
{ "/* XPM */", NULL, 100 },
{ NULL, NULL, 0 }
};
static gchar * mime_types[] = {
"image/x-xpixmap",
NULL
};
static gchar * extensions[] = {
"xpm",
NULL
};
info->name = "xpm";
info->signature = signature;
info->description = N_("The XPM image format");
info->mime_types = mime_types;
info->extensions = extensions;
info->flags = 0;
}

View File

@ -1,2 +1,3 @@
EXPORTS
gdk_pixbuf__ani_fill_vtable
fill_vtable
fill_info

View File

@ -1,2 +1,3 @@
EXPORTS
gdk_pixbuf__bmp_fill_vtable
fill_vtable
fill_info

View File

@ -1,2 +1,3 @@
EXPORTS
gdk_pixbuf__gif_fill_vtable
fill_vtable
fill_info

View File

@ -1,2 +1,3 @@
EXPORTS
gdk_pixbuf__ico_fill_vtable
fill_vtable
fill_info

View File

@ -1,2 +1,3 @@
EXPORTS
gdk_pixbuf__jpeg_fill_vtable
fill_vtable
fill_info

View File

@ -1,2 +1,3 @@
EXPORTS
gdk_pixbuf__png_fill_vtable
fill_vtable
fill_info

View File

@ -1,2 +1,3 @@
EXPORTS
gdk_pixbuf__pnm_fill_vtable
fill_vtable
fill_info

View File

@ -1,2 +1,3 @@
EXPORTS
gdk_pixbuf__ras_fill_vtable
fill_vtable
fill_info

View File

@ -1,2 +1,3 @@
EXPORTS
gdk_pixbuf__tga_fill_vtable
fill_vtable
fill_info

View File

@ -1,2 +1,3 @@
EXPORTS
gdk_pixbuf__tiff_fill_vtable
fill_vtable
fill_info

View File

@ -1,2 +1,3 @@
EXPORTS
gdk_pixbuf__wbmp_fill_vtable
fill_vtable
fill_info

View File

@ -1,2 +1,3 @@
EXPORTS
gdk_pixbuf__xbm_fill_vtable
fill_vtable
fill_info

View File

@ -1,2 +1,3 @@
EXPORTS
gdk_pixbuf__xpm_fill_vtable
fill_vtable
fill_info

155
gdk-pixbuf/queryloaders.c Normal file
View File

@ -0,0 +1,155 @@
/* -*- mode: C; c-file-style: "linux" -*- */
/* GdkPixbuf library
* queryloaders.c:
*
* Copyright (C) 2002 The Free Software Foundation
*
* Author: Matthias Clasen <maclas@gmx.de>
*
* 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.
*/
#include <config.h>
#include <glib.h>
#include <gmodule.h>
#include <errno.h>
#include <string.h>
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#include <stdio.h>
#include "gdk-pixbuf/gdk-pixbuf.h"
#include "gdk-pixbuf/gdk-pixbuf-private.h"
#include "gdk-pixbuf/gdk-pixbuf-io.h"
#if USE_LA_MODULES
#define SOEXT ".la"
#else
#define SOEXT ("." G_MODULE_SUFFIX)
#endif
#define SOEXT_LEN (strlen (SOEXT))
static void
print_escaped (const char *str)
{
gchar *tmp = g_strescape (str, "");
printf ("\"%s\" ", tmp);
g_free (tmp);
}
static void
query_module (const char *dir, const char *file)
{
char *path;
GModule *module;
void (*fill_info) (GdkPixbufFormat *info);
void (*fill_vtable) (GdkPixbufModule *module);
char **mime;
char **ext;
const GdkPixbufModulePattern *pattern;
if (g_path_is_absolute (dir))
path = g_build_filename (dir, file, NULL);
else {
char *cwd = g_get_current_dir ();
path = g_build_filename (cwd, dir, file, NULL);
g_free (cwd);
}
module = g_module_open (path, 0);
if (module &&
g_module_symbol (module, "fill_info", (gpointer *) &fill_info) &&
g_module_symbol (module, "fill_vtable", (gpointer *) &fill_vtable)) {
printf("\"%s\"\n", path);
GdkPixbufFormat *info = g_new0 (GdkPixbufFormat, 1);
(*fill_info) (info);
printf("\"%s\" %d \"%s\" \"%s\"\n",
info->name, info->flags,
info->domain ? info->domain : GETTEXT_PACKAGE, info->description);
for (mime = info->mime_types; *mime; mime++) {
printf("\"%s\" ", *mime);
}
printf("\"\"\n");
for (ext = info->extensions; *ext; ext++) {
printf("\"%s\" ", *ext);
}
printf("\"\"\n");
for (pattern = info->signature; pattern->prefix; pattern++) {
print_escaped (pattern->prefix);
print_escaped (pattern->mask ? (const char *)pattern->mask : "");
printf ("%d\n", pattern->relevance);
}
printf ("\n");
g_free (info);
}
else {
fprintf (stderr, "Cannot load loader %s\n", path);
}
if (module)
g_module_close (module);
g_free (path);
}
int main (int argc, char **argv)
{
gint i;
printf ("# GdkPixbuf Image Loader Modules file\n"
"# Automatically generated file, do not edit\n"
"#\n");
if (argc == 1) {
#ifdef USE_GMODULE
const char *path;
path = g_getenv ("GDK_PIXBUF_MODULEDIR");
if (path == NULL || *path == '\0')
path = PIXBUF_LIBDIR;
printf ("# LoaderDir = %s\n#\n", path);
GDir *dir = g_dir_open (path, 0, NULL);
if (dir) {
const char *dent;
while ((dent = g_dir_read_name (dir))) {
gint len = strlen (dent);
if (len > SOEXT_LEN &&
strcmp (dent + len - SOEXT_LEN, SOEXT) == 0) {
query_module (path, dent);
}
}
g_dir_close (dir);
}
#else
printf ("# dynamic loading of modules not supported\n");
#endif
}
else {
char *cwd = g_get_current_dir ();
for (i = 1; i < argc; i++)
query_module (cwd, argv[i]);
g_free (cwd);
}
return 0;
}