changeset 279:984db8aefd7f

Build fixes for GTK.
author bsmith@81767d24-ef19-dc11-ae90-00e081727c95
date Fri, 14 Mar 2003 18:09:56 +0000
parents df0665ba147f
children 030188d45a69
files dw.h gtk/dw.c
diffstat 2 files changed, 3 insertions(+), 59 deletions(-) [+]
line wrap: on
line diff
--- a/dw.h	Fri Mar 14 18:03:35 2003 +0000
+++ b/dw.h	Fri Mar 14 18:09:56 2003 +0000
@@ -712,7 +712,7 @@
 HWND API dw_mdi_new(unsigned long id);
 HWND API dw_bitmap_new(unsigned long id);
 HWND API dw_bitmapbutton_new(char *text, unsigned long id);
-HWND API dw_bitmapbutton_new_from_file(char *text, unsigned long id, char filename);
+HWND API dw_bitmapbutton_new_from_file(char *text, unsigned long id, char *filename);
 HWND API dw_container_new(unsigned long id);
 HWND API dw_tree_new(unsigned long id);
 HWND API dw_text_new(char *text, unsigned long id);
--- a/gtk/dw.c	Fri Mar 14 18:03:35 2003 +0000
+++ b/gtk/dw.c	Fri Mar 14 18:09:56 2003 +0000
@@ -2366,7 +2366,7 @@
  *                 DW pick the appropriate file extension.
  *                 (BMP on OS/2 or Windows, XPM on Unix)
  */
-HWND dw_bitmapbutton_new_from_file(char *text, unsigned long id, char filename)
+HWND dw_bitmapbutton_new_from_file(char *text, unsigned long id, char *filename)
 {
 	GtkWidget *tmp;
 	GtkWidget *bitmap;
@@ -2583,62 +2583,6 @@
 	DW_MUTEX_UNLOCK;
 }
 
-HPIXMAP dw_pixmap_new_from_file(HWND handle, char *filename)
-{
-	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);
-
-	if (!file || !(pixmap = calloc(1,sizeof(struct _hpixmap))))
-		return NULL;
-
-	strcpy(file, filename);
-
-	/* check if we can read from this file (it exists and read permission) */
-	if(access(file, 04) != 0)
-	{
-		/* Try with .xpm extention */
-		strcat(file, ".xpm");
-		if(access(file, 04) != 0)
-		{
-			free(pixmap);
-			return NULL;
-		}
-	}
-
-	DW_MUTEX_LOCK;
-#if GTK_MAJOR_VERSION > 1
-	pixbuf = gdk_pixbuf_new_from_file(file, NULL);
-
-	pixmap->width = gdk_pixbuf_get_width(pixbuf);
-	pixmap->height = gdk_pixbuf_get_height(pixbuf);
-
-	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->width = image->rgb_width;
-	pixmap->height = image->rgb_height;
-
-	gdk_imlib_render(image, pixmap->width, pixmap->height);
-	pixmap->pixmap = gdk_imlib_copy_image(image);
-	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;
-	return pixmap;
-}
 /*
  * Sets the bitmap used for a given static window.
  * Parameters:
@@ -2686,7 +2630,7 @@
 			if(access(file, 04) != 0)
 			{
 				DW_MUTEX_UNLOCK;
-				return NULL;
+				return;
 			}
 		}
 #if GTK_MAJOR_VERSION > 1