From 98987464d58890b803af45dc7accdc631148a58a Mon Sep 17 00:00:00 2001 From: Tor Lillqvist Date: Sun, 15 Aug 2004 15:05:46 +0000 Subject: [PATCH] Fix typo. The gtk.immodules file had never been included in my 2004-08-15 Tor Lillqvist * gtk-zip.sh.in: Fix typo. The gtk.immodules file had never been included in my zipfiles...! * gtk/gtkfilesystemwin32.c (extract_icon): Improve handling of icon alpha channel (on Windows XP) and mask (older Windows versions). (#148641, Tim Evans) --- ChangeLog | 9 +++++++ ChangeLog.pre-2-10 | 9 +++++++ ChangeLog.pre-2-6 | 9 +++++++ ChangeLog.pre-2-8 | 9 +++++++ gtk-zip.sh.in | 2 +- gtk/gtkfilesystemwin32.c | 52 ++++++++++++++++++++++------------------ 6 files changed, 66 insertions(+), 24 deletions(-) diff --git a/ChangeLog b/ChangeLog index 13662d8819..8552f8cf22 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2004-08-15 Tor Lillqvist + + * gtk-zip.sh.in: Fix typo. The gtk.immodules file had never been + included in my zipfiles...! + + * gtk/gtkfilesystemwin32.c (extract_icon): Improve handling of + icon alpha channel (on Windows XP) and mask (older Windows + versions). (#148641, Tim Evans) + Sun Aug 15 02:31:55 2004 Matthias Clasen * gtk/gtkfilesystemunix.c (get_icon_type_from_stat): Make diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index 13662d8819..8552f8cf22 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,12 @@ +2004-08-15 Tor Lillqvist + + * gtk-zip.sh.in: Fix typo. The gtk.immodules file had never been + included in my zipfiles...! + + * gtk/gtkfilesystemwin32.c (extract_icon): Improve handling of + icon alpha channel (on Windows XP) and mask (older Windows + versions). (#148641, Tim Evans) + Sun Aug 15 02:31:55 2004 Matthias Clasen * gtk/gtkfilesystemunix.c (get_icon_type_from_stat): Make diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6 index 13662d8819..8552f8cf22 100644 --- a/ChangeLog.pre-2-6 +++ b/ChangeLog.pre-2-6 @@ -1,3 +1,12 @@ +2004-08-15 Tor Lillqvist + + * gtk-zip.sh.in: Fix typo. The gtk.immodules file had never been + included in my zipfiles...! + + * gtk/gtkfilesystemwin32.c (extract_icon): Improve handling of + icon alpha channel (on Windows XP) and mask (older Windows + versions). (#148641, Tim Evans) + Sun Aug 15 02:31:55 2004 Matthias Clasen * gtk/gtkfilesystemunix.c (get_icon_type_from_stat): Make diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index 13662d8819..8552f8cf22 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,3 +1,12 @@ +2004-08-15 Tor Lillqvist + + * gtk-zip.sh.in: Fix typo. The gtk.immodules file had never been + included in my zipfiles...! + + * gtk/gtkfilesystemwin32.c (extract_icon): Improve handling of + icon alpha channel (on Windows XP) and mask (older Windows + versions). (#148641, Tim Evans) + Sun Aug 15 02:31:55 2004 Matthias Clasen * gtk/gtkfilesystemunix.c (get_icon_type_from_stat): Make diff --git a/gtk-zip.sh.in b/gtk-zip.sh.in index 16ed3cb71e..fe2acfb392 100755 --- a/gtk-zip.sh.in +++ b/gtk-zip.sh.in @@ -14,7 +14,7 @@ zip $ZIP -@ < 0) no_alpha = FALSE; pixels += 4; } pixels += (w * 4 - rowstride); } - /* transparency */ - if (!GetDIBits (hdc, ii.hbmMask, 0, h, bits, (BITMAPINFO *)&bmi, DIB_RGB_COLORS)) - g_warning(G_STRLOC ": Failed to get dibits"); - pixels = gdk_pixbuf_get_pixels (pixbuf); - for (y = 0; y < h; y++) - { - for (x = 0; x < w; x++) - { - pixels[3] = 255 - bits[(x + y * w) * 3]; + /* mask */ + if (no_alpha) { + if (!GetDIBits (hdc, ii.hbmMask, 0, h, bits, (BITMAPINFO *)&bmi, DIB_RGB_COLORS)) + g_warning(G_STRLOC ": Failed to get dibits"); + pixels = gdk_pixbuf_get_pixels (pixbuf); + for (y = 0; y < h; y++) + { + for (x = 0; x < w; x++) + { + pixels[3] = 255 - bits[(x + y * w) * 4]; pixels += 4; - } - pixels += (w * 4 - rowstride); - } + } + pixels += (w * 4 - rowstride); + } - /* release temporary resources */ - g_free (bits); - if (!DeleteObject (ii.hbmColor) || !DeleteObject (ii.hbmMask)) - g_warning(G_STRLOC ": Leaking Icon Bitmaps ?"); + /* release temporary resources */ + g_free (bits); + if (!DeleteObject (ii.hbmColor) || !DeleteObject (ii.hbmMask)) + g_warning(G_STRLOC ": Leaking Icon Bitmaps ?"); + } } else g_warning(G_STRLOC ": GetDIBits () failed, %s", g_win32_error_message (GetLastError ())); @@ -1023,7 +1029,7 @@ extract_icon (const char* filename) g_warning(G_STRLOC ": DestroyIcon failed"); } else - g_print ("ExtractAssociatedIcon(%s) failed: %s\n", filename, g_win32_error_message (GetLastError ())); + g_warning (G_STRLOC ":ExtractAssociatedIcon(%s) failed: %s", filename, g_win32_error_message (GetLastError ())); return pixbuf; }