// 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"
m_region = gdk_region_copy(refData.m_region);
}
- ~wxRegionRefData()
+ virtual ~wxRegionRefData()
{
if (m_region)
gdk_region_destroy( m_region );
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 );
}