]> git.saurik.com Git - wxWidgets.git/blobdiff - src/gtk1/region.cpp
Added missing '!' to HasCapture() in window.cpp
[wxWidgets.git] / src / gtk1 / region.cpp
index 2c31667721a289500e07d11953029ee3461a2542..e71f072e8c70ccc21a0f3edc53daa34dc9f730ae 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()
 {
 }
@@ -492,6 +516,16 @@ wxRect wxRegion::GetBox() const
     return wxRect( x, y, w, h );
 }
 
+bool wxRegion::Offset( wxCoord x, wxCoord y )
+{
+    if (!m_refData)
+        return FALSE;
+
+    gdk_region_offset( M_REGIONDATA->m_region, x, y );
+    
+    return TRUE;
+}
+
 bool wxRegion::Empty() const
 {
     if (!m_refData)