diff options
author | Havoc Pennington <hp@redhat.com> | 2000-10-18 18:42:54 +0000 |
---|---|---|
committer | Havoc Pennington <hp@src.gnome.org> | 2000-10-18 18:42:54 +0000 |
commit | 7a4c68938789206bfec3c6d15cc4bb922daf6443 (patch) | |
tree | e5f031fc609e50a8b7b12e7d6abf63cc78cc88e7 /gdk-pixbuf/io-wbmp.c | |
parent | 7420908815651a1ff2ceb1c0fb5e92fe9b260619 (diff) | |
download | gtk+-7a4c68938789206bfec3c6d15cc4bb922daf6443.tar.gz |
Some updates
2000-10-18 Havoc Pennington <hp@redhat.com>
* gtk/gtk-sections.txt: Some updates
* gdk/gdk-sections.txt: remove GdkPixbufAlphaMode
* gdk-pixbuf/gdk-pixbuf-sections.txt: Add new API, remove
GdkPixbufClass/GdkAnimationClass since those are private
* gdk-pixbuf/Makefile.am (IGNORE_HFILES): ignore more headers
2000-10-18 Havoc Pennington <hp@redhat.com>
* gtk/gtktextiter.c (gtk_text_iter_forward_to_newline): Fix a bug
where any number of empty lines would get skipped
* gtk/gtktextiter.h: Remove padding from GtkTextIter; live on the
edge.
* gtk/gtktextiter.c (gtk_text_iter_make_surreal): enhance the
warning about invalid iterators (explain more thoroughly)
(gtk_text_iter_in_region): rename gtk_text_iter_in_range
* gtk/gtktextview.c (FOCUS_EDGE_WIDTH): Make focus rectangle less
big
* demos/*.c: Add error handling
* gtk/gtktextbuffer.c: don't modify const iterators
* gtk/gdk-pixbuf-loader.c: Add full error handling here
* gtk/gtkimage.c (gtk_image_set_from_file): ignore errors
on file load
* gtk/gtkiconfactory.c: Update to reflect addition of error
handling to gdk-pixbuf loaders
2000-10-16 Havoc Pennington <hp@redhat.com>
* gdk-pixbuf-io.c (gdk_pixbuf_get_module)
(gdk_pixbuf_get_named_module) (gdk_pixbuf_load_module):
add error reporting here also
* make-inline-pixbuf.c (main): use GError
* io-xpm.c: include unistd.h
* gdk-pixbuf-util.c: include string.h
* io-*.c: add error reporting
* gdk-pixbuf-animation.c (gdk_pixbuf_animation_new_from_file): add
error reporting
* gdk-pixbuf-io.c (gdk_pixbuf_new_from_file): Add error reporting
* gdk-pixbuf-io.h: Add GError** to load_increment and load
methods
* gdk-pixbuf-io.c (gdk_pixbuf_save) (gdk_pixbuf_savev): return
a G_FILE_ERROR if we fail to write or close the file.
* gdk-pixbuf.h: remove GDK_PIXBUF_ERROR_IO, instead we'll use
G_FILE_ERROR_*. Rename enum to GdkPixbufError, properly following
the GError naming rules. Add GError** to load functions.
Diffstat (limited to 'gdk-pixbuf/io-wbmp.c')
-rw-r--r-- | gdk-pixbuf/io-wbmp.c | 28 |
1 files changed, 18 insertions, 10 deletions
diff --git a/gdk-pixbuf/io-wbmp.c b/gdk-pixbuf/io-wbmp.c index f8411ae269..bbca3e1a17 100644 --- a/gdk-pixbuf/io-wbmp.c +++ b/gdk-pixbuf/io-wbmp.c @@ -67,16 +67,18 @@ gdk_pixbuf__wbmp_image_begin_load(ModulePreparedNotifyFunc prepared_func, ModuleUpdatedNotifyFunc updated_func, ModuleFrameDoneNotifyFunc frame_done_func, ModuleAnimationDoneNotifyFunc - anim_done_func, gpointer user_data); + anim_done_func, gpointer user_data, + GError **error); void gdk_pixbuf__wbmp_image_stop_load(gpointer data); gboolean gdk_pixbuf__wbmp_image_load_increment(gpointer data, guchar * buf, - guint size); + guint size, + GError **error); /* Shared library entry point --> This should be removed when generic_image_load enters gdk-pixbuf-io. */ -GdkPixbuf *gdk_pixbuf__wbmp_image_load(FILE * f) +GdkPixbuf *gdk_pixbuf__wbmp_image_load(FILE * f, GError **error) { size_t length; char membuf[4096]; @@ -84,14 +86,19 @@ GdkPixbuf *gdk_pixbuf__wbmp_image_load(FILE * f) GdkPixbuf *pb; - State = gdk_pixbuf__wbmp_image_begin_load(NULL, NULL, NULL, NULL, NULL); + State = gdk_pixbuf__wbmp_image_begin_load(NULL, NULL, NULL, NULL, NULL, + error); + if (State == NULL) + return NULL; + while (feof(f) == 0) { length = fread(membuf, 1, 4096, f); if (length > 0) gdk_pixbuf__wbmp_image_load_increment(State, membuf, - length); + length, + error); } if (State->pixbuf != NULL) @@ -111,10 +118,11 @@ GdkPixbuf *gdk_pixbuf__wbmp_image_load(FILE * f) gpointer gdk_pixbuf__wbmp_image_begin_load(ModulePreparedNotifyFunc prepared_func, - ModuleUpdatedNotifyFunc updated_func, - ModuleFrameDoneNotifyFunc frame_done_func, - ModuleAnimationDoneNotifyFunc - anim_done_func, gpointer user_data) + ModuleUpdatedNotifyFunc updated_func, + ModuleFrameDoneNotifyFunc frame_done_func, + ModuleAnimationDoneNotifyFunc + anim_done_func, gpointer user_data, + GError **error) { struct wbmp_progressive_state *context; @@ -221,7 +229,7 @@ get_mbi(struct wbmp_progressive_state *context, guchar **buf, guint *buf_size, i * append image data onto inrecrementally built output image */ gboolean gdk_pixbuf__wbmp_image_load_increment(gpointer data, guchar * buf, - guint size) + guint size, GError **error) { struct wbmp_progressive_state *context = (struct wbmp_progressive_state *) data; |