summaryrefslogtreecommitdiff
path: root/gdk-pixbuf
diff options
context:
space:
mode:
authorMatthias Clasen <matthiasc@src.gnome.org>2002-07-06 23:10:46 +0000
committerMatthias Clasen <matthiasc@src.gnome.org>2002-07-06 23:10:46 +0000
commit7a7315974bbe8e43fa45384766ad8acadc687b39 (patch)
tree501210ec71c71966efdf24cf90ccdc4c4bb3999b /gdk-pixbuf
parent290ef37e0568b83f6111072d99a07e2d569d52f5 (diff)
downloadgdk-pixbuf-7a7315974bbe8e43fa45384766ad8acadc687b39.tar.gz
Load-at-size functionality for gdk-pixbuf.
Diffstat (limited to 'gdk-pixbuf')
-rw-r--r--gdk-pixbuf/gdk-pixbuf-io.h7
-rw-r--r--gdk-pixbuf/gdk-pixbuf-loader.c141
-rw-r--r--gdk-pixbuf/gdk-pixbuf-loader.h10
-rw-r--r--gdk-pixbuf/gdk-pixbuf-marshal.list1
-rw-r--r--gdk-pixbuf/io-bmp.c8
-rw-r--r--gdk-pixbuf/io-gif.c3
-rw-r--r--gdk-pixbuf/io-ico.c8
-rw-r--r--gdk-pixbuf/io-jpeg.c87
-rw-r--r--gdk-pixbuf/io-png.c3
-rw-r--r--gdk-pixbuf/io-pnm.c6
-rw-r--r--gdk-pixbuf/io-ras.c8
-rw-r--r--gdk-pixbuf/io-tga.c3
-rw-r--r--gdk-pixbuf/io-tiff.c3
-rw-r--r--gdk-pixbuf/io-wbmp.c8
-rw-r--r--gdk-pixbuf/io-xbm.c3
-rw-r--r--gdk-pixbuf/io-xpm.c3
16 files changed, 223 insertions, 79 deletions
diff --git a/gdk-pixbuf/gdk-pixbuf-io.h b/gdk-pixbuf/gdk-pixbuf-io.h
index 15e9de0a0..8cf233fe2 100644
--- a/gdk-pixbuf/gdk-pixbuf-io.h
+++ b/gdk-pixbuf/gdk-pixbuf-io.h
@@ -37,6 +37,10 @@ G_BEGIN_DECLS
+typedef void (* ModuleSizeFunc) (gint *width,
+ gint *height,
+ gpointer user_data);
+
typedef void (* ModulePreparedNotifyFunc) (GdkPixbuf *pixbuf,
GdkPixbufAnimation *anim,
gpointer user_data);
@@ -58,7 +62,8 @@ struct _GdkPixbufModule {
/* Incremental loading */
- gpointer (* begin_load) (ModulePreparedNotifyFunc prepare_func,
+ gpointer (* begin_load) (ModuleSizeFunc size_func,
+ ModulePreparedNotifyFunc prepare_func,
ModuleUpdatedNotifyFunc update_func,
gpointer user_data,
GError **error);
diff --git a/gdk-pixbuf/gdk-pixbuf-loader.c b/gdk-pixbuf/gdk-pixbuf-loader.c
index 52b1f112a..bcb7382e3 100644
--- a/gdk-pixbuf/gdk-pixbuf-loader.c
+++ b/gdk-pixbuf/gdk-pixbuf-loader.c
@@ -31,8 +31,9 @@
#include "gdk-pixbuf-marshal.h"
enum {
- AREA_UPDATED,
+ SIZE_PREPARED,
AREA_PREPARED,
+ AREA_UPDATED,
CLOSED,
LAST_SIGNAL
};
@@ -58,6 +59,10 @@ typedef struct
gint header_buf_offset;
GdkPixbufModule *image_module;
gpointer context;
+ gint width;
+ gint height;
+ gboolean size_fixed;
+ gboolean needs_scale;
} GdkPixbufLoaderPrivate;
@@ -109,6 +114,17 @@ gdk_pixbuf_loader_class_init (GdkPixbufLoaderClass *class)
object_class->finalize = gdk_pixbuf_loader_finalize;
+ pixbuf_loader_signals[SIZE_PREPARED] =
+ g_signal_new ("size_prepared",
+ G_TYPE_FROM_CLASS (object_class),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (GdkPixbufLoaderClass, size_prepared),
+ NULL, NULL,
+ gdk_pixbuf_marshal_VOID__INT_INT,
+ G_TYPE_NONE, 2,
+ G_TYPE_INT,
+ G_TYPE_INT);
+
pixbuf_loader_signals[AREA_PREPARED] =
g_signal_new ("area_prepared",
G_TYPE_FROM_CLASS (object_class),
@@ -170,14 +186,73 @@ gdk_pixbuf_loader_finalize (GObject *object)
G_OBJECT_CLASS (parent_class)->finalize (object);
}
+/**
+ * gdk_pixbuf_loader_set_size:
+ * @loader: A pixbuf loader.
+ * @width: The desired width of the image being loaded.
+ * @height: The desired height of the image being loaded.
+ *
+ * Causes the image to be scaled while it is loaded. The desired
+ * image size can be determined relative to the original size of
+ * the image by calling gdk_pixbuf_loader_set_size() from a
+ * signal handler for the ::size_prepared signal.
+ *
+ * Attempts to set the desired image size are ignored after the
+ * emission of the ::size_prepared signal.
+ */
+void
+gdk_pixbuf_loader_set_size (GdkPixbufLoader *loader,
+ gint width,
+ gint height)
+{
+ GdkPixbufLoaderPrivate *priv = GDK_PIXBUF_LOADER (loader)->priv;
+ g_return_if_fail (width > 0 && height > 0);
+
+ if (!priv->size_fixed) {
+ priv->width = width;
+ priv->height = height;
+ }
+}
+
+static void
+gdk_pixbuf_loader_size_func (gint *width, gint *height, gpointer loader)
+{
+ GdkPixbufLoaderPrivate *priv = GDK_PIXBUF_LOADER (loader)->priv;
+
+ /* allow calling gdk_pixbuf_loader_set_size() before the signal */
+ if (priv->width == 0 && priv->height == 0) {
+ priv->width = *width;
+ priv->height = *height;
+ }
+
+ g_signal_emit (loader, pixbuf_loader_signals[SIZE_PREPARED], 0, *width, *height);
+ priv->size_fixed = TRUE;
+
+ *width = priv->width;
+ *height = priv->height;
+}
+
static void
gdk_pixbuf_loader_prepare (GdkPixbuf *pixbuf,
GdkPixbufAnimation *anim,
gpointer loader)
{
- GdkPixbufLoaderPrivate *priv = NULL;
-
- priv = GDK_PIXBUF_LOADER (loader)->priv;
+ GdkPixbufLoaderPrivate *priv = GDK_PIXBUF_LOADER (loader)->priv;
+ g_return_if_fail (pixbuf != NULL);
+
+ if (!priv->size_fixed) {
+ /* Defend against lazy loaders which don't call size_func */
+ gint width = gdk_pixbuf_get_width (pixbuf);
+ gint height = gdk_pixbuf_get_height (pixbuf);
+
+ gdk_pixbuf_loader_size_func (&width, &height, loader);
+ }
+
+ priv->needs_scale = FALSE;
+ if (priv->width > 0 && priv->height > 0 &&
+ (priv->width != gdk_pixbuf_get_width (pixbuf) ||
+ priv->height != gdk_pixbuf_get_height (pixbuf)))
+ priv->needs_scale = TRUE;
if (anim)
g_object_ref (anim);
@@ -186,7 +261,8 @@ gdk_pixbuf_loader_prepare (GdkPixbuf *pixbuf,
priv->animation = anim;
- g_signal_emit (loader, pixbuf_loader_signals[AREA_PREPARED], 0);
+ if (!priv->needs_scale)
+ g_signal_emit (loader, pixbuf_loader_signals[AREA_PREPARED], 0);
}
static void
@@ -197,17 +273,16 @@ gdk_pixbuf_loader_update (GdkPixbuf *pixbuf,
gint height,
gpointer loader)
{
- GdkPixbufLoaderPrivate *priv = NULL;
-
- priv = GDK_PIXBUF_LOADER (loader)->priv;
-
- g_signal_emit (loader,
- pixbuf_loader_signals[AREA_UPDATED],
- 0,
- x, y,
- /* sanity check in here. Defend against an errant loader */
- MIN (width, gdk_pixbuf_animation_get_width (priv->animation)),
- MIN (height, gdk_pixbuf_animation_get_height (priv->animation)));
+ GdkPixbufLoaderPrivate *priv = GDK_PIXBUF_LOADER (loader)->priv;
+
+ if (!priv->needs_scale)
+ g_signal_emit (loader,
+ pixbuf_loader_signals[AREA_UPDATED],
+ 0,
+ x, y,
+ /* sanity check in here. Defend against an errant loader */
+ MIN (width, gdk_pixbuf_animation_get_width (priv->animation)),
+ MIN (height, gdk_pixbuf_animation_get_height (priv->animation)));
}
static gint
@@ -253,10 +328,11 @@ gdk_pixbuf_loader_load_module (GdkPixbufLoader *loader,
return 0;
}
- priv->context = priv->image_module->begin_load (gdk_pixbuf_loader_prepare,
- gdk_pixbuf_loader_update,
- loader,
- error);
+ priv->context = priv->image_module->begin_load (gdk_pixbuf_loader_size_func,
+ gdk_pixbuf_loader_prepare,
+ gdk_pixbuf_loader_update,
+ loader,
+ error);
if (priv->context == NULL)
{
@@ -536,12 +612,33 @@ gdk_pixbuf_loader_close (GdkPixbufLoader *loader,
retval = FALSE;
}
}
+
if (priv->image_module && priv->image_module->stop_load && priv->context) {
if (!priv->image_module->stop_load (priv->context, error))
retval = FALSE;
}
priv->closed = TRUE;
+
+ if (priv->needs_scale) {
+ GdkPixbuf *tmp, *pixbuf;
+
+ tmp = gdk_pixbuf_animation_get_static_image (priv->animation);
+ g_object_ref (tmp);
+ pixbuf = gdk_pixbuf_new (GDK_COLORSPACE_RGB, tmp->has_alpha, 8, priv->width, priv->height);
+ g_object_unref (priv->animation);
+ priv->animation = gdk_pixbuf_non_anim_new (pixbuf);
+ g_signal_emit (loader, pixbuf_loader_signals[AREA_PREPARED], 0);
+ gdk_pixbuf_scale (tmp, pixbuf, 0, 0, priv->width, priv->height, 0, 0,
+ (double) priv->width / tmp->width,
+ (double) priv->height / tmp->height,
+ GDK_INTERP_BILINEAR);
+ g_object_unref (tmp);
+
+ g_signal_emit (loader, pixbuf_loader_signals[AREA_UPDATED], 0,
+ 0, 0, priv->width, priv->height);
+ }
+
g_signal_emit (loader, pixbuf_loader_signals[CLOSED], 0);
@@ -549,3 +646,7 @@ gdk_pixbuf_loader_close (GdkPixbufLoader *loader,
}
+
+
+
+
diff --git a/gdk-pixbuf/gdk-pixbuf-loader.h b/gdk-pixbuf/gdk-pixbuf-loader.h
index bacaf9d38..030d446fa 100644
--- a/gdk-pixbuf/gdk-pixbuf-loader.h
+++ b/gdk-pixbuf/gdk-pixbuf-loader.h
@@ -50,6 +50,10 @@ struct _GdkPixbufLoaderClass
{
GObjectClass parent_class;
+ void (*size_prepared) (GdkPixbufLoader *loader,
+ int width,
+ int height);
+
void (*area_prepared) (GdkPixbufLoader *loader);
/* Last known frame needs a redraw for x, y, width, height */
@@ -62,11 +66,13 @@ struct _GdkPixbufLoaderClass
void (*closed) (GdkPixbufLoader *loader);
};
-
GType gdk_pixbuf_loader_get_type (void) G_GNUC_CONST;
GdkPixbufLoader * gdk_pixbuf_loader_new (void);
GdkPixbufLoader * gdk_pixbuf_loader_new_with_type (const char *image_type,
GError **error);
+void gdk_pixbuf_loader_set_size (GdkPixbufLoader *loader,
+ int width,
+ int height);
gboolean gdk_pixbuf_loader_write (GdkPixbufLoader *loader,
const guchar *buf,
gsize count,
@@ -80,3 +86,5 @@ gboolean gdk_pixbuf_loader_close (GdkPixbufLoader *loader,
G_END_DECLS
#endif
+
+
diff --git a/gdk-pixbuf/gdk-pixbuf-marshal.list b/gdk-pixbuf/gdk-pixbuf-marshal.list
index db100651b..9e63f91c4 100644
--- a/gdk-pixbuf/gdk-pixbuf-marshal.list
+++ b/gdk-pixbuf/gdk-pixbuf-marshal.list
@@ -25,3 +25,4 @@
VOID:VOID
VOID:INT,INT,INT,INT
VOID:POINTER
+VOID:INT,INT
diff --git a/gdk-pixbuf/io-bmp.c b/gdk-pixbuf/io-bmp.c
index 8b0e3c07d..83df835f3 100644
--- a/gdk-pixbuf/io-bmp.c
+++ b/gdk-pixbuf/io-bmp.c
@@ -181,7 +181,8 @@ struct bmp_progressive_state {
};
static gpointer
-gdk_pixbuf__bmp_image_begin_load(ModulePreparedNotifyFunc prepared_func,
+gdk_pixbuf__bmp_image_begin_load(ModuleSizeFunc size_func,
+ ModulePreparedNotifyFunc prepared_func,
ModuleUpdatedNotifyFunc updated_func,
gpointer user_data,
GError **error);
@@ -205,7 +206,7 @@ static GdkPixbuf *gdk_pixbuf__bmp_image_load(FILE * f, GError **error)
GdkPixbuf *pb;
State =
- gdk_pixbuf__bmp_image_begin_load(NULL, NULL, NULL,
+ gdk_pixbuf__bmp_image_begin_load(NULL, NULL, NULL, NULL,
error);
if (State == NULL)
@@ -512,7 +513,8 @@ decode_bitmasks (guchar *buf,
*/
static gpointer
-gdk_pixbuf__bmp_image_begin_load(ModulePreparedNotifyFunc prepared_func,
+gdk_pixbuf__bmp_image_begin_load(ModuleSizeFunc size_func,
+ ModulePreparedNotifyFunc prepared_func,
ModuleUpdatedNotifyFunc updated_func,
gpointer user_data,
GError **error)
diff --git a/gdk-pixbuf/io-gif.c b/gdk-pixbuf/io-gif.c
index 09c843e84..b85e2ea95 100644
--- a/gdk-pixbuf/io-gif.c
+++ b/gdk-pixbuf/io-gif.c
@@ -1396,7 +1396,8 @@ gdk_pixbuf__gif_image_load (FILE *file, GError **error)
}
static gpointer
-gdk_pixbuf__gif_image_begin_load (ModulePreparedNotifyFunc prepare_func,
+gdk_pixbuf__gif_image_begin_load (ModuleSizeFunc size_func,
+ ModulePreparedNotifyFunc prepare_func,
ModuleUpdatedNotifyFunc update_func,
gpointer user_data,
GError **error)
diff --git a/gdk-pixbuf/io-ico.c b/gdk-pixbuf/io-ico.c
index bac4d8e90..1a1de441e 100644
--- a/gdk-pixbuf/io-ico.c
+++ b/gdk-pixbuf/io-ico.c
@@ -158,7 +158,8 @@ struct ico_progressive_state {
};
static gpointer
-gdk_pixbuf__ico_image_begin_load(ModulePreparedNotifyFunc prepared_func,
+gdk_pixbuf__ico_image_begin_load(ModuleSizeFunc size_func,
+ ModulePreparedNotifyFunc prepared_func,
ModuleUpdatedNotifyFunc updated_func,
gpointer user_data,
GError **error);
@@ -193,7 +194,7 @@ gdk_pixbuf__ico_image_load(FILE * f, GError **error)
GdkPixbuf *pb;
- State = gdk_pixbuf__ico_image_begin_load(NULL, NULL, NULL, error);
+ State = gdk_pixbuf__ico_image_begin_load(NULL, NULL, NULL, NULL, error);
if (State == NULL)
return NULL;
@@ -478,7 +479,8 @@ static void DecodeHeader(guchar *Data, gint Bytes,
*/
static gpointer
-gdk_pixbuf__ico_image_begin_load(ModulePreparedNotifyFunc prepared_func,
+gdk_pixbuf__ico_image_begin_load(ModuleSizeFunc size_func,
+ ModulePreparedNotifyFunc prepared_func,
ModuleUpdatedNotifyFunc updated_func,
gpointer user_data,
GError **error)
diff --git a/gdk-pixbuf/io-jpeg.c b/gdk-pixbuf/io-jpeg.c
index 0081402e8..964109942 100644
--- a/gdk-pixbuf/io-jpeg.c
+++ b/gdk-pixbuf/io-jpeg.c
@@ -1,3 +1,4 @@
+/* -*- mode: C; c-file-style: "linux" -*- */
/* GdkPixbuf library - JPEG image loader
*
* Copyright (C) 1999 Michael Zucchi
@@ -50,7 +51,7 @@ typedef struct {
JOCTET buffer[JPEG_PROG_BUF_SIZE]; /* start of buffer */
long skip_next; /* number of bytes to skip next read */
-
+
} my_source_mgr;
typedef my_source_mgr * my_src_ptr;
@@ -64,6 +65,7 @@ struct error_handler_data {
/* progressive loader context */
typedef struct {
+ ModuleSizeFunc size_func;
ModuleUpdatedNotifyFunc updated_func;
ModulePreparedNotifyFunc prepared_func;
gpointer user_data;
@@ -80,7 +82,8 @@ typedef struct {
} JpegProgContext;
static GdkPixbuf *gdk_pixbuf__jpeg_image_load (FILE *f, GError **error);
-static gpointer gdk_pixbuf__jpeg_image_begin_load (ModulePreparedNotifyFunc func,
+static gpointer gdk_pixbuf__jpeg_image_begin_load (ModuleSizeFunc func0,
+ ModulePreparedNotifyFunc func1,
ModuleUpdatedNotifyFunc func2,
gpointer user_data,
GError **error);
@@ -140,7 +143,7 @@ explode_gray_into_buf (struct jpeg_decompress_struct *cinfo,
/* Expand grey->colour. Expand from the end of the
* memory down, so we can use the same buffer.
*/
- w = cinfo->image_width;
+ w = cinfo->output_width;
for (i = cinfo->rec_outbuf_height - 1; i >= 0; i--) {
guchar *from, *to;
@@ -171,7 +174,7 @@ convert_cmyk_to_rgb (struct jpeg_decompress_struct *cinfo,
guchar *p;
p = lines[i];
- for (j = 0; j < cinfo->image_width; j++) {
+ for (j = 0; j < cinfo->output_width; j++) {
int c, m, y, k;
c = p[0];
m = p[1];
@@ -446,8 +449,9 @@ skip_input_data (j_decompress_ptr cinfo, long num_bytes)
*/
gpointer
-gdk_pixbuf__jpeg_image_begin_load (ModulePreparedNotifyFunc prepared_func,
- ModuleUpdatedNotifyFunc updated_func,
+gdk_pixbuf__jpeg_image_begin_load (ModuleSizeFunc size_func,
+ ModulePreparedNotifyFunc prepared_func,
+ ModuleUpdatedNotifyFunc updated_func,
gpointer user_data,
GError **error)
{
@@ -455,6 +459,7 @@ gdk_pixbuf__jpeg_image_begin_load (ModulePreparedNotifyFunc prepared_func,
my_source_mgr *src;
context = g_new0 (JpegProgContext, 1);
+ context->size_func = size_func;
context->prepared_func = prepared_func;
context->updated_func = updated_func;
context->user_data = user_data;
@@ -469,11 +474,11 @@ gdk_pixbuf__jpeg_image_begin_load (ModulePreparedNotifyFunc prepared_func,
context->cinfo.src = (struct jpeg_source_mgr *) g_try_malloc (sizeof (my_source_mgr));
if (!context->cinfo.src) {
- g_set_error (error,
- GDK_PIXBUF_ERROR,
- GDK_PIXBUF_ERROR_INSUFFICIENT_MEMORY,
- _("Couldn't allocate memory for loading JPEG file"));
- return NULL;
+ g_set_error (error,
+ GDK_PIXBUF_ERROR,
+ GDK_PIXBUF_ERROR_INSUFFICIENT_MEMORY,
+ _("Couldn't allocate memory for loading JPEG file"));
+ return NULL;
}
memset (context->cinfo.src, 0, sizeof (my_source_mgr));
@@ -509,14 +514,14 @@ gdk_pixbuf__jpeg_image_stop_load (gpointer data, GError **error)
JpegProgContext *context = (JpegProgContext *) data;
g_return_val_if_fail (context != NULL, TRUE);
-
+
/* FIXME this thing needs to report errors if
* we have unused image data
*/
if (context->pixbuf)
g_object_unref (context->pixbuf);
-
+
/* if we have an error? */
if (sigsetjmp (context->jerr.setjmp_buffer, 1)) {
jpeg_destroy_decompress (&context->cinfo);
@@ -559,6 +564,7 @@ gdk_pixbuf__jpeg_image_load_increment (gpointer data,
guint spinguard;
gboolean first;
const guchar *bufhd;
+ gint width, height;
g_return_val_if_fail (context != NULL, FALSE);
g_return_val_if_fail (buf != NULL, FALSE);
@@ -569,10 +575,6 @@ gdk_pixbuf__jpeg_image_load_increment (gpointer data,
context->jerr.error = error;
- /* XXXXXXX (drmike) - loop(s) below need to be recoded now I
- * have a grasp of what the flow needs to be!
- */
-
/* check for fatal error */
if (sigsetjmp (context->jerr.setjmp_buffer, 1)) {
return FALSE;
@@ -636,29 +638,32 @@ gdk_pixbuf__jpeg_image_load_increment (gpointer data,
/* try to load jpeg header */
if (!context->got_header) {
int rc;
-
+
rc = jpeg_read_header (cinfo, TRUE);
context->src_initialized = TRUE;
-
+
if (rc == JPEG_SUSPENDED)
continue;
-
+
context->got_header = TRUE;
-
- } else if (!context->did_prescan) {
- int rc;
- /* start decompression */
- cinfo->buffered_image = TRUE;
- rc = jpeg_start_decompress (cinfo);
- cinfo->do_fancy_upsampling = FALSE;
- cinfo->do_block_smoothing = FALSE;
-
- context->pixbuf = gdk_pixbuf_new(GDK_COLORSPACE_RGB,
- cinfo->output_components == 4 ? TRUE : FALSE,
- 8,
- cinfo->image_width,
- cinfo->image_height);
+ width = cinfo->image_width;
+ height = cinfo->image_height;
+ (* context->size_func) (&width, &height, context->user_data);
+ for (cinfo->scale_denom = 2; cinfo->scale_denom <= 8; cinfo->scale_denom *= 2) {
+ jpeg_calc_output_dimensions (cinfo);
+ if (cinfo->output_width < width || cinfo->output_height < height) {
+ cinfo->scale_denom /= 2;
+ break;
+ }
+ }
+ jpeg_calc_output_dimensions (cinfo);
+
+ context->pixbuf = gdk_pixbuf_new (GDK_COLORSPACE_RGB,
+ cinfo->output_components == 4 ? TRUE : FALSE,
+ 8,
+ cinfo->output_width,
+ cinfo->output_height);
if (context->pixbuf == NULL) {
g_set_error (error,
@@ -667,16 +672,24 @@ gdk_pixbuf__jpeg_image_load_increment (gpointer data,
_("Couldn't allocate memory for loading JPEG file"));
return FALSE;
}
-
+
/* Use pixbuf buffer to store decompressed data */
context->dptr = context->pixbuf->pixels;
-
+
/* Notify the client that we are ready to go */
(* context->prepared_func) (context->pixbuf,
NULL,
context->user_data);
-
+ } else if (!context->did_prescan) {
+ int rc;
+
+ /* start decompression */
+ cinfo->buffered_image = TRUE;
+ rc = jpeg_start_decompress (cinfo);
+ cinfo->do_fancy_upsampling = FALSE;
+ cinfo->do_block_smoothing = FALSE;
+
if (rc == JPEG_SUSPENDED)
continue;
diff --git a/gdk-pixbuf/io-png.c b/gdk-pixbuf/io-png.c
index 9081096e7..dc886f832 100644
--- a/gdk-pixbuf/io-png.c
+++ b/gdk-pixbuf/io-png.c
@@ -386,7 +386,8 @@ struct _LoadContext {
};
static gpointer
-gdk_pixbuf__png_image_begin_load (ModulePreparedNotifyFunc prepare_func,
+gdk_pixbuf__png_image_begin_load (ModuleSizeFunc size_func,
+ ModulePreparedNotifyFunc prepare_func,
ModuleUpdatedNotifyFunc update_func,
gpointer user_data,
GError **error)
diff --git a/gdk-pixbuf/io-pnm.c b/gdk-pixbuf/io-pnm.c
index 797f93717..c13719146 100644
--- a/gdk-pixbuf/io-pnm.c
+++ b/gdk-pixbuf/io-pnm.c
@@ -81,7 +81,8 @@ typedef struct {
} PnmLoaderContext;
static GdkPixbuf *gdk_pixbuf__pnm_image_load (FILE *f, GError **error);
-static gpointer gdk_pixbuf__pnm_image_begin_load (ModulePreparedNotifyFunc func,
+static gpointer gdk_pixbuf__pnm_image_begin_load (ModuleSizeFunc size_func,
+ ModulePreparedNotifyFunc func,
ModuleUpdatedNotifyFunc func2,
gpointer user_data,
GError **error);
@@ -803,7 +804,8 @@ gdk_pixbuf__pnm_image_load (FILE *f, GError **error)
*/
static gpointer
-gdk_pixbuf__pnm_image_begin_load (ModulePreparedNotifyFunc prepared_func,
+gdk_pixbuf__pnm_image_begin_load (ModuleSizeFunc size_func,
+ ModulePreparedNotifyFunc prepared_func,
ModuleUpdatedNotifyFunc updated_func,
gpointer user_data,
GError **error)
diff --git a/gdk-pixbuf/io-ras.c b/gdk-pixbuf/io-ras.c
index cc39e6a28..32bc35abf 100644
--- a/gdk-pixbuf/io-ras.c
+++ b/gdk-pixbuf/io-ras.c
@@ -94,7 +94,8 @@ struct ras_progressive_state {
};
static gpointer
-gdk_pixbuf__ras_image_begin_load(ModulePreparedNotifyFunc prepared_func,
+gdk_pixbuf__ras_image_begin_load(ModuleSizeFunc size_func,
+ ModulePreparedNotifyFunc prepared_func,
ModuleUpdatedNotifyFunc updated_func,
gpointer user_data,
GError **error);
@@ -114,7 +115,7 @@ static GdkPixbuf *gdk_pixbuf__ras_image_load(FILE * f, GError **error)
GdkPixbuf *pb;
- State = gdk_pixbuf__ras_image_begin_load(NULL, NULL, NULL, error);
+ State = gdk_pixbuf__ras_image_begin_load(NULL, NULL, NULL, NULL, error);
membuf = g_malloc(4096);
@@ -251,7 +252,8 @@ static gboolean RAS2State(struct rasterfile *RAS,
*/
static gpointer
-gdk_pixbuf__ras_image_begin_load(ModulePreparedNotifyFunc prepared_func,
+gdk_pixbuf__ras_image_begin_load(ModuleSizeFunc size_func,
+ ModulePreparedNotifyFunc prepared_func,
ModuleUpdatedNotifyFunc updated_func,
gpointer user_data,
GError **error)
diff --git a/gdk-pixbuf/io-tga.c b/gdk-pixbuf/io-tga.c
index 87a7ea659..08259d832 100644
--- a/gdk-pixbuf/io-tga.c
+++ b/gdk-pixbuf/io-tga.c
@@ -801,7 +801,8 @@ static gboolean try_preload(TGAContext *ctx, GError **err)
return TRUE;
}
-static gpointer gdk_pixbuf__tga_begin_load(ModulePreparedNotifyFunc f1,
+static gpointer gdk_pixbuf__tga_begin_load(ModuleSizeFunc f0,
+ ModulePreparedNotifyFunc f1,
ModuleUpdatedNotifyFunc f2,
gpointer udata, GError **err)
{
diff --git a/gdk-pixbuf/io-tiff.c b/gdk-pixbuf/io-tiff.c
index deae12bd7..d37614764 100644
--- a/gdk-pixbuf/io-tiff.c
+++ b/gdk-pixbuf/io-tiff.c
@@ -361,7 +361,8 @@ gdk_pixbuf__tiff_image_load (FILE *f, GError **error)
/* Progressive loader */
static gpointer
-gdk_pixbuf__tiff_image_begin_load (ModulePreparedNotifyFunc prepare_func,
+gdk_pixbuf__tiff_image_begin_load (ModuleSizeFunc size_func,
+ ModulePreparedNotifyFunc prepare_func,
ModuleUpdatedNotifyFunc update_func,
gpointer user_data,
GError **error)
diff --git a/gdk-pixbuf/io-wbmp.c b/gdk-pixbuf/io-wbmp.c
index bfbfb4c36..14bb11536 100644
--- a/gdk-pixbuf/io-wbmp.c
+++ b/gdk-pixbuf/io-wbmp.c
@@ -63,7 +63,8 @@ struct wbmp_progressive_state {
};
static gpointer
-gdk_pixbuf__wbmp_image_begin_load(ModulePreparedNotifyFunc prepared_func,
+gdk_pixbuf__wbmp_image_begin_load(ModuleSizeFunc size_func,
+ ModulePreparedNotifyFunc prepared_func,
ModuleUpdatedNotifyFunc updated_func,
gpointer user_data,
GError **error);
@@ -85,7 +86,7 @@ static GdkPixbuf *gdk_pixbuf__wbmp_image_load(FILE * f, GError **error)
GdkPixbuf *pb;
- State = gdk_pixbuf__wbmp_image_begin_load(NULL, NULL, NULL,
+ State = gdk_pixbuf__wbmp_image_begin_load(NULL, NULL, NULL, NULL,
error);
if (State == NULL)
@@ -116,7 +117,8 @@ static GdkPixbuf *gdk_pixbuf__wbmp_image_load(FILE * f, GError **error)
*/
static gpointer
-gdk_pixbuf__wbmp_image_begin_load(ModulePreparedNotifyFunc prepared_func,
+gdk_pixbuf__wbmp_image_begin_load(ModuleSizeFunc size_func,
+ ModulePreparedNotifyFunc prepared_func,
ModuleUpdatedNotifyFunc updated_func,
gpointer user_data,
GError **error)
diff --git a/gdk-pixbuf/io-xbm.c b/gdk-pixbuf/io-xbm.c
index 3ef06bb2a..71e6e4039 100644
--- a/gdk-pixbuf/io-xbm.c
+++ b/gdk-pixbuf/io-xbm.c
@@ -353,7 +353,8 @@ gdk_pixbuf__xbm_image_load (FILE *f, GError **error)
*/
static gpointer
-gdk_pixbuf__xbm_image_begin_load (ModulePreparedNotifyFunc prepare_func,
+gdk_pixbuf__xbm_image_begin_load (ModuleSizeFunc size_func,
+ ModulePreparedNotifyFunc prepare_func,
ModuleUpdatedNotifyFunc update_func,
gpointer user_data,
GError **error)
diff --git a/gdk-pixbuf/io-xpm.c b/gdk-pixbuf/io-xpm.c
index 6f4776676..ee9d44e38 100644
--- a/gdk-pixbuf/io-xpm.c
+++ b/gdk-pixbuf/io-xpm.c
@@ -1416,7 +1416,8 @@ struct _XPMContext
* in the future.
*/
static gpointer
-gdk_pixbuf__xpm_image_begin_load (ModulePreparedNotifyFunc prepare_func,
+gdk_pixbuf__xpm_image_begin_load (ModuleSizeFunc size_func,
+ ModulePreparedNotifyFunc prepare_func,
ModuleUpdatedNotifyFunc update_func,
gpointer user_data,
GError **error)