summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonathan Blandford <jrb@redhat.com>1999-11-10 21:06:40 +0000
committerJonathan Blandford <jrb@src.gnome.org>1999-11-10 21:06:40 +0000
commit19b42c342f9e227d09ae7a6a6706c5e3e141856e (patch)
treee1568599ea52661580137d7e1b3f89bd34efbbf9
parent16aa7c4316ef4b964c314a37dc0815d0a52db04f (diff)
downloadgtk+-19b42c342f9e227d09ae7a6a6706c5e3e141856e.tar.gz
emit the closed signal.
1999-11-10 Jonathan Blandford <jrb@redhat.com> * src/gdk-pixbuf-loader.c (gdk_pixbuf_loader_close): emit the closed signal.
-rw-r--r--gdk-pixbuf/ChangeLog3
-rw-r--r--gdk-pixbuf/gdk-pixbuf-loader.c7
-rw-r--r--gdk-pixbuf/io-gif.c38
-rw-r--r--gtk/gdk-pixbuf-loader.c7
4 files changed, 44 insertions, 11 deletions
diff --git a/gdk-pixbuf/ChangeLog b/gdk-pixbuf/ChangeLog
index 89733b2212..e7a9ecde8f 100644
--- a/gdk-pixbuf/ChangeLog
+++ b/gdk-pixbuf/ChangeLog
@@ -1,5 +1,8 @@
1999-11-10 Jonathan Blandford <jrb@redhat.com>
+ * src/gdk-pixbuf-loader.c (gdk_pixbuf_loader_close): emit the
+ closed signal.
+
* src/io-ras.c (OneLineMapped_file): Now can handle indexing
correctly. Patch from Arjan to do so.
diff --git a/gdk-pixbuf/gdk-pixbuf-loader.c b/gdk-pixbuf/gdk-pixbuf-loader.c
index 73093c6cf0..627d8dcd71 100644
--- a/gdk-pixbuf/gdk-pixbuf-loader.c
+++ b/gdk-pixbuf/gdk-pixbuf-loader.c
@@ -403,4 +403,11 @@ gdk_pixbuf_loader_close (GdkPixbufLoader *loader)
(* priv->image_module->stop_load) (priv->context);
priv->closed = TRUE;
+
+ gtk_signal_emit (GTK_OBJECT (loader),
+ pixbuf_loader_signals[CLOSED],
+ 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)));
}
diff --git a/gdk-pixbuf/io-gif.c b/gdk-pixbuf/io-gif.c
index f1dcc6e902..005bb907f0 100644
--- a/gdk-pixbuf/io-gif.c
+++ b/gdk-pixbuf/io-gif.c
@@ -99,6 +99,9 @@ typedef struct _Gif89 Gif89;
struct _Gif89
{
int transparent;
+ int delay_time;
+ int input_flag;
+ int disposal;
};
typedef struct _GifContext GifContext;
@@ -108,6 +111,7 @@ struct _GifContext
unsigned int width;
unsigned int height;
CMap color_map;
+ CMap frame_color_map;
unsigned int bit_pixel;
unsigned int color_resolution;
unsigned int background;
@@ -1002,6 +1006,26 @@ gif_main_loop (GifContext *context)
return retval;
}
+static GifContext *
+new_context (void)
+{
+ GifContext *context;
+
+ context = g_new (GifContext, 1);
+ context->pixbuf = NULL;
+ context->file = NULL;
+ context->state = GIF_START;
+ context->prepare_func = NULL;
+ context->update_func = NULL;
+ context->user_data = NULL;
+ context->buf = NULL;
+ context->amount_needed = 0;
+ context->gif89.transparent = -1;
+ context->gif89.delay_time = -1;
+ context->gif89.input_flag = -1;
+ context->gif89.disposal = -1;
+ return context;
+}
/* Shared library entry point */
GdkPixbuf *
image_load (FILE *file)
@@ -1010,12 +1034,8 @@ image_load (FILE *file)
g_return_val_if_fail (file != NULL, NULL);
- context = g_new (GifContext, 1);
+ context = new_context ();
context->file = file;
- context->pixbuf = NULL;
- context->state = GIF_START;
- context->prepare_func = NULL;
- context->update_func = NULL;
gif_main_loop (context);
@@ -1032,15 +1052,11 @@ image_begin_load (ModulePreparedNotifyFunc prepare_func,
#ifdef IO_GIFDEBUG
count = 0;
#endif
- context = g_new (GifContext, 1);
+ context = new_context ();
context->prepare_func = prepare_func;
context->update_func = update_func;
context->user_data = user_data;
- context->file = NULL;
- context->pixbuf = NULL;
- context->state = GIF_START;
- context->buf = NULL;
- context->amount_needed = 0;
+
return (gpointer) context;
}
diff --git a/gtk/gdk-pixbuf-loader.c b/gtk/gdk-pixbuf-loader.c
index 73093c6cf0..627d8dcd71 100644
--- a/gtk/gdk-pixbuf-loader.c
+++ b/gtk/gdk-pixbuf-loader.c
@@ -403,4 +403,11 @@ gdk_pixbuf_loader_close (GdkPixbufLoader *loader)
(* priv->image_module->stop_load) (priv->context);
priv->closed = TRUE;
+
+ gtk_signal_emit (GTK_OBJECT (loader),
+ pixbuf_loader_signals[CLOSED],
+ 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)));
}