Commits

Jeff Sparkes committed 8d4a873

GdkVisual type accessor was added in 2.22.

* device-gtk.c (Fgtk_display_visual_class):
gdk_visual_get_visual_type was added in 2.22.
* glyphs-gtk.c (convert_EImage_to_GDKPixbuf): Ditto.

Comments (0)

Files changed (3)

 2013-11-15  Jeff Sparkes  <jsparkes@gmail.com>
 
+	* device-gtk.c (Fgtk_display_visual_class):
+	gdk_visual_get_visual_type was added in 2.22.
+	* glyphs-gtk.c (convert_EImage_to_GDKPixbuf): Ditto.
+
 	* ui-gtk.c (g_type_to_lisp): g_value_get_schar only exists in more
 	recent glib.
 
        (device))
 {
   GdkVisual *vis = DEVICE_GTK_VISUAL (decode_gtk_device (device));
-  switch (gdk_visual_get_visual_type (vis))
+#if GTK_CHECK_VERSION(2,22,1)
+  GdkVisualType type = gdk_visual_get_visual_type (vis);
+#else
+  GdkVisualType type = vis->type;
+#endif
+  switch (type)
     {
     case GDK_VISUAL_STATIC_GRAY:  return intern ("static-gray");
     case GDK_VISUAL_GRAYSCALE:    return intern ("gray-scale");
   guchar *data, *ip, *dp = NULL;
 
   vis = DEVICE_GTK_VISUAL (XDEVICE(device));
+#if GTK_CHECK_VERSION(2,22,1)
   vtype = gdk_visual_get_visual_type (vis);
+#else
+  vtype = vis->type;
+#endif
 
   if (vtype == GDK_VISUAL_GRAYSCALE || vtype == GDK_VISUAL_STATIC_COLOR ||
       vtype == GDK_VISUAL_STATIC_GRAY)