Use cairo_region_t when building with gtk+-3.0

GdkRegion has been removed from Gtk+. The replacement is a
yet-unreleased cairo API, so use it only when building with
Gtk+-3.0.

https://bugzilla.gnome.org/show_bug.cgi?id=587991
This commit is contained in:
Florian Müllner
2010-06-30 00:43:56 +02:00
parent 01447d94d1
commit 7feeb72721
13 changed files with 184 additions and 86 deletions

View File

@ -879,5 +879,29 @@ meta_later_remove (guint later_id)
}
}
#ifdef USE_CAIRO_REGION
#include "region.h"
void
meta_region_get_rectangles (MetaRegion *region,
GdkRectangle **rectangles,
int *n_rectangles)
{
int n = cairo_region_num_rectangles (region);
if (n_rectangles != NULL)
*n_rectangles = n;
if (rectangles != NULL)
{
int i;
*rectangles = g_new (cairo_rectangle_int_t, n);
for (i = 0; i < n; i++)
cairo_region_get_rectangle (region, i, *rectangles + i);
}
}
#endif
/* eof util.c */