summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFederico Mena Quintero <federico@helixcode.com>2000-02-02 05:47:57 +0000
committerArturo Espinosa <unammx@src.gnome.org>2000-02-02 05:47:57 +0000
commit51a0dc303d8c414d86cb0316215192155c628482 (patch)
treebae392db1cc1df7f54a99f20dcc8bb7d7368d90e
parent4caf4dc7876e81648061b0f37e31fa0c6ddcc4e8 (diff)
downloadgtk+-51a0dc303d8c414d86cb0316215192155c628482.tar.gz
Removed debugging g_print. Thanks to John Sullivan <sullivan@eazel.com>
2000-02-02 Federico Mena Quintero <federico@helixcode.com> * gdk-pixbuf/io-gif.c (gif_get_lzw): Removed debugging g_print. Thanks to John Sullivan <sullivan@eazel.com> for the patch. * gdk-pixbuf/testpixbuf-drawable.c (configure_cb): Get a new area of the screen when the window is resized. Thanks to David N. Welton <davidw@linuxcare.com> for pointing this out. Misc. cleanups to the rest of the file.
-rw-r--r--demos/testpixbuf-drawable.c50
-rw-r--r--gdk-pixbuf/ChangeLog10
-rw-r--r--gdk-pixbuf/io-gif.c1
3 files changed, 38 insertions, 23 deletions
diff --git a/demos/testpixbuf-drawable.c b/demos/testpixbuf-drawable.c
index 22dab35e9e..a465aa4c82 100644
--- a/demos/testpixbuf-drawable.c
+++ b/demos/testpixbuf-drawable.c
@@ -3,19 +3,18 @@
#include <gdk/gdkx.h>
#include "gdk-pixbuf.h"
-void close_app(GtkWidget *widget, gpointer data)
+int close_app(GtkWidget *widget, gpointer data)
{
gtk_main_quit();
+ return TRUE;
}
-void expose_cb(GtkWidget *drawing_area, GdkEventExpose *evt, gpointer
-data)
+int expose_cb(GtkWidget *drawing_area, GdkEventExpose *evt, gpointer data)
{
GdkPixbuf *pixbuf;
pixbuf = (GdkPixbuf *) gtk_object_get_data(GTK_OBJECT(drawing_area),
"pixbuf");
-
if(pixbuf->art_pixbuf->has_alpha)
{
gdk_draw_rgb_32_image(drawing_area->window,
@@ -32,20 +31,20 @@ data)
else
{
gdk_draw_rgb_image(drawing_area->window,
- drawing_area->style->white_gc,
- evt->area.x, evt->area.y,
- evt->area.width,
- evt->area.height,
- GDK_RGB_DITHER_NORMAL,
- pixbuf->art_pixbuf->pixels +
- (evt->area.y * pixbuf->art_pixbuf->rowstride) +
- (evt->area.x * pixbuf->art_pixbuf->n_channels),
- pixbuf->art_pixbuf->rowstride);
+ drawing_area->style->black_gc,
+ evt->area.x, evt->area.y,
+ evt->area.width,
+ evt->area.height,
+ GDK_RGB_DITHER_NORMAL,
+ pixbuf->art_pixbuf->pixels +
+ (evt->area.y * pixbuf->art_pixbuf->rowstride) +
+ (evt->area.x * pixbuf->art_pixbuf->n_channels),
+ pixbuf->art_pixbuf->rowstride);
}
+ return FALSE;
}
-void configure_cb(GtkWidget *drawing_area, GdkEventConfigure *evt,
-gpointer data)
+int configure_cb(GtkWidget *drawing_area, GdkEventConfigure *evt, gpointer data)
{
GdkPixbuf *pixbuf;
@@ -53,11 +52,19 @@ gpointer data)
"pixbuf");
g_print("X:%d Y:%d\n", evt->width, evt->height);
-#if 0
- if(((evt->width) != (pixbuf->art_pixbuf->width)) ||
- ((evt->height) != (pixbuf->art_pixbuf->height)))
- gdk_pixbuf_scale(pixbuf, evt->width, evt->height);
-#endif
+ if(evt->width != pixbuf->art_pixbuf->width || evt->height != pixbuf->art_pixbuf->height)
+ {
+ GdkWindow *root;
+ GdkPixbuf *new_pixbuf;
+
+ root = GDK_ROOT_PARENT();
+ new_pixbuf = gdk_pixbuf_get_from_drawable(NULL, root, NULL,
+ 0, 0, 0, 0, evt->width, evt->height);
+ gtk_object_set_data(GTK_OBJECT(drawing_area), "pixbuf", new_pixbuf);
+ gdk_pixbuf_unref(pixbuf);
+ }
+
+ return FALSE;
}
int main(int argc, char **argv)
@@ -75,7 +82,7 @@ int main(int argc, char **argv)
gtk_widget_set_default_colormap(gdk_rgb_get_cmap());
gtk_widget_set_default_visual(gdk_rgb_get_visual());
- root = gdk_window_foreign_new(GDK_ROOT_WINDOW());
+ root = GDK_ROOT_PARENT();
pixbuf = gdk_pixbuf_get_from_drawable(NULL, root, NULL,
0, 0, 0, 0, 150, 160);
@@ -83,7 +90,6 @@ int main(int argc, char **argv)
gtk_signal_connect(GTK_OBJECT(window), "delete_event",
GTK_SIGNAL_FUNC(close_app), NULL);
gtk_signal_connect(GTK_OBJECT(window), "destroy",
-
GTK_SIGNAL_FUNC(close_app), NULL);
vbox = gtk_vbox_new(FALSE, 0);
diff --git a/gdk-pixbuf/ChangeLog b/gdk-pixbuf/ChangeLog
index 6bf3725f91..3f74782181 100644
--- a/gdk-pixbuf/ChangeLog
+++ b/gdk-pixbuf/ChangeLog
@@ -1,3 +1,13 @@
+2000-02-02 Federico Mena Quintero <federico@helixcode.com>
+
+ * gdk-pixbuf/io-gif.c (gif_get_lzw): Removed debugging g_print.
+ Thanks to John Sullivan <sullivan@eazel.com> for the patch.
+
+ * gdk-pixbuf/testpixbuf-drawable.c (configure_cb): Get a new area
+ of the screen when the window is resized. Thanks to David
+ N. Welton <davidw@linuxcare.com> for pointing this out.
+ Misc. cleanups to the rest of the file.
+
2000-02-01 Federico Mena Quintero <federico@helixcode.com>
* doc/tmpl/rendering.sgml: gnome_init() does not call
diff --git a/gdk-pixbuf/io-gif.c b/gdk-pixbuf/io-gif.c
index 77ed21263e..fede1baf62 100644
--- a/gdk-pixbuf/io-gif.c
+++ b/gdk-pixbuf/io-gif.c
@@ -664,7 +664,6 @@ gif_get_lzw (GifContext *context)
gint v;
if (context->pixbuf == NULL) {
- g_print ("making a new pixbuf\n");
context->pixbuf = gdk_pixbuf_new (ART_PIX_RGB,
context->gif89.transparent,
8,