[gtk+] s/GdkRegion/cairo_region_t/ in all of gtk



commit 300e6b84cd0c36873005dd877e3039870d43741b
Author: Benjamin Otte <otte redhat com>
Date:   Mon Jun 28 14:54:37 2010 +0200

    s/GdkRegion/cairo_region_t/ in all of gtk
    
    https://bugzilla.gnome.org/show_bug.cgi?id=613284

 gdk/directfb/gdkdrawable-directfb.c |   27 +++---
 gdk/directfb/gdkgc-directfb.c       |    3 +-
 gdk/directfb/gdkgeometry-directfb.c |   20 ++--
 gdk/directfb/gdkprivate-directfb.h  |   27 +++---
 gdk/directfb/gdkwindow-directfb.c   |   26 +++---
 gdk/gdkcairo.c                      |    4 +-
 gdk/gdkcairo.h                      |    2 +-
 gdk/gdkdraw.c                       |   16 ++--
 gdk/gdkdrawable.h                   |    8 +-
 gdk/gdkevents.h                     |    2 +-
 gdk/gdkgc.c                         |   22 ++--
 gdk/gdkgc.h                         |    2 +-
 gdk/gdkinternals.h                  |   36 ++++----
 gdk/gdkoffscreenwindow.c            |   10 +-
 gdk/gdkpango.c                      |   14 ++--
 gdk/gdkpango.h                      |    4 +-
 gdk/gdkregion.h                     |    6 +-
 gdk/gdktypes.h                      |    4 +
 gdk/gdkwindow.c                     |  180 +++++++++++++++++-----------------
 gdk/gdkwindow.h                     |   16 ++--
 gdk/gdkwindowimpl.h                 |   12 +-
 gdk/quartz/GdkQuartzView.c          |    2 -
 gdk/quartz/gdkgc-quartz.c           |    2 +-
 gdk/quartz/gdkgeometry-quartz.c     |    6 +-
 gdk/quartz/gdkprivate-quartz.h      |    6 +-
 gdk/quartz/gdkwindow-quartz.c       |   24 +++---
 gdk/quartz/gdkwindow-quartz.h       |    4 +-
 gdk/win32/gdkdrawable-win32.c       |   15 ++--
 gdk/win32/gdkevents-win32.c         |    6 +-
 gdk/win32/gdkgc-win32.c             |    7 +-
 gdk/win32/gdkgeometry-win32.c       |   10 +-
 gdk/win32/gdkmain-win32.c           |    3 +-
 gdk/win32/gdkprivate-win32.h        |    8 +-
 gdk/win32/gdkwindow-win32.c         |   20 ++--
 gdk/x11/gdkdnd-x11.c                |    4 +-
 gdk/x11/gdkdrawable-x11.c           |    2 +-
 gdk/x11/gdkgc-x11.c                 |    4 +-
 gdk/x11/gdkgeometry-x11.c           |   13 +--
 gdk/x11/gdkmain-x11.c               |    2 +-
 gdk/x11/gdkprivate-x11.h            |    8 +-
 gdk/x11/gdkwindow-x11.c             |   23 ++---
 gtk/gtkiconview.c                   |    4 +-
 gtk/gtklabel.c                      |    4 +-
 gtk/gtkmenu.h                       |    2 +-
 gtk/gtktextdisplay.c                |    8 +-
 gtk/gtktreeview.c                   |    4 +-
 gtk/gtkwidget.c                     |   20 ++--
 gtk/gtkwidget.h                     |    4 +-
 tests/testgtk.c                     |    4 +-
 49 files changed, 325 insertions(+), 335 deletions(-)
---
diff --git a/gdk/directfb/gdkdrawable-directfb.c b/gdk/directfb/gdkdrawable-directfb.c
index da314e5..eb859ef 100644
--- a/gdk/directfb/gdkdrawable-directfb.c
+++ b/gdk/directfb/gdkdrawable-directfb.c
@@ -44,7 +44,6 @@
 #include "gdkinternals.h"
 
 
-#include "gdkregion-generic.h"
 #include "gdkalias.h"
 
 #include "cairo-directfb.h"
@@ -226,7 +225,7 @@ void
 gdk_directfb_clip_region (GdkDrawable  *drawable,
                           GdkGC        *gc,
                           GdkRectangle *draw_rect,
-                          GdkRegion    *ret_clip)
+                          cairo_region_t    *ret_clip)
 {
   GdkDrawableImplDirectFB *private;
   GdkRectangle             rect;
@@ -264,7 +263,7 @@ gdk_directfb_clip_region (GdkDrawable  *drawable,
   if (gc)
     {
       GdkGCDirectFB *gc_private = GDK_GC_DIRECTFB (gc);
-      GdkRegion     *region     = &gc_private->clip_region;
+      cairo_region_t     *region     = &gc_private->clip_region;
 
       if (region->numRects)
         {
@@ -299,7 +298,7 @@ gdk_directfb_clip_region (GdkDrawable  *drawable,
       !GDK_WINDOW_OBJECT (private->wrapper)->input_only)
     {
       GList     *cur;
-      GdkRegion  temp;
+      cairo_region_t  temp;
 
       temp.numRects = 1;
       temp.rects = &temp.extents;
@@ -428,7 +427,7 @@ gdk_directfb_draw_rectangle (GdkDrawable *drawable,
                              gint         height)
 {
   GdkDrawableImplDirectFB *impl;
-  GdkRegion                clip;
+  cairo_region_t                clip;
   GdkGCDirectFB           *gc_private = NULL;
   IDirectFBSurface        *surface    = NULL;
   gint  i;
@@ -543,7 +542,7 @@ gdk_directfb_draw_rectangle (GdkDrawable *drawable,
 
           for (i = 0; i < clip.numRects; i++)
             {
-              GdkRegionBox *box = &clip.rects[i];
+              cairo_region_tBox *box = &clip.rects[i];
 
               rects[i].x = box->x1;
               rects[i].y = box->y1;
@@ -606,7 +605,7 @@ gdk_directfb_draw_polygon (GdkDrawable *drawable,
                                  points[0].y == points[npoints-1].y))
           {
             GdkDrawableImplDirectFB *impl;
-            GdkRegion                clip;
+            cairo_region_t                clip;
             gint                     i;
 
             impl = GDK_DRAWABLE_IMPL_DIRECTFB (drawable);
@@ -671,7 +670,7 @@ gdk_directfb_draw_drawable (GdkDrawable *drawable,
 {
   GdkDrawableImplDirectFB *impl;
   GdkDrawableImplDirectFB *src_impl;
-  GdkRegion                clip;
+  cairo_region_t                clip;
   GdkRectangle             dest_rect = { xdest,
                                          ydest,
                 xdest + width ,
@@ -721,7 +720,7 @@ gdk_directfb_draw_points (GdkDrawable *drawable,
                           gint         npoints)
 {
   GdkDrawableImplDirectFB *impl;
-  GdkRegion                clip;
+  cairo_region_t                clip;
 
   DFBRegion region = { points->x, points->y, points->x, points->y };
 
@@ -769,7 +768,7 @@ gdk_directfb_draw_segments (GdkDrawable *drawable,
                             gint         nsegs)
 {
   GdkDrawableImplDirectFB *impl;
-  GdkRegion                clip;
+  cairo_region_t                clip;
   gint                     i;
 
 //  DFBRegion region = { segs->x1, segs->y1, segs->x2, segs->y2 };
@@ -847,7 +846,7 @@ gdk_directfb_draw_lines (GdkDrawable *drawable,
                          gint         npoints)
 {
   GdkDrawableImplDirectFB *impl;
-  GdkRegion                clip;
+  cairo_region_t                clip;
   gint                     i;
 
   DFBRegion lines[npoints > 1 ? npoints - 1 : 1];
@@ -920,7 +919,7 @@ gdk_directfb_draw_image (GdkDrawable *drawable,
 {
   GdkDrawableImplDirectFB *impl;
   GdkImageDirectFB        *image_private;
-  GdkRegion                clip;
+  cairo_region_t                clip;
   GdkRectangle             dest_rect = { xdest, ydest, width, height };
 
   gint pitch = 0;
@@ -1156,8 +1155,8 @@ gdk_directfb_draw_pixbuf (GdkDrawable  *drawable,
 {
   GdkPixbuf *composited = NULL;
 #if 0
-  GdkRegion *clip;
-  GdkRegion *drect;
+  cairo_region_t *clip;
+  cairo_region_t *drect;
   GdkRectangle tmp_rect;
 #endif
   GdkDrawableImplDirectFB *impl = GDK_DRAWABLE_IMPL_DIRECTFB (drawable);
diff --git a/gdk/directfb/gdkgc-directfb.c b/gdk/directfb/gdkgc-directfb.c
index e8cb617..7e419e8 100644
--- a/gdk/directfb/gdkgc-directfb.c
+++ b/gdk/directfb/gdkgc-directfb.c
@@ -42,7 +42,6 @@
 
 #include "gdkgc.h"
 #include "gdkpixmap.h"
-#include "gdkregion-generic.h"
 
 #include "gdkalias.h"
 
@@ -313,7 +312,7 @@ gc_unset_clip_mask (GdkGC *gc)
 
 void
 _gdk_windowing_gc_set_clip_region (GdkGC           *gc,
-                                   const GdkRegion *region,
+                                   const cairo_region_t *region,
                                    gboolean         reset_origin)
 {
   GdkGCDirectFB *data;
diff --git a/gdk/directfb/gdkgeometry-directfb.c b/gdk/directfb/gdkgeometry-directfb.c
index bddc2dd..416e1b0 100644
--- a/gdk/directfb/gdkgeometry-directfb.c
+++ b/gdk/directfb/gdkgeometry-directfb.c
@@ -53,7 +53,7 @@ _gdk_directfb_window_get_offsets (GdkWindow *window,
 
 gboolean
 _gdk_windowing_window_queue_antiexpose (GdkWindow *window,
-                                        GdkRegion *area)
+                                        cairo_region_t *area)
 {
   return FALSE;
 }
@@ -75,7 +75,7 @@ _gdk_directfb_window_scroll (GdkWindow *window,
 {
   GdkWindowObject         *private;
   GdkDrawableImplDirectFB *impl;
-  GdkRegion               *invalidate_region = NULL;
+  cairo_region_t               *invalidate_region = NULL;
   GList                   *list;
 
   g_return_if_fail (GDK_IS_WINDOW (window));
@@ -104,7 +104,7 @@ _gdk_directfb_window_scroll (GdkWindow *window,
           (!private->update_area ||
            !cairo_region_contains_rectangle (private->update_area, &rect)))
         {
-          GdkRegion *region;
+          cairo_region_t *region;
 
           region = cairo_region_create_rectangle (&rect);
           cairo_region_subtract (invalidate_region, region);
@@ -148,7 +148,7 @@ _gdk_directfb_window_scroll (GdkWindow *window,
 /**
  * gdk_window_move_region:
  * @window: a #GdkWindow
- * @region: The #GdkRegion to move
+ * @region: The #cairo_region_t to move
  * @dx: Amount to move in the X direction
  * @dy: Amount to move in the Y direction
  * 
@@ -162,17 +162,17 @@ _gdk_directfb_window_scroll (GdkWindow *window,
  **/
 void
 _gdk_directfb_window_move_region (GdkWindow       *window,
-                                  const GdkRegion *region,
+                                  const cairo_region_t *region,
                                   gint             dx,
                                   gint             dy)
 {
   GdkWindowObject         *private;
   GdkDrawableImplDirectFB *impl;
-  GdkRegion *window_clip;
-  GdkRegion *src_region;
-  GdkRegion *brought_in;
-  GdkRegion *dest_region;
-  GdkRegion *moving_invalid_region;
+  cairo_region_t *window_clip;
+  cairo_region_t *src_region;
+  cairo_region_t *brought_in;
+  cairo_region_t *dest_region;
+  cairo_region_t *moving_invalid_region;
   GdkRectangle dest_extents;
   
   g_return_if_fail (GDK_IS_WINDOW (window));
diff --git a/gdk/directfb/gdkprivate-directfb.h b/gdk/directfb/gdkprivate-directfb.h
index 201a1e6..db04f92 100644
--- a/gdk/directfb/gdkprivate-directfb.h
+++ b/gdk/directfb/gdkprivate-directfb.h
@@ -38,7 +38,6 @@
 #include "gdkinternals.h"
 #include "gdkcursor.h"
 #include "gdkdisplay-directfb.h"
-#include "gdkregion-generic.h"
 #include <cairo.h>
 
 #include <string.h>
@@ -72,14 +71,14 @@ struct _GdkDrawableImplDirectFB
 
   gboolean                buffered;
 
-  GdkRegion               paint_region;
+  cairo_region_t               paint_region;
   gint                    paint_depth;
   gint                    width;
   gint                    height;
   gint                    abs_x;
   gint                    abs_y;
 
-  GdkRegion               clip_region;
+  cairo_region_t               clip_region;
 
   GdkColormap            *colormap;
 
@@ -179,7 +178,7 @@ void        _gdk_directfb_window_scroll         (GdkWindow       *window,
                                                  gint             dx,
                                                  gint             dy);
 void        _gdk_directfb_window_move_region    (GdkWindow       *window,
-                                                 const GdkRegion *region,
+                                                 const cairo_region_t *region,
                                                  gint             dx,
                                                  gint             dy);
 
@@ -213,7 +212,7 @@ typedef struct
 {
   GdkGC             parent_instance;
 
-  GdkRegion         clip_region;
+  cairo_region_t         clip_region;
 
   GdkGCValuesMask   values_mask;
   GdkGCValues       values;
@@ -335,14 +334,14 @@ void gdk_fb_window_set_child_handler (GdkWindow              *window,
 void gdk_directfb_clip_region (GdkDrawable  *drawable,
                                GdkGC        *gc,
                                GdkRectangle *draw_rect,
-                               GdkRegion    *ret_clip);
+                               cairo_region_t    *ret_clip);
 
 
 /* Utilities for avoiding mallocs */
 
 static inline void
-temp_region_init_copy( GdkRegion       *region, 
-                       const GdkRegion *source)
+temp_region_init_copy( cairo_region_t       *region, 
+                       const cairo_region_t *source)
 {
   if (region != source) /*  don't want to copy to itself */
     {  
@@ -351,19 +350,19 @@ temp_region_init_copy( GdkRegion       *region,
           if (region->rects && region->rects != &region->extents)
             g_free( region->rects );
 
-          region->rects = g_new (GdkRegionBox, source->numRects);
+          region->rects = g_new (cairo_region_tBox, source->numRects);
           region->size  = source->numRects;
         }
 
       region->numRects = source->numRects;
       region->extents  = source->extents;
 
-      memcpy( region->rects, source->rects, source->numRects * sizeof (GdkRegionBox) );
+      memcpy( region->rects, source->rects, source->numRects * sizeof (cairo_region_tBox) );
     }
 }
 
 static inline void
-temp_region_init_rectangle( GdkRegion          *region,
+temp_region_init_rectangle( cairo_region_t          *region,
                             const GdkRectangle *rect )
 {
      region->numRects = 1;
@@ -376,7 +375,7 @@ temp_region_init_rectangle( GdkRegion          *region,
 }
 
 static inline void
-temp_region_init_rectangle_vals( GdkRegion *region,
+temp_region_init_rectangle_vals( cairo_region_t *region,
                                  int        x,
                                  int        y,
                                  int        w,
@@ -392,7 +391,7 @@ temp_region_init_rectangle_vals( GdkRegion *region,
 }
 
 static inline void
-temp_region_reset( GdkRegion *region )
+temp_region_reset( cairo_region_t *region )
 {
      if (region->size > 32 && region->rects && region->rects != &region->extents) {
           g_free( region->rects );
@@ -405,7 +404,7 @@ temp_region_reset( GdkRegion *region )
 }
 
 static inline void
-temp_region_deinit( GdkRegion *region )
+temp_region_deinit( cairo_region_t *region )
 {
      if (region->rects && region->rects != &region->extents) {
           g_free( region->rects );
diff --git a/gdk/directfb/gdkwindow-directfb.c b/gdk/directfb/gdkwindow-directfb.c
index ed086c6..5468a8f 100644
--- a/gdk/directfb/gdkwindow-directfb.c
+++ b/gdk/directfb/gdkwindow-directfb.c
@@ -40,8 +40,6 @@
 #include "gdkprivate-directfb.h"
 #include "gdkdisplay-directfb.h"
 
-#include "gdkregion-generic.h"
-
 #include "gdkinternals.h"
 #include "gdkalias.h"
 #include "cairo.h"
@@ -57,7 +55,7 @@ D_DEBUG_DOMAIN( GDKDFB_Paintable, "GDKDFB/Paintable", "GDK DirectFB Paintable" )
 D_DEBUG_DOMAIN( GDKDFB_Window,    "GDKDFB/Window",    "GDK DirectFB Window" );
 
 
-static GdkRegion * gdk_window_impl_directfb_get_visible_region (GdkDrawable *drawable);
+static cairo_region_t * gdk_window_impl_directfb_get_visible_region (GdkDrawable *drawable);
 static void        gdk_window_impl_directfb_set_colormap       (GdkDrawable *drawable,
                                                                 GdkColormap *colormap);
 static void gdk_window_impl_directfb_init       (GdkWindowImplDirectFB      *window);
@@ -209,7 +207,7 @@ gdk_window_impl_directfb_finalize (GObject *object)
     G_OBJECT_CLASS (parent_class)->finalize (object);
 }
 
-static GdkRegion*
+static cairo_region_t*
 gdk_window_impl_directfb_get_visible_region (GdkDrawable *drawable)
 {
   GdkDrawableImplDirectFB *priv = GDK_DRAWABLE_IMPL_DIRECTFB (drawable);
@@ -1942,7 +1940,7 @@ gdk_directfb_window_set_events (GdkWindow    *window,
 
 static void
 gdk_directfb_window_shape_combine_region (GdkWindow       *window,
-                                          const GdkRegion *shape_region,
+                                          const cairo_region_t *shape_region,
                                           gint             offset_x,
                                           gint             offset_y)
 {
@@ -1950,7 +1948,7 @@ gdk_directfb_window_shape_combine_region (GdkWindow       *window,
 
 void
 gdk_directfb_window_input_shape_combine_region (GdkWindow       *window,
-                                                const GdkRegion *shape_region,
+                                                const cairo_region_t *shape_region,
                                                 gint             offset_x,
                                                 gint             offset_y)
 {
@@ -1959,7 +1957,7 @@ gdk_directfb_window_input_shape_combine_region (GdkWindow       *window,
 static void
 gdk_directfb_window_queue_translation (GdkWindow *window,
 				       GdkGC     *gc,
-                                       GdkRegion *region,
+                                       cairo_region_t *region,
                                        gint       dx,
                                        gint       dy)
 {
@@ -2622,7 +2620,7 @@ gdk_window_set_urgency_hint (GdkWindow *window,
 static void
 gdk_window_impl_directfb_begin_paint_region (GdkPaintable    *paintable,
                                              GdkWindow       *window,
-                                             const GdkRegion *region)
+                                             const cairo_region_t *region)
 {
   GdkDrawableImplDirectFB *impl;
   GdkWindowImplDirectFB   *wimpl;
@@ -2679,7 +2677,7 @@ gdk_window_impl_directfb_begin_paint_region (GdkPaintable    *paintable,
 
   for (i = 0; i < region->numRects; i++)
     {
-      GdkRegionBox *box = &region->rects[i];
+      cairo_region_tBox *box = &region->rects[i];
 
       D_DEBUG_AT( GDKDFB_Window, "  -> [%2d] %4d,%4d-%4dx%4d\n", i, GDKDFB_RECTANGLE_VALS_FROM_BOX( box ) );
 
@@ -2766,13 +2764,13 @@ gdk_window_impl_directfb_end_paint (GdkPaintable *paintable)
     D_DEBUG_AT( GDKDFB_Window, "  -> depth is still %d\n", impl->paint_depth );
 }
 
-GdkRegion *
+cairo_region_t *
 _gdk_windowing_get_shape_for_mask (GdkBitmap *mask)
 {
   return NULL;
 }
 
-GdkRegion *
+cairo_region_t *
 _gdk_windowing_window_get_shape (GdkWindow *window)
 {
   return NULL;
@@ -2784,7 +2782,7 @@ _gdk_windowing_window_get_next_serial (GdkDisplay *display)
   return 0;
 }
 
-GdkRegion *
+cairo_region_t *
 _gdk_windowing_window_get_input_shape (GdkWindow *window)
 {
   return NULL;
@@ -2802,7 +2800,7 @@ _gdk_windowing_after_process_all_updates (void)
 
 void
 _gdk_windowing_window_process_updates_recurse (GdkWindow *window,
-                                               GdkRegion *region)
+                                               cairo_region_t *region)
 {
   _gdk_window_process_updates_recurse (window, region);
 }
@@ -2861,7 +2859,7 @@ gdk_directfb_window_get_root_coords (GdkWindow *window,
 
 static gboolean
 gdk_directfb_window_queue_antiexpose (GdkWindow *window,
-                                      GdkRegion *area)
+                                      cairo_region_t *area)
 {
   return FALSE;
 }
diff --git a/gdk/gdkcairo.c b/gdk/gdkcairo.c
index 868be8e..4031db7 100644
--- a/gdk/gdkcairo.c
+++ b/gdk/gdkcairo.c
@@ -132,7 +132,7 @@ gdk_cairo_rectangle (cairo_t            *cr,
 /**
  * gdk_cairo_region:
  * @cr: a #cairo_t
- * @region: a #GdkRegion
+ * @region: a #cairo_region_t
  * 
  * Adds the given region to the current path of @cr.
  *
@@ -140,7 +140,7 @@ gdk_cairo_rectangle (cairo_t            *cr,
  **/
 void
 gdk_cairo_region (cairo_t         *cr,
-		  const GdkRegion *region)
+		  const cairo_region_t *region)
 {
   cairo_rectangle_int_t box;
   gint n_boxes, i;
diff --git a/gdk/gdkcairo.h b/gdk/gdkcairo.h
index bc2153d..4ecb037 100644
--- a/gdk/gdkcairo.h
+++ b/gdk/gdkcairo.h
@@ -48,7 +48,7 @@ void     gdk_cairo_set_source_pixmap (cairo_t            *cr,
 void     gdk_cairo_rectangle         (cairo_t            *cr,
                                       const GdkRectangle *rectangle);
 void     gdk_cairo_region            (cairo_t            *cr,
-                                      const GdkRegion    *region);
+                                      const cairo_region_t    *region);
 
 G_END_DECLS
 
diff --git a/gdk/gdkdraw.c b/gdk/gdkdraw.c
index 6ea712d..cf1fc07 100644
--- a/gdk/gdkdraw.c
+++ b/gdk/gdkdraw.c
@@ -48,7 +48,7 @@ static GdkDrawable* gdk_drawable_real_get_composite_drawable (GdkDrawable  *draw
 							      gint          height,
 							      gint         *composite_x_offset,
 							      gint         *composite_y_offset);
-static GdkRegion *  gdk_drawable_real_get_visible_region     (GdkDrawable  *drawable);
+static cairo_region_t *  gdk_drawable_real_get_visible_region     (GdkDrawable  *drawable);
 static void         gdk_drawable_real_draw_pixbuf            (GdkDrawable  *drawable,
 							      GdkGC        *gc,
 							      GdkPixbuf    *pixbuf,
@@ -1059,10 +1059,10 @@ gdk_drawable_real_get_composite_drawable (GdkDrawable *drawable,
  * but no area outside of this region will be affected by drawing
  * primitives.
  * 
- * Returns: a #GdkRegion. This must be freed with cairo_region_destroy()
+ * Returns: a #cairo_region_t. This must be freed with cairo_region_destroy()
  *          when you are done.
  **/
-GdkRegion *
+cairo_region_t *
 gdk_drawable_get_clip_region (GdkDrawable *drawable)
 {
   g_return_val_if_fail (GDK_IS_DRAWABLE (drawable), NULL);
@@ -1079,10 +1079,10 @@ gdk_drawable_get_clip_region (GdkDrawable *drawable)
  * obscured by other windows, but no area outside of this region
  * is visible.
  * 
- * Returns: a #GdkRegion. This must be freed with cairo_region_destroy()
+ * Returns: a #cairo_region_t. This must be freed with cairo_region_destroy()
  *          when you are done.
  **/
-GdkRegion *
+cairo_region_t *
 gdk_drawable_get_visible_region (GdkDrawable *drawable)
 {
   g_return_val_if_fail (GDK_IS_DRAWABLE (drawable), NULL);
@@ -1090,7 +1090,7 @@ gdk_drawable_get_visible_region (GdkDrawable *drawable)
   return GDK_DRAWABLE_GET_CLASS (drawable)->get_visible_region (drawable);
 }
 
-static GdkRegion *
+static cairo_region_t *
 gdk_drawable_real_get_visible_region (GdkDrawable *drawable)
 {
   GdkRectangle rect;
@@ -1371,8 +1371,8 @@ gdk_drawable_real_draw_pixbuf (GdkDrawable  *drawable,
 {
   GdkPixbuf *composited = NULL;
   gint dwidth, dheight;
-  GdkRegion *clip;
-  GdkRegion *drect;
+  cairo_region_t *clip;
+  cairo_region_t *drect;
   GdkRectangle tmp_rect;
   GdkDrawable  *real_drawable;
 
diff --git a/gdk/gdkdrawable.h b/gdk/gdkdrawable.h
index 574bef2..5eb5f45 100644
--- a/gdk/gdkdrawable.h
+++ b/gdk/gdkdrawable.h
@@ -140,8 +140,8 @@ struct _GdkDrawableClass
                               gint          width,
                               gint          height);
 
-  GdkRegion*   (*get_clip_region)    (GdkDrawable  *drawable);
-  GdkRegion*   (*get_visible_region) (GdkDrawable  *drawable);
+  cairo_region_t*   (*get_clip_region)    (GdkDrawable  *drawable);
+  cairo_region_t*   (*get_visible_region) (GdkDrawable  *drawable);
 
   GdkDrawable* (*get_composite_drawable) (GdkDrawable *drawable,
                                           gint         x,
@@ -372,8 +372,8 @@ GdkImage *gdk_drawable_copy_to_image (GdkDrawable  *drawable,
 				      gint          width,
 				      gint          height);
 
-GdkRegion *gdk_drawable_get_clip_region    (GdkDrawable *drawable);
-GdkRegion *gdk_drawable_get_visible_region (GdkDrawable *drawable);
+cairo_region_t *gdk_drawable_get_clip_region    (GdkDrawable *drawable);
+cairo_region_t *gdk_drawable_get_visible_region (GdkDrawable *drawable);
 
 G_END_DECLS
 
diff --git a/gdk/gdkevents.h b/gdk/gdkevents.h
index f8f6d1a..8e77350 100644
--- a/gdk/gdkevents.h
+++ b/gdk/gdkevents.h
@@ -279,7 +279,7 @@ struct _GdkEventExpose
   GdkWindow *window;
   gint8 send_event;
   GdkRectangle area;
-  GdkRegion *region;
+  cairo_region_t *region;
   gint count; /* If non-zero, how many more events follow. */
 };
 
diff --git a/gdk/gdkgc.c b/gdk/gdkgc.c
index f76ead8..4bf2dc5 100644
--- a/gdk/gdkgc.c
+++ b/gdk/gdkgc.c
@@ -41,13 +41,13 @@ typedef struct _GdkGCPrivate GdkGCPrivate;
 
 struct _GdkGCPrivate
 {
-  GdkRegion *clip_region;
+  cairo_region_t *clip_region;
 
   guint32 region_tag_applied;
   int region_tag_offset_x;
   int region_tag_offset_y;
 
-  GdkRegion *old_clip_region;
+  cairo_region_t *old_clip_region;
   GdkPixmap *old_clip_mask;
 
   GdkBitmap *stipple;
@@ -538,7 +538,7 @@ gdk_gc_set_clip_mask (GdkGC	*gc,
 /* Takes ownership of passed in region */
 static void
 _gdk_gc_set_clip_region_real (GdkGC     *gc,
-			      GdkRegion *region,
+			      cairo_region_t *region,
 			      gboolean reset_origin)
 {
   GdkGCPrivate *priv = GDK_GC_GET_PRIVATE (gc);
@@ -560,7 +560,7 @@ _gdk_gc_set_clip_region_real (GdkGC     *gc,
 /* Doesn't copy region, allows not to reset origin */
 void
 _gdk_gc_set_clip_region_internal (GdkGC     *gc,
-				  GdkRegion *region,
+				  cairo_region_t *region,
 				  gboolean reset_origin)
 {
   _gdk_gc_remove_drawable_clip (gc);
@@ -571,7 +571,7 @@ _gdk_gc_set_clip_region_internal (GdkGC     *gc,
 void
 _gdk_gc_add_drawable_clip (GdkGC     *gc,
 			   guint32    region_tag,
-			   GdkRegion *region,
+			   cairo_region_t *region,
 			   int        offset_x,
 			   int        offset_y)
 {
@@ -634,7 +634,7 @@ _gdk_gc_add_drawable_clip (GdkGC     *gc,
       else if (overlap == CAIRO_REGION_OVERLAP_OUT)
 	{
 	  /* No intersection, set empty clip region */
-	  GdkRegion *empty = cairo_region_create ();
+	  cairo_region_t *empty = cairo_region_create ();
 
 	  cairo_region_destroy (region);
 	  priv->old_clip_mask = g_object_ref (priv->clip_mask);
@@ -704,7 +704,7 @@ void
 gdk_gc_set_clip_rectangle (GdkGC              *gc,
 			   const GdkRectangle *rectangle)
 {
-  GdkRegion *region;
+  cairo_region_t *region;
   
   g_return_if_fail (GDK_IS_GC (gc));
 
@@ -721,7 +721,7 @@ gdk_gc_set_clip_rectangle (GdkGC              *gc,
 /**
  * gdk_gc_set_clip_region:
  * @gc: a #GdkGC.
- * @region: the #GdkRegion. 
+ * @region: the #cairo_region_t. 
  * 
  * Sets the clip mask for a graphics context from a region structure.
  * The clip mask is interpreted relative to the clip origin. (See
@@ -729,9 +729,9 @@ gdk_gc_set_clip_rectangle (GdkGC              *gc,
  **/
 void
 gdk_gc_set_clip_region (GdkGC           *gc,
-			const GdkRegion *region)
+			const cairo_region_t *region)
 {
-  GdkRegion *copy;
+  cairo_region_t *copy;
 
   g_return_if_fail (GDK_IS_GC (gc));
 
@@ -755,7 +755,7 @@ gdk_gc_set_clip_region (GdkGC           *gc,
  *   (if a clip mask is set, the return will be %NULL)
  *   This value is owned by the GC and must not be freed.
  **/
-GdkRegion *
+cairo_region_t *
 _gdk_gc_get_clip_region (GdkGC *gc)
 {
   g_return_val_if_fail (GDK_IS_GC (gc), NULL);
diff --git a/gdk/gdkgc.h b/gdk/gdkgc.h
index 962b133..93fae22 100644
--- a/gdk/gdkgc.h
+++ b/gdk/gdkgc.h
@@ -252,7 +252,7 @@ void   gdk_gc_set_clip_mask	  (GdkGC	    *gc,
 void   gdk_gc_set_clip_rectangle  (GdkGC	    *gc,
 				   const GdkRectangle *rectangle);
 void   gdk_gc_set_clip_region	  (GdkGC	    *gc,
-				   const GdkRegion  *region);
+				   const cairo_region_t  *region);
 void   gdk_gc_set_subwindow	  (GdkGC	    *gc,
 				   GdkSubwindowMode  mode);
 void   gdk_gc_set_exposures	  (GdkGC	    *gc,
diff --git a/gdk/gdkinternals.h b/gdk/gdkinternals.h
index ff78737..becfb15 100644
--- a/gdk/gdkinternals.h
+++ b/gdk/gdkinternals.h
@@ -212,7 +212,7 @@ struct _GdkWindowObject
   
   GSList *paint_stack;
   
-  GdkRegion *update_area;
+  cairo_region_t *update_area;
   guint update_freeze_count;
   
   guint8 window_type;
@@ -248,8 +248,8 @@ struct _GdkWindowObject
   int abs_x, abs_y; /* Absolute offset in impl */
   gint width, height;
   guint32 clip_tag;
-  GdkRegion *clip_region; /* Clip region (wrt toplevel) in window coords */
-  GdkRegion *clip_region_with_children; /* Clip region in window coords */
+  cairo_region_t *clip_region; /* Clip region (wrt toplevel) in window coords */
+  cairo_region_t *clip_region_with_children; /* Clip region in window coords */
   GdkCursor *cursor;
   GHashTable *device_cursor;
   gint8 toplevel_window_type;
@@ -266,8 +266,8 @@ struct _GdkWindowObject
 
   GList *outstanding_moves;
 
-  GdkRegion *shape;
-  GdkRegion *input_shape;
+  cairo_region_t *shape;
+  cairo_region_t *input_shape;
   
   cairo_surface_t *cairo_surface;
   guint outstanding_surfaces; /* only set on impl window */
@@ -397,7 +397,7 @@ void       _gdk_window_update_size       (GdkWindow      *window);
 gboolean   _gdk_window_update_viewable   (GdkWindow      *window);
 
 void       _gdk_window_process_updates_recurse (GdkWindow *window,
-                                                GdkRegion *expose_region);
+                                                cairo_region_t *expose_region);
 
 void       _gdk_screen_close             (GdkScreen      *screen);
 
@@ -408,7 +408,7 @@ void _gdk_gc_init (GdkGC           *gc,
 		   GdkGCValues     *values,
 		   GdkGCValuesMask  values_mask);
 
-GdkRegion *_gdk_gc_get_clip_region (GdkGC *gc);
+cairo_region_t *_gdk_gc_get_clip_region (GdkGC *gc);
 GdkBitmap *_gdk_gc_get_clip_mask   (GdkGC *gc);
 gboolean   _gdk_gc_get_exposures   (GdkGC *gc);
 GdkFill    _gdk_gc_get_fill        (GdkGC *gc);
@@ -418,12 +418,12 @@ guint32    _gdk_gc_get_fg_pixel    (GdkGC *gc);
 guint32    _gdk_gc_get_bg_pixel    (GdkGC *gc);
 void      _gdk_gc_add_drawable_clip     (GdkGC     *gc,
 					 guint32    region_tag,
-					 GdkRegion *region,
+					 cairo_region_t *region,
 					 int        offset_x,
 					 int        offset_y);
 void      _gdk_gc_remove_drawable_clip  (GdkGC     *gc);
 void       _gdk_gc_set_clip_region_internal (GdkGC     *gc,
-					     GdkRegion *region,
+					     cairo_region_t *region,
 					     gboolean reset_origin);
 GdkSubwindowMode _gdk_gc_get_subwindow (GdkGC *gc);
 
@@ -457,9 +457,9 @@ gulong   _gdk_windowing_window_get_next_serial  (GdkDisplay *display);
 void     _gdk_windowing_window_get_offsets      (GdkWindow  *window,
 						 gint       *x_offset,
 						 gint       *y_offset);
-GdkRegion *_gdk_windowing_window_get_shape      (GdkWindow  *window);
-GdkRegion *_gdk_windowing_window_get_input_shape(GdkWindow  *window);
-GdkRegion *_gdk_windowing_get_shape_for_mask    (GdkBitmap *mask);
+cairo_region_t *_gdk_windowing_window_get_shape      (GdkWindow  *window);
+cairo_region_t *_gdk_windowing_window_get_input_shape(GdkWindow  *window);
+cairo_region_t *_gdk_windowing_get_shape_for_mask    (GdkBitmap *mask);
 void     _gdk_windowing_window_beep             (GdkWindow *window);
 
 
@@ -489,7 +489,7 @@ void _gdk_windowing_got_event                (GdkDisplay       *display,
 					      gulong            serial);
 
 void _gdk_windowing_window_process_updates_recurse (GdkWindow *window,
-                                                    GdkRegion *expose_region);
+                                                    cairo_region_t *expose_region);
 void _gdk_windowing_before_process_all_updates     (void);
 void _gdk_windowing_after_process_all_updates      (void);
 
@@ -528,7 +528,7 @@ struct _GdkPaintableIface
   
   void (* begin_paint_region)       (GdkPaintable    *paintable,
                                      GdkWindow       *window,
-                                     const GdkRegion *region);
+                                     const cairo_region_t *region);
   void (* end_paint)                (GdkPaintable    *paintable);
 };
 
@@ -555,7 +555,7 @@ GType _gdk_pixmap_impl_get_type (void) G_GNUC_CONST;
  * will already return the new region.
  **/
 void _gdk_windowing_gc_set_clip_region (GdkGC           *gc,
-					const GdkRegion *region,
+					const cairo_region_t *region,
 					gboolean reset_origin);
 
 /**
@@ -630,7 +630,7 @@ void _gdk_display_pointer_info_foreach (GdkDisplay                   *display,
                                         gpointer                      user_data);
 
 void _gdk_window_invalidate_for_expose (GdkWindow       *window,
-					GdkRegion       *region);
+					cairo_region_t       *region);
 
 void _gdk_windowing_set_cairo_surface_size (cairo_surface_t *surface,
 					    int width,
@@ -647,7 +647,7 @@ GdkWindow * _gdk_window_find_descendant_at (GdkWindow *toplevel,
 					    double *found_y);
 
 void _gdk_window_add_damage (GdkWindow *toplevel,
-			     GdkRegion *damaged_region);
+			     cairo_region_t *damaged_region);
 
 GdkEvent * _gdk_make_event (GdkWindow    *window,
 			    GdkEventType  type,
@@ -675,7 +675,7 @@ void _gdk_display_set_window_under_pointer (GdkDisplay *display,
 
 void _gdk_synthesize_crossing_events_for_geometry_change (GdkWindow *changed_window);
 
-GdkRegion *_gdk_window_calculate_full_clip_region    (GdkWindow     *window,
+cairo_region_t *_gdk_window_calculate_full_clip_region    (GdkWindow     *window,
                                                       GdkWindow     *base_window,
                                                       gboolean       do_children,
                                                       gint          *base_x_offset,
diff --git a/gdk/gdkoffscreenwindow.c b/gdk/gdkoffscreenwindow.c
index f6a87e9..8005d05 100644
--- a/gdk/gdkoffscreenwindow.c
+++ b/gdk/gdkoffscreenwindow.c
@@ -261,7 +261,7 @@ add_damage (GdkOffscreenWindow *offscreen,
 	    gboolean is_line)
 {
   GdkRectangle rect;
-  GdkRegion *damage;
+  cairo_region_t *damage;
 
   rect.x = x;
   rect.y = y;
@@ -1039,7 +1039,7 @@ gdk_offscreen_window_set_back_pixmap (GdkWindow *window,
 
 static void
 gdk_offscreen_window_shape_combine_region (GdkWindow       *window,
-					   const GdkRegion *shape_region,
+					   const cairo_region_t *shape_region,
 					   gint             offset_x,
 					   gint             offset_y)
 {
@@ -1047,7 +1047,7 @@ gdk_offscreen_window_shape_combine_region (GdkWindow       *window,
 
 static void
 gdk_offscreen_window_input_shape_combine_region (GdkWindow       *window,
-						 const GdkRegion *shape_region,
+						 const cairo_region_t *shape_region,
 						 gint             offset_x,
 						 gint             offset_y)
 {
@@ -1089,7 +1089,7 @@ gdk_offscreen_window_get_geometry (GdkWindow *window,
 
 static gboolean
 gdk_offscreen_window_queue_antiexpose (GdkWindow *window,
-				       GdkRegion *area)
+				       cairo_region_t *area)
 {
   return FALSE;
 }
@@ -1097,7 +1097,7 @@ gdk_offscreen_window_queue_antiexpose (GdkWindow *window,
 static void
 gdk_offscreen_window_queue_translation (GdkWindow *window,
 					GdkGC     *gc,
-					GdkRegion *area,
+					cairo_region_t *area,
 					gint       dx,
 					gint       dy)
 {
diff --git a/gdk/gdkpango.c b/gdk/gdkpango.c
index 2707817..2a6b1ea 100644
--- a/gdk/gdkpango.c
+++ b/gdk/gdkpango.c
@@ -1240,7 +1240,7 @@ gdk_pango_attr_emboss_color_new (const GdkColor *color)
  * region which contains the given ranges, i.e. if you draw with the
  * region as clip, only the given ranges are drawn.
  */
-static GdkRegion*
+static cairo_region_t*
 layout_iter_get_line_clip_region (PangoLayoutIter *iter,
 				  gint             x_origin,
 				  gint             y_origin,
@@ -1248,7 +1248,7 @@ layout_iter_get_line_clip_region (PangoLayoutIter *iter,
 				  gint             n_ranges)
 {
   PangoLayoutLine *line;
-  GdkRegion *clip_region;
+  cairo_region_t *clip_region;
   PangoRectangle logical_rect;
   gint baseline;
   gint i;
@@ -1323,14 +1323,14 @@ layout_iter_get_line_clip_region (PangoLayoutIter *iter,
  * 
  * Return value: a clip region containing the given ranges
  **/
-GdkRegion*
+cairo_region_t*
 gdk_pango_layout_line_get_clip_region (PangoLayoutLine *line,
                                        gint             x_origin,
                                        gint             y_origin,
                                        const gint      *index_ranges,
                                        gint             n_ranges)
 {
-  GdkRegion *clip_region;
+  cairo_region_t *clip_region;
   PangoLayoutIter *iter;
   
   g_return_val_if_fail (line != NULL, NULL);
@@ -1367,7 +1367,7 @@ gdk_pango_layout_line_get_clip_region (PangoLayoutLine *line,
  * 
  * Return value: a clip region containing the given ranges
  **/
-GdkRegion*
+cairo_region_t*
 gdk_pango_layout_get_clip_region (PangoLayout *layout,
                                   gint         x_origin,
                                   gint         y_origin,
@@ -1375,7 +1375,7 @@ gdk_pango_layout_get_clip_region (PangoLayout *layout,
                                   gint         n_ranges)
 {
   PangoLayoutIter *iter;  
-  GdkRegion *clip_region;
+  cairo_region_t *clip_region;
   
   g_return_val_if_fail (PANGO_IS_LAYOUT (layout), NULL);
   g_return_val_if_fail (index_ranges != NULL, NULL);
@@ -1387,7 +1387,7 @@ gdk_pango_layout_get_clip_region (PangoLayout *layout,
   do
     {
       PangoRectangle logical_rect;
-      GdkRegion *line_region;
+      cairo_region_t *line_region;
       gint baseline;
       
       pango_layout_iter_get_line_extents (iter, NULL, &logical_rect);
diff --git a/gdk/gdkpango.h b/gdk/gdkpango.h
index 52ae4a3..512552c 100644
--- a/gdk/gdkpango.h
+++ b/gdk/gdkpango.h
@@ -116,12 +116,12 @@ PangoContext *gdk_pango_context_get            (void);
  * draw with the region as clip, only the given ranges are drawn.
  */
 
-GdkRegion    *gdk_pango_layout_line_get_clip_region (PangoLayoutLine *line,
+cairo_region_t    *gdk_pango_layout_line_get_clip_region (PangoLayoutLine *line,
                                                      gint             x_origin,
                                                      gint             y_origin,
                                                      const gint      *index_ranges,
                                                      gint             n_ranges);
-GdkRegion    *gdk_pango_layout_get_clip_region      (PangoLayout     *layout,
+cairo_region_t    *gdk_pango_layout_get_clip_region      (PangoLayout     *layout,
                                                      gint             x_origin,
                                                      gint             y_origin,
                                                      const gint      *index_ranges,
diff --git a/gdk/gdkregion.h b/gdk/gdkregion.h
index c00fb42..b1996ee 100644
--- a/gdk/gdkregion.h
+++ b/gdk/gdkregion.h
@@ -66,7 +66,7 @@ typedef void (* GdkSpanFunc) (GdkSpan *span,
 
 GdkRegion    * gdk_region_new             (void);
 #endif
-GdkRegion    * gdk_region_polygon         (const GdkPoint     *points,
+cairo_region_t * gdk_region_polygon       (const GdkPoint     *points,
                                            gint                n_points,
                                            GdkFillRule         fill_rule);
 #ifndef GDK_DISABLE_DEPRECATED
@@ -84,8 +84,8 @@ gboolean       gdk_region_empty           (const GdkRegion    *region);
 gboolean       gdk_region_equal           (const GdkRegion    *region1,
                                            const GdkRegion    *region2);
 #endif
-gboolean       gdk_region_rect_equal      (const GdkRegion    *region,
-                                           const GdkRectangle *rectangle);
+gboolean       gdk_region_rect_equal      (const cairo_region_t *region,
+                                           const GdkRectangle   *rectangle);
 #ifndef GDK_DISABLE_DEPRECATED
 gboolean       gdk_region_point_in        (const GdkRegion    *region,
                                            int                 x,
diff --git a/gdk/gdktypes.h b/gdk/gdktypes.h
index a35dca2..5ce626f 100644
--- a/gdk/gdktypes.h
+++ b/gdk/gdktypes.h
@@ -105,7 +105,9 @@ typedef struct _GdkColormap	      GdkColormap;
 typedef struct _GdkCursor	      GdkCursor;
 typedef struct _GdkGC                 GdkGC;
 typedef struct _GdkImage              GdkImage;
+#ifndef GDK_DISABLE_DEPRECATED
 typedef cairo_region_t                GdkRegion;
+#endif
 typedef struct _GdkVisual             GdkVisual;
 
 typedef struct _GdkDrawable           GdkDrawable;
@@ -272,6 +274,7 @@ struct _GdkPoint
   gint y;
 };
 
+#ifndef GDK_DISABLE_DEPRECATED
 struct _GdkRectangle
 {
   gint x;
@@ -279,6 +282,7 @@ struct _GdkRectangle
   gint width;
   gint height;
 };
+#endif
 
 struct _GdkSegment
 {
diff --git a/gdk/gdkwindow.c b/gdk/gdkwindow.c
index b4c84aa..afb2d42 100644
--- a/gdk/gdkwindow.c
+++ b/gdk/gdkwindow.c
@@ -211,7 +211,7 @@ typedef enum {
 
 struct _GdkWindowPaint
 {
-  GdkRegion *region;
+  cairo_region_t *region;
   GdkPixmap *pixmap;
   gint x_offset;
   gint y_offset;
@@ -222,7 +222,7 @@ struct _GdkWindowPaint
 };
 
 typedef struct {
-  GdkRegion *dest_region; /* The destination region */
+  cairo_region_t *dest_region; /* The destination region */
   int dx, dy; /* The amount that the source was moved to reach dest_region */
 } GdkWindowRegionMove;
 
@@ -353,8 +353,8 @@ static GdkDrawable* gdk_window_get_composite_drawable (GdkDrawable *drawable,
 						       gint         height,
 						       gint        *composite_x_offset,
 						       gint        *composite_y_offset);
-static GdkRegion*   gdk_window_get_clip_region        (GdkDrawable *drawable);
-static GdkRegion*   gdk_window_get_visible_region     (GdkDrawable *drawable);
+static cairo_region_t*   gdk_window_get_clip_region        (GdkDrawable *drawable);
+static cairo_region_t*   gdk_window_get_visible_region     (GdkDrawable *drawable);
 
 static void gdk_window_free_paint_stack (GdkWindow *window);
 
@@ -372,7 +372,7 @@ static void gdk_window_get_property (GObject      *object,
                                      GParamSpec   *pspec);
 
 static void gdk_window_clear_backing_region (GdkWindow *window,
-					     GdkRegion *region);
+					     cairo_region_t *region);
 static void gdk_window_redirect_free      (GdkWindowRedirect *redirect);
 static void apply_redirect_to_children    (GdkWindowObject   *private,
 					   GdkWindowRedirect *redirect);
@@ -385,17 +385,17 @@ static void recompute_visible_regions   (GdkWindowObject *private,
 static void gdk_window_flush_outstanding_moves (GdkWindow *window);
 static void gdk_window_flush_recursive  (GdkWindowObject *window);
 static void do_move_region_bits_on_impl (GdkWindowObject *private,
-					 GdkRegion *region, /* In impl window coords */
+					 cairo_region_t *region, /* In impl window coords */
 					 int dx, int dy);
 static void gdk_window_invalidate_in_parent (GdkWindowObject *private);
 static void move_native_children        (GdkWindowObject *private);
 static void update_cursor               (GdkDisplay *display,
                                          GdkDevice  *device);
 static void impl_window_add_update_area (GdkWindowObject *impl_window,
-					 GdkRegion *region);
+					 cairo_region_t *region);
 static void gdk_window_region_move_free (GdkWindowRegionMove *move);
 static void gdk_window_invalidate_region_full (GdkWindow       *window,
-					       const GdkRegion *region,
+					       const cairo_region_t *region,
 					       gboolean         invalidate_children,
 					       ClearBg          clear_bg);
 static void gdk_window_invalidate_rect_full (GdkWindow          *window,
@@ -796,13 +796,13 @@ static void
 remove_child_area (GdkWindowObject *private,
 		   GdkWindowObject *until,
 		   gboolean for_input,
-		   GdkRegion *region)
+		   cairo_region_t *region)
 {
   GdkWindowObject *child;
-  GdkRegion *child_region;
+  cairo_region_t *child_region;
   GdkRectangle r;
   GList *l;
-  GdkRegion *shape;
+  cairo_region_t *shape;
 
   for (l = private->children; l; l = l->next)
     {
@@ -948,7 +948,7 @@ should_apply_clip_as_shape (GdkWindowObject *private)
 
 static void
 apply_shape (GdkWindowObject *private,
-	     GdkRegion *region)
+	     cairo_region_t *region)
 {
   GdkWindowImplIface *impl_iface;
 
@@ -1012,7 +1012,7 @@ recompute_visible_regions_internal (GdkWindowObject *private,
   GdkRectangle r;
   GList *l;
   GdkWindowObject *child;
-  GdkRegion *new_clip, *old_clip_region_with_children;
+  cairo_region_t *new_clip, *old_clip_region_with_children;
   gboolean clip_region_changed;
   gboolean abs_pos_changed;
   int old_abs_x, old_abs_y;
@@ -2866,7 +2866,7 @@ gdk_window_flush_implicit_paint (GdkWindow *window)
   GdkWindowObject *private = (GdkWindowObject *)window;
   GdkWindowObject *impl_window;
   GdkWindowPaint *paint;
-  GdkRegion *region;
+  cairo_region_t *region;
   GdkGC *tmp_gc;
   GSList *list;
 
@@ -2954,7 +2954,7 @@ void
 gdk_window_begin_paint_rect (GdkWindow          *window,
 			     const GdkRectangle *rectangle)
 {
-  GdkRegion *region;
+  cairo_region_t *region;
 
   g_return_if_fail (GDK_IS_WINDOW (window));
 
@@ -3010,7 +3010,7 @@ gdk_window_begin_paint_rect (GdkWindow          *window,
  **/
 void
 gdk_window_begin_paint_region (GdkWindow       *window,
-			       const GdkRegion *region)
+			       const cairo_region_t *region)
 {
 #ifdef USE_BACKING_STORE
   GdkWindowObject *private = (GdkWindowObject *)window;
@@ -3107,9 +3107,9 @@ setup_redirect_clip (GdkWindow      *window,
 		     int            *y_offset_out)
 {
   GdkWindowObject *private = (GdkWindowObject *)window;
-  GdkRegion *visible_region;
+  cairo_region_t *visible_region;
   GdkRectangle dest_rect;
-  GdkRegion *tmpreg;
+  cairo_region_t *tmpreg;
   GdkWindow *toplevel;
   int x_offset, y_offset;
 
@@ -3172,7 +3172,7 @@ gdk_window_end_paint (GdkWindow *window)
   GdkGC *tmp_gc;
   GdkRectangle clip_box;
   gint x_offset, y_offset;
-  GdkRegion *full_clip;
+  cairo_region_t *full_clip;
 
   g_return_if_fail (GDK_IS_WINDOW (window));
 
@@ -3302,7 +3302,7 @@ gdk_window_free_paint_stack (GdkWindow *window)
 
 static void
 do_move_region_bits_on_impl (GdkWindowObject *impl_window,
-			     GdkRegion *dest_region, /* In impl window coords */
+			     cairo_region_t *dest_region, /* In impl window coords */
 			     int dx, int dy)
 {
   GdkGC *tmp_gc;
@@ -3347,7 +3347,7 @@ do_move_region_bits_on_impl (GdkWindowObject *impl_window,
 }
 
 static GdkWindowRegionMove *
-gdk_window_region_move_new (GdkRegion *region,
+gdk_window_region_move_new (cairo_region_t *region,
 			    int dx, int dy)
 {
   GdkWindowRegionMove *move;
@@ -3369,13 +3369,13 @@ gdk_window_region_move_free (GdkWindowRegionMove *move)
 
 static void
 append_move_region (GdkWindowObject *impl_window,
-		    GdkRegion *new_dest_region,
+		    cairo_region_t *new_dest_region,
 		    int dx, int dy)
 {
   GdkWindowRegionMove *move, *old_move;
-  GdkRegion *new_total_region, *old_total_region;
-  GdkRegion *source_overlaps_destination;
-  GdkRegion *non_overwritten;
+  cairo_region_t *new_total_region, *old_total_region;
+  cairo_region_t *source_overlaps_destination;
+  cairo_region_t *non_overwritten;
   gboolean added_move;
   GList *l, *prev;
 
@@ -3484,7 +3484,7 @@ append_move_region (GdkWindowObject *impl_window,
    Takes ownership of region to avoid copy (because we may change it) */
 static void
 move_region_on_impl (GdkWindowObject *impl_window,
-		     GdkRegion *region, /* In impl window coords */
+		     cairo_region_t *region, /* In impl window coords */
 		     int dx, int dy)
 {
   if ((dx == 0 && dy == 0) ||
@@ -3499,7 +3499,7 @@ move_region_on_impl (GdkWindowObject *impl_window,
   /* Move any old invalid regions in the copy source area by dx/dy */
   if (impl_window->update_area)
     {
-      GdkRegion *update_area;
+      cairo_region_t *update_area;
 
       update_area = cairo_region_copy (region);
 
@@ -3528,7 +3528,7 @@ move_region_on_impl (GdkWindowObject *impl_window,
   if (impl_window->implicit_paint)
     {
       GdkWindowPaint *implicit_paint = impl_window->implicit_paint;
-      GdkRegion *exposing;
+      cairo_region_t *exposing;
 
       exposing = cairo_region_copy (implicit_paint->region);
       cairo_region_intersect (exposing, region);
@@ -3747,7 +3747,7 @@ start_draw_helper (GdkDrawable *drawable,
   GdkDrawable *impl;
   gint old_clip_x = gc->clip_x_origin;
   gint old_clip_y = gc->clip_y_origin;
-  GdkRegion *clip;
+  cairo_region_t *clip;
   guint32 clip_region_tag;
   GdkWindowPaint *paint;
 
@@ -4186,17 +4186,17 @@ gdk_window_get_composite_drawable (GdkDrawable *drawable,
   return tmp_pixmap;
 }
 
-static GdkRegion*
+static cairo_region_t*
 gdk_window_get_clip_region (GdkDrawable *drawable)
 {
   GdkWindowObject *private = (GdkWindowObject *)drawable;
-  GdkRegion *result;
+  cairo_region_t *result;
 
   result = cairo_region_copy (private->clip_region);
 
   if (private->paint_stack)
     {
-      GdkRegion *paint_region = cairo_region_create ();
+      cairo_region_t *paint_region = cairo_region_create ();
       GSList *tmp_list = private->paint_stack;
 
       while (tmp_list)
@@ -4215,7 +4215,7 @@ gdk_window_get_clip_region (GdkDrawable *drawable)
   return result;
 }
 
-static GdkRegion*
+static cairo_region_t*
 gdk_window_get_visible_region (GdkDrawable *drawable)
 {
   GdkWindowObject *private = (GdkWindowObject*) drawable;
@@ -4258,8 +4258,8 @@ gdk_window_draw_drawable (GdkDrawable *drawable,
       if (_gdk_gc_get_exposures (gc) &&
 	  GDK_IS_WINDOW (original_src))
 	{
-	  GdkRegion *exposure_region;
-	  GdkRegion *clip;
+	  cairo_region_t *exposure_region;
+	  cairo_region_t *clip;
 	  GdkRectangle r;
 
 	  r.x = xdest;
@@ -4567,12 +4567,12 @@ setup_backing_rect_method (BackingRectMethod *method, GdkWindow *window, GdkWind
 
 static void
 gdk_window_clear_backing_region (GdkWindow *window,
-				 GdkRegion *region)
+				 cairo_region_t *region)
 {
   GdkWindowObject *private = (GdkWindowObject *)window;
   GdkWindowPaint *paint = private->paint_stack->data;
   BackingRectMethod method;
-  GdkRegion *clip;
+  cairo_region_t *clip;
   GdkRectangle clipbox;
 #if 0
   GTimer *timer;
@@ -4633,11 +4633,11 @@ gdk_window_clear_backing_region (GdkWindow *window,
 
 static void
 gdk_window_clear_backing_region_redirect (GdkWindow *window,
-					  GdkRegion *region)
+					  cairo_region_t *region)
 {
   GdkWindowObject *private = (GdkWindowObject *)window;
   GdkWindowRedirect *redirect = private->redirect;
-  GdkRegion *clip_region;
+  cairo_region_t *clip_region;
   GdkRectangle clipbox;
   gint x_offset, y_offset;
   BackingRectMethod method;
@@ -4697,12 +4697,12 @@ gdk_window_clear_backing_region_redirect (GdkWindow *window,
 
 static void
 gdk_window_clear_backing_region_direct (GdkWindow *window,
-					GdkRegion *region)
+					cairo_region_t *region)
 {
   GdkWindowObject *private = (GdkWindowObject *)window;
   BackingRectMethod method;
   GdkWindowPaint paint;
-  GdkRegion *clip;
+  cairo_region_t *clip;
   GdkRectangle clipbox;
 
   if (GDK_WINDOW_DESTROYED (window))
@@ -4790,7 +4790,7 @@ clears_as_native (GdkWindowObject *private)
 
 static void
 gdk_window_clear_region_internal (GdkWindow *window,
-				  GdkRegion *region,
+				  cairo_region_t *region,
 				  gboolean   send_expose)
 {
   GdkWindowObject *private = (GdkWindowObject *)window;
@@ -4807,7 +4807,7 @@ gdk_window_clear_region_internal (GdkWindow *window,
 
       if (impl_iface->clear_region && clears_as_native (private))
 	{
-	  GdkRegion *copy;
+	  cairo_region_t *copy;
 	  copy = cairo_region_copy (region);
 	  cairo_region_intersect (copy,
 				private->clip_region_with_children);
@@ -4838,7 +4838,7 @@ gdk_window_clear_area_internal (GdkWindow *window,
 				gboolean   send_expose)
 {
   GdkRectangle rect;
-  GdkRegion *region;
+  cairo_region_t *region;
 
   g_return_if_fail (GDK_IS_WINDOW (window));
 
@@ -5381,11 +5381,11 @@ gdk_window_schedule_update (GdkWindow *window)
 
 void
 _gdk_window_process_updates_recurse (GdkWindow *window,
-				     GdkRegion *expose_region)
+				     cairo_region_t *expose_region)
 {
   GdkWindowObject *private = (GdkWindowObject *)window;
   GdkWindowObject *child;
-  GdkRegion *child_region;
+  cairo_region_t *child_region;
   GdkRectangle r;
   GList *l, *children;
 
@@ -5505,12 +5505,12 @@ gdk_window_process_updates_internal (GdkWindow *window)
    */
   if (private->update_area)
     {
-      GdkRegion *update_area = private->update_area;
+      cairo_region_t *update_area = private->update_area;
       private->update_area = NULL;
 
       if (_gdk_event_func && gdk_window_is_viewable (window))
 	{
-	  GdkRegion *expose_region;
+	  cairo_region_t *expose_region;
 	  gboolean end_implicit;
 
 	  /* Clip to part visible in toplevel */
@@ -5532,7 +5532,7 @@ gdk_window_process_updates_internal (GdkWindow *window)
 	  if (private->outstanding_moves)
 	    {
 	      GdkWindowRegionMove *move;
-	      GdkRegion *remove;
+	      cairo_region_t *remove;
 	      GList *l, *prev;
 
 	      remove = cairo_region_copy (update_area);
@@ -5822,7 +5822,7 @@ gdk_window_invalidate_rect_full (GdkWindow          *window,
 				  ClearBg             clear_bg)
 {
   GdkRectangle window_rect;
-  GdkRegion *region;
+  cairo_region_t *region;
   GdkWindowObject *private = (GdkWindowObject *)window;
 
   g_return_if_fail (GDK_IS_WINDOW (window));
@@ -5869,7 +5869,7 @@ gdk_window_invalidate_rect (GdkWindow          *window,
 
 static void
 draw_ugly_color (GdkWindow       *window,
-		 const GdkRegion *region)
+		 const cairo_region_t *region)
 {
   /* Draw ugly color all over the newly-invalid region */
   GdkColor ugly_color = { 0, 50000, 10000, 10000 };
@@ -5893,7 +5893,7 @@ draw_ugly_color (GdkWindow       *window,
 
 static void
 impl_window_add_update_area (GdkWindowObject *impl_window,
-			     GdkRegion *region)
+			     cairo_region_t *region)
 {
   if (impl_window->update_area)
     cairo_region_union (impl_window->update_area, region);
@@ -5917,7 +5917,7 @@ impl_window_add_update_area (GdkWindowObject *impl_window,
  */
 static void
 gdk_window_invalidate_maybe_recurse_full (GdkWindow       *window,
-					  const GdkRegion *region,
+					  const cairo_region_t *region,
 					  ClearBg          clear_bg,
 					  gboolean       (*child_func) (GdkWindow *,
 									gpointer),
@@ -5925,7 +5925,7 @@ gdk_window_invalidate_maybe_recurse_full (GdkWindow       *window,
 {
   GdkWindowObject *private = (GdkWindowObject *)window;
   GdkWindowObject *impl_window;
-  GdkRegion *visible_region;
+  cairo_region_t *visible_region;
   GList *tmp_list;
 
   g_return_if_fail (GDK_IS_WINDOW (window));
@@ -5949,7 +5949,7 @@ gdk_window_invalidate_maybe_recurse_full (GdkWindow       *window,
 
       if (!child->input_only)
 	{
-	  GdkRegion *child_region;
+	  cairo_region_t *child_region;
 	  GdkRectangle child_rect;
 
 	  child_rect.x = child->x;
@@ -5966,7 +5966,7 @@ gdk_window_invalidate_maybe_recurse_full (GdkWindow       *window,
 
 	  if (child_func && (*child_func) ((GdkWindow *)child, user_data))
 	    {
-	      GdkRegion *tmp = cairo_region_copy (region);
+	      cairo_region_t *tmp = cairo_region_copy (region);
 
 	      cairo_region_translate (tmp, - child_rect.x, - child_rect.y);
 	      cairo_region_translate (child_region, - child_rect.x, - child_rect.y);
@@ -6016,7 +6016,7 @@ gdk_window_invalidate_maybe_recurse_full (GdkWindow       *window,
 /**
  * gdk_window_invalidate_maybe_recurse:
  * @window: a #GdkWindow
- * @region: a #GdkRegion
+ * @region: a #cairo_region_t
  * @child_func: function to use to decide if to recurse to a child,
  *              %NULL means never recurse.
  * @user_data: data passed to @child_func
@@ -6040,7 +6040,7 @@ gdk_window_invalidate_maybe_recurse_full (GdkWindow       *window,
  **/
 void
 gdk_window_invalidate_maybe_recurse (GdkWindow       *window,
-				     const GdkRegion *region,
+				     const cairo_region_t *region,
 				     gboolean       (*child_func) (GdkWindow *,
 								   gpointer),
 				     gpointer   user_data)
@@ -6058,7 +6058,7 @@ true_predicate (GdkWindow *window,
 
 static void
 gdk_window_invalidate_region_full (GdkWindow       *window,
-				    const GdkRegion *region,
+				    const cairo_region_t *region,
 				    gboolean         invalidate_children,
 				    ClearBg          clear_bg)
 {
@@ -6071,7 +6071,7 @@ gdk_window_invalidate_region_full (GdkWindow       *window,
 /**
  * gdk_window_invalidate_region:
  * @window: a #GdkWindow
- * @region: a #GdkRegion
+ * @region: a #cairo_region_t
  * @invalidate_children: %TRUE to also invalidate child windows
  *
  * Adds @region to the update area for @window. The update area is the
@@ -6094,7 +6094,7 @@ gdk_window_invalidate_region_full (GdkWindow       *window,
  **/
 void
 gdk_window_invalidate_region (GdkWindow       *window,
-			      const GdkRegion *region,
+			      const cairo_region_t *region,
 			      gboolean         invalidate_children)
 {
   gdk_window_invalidate_maybe_recurse (window, region,
@@ -6106,7 +6106,7 @@ gdk_window_invalidate_region (GdkWindow       *window,
 /**
  * _gdk_window_invalidate_for_expose:
  * @window: a #GdkWindow
- * @region: a #GdkRegion
+ * @region: a #cairo_region_t
  *
  * Adds @region to the update area for @window. The update area is the
  * region that needs to be redrawn, or "dirty region." The call
@@ -6127,11 +6127,11 @@ gdk_window_invalidate_region (GdkWindow       *window,
  **/
 void
 _gdk_window_invalidate_for_expose (GdkWindow       *window,
-				   GdkRegion       *region)
+				   cairo_region_t       *region)
 {
   GdkWindowObject *private = (GdkWindowObject *) window;
   GdkWindowRegionMove *move;
-  GdkRegion *move_region;
+  cairo_region_t *move_region;
   GList *l;
 
   /* Any invalidations comming from the windowing system will
@@ -6177,12 +6177,12 @@ _gdk_window_invalidate_for_expose (GdkWindow       *window,
  *
  * Return value: the update area for @window
  **/
-GdkRegion *
+cairo_region_t *
 gdk_window_get_update_area (GdkWindow *window)
 {
   GdkWindowObject *private = (GdkWindowObject *)window;
   GdkWindowObject *impl_window;
-  GdkRegion *tmp_region;
+  cairo_region_t *tmp_region;
 
   g_return_val_if_fail (GDK_IS_WINDOW (window), NULL);
 
@@ -6920,7 +6920,7 @@ void
 gdk_window_raise (GdkWindow *window)
 {
   GdkWindowObject *private;
-  GdkRegion *old_region, *new_region;
+  cairo_region_t *old_region, *new_region;
 
   g_return_if_fail (GDK_IS_WINDOW (window));
 
@@ -7542,7 +7542,7 @@ gdk_window_move_resize_toplevel (GdkWindow *window,
 				 gint       height)
 {
   GdkWindowObject *private;
-  GdkRegion *old_region, *new_region;
+  cairo_region_t *old_region, *new_region;
   GdkWindowImplIface *impl_iface;
   gboolean expose;
   int old_x, old_y, old_abs_x, old_abs_y;
@@ -7624,12 +7624,12 @@ move_native_children (GdkWindowObject *private)
 static gboolean
 collect_native_child_region_helper (GdkWindowObject *window,
 				    GdkWindow *impl,
-				    GdkRegion **region,
+				    cairo_region_t **region,
 				    int x_offset,
 				    int y_offset)
 {
   GdkWindowObject *child;
-  GdkRegion *tmp;
+  cairo_region_t *tmp;
   GList *l;
 
   for (l = window->children; l != NULL; l = l->next)
@@ -7662,11 +7662,11 @@ collect_native_child_region_helper (GdkWindowObject *window,
   return FALSE;
 }
 
-static GdkRegion *
+static cairo_region_t *
 collect_native_child_region (GdkWindowObject *window,
 			     gboolean include_this)
 {
-  GdkRegion *region;
+  cairo_region_t *region;
 
   if (include_this && gdk_window_has_impl (window) && window->viewable)
     return cairo_region_copy (window->clip_region);
@@ -7688,8 +7688,8 @@ gdk_window_move_resize_internal (GdkWindow *window,
 				 gint       height)
 {
   GdkWindowObject *private;
-  GdkRegion *old_region, *new_region, *copy_area;
-  GdkRegion *old_native_child_region, *new_native_child_region;
+  cairo_region_t *old_region, *new_region, *copy_area;
+  cairo_region_t *old_native_child_region, *new_native_child_region;
   GdkWindowObject *impl_window;
   GdkWindowImplIface *impl_iface;
   gboolean expose;
@@ -7975,8 +7975,8 @@ gdk_window_scroll (GdkWindow *window,
 {
   GdkWindowObject *private = (GdkWindowObject *) window;
   GdkWindowObject *impl_window;
-  GdkRegion *copy_area, *noncopy_area;
-  GdkRegion *old_native_child_region, *new_native_child_region;
+  cairo_region_t *copy_area, *noncopy_area;
+  cairo_region_t *old_native_child_region, *new_native_child_region;
   GList *tmp_list;
 
   g_return_if_fail (GDK_IS_WINDOW (window));
@@ -8078,7 +8078,7 @@ gdk_window_scroll (GdkWindow *window,
 /**
  * gdk_window_move_region:
  * @window: a #GdkWindow
- * @region: The #GdkRegion to move
+ * @region: The #cairo_region_t to move
  * @dx: Amount to move in the X direction
  * @dy: Amount to move in the Y direction
  *
@@ -8092,14 +8092,14 @@ gdk_window_scroll (GdkWindow *window,
  */
 void
 gdk_window_move_region (GdkWindow       *window,
-			const GdkRegion *region,
+			const cairo_region_t *region,
 			gint             dx,
 			gint             dy)
 {
   GdkWindowObject *private = (GdkWindowObject *) window;
   GdkWindowObject *impl_window;
-  GdkRegion *nocopy_area;
-  GdkRegion *copy_area;
+  cairo_region_t *nocopy_area;
+  cairo_region_t *copy_area;
 
   g_return_if_fail (GDK_IS_WINDOW (window));
   g_return_if_fail (region != NULL);
@@ -8847,7 +8847,7 @@ gdk_window_shape_combine_mask (GdkWindow *window,
 			       gint       y)
 {
   GdkWindowObject *private;
-  GdkRegion *region;
+  cairo_region_t *region;
 
   g_return_if_fail (GDK_IS_WINDOW (window));
 
@@ -8891,12 +8891,12 @@ gdk_window_shape_combine_mask (GdkWindow *window,
  */
 void
 gdk_window_shape_combine_region (GdkWindow       *window,
-				 const GdkRegion *shape_region,
+				 const cairo_region_t *shape_region,
 				 gint             offset_x,
 				 gint             offset_y)
 {
   GdkWindowObject *private;
-  GdkRegion *old_region, *new_region, *diff;
+  cairo_region_t *old_region, *new_region, *diff;
 
   g_return_if_fail (GDK_IS_WINDOW (window));
 
@@ -8965,7 +8965,7 @@ do_child_shapes (GdkWindow *window,
 {
   GdkWindowObject *private;
   GdkRectangle r;
-  GdkRegion *region;
+  cairo_region_t *region;
 
   private = (GdkWindowObject *) window;
 
@@ -9054,7 +9054,7 @@ gdk_window_input_shape_combine_mask (GdkWindow *window,
 				     gint       y)
 {
   GdkWindowObject *private;
-  GdkRegion *region;
+  cairo_region_t *region;
 
   g_return_if_fail (GDK_IS_WINDOW (window));
 
@@ -9101,7 +9101,7 @@ gdk_window_input_shape_combine_mask (GdkWindow *window,
  */
 void
 gdk_window_input_shape_combine_region (GdkWindow       *window,
-				       const GdkRegion *shape_region,
+				       const cairo_region_t *shape_region,
 				       gint             offset_x,
 				       gint             offset_y)
 {
@@ -9142,7 +9142,7 @@ do_child_input_shapes (GdkWindow *window,
 {
   GdkWindowObject *private;
   GdkRectangle r;
-  GdkRegion *region;
+  cairo_region_t *region;
 
   private = (GdkWindowObject *) window;
 
@@ -9594,7 +9594,7 @@ window_get_size_rectangle (GdkWindow    *window,
 /* Calculates the real clipping region for a window, in window coordinates,
  * taking into account other windows, gc clip region and gc clip mask.
  */
-GdkRegion *
+cairo_region_t *
 _gdk_window_calculate_full_clip_region (GdkWindow *window,
 					GdkWindow *base_window,
 					gboolean   do_children,
@@ -9603,7 +9603,7 @@ _gdk_window_calculate_full_clip_region (GdkWindow *window,
 {
   GdkWindowObject *private = GDK_WINDOW_OBJECT (window);
   GdkRectangle visible_rect;
-  GdkRegion *real_clip_region, *tmpreg;
+  cairo_region_t *real_clip_region, *tmpreg;
   gint x_offset, y_offset;
   GdkWindowObject *parentwin, *lastwin;
 
@@ -9698,7 +9698,7 @@ _gdk_window_calculate_full_clip_region (GdkWindow *window,
 
 void
 _gdk_window_add_damage (GdkWindow *toplevel,
-			GdkRegion *damaged_region)
+			cairo_region_t *damaged_region)
 {
   GdkDisplay *display;
   GdkEvent event = { 0, };
diff --git a/gdk/gdkwindow.h b/gdk/gdkwindow.h
index 640f6af..6013a7f 100644
--- a/gdk/gdkwindow.h
+++ b/gdk/gdkwindow.h
@@ -524,7 +524,7 @@ struct _GdkWindowObject
   
   GSList *GSEAL (paint_stack);
   
-  GdkRegion *GSEAL (update_area);
+  cairo_region_t *GSEAL (update_area);
   guint GSEAL (update_freeze_count);
   
   guint8 GSEAL (window_type);
@@ -630,7 +630,7 @@ void          gdk_window_scroll                (GdkWindow     *window,
                                                 gint           dx,
                                                 gint           dy);
 void	      gdk_window_move_region           (GdkWindow       *window,
-						const GdkRegion *region,
+						const cairo_region_t *region,
 						gint             dx,
 						gint             dy);
 gboolean      gdk_window_ensure_native        (GdkWindow       *window);
@@ -646,7 +646,7 @@ void gdk_window_shape_combine_mask  (GdkWindow	      *window,
                                      gint	       x,
                                      gint	       y);
 void gdk_window_shape_combine_region (GdkWindow	      *window,
-                                      const GdkRegion *shape_region,
+                                      const cairo_region_t *shape_region,
                                       gint	       offset_x,
                                       gint	       offset_y);
 
@@ -677,7 +677,7 @@ void gdk_window_input_shape_combine_mask   (GdkWindow       *window,
 					    gint             x,
 					    gint             y);
 void gdk_window_input_shape_combine_region (GdkWindow       *window,
-                                            const GdkRegion *shape_region,
+                                            const cairo_region_t *shape_region,
                                             gint             offset_x,
                                             gint             offset_y);
 void gdk_window_set_child_input_shapes     (GdkWindow       *window);
@@ -739,7 +739,7 @@ void          gdk_set_sm_client_id          (const gchar        *sm_client_id);
 void	      gdk_window_begin_paint_rect   (GdkWindow          *window,
 					     const GdkRectangle *rectangle);
 void	      gdk_window_begin_paint_region (GdkWindow          *window,
-					     const GdkRegion    *region);
+					     const cairo_region_t    *region);
 void	      gdk_window_end_paint          (GdkWindow          *window);
 void	      gdk_window_flush             (GdkWindow          *window);
 
@@ -892,13 +892,13 @@ void       gdk_window_invalidate_rect           (GdkWindow          *window,
 					         const GdkRectangle *rect,
 					         gboolean            invalidate_children);
 void       gdk_window_invalidate_region         (GdkWindow          *window,
-					         const GdkRegion    *region,
+					         const cairo_region_t    *region,
 					         gboolean            invalidate_children);
 void       gdk_window_invalidate_maybe_recurse  (GdkWindow          *window,
-						 const GdkRegion    *region,
+						 const cairo_region_t    *region,
 						 gboolean (*child_func) (GdkWindow *, gpointer),
 						 gpointer   user_data);
-GdkRegion *gdk_window_get_update_area     (GdkWindow    *window);
+cairo_region_t *gdk_window_get_update_area     (GdkWindow    *window);
 
 void       gdk_window_freeze_updates      (GdkWindow    *window);
 void       gdk_window_thaw_updates        (GdkWindow    *window);
diff --git a/gdk/gdkwindowimpl.h b/gdk/gdkwindowimpl.h
index dc0ca75..089706f 100644
--- a/gdk/gdkwindowimpl.h
+++ b/gdk/gdkwindowimpl.h
@@ -75,7 +75,7 @@ struct _GdkWindowImplIface
                                          gint             x,
                                          gint             y);
   void         (* clear_region)         (GdkWindow       *window,
-					 GdkRegion       *region,
+					 cairo_region_t       *region,
 					 gboolean         send_expose);
 
   void         (* set_device_cursor)    (GdkWindow       *window,
@@ -103,11 +103,11 @@ struct _GdkWindowImplIface
                                          GdkModifierType *mask);
 
   void         (* shape_combine_region) (GdkWindow       *window,
-                                         const GdkRegion *shape_region,
+                                         const cairo_region_t *shape_region,
                                          gint             offset_x,
                                          gint             offset_y);
   void         (* input_shape_combine_region) (GdkWindow       *window,
-					       const GdkRegion *shape_region,
+					       const cairo_region_t *shape_region,
 					       gint             offset_x,
 					       gint             offset_y);
 
@@ -121,10 +121,10 @@ struct _GdkWindowImplIface
    * for destroying the region later.
    */
   gboolean     (* queue_antiexpose)     (GdkWindow       *window,
-					 GdkRegion       *update_area);
+					 cairo_region_t       *update_area);
   void         (* queue_translation)    (GdkWindow       *window,
 					 GdkGC           *gc,
-					 GdkRegion       *area,
+					 cairo_region_t       *area,
 					 gint            dx,
 					 gint            dy);
 
@@ -164,7 +164,7 @@ struct _GdkWindowRedirect
   gint width;
   gint height;
 
-  GdkRegion *damage;
+  cairo_region_t *damage;
   guint damage_idle;
 };
 
diff --git a/gdk/quartz/GdkQuartzView.c b/gdk/quartz/GdkQuartzView.c
index 7249db7..656f8e2 100644
--- a/gdk/quartz/GdkQuartzView.c
+++ b/gdk/quartz/GdkQuartzView.c
@@ -19,8 +19,6 @@
  */
 
 #import "GdkQuartzView.h"
-#include "gdkregion.h"
-#include "gdkregion-generic.h"
 #include "gdkwindow-quartz.h"
 #include "gdkprivate-quartz.h"
 #include "gdkquartz.h"
diff --git a/gdk/quartz/gdkgc-quartz.c b/gdk/quartz/gdkgc-quartz.c
index 8f1a6de..b104d9e 100644
--- a/gdk/quartz/gdkgc-quartz.c
+++ b/gdk/quartz/gdkgc-quartz.c
@@ -264,7 +264,7 @@ _gdk_quartz_gc_new (GdkDrawable      *drawable,
 
 void
 _gdk_windowing_gc_set_clip_region (GdkGC           *gc,
-				   const GdkRegion *region,
+				   const cairo_region_t *region,
 				   gboolean         reset_origin)
 {
   GdkGCQuartz *private = GDK_GC_QUARTZ (gc);
diff --git a/gdk/quartz/gdkgeometry-quartz.c b/gdk/quartz/gdkgeometry-quartz.c
index 12e8a0f..9881cd7 100644
--- a/gdk/quartz/gdkgeometry-quartz.c
+++ b/gdk/quartz/gdkgeometry-quartz.c
@@ -25,7 +25,7 @@
 void
 _gdk_quartz_window_queue_translation (GdkWindow *window,
 				      GdkGC     *gc,
-                                      GdkRegion *area,
+                                      cairo_region_t *area,
                                       gint       dx,
                                       gint       dy)
 {
@@ -33,7 +33,7 @@ _gdk_quartz_window_queue_translation (GdkWindow *window,
   GdkWindowImplQuartz *impl = (GdkWindowImplQuartz *)private->impl;
 
   int i, n_rects;
-  GdkRegion *intersection;
+  cairo_region_t *intersection;
   GdkRectangle rect;
 
   /* We will intersect the known region that needs display with the given
@@ -54,7 +54,7 @@ _gdk_quartz_window_queue_translation (GdkWindow *window,
 
 gboolean
 _gdk_quartz_window_queue_antiexpose (GdkWindow *window,
-                                     GdkRegion *area)
+                                     cairo_region_t *area)
 {
   return FALSE;
 }
diff --git a/gdk/quartz/gdkprivate-quartz.h b/gdk/quartz/gdkprivate-quartz.h
index 6b641a5..b1421fd 100644
--- a/gdk/quartz/gdkprivate-quartz.h
+++ b/gdk/quartz/gdkprivate-quartz.h
@@ -158,7 +158,7 @@ void       _gdk_quartz_window_debug_highlight       (GdkWindow *window,
                                                      gint       number);
 
 void       _gdk_quartz_window_set_needs_display_in_region (GdkWindow    *window,
-                                                           GdkRegion    *region);
+                                                           cairo_region_t    *region);
 
 void       _gdk_quartz_window_update_position           (GdkWindow    *window);
 
@@ -203,10 +203,10 @@ void        _gdk_quartz_window_scroll      (GdkWindow       *window,
                                             gint             dy);
 void        _gdk_quartz_window_queue_translation (GdkWindow *window,
 						  GdkGC     *gc,
-                                                  GdkRegion *area,
+                                                  cairo_region_t *area,
                                                   gint       dx,
                                                   gint       dy);
 gboolean    _gdk_quartz_window_queue_antiexpose  (GdkWindow *window,
-                                                  GdkRegion *area);
+                                                  cairo_region_t *area);
 
 #endif /* __GDK_PRIVATE_QUARTZ_H__ */
diff --git a/gdk/quartz/gdkwindow-quartz.c b/gdk/quartz/gdkwindow-quartz.c
index dd2f0d3..493d22d 100644
--- a/gdk/quartz/gdkwindow-quartz.c
+++ b/gdk/quartz/gdkwindow-quartz.c
@@ -225,13 +225,13 @@ gdk_window_impl_quartz_init (GdkWindowImplQuartz *impl)
 static void
 gdk_window_impl_quartz_begin_paint_region (GdkPaintable    *paintable,
                                            GdkWindow       *window,
-					   const GdkRegion *region)
+					   const cairo_region_t *region)
 {
   GdkWindowImplQuartz *impl = GDK_WINDOW_IMPL_QUARTZ (paintable);
   GdkWindowObject *private = (GdkWindowObject*)window;
   int n_rects;
   GdkPixmap *bg_pixmap;
-  GdkRegion *clipped_and_offset_region;
+  cairo_region_t *clipped_and_offset_region;
   gboolean free_clipped_and_offset_region = TRUE;
 
   bg_pixmap = private->bg_pixmap;
@@ -363,7 +363,7 @@ gdk_window_impl_quartz_end_paint (GdkPaintable *paintable)
 
 void
 _gdk_quartz_window_set_needs_display_in_region (GdkWindow    *window,
-                                                GdkRegion    *region)
+                                                cairo_region_t    *region)
 {
   GdkWindowObject *private;
   GdkWindowImplQuartz *impl;
@@ -389,7 +389,7 @@ _gdk_quartz_window_set_needs_display_in_region (GdkWindow    *window,
 
 void
 _gdk_windowing_window_process_updates_recurse (GdkWindow *window,
-                                               GdkRegion *region)
+                                               cairo_region_t *region)
 {
   /* Make sure to only flush each toplevel at most once if we're called
    * from process_all_updates.
@@ -1322,8 +1322,8 @@ move_resize_window_internal (GdkWindow *window,
   GdkRectangle old_visible;
   GdkRectangle new_visible;
   GdkRectangle scroll_rect;
-  GdkRegion *old_region;
-  GdkRegion *expose_region;
+  cairo_region_t *old_region;
+  cairo_region_t *expose_region;
   NSSize delta;
 
   if (GDK_WINDOW_DESTROYED (window))
@@ -2273,7 +2273,7 @@ gdk_window_set_transient_for (GdkWindow *window,
 
 static void
 gdk_window_quartz_shape_combine_region (GdkWindow       *window,
-                                        const GdkRegion *shape,
+                                        const cairo_region_t *shape,
                                         gint             x,
                                         gint             y)
 {
@@ -2282,7 +2282,7 @@ gdk_window_quartz_shape_combine_region (GdkWindow       *window,
 
 static void
 gdk_window_quartz_input_shape_combine_region (GdkWindow       *window,
-                                              const GdkRegion *shape_region,
+                                              const cairo_region_t *shape_region,
                                               gint             offset_x,
                                               gint             offset_y)
 {
@@ -2717,7 +2717,7 @@ gdk_window_set_functions (GdkWindow    *window,
 
 gboolean
 _gdk_windowing_window_queue_antiexpose (GdkWindow  *window,
-					GdkRegion  *area)
+					cairo_region_t  *area)
 {
   return FALSE;
 }
@@ -3057,21 +3057,21 @@ _gdk_windowing_window_set_composited (GdkWindow *window, gboolean composited)
 {
 }
 
-GdkRegion *
+cairo_region_t *
 _gdk_windowing_get_shape_for_mask (GdkBitmap *mask)
 {
   /* FIXME: implement */
   return NULL;
 }
 
-GdkRegion *
+cairo_region_t *
 _gdk_windowing_window_get_shape (GdkWindow *window)
 {
   /* FIXME: implement */
   return NULL;
 }
 
-GdkRegion *
+cairo_region_t *
 _gdk_windowing_window_get_input_shape (GdkWindow *window)
 {
   /* FIXME: implement */
diff --git a/gdk/quartz/gdkwindow-quartz.h b/gdk/quartz/gdkwindow-quartz.h
index 4a0e27a..c022b99 100644
--- a/gdk/quartz/gdkwindow-quartz.h
+++ b/gdk/quartz/gdkwindow-quartz.h
@@ -50,7 +50,7 @@ struct _GdkWindowImplQuartz
 
   GdkWindowTypeHint type_hint;
 
-  GdkRegion *paint_clip_region;
+  cairo_region_t *paint_clip_region;
   gint begin_paint_count;
   gint in_paint_rect_count;
 
@@ -59,7 +59,7 @@ struct _GdkWindowImplQuartz
   /* Sorted by z-order */
   GList *sorted_children;
 
-  GdkRegion *needs_display_region;
+  cairo_region_t *needs_display_region;
 };
  
 struct _GdkWindowImplQuartzClass 
diff --git a/gdk/win32/gdkdrawable-win32.c b/gdk/win32/gdkdrawable-win32.c
index 10bcdf5..83d8727 100644
--- a/gdk/win32/gdkdrawable-win32.c
+++ b/gdk/win32/gdkdrawable-win32.c
@@ -35,7 +35,6 @@
 #include <cairo-win32.h>
 
 #include "gdkscreen.h" /* gdk_screen_get_default() */
-#include "gdkregion-generic.h"
 #include "gdkprivate-win32.h"
 
 #define ROP3_D 0x00AA0029
@@ -486,7 +485,7 @@ generic_draw (GdkDrawable    *drawable,
 	      GdkGC          *gc,
 	      GdkGCValuesMask mask,
 	      void (*function) (GdkGCWin32 *, HDC, gint, gint, va_list),
-	      const GdkRegion *region,
+	      const cairo_region_t *region,
 	      ...)
 {
   GdkDrawableImplWin32 *impl = GDK_DRAWABLE_IMPL_WIN32 (drawable);
@@ -709,7 +708,7 @@ generic_draw (GdkDrawable    *drawable,
   va_end (args);
 }
 
-static GdkRegion *
+static cairo_region_t *
 widen_bounds (GdkRectangle *bounds,
 	      gint          pen_width)
 {
@@ -780,7 +779,7 @@ gdk_win32_draw_rectangle (GdkDrawable *drawable,
 			  gint         height)
 {
   GdkRectangle bounds;
-  GdkRegion *region;
+  cairo_region_t *region;
 
   GDK_NOTE (DRAW, g_print ("gdk_win32_draw_rectangle: %s (%p) %s%dx%d %+d%+d\n",
 			   _gdk_win32_drawable_description (drawable),
@@ -878,7 +877,7 @@ gdk_win32_draw_arc (GdkDrawable *drawable,
 		    gint         angle2)
 {
   GdkRectangle bounds;
-  GdkRegion *region;
+  cairo_region_t *region;
 
   GDK_NOTE (DRAW, g_print ("gdk_win32_draw_arc: %s  %d,%d,%d,%d  %d %d\n",
 			   _gdk_win32_drawable_description (drawable),
@@ -943,7 +942,7 @@ gdk_win32_draw_polygon (GdkDrawable *drawable,
 			gint         npoints)
 {
   GdkRectangle bounds;
-  GdkRegion *region;
+  cairo_region_t *region;
   POINT *pts;
   int i;
 
@@ -1119,7 +1118,7 @@ gdk_win32_draw_segments (GdkDrawable *drawable,
 			 gint         nsegs)
 {
   GdkRectangle bounds;
-  GdkRegion *region;
+  cairo_region_t *region;
   gint i;
 
   GDK_NOTE (DRAW, g_print ("gdk_win32_draw_segments: %s %d segs\n",
@@ -1216,7 +1215,7 @@ gdk_win32_draw_lines (GdkDrawable *drawable,
 		      gint         npoints)
 {
   GdkRectangle bounds;
-  GdkRegion *region;
+  cairo_region_t *region;
   POINT *pts;
   int i;
 
diff --git a/gdk/win32/gdkevents-win32.c b/gdk/win32/gdkevents-win32.c
index db247fb..840c4a9 100644
--- a/gdk/win32/gdkevents-win32.c
+++ b/gdk/win32/gdkevents-win32.c
@@ -1475,12 +1475,12 @@ handle_configure_event (MSG       *msg,
     }
 }
 
-GdkRegion *
+cairo_region_t *
 _gdk_win32_hrgn_to_region (HRGN hrgn)
 {
   RGNDATA *rgndata;
   RECT *rects;
-  GdkRegion *result;
+  cairo_region_t *result;
   gint nbytes;
   guint i;
 
@@ -1538,7 +1538,7 @@ handle_wm_paint (MSG        *msg,
   HRGN hrgn = CreateRectRgn (0, 0, 0, 0);
   HDC hdc;
   PAINTSTRUCT paintstruct;
-  GdkRegion *update_region;
+  cairo_region_t *update_region;
 
   if (GetUpdateRgn (msg->hwnd, hrgn, FALSE) == ERROR)
     {
diff --git a/gdk/win32/gdkgc-win32.c b/gdk/win32/gdkgc-win32.c
index 148a0f5..6b80269 100644
--- a/gdk/win32/gdkgc-win32.c
+++ b/gdk/win32/gdkgc-win32.c
@@ -34,7 +34,6 @@
 
 #include "gdkgc.h"
 #include "gdkpixmap.h"
-#include "gdkregion-generic.h"
 #include "gdkprivate-win32.h"
 
 static void gdk_win32_gc_get_values (GdkGC           *gc,
@@ -545,7 +544,7 @@ gdk_win32_gc_set_dashes (GdkGC *gc,
 
 void
 _gdk_windowing_gc_set_clip_region (GdkGC           *gc,
-                                   const GdkRegion *region,
+                                   const cairo_region_t *region,
 				   gboolean         reset_origin)
 {
   GdkGCWin32 *win32_gc = GDK_GC_WIN32 (gc);
@@ -1056,14 +1055,14 @@ _gdk_win32_bitmap_to_hrgn (GdkPixmap *pixmap)
 }
 
 HRGN
-_gdk_win32_gdkregion_to_hrgn (const GdkRegion *region,
+_gdk_win32_gdkregion_to_hrgn (const cairo_region_t *region,
 			      gint             x_origin,
 			      gint             y_origin)
 {
   HRGN hrgn;
   RGNDATA *rgndata;
   RECT *rect;
-  GdkRegionBox *boxes = region->rects;
+  cairo_region_tBox *boxes = region->rects;
   guint nbytes =
     sizeof (RGNDATAHEADER) + (sizeof (RECT) * region->numRects);
   int i;
diff --git a/gdk/win32/gdkgeometry-win32.c b/gdk/win32/gdkgeometry-win32.c
index 044479d..ca28b28 100644
--- a/gdk/win32/gdkgeometry-win32.c
+++ b/gdk/win32/gdkgeometry-win32.c
@@ -40,8 +40,6 @@
 
 #include "config.h"
 #include "gdk.h"		/* For gdk_rectangle_intersect */
-#include "gdkregion.h"
-#include "gdkregion-generic.h"
 #include "gdkinternals.h"
 #include "gdkprivate-win32.h"
 
@@ -236,15 +234,15 @@ _gdk_win32_window_tmp_reset_bg (GdkWindow *window)
 */
 
 #if 0
-static GdkRegion *
+static cairo_region_t *
 gdk_window_clip_changed (GdkWindow    *window,
 			 GdkRectangle *old_clip,
 			 GdkRectangle *new_clip)
 {
   GdkWindowImplWin32 *impl;
   GdkWindowObject *obj;
-  GdkRegion *old_clip_region;
-  GdkRegion *new_clip_region;
+  cairo_region_t *old_clip_region;
+  cairo_region_t *new_clip_region;
   
   if (((GdkWindowObject *)window)->input_only)
     return NULL;
@@ -280,7 +278,7 @@ gdk_window_clip_changed (GdkWindow    *window,
 #if 0
 static void
 gdk_window_post_scroll (GdkWindow    *window,
-			GdkRegion    *new_clip_region)
+			cairo_region_t    *new_clip_region)
 {
   GDK_NOTE (EVENTS,
 	    g_print ("gdk_window_clip_changed: invalidating region: %s\n",
diff --git a/gdk/win32/gdkmain-win32.c b/gdk/win32/gdkmain-win32.c
index e2fd628..e8258f4 100644
--- a/gdk/win32/gdkmain-win32.c
+++ b/gdk/win32/gdkmain-win32.c
@@ -34,7 +34,6 @@
 #include <io.h>
 
 #include "gdk.h"
-#include "gdkregion-generic.h"
 #include "gdkkeysyms.h"
 #include "gdkinternals.h"
 #include "gdkintl.h"
@@ -1159,7 +1158,7 @@ _gdk_win32_gdkrectangle_to_string (const GdkRectangle *rect)
 }
 
 gchar *
-_gdk_win32_gdkregion_to_string (const GdkRegion *rgn)
+_gdk_win32_gdkregion_to_string (const cairo_region_t *rgn)
 {
   return static_printf ("%dx%d %+d%+d",
 			(rgn->extents.x2 - rgn->extents.x1),
diff --git a/gdk/win32/gdkprivate-win32.h b/gdk/win32/gdkprivate-win32.h
index 031ef72..39a9f9a 100644
--- a/gdk/win32/gdkprivate-win32.h
+++ b/gdk/win32/gdkprivate-win32.h
@@ -217,7 +217,7 @@ void _gdk_win32_window_scroll (GdkWindow *window,
 			       gint       dx,
 			       gint       dy);
 void _gdk_win32_window_move_region (GdkWindow       *window,
-				    const GdkRegion *region,
+				    const cairo_region_t *region,
 				    gint             dx,
 				    gint             dy);
 void _gdk_win32_windowing_window_get_offsets (GdkWindow *window,
@@ -267,11 +267,11 @@ COLORREF  _gdk_win32_colormap_color     (GdkColormap *colormap,
 
 HRGN	  _gdk_win32_bitmap_to_hrgn     (GdkPixmap   *bitmap);
 
-HRGN	  _gdk_win32_gdkregion_to_hrgn  (const GdkRegion *region,
+HRGN	  _gdk_win32_gdkregion_to_hrgn  (const cairo_region_t *region,
 					 gint             x_origin,
 					 gint             y_origin);
 
-GdkRegion *_gdk_win32_hrgn_to_region    (HRGN hrgn);
+cairo_region_t *_gdk_win32_hrgn_to_region    (HRGN hrgn);
 
 void	_gdk_win32_adjust_client_rect   (GdkWindow *window,
 					 RECT      *RECT);
@@ -321,7 +321,7 @@ gchar *_gdk_win32_data_to_string       (const guchar*data,
 gchar *_gdk_win32_rect_to_string       (const RECT  *rect);
 
 gchar *_gdk_win32_gdkrectangle_to_string (const GdkRectangle *rect);
-gchar *_gdk_win32_gdkregion_to_string    (const GdkRegion    *box);
+gchar *_gdk_win32_gdkregion_to_string    (const cairo_region_t    *box);
 
 void   _gdk_win32_print_event            (const GdkEvent     *event);
 
diff --git a/gdk/win32/gdkwindow-win32.c b/gdk/win32/gdkwindow-win32.c
index 639d2fd..83e467e 100644
--- a/gdk/win32/gdkwindow-win32.c
+++ b/gdk/win32/gdkwindow-win32.c
@@ -3132,7 +3132,7 @@ gdk_window_get_type_hint (GdkWindow *window)
 
 static void
 gdk_win32_window_shape_combine_region (GdkWindow       *window,
-				       const GdkRegion *shape_region,
+				       const cairo_region_t *shape_region,
 				       gint             offset_x,
 				       gint             offset_y)
 {
@@ -3224,10 +3224,10 @@ gdk_window_set_opacity (GdkWindow *window,
     }
 }
 
-GdkRegion *
+cairo_region_t *
 _gdk_windowing_get_shape_for_mask (GdkBitmap *mask)
 {
-  GdkRegion *region;
+  cairo_region_t *region;
   HRGN hrgn = _gdk_win32_bitmap_to_hrgn (mask);
 
   region = _gdk_win32_hrgn_to_region (hrgn);
@@ -3241,7 +3241,7 @@ _gdk_windowing_window_set_composited (GdkWindow *window, gboolean composited)
 {
 }
 
-GdkRegion *
+cairo_region_t *
 _gdk_windowing_window_get_shape (GdkWindow *window)
 {
   HRGN hrgn = CreateRectRgn (0, 0, 0, 0);
@@ -3249,7 +3249,7 @@ _gdk_windowing_window_get_shape (GdkWindow *window)
 
   if (type == SIMPLEREGION || type == COMPLEXREGION)
     {
-      GdkRegion *region = _gdk_win32_hrgn_to_region (hrgn);
+      cairo_region_t *region = _gdk_win32_hrgn_to_region (hrgn);
 
       DeleteObject (hrgn);
       return region;
@@ -3258,7 +3258,7 @@ _gdk_windowing_window_get_shape (GdkWindow *window)
   return NULL;
 }
 
-GdkRegion *
+cairo_region_t *
 _gdk_windowing_window_get_input_shape (GdkWindow *window)
 {
   /* CHECK: are these really supposed to be the same? */
@@ -3267,7 +3267,7 @@ _gdk_windowing_window_get_input_shape (GdkWindow *window)
 
 static gboolean
 _gdk_win32_window_queue_antiexpose (GdkWindow *window,
-				    GdkRegion *area)
+				    cairo_region_t *area)
 {
   HRGN hrgn = _gdk_win32_gdkregion_to_hrgn (area, 0, 0);
 
@@ -3295,7 +3295,7 @@ _gdk_win32_window_queue_antiexpose (GdkWindow *window,
 static void
 _gdk_win32_window_queue_translation (GdkWindow *window,
 				     GdkGC     *gc,
-				     GdkRegion *area,
+				     cairo_region_t *area,
 				     gint       dx,
 				     gint       dy)
 {
@@ -3322,7 +3322,7 @@ _gdk_win32_window_queue_translation (GdkWindow *window,
 
 static void
 gdk_win32_input_shape_combine_region (GdkWindow *window,
-				      const GdkRegion *shape_region,
+				      const cairo_region_t *shape_region,
 				      gint offset_x,
 				      gint offset_y)
 {
@@ -3334,7 +3334,7 @@ gdk_win32_input_shape_combine_region (GdkWindow *window,
 
 void
 _gdk_windowing_window_process_updates_recurse (GdkWindow *window,
-					       GdkRegion *region)
+					       cairo_region_t *region)
 {
   _gdk_window_process_updates_recurse (window, region);
 }
diff --git a/gdk/x11/gdkdnd-x11.c b/gdk/x11/gdkdnd-x11.c
index 7077d64..4486900 100644
--- a/gdk/x11/gdkdnd-x11.c
+++ b/gdk/x11/gdkdnd-x11.c
@@ -59,7 +59,7 @@ typedef struct {
   gboolean mapped;
   gboolean shape_selected;
   gboolean shape_valid;
-  GdkRegion *shape;
+  cairo_region_t *shape;
 } GdkCacheChild;
 
 typedef struct {
@@ -630,7 +630,7 @@ is_pointer_within_shape (GdkDisplay    *display,
   if (!child->shape_valid)
     {
       GdkDisplayX11 *display_x11 = GDK_DISPLAY_X11 (display);
-      GdkRegion *input_shape;
+      cairo_region_t *input_shape;
 
       child->shape = _xwindow_get_shape (display_x11->xdisplay,
                                          child->xid, ShapeBounding);
diff --git a/gdk/x11/gdkdrawable-x11.c b/gdk/x11/gdkdrawable-x11.c
index c85ac41..c10513b 100644
--- a/gdk/x11/gdkdrawable-x11.c
+++ b/gdk/x11/gdkdrawable-x11.c
@@ -346,7 +346,7 @@ gdk_x11_drawable_update_picture_clip (GdkDrawable *drawable,
   GdkDrawableImplX11 *impl = GDK_DRAWABLE_IMPL_X11 (drawable);
   Display *xdisplay = GDK_SCREEN_XDISPLAY (impl->screen);
   Picture picture = gdk_x11_drawable_get_picture (drawable);
-  GdkRegion *clip_region = gc ? _gdk_gc_get_clip_region (gc) : NULL;
+  cairo_region_t *clip_region = gc ? _gdk_gc_get_clip_region (gc) : NULL;
 
   if (clip_region)
     {
diff --git a/gdk/x11/gdkgc-x11.c b/gdk/x11/gdkgc-x11.c
index b0d2578..8676d7c 100644
--- a/gdk/x11/gdkgc-x11.c
+++ b/gdk/x11/gdkgc-x11.c
@@ -154,7 +154,7 @@ _gdk_x11_gc_flush (GdkGC *gc)
 
   if (private->dirty_mask & GDK_GC_DIRTY_CLIP)
     {
-      GdkRegion *clip_region = _gdk_gc_get_clip_region (gc);
+      cairo_region_t *clip_region = _gdk_gc_get_clip_region (gc);
       
       if (!clip_region)
 	XSetClipOrigin (xdisplay, xgc,
@@ -600,7 +600,7 @@ gdk_x11_gc_values_to_xvalues (GdkGCValues    *values,
 
 void
 _gdk_windowing_gc_set_clip_region (GdkGC           *gc,
-				   const GdkRegion *region,
+				   const cairo_region_t *region,
 				   gboolean reset_origin)
 {
   GdkGCX11 *x11_gc = GDK_GC_X11 (gc);
diff --git a/gdk/x11/gdkgeometry-x11.c b/gdk/x11/gdkgeometry-x11.c
index 3d572bd..a7b1484 100644
--- a/gdk/x11/gdkgeometry-x11.c
+++ b/gdk/x11/gdkgeometry-x11.c
@@ -21,7 +21,6 @@
 #include "gdk.h"		/* For gdk_rectangle_intersect */
 #include "gdkprivate-x11.h"
 #include "gdkx.h"
-#include "gdkregion.h"
 #include "gdkinternals.h"
 #include "gdkscreen-x11.h"
 #include "gdkdisplay-x11.h"
@@ -43,12 +42,12 @@ struct _GdkWindowQueueItem
   GdkWindowQueueType type;
   union {
     struct {
-      GdkRegion *area;
+      cairo_region_t *area;
       gint dx;
       gint dy;
     } translate;
     struct {
-      GdkRegion *area;
+      cairo_region_t *area;
     } antiexpose;
   } u;
 };
@@ -229,7 +228,7 @@ gdk_window_queue (GdkWindow          *window,
 void
 _gdk_x11_window_queue_translation (GdkWindow *window,
 				   GdkGC     *gc,
-				   GdkRegion *area,
+				   cairo_region_t *area,
 				   gint       dx,
 				   gint       dy)
 {
@@ -249,7 +248,7 @@ _gdk_x11_window_queue_translation (GdkWindow *window,
 
 gboolean
 _gdk_x11_window_queue_antiexpose (GdkWindow *window,
-				  GdkRegion *area)
+				  cairo_region_t *area)
 {
   GdkWindowQueueItem *item = g_new (GdkWindowQueueItem, 1);
   item->type = GDK_WINDOW_QUEUE_ANTIEXPOSE;
@@ -265,7 +264,7 @@ _gdk_window_process_expose (GdkWindow    *window,
 			    gulong        serial,
 			    GdkRectangle *area)
 {
-  GdkRegion *invalidate_region = cairo_region_create_rectangle (area);
+  cairo_region_t *invalidate_region = cairo_region_create_rectangle (area);
   GdkDisplayX11 *display_x11 = GDK_DISPLAY_X11 (GDK_WINDOW_DISPLAY (window));
 
   if (display_x11->translate_queue)
@@ -286,7 +285,7 @@ _gdk_window_process_expose (GdkWindow    *window,
 		    {
 		      if (item->u.translate.area)
 			{
-			  GdkRegion *intersection;
+			  cairo_region_t *intersection;
 
 			  intersection = cairo_region_copy (invalidate_region);
 			  cairo_region_intersect (intersection, item->u.translate.area);
diff --git a/gdk/x11/gdkmain-x11.c b/gdk/x11/gdkmain-x11.c
index 9c71105..a3a91cc 100644
--- a/gdk/x11/gdkmain-x11.c
+++ b/gdk/x11/gdkmain-x11.c
@@ -517,7 +517,7 @@ _gdk_send_xevent (GdkDisplay *display,
 }
 
 void
-_gdk_region_get_xrectangles (const GdkRegion *region,
+_gdk_region_get_xrectangles (const cairo_region_t *region,
                              gint             x_offset,
                              gint             y_offset,
                              XRectangle     **rects,
diff --git a/gdk/x11/gdkprivate-x11.h b/gdk/x11/gdkprivate-x11.h
index 2e2cdc0..8a48dad 100644
--- a/gdk/x11/gdkprivate-x11.h
+++ b/gdk/x11/gdkprivate-x11.h
@@ -127,21 +127,21 @@ void _gdk_window_process_expose    (GdkWindow     *window,
                                     GdkRectangle  *area);
 
 gboolean _gdk_x11_window_queue_antiexpose  (GdkWindow *window,
-					    GdkRegion *area);
+					    cairo_region_t *area);
 void     _gdk_x11_window_queue_translation (GdkWindow *window,
 					    GdkGC     *gc,
-					    GdkRegion *area,
+					    cairo_region_t *area,
 					    gint       dx,
 					    gint       dy);
 
 void     _gdk_selection_window_destroyed   (GdkWindow            *window);
 gboolean _gdk_selection_filter_clear_event (XSelectionClearEvent *event);
 
-GdkRegion* _xwindow_get_shape              (Display *xdisplay,
+cairo_region_t* _xwindow_get_shape              (Display *xdisplay,
                                             Window window,
                                             gint shape_type);
 
-void     _gdk_region_get_xrectangles       (const GdkRegion      *region,
+void     _gdk_region_get_xrectangles       (const cairo_region_t      *region,
                                             gint                  x_offset,
                                             gint                  y_offset,
                                             XRectangle          **rects,
diff --git a/gdk/x11/gdkwindow-x11.c b/gdk/x11/gdkwindow-x11.c
index 263dd17..96562f7 100644
--- a/gdk/x11/gdkwindow-x11.c
+++ b/gdk/x11/gdkwindow-x11.c
@@ -46,7 +46,6 @@
 #include "gdkasync.h"
 #include "gdkdisplay-x11.h"
 #include "gdkprivate-x11.h"
-#include "gdkregion.h"
 #include "gdkinternals.h"
 #include "MwmUtil.h"
 #include "gdkwindow-x11.h"
@@ -1684,7 +1683,7 @@ gdk_window_x11_reparent (GdkWindow *window,
 
 static void
 gdk_window_x11_clear_region (GdkWindow *window,
-			     GdkRegion *region,
+			     cairo_region_t *region,
 			     gboolean   send_expose)
 {
   cairo_rectangle_int_t rect;
@@ -3396,7 +3395,7 @@ gdk_window_add_colormap_windows (GdkWindow *window)
 
 static inline void
 do_shape_combine_region (GdkWindow       *window,
-			 const GdkRegion *shape_region,
+			 const cairo_region_t *shape_region,
 			 gint             offset_x,
 			 gint             offset_y,
 			 gint             shape)
@@ -3467,7 +3466,7 @@ do_shape_combine_region (GdkWindow       *window,
 
 static void
 gdk_window_x11_shape_combine_region (GdkWindow       *window,
-                                     const GdkRegion *shape_region,
+                                     const cairo_region_t *shape_region,
                                      gint             offset_x,
                                      gint             offset_y)
 {
@@ -3476,7 +3475,7 @@ gdk_window_x11_shape_combine_region (GdkWindow       *window,
 
 static void 
 gdk_window_x11_input_shape_combine_region (GdkWindow       *window,
-					   const GdkRegion *shape_region,
+					   const cairo_region_t *shape_region,
 					   gint             offset_x,
 					   gint             offset_y)
 {
@@ -4555,12 +4554,12 @@ gdk_window_set_functions (GdkWindow    *window,
   gdk_window_set_mwm_hints (window, &hints);
 }
 
-GdkRegion *
+cairo_region_t *
 _xwindow_get_shape (Display *xdisplay,
 		    Window window,
 		    gint shape_type)
 {
-  GdkRegion *shape;
+  cairo_region_t *shape;
   GdkRectangle *rl;
   XRectangle *xrl;
   gint rn, ord, i;
@@ -4601,12 +4600,12 @@ _xwindow_get_shape (Display *xdisplay,
 }
 
 
-GdkRegion *
+cairo_region_t *
 _gdk_windowing_get_shape_for_mask (GdkBitmap *mask)
 {
   GdkDisplay *display;
   Window window;
-  GdkRegion *region;
+  cairo_region_t *region;
 
   display = gdk_drawable_get_display (GDK_DRAWABLE (mask));
 
@@ -4629,7 +4628,7 @@ _gdk_windowing_get_shape_for_mask (GdkBitmap *mask)
   return region;
 }
 
-GdkRegion *
+cairo_region_t *
 _gdk_windowing_window_get_shape (GdkWindow *window)
 {
   if (!GDK_WINDOW_DESTROYED (window) &&
@@ -4640,7 +4639,7 @@ _gdk_windowing_window_get_shape (GdkWindow *window)
   return NULL;
 }
 
-GdkRegion *
+cairo_region_t *
 _gdk_windowing_window_get_input_shape (GdkWindow *window)
 {
 #if defined(ShapeInput)
@@ -5523,7 +5522,7 @@ _gdk_windowing_window_set_composited (GdkWindow *window,
 
 void
 _gdk_windowing_window_process_updates_recurse (GdkWindow *window,
-                                               GdkRegion *region)
+                                               cairo_region_t *region)
 {
   _gdk_window_process_updates_recurse (window, region);
 }
diff --git a/gtk/gtkiconview.c b/gtk/gtkiconview.c
index 699c4a0..61a3b0c 100644
--- a/gtk/gtkiconview.c
+++ b/gtk/gtkiconview.c
@@ -2319,7 +2319,7 @@ gtk_icon_view_update_rubberband (gpointer data)
   GdkRectangle old_area;
   GdkRectangle new_area;
   GdkRectangle common;
-  GdkRegion *invalid_region;
+  cairo_region_t *invalid_region;
   
   icon_view = GTK_ICON_VIEW (data);
 
@@ -2350,7 +2350,7 @@ gtk_icon_view_update_rubberband (gpointer data)
   gdk_rectangle_intersect (&old_area, &new_area, &common);
   if (common.width > 2 && common.height > 2)
     {
-      GdkRegion *common_region;
+      cairo_region_t *common_region;
 
       /* make sure the border is invalidated */
       common.x += 1;
diff --git a/gtk/gtklabel.c b/gtk/gtklabel.c
index 41c4a6f..71eeb9a 100644
--- a/gtk/gtklabel.c
+++ b/gtk/gtklabel.c
@@ -3998,7 +3998,7 @@ gtk_label_expose (GtkWidget      *widget,
           (info->selection_anchor != info->selection_end))
         {
           gint range[2];
-          GdkRegion *clip;
+          cairo_region_t *clip;
 	  GtkStateType state;
 
           range[0] = info->selection_anchor;
@@ -4043,7 +4043,7 @@ gtk_label_expose (GtkWidget      *widget,
           GtkLabelLink *focus_link;
           GtkLabelLink *active_link;
           gint range[2];
-          GdkRegion *clip;
+          cairo_region_t *clip;
           GdkRectangle rect;
           GdkColor *text_color;
           GdkColor *base_color;
diff --git a/gtk/gtkmenu.h b/gtk/gtkmenu.h
index 4e4746f..5274b09 100644
--- a/gtk/gtkmenu.h
+++ b/gtk/gtkmenu.h
@@ -92,7 +92,7 @@ struct _GtkMenu
   /* When a submenu of this menu is popped up, motion in this
    * region is ignored
    */
-  GdkRegion *GSEAL (navigation_region); /* unused */
+  cairo_region_t *GSEAL (navigation_region); /* unused */
   guint GSEAL (navigation_timeout);
 
   guint GSEAL (needs_destruction_ref_count) : 1;
diff --git a/gtk/gtktextdisplay.c b/gtk/gtktextdisplay.c
index 136e55a..7f76892 100644
--- a/gtk/gtktextdisplay.c
+++ b/gtk/gtktextdisplay.c
@@ -414,7 +414,7 @@ text_renderer_end (GtkTextRenderer *text_renderer)
 }
 
 
-static GdkRegion *
+static cairo_region_t *
 get_selected_clip (GtkTextRenderer    *text_renderer,
                    PangoLayout        *layout,
                    PangoLayoutLine    *line,
@@ -426,8 +426,8 @@ get_selected_clip (GtkTextRenderer    *text_renderer,
 {
   gint *ranges;
   gint n_ranges, i;
-  GdkRegion *clip_region = cairo_region_create ();
-  GdkRegion *tmp_region;
+  cairo_region_t *clip_region = cairo_region_create ();
+  cairo_region_t *tmp_region;
 
   pango_layout_line_get_x_ranges (line, start_index, end_index, &ranges, &n_ranges);
 
@@ -578,7 +578,7 @@ render_para (GtkTextRenderer    *text_renderer,
 	       (selection_start_index == byte_offset + line->length && pango_layout_iter_at_last_line (iter))) &&
 	      selection_end_index > byte_offset)
             {
-              GdkRegion *clip_region = get_selected_clip (text_renderer, layout, line,
+              cairo_region_t *clip_region = get_selected_clip (text_renderer, layout, line,
                                                           x + line_display->x_offset,
                                                           selection_y,
                                                           selection_height,
diff --git a/gtk/gtktreeview.c b/gtk/gtktreeview.c
index 69b7991..387bdde 100644
--- a/gtk/gtktreeview.c
+++ b/gtk/gtktreeview.c
@@ -4027,7 +4027,7 @@ gtk_tree_view_update_rubber_band (GtkTreeView *tree_view)
   GdkRectangle old_area;
   GdkRectangle new_area;
   GdkRectangle common;
-  GdkRegion *invalid_region;
+  cairo_region_t *invalid_region;
 
   old_area.x = MIN (tree_view->priv->press_start_x, tree_view->priv->rubber_band_x);
   old_area.y = MIN (tree_view->priv->press_start_y, tree_view->priv->rubber_band_y) - tree_view->priv->dy;
@@ -4050,7 +4050,7 @@ gtk_tree_view_update_rubber_band (GtkTreeView *tree_view)
   gdk_rectangle_intersect (&old_area, &new_area, &common);
   if (common.width > 2 && common.height > 2)
     {
-      GdkRegion *common_region;
+      cairo_region_t *common_region;
 
       /* make sure the border is invalidated */
       common.x += 1;
diff --git a/gtk/gtkwidget.c b/gtk/gtkwidget.c
index edf87a0..351d995 100644
--- a/gtk/gtkwidget.c
+++ b/gtk/gtkwidget.c
@@ -313,7 +313,7 @@ static AtkObject*	gtk_widget_real_get_accessible		(GtkWidget	  *widget);
 static void		gtk_widget_accessible_interface_init	(AtkImplementorIface *iface);
 static AtkObject*	gtk_widget_ref_accessible		(AtkImplementor *implementor);
 static void             gtk_widget_invalidate_widget_windows    (GtkWidget        *widget,
-								 GdkRegion        *region);
+								 cairo_region_t        *region);
 static GdkScreen *      gtk_widget_get_screen_unchecked         (GtkWidget        *widget);
 static void		gtk_widget_queue_shallow_draw		(GtkWidget        *widget);
 static gboolean         gtk_widget_real_can_activate_accel      (GtkWidget *widget,
@@ -3903,7 +3903,7 @@ invalidate_predicate (GdkWindow *window,
  */
 static void
 gtk_widget_invalidate_widget_windows (GtkWidget *widget,
-				      GdkRegion *region)
+				      cairo_region_t *region)
 {
   if (!gtk_widget_get_realized (widget))
     return;
@@ -3931,7 +3931,7 @@ static void
 gtk_widget_queue_shallow_draw (GtkWidget *widget)
 {
   GdkRectangle rect;
-  GdkRegion *region;
+  cairo_region_t *region;
   
   if (!gtk_widget_get_realized (widget))
     return;
@@ -4042,7 +4042,7 @@ gtk_widget_size_allocate (GtkWidget	*widget,
 	{
 	  /* Invalidate union(old_allaction,widget->allocation) in widget->window
 	   */
-	  GdkRegion *invalidate = cairo_region_create_rectangle (&widget->allocation);
+	  cairo_region_t *invalidate = cairo_region_create_rectangle (&widget->allocation);
 	  cairo_region_union_rectangle (invalidate, &old_allocation);
 
 	  gdk_window_invalidate_region (widget->window, invalidate, FALSE);
@@ -4055,7 +4055,7 @@ gtk_widget_size_allocate (GtkWidget	*widget,
 	    {
 	      /* Invalidate union(old_allaction,widget->allocation) in widget->window and descendents owned by widget
 	       */
-	      GdkRegion *invalidate = cairo_region_create_rectangle (&widget->allocation);
+	      cairo_region_t *invalidate = cairo_region_create_rectangle (&widget->allocation);
 	      cairo_region_union_rectangle (invalidate, &old_allocation);
 
 	      gtk_widget_invalidate_widget_windows (widget, invalidate);
@@ -4067,7 +4067,7 @@ gtk_widget_size_allocate (GtkWidget	*widget,
   if ((size_changed || position_changed) && widget->parent &&
       gtk_widget_get_realized (widget->parent) && GTK_CONTAINER (widget->parent)->reallocate_redraws)
     {
-      GdkRegion *invalidate = cairo_region_create_rectangle (&widget->parent->allocation);
+      cairo_region_t *invalidate = cairo_region_create_rectangle (&widget->parent->allocation);
       gtk_widget_invalidate_widget_windows (widget->parent, invalidate);
       cairo_region_destroy (invalidate);
     }
@@ -5177,7 +5177,7 @@ gtk_widget_intersect (GtkWidget	         *widget,
 /**
  * gtk_widget_region_intersect:
  * @widget: a #GtkWidget
- * @region: a #GdkRegion, in the same coordinate system as 
+ * @region: a #cairo_region_t, in the same coordinate system as 
  *          @widget->allocation. That is, relative to @widget->window
  *          for %NO_WINDOW widgets; relative to the parent window
  *          of @widget->window for widgets with their own window.
@@ -5191,12 +5191,12 @@ gtk_widget_intersect (GtkWidget	         *widget,
  * the intersection. The result may be empty, use cairo_region_is_empty() to
  * check.
  **/
-GdkRegion *
+cairo_region_t *
 gtk_widget_region_intersect (GtkWidget       *widget,
-			     const GdkRegion *region)
+			     const cairo_region_t *region)
 {
   GdkRectangle rect;
-  GdkRegion *dest;
+  cairo_region_t *dest;
   
   g_return_val_if_fail (GTK_IS_WIDGET (widget), NULL);
   g_return_val_if_fail (region != NULL, NULL);
diff --git a/gtk/gtkwidget.h b/gtk/gtkwidget.h
index 92f6fe1..15ec198 100644
--- a/gtk/gtkwidget.h
+++ b/gtk/gtkwidget.h
@@ -624,8 +624,8 @@ void	   gtk_widget_reparent		  (GtkWidget	       *widget,
 gboolean   gtk_widget_intersect		  (GtkWidget	       *widget,
 					   const GdkRectangle  *area,
 					   GdkRectangle	       *intersection);
-GdkRegion *gtk_widget_region_intersect	  (GtkWidget	       *widget,
-					   const GdkRegion     *region);
+cairo_region_t *gtk_widget_region_intersect	  (GtkWidget	       *widget,
+					   const cairo_region_t     *region);
 
 void	gtk_widget_freeze_child_notify	  (GtkWidget	       *widget);
 void	gtk_widget_child_notify		  (GtkWidget	       *widget,
diff --git a/tests/testgtk.c b/tests/testgtk.c
index 0f02c21..0a3161b 100644
--- a/tests/testgtk.c
+++ b/tests/testgtk.c
@@ -441,7 +441,7 @@ static gboolean
 window_expose_event (GtkWidget *widget,
                      GdkEventExpose *event)
 {
-  GdkRegion *region;
+  cairo_region_t *region;
   GtkWidget *child;
   cairo_t *cr;
 
@@ -7732,7 +7732,7 @@ create_shapes (GtkWidget *widget)
 
   if (!with_region)
     {
-      GdkRegion *region;
+      cairo_region_t *region;
       gint x, y;
       
       with_region = shape_create_icon (screen, "3DRings.xpm",



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