[gucharmap] GdkRegion doesn't exist anymore



commit fcf4b2575f45281a6f3daa04d949954e26835ffc
Author: Matthias Clasen <mclasen redhat com>
Date:   Fri Jul 2 16:38:39 2010 -0400

    GdkRegion doesn't exist anymore
    
    Fix the build against GTK+ > 2.90.4.
    See bug 623435.

 gucharmap/gucharmap-chartable.c |   26 ++++++++++++++++++++++----
 1 files changed, 22 insertions(+), 4 deletions(-)
---
diff --git a/gucharmap/gucharmap-chartable.c b/gucharmap/gucharmap-chartable.c
index 292e4c6..153f2df 100644
--- a/gucharmap/gucharmap-chartable.c
+++ b/gucharmap/gucharmap-chartable.c
@@ -1470,7 +1470,13 @@ gucharmap_chartable_expose_event (GtkWidget *widget,
 {
   GucharmapChartable *chartable = GUCHARMAP_CHARTABLE (widget);
   GucharmapChartablePrivate *priv = chartable->priv;
+#if GTK_CHECK_VERSION(2,90,5)
+  cairo_rectangle_int_t *rect;
+  cairo_rectangle_int_t r;
+#else
   GdkRectangle *rects;
+  GdkRectangle *rect;
+#endif
   int i, n_rects;
   GdkGC *gc;
   GtkStyle *style;
@@ -1485,10 +1491,16 @@ gucharmap_chartable_expose_event (GtkWidget *widget,
       draw_chartable_from_scratch (chartable);
     }
 
+#if GTK_CHECK_VERSION(2,90,5)
+  if (cairo_region_is_empty (event->region))
+    return FALSE;
+  n_rects = cairo_region_num_rectangles (event->region);
+#else
   if (gdk_region_empty (event->region))
     return FALSE;
-
   gdk_region_get_rectangles (event->region, &rects, &n_rects);
+#endif
+
   if (n_rects == 0)
     return FALSE;
 
@@ -1508,12 +1520,18 @@ gucharmap_chartable_expose_event (GtkWidget *widget,
 
   gc = style->fg_gc[GTK_STATE_NORMAL];
   for (i = 0; i < n_rects; ++i) {
+#if GTK_CHECK_VERSION(2,90,5)
+    cairo_region_get_rectangle (event->region, i, &r);
+    rect = &r;
+#else
+    rect = rects + i;
+#endif
     gdk_draw_drawable (window,
                        gc,
                        priv->pixmap,
-                       rects[i].x, rects[i].y,
-                       rects[i].x, rects[i].y,
-                       rects[i].width, rects[i].height);
+                       rect->x, rect->y,
+                       rect->x, rect->y,
+                       rect->width, rect->height);
   }
 
   g_free (rects);



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