-//-----------------------------------------------------------------------------
-// wxRegion
-//-----------------------------------------------------------------------------
+void wxRIRefData::CreateRects( const wxRegion& region )
+{
+ delete [] m_rects;
+
+ Init();
+
+ GdkRegion *gdkregion = region.GetRegion();
+ if (!gdkregion)
+ return;
+
+ Region r = ((GdkRegionPrivate *)gdkregion)->xregion;
+ if (r)
+ {
+ m_numRects = r->numRects;
+ if (m_numRects)
+ {
+ m_rects = new wxRect[m_numRects];
+ for (size_t i=0; i < m_numRects; ++i)
+ {
+ _XBox &xr = r->rects[i];
+ wxRect &wr = m_rects[i];
+ wr.x = xr.x1;
+ wr.y = xr.y1;
+ wr.width = xr.x2-xr.x1;
+ wr.height = xr.y2-xr.y1;
+ }
+ }
+ }
+}