#include "wx/panel.h"
#include "wx/toplevel.h"
#include "wx/frame.h"
+#include "wx/region.h"
#include "wx/bitmap.h"
#include "wx/colour.h"
#include "wx/font.h"
#endif // wxUSE_GUI
#endif // _WX_WX_H_
-
/////////////////////////////////////////////////////////////////////////////
-// Name: cocoa/region.mm
+// Name: src/cocoa/region.mm
// Purpose: wxRegion class
// Author: David Elliott
-// Modified by:
+// Modified by:
// Created: 2004/04/12
// RCS-ID: $Id$
// Copyright: (c) 2004 David Elliott
// Licence: wxWidgets licence
/////////////////////////////////////////////////////////////////////////////
+// ============================================================================
+// declarations
+// ============================================================================
+
+// ----------------------------------------------------------------------------
+// headers
+// ----------------------------------------------------------------------------
+
+// For compilers that support precompilation, includes "wx.h".
+#include "wx/wxprec.h"
+
#include "wx/region.h"
#import <Foundation/NSGeometry.h>
Union(NSRectToWxRect(rects[i]));
}
}
-
// For compilers that support precompilation, includes "wx.h".
#include "wx/wxprec.h"
+#include "wx/region.h"
+
#ifndef WX_PRECOMP
#include "wx/log.h"
#endif
-#include "wx/region.h"
#include "wx/gtk/private.h"
bool wxRegion::operator==( const wxRegion& region ) const
{
- if (m_refData == region.m_refData) return TRUE;
+ if (m_refData == region.m_refData) return true;
- if (!m_refData || !region.m_refData) return FALSE;
+ if (!m_refData || !region.m_refData) return false;
// compare the regions themselves, not the pointers to ref data!
return gdk_region_equal(M_REGIONDATA->m_region,
// rectangle results in an empty region which is definitely not what we
// want
if ( !width || !height )
- return TRUE;
+ return true;
if ( !m_refData )
{
gdk_region_union_with_rect( M_REGIONDATA->m_region, &rect );
}
- return TRUE;
+ return true;
}
bool wxRegion::Union( const wxRect& rect )
bool wxRegion::Union( const wxRegion& region )
{
if (region.IsNull())
- return FALSE;
+ return false;
if (!m_refData)
{
gdk_region_union( M_REGIONDATA->m_region, region.GetRegion() );
- return TRUE;
+ return true;
}
bool wxRegion::Intersect( wxCoord x, wxCoord y, wxCoord width, wxCoord height )
bool wxRegion::Intersect( const wxRegion& region )
{
if (region.IsNull())
- return FALSE;
+ return false;
if (!m_refData)
{
// intersecting with invalid region doesn't make sense
- return FALSE;
+ return false;
}
AllocExclusive();
gdk_region_intersect( M_REGIONDATA->m_region, region.GetRegion() );
- return TRUE;
+ return true;
}
bool wxRegion::Subtract( wxCoord x, wxCoord y, wxCoord width, wxCoord height )
bool wxRegion::Subtract( const wxRegion& region )
{
if (region.IsNull())
- return FALSE;
+ return false;
if (!m_refData)
{
// subtracting from an invalid region doesn't make sense
- return FALSE;
+ return false;
}
AllocExclusive();
gdk_region_subtract( M_REGIONDATA->m_region, region.GetRegion() );
- return TRUE;
+ return true;
}
bool wxRegion::Xor( wxCoord x, wxCoord y, wxCoord width, wxCoord height )
bool wxRegion::Xor( const wxRegion& region )
{
if (region.IsNull())
- return FALSE;
+ return false;
if (!m_refData)
{
- return FALSE;
+ return false;
}
AllocExclusive();
gdk_region_xor( M_REGIONDATA->m_region, region.GetRegion() );
- return TRUE;
+ return true;
}
bool wxRegion::Offset( wxCoord x, wxCoord y )
{
if (!m_refData)
- return FALSE;
+ return false;
AllocExclusive();
gdk_region_offset( M_REGIONDATA->m_region, x, y );
- return TRUE;
+ return true;
}
// ----------------------------------------------------------------------------
bool wxRegion::Empty() const
{
if (!m_refData)
- return TRUE;
+ return true;
return gdk_region_empty( M_REGIONDATA->m_region );
}
#include "wx/app.h"
#include "wx/dcmemory.h"
#include "wx/dcprint.h"
+ #include "wx/region.h"
#endif
#include "wx/mac/uma.h"
-#include "wx/region.h"
#include "wx/image.h"
#ifdef __MSL__
#include "wx/app.h"
#include "wx/dcmemory.h"
#include "wx/dcprint.h"
+ #include "wx/region.h"
#endif
#include "wx/mac/uma.h"
-#include "wx/region.h"
#include "wx/image.h"
#include "wx/settings.h"
#include "wx/toplevel.h"
#include "wx/math.h"
+ #include "wx/region.h"
#endif
-#include "wx/region.h"
#include "wx/mac/private.h"
//-----------------------------------------------------------------------------
/////////////////////////////////////////////////////////////////////////////
-// File: region.cpp
+// File: src/mac/carbon/region.cpp
// Purpose: Region class
// Author: Stefan Csomor
// Created: Fri Oct 24 10:46:34 MET 1997
#include "wx/wxprec.h"
#include "wx/region.h"
+
#include "wx/gdicmn.h"
#include "wx/mac/uma.h"
{
if (m_current < m_numRects)
++m_current;
-
+
return *this;
}
return 0;
}
-
#include "wx/app.h"
#include "wx/dcmemory.h"
#include "wx/dcprint.h"
+ #include "wx/region.h"
#endif
#include "wx/mac/uma.h"
-#include "wx/region.h"
#include "wx/image.h"
#if __MSL__ >= 0x6000
#include "wx/dcmemory.h"
#include "wx/toplevel.h"
#include "wx/math.h"
+ #include "wx/region.h"
#endif
-#include "wx/region.h"
#include "wx/mac/private.h"
//-----------------------------------------------------------------------------
/////////////////////////////////////////////////////////////////////////////
-// 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
/////////////////////////////////////////////////////////////////////////////
+#include "wx/wxprec.h"
+
#include "wx/region.h"
+
#include "wx/gdicmn.h"
#include "wx/mac/uma.h"
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;
}
-
#endif
#include "wx/region.h"
+
#include "wx/gdicmn.h"
#include "wx/thread.h"
#include "wx/module.h"
/////////////////////////////////////////////////////////////////////////////
-// Name: msw/region.cpp
+// Name: src/msw/region.cpp
// Purpose: wxRegion implementation using Win32 API
// Author: Vadim Zeitlin
// Modified by:
#endif
#include "wx/region.h"
-#include "wx/gdicmn.h"
+#include "wx/gdicmn.h"
#include "wx/msw/private.h"
IMPLEMENT_DYNAMIC_CLASS(wxRegion, wxGDIObject)
return m_rects[m_current].height;
}
-
/////////////////////////////////////////////////////////////////////////////
-// Name: src/palmos/region.cpp
-// Purpose: wxRegion implementation
+// Name: src/palmos/region.cpp
+// Purpose: wxRegion implementation
// Author: William Osborne - minimal working wxPalmOS port
// Modified by:
-// Created: 10/13/04
-// RCS-ID: $Id$
-// Copyright: (c) William Osborne
-// Licence: wxWindows licence
+// Created: 10/13/04
+// RCS-ID: $Id$
+// Copyright: (c) William Osborne
+// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
// ============================================================================
#endif
#include "wx/region.h"
+
#include "wx/gdicmn.h"
IMPLEMENT_DYNAMIC_CLASS(wxRegion, wxGDIObject)
{
return 0;
}
-
#ifndef WX_PRECOMP
#include "wx/bitmap.h"
+ #include "wx/region.h"
#endif
#ifdef __VMS
#include <X11/extensions/shape.h>
#endif
- #include "wx/region.h"
#include "wx/dcmemory.h"
#endif