X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/2646f485163f410baaad5bcf49028c604a352d19..b9eb3d9de670bdeb0b6c2500b43bb74bc3807bd9:/src/mac/classic/region.cpp?ds=sidebyside diff --git a/src/mac/classic/region.cpp b/src/mac/classic/region.cpp index a3cf8cef7b..2b25c299cc 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,19 +8,19 @@ // 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" -#if !USE_SHARED_LIBRARY - IMPLEMENT_DYNAMIC_CLASS(wxRegion, wxGDIObject) - IMPLEMENT_DYNAMIC_CLASS(wxRegionIterator, wxObject) +#ifndef WX_PRECOMP + #include "wx/gdicmn.h" #endif +#include "wx/mac/uma.h" + +IMPLEMENT_DYNAMIC_CLASS(wxRegion, wxGDIObject) +IMPLEMENT_DYNAMIC_CLASS(wxRegionIterator, wxObject) + //----------------------------------------------------------------------------- // wxRegionRefData implementation //----------------------------------------------------------------------------- @@ -107,11 +107,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(); @@ -119,7 +119,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: @@ -142,20 +142,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(); @@ -182,7 +182,7 @@ bool wxRegion::Combine(const wxRegion& region, wxRegionOp op) break ; } - return TRUE; + return true; } bool wxRegion::Combine(const wxRect& rect, wxRegionOp op) @@ -197,7 +197,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 ) ; @@ -205,8 +205,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; } @@ -255,7 +255,7 @@ wxRegionContain wxRegion::Contains(const wxPoint& pt) const Point p = { pt.y , pt.x } ; if (PtInRgn( p , M_REGION ) ) return wxInRegion; - + return wxOutRegion; } @@ -434,4 +434,3 @@ long wxRegionIterator::GetH() const return m_rects[m_current].height; return 0; } -