From b3a44e057b5183acdf2cf133f059cf94c7884738 Mon Sep 17 00:00:00 2001 From: =?utf8?q?W=C5=82odzimierz=20Skiba?= Date: Fri, 16 Jun 2006 07:14:51 +0000 Subject: [PATCH] Include wx/region.h according to precompiled headers of wx/wx.h (with other minor cleaning). git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@39760 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/wx.h | 2 +- src/cocoa/region.mm | 16 ++++++++++++--- src/gtk/region.cpp | 39 ++++++++++++++++++------------------ src/mac/carbon/dc.cpp | 2 +- src/mac/carbon/dccg.cpp | 2 +- src/mac/carbon/dcclient.cpp | 2 +- src/mac/carbon/region.cpp | 6 +++--- src/mac/classic/dc.cpp | 2 +- src/mac/classic/dcclient.cpp | 2 +- src/mac/classic/region.cpp | 32 +++++++++++++++-------------- src/mgl/region.cpp | 1 + src/msw/region.cpp | 5 ++--- src/palmos/region.cpp | 14 ++++++------- src/x11/utilsx.cpp | 2 +- 14 files changed, 70 insertions(+), 57 deletions(-) diff --git a/include/wx/wx.h b/include/wx/wx.h index e204e289af..5f6ef4a99f 100644 --- a/include/wx/wx.h +++ b/include/wx/wx.h @@ -34,6 +34,7 @@ #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" @@ -93,4 +94,3 @@ #endif // wxUSE_GUI #endif // _WX_WX_H_ - diff --git a/src/cocoa/region.mm b/src/cocoa/region.mm index b8ed91676f..14cd20984f 100644 --- a/src/cocoa/region.mm +++ b/src/cocoa/region.mm @@ -1,14 +1,25 @@ ///////////////////////////////////////////////////////////////////////////// -// 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 @@ -33,4 +44,3 @@ wxRegion::wxRegion(const NSRect *rects, int count) Union(NSRectToWxRect(rects[i])); } } - diff --git a/src/gtk/region.cpp b/src/gtk/region.cpp index 4db9d7755f..0fd5a8ac44 100644 --- a/src/gtk/region.cpp +++ b/src/gtk/region.cpp @@ -19,11 +19,12 @@ // 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" @@ -134,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, @@ -158,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 ) { @@ -177,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 ) @@ -188,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) { @@ -202,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 ) @@ -222,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 ) @@ -252,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 ) @@ -282,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; } // ---------------------------------------------------------------------------- @@ -342,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 ); } diff --git a/src/mac/carbon/dc.cpp b/src/mac/carbon/dc.cpp index 76717f4b4c..7140e82d7e 100644 --- a/src/mac/carbon/dc.cpp +++ b/src/mac/carbon/dc.cpp @@ -20,10 +20,10 @@ #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__ diff --git a/src/mac/carbon/dccg.cpp b/src/mac/carbon/dccg.cpp index fb97b10859..beddc49b5c 100755 --- a/src/mac/carbon/dccg.cpp +++ b/src/mac/carbon/dccg.cpp @@ -20,10 +20,10 @@ #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" diff --git a/src/mac/carbon/dcclient.cpp b/src/mac/carbon/dcclient.cpp index c05e976854..0e0b775e92 100644 --- a/src/mac/carbon/dcclient.cpp +++ b/src/mac/carbon/dcclient.cpp @@ -20,9 +20,9 @@ #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" //----------------------------------------------------------------------------- diff --git a/src/mac/carbon/region.cpp b/src/mac/carbon/region.cpp index b20a78b000..a123e2a647 100644 --- a/src/mac/carbon/region.cpp +++ b/src/mac/carbon/region.cpp @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// File: region.cpp +// File: src/mac/carbon/region.cpp // Purpose: Region class // Author: Stefan Csomor // Created: Fri Oct 24 10:46:34 MET 1997 @@ -11,6 +11,7 @@ #include "wx/wxprec.h" #include "wx/region.h" + #include "wx/gdicmn.h" #include "wx/mac/uma.h" @@ -512,7 +513,7 @@ wxRegionIterator& wxRegionIterator::operator ++ () { if (m_current < m_numRects) ++m_current; - + return *this; } @@ -561,4 +562,3 @@ long wxRegionIterator::GetH() const return 0; } - diff --git a/src/mac/classic/dc.cpp b/src/mac/classic/dc.cpp index b368d67128..8d1e1762df 100644 --- a/src/mac/classic/dc.cpp +++ b/src/mac/classic/dc.cpp @@ -18,10 +18,10 @@ #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 diff --git a/src/mac/classic/dcclient.cpp b/src/mac/classic/dcclient.cpp index a76be690b6..9d7133b6e8 100644 --- a/src/mac/classic/dcclient.cpp +++ b/src/mac/classic/dcclient.cpp @@ -18,9 +18,9 @@ #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" //----------------------------------------------------------------------------- diff --git a/src/mac/classic/region.cpp b/src/mac/classic/region.cpp index 8920707ed2..4bfadfd5bb 100644 --- a/src/mac/classic/region.cpp +++ b/src/mac/classic/region.cpp @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// File: region.cpp +// File: src/mac/classic/region.cpp // Purpose: Region class // Author: Stefan Csomor // Created: Fri Oct 24 10:46:34 MET 1997 @@ -8,7 +8,10 @@ // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// +#include "wx/wxprec.h" + #include "wx/region.h" + #include "wx/gdicmn.h" #include "wx/mac/uma.h" @@ -101,11 +104,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(); @@ -113,7 +116,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: @@ -136,20 +139,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(); @@ -176,7 +179,7 @@ bool wxRegion::Combine(const wxRegion& region, wxRegionOp op) break ; } - return TRUE; + return true; } bool wxRegion::Combine(const wxRect& rect, wxRegionOp op) @@ -191,7 +194,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 ) ; @@ -199,8 +202,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; } @@ -249,7 +252,7 @@ wxRegionContain wxRegion::Contains(const wxPoint& pt) const Point p = { pt.y , pt.x } ; if (PtInRgn( p , M_REGION ) ) return wxInRegion; - + return wxOutRegion; } @@ -428,4 +431,3 @@ long wxRegionIterator::GetH() const return m_rects[m_current].height; return 0; } - diff --git a/src/mgl/region.cpp b/src/mgl/region.cpp index bd1da90543..78b688a6cb 100644 --- a/src/mgl/region.cpp +++ b/src/mgl/region.cpp @@ -15,6 +15,7 @@ #endif #include "wx/region.h" + #include "wx/gdicmn.h" #include "wx/thread.h" #include "wx/module.h" diff --git a/src/msw/region.cpp b/src/msw/region.cpp index eb6e672159..df3273df82 100644 --- a/src/msw/region.cpp +++ b/src/msw/region.cpp @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: msw/region.cpp +// Name: src/msw/region.cpp // Purpose: wxRegion implementation using Win32 API // Author: Vadim Zeitlin // Modified by: @@ -25,8 +25,8 @@ #endif #include "wx/region.h" -#include "wx/gdicmn.h" +#include "wx/gdicmn.h" #include "wx/msw/private.h" IMPLEMENT_DYNAMIC_CLASS(wxRegion, wxGDIObject) @@ -491,4 +491,3 @@ wxCoord wxRegionIterator::GetH() const return m_rects[m_current].height; } - diff --git a/src/palmos/region.cpp b/src/palmos/region.cpp index fdbffa9f08..64e726b997 100644 --- a/src/palmos/region.cpp +++ b/src/palmos/region.cpp @@ -1,12 +1,12 @@ ///////////////////////////////////////////////////////////////////////////// -// 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 ///////////////////////////////////////////////////////////////////////////// // ============================================================================ @@ -25,6 +25,7 @@ #endif #include "wx/region.h" + #include "wx/gdicmn.h" IMPLEMENT_DYNAMIC_CLASS(wxRegion, wxGDIObject) @@ -236,4 +237,3 @@ wxCoord wxRegionIterator::GetH() const { return 0; } - diff --git a/src/x11/utilsx.cpp b/src/x11/utilsx.cpp index ff17f168e7..c01eeb8af8 100644 --- a/src/x11/utilsx.cpp +++ b/src/x11/utilsx.cpp @@ -23,6 +23,7 @@ #ifndef WX_PRECOMP #include "wx/bitmap.h" + #include "wx/region.h" #endif #ifdef __VMS @@ -32,7 +33,6 @@ #include #endif - #include "wx/region.h" #include "wx/dcmemory.h" #endif -- 2.47.2