summaryrefslogtreecommitdiff
path: root/gdk-pixbuf/gdk-pixbuf-loader.c
diff options
context:
space:
mode:
authorJonathan Blandford <jrb@redhat.com>1999-11-04 18:18:07 +0000
committerJonathan Blandford <jrb@src.gnome.org>1999-11-04 18:18:07 +0000
commitd0ed72ee143dd9586ea42a937860c042bdd8fa74 (patch)
tree14f19ca39bb3bdd6c27817493e3f4fe9c25d650e /gdk-pixbuf/gdk-pixbuf-loader.c
parent567305020d37f24e192ffcec008e857a0da32e19 (diff)
downloadgtk+-d0ed72ee143dd9586ea42a937860c042bdd8fa74.tar.gz
handle the actual update. add a update_func callback. add a update_func
1999-11-04 Jonathan Blandford <jrb@redhat.com> * src/gdk-pixbuf-loader.c (gdk_pixbuf_loader_update): handle the actual update. * src/io-png.c (image_begin_load): add a update_func callback. * src/io-gif.c (image_begin_load): add a update_func callback. * src/io-tiff.c (image_begin_load): add a update_func callback.
Diffstat (limited to 'gdk-pixbuf/gdk-pixbuf-loader.c')
-rw-r--r--gdk-pixbuf/gdk-pixbuf-loader.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/gdk-pixbuf/gdk-pixbuf-loader.c b/gdk-pixbuf/gdk-pixbuf-loader.c
index c62d325f89..eecc8a605f 100644
--- a/gdk-pixbuf/gdk-pixbuf-loader.c
+++ b/gdk-pixbuf/gdk-pixbuf-loader.c
@@ -219,6 +219,21 @@ gdk_pixbuf_loader_prepare (GdkPixbuf *pixbuf, gpointer loader)
gtk_signal_emit (GTK_OBJECT (loader), pixbuf_loader_signals[AREA_PREPARED]);
}
+static void
+gdk_pixbuf_loader_update (GdkPixbuf *pixbuf, gpointer loader, guint x, guint y, guint width, guint height)
+{
+ GdkPixbufLoaderPrivate *priv = NULL;
+
+ priv = GDK_PIXBUF_LOADER (loader)->private;
+
+ gtk_signal_emit (GTK_OBJECT (loader),
+ pixbuf_loader_signals[AREA_UPDATED],
+ x, y,
+ /* sanity check in here. Defend against an errant loader */
+ MIN (width, gdk_pixbuf_get_width (priv->pixbuf)),
+ MIN (height, gdk_pixbuf_get_height (priv->pixbuf)));
+}
+
/**
@@ -259,7 +274,7 @@ gdk_pixbuf_loader_load_module(GdkPixbufLoader *loader)
return 0;
}
- priv->context = (*priv->image_module->begin_load) (gdk_pixbuf_loader_prepare, loader);
+ priv->context = (*priv->image_module->begin_load) (gdk_pixbuf_loader_prepare, gdk_pixbuf_loader_update, loader);
if (priv->context == NULL) {
g_warning("Failed to begin progressive load");