comparison gtk/dw.c @ 1258:3df86772b625

Updated the list of supported image formats for GTK. This could be generated automatically by querying pixbuf loaders... However it does not take into account formats that support transparency. So for right now we keep using a static list... and include the most popular formats.
author bsmith@81767d24-ef19-dc11-ae90-00e081727c95
date Mon, 24 Oct 2011 08:30:53 +0000
parents 28c2c7e6671c
children 61d0c5f84644
comparison
equal deleted inserted replaced
1257:35b177e8a0a2 1258:3df86772b625
99 }; 99 };
100 100
101 /* 101 /*
102 * List those icons that have transparency first 102 * List those icons that have transparency first
103 */ 103 */
104 #define NUM_EXTS 5 104 #define NUM_EXTS 9
105 char *image_exts[NUM_EXTS] = 105 char *image_exts[NUM_EXTS] =
106 { 106 {
107 ".xpm", 107 ".xpm",
108 ".png", 108 ".png",
109 ".ico", 109 ".ico",
110 ".icns",
111 ".gif",
110 ".jpg", 112 ".jpg",
111 ".bmp", 113 ".jpeg",
114 ".tiff",
115 ".bmp"
112 }; 116 };
113 117
114 #ifndef max 118 #ifndef max
115 # define max(a,b) (((a) > (b)) ? (a) : (b)) 119 # define max(a,b) (((a) > (b)) ? (a) : (b))
116 #endif 120 #endif
4555 DW_MUTEX_LOCK; 4559 DW_MUTEX_LOCK;
4556 if(id) 4560 if(id)
4557 tmp = _find_pixmap(&bitmap, (HICN)id, handle, NULL, NULL); 4561 tmp = _find_pixmap(&bitmap, (HICN)id, handle, NULL, NULL);
4558 else 4562 else
4559 { 4563 {
4560 char *file = alloca(strlen(filename) + 5); 4564 char *file = alloca(strlen(filename) + 6);
4561 #if GTK_MAJOR_VERSION > 1 4565 #if GTK_MAJOR_VERSION > 1
4562 GdkPixbuf *pixbuf; 4566 GdkPixbuf *pixbuf;
4563 #elif defined(USE_IMLIB) 4567 #elif defined(USE_IMLIB)
4564 GdkImlibImage *image; 4568 GdkImlibImage *image;
4565 #endif 4569 #endif
6613 #if GTK_MAJOR_VERSION > 1 6617 #if GTK_MAJOR_VERSION > 1
6614 GdkPixbuf *pixbuf; 6618 GdkPixbuf *pixbuf;
6615 #elif defined(USE_IMLIB) 6619 #elif defined(USE_IMLIB)
6616 GdkImlibImage *image; 6620 GdkImlibImage *image;
6617 #endif 6621 #endif
6618 char *file = alloca(strlen(filename) + 5); 6622 char *file = alloca(strlen(filename) + 6);
6619 unsigned long z, ret = 0; 6623 unsigned long z, ret = 0;
6620 int found_ext = 0; 6624 int found_ext = 0;
6621 int i; 6625 int i;
6622 6626
6623 if (!file) 6627 if (!file)
8355 int _locked_by_me = FALSE; 8359 int _locked_by_me = FALSE;
8356 HPIXMAP pixmap; 8360 HPIXMAP pixmap;
8357 #ifdef USE_IMLIB 8361 #ifdef USE_IMLIB
8358 GdkImlibImage *image; 8362 GdkImlibImage *image;
8359 #endif 8363 #endif
8360 char *file = alloca(strlen(filename) + 5); 8364 char *file = alloca(strlen(filename) + 6);
8361 int found_ext = 0; 8365 int found_ext = 0;
8362 int i; 8366 int i;
8363 8367
8364 if (!file || !(pixmap = calloc(1,sizeof(struct _hpixmap)))) 8368 if (!file || !(pixmap = calloc(1,sizeof(struct _hpixmap))))
8365 return NULL; 8369 return NULL;