diff gtk3/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 3a2ffe3a7eae
children 61d0c5f84644
line wrap: on
line diff
--- a/gtk3/dw.c	Mon Oct 24 08:01:42 2011 +0000
+++ b/gtk3/dw.c	Mon Oct 24 08:30:53 2011 +0000
@@ -96,14 +96,18 @@
 /*
  * List those icons that have transparency first
  */
-#define NUM_EXTS 5
+#define NUM_EXTS 9
 char *image_exts[NUM_EXTS] =
 {
    ".xpm",
    ".png",
    ".ico",
+   ".icns",
+   ".gif",
    ".jpg",
-   ".bmp",
+   ".jpeg",
+   ".tiff",
+   ".bmp"
 };
 
 #ifndef max
@@ -4206,7 +4210,7 @@
       tmp = _find_pixbuf((HICN)id, NULL, NULL);
    else
    {
-      char *file = alloca(strlen(filename) + 5);
+      char *file = alloca(strlen(filename) + 6);
 
       if (!file)
       {
@@ -5624,7 +5628,7 @@
 HICN API dw_icon_load_from_file(char *filename)
 {
    int _locked_by_me = FALSE;
-   char *file = alloca(strlen(filename) + 5);
+   char *file = alloca(strlen(filename) + 6);
    int i, found_ext = 0;
    HICN ret = 0;
 
@@ -7127,7 +7131,7 @@
 {
    int _locked_by_me = FALSE;
    HPIXMAP pixmap;
-   char *file = alloca(strlen(filename) + 5);
+   char *file = alloca(strlen(filename) + 6);
    int found_ext = 0;
    int i;