diff options
author | Federico Mena Quintero <federico@redhat.com> | 1999-10-20 21:20:49 +0000 |
---|---|---|
committer | Arturo Espinosa <unammx@src.gnome.org> | 1999-10-20 21:20:49 +0000 |
commit | 7ef5dec32dac9e31f745b4e05deb8ee6fa10350c (patch) | |
tree | 8dfa010c18dfbb4d457d812cc266d572ac2e136c /demos | |
parent | 46da5c2bec71558218f654e26b70200993ecbbe4 (diff) | |
download | gtk+-7ef5dec32dac9e31f745b4e05deb8ee6fa10350c.tar.gz |
Removed the unref_fn field. Now all memory management of the buffer is
1999-10-20 Federico Mena Quintero <federico@redhat.com>
* src/gdk-pixbuf.h (GdkPixbuf): Removed the unref_fn field. Now
all memory management of the buffer is done by libart.
* src/gdk-pixbuf.c (gdk_pixbuf_unref): Do destruction here.
Removed gdk_pixbuf_destroy, gdk_pixbuf_duplicate.
* src/gdk-pixbuf-data.c (gdk_pixbuf_new_from_data): Implemented in
terms of the libart functions. Removed the old code.
* src/gdk-pixbuf-io.c (image_handler_load): Removed the save
symbols. Saving will not be implemented in GdkPixbuf.
* src/io-gif.c: Removed the saving stub.
(image_load): Fixed memory management to fail gracefully if we run
out of memory while loading the image. Close the gif file when we
are done. This still needs more error handling for the DGif
functions.
* src/io-jpeg.c (image_load): Some robustness fixes.
* src/io-png.c: Removed the saving stuff.
(image_load): Some memory management fixes.
* src/io-tiff.c (image_load): Ditto.
* src/io-xpm.c (pixbuf_create_from_xpm): Ditto.
Diffstat (limited to 'demos')
-rw-r--r-- | demos/testpixbuf.c | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/demos/testpixbuf.c b/demos/testpixbuf.c index e9b984ea16..96c20bd63e 100644 --- a/demos/testpixbuf.c +++ b/demos/testpixbuf.c @@ -185,7 +185,6 @@ static void expose_func (GtkWidget *drawing_area, GdkEventExpose *event, gpointer data) { GdkPixbuf *pixbuf; - gint x1, y1, x2, y2; pixbuf = (GdkPixbuf *)gtk_object_get_data(GTK_OBJECT(drawing_area), "pixbuf"); @@ -217,16 +216,17 @@ expose_func (GtkWidget *drawing_area, GdkEventExpose *event, gpointer data) static void config_func (GtkWidget *drawing_area, GdkEventConfigure *event, gpointer data) { - GdkPixbuf *pixbuf, *spb; + GdkPixbuf *pixbuf; pixbuf = (GdkPixbuf *)gtk_object_get_data(GTK_OBJECT(drawing_area), "pixbuf"); g_print("X:%d Y:%d\n", event->width, event->height); +#if 0 if (((event->width) != (pixbuf->art_pixbuf->width)) || ((event->height) != (pixbuf->art_pixbuf->height))) gdk_pixbuf_scale(pixbuf, event->width, event->height); - +#endif } static void @@ -299,18 +299,18 @@ main (int argc, char **argv) i = 1; if (argc == 1) { - pixbuf = gdk_pixbuf_load_image_from_rgb_d(default_image, - DEFAULT_WIDTH, - DEFAULT_HEIGHT); - if (pixbuf) { - new_testrgb_window (pixbuf); - found_valid = TRUE; - } + pixbuf = gdk_pixbuf_new_from_data ((guchar *) default_image, ART_PIX_RGB, FALSE, + DEFAULT_WIDTH, DEFAULT_HEIGHT, DEFAULT_WIDTH * 3, + NULL, NULL); + new_testrgb_window (pixbuf); + found_valid = TRUE; } else { for (i = 1; i < argc; i++) { - pixbuf = gdk_pixbuf_load_image (argv[i]); + pixbuf = gdk_pixbuf_new_from_file (argv[i]); +#if 0 pixbuf = gdk_pixbuf_rotate(pixbuf, 10.0); - +#endif + if (pixbuf) { new_testrgb_window (pixbuf); found_valid = TRUE; |