- GdkRegion *reg = gdk_regions_xor( M_REGIONDATA->m_region, region.GetRegion() );
- gdk_region_destroy( M_REGIONDATA->m_region );
- M_REGIONDATA->m_region = reg;
-
- wxNode *node = region.GetRectList()->First();
- while (node)
- {
- wxRect *r = (wxRect*)node->Data();
- M_REGIONDATA->m_rects.Append( (wxObject*) new wxRect(r->x,r->y,r->width,r->height) );
- node = node->Next();
- }
-
- return TRUE;
-}
-
-void wxRegion::GetBox( long& x, long& y, long&w, long &h ) const
-{
- x = 0;
- y = 0;
- w = -1;
- h = -1;
- wxNode *node = GetRectList()->First();
- while (node)
- {
- wxRect *r = (wxRect*)node->Data();
- if (node == GetRectList()->First())
+ if (region.IsNull())
+ return FALSE;
+
+ if (!m_refData)
+ {
+ return FALSE;
+ }
+
+ AllocExclusive();
+
+#ifdef __WXGTK20__
+ gdk_region_xor( M_REGIONDATA->m_region, region.GetRegion() );
+#else
+ GdkRegion *reg = gdk_regions_xor( M_REGIONDATA->m_region, region.GetRegion() );
+ gdk_region_destroy( M_REGIONDATA->m_region );
+ M_REGIONDATA->m_region = reg;
+#endif
+
+ return TRUE;
+}
+
+bool wxRegion::Offset( wxCoord x, wxCoord y )
+{
+ if (!m_refData)
+ return FALSE;
+
+ AllocExclusive();
+
+ gdk_region_offset( M_REGIONDATA->m_region, x, y );
+
+ return TRUE;
+}
+
+// ----------------------------------------------------------------------------
+// wxRegion tests
+// ----------------------------------------------------------------------------
+
+void wxRegion::GetBox( wxCoord &x, wxCoord &y, wxCoord &w, wxCoord &h ) const
+{
+ if ( m_refData )