X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/77ffb5937e89927b621128789401db8921fe580f..ec5006bdc630dd6b3d4cad1a3b572ab4c695a029:/src/mac/classic/region.cpp?ds=sidebyside diff --git a/src/mac/classic/region.cpp b/src/mac/classic/region.cpp index fcf4055a2b..6d3e1bafc5 100644 --- a/src/mac/classic/region.cpp +++ b/src/mac/classic/region.cpp @@ -1,26 +1,26 @@ ///////////////////////////////////////////////////////////////////////////// -// File: region.cpp +// File: src/mac/classic/region.cpp // Purpose: Region class // Author: Stefan Csomor // Created: Fri Oct 24 10:46:34 MET 1997 // RCS-ID: $Id$ // Copyright: (c) 1997 Stefan Csomor -// Licence: wxWidgets licence +// 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 //----------------------------------------------------------------------------- @@ -39,7 +39,7 @@ public: CopyRgn( data.m_macRgn , m_macRgn ) ; } - ~wxRegionRefData() + virtual ~wxRegionRefData() { DisposeRgn( m_macRgn ) ; } @@ -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; } -