X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/68567a967bc8afd37a40cb9a7ee5021b9ee6cd96..ce22ac4592fccaedd8324e7a8f08b510748827e4:/src/gtk/region.cpp diff --git a/src/gtk/region.cpp b/src/gtk/region.cpp index 71cc667463..0cb6a0ee19 100644 --- a/src/gtk/region.cpp +++ b/src/gtk/region.cpp @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: gtk/region.cpp +// Name: src/gtk/region.cpp // Purpose: // Author: Robert Roebling // Modified: VZ at 05.10.00: use AllocExclusive(), comparison fixed @@ -20,7 +20,11 @@ #include "wx/wxprec.h" #include "wx/region.h" -#include "wx/log.h" + +#ifndef WX_PRECOMP + #include "wx/log.h" +#endif + #include "wx/gtk/private.h" @@ -42,7 +46,7 @@ public: m_region = gdk_region_copy(refData.m_region); } - ~wxRegionRefData() + virtual ~wxRegionRefData() { if (m_region) gdk_region_destroy( m_region ); @@ -131,9 +135,9 @@ wxObjectRefData *wxRegion::CloneRefData(const wxObjectRefData *data) const 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, @@ -155,7 +159,7 @@ bool wxRegion::Union( wxCoord x, wxCoord y, wxCoord width, wxCoord height ) // rectangle results in an empty region which is definitely not what we // want if ( !width || !height ) - return TRUE; + return true; if ( !m_refData ) { @@ -174,7 +178,7 @@ bool wxRegion::Union( wxCoord x, wxCoord y, wxCoord width, wxCoord height ) gdk_region_union_with_rect( M_REGIONDATA->m_region, &rect ); } - return TRUE; + return true; } bool wxRegion::Union( const wxRect& rect ) @@ -185,7 +189,7 @@ bool wxRegion::Union( const wxRect& rect ) bool wxRegion::Union( const wxRegion& region ) { if (region.IsNull()) - return FALSE; + return false; if (!m_refData) { @@ -199,7 +203,7 @@ bool wxRegion::Union( const wxRegion& region ) gdk_region_union( M_REGIONDATA->m_region, region.GetRegion() ); - return TRUE; + return true; } bool wxRegion::Intersect( wxCoord x, wxCoord y, wxCoord width, wxCoord height ) @@ -219,19 +223,19 @@ bool wxRegion::Intersect( const wxRect& rect ) 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 ) @@ -249,19 +253,19 @@ bool wxRegion::Subtract( const wxRect& rect ) 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 ) @@ -279,30 +283,30 @@ bool wxRegion::Xor( const wxRect& rect ) 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; } // ---------------------------------------------------------------------------- @@ -339,7 +343,7 @@ wxRect wxRegion::GetBox() const bool wxRegion::Empty() const { if (!m_refData) - return TRUE; + return true; return gdk_region_empty( M_REGIONDATA->m_region ); } @@ -524,4 +528,3 @@ wxRect wxRegionIterator::GetRect() const return r; } -