From fdaad94e75273fa586ec9af9d53518222f9699d0 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sun, 8 Jun 2008 01:45:56 +0000 Subject: [PATCH] deprecate wxDC::SetClippingRegion(wxRegion) overload and replace it with SetDeviceClippingRegion() to avoid confusion due to use of different kind of coordinates in this and other overloads of the same function; also rename wxDCImpl::DoSetClippingRegionAsRegion() to DoSetDeviceClippingRegion(); finally use bounding box of the region passed to wxDCClipper ctor to avoid interpreting coordinates differently for different ctors of the same class (see #8970) git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@54024 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- docs/changes.txt | 7 +++++++ include/wx/cocoa/dc.h | 2 +- include/wx/dc.h | 23 +++++++++++++++++++---- include/wx/dcgraph.h | 2 +- include/wx/dcmirror.h | 2 +- include/wx/dcsvg.h | 4 ++-- include/wx/dfb/dc.h | 4 +--- include/wx/generic/dcpsg.h | 5 ++++- include/wx/gtk/dcclient.h | 2 +- include/wx/gtk/gnome/gprint.h | 5 ++++- include/wx/gtk/print.h | 5 ++++- include/wx/gtk1/dcclient.h | 2 +- include/wx/mgl/dc.h | 4 +--- include/wx/motif/dcclient.h | 2 +- include/wx/msw/dc.h | 6 ++---- include/wx/os2/dc.h | 2 +- include/wx/palmos/dc.h | 7 +------ include/wx/x11/dcclient.h | 2 +- interface/dc.h | 9 ++++++++- src/common/dcgraph.cpp | 4 ++-- src/common/rgncmn.cpp | 2 +- src/dfb/dc.cpp | 13 +++++++++++-- src/gtk/dcclient.cpp | 2 +- src/gtk1/dcclient.cpp | 2 +- src/mgl/dc.cpp | 2 +- src/motif/dcclient.cpp | 10 +++++----- src/msw/dc.cpp | 4 ++-- src/os2/dc.cpp | 4 ++-- src/palmos/dc.cpp | 8 +------- src/x11/dcclient.cpp | 2 +- 30 files changed, 89 insertions(+), 59 deletions(-) diff --git a/docs/changes.txt b/docs/changes.txt index 185cc4f340..0f9625d963 100644 --- a/docs/changes.txt +++ b/docs/changes.txt @@ -218,6 +218,13 @@ Deprecated methods and their replacements - EVT_CALENDAR_MONTH and EVT_CALENDAR_YEAR events are deprecated, use EVT_CALENDAR_PAGE_CHANGED which replaces both of them. - wxCalendarCtrl::EnableYearChange() and wxCAL_NO_YEAR_CHANGE are deprecated. + There is no replacement for this functionality, it is being dropped as it is + not available in native wxCalendarCtrl implementations. +- wxDC::SetClippingRegion(const wxRegion&) overload is deprecated as it used + different convention from the other SetClippingRegion() overloads: wxRegion + passed to it was interpreted in physical, not logical, coordinates. Replace + it with SetDeviceClippingRegion() if this was the correct thing to do in your + code. diff --git a/include/wx/cocoa/dc.h b/include/wx/cocoa/dc.h index 2dbe2e32a1..8e990e080e 100644 --- a/include/wx/cocoa/dc.h +++ b/include/wx/cocoa/dc.h @@ -158,7 +158,7 @@ protected: // this is gnarly - we can't even call this function DoSetClippingRegion() // because of virtual function hiding - virtual void DoSetClippingRegionAsRegion(const wxRegion& region); + virtual void DoSetDeviceClippingRegion(const wxRegion& region); virtual void DoSetClippingRegion(wxCoord x, wxCoord y, wxCoord width, wxCoord height); diff --git a/include/wx/dc.h b/include/wx/dc.h index 560d969061..8599c02433 100644 --- a/include/wx/dc.h +++ b/include/wx/dc.h @@ -316,7 +316,9 @@ public: virtual void DoSetClippingRegion(wxCoord x, wxCoord y, wxCoord width, wxCoord height) = 0; - virtual void DoSetClippingRegionAsRegion(const wxRegion& region) = 0; + + // NB: this function works with device coordinates, not the logical ones! + virtual void DoSetDeviceClippingRegion(const wxRegion& region) = 0; virtual void DoGetClippingBox(wxCoord *x, wxCoord *y, wxCoord *w, wxCoord *h) const @@ -796,8 +798,21 @@ public: { m_pimpl->DoSetClippingRegion(pt.x, pt.y, sz.x, sz.y); } void SetClippingRegion(const wxRect& rect) { m_pimpl->DoSetClippingRegion(rect.x, rect.y, rect.width, rect.height); } - void SetClippingRegion(const wxRegion& region) - { m_pimpl->DoSetClippingRegionAsRegion(region); } + + // unlike the functions above, the coordinates of the region used in this + // one are in device coordinates, not the logical ones + void SetDeviceClippingRegion(const wxRegion& region) + { m_pimpl->DoSetDeviceClippingRegion(region); } + + // this function is deprecated because its name is confusing: you may + // expect it to work with logical coordinates but, in fact, it does exactly + // the same thing as SetDeviceClippingRegion() + // + // please review the code using it and either replace it with calls to + // SetDeviceClippingRegion() or correct it if it was [wrongly] passing + // logical coordinates to this function + wxDEPRECATED_INLINE(void SetClippingRegion(const wxRegion& region), + SetDeviceClippingRegion(region); ) void DestroyClippingRegion() { m_pimpl->DestroyClippingRegion(); } @@ -1212,7 +1227,7 @@ class WXDLLIMPEXP_CORE wxDCClipper { public: wxDCClipper(wxDC& dc, const wxRegion& r) : m_dc(dc) - { dc.SetClippingRegion(r); } + { dc.SetClippingRegion(r.GetBox()); } wxDCClipper(wxDC& dc, const wxRect& r) : m_dc(dc) { dc.SetClippingRegion(r.x, r.y, r.width, r.height); } wxDCClipper(wxDC& dc, wxCoord x, wxCoord y, wxCoord w, wxCoord h) : m_dc(dc) diff --git a/include/wx/dcgraph.h b/include/wx/dcgraph.h index 820c6780c7..0c2dec4771 100644 --- a/include/wx/dcgraph.h +++ b/include/wx/dcgraph.h @@ -168,7 +168,7 @@ public: wxCoord xoffset, wxCoord yoffset, int fillStyle); - virtual void DoSetClippingRegionAsRegion(const wxRegion& region); + virtual void DoSetDeviceClippingRegion(const wxRegion& region); virtual void DoSetClippingRegion(wxCoord x, wxCoord y, wxCoord width, wxCoord height); diff --git a/include/wx/dcmirror.h b/include/wx/dcmirror.h index 94e33b2ad5..7ab8d88f25 100644 --- a/include/wx/dcmirror.h +++ b/include/wx/dcmirror.h @@ -246,7 +246,7 @@ protected: Mirror(n, points); } - virtual void DoSetClippingRegionAsRegion(const wxRegion& WXUNUSED(region)) + virtual void DoSetDeviceClippingRegion(const wxRegion& WXUNUSED(region)) { wxFAIL_MSG( _T("not implemented") ); } diff --git a/include/wx/dcsvg.h b/include/wx/dcsvg.h index fc17548fae..8921784aae 100644 --- a/include/wx/dcsvg.h +++ b/include/wx/dcsvg.h @@ -166,9 +166,9 @@ private: wxCoord *externalLeading = NULL, const wxFont *font = NULL) const; - virtual void DoSetClippingRegionAsRegion(const wxRegion& WXUNUSED(region)) + virtual void DoSetDeviceClippingRegion(const wxRegion& WXUNUSED(region)) { - wxFAIL_MSG(wxT("wxSVGFILEDC::DoSetClippingRegionAsRegion not yet implemented")); + wxFAIL_MSG(wxT("wxSVGFILEDC::DoSetDeviceClippingRegion not yet implemented")); } virtual void DoSetClippingRegion( int WXUNUSED(x), int WXUNUSED(y), int WXUNUSED(width), int WXUNUSED(height) ) diff --git a/include/wx/dfb/dc.h b/include/wx/dfb/dc.h index a9a11d4136..c650c55ede 100644 --- a/include/wx/dfb/dc.h +++ b/include/wx/dfb/dc.h @@ -124,11 +124,9 @@ protected: wxDC *source, wxCoord xsrc, wxCoord ysrc, int rop = wxCOPY, bool useMask = false, wxCoord xsrcMask = -1, wxCoord ysrcMask = -1); - // this is gnarly - we can't even call this function DoSetClippingRegion() - // because of virtual function hiding - virtual void DoSetClippingRegionAsRegion(const wxRegion& region); virtual void DoSetClippingRegion(wxCoord x, wxCoord y, wxCoord width, wxCoord height); + virtual void DoSetDeviceClippingRegion(const wxRegion& region); virtual void DoGetSize(int *width, int *height) const; virtual void DoGetSizeMM(int* width, int* height) const; diff --git a/include/wx/generic/dcpsg.h b/include/wx/generic/dcpsg.h index b8847fa31f..3bba53d93c 100644 --- a/include/wx/generic/dcpsg.h +++ b/include/wx/generic/dcpsg.h @@ -119,7 +119,10 @@ protected: void DoDrawText(const wxString& text, wxCoord x, wxCoord y); void DoDrawRotatedText(const wxString& text, wxCoord x, wxCoord y, double angle); void DoSetClippingRegion(wxCoord x, wxCoord y, wxCoord width, wxCoord height); - void DoSetClippingRegionAsRegion( const wxRegion &WXUNUSED(clip)) { } + void DoSetDeviceClippingRegion( const wxRegion &WXUNUSED(clip)) + { + wxFAIL_MSG( "not implemented" ); + } void DoGetTextExtent(const wxString& string, wxCoord *x, wxCoord *y, wxCoord *descent = NULL, wxCoord *externalLeading = NULL, diff --git a/include/wx/gtk/dcclient.h b/include/wx/gtk/dcclient.h index 29e35429a5..7fb539c7b6 100644 --- a/include/wx/gtk/dcclient.h +++ b/include/wx/gtk/dcclient.h @@ -71,7 +71,7 @@ public: const wxFont *theFont = (wxFont *) NULL) const; virtual bool DoGetPartialTextExtents(const wxString& text, wxArrayInt& widths) const; virtual void DoSetClippingRegion( wxCoord x, wxCoord y, wxCoord width, wxCoord height ); - virtual void DoSetClippingRegionAsRegion( const wxRegion ®ion ); + virtual void DoSetDeviceClippingRegion( const wxRegion ®ion ); virtual wxCoord GetCharWidth() const; virtual wxCoord GetCharHeight() const; diff --git a/include/wx/gtk/gnome/gprint.h b/include/wx/gtk/gnome/gprint.h index d4c585e413..a801f01ccd 100644 --- a/include/wx/gtk/gnome/gprint.h +++ b/include/wx/gtk/gnome/gprint.h @@ -274,7 +274,10 @@ protected: void DoDrawText(const wxString& text, wxCoord x, wxCoord y ); void DoDrawRotatedText(const wxString& text, wxCoord x, wxCoord y, double angle); void DoSetClippingRegion(wxCoord x, wxCoord y, wxCoord width, wxCoord height); - void DoSetClippingRegionAsRegion( const wxRegion &WXUNUSED(clip) ) { } + void DoSetDeviceClippingRegion( const wxRegion &WXUNUSED(clip) ) + { + wxFAIL_MSG( "not implemented" ); + } void DoGetTextExtent(const wxString& string, wxCoord *x, wxCoord *y, wxCoord *descent = (wxCoord *) NULL, wxCoord *externalLeading = (wxCoord *) NULL, diff --git a/include/wx/gtk/print.h b/include/wx/gtk/print.h index b6f26630b0..66f34f0702 100644 --- a/include/wx/gtk/print.h +++ b/include/wx/gtk/print.h @@ -281,7 +281,10 @@ protected: void DoDrawText(const wxString& text, wxCoord x, wxCoord y ); void DoDrawRotatedText(const wxString& text, wxCoord x, wxCoord y, double angle); void DoSetClippingRegion(wxCoord x, wxCoord y, wxCoord width, wxCoord height); - void DoSetClippingRegionAsRegion( const wxRegion &WXUNUSED(clip) ) { } + void DoSetDeviceClippingRegion( const wxRegion &WXUNUSED(clip) ) + { + wxFAIL_MSG( "not implemented" ); + } void DoGetTextExtent(const wxString& string, wxCoord *x, wxCoord *y, wxCoord *descent = (wxCoord *) NULL, wxCoord *externalLeading = (wxCoord *) NULL, diff --git a/include/wx/gtk1/dcclient.h b/include/wx/gtk1/dcclient.h index 0304f15724..b0e3f9e438 100644 --- a/include/wx/gtk1/dcclient.h +++ b/include/wx/gtk1/dcclient.h @@ -94,7 +94,7 @@ public: virtual void DoSetClippingRegion( wxCoord x, wxCoord y, wxCoord width, wxCoord height ); virtual void DestroyClippingRegion(); - virtual void DoSetClippingRegionAsRegion( const wxRegion ®ion ); + virtual void DoSetDeviceClippingRegion( const wxRegion ®ion ); // Resolution in pixels per logical inch virtual wxSize GetPPI() const; diff --git a/include/wx/mgl/dc.h b/include/wx/mgl/dc.h index 39b183fa8a..02535965b7 100644 --- a/include/wx/mgl/dc.h +++ b/include/wx/mgl/dc.h @@ -140,11 +140,9 @@ protected: wxDC *source, wxCoord xsrc, wxCoord ysrc, int rop = wxCOPY, bool useMask = false, wxCoord xsrcMask = -1, wxCoord ysrcMask = -1); - // this is gnarly - we can't even call this function DoSetClippingRegion() - // because of virtual function hiding - virtual void DoSetClippingRegionAsRegion(const wxRegion& region); virtual void DoSetClippingRegion(wxCoord x, wxCoord y, wxCoord width, wxCoord height); + virtual void DoSetDeviceClippingRegion(const wxRegion& region); virtual void DoGetSize(int *width, int *height) const; virtual void DoGetSizeMM(int* width, int* height) const; diff --git a/include/wx/motif/dcclient.h b/include/wx/motif/dcclient.h index 3e4899f265..86f6ce73ee 100644 --- a/include/wx/motif/dcclient.h +++ b/include/wx/motif/dcclient.h @@ -117,9 +117,9 @@ protected: wxDC *source, wxCoord xsrc, wxCoord ysrc, int rop = wxCOPY, bool useMask = false, wxCoord xsrcMask = -1, wxCoord ysrcMask = -1); - virtual void DoSetClippingRegionAsRegion(const wxRegion& region); virtual void DoSetClippingRegion(wxCoord x, wxCoord y, wxCoord width, wxCoord height); + virtual void DoSetDeviceClippingRegion(const wxRegion& region); virtual void DoDrawLines(int n, wxPoint points[], wxCoord xoffset, wxCoord yoffset); diff --git a/include/wx/msw/dc.h b/include/wx/msw/dc.h index a4f6922d84..0eea5ca268 100644 --- a/include/wx/msw/dc.h +++ b/include/wx/msw/dc.h @@ -225,11 +225,9 @@ public: int rop = wxCOPY, bool useMask = false, wxCoord xsrcMask = wxDefaultCoord, wxCoord ysrcMask = wxDefaultCoord); - // this is gnarly - we can't even call this function DoSetClippingRegion() - // because of virtual function hiding - virtual void DoSetClippingRegionAsRegion(const wxRegion& region); virtual void DoSetClippingRegion(wxCoord x, wxCoord y, wxCoord width, wxCoord height); + virtual void DoSetDeviceClippingRegion(const wxRegion& region); virtual void DoGetClippingBox(wxCoord *x, wxCoord *y, wxCoord *w, wxCoord *h) const; @@ -265,7 +263,7 @@ protected: // common part of DoDrawText() and DoDrawRotatedText() void DrawAnyText(const wxString& text, wxCoord x, wxCoord y); - // common part of DoSetClippingRegion() and DoSetClippingRegionAsRegion() + // common part of DoSetClippingRegion() and DoSetDeviceClippingRegion() void SetClippingHrgn(WXHRGN hrgn); // implementation of DoGetSize() for wxScreen/PrinterDC: this simply diff --git a/include/wx/os2/dc.h b/include/wx/os2/dc.h index d5dc00aa1c..d8ced433d8 100644 --- a/include/wx/os2/dc.h +++ b/include/wx/os2/dc.h @@ -321,12 +321,12 @@ public: ,wxCoord vYsrcMask = -1 ); - virtual void DoSetClippingRegionAsRegion(const wxRegion& rRegion); virtual void DoSetClippingRegion( wxCoord vX ,wxCoord vY ,wxCoord vWidth ,wxCoord vHeight ); + virtual void DoSetDeviceClippingRegion(const wxRegion& rRegion); virtual void DoGetSize( int* pWidth ,int* pHeight diff --git a/include/wx/palmos/dc.h b/include/wx/palmos/dc.h index 0fb07f2a7a..216a802431 100644 --- a/include/wx/palmos/dc.h +++ b/include/wx/palmos/dc.h @@ -225,11 +225,9 @@ public: int rop = wxCOPY, bool useMask = false, wxCoord xsrcMask = wxDefaultCoord, wxCoord ysrcMask = wxDefaultCoord); - // this is gnarly - we can't even call this function DoSetClippingRegion() - // because of virtual function hiding - virtual void DoSetClippingRegionAsRegion(const wxRegion& region); virtual void DoSetClippingRegion(wxCoord x, wxCoord y, wxCoord width, wxCoord height); + virtual void DoSetDeviceClippingRegion(const wxRegion& region); virtual void DoGetClippingBox(wxCoord *x, wxCoord *y, wxCoord *w, wxCoord *h) const; @@ -265,9 +263,6 @@ protected: // common part of DoDrawText() and DoDrawRotatedText() void DrawAnyText(const wxString& text, wxCoord x, wxCoord y); - // common part of DoSetClippingRegion() and DoSetClippingRegionAsRegion() - void SetClippingHrgn(WXHRGN hrgn); - // implementation of DoGetSize() for wxScreen/PrinterDC: this simply // returns the size of the entire device this DC is associated with // diff --git a/include/wx/x11/dcclient.h b/include/wx/x11/dcclient.h index 627df84efd..95dfc30f50 100644 --- a/include/wx/x11/dcclient.h +++ b/include/wx/x11/dcclient.h @@ -71,9 +71,9 @@ protected: wxDC *source, wxCoord xsrc, wxCoord ysrc, int rop = wxCOPY, bool useMask = false, wxCoord xsrcMask = -1, wxCoord ysrcMask = -1); - virtual void DoSetClippingRegionAsRegion(const wxRegion& region); virtual void DoSetClippingRegion(wxCoord x, wxCoord y, wxCoord width, wxCoord height); + virtual void DoSetDeviceClippingRegion(const wxRegion& region); virtual void DoDrawLines(int n, wxPoint points[], wxCoord xoffset, wxCoord yoffset); diff --git a/interface/dc.h b/interface/dc.h index 9a3b4dac48..1467bff0c1 100644 --- a/interface/dc.h +++ b/interface/dc.h @@ -869,9 +869,16 @@ public: wxCoord height); void SetClippingRegion(const wxPoint& pt, const wxSize& sz); void SetClippingRegion(const wxRect& rect); - void SetClippingRegion(const wxRegion& region); //@} + /** + Sets the clipping region for this device context. + + Unlike SetClippingRegion(), this function works with physical + coordinates and not with the logical ones. + */ + void SetDeviceClippingRegion(const wxRegion& region); + /** Sets the device origin (i.e., the origin in pixels after scaling has been applied). This function may be useful in Windows printing diff --git a/src/common/dcgraph.cpp b/src/common/dcgraph.cpp index 0c51ae0773..ee36df03b5 100644 --- a/src/common/dcgraph.cpp +++ b/src/common/dcgraph.cpp @@ -237,10 +237,10 @@ void wxGCDCImpl::DoSetClippingRegion( wxCoord x, wxCoord y, wxCoord w, wxCoord h } } -void wxGCDCImpl::DoSetClippingRegionAsRegion( const wxRegion ®ion ) +void wxGCDCImpl::DoSetDeviceClippingRegion( const wxRegion ®ion ) { // region is in device coordinates - wxCHECK_RET( IsOk(), wxT("wxGCDC(cg)::DoSetClippingRegionAsRegion - invalid DC") ); + wxCHECK_RET( IsOk(), wxT("wxGCDC(cg)::DoSetDeviceClippingRegion - invalid DC") ); if (region.Empty()) { diff --git a/src/common/rgncmn.cpp b/src/common/rgncmn.cpp index a18bb20708..e19bf54505 100644 --- a/src/common/rgncmn.cpp +++ b/src/common/rgncmn.cpp @@ -65,7 +65,7 @@ wxBitmap wxRegionBase::ConvertToBitmap() const dc.SelectObject(bmp); dc.SetBackground(*wxBLACK_BRUSH); dc.Clear(); - dc.SetClippingRegion(*wx_static_cast(const wxRegion *, this)); + dc.SetDeviceClippingRegion(*wx_static_cast(const wxRegion *, this)); dc.SetBackground(*wxWHITE_BRUSH); dc.Clear(); dc.SelectObject(wxNullBitmap); diff --git a/src/dfb/dc.cpp b/src/dfb/dc.cpp index 16257ca195..67609b4f13 100644 --- a/src/dfb/dc.cpp +++ b/src/dfb/dc.cpp @@ -95,10 +95,19 @@ void wxDFBDCImpl::DoSetClippingRegion(wxCoord cx, wxCoord cy, wxCoord cw, wxCoor m_clipping = true; } -void wxDFBDCImpl::DoSetClippingRegionAsRegion(const wxRegion& region) +void wxDFBDCImpl::DoSetDeviceClippingRegion(const wxRegion& region) { // NB: this can be done because wxDFB only supports rectangular regions - GetOwner()->SetClippingRegion(region.AsRect()); + wxRect rect = region.AsRect(); + + // our parameter is in physical coordinates while DoSetClippingRegion() + // takes logical ones + rect.x = XDEV2LOG(rect.x); + rect.y = YDEV2LOG(rect.y); + rect.width = XDEV2LOG(rect.width); + rect.height = YDEV2LOG(rect.height); + + DoSetClippingRegion(rect); } void wxDFBDCImpl::DestroyClippingRegion() diff --git a/src/gtk/dcclient.cpp b/src/gtk/dcclient.cpp index 31995574ad..88649ea909 100644 --- a/src/gtk/dcclient.cpp +++ b/src/gtk/dcclient.cpp @@ -2115,7 +2115,7 @@ void wxWindowDCImpl::DoSetClippingRegion( wxCoord x, wxCoord y, wxCoord width, w gdk_gc_set_clip_region(m_bgGC, gdkRegion); } -void wxWindowDCImpl::DoSetClippingRegionAsRegion( const wxRegion ®ion ) +void wxWindowDCImpl::DoSetDeviceClippingRegion( const wxRegion ®ion ) { wxCHECK_RET( IsOk(), wxT("invalid window dc") ); diff --git a/src/gtk1/dcclient.cpp b/src/gtk1/dcclient.cpp index 7046368d6c..9fa41bf7f4 100644 --- a/src/gtk1/dcclient.cpp +++ b/src/gtk1/dcclient.cpp @@ -2021,7 +2021,7 @@ void wxWindowDCImpl::DoSetClippingRegion( wxCoord x, wxCoord y, wxCoord width, w gdk_gc_set_clip_region( m_bgGC, m_currentClippingRegion.GetRegion() ); } -void wxWindowDCImpl::DoSetClippingRegionAsRegion( const wxRegion ®ion ) +void wxWindowDCImpl::DoSetDeviceClippingRegion( const wxRegion ®ion ) { wxCHECK_RET( IsOk(), wxT("invalid window dc") ); diff --git a/src/mgl/dc.cpp b/src/mgl/dc.cpp index 06ab0b335d..81a69d8c58 100644 --- a/src/mgl/dc.cpp +++ b/src/mgl/dc.cpp @@ -220,7 +220,7 @@ void wxDC::DoSetClippingRegion(wxCoord cx, wxCoord cy, wxCoord cw, wxCoord ch) DO_SET_CLIPPING_BOX(m_currentClippingRegion) } -void wxDC::DoSetClippingRegionAsRegion(const wxRegion& region) +void wxDC::DoSetDeviceClippingRegion(const wxRegion& region) { wxCHECK_RET( Ok(), wxT("invalid dc") ); diff --git a/src/motif/dcclient.cpp b/src/motif/dcclient.cpp index 23e57a20b5..32f80903e4 100644 --- a/src/motif/dcclient.cpp +++ b/src/motif/dcclient.cpp @@ -2099,7 +2099,7 @@ void wxWindowDCImpl::DoSetClippingRegion( wxCoord x, wxCoord y, } } -void wxWindowDCImpl::DoSetClippingRegionAsRegion( const wxRegion& region ) +void wxWindowDCImpl::DoSetDeviceClippingRegion( const wxRegion& region ) { SetDCClipping(region.GetX11Region()); @@ -2110,10 +2110,10 @@ void wxWindowDCImpl::DoSetClippingRegionAsRegion( const wxRegion& region ) wxRect box = region.GetBox(); XRectangle rects[1]; - rects[0].x = (short)XLOG2DEV_2(box.x); - rects[0].y = (short)YLOG2DEV_2(box.y); - rects[0].width = (unsigned short)XLOG2DEVREL(box.width); - rects[0].height = (unsigned short)YLOG2DEVREL(box.height); + rects[0].x = (short)box.x; + rects[0].y = (short)box.y; + rects[0].width = (unsigned short)box.width; + rects[0].height = (unsigned short)box.height; XSetClipRectangles((Display*) m_display, (GC) m_gcBacking, 0, 0, rects, 1, Unsorted); } diff --git a/src/msw/dc.cpp b/src/msw/dc.cpp index 7e4772573d..5a8608840b 100644 --- a/src/msw/dc.cpp +++ b/src/msw/dc.cpp @@ -525,7 +525,7 @@ wxMSWDCImpl::DoGetClippingBox(wxCoord *x, wxCoord *y, wxCoord *w, wxCoord *h) co wxDCImpl::DoGetClippingBox(x, y, w, h); } -// common part of DoSetClippingRegion() and DoSetClippingRegionAsRegion() +// common part of DoSetClippingRegion() and DoSetDeviceClippingRegion() void wxMSWDCImpl::SetClippingHrgn(WXHRGN hrgn) { wxCHECK_RET( hrgn, wxT("invalid clipping region") ); @@ -593,7 +593,7 @@ void wxMSWDCImpl::DoSetClippingRegion(wxCoord x, wxCoord y, wxCoord w, wxCoord h } } -void wxMSWDCImpl::DoSetClippingRegionAsRegion(const wxRegion& region) +void wxMSWDCImpl::DoSetDeviceClippingRegion(const wxRegion& region) { SetClippingHrgn(region.GetHRGN()); } diff --git a/src/os2/dc.cpp b/src/os2/dc.cpp index c8fec9f68f..47e40bc3bb 100644 --- a/src/os2/dc.cpp +++ b/src/os2/dc.cpp @@ -444,7 +444,7 @@ void wxPMDCImpl::DoSetClippingRegion( DO_SET_CLIPPING_BOX() } // end of wxPMDCImpl::DoSetClippingRegion -void wxPMDCImpl::DoSetClippingRegionAsRegion( +void wxPMDCImpl::DoSetDeviceClippingRegion( const wxRegion& rRegion ) { @@ -457,7 +457,7 @@ void wxPMDCImpl::DoSetClippingRegionAsRegion( ,&hRgnOld ); DO_SET_CLIPPING_BOX() -} // end of wxPMDCImpl::DoSetClippingRegionAsRegion +} // end of wxPMDCImpl::DoSetDeviceClippingRegion void wxPMDCImpl::DestroyClippingRegion(void) { diff --git a/src/palmos/dc.cpp b/src/palmos/dc.cpp index 25dc258b30..07239ebaa5 100644 --- a/src/palmos/dc.cpp +++ b/src/palmos/dc.cpp @@ -197,17 +197,11 @@ wxPalmDCImpl::DoGetClippingBox(wxCoord *x, wxCoord *y, wxCoord *w, wxCoord *h) c { } -// common part of DoSetClippingRegion() and DoSetClippingRegionAsRegion() -void wxPalmDCImpl::SetClippingHrgn(WXHRGN hrgn) -{ - wxCHECK_RET( hrgn, wxT("invalid clipping region") ); -} - void wxPalmDCImpl::DoSetClippingRegion(wxCoord x, wxCoord y, wxCoord w, wxCoord h) { } -void wxPalmDCImpl::DoSetClippingRegionAsRegion(const wxRegion& region) +void wxPalmDCImpl::DoSetDeviceClippingRegion(const wxRegion& region) { } diff --git a/src/x11/dcclient.cpp b/src/x11/dcclient.cpp index c127517202..51eed057bc 100644 --- a/src/x11/dcclient.cpp +++ b/src/x11/dcclient.cpp @@ -2222,7 +2222,7 @@ void wxWindowDCImpl::DoSetClippingRegion( wxCoord x, wxCoord y, wxCoord width, w XSetRegion( (Display*) m_display, (GC) m_bgGC, (Region) m_currentClippingRegion.GetX11Region() ); } -void wxWindowDCImpl::DoSetClippingRegionAsRegion( const wxRegion& region ) +void wxWindowDCImpl::DoSetDeviceClippingRegion( const wxRegion& region ) { wxCHECK_RET( IsOk(), wxT("invalid window dc") ); -- 2.45.2