X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/62f864c32c53356b7228591c85b14abc491c46f0..b3a44e057b5183acdf2cf133f059cf94c7884738:/src/mac/classic/region.cpp diff --git a/src/mac/classic/region.cpp b/src/mac/classic/region.cpp index de2b062d0d..4bfadfd5bb 100644 --- a/src/mac/classic/region.cpp +++ b/src/mac/classic/region.cpp @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// File: region.cpp +// File: src/mac/classic/region.cpp // Purpose: Region class // Author: Stefan Csomor // Created: Fri Oct 24 10:46:34 MET 1997 @@ -8,11 +8,10 @@ // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// -#ifdef __GNUG__ -#pragma implementation "region.h" -#endif +#include "wx/wxprec.h" #include "wx/region.h" + #include "wx/gdicmn.h" #include "wx/mac/uma.h" @@ -105,11 +104,11 @@ void wxRegion::Clear() bool wxRegion::Combine(long x, long y, long width, long height, wxRegionOp op) { // Don't change shared data - if (!m_refData) + if (!m_refData) { m_refData = new wxRegionRefData(); - } - else if (m_refData->GetRefCount() > 1) + } + else if (m_refData->GetRefCount() > 1) { wxRegionRefData* ref = (wxRegionRefData*)m_refData; UnRef(); @@ -117,7 +116,7 @@ bool wxRegion::Combine(long x, long y, long width, long height, wxRegionOp op) } RgnHandle rgn = NewRgn() ; SetRectRgn( rgn , x , y, x+width,y + height ) ; - + switch (op) { case wxRGN_AND: @@ -140,20 +139,20 @@ bool wxRegion::Combine(long x, long y, long width, long height, wxRegionOp op) DisposeRgn( rgn ) ; - return TRUE; + return true; } //! Union /e region with this. bool wxRegion::Combine(const wxRegion& region, wxRegionOp op) { if (region.Empty()) - return FALSE; + return false; // Don't change shared data if (!m_refData) { m_refData = new wxRegionRefData(); - } - else if (m_refData->GetRefCount() > 1) + } + else if (m_refData->GetRefCount() > 1) { wxRegionRefData* ref = (wxRegionRefData*)m_refData; UnRef(); @@ -180,7 +179,7 @@ bool wxRegion::Combine(const wxRegion& region, wxRegionOp op) break ; } - return TRUE; + return true; } bool wxRegion::Combine(const wxRect& rect, wxRegionOp op) @@ -195,7 +194,7 @@ bool wxRegion::Combine(const wxRect& rect, wxRegionOp op) // Outer bounds of region void wxRegion::GetBox(wxCoord& x, wxCoord& y, wxCoord& w, wxCoord& h) const { - if (m_refData) + if (m_refData) { Rect box ; GetRegionBounds( M_REGION , &box ) ; @@ -203,8 +202,8 @@ void wxRegion::GetBox(wxCoord& x, wxCoord& y, wxCoord& w, wxCoord& h) const y = box.top ; w = box.right - box.left ; h = box.bottom - box.top ; - } - else + } + else { x = y = w = h = 0; } @@ -253,7 +252,7 @@ wxRegionContain wxRegion::Contains(const wxPoint& pt) const Point p = { pt.y , pt.x } ; if (PtInRgn( p , M_REGION ) ) return wxInRegion; - + return wxOutRegion; } @@ -432,4 +431,3 @@ long wxRegionIterator::GetH() const return m_rects[m_current].height; return 0; } -