]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/rgncmn.cpp
make wxSocketImplUnix inherit from wxFDIOHandler as they're used for almost the same...
[wxWidgets.git] / src / common / rgncmn.cpp
index cee89a91c220c535d618d945f0adf5354bf264a8..f16024cbb730a9faa6ce7121b0dacb82b5cd81cd 100644 (file)
 
 bool wxRegionBase::IsEqual(const wxRegion& region) const
 {
-    if ( m_refData == region.m_refData )
+    if ( m_refData == region.GetRefData() )
     {
         // regions are identical, hence equal
         return true;
     }
 
-    if ( !m_refData || !region.m_refData )
+    if ( !m_refData || !region.GetRefData() )
     {
         // one, but not both, of the regions is invalid
         return false;
@@ -65,7 +65,7 @@ wxBitmap wxRegionBase::ConvertToBitmap() const
     dc.SelectObject(bmp);
     dc.SetBackground(*wxBLACK_BRUSH);
     dc.Clear();
-    dc.SetClippingRegion(*wx_static_cast(const wxRegion *, this));
+    dc.SetDeviceClippingRegion(*static_cast<const wxRegion *>(this));
     dc.SetBackground(*wxWHITE_BRUSH);
     dc.Clear();
     dc.SelectObject(wxNullBitmap);
@@ -157,3 +157,36 @@ bool wxRegionBase::Union(const wxBitmap& bmp,
 }
 
 #endif // wxUSE_IMAGE
+
+#ifdef wxHAS_REGION_COMBINE
+// ============================================================================
+// wxRegionWithCombine
+// ============================================================================
+
+// implement some wxRegionBase pure virtuals in terms of Combine()
+bool wxRegionWithCombine::DoUnionWithRect(const wxRect& rect)
+{
+    return Combine(rect, wxRGN_OR);
+}
+
+bool wxRegionWithCombine::DoUnionWithRegion(const wxRegion& region)
+{
+    return DoCombine(region, wxRGN_OR);
+}
+
+bool wxRegionWithCombine::DoIntersect(const wxRegion& region)
+{
+    return DoCombine(region, wxRGN_AND);
+}
+
+bool wxRegionWithCombine::DoSubtract(const wxRegion& region)
+{
+    return DoCombine(region, wxRGN_DIFF);
+}
+
+bool wxRegionWithCombine::DoXor(const wxRegion& region)
+{
+    return DoCombine(region, wxRGN_XOR);
+}
+
+#endif // wxHAS_REGION_COMBINE