[evolution-data-server] Work around sudden disappearance of GdkRegion in GTK+ 2.90.5.



commit e1aa0719162620c50ad6f402a1c58ed817f75bf7
Author: Matthew Barnes <mbarnes redhat com>
Date:   Tue Jun 29 19:17:59 2010 -0400

    Work around sudden disappearance of GdkRegion in GTK+ 2.90.5.
    
    API was deprecated and removed in less than two hours!  Sheesh!

 libedataserverui/gtk-compat.h |   18 ++++++++++++++++++
 1 files changed, 18 insertions(+), 0 deletions(-)
---
diff --git a/libedataserverui/gtk-compat.h b/libedataserverui/gtk-compat.h
index 766b8b3..aaabf0a 100644
--- a/libedataserverui/gtk-compat.h
+++ b/libedataserverui/gtk-compat.h
@@ -21,4 +21,22 @@
 #define gdk_drag_context_get_selected_action(context)  gdk_drag_context_get_action(context)
 #endif
 
+#if GTK_CHECK_VERSION (2,90,5)
+
+/* Recreate GdkRegion until we drop GTK2 compatibility. */
+
+#define GdkRegion cairo_region_t
+
+#define gdk_region_destroy(region) \
+	(cairo_region_destroy (region))
+
+#define gdk_region_point_in(region, x, y) \
+	(cairo_region_contains_point ((region), (x), (y)))
+
+#define gdk_region_rectangle(rectangle) \
+	(((rectangle)->width <= 0 || (rectangle->height <= 0)) ? \
+	cairo_region_create () : cairo_region_create_rectangle (rectangle))
+
+#endif
+
 #endif /* __GTK_COMPAT_H__ */



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]