changeset 1327:e4ef8d86dfc4

Added support for GdkPixbuf inline data in GTK.
author bsmith@81767d24-ef19-dc11-ae90-00e081727c95
date Thu, 10 Nov 2011 03:46:01 +0000
parents 03f0a57c9e87
children be2c04276209
files gtk/dw.c gtk3/dw.c
diffstat 2 files changed, 12 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/gtk/dw.c	Wed Nov 09 10:34:58 2011 +0000
+++ b/gtk/dw.c	Thu Nov 10 03:46:01 2011 +0000
@@ -1892,7 +1892,12 @@
    {
       GdkPixmap *icon_pixmap = NULL;
 #if GTK_MAJOR_VERSION > 1
-      GdkPixbuf *icon_pixbuf = gdk_pixbuf_new_from_xpm_data((const char **)data);
+      GdkPixbuf *icon_pixbuf;
+      
+      if(data[0] == 'G' && data[1] == 'd' && data[2] == 'k' && data[3] == 'P')
+         icon_pixbuf = gdk_pixbuf_new_from_inline(-1, (const guint8 *)data, FALSE, NULL);
+      else
+         icon_pixbuf = gdk_pixbuf_new_from_xpm_data((const char **)data);
 
       if(userwidth)
          *userwidth = gdk_pixbuf_get_width(icon_pixbuf);
--- a/gtk3/dw.c	Wed Nov 09 10:34:58 2011 +0000
+++ b/gtk3/dw.c	Thu Nov 10 03:46:01 2011 +0000
@@ -1731,7 +1731,12 @@
 
    if(data)
    {
-      GdkPixbuf *icon_pixbuf = gdk_pixbuf_new_from_xpm_data((const char **)data);
+      GdkPixbuf *icon_pixbuf;
+      
+      if(data[0] == 'G' && data[1] == 'd' && data[2] == 'k' && data[3] == 'P')
+         icon_pixbuf = gdk_pixbuf_new_from_inline(-1, (const guint8 *)data, FALSE, NULL);
+      else
+         icon_pixbuf = gdk_pixbuf_new_from_xpm_data((const char **)data);
 
       if(userwidth)
          *userwidth = gdk_pixbuf_get_width(icon_pixbuf);