# HG changeset patch # User bsmith@81767d24-ef19-dc11-ae90-00e081727c95 # Date 1045640510 0 # Node ID 68158098a09241d502d82771c04ba3cc2b835219 # Parent 3c1e39905f2f09ad574d776cf0db36a888d0463f Implemented dw_pixmap_new_from_file() for GTK 1.x with and without imlib. diff -r 3c1e39905f2f -r 68158098a092 gtk/dw.c --- 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;