]> git.saurik.com Git - wxWidgets.git/blobdiff - src/gtk/region.cpp
added support for column images under MSW
[wxWidgets.git] / src / gtk / region.cpp
index e4d59dc1e804b844e5af0249a792fdad2ad67e7f..b89afd3b4ce9e686fecf7c75de49c929a9ed82e6 100644 (file)
@@ -186,6 +186,30 @@ wxRegion::wxRegion( const wxRect& rect )
 #endif
 }
 
+wxRegion::wxRegion( size_t n, const wxPoint *points, int fillStyle )
+{
+    GdkPoint *gdkpoints = new GdkPoint[n];
+    for ( size_t i = 0 ; i < n ; i++ )
+    {
+        gdkpoints[i].x = points[i].x;
+        gdkpoints[i].y = points[i].y;
+    }
+
+    m_refData = new wxRegionRefData();
+
+    GdkRegion* reg = gdk_region_polygon
+                     (
+                        gdkpoints,
+                        n,
+                        fillStyle == wxWINDING_RULE ? GDK_WINDING_RULE
+                                                    : GDK_EVEN_ODD_RULE
+                     );
+
+    M_REGIONDATA->m_region = reg;
+
+    delete [] gdkpoints;
+}
+
 wxRegion::~wxRegion()
 {
 }
@@ -766,10 +790,8 @@ wxCoord wxRegionIterator::GetH() const
 wxRect wxRegionIterator::GetRect() const
 {
     wxRect r;
-    wxNode *node = m_region.GetRectList()->Nth( m_current );
-
-    if (node)
-        r = *((wxRect*)node->Data());
+    if( HaveRects() )
+        r = ((wxRIRefData*)m_refData)->m_rects[m_current];
 
     return r;
 }