comparison gtk/dw.c @ 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 3f1ac800bf65
children 1f22addc2722
comparison
equal deleted inserted replaced
1326:03f0a57c9e87 1327:e4ef8d86dfc4
1890 1890
1891 if(data) 1891 if(data)
1892 { 1892 {
1893 GdkPixmap *icon_pixmap = NULL; 1893 GdkPixmap *icon_pixmap = NULL;
1894 #if GTK_MAJOR_VERSION > 1 1894 #if GTK_MAJOR_VERSION > 1
1895 GdkPixbuf *icon_pixbuf = gdk_pixbuf_new_from_xpm_data((const char **)data); 1895 GdkPixbuf *icon_pixbuf;
1896
1897 if(data[0] == 'G' && data[1] == 'd' && data[2] == 'k' && data[3] == 'P')
1898 icon_pixbuf = gdk_pixbuf_new_from_inline(-1, (const guint8 *)data, FALSE, NULL);
1899 else
1900 icon_pixbuf = gdk_pixbuf_new_from_xpm_data((const char **)data);
1896 1901
1897 if(userwidth) 1902 if(userwidth)
1898 *userwidth = gdk_pixbuf_get_width(icon_pixbuf); 1903 *userwidth = gdk_pixbuf_get_width(icon_pixbuf);
1899 if(userheight) 1904 if(userheight)
1900 *userheight = gdk_pixbuf_get_height(icon_pixbuf); 1905 *userheight = gdk_pixbuf_get_height(icon_pixbuf);