changeset 244:68158098a092

Implemented dw_pixmap_new_from_file() for GTK 1.x with and without imlib.
author bsmith@81767d24-ef19-dc11-ae90-00e081727c95
date Wed, 19 Feb 2003 07:41:50 +0000
parents 3c1e39905f2f
children 11baf43efbc2
files gtk/dw.c
diffstat 1 files changed, 14 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/gtk/dw.c	Wed Feb 19 06:37:24 2003 +0000
+++ b/gtk/dw.c	Wed Feb 19 07:41:50 2003 +0000
@@ -5062,9 +5062,13 @@
 {
 	int _locked_by_me = FALSE;
 	HPIXMAP pixmap;
+#ifndef USE_IMLIB
 	GdkBitmap *bitmap = NULL;
+#endif
 #if GTK_MAJOR_VERSION > 1
 	GdkPixbuf *pixbuf;
+#elif defined(USE_IMLIB)
+	GdkImlibImage *image;
 #endif
 	char *file = alloca(strlen(filename) + 5);
 
@@ -5094,6 +5098,16 @@
 
 	gdk_pixbuf_render_pixmap_and_mask(pixbuf, &pixmap->pixmap, &bitmap, 1);
 	g_object_unref(pixbuf);
+#elif defined(USE_IMLIB)
+	image = gdk_imlib_load_image(file);
+	pixmap->pixmap = gdk_imlib_copy_image(image);
+
+	pixmap->width = image->rgb_width;
+	pixmap->height = image->rgb_height;
+
+	gdk_imlib_destroy_image(image);
+#else
+	pixmap->pixmap = gdk_pixmap_create_from_xpm(handle->window, &bitmap, &_colors[DW_CLR_PALEGRAY], file);
 #endif
 	pixmap->handle = handle;
 	DW_MUTEX_UNLOCK;