X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/2b5f62a0b2db198609b45dec622a018dae37008e..921c65ed3d889117c600387cebb0bce2470cff8e:/src/msw/region.cpp?ds=inline diff --git a/src/msw/region.cpp b/src/msw/region.cpp index 4da2054b10..828fe82e64 100644 --- a/src/msw/region.cpp +++ b/src/msw/region.cpp @@ -1,11 +1,11 @@ ///////////////////////////////////////////////////////////////////////////// // Name: msw/region.cpp // Purpose: wxRegion implementation using Win32 API -// Author: Markus Holzem, Vadim Zeitlin +// Author: Vadim Zeitlin // Modified by: // Created: Fri Oct 24 10:46:34 MET 1997 // RCS-ID: $Id$ -// Copyright: (c) 1997-2002 wxWindows team +// Copyright: (c) 1997-2002 wxWidgets team // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// @@ -17,7 +17,7 @@ // headers // ---------------------------------------------------------------------------- -#ifdef __GNUG__ +#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) #pragma implementation "region.h" #endif @@ -48,9 +48,9 @@ public: m_region = 0; } - wxRegionRefData(const wxRegionRefData& data) + wxRegionRefData(const wxRegionRefData& data) : wxGDIRefData() { -#if defined(__WIN32__) && !defined(__WXMICROWIN__) +#if defined(__WIN32__) && !defined(__WXMICROWIN__) && !defined(__WXWINCE__) DWORD noBytes = ::GetRegionData(data.m_region, 0, NULL); RGNDATA *rgnData = (RGNDATA*) new char[noBytes]; ::GetRegionData(data.m_region, noBytes, rgnData); @@ -70,6 +70,14 @@ public: } HRGN m_region; + +private: +// Cannot use +// DECLARE_NO_COPY_CLASS(wxRegionRefData) +// because copy constructor is explicitly declared above; +// but no copy assignment operator is defined, so declare +// it private to prevent the compiler from defining it: + wxRegionRefData& operator=(const wxRegionRefData&); }; #define M_REGION (((wxRegionRefData*)m_refData)->m_region) @@ -114,7 +122,10 @@ wxRegion::wxRegion(const wxRect& rect) wxRegion::wxRegion(size_t n, const wxPoint *points, int fillStyle) { -#ifdef __WXMICROWIN__ +#if defined(__WXMICROWIN__) || defined(__WXWINCE__) + wxUnusedVar(n); + wxUnusedVar(points); + wxUnusedVar(fillStyle); m_refData = NULL; M_REGION = NULL; #else @@ -155,12 +166,12 @@ void wxRegion::Clear() bool wxRegion::Offset(wxCoord x, wxCoord y) { - wxCHECK_MSG( M_REGION, FALSE, _T("invalid wxRegion") ); + wxCHECK_MSG( M_REGION, false, _T("invalid wxRegion") ); if ( !x && !y ) { // nothing to do - return TRUE; + return true; } AllocExclusive(); @@ -169,10 +180,10 @@ bool wxRegion::Offset(wxCoord x, wxCoord y) { wxLogLastError(_T("OffsetRgn")); - return FALSE; + return false; } - return TRUE; + return true; } // combine another region with this one @@ -198,7 +209,7 @@ bool wxRegion::Combine(const wxRegion& rgn, wxRegionOp op) case wxRGN_AND: case wxRGN_DIFF: // leave empty/invalid - return FALSE; + return false; } } else // we have a valid region @@ -237,11 +248,11 @@ bool wxRegion::Combine(const wxRegion& rgn, wxRegionOp op) { wxLogLastError(_T("CombineRgn")); - return FALSE; + return false; } } - return TRUE; + return true; } // Combine rectangle (x, y, w, h) with this. @@ -413,7 +424,6 @@ void wxRegionIterator::Reset(const wxRegion& region) m_numRects = 0; else { -#if defined(__WIN32__) DWORD noBytes = ::GetRegionData(((wxRegionRefData*)region.m_refData)->m_region, 0, NULL); RGNDATA *rgnData = (RGNDATA*) new char[noBytes]; ::GetRegionData(((wxRegionRefData*)region.m_refData)->m_region, noBytes, rgnData); @@ -434,17 +444,6 @@ void wxRegionIterator::Reset(const wxRegion& region) m_numRects = header->nCount; delete[] (char*) rgnData; -#else // Win16 - RECT rect; - ::GetRgnBox(((wxRegionRefData*)region.m_refData)->m_region, &rect); - m_rects = new wxRect[1]; - m_rects[0].x = rect.left; - m_rects[0].y = rect.top; - m_rects[0].width = rect.right - rect.left; - m_rects[0].height = rect.bottom - rect.top; - - m_numRects = 1; -#endif // Win32/16 } }