/////////////////////////////////////////////////////////////////////////////
-// File: region.cpp
+// File: src/mac/classic/region.cpp
// Purpose: Region class
// Author: Stefan Csomor
// Created: Fri Oct 24 10:46:34 MET 1997
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
-#ifdef __GNUG__
-#pragma implementation "region.h"
-#endif
+#include "wx/wxprec.h"
#include "wx/region.h"
-#include "wx/gdicmn.h"
+
+#ifndef WX_PRECOMP
+ #include "wx/gdicmn.h"
+#endif
+
#include "wx/mac/uma.h"
IMPLEMENT_DYNAMIC_CLASS(wxRegion, wxGDIObject)
CopyRgn( data.m_macRgn , m_macRgn ) ;
}
- ~wxRegionRefData()
+ virtual ~wxRegionRefData()
{
DisposeRgn( m_macRgn ) ;
}
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();
}
RgnHandle rgn = NewRgn() ;
SetRectRgn( rgn , x , y, x+width,y + height ) ;
-
+
switch (op)
{
case wxRGN_AND:
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();
break ;
}
- return TRUE;
+ return true;
}
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 ) ;
y = box.top ;
w = box.right - box.left ;
h = box.bottom - box.top ;
- }
- else
+ }
+ else
{
x = y = w = h = 0;
}
Point p = { pt.y , pt.x } ;
if (PtInRgn( p , M_REGION ) )
return wxInRegion;
-
+
return wxOutRegion;
}
return m_rects[m_current].height;
return 0;
}
-