Commit 80d4bf2b authored by Havoc Pennington's avatar Havoc Pennington Committed by Havoc Pennington

Add built marshaller files to support GdkPixbufLoader signals

2001-01-22  Havoc Pennington  <hp@redhat.com>

	* Makefile.am: Add built marshaller files to support
	GdkPixbufLoader signals

	* gdk-pixbuf-io.c (gdk_pixbuf_load_module): have
	GDK_PIXBUF_MODULEDIR unconditionally replace the compiled-in
	module location, rather than acting as a fallback, because we are
	using GDK_PIXBUF_MODULEDIR to use gdk-pixbuf before installing it.

	* gdk-pixbuf.h: include gdk-pixbuf-loader.h

        * gdk-pixbuf-loader.h, gdk-pixbuf-loader.c: Move back over here
	from gtk, and add error to close(), because stop_load may do
	parsing of the image.

	* pixops/have_mmx.S (_pixops_have_mmx): add newline at end of file

        * io-*.c: make individual operations static, and add fill_vtable
	functions which are exported. Fix the collection of type warnings
	that surfaced, including a number of functions that didn't
	properly take a GError and some that weren't
	const-correct. Involved adding error handling for a few loaders.

	* gdk-pixbuf-io.h: Add error reporting to stop_load function

	* gdk-pixbuf-io.c (gdk_pixbuf_load_module): change to just look up
	a function that fills in the GdkPixbufModule vtable, instead of
	looking up all the image functions individually; this means we
	can get type safety within modules for the loader functions.
	Also it means you don't have to keep the statically compiled and
	GModule versions in sync.

	* test-gdk-pixbuf.c (main): remove gdk_pixbuf_init()

	* make-inline-pixbuf.c (main): remove call to gdk_pixbuf_init()

	* gdk-pixbuf.h: nuke gdk_pixbuf_init()

	* gdk-pixbuf-animation.c (gdk_pixbuf_frame_get_type): g_type_init
	() here

	* gdk-pixbuf.c (gdk_pixbuf_get_type): g_type_init () here

	* gdk-pixbuf-animation.c (gdk_pixbuf_animation_get_type):
	g_type_init() here


2001-01-22  Havoc Pennington  <hp@redhat.com>

	* demos/testanimation.c: fix to reflect gdk-pixbuf changes

	* demos/testpixbuf.c: fix to reflect gdk-pixbuf changes

	* gtk/gdk-pixbuf-loader.c, gtk/gdk-pixbuf-loader.h:
	Remove, move back to gdk-pixbuf

	* gtk/gtktextiter.c, gtk/gtktextiter.h: add sentence equivalents
	to all the word functions

	* gtk/gtktextview.c (gtk_text_view_start_cursor_blink): return
	before doing anything on NULL layout or if we don't have the focus

	* gtk/testtext.c (fill_example_buffer): "justification"

	* gtk/gtktexttag.h, gtk/gtktexttag.c: change the tag attribute
	to be called "justification" not "justify"

	* demos/gtk-demo/textview.c (create_tags): "justification"

	* gtk/gtktextlayout.c (set_para_values): Handle char-wise wrapping
parent 90a5f4ca
......@@ -166,7 +166,7 @@ INCLUDES = -I$(top_srcdir) -I$(top_builddir) \
-I$(top_srcdir)/gdk-pixbuf \
-I$(top_builddir)/gdk-pixbuf \
@INCLUDED_LOADER_DEFINE@ \
$(GLIB_CFLAGS)
@GLIB_CFLAGS@
AM_CPPFLAGS = "-DPIXBUF_LIBDIR=\"$(loaderdir)\""
LDADDS = libgdk_pixbuf-1.3.la $(GLIB_LIBS) $(STATIC_LIB_DEPS)
......@@ -185,6 +185,8 @@ GDK_PIXBUF_LIBS = $(GLIB_LIBS) $(INTLLIBS)
# The GdkPixBuf library
#
BUILT_SOURCES=gdk-pixbuf-marshal.h gdk-pixbuf-marshal.c
libgdk_pixbufincludedir = $(includedir)/gtk-2.0/gdk-pixbuf
libgdk_pixbuf_1_3_la_SOURCES = \
......@@ -193,6 +195,8 @@ libgdk_pixbuf_1_3_la_SOURCES = \
gdk-pixbuf-animation.c \
gdk-pixbuf-data.c \
gdk-pixbuf-io.c \
gdk-pixbuf-loader.c \
gdk-pixbuf-marshal.h \
gdk-pixbuf-scale.c \
gdk-pixbuf-util.c
......@@ -205,6 +209,7 @@ libgdk_pixbuf_1_3_la_DEPENDENCIES = $(builtin_objs)
libgdk_pixbufinclude_HEADERS = \
gdk-pixbuf.h \
gdk-pixbuf-loader.h \
gdk-pixbuf-features.h
noinst_HEADERS = \
......@@ -227,3 +232,15 @@ EXTRA_DIST = \
pixbufloader_wbmp.def \
pixbufloader_xbm.def
gdk-pixbuf-marshal.h: gdk-pixbuf-marshal.list
cd $(srcdir) \
&& glib-genmarshal --prefix=gdk_pixbuf_marshal gdk-pixbuf-marshal.list --header >> xgen-gmh \
&& (cmp -s xgen-gmh gdk-pixbuf-marshal.h || cp xgen-gmh gdk-pixbuf-marshal.h) \
&& rm -f xgen-gmh xgen-gmh~
gdk-pixbuf-marshal.c: gdk-pixbuf-marshal.list
cd $(srcdir) \
&& glib-genmarshal --prefix=gdk_pixbuf_marshal gdk-pixbuf-marshal.list --body >> xgen-gmh \
&& (cmp -s xgen-gmh gdk-pixbuf-marshal.c || cp xgen-gmh gdk-pixbuf-marshal.c) \
&& rm -f xgen-gmh xgen-gmh~
......@@ -50,7 +50,9 @@ gdk_pixbuf_animation_get_type (void)
0, /* n_preallocs */
(GInstanceInitFunc) NULL,
};
g_type_init ();
object_type = g_type_register_static (G_TYPE_OBJECT,
"GdkPixbufAnimation",
&object_info, 0);
......@@ -457,6 +459,8 @@ gdk_pixbuf_frame_get_type (void)
if (our_type == 0)
{
g_type_init ();
our_type = g_boxed_type_register_static ("GdkPixbufFrame",
gdk_pixbuf_frame_copy,
gdk_pixbuf_frame_free);
......
......@@ -260,281 +260,173 @@ gdk_pixbuf_load_module (GdkPixbufModule *image_module,
char *module_name;
char *path;
GModule *module;
gpointer load_sym;
gpointer save_sym;
gpointer sym;
char *name;
gboolean retval;
char *dir;
g_return_val_if_fail (image_module->module == NULL, FALSE);
name = image_module->module_name;
module_name = g_strconcat ("pixbufloader-", name, NULL);
path = g_module_build_path (PIXBUF_LIBDIR, module_name);
module = g_module_open (path, G_MODULE_BIND_LAZY);
if (!module) {
/* Debug feature, check in GDK_PIXBUF_MODULEDIR, or working directory */
char *dir = g_getenv ("GDK_PIXBUF_MODULEDIR");
if (!dir)
dir = "";
g_free (path);
path = g_module_build_path (dir, module_name);
/* This would be an exploit in an suid binary using gdk-pixbuf,
* but see http://www.gtk.org/setuid.html or the BugTraq
* archives for why you should report this as a bug against
* setuid apps using this library rather than the library
* itself.
*/
dir = g_getenv ("GDK_PIXBUF_MODULEDIR");
if (dir == NULL || *dir == '\0') {
path = g_module_build_path (PIXBUF_LIBDIR, module_name);
module = g_module_open (path, G_MODULE_BIND_LAZY);
} else {
path = g_module_build_path (dir, module_name);
module = g_module_open (path, G_MODULE_BIND_LAZY);
}
if (!module) {
g_set_error (error,
GDK_PIXBUF_ERROR,
GDK_PIXBUF_ERROR_FAILED,
_("Unable to load image-loading module: %s: %s"),
path, g_module_error ());
g_free (module_name);
g_free (path);
return FALSE;
}
g_free (path);
} else {
if (!module) {
g_set_error (error,
GDK_PIXBUF_ERROR,
GDK_PIXBUF_ERROR_FAILED,
_("Unable to load image-loading module: %s: %s"),
path, g_module_error ());
g_free (module_name);
g_free (path);
return FALSE;
}
g_free (module_name);
image_module->module = module;
if (pixbuf_module_symbol (module, name, "image_load", &load_sym))
image_module->load = load_sym;
if (pixbuf_module_symbol (module, name, "image_load_xpm_data", &load_sym))
image_module->load_xpm_data = load_sym;
if (pixbuf_module_symbol (module, name, "image_begin_load", &load_sym))
image_module->begin_load = load_sym;
if (pixbuf_module_symbol (module, name, "image_stop_load", &load_sym))
image_module->stop_load = load_sym;
if (pixbuf_module_symbol (module, name, "image_load_increment", &load_sym))
image_module->load_increment = load_sym;
if (pixbuf_module_symbol (module, name, "image_load_animation", &load_sym))
image_module->load_animation = load_sym;
image_module->module = module;
if (pixbuf_module_symbol (module, name, "fill_vtable", &sym)) {
ModuleFillVtableFunc func = sym;
(* func) (image_module);
retval = TRUE;
} else {
g_set_error (error,
GDK_PIXBUF_ERROR,
GDK_PIXBUF_ERROR_FAILED,
_("Image-loading module %s does not export the proper interface; perhaps it's from a different GTK version?"),
path);
retval = FALSE;
}
if (pixbuf_module_symbol (module, name, "image_save", &save_sym))
image_module->save = save_sym;
g_free (path);
return TRUE;
return retval;
}
#else
#define mname(type,fn) gdk_pixbuf__ ## type ## _image_ ##fn
#define m_load(type) extern GdkPixbuf * mname(type,load) (FILE *f, GError **error);
#define m_load_xpm_data(type) extern GdkPixbuf * mname(type,load_xpm_data) (const char **data);
#define m_begin_load(type) \
extern gpointer mname(type,begin_load) (ModulePreparedNotifyFunc prepare_func, \
ModuleUpdatedNotifyFunc update_func, \
ModuleFrameDoneNotifyFunc frame_done_func,\
ModuleAnimationDoneNotifyFunc anim_done_func,\
gpointer user_data,\
GError **error);
#define m_stop_load(type) extern void mname(type,stop_load) (gpointer context);
#define m_load_increment(type) extern gboolean mname(type,load_increment) (gpointer context, const guchar *buf, guint size, GError **error);
#define m_load_animation(type) extern GdkPixbufAnimation * mname(type,load_animation) (FILE *f, GError **error);
#define m_save(type) \
extern gboolean mname(type,save) (FILE *f, \
GdkPixbuf *pixbuf, \
gchar **keys, \
gchar **values, \
GError **error);
/* PNG */
m_load (png);
m_begin_load (png);
m_load_increment (png);
m_stop_load (png);
m_save (png);
/* BMP */
m_load (bmp);
m_begin_load (bmp);
m_load_increment (bmp);
m_stop_load (bmp);
/* WBMP */
m_load (wbmp);
m_begin_load (wbmp);
m_load_increment (wbmp);
m_stop_load (wbmp);
/* GIF */
m_load (gif);
m_begin_load (gif);
m_load_increment (gif);
m_stop_load (gif);
m_load_animation (gif);
/* ICO */
m_load (ico);
m_begin_load (ico);
m_load_increment (ico);
m_stop_load (ico);
/* JPEG */
m_load (jpeg);
m_begin_load (jpeg);
m_load_increment (jpeg);
m_stop_load (jpeg);
m_save (jpeg);
/* PNM */
m_load (pnm);
m_begin_load (pnm);
m_load_increment (pnm);
m_stop_load (pnm);
/* RAS */
m_load (ras);
m_begin_load (ras);
m_load_increment (ras);
m_stop_load (ras);
/* TIFF */
m_load (tiff);
m_begin_load (tiff);
m_load_increment (tiff);
m_stop_load (tiff);
/* XPM */
m_load (xpm);
m_load_xpm_data (xpm);
/* XBM */
m_load (xbm);
m_begin_load (xbm);
m_load_increment (xbm);
m_stop_load (xbm);
#define m_fill_vtable(type) extern void mname(type,fill_vtable) (GdkPixbufModule *module)
m_fill_vtable (png);
m_fill_vtable (bmp);
m_fill_vtable (wbmp);
m_fill_vtable (gif);
m_fill_vtable (ico);
m_fill_vtable (jpeg);
m_fill_vtable (pnm);
m_fill_vtable (ras);
m_fill_vtable (tiff);
m_fill_vtable (xpm);
m_fill_vtable (xbm);
gboolean
gdk_pixbuf_load_module (GdkPixbufModule *image_module,
GError **error)
{
ModuleFillVtableFunc fill_vtable = NULL;
image_module->module = (void *) 1;
if (FALSE) {
/* Ugly hack so we can use else if unconditionally below ;-) */
}
#ifdef INCLUDE_png
if (strcmp (image_module->module_name, "png") == 0){
image_module->load = mname (png,load);
image_module->begin_load = mname (png,begin_load);
image_module->load_increment = mname (png,load_increment);
image_module->stop_load = mname (png,stop_load);
image_module->save = mname (png,save);
return TRUE;
else if (strcmp (image_module->module_name, "png") == 0){
fill_vtable = mname (png, fill_vtable);
}
#endif
#ifdef INCLUDE_bmp
if (strcmp (image_module->module_name, "bmp") == 0){
image_module->load = mname (bmp,load);
image_module->begin_load = mname (bmp,begin_load);
image_module->load_increment = mname (bmp,load_increment);
image_module->stop_load = mname (bmp,stop_load);
return TRUE;
else if (strcmp (image_module->module_name, "bmp") == 0){
fill_vtable = mname (bmp, fill_vtable);
}
#endif
#ifdef INCLUDE_wbmp
if (strcmp (image_module->module_name, "wbmp") == 0){
image_module->load = mname (wbmp,load);
image_module->begin_load = mname (wbmp,begin_load);
image_module->load_increment = mname (wbmp,load_increment);
image_module->stop_load = mname (wbmp,stop_load);
return TRUE;
else if (strcmp (image_module->module_name, "wbmp") == 0){
fill_vtable = mname (wbmp, fill_vtable);
}
#endif
#ifdef INCLUDE_gif
if (strcmp (image_module->module_name, "gif") == 0){
image_module->load = mname (gif,load);
image_module->begin_load = mname (gif,begin_load);
image_module->load_increment = mname (gif,load_increment);
image_module->stop_load = mname (gif,stop_load);
image_module->load_animation = mname (gif,load_animation);
return TRUE;
else if (strcmp (image_module->module_name, "gif") == 0){
fill_vtable = mname (gif, fill_vtable);
}
#endif
#ifdef INCLUDE_ico
if (strcmp (image_module->module_name, "ico") == 0){
image_module->load = mname (ico,load);
image_module->begin_load = mname (ico,begin_load);
image_module->load_increment = mname (ico,load_increment);
image_module->stop_load = mname (ico,stop_load);
return TRUE;
else if (strcmp (image_module->module_name, "ico") == 0){
fill_vtable = mname (ico, fill_vtable);
}
#endif
#ifdef INCLUDE_jpeg
if (strcmp (image_module->module_name, "jpeg") == 0){
image_module->load = mname (jpeg,load);
image_module->begin_load = mname (jpeg,begin_load);
image_module->load_increment = mname (jpeg,load_increment);
image_module->stop_load = mname (jpeg,stop_load);
image_module->save = mname (jpeg,save);
return TRUE;
else if (strcmp (image_module->module_name, "jpeg") == 0){
fill_vtable = mname (jpeg, fill_vtable);
}
#endif
#ifdef INCLUDE_pnm
if (strcmp (image_module->module_name, "pnm") == 0){
image_module->load = mname (pnm,load);
image_module->begin_load = mname (pnm,begin_load);
image_module->load_increment = mname (pnm,load_increment);
image_module->stop_load = mname (pnm,stop_load);
return TRUE;
else if (strcmp (image_module->module_name, "pnm") == 0){
fill_vtable = mname (pnm, fill_vtable);
}
#endif
#ifdef INCLUDE_ras
if (strcmp (image_module->module_name, "ras") == 0){
image_module->load = mname (ras,load);
image_module->begin_load = mname (ras,begin_load);
image_module->load_increment = mname (ras,load_increment);
image_module->stop_load = mname (ras,stop_load);
return TRUE;
else if (strcmp (image_module->module_name, "ras") == 0){
fill_vtable = mname (ras, fill_vtable);
}
#endif
#ifdef INCLUDE_tiff
if (strcmp (image_module->module_name, "tiff") == 0){
image_module->load = mname (tiff,load);
image_module->begin_load = mname (tiff,begin_load);
image_module->load_increment = mname (tiff,load_increment);
image_module->stop_load = mname (tiff,stop_load);
return TRUE;
}
#endif
#ifdef INCLUDE_xpm
if (strcmp (image_module->module_name, "xpm") == 0){
image_module->load = mname (xpm,load);
image_module->load_xpm_data = mname (xpm,load_xpm_data);
return TRUE;
else if (strcmp (image_module->module_name, "tiff") == 0){
fill_vtable = mname (tiff, fill_vtable);
}
#endif
#ifdef INCLUDE_xpm
if (strcmp (image_module->module_name, "xpm") == 0){
image_module->load = mname (xpm,load);
image_module->load_xpm_data = mname (xpm,load_xpm_data);
return TRUE;
else if (strcmp (image_module->module_name, "xpm") == 0){
fill_vtable = mname (xpm, fill_vtable);
}
#endif
#ifdef INCLUDE_tiff
if (strcmp (image_module->module_name, "xbm") == 0){
image_module->load = mname (xbm,load);
image_module->begin_load = mname (xbm,begin_load);
image_module->load_increment = mname (xbm,load_increment);
image_module->stop_load = mname (xbm,stop_load);
return TRUE;
#ifdef INCLUDE_xbm
else if (strcmp (image_module->module_name, "xbm") == 0){
fill_vtable = mname (xbm, fill_vtable);
}
#endif
g_set_error (error,
GDK_PIXBUF_ERROR,
GDK_PIXBUF_ERROR_UNKNOWN_TYPE,
_("Image type '%s' is not supported"),
image_module->module_name);
if (fill_vtable) {
(* fill_vtable) (image_module);
return TRUE;
} else {
g_set_error (error,
GDK_PIXBUF_ERROR,
GDK_PIXBUF_ERROR_UNKNOWN_TYPE,
_("Image type '%s' is not supported"),
image_module->module_name);
return FALSE;
return FALSE;
}
}
......
......@@ -61,13 +61,14 @@ struct _GdkPixbufModule {
/* Incremental loading */
gpointer (* begin_load) (ModulePreparedNotifyFunc prepare_func,
ModuleUpdatedNotifyFunc update_func,
ModuleFrameDoneNotifyFunc frame_done_func,
ModuleAnimationDoneNotifyFunc anim_done_func,
gpointer user_data,
GError **error);
void (* stop_load) (gpointer context);
gpointer (* begin_load) (ModulePreparedNotifyFunc prepare_func,
ModuleUpdatedNotifyFunc update_func,
ModuleFrameDoneNotifyFunc frame_done_func,
ModuleAnimationDoneNotifyFunc anim_done_func,
gpointer user_data,
GError **error);
gboolean (* stop_load) (gpointer context,
GError **error);
gboolean (* load_increment) (gpointer context,
const guchar *buf,
guint size,
......@@ -84,6 +85,7 @@ struct _GdkPixbufModule {
GError **error);
};
typedef void (* ModuleFillVtableFunc) (GdkPixbufModule *module);
GdkPixbufModule *gdk_pixbuf_get_module (guchar *buffer, guint size,
const gchar *filename,
......
......@@ -28,8 +28,9 @@
#include "gdk-pixbuf-private.h"
#include "gdk-pixbuf-loader.h"
#include "gdk-pixbuf-io.h"
#include "gdk-pixbuf-marshal.h"
#include "gtksignal.h"
#include <gobject/gsignal.h>
enum {
AREA_UPDATED,
......@@ -92,6 +93,8 @@ gdk_pixbuf_loader_get_type (void)
0, /* n_preallocs */
(GInstanceInitFunc) gdk_pixbuf_loader_init
};
g_type_init ();
loader_type = g_type_register_static (G_TYPE_OBJECT,
"GdkPixbufLoader",
......@@ -119,7 +122,7 @@ gdk_pixbuf_loader_class_init (GdkPixbufLoaderClass *class)
G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (GdkPixbufLoaderClass, area_prepared),
NULL,
gtk_marshal_VOID__VOID,
gdk_pixbuf_marshal_VOID__VOID,
G_TYPE_NONE, 0);
pixbuf_loader_signals[AREA_UPDATED] =
......@@ -128,7 +131,7 @@ gdk_pixbuf_loader_class_init (GdkPixbufLoaderClass *class)
G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (GdkPixbufLoaderClass, area_updated),
NULL,
gtk_marshal_VOID__INT_INT_INT_INT,
gdk_pixbuf_marshal_VOID__INT_INT_INT_INT,
G_TYPE_NONE, 4,
G_TYPE_INT,
G_TYPE_INT,
......@@ -141,7 +144,7 @@ gdk_pixbuf_loader_class_init (GdkPixbufLoaderClass *class)
G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (GdkPixbufLoaderClass, frame_done),
NULL,
gtk_marshal_VOID__POINTER,
gdk_pixbuf_marshal_VOID__POINTER,
G_TYPE_NONE, 1,
GDK_TYPE_PIXBUF_FRAME);
......@@ -151,7 +154,7 @@ gdk_pixbuf_loader_class_init (GdkPixbufLoaderClass *class)
G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (GdkPixbufLoaderClass, animation_done),
NULL,
gtk_marshal_VOID__VOID,
gdk_pixbuf_marshal_VOID__VOID,
G_TYPE_NONE, 0);
pixbuf_loader_signals[CLOSED] =
......@@ -160,7 +163,7 @@ gdk_pixbuf_loader_class_init (GdkPixbufLoaderClass *class)
G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (GdkPixbufLoaderClass, closed),
NULL,
gtk_marshal_VOID__VOID,
gdk_pixbuf_marshal_VOID__VOID,
G_TYPE_NONE, 0);
}
......@@ -421,7 +424,7 @@ gdk_pixbuf_loader_eat_header_write (GdkPixbufLoader *loader,
* and FALSE if an error occurred. In the latter case, the loader
* will be closed, and will not accept further writes. If FALSE is
* returned, @error will be set to an error from the #GDK_PIXBUF_ERROR
* domain.
* or #G_FILE_ERROR domains.
*
* Return value: #TRUE if the write was successful, or #FALSE if the loader
* cannot parse the buffer.
......@@ -595,31 +598,46 @@ gdk_pixbuf_loader_get_animation (GdkPixbufLoader *loader)
/**
* gdk_pixbuf_loader_close:
* @loader: A pixbuf loader.
* @error: return location for a #GError, or %NULL to ignore errors
*
* Informs a pixbuf loader that no further writes with
* gdk_pixbuf_loader_write() will occur, so that it can free its
* internal loading structures. Also, tries to parse any data that
* hasn't yet been parsed; if the remaining data is partial or
* corrupt, an error will be returned. If FALSE is returned, @error
* will be set to an error from the #GDK_PIXBUF_ERROR or #G_FILE_ERROR
* domains. If you're just cancelling a load rather than expecting it
* to be finished, passing %NULL for @error to ignore it is
* reasonable.
*
* Informs a pixbuf loader that no further writes with gdk_pixbuf_loader_write()
* will occur, so that it can free its internal loading structures.
* Returns: %TRUE if all image data written so far was successfully
passed out via the update_area signal
**/
void
gdk_pixbuf_loader_close (GdkPixbufLoader *loader)
gboolean
gdk_pixbuf_loader_close (GdkPixbufLoader *loader,
GError **error)
{
GdkPixbufLoaderPrivate *priv;
gboolean retval = TRUE;
g_return_if_fail (loader != NULL);
g_return_if_fail (GDK_IS_PIXBUF_LOADER (loader));
g_return_val_if_fail (loader != NULL, TRUE);
g_return_val_if_fail (GDK_IS_PIXBUF_LOADER (loader), TRUE);
priv = loader->private;
/* we expect it's not closed */
g_return_if_fail (priv->closed == FALSE);
g_return_val_if_fail (priv->closed == FALSE, TRUE);
/* We have less the 128 bytes in the image. Flush it, and keep going. */
if (priv->image_module == NULL)
gdk_pixbuf_loader_load_module (loader, NULL, NULL);
if (priv->image_module && priv->image_module->stop_load)
priv->image_module->stop_load (priv->context);
retval = priv->image_module->stop_load (priv->context, error);
priv->closed = TRUE;
g_signal_emit (G_OBJECT (loader), pixbuf_loader_signals[CLOSED], 0);
return retval;
}
......@@ -26,8 +26,6 @@
#ifndef GDK_PIXBUF_LOADER_H
#define GDK_PIXBUF_LOADER_H
#include <gdk-pixbuf/gdk-pixbuf.h>
#ifdef __cplusplus
extern "C" {
#endif
......@@ -77,7 +75,8 @@ gboolean gdk_pixbuf_loader_write (GdkPixbufLoader *loader,
GError **error);
GdkPixbuf * gdk_pixbuf_loader_get_pixbuf (GdkPixbufLoader *loader);
GdkPixbufAnimation * gdk_pixbuf_loader_get_animation (GdkPixbufLoader *loader);
void gdk_pixbuf_loader_close (GdkPixbufLoader *loader);
gboolean gdk_pixbuf_loader_close (GdkPixbufLoader *loader,
GError **error);
#ifdef __cplusplus
......
# see glib-genmarshal(1) for a detailed description of the file format,
# possible parameter types are:
# VOID indicates no return type, or no extra
# parameters. if VOID is used as the parameter
# list, no additional parameters may be present.
# BOOLEAN for boolean types (gboolean)
# CHAR for signed char types (gchar)
# UCHAR for unsigned char types (guchar)
# INT for signed integer types (gint)
# UINT for unsigned integer types (guint)
# LONG for signed long integer types (glong)
# ULONG for unsigned long integer types (gulong)
# ENUM for enumeration types (gint)
# FLAGS for flag enumeration types (guint)
# FLOAT for single-precision float types (gfloat)
# DOUBLE for double-precision float types (gdouble)
# STRING for string types (gchar*)
# BOXED for boxed (anonymous but reference counted) types (GBoxed*)
# POINTER for anonymous pointer types (gpointer)
# OBJECT for GObject or derived types (GObject*)
# NONE deprecated alias for VOID
# BOOL deprecated alias for BOOLEAN
VOID:VOID
VOID:INT,INT,INT,INT
VOID:POINTER
......@@ -54,6 +54,8 @@ gdk_pixbuf_get_type (void)
(GInstanceInitFunc) NULL,
};
g_type_init ();
object_type = g_type_register_static (G_TYPE_OBJECT,
"GdkPixbuf",
&object_info, 0);
......@@ -398,24 +400,6 @@ const guint gdk_pixbuf_micro_version = GDK_PIXBUF_MICRO;
const char *gdk_pixbuf_version = GDK_PIXBUF_VERSION;
void
gdk_pixbuf_preinit (gpointer app, gpointer modinfo)
{
g_type_init ();
}
void
gdk_pixbuf_postinit (gpointer app, gpointer modinfo)
{
}
void
gdk_pixbuf_init (void)
{
gdk_pixbuf_preinit (NULL, NULL);
gdk_pixbuf_postinit (NULL, NULL);
}
/* Error quark */
GQuark
gdk_pixbuf_error_quark (void)
......@@ -426,3 +410,7 @@ gdk_pixbuf_error_quark (void)
return q;
}
/* Include the marshallers */
#include <gobject/gvaluetypes.h>
#include "gdk-pixbuf-marshal.c"
......@@ -284,12 +284,7 @@ void gdk_pixbuf_frame_free (GdkPixbufFrame *frame);
GType gdk_pixbuf_frame_get_type (void) G_GNUC_CONST;
#define GDK_TYPE_PIXBUF_FRAME gdk_pixbuf_frame_get_type ()
/* General (presently empty) initialization hooks, primarily for gnome-libs */
void gdk_pixbuf_preinit (gpointer app, gpointer modinfo);
void gdk_pixbuf_postinit (gpointer app, gpointer modinfo);
/* A more user-friendly init function */
void gdk_pixbuf_init (void);
#include <gdk-pixbuf/gdk-pixbuf-loader.h>
......
......@@ -171,7 +171,7 @@ struct bmp_progressive_state {
GdkPixbuf *pixbuf; /* Our "target" */
};
gpointer
static gpointer
gdk_pixbuf__bmp_image_begin_load(ModulePreparedNotifyFunc prepared_func,
ModuleUpdatedNotifyFunc updated_func,
ModuleFrameDoneNotifyFunc frame_done_func,
......@@ -179,16 +179,17 @@ gdk_pixbuf__bmp_image_begin_load(ModulePreparedNotifyFunc prepared_func,
anim_done_func, gpointer user_data,
GError **error);
void gdk_pixbuf__bmp_image_stop_load(gpointer data);
gboolean gdk_pixbuf__bmp_image_load_increment(gpointer data, guchar * buf,
guint size,
GError **error);
static gboolean gdk_pixbuf__bmp_image_stop_load(gpointer data, GError **error);
static gboolean gdk_pixbuf__bmp_image_load_increment(gpointer data,
const guchar * buf,
guint size,
GError **error);
/* Shared library entry point --> This should be removed when