From b1263dcfa3fb318e9a48bdbdfe548eb474ae5fde Mon Sep 17 00:00:00 2001 From: =?utf8?q?W=C5=82odzimierz=20Skiba?= Date: Thu, 16 Dec 2004 21:24:45 +0000 Subject: [PATCH] Make ComputeScaleAndOrigin() as virtual part of wxDCBase and this way present on missing platforms. Add into manaul too. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@31034 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- contrib/include/wx/svg/dcsvg.h | 30 ++++++++++++------------ docs/latex/wx/dc.tex | 9 ++++++++ include/wx/cocoa/dc.h | 16 ++++++------- include/wx/dc.h | 2 ++ include/wx/dcsvg.h | 30 ++++++++++++------------ include/wx/gtk/dc.h | 2 +- include/wx/gtk/dcclient.h | 12 +++++----- include/wx/gtk1/dc.h | 2 +- include/wx/gtk1/dcclient.h | 12 +++++----- include/wx/mac/carbon/dc.h | 10 ++++---- include/wx/mac/classic/dc.h | 10 ++++---- include/wx/mgl/dc.h | 6 ++--- include/wx/motif/dc.h | 4 ++-- include/wx/x11/dc.h | 2 +- include/wx/x11/dcclient.h | 42 +++++++++++++++++----------------- src/generic/dcpsg.cpp | 3 --- 16 files changed, 100 insertions(+), 92 deletions(-) diff --git a/contrib/include/wx/svg/dcsvg.h b/contrib/include/wx/svg/dcsvg.h index 0cae7be4a8..e6e19364da 100644 --- a/contrib/include/wx/svg/dcsvg.h +++ b/contrib/include/wx/svg/dcsvg.h @@ -57,13 +57,13 @@ class WXDLLIMPEXP_SVG wxSVGFileDC : public wxDC bool DoGetPixel(wxCoord, wxCoord, class wxColour *) const - { wxASSERT_MSG (FALSE, wxT("wxSVGFILEDC::DoGetPixel Call not implemented")); return true; }; + { wxASSERT_MSG (false, wxT("wxSVGFILEDC::DoGetPixel Call not implemented")); return true; }; virtual bool DoBlit(wxCoord, wxCoord, wxCoord, wxCoord, class wxDC *, wxCoord, wxCoord, int = wxCOPY, bool = 0, int = -1, int = -1) ; void DoCrossHair(wxCoord, wxCoord) - { wxASSERT_MSG (FALSE, wxT("wxSVGFILEDC::CrossHair Call not implemented")); return ; }; + { wxASSERT_MSG (false, wxT("wxSVGFILEDC::CrossHair Call not implemented")); return ; }; void DoDrawArc(wxCoord, wxCoord, wxCoord, wxCoord, wxCoord, wxCoord); @@ -93,14 +93,14 @@ class WXDLLIMPEXP_SVG wxSVGFileDC : public wxDC bool DoFloodFill(wxCoord WXUNUSED(x), wxCoord WXUNUSED(y), const wxColour& WXUNUSED(col), int WXUNUSED(style) = wxFLOOD_SURFACE) - { wxASSERT_MSG (FALSE, wxT("wxSVGFILEDC::DoFloodFill Call not implemented")); return FALSE ; }; + { wxASSERT_MSG (false, wxT("wxSVGFILEDC::DoFloodFill Call not implemented")); return false ; }; void DoGetSize(int * x, int *y) const { *x = m_width; *y = m_height ; return ; } ; void DoGetTextExtent(const wxString& string, wxCoord *w, wxCoord *h, wxCoord *descent = NULL, wxCoord *externalLeading = NULL, wxFont *font = NULL) const ; void DoSetClippingRegionAsRegion(const class wxRegion &) - { wxASSERT_MSG (FALSE, wxT("wxSVGFILEDC::DoSetClippingRegionAsRegion Call not yet implemented")); return ; }; + { wxASSERT_MSG (false, wxT("wxSVGFILEDC::DoSetClippingRegionAsRegion Call not yet implemented")); return ; }; void Init (wxString f, int Width, int Height, float dpi); @@ -206,23 +206,23 @@ class WXDLLIMPEXP_SVG wxSVGFileDC : public wxDC bool CanGetTextExtent() const { return true; }; int GetDepth() const - { wxASSERT_MSG (FALSE, wxT("wxSVGFILEDC::GetDepth Call not implemented")); return -1 ; }; + { wxASSERT_MSG (false, wxT("wxSVGFILEDC::GetDepth Call not implemented")); return -1 ; }; void BeginDrawing() { return;}; - bool Blit(wxCoord xdest, wxCoord ydest, wxCoord width, wxCoord height, wxDC* source, wxCoord xsrc, wxCoord ysrc, int logicalFunc = wxCOPY, bool useMask = FALSE) + bool Blit(wxCoord xdest, wxCoord ydest, wxCoord width, wxCoord height, wxDC* source, wxCoord xsrc, wxCoord ysrc, int logicalFunc = wxCOPY, bool useMask = false) { return DoBlit(xdest, ydest, width, height, source, xsrc, ysrc, logicalFunc, useMask); }; void Clear() - { wxASSERT_MSG (FALSE, wxT("wxSVGFILEDC::Clear() Call not implemented \nNot sensible for an output file?")); return ; }; + { wxASSERT_MSG (false, wxT("wxSVGFILEDC::Clear() Call not implemented \nNot sensible for an output file?")); return ; }; void CrossHair(wxCoord x, wxCoord y) { DoCrossHair (x,y); return; }; - void ComputeScaleAndOrigin() ; + virtual void ComputeScaleAndOrigin(); void DestroyClippingRegion() - { wxASSERT_MSG (FALSE, wxT("wxSVGFILEDC::void Call not yet implemented")); return ; }; + { wxASSERT_MSG (false, wxT("wxSVGFILEDC::void Call not yet implemented")); return ; }; wxCoord DeviceToLogicalX(wxCoord x) const ; @@ -257,10 +257,10 @@ class WXDLLIMPEXP_SVG wxSVGFileDC : public wxDC wxCoord GetCharWidth() const; void GetClippingBox(wxCoord *WXUNUSED(x), wxCoord *WXUNUSED(y), wxCoord * WXUNUSED(width), wxCoord * WXUNUSED(height)) - { wxASSERT_MSG (FALSE, wxT("wxSVGFILEDC::GetClippingBox Call not yet implemented")); return ; }; + { wxASSERT_MSG (false, wxT("wxSVGFILEDC::GetClippingBox Call not yet implemented")); return ; }; int GetLogicalFunction() - { wxASSERT_MSG (FALSE, wxT("wxSVGFILEDC::GetLogicalFunction() Call not implemented")); return wxCOPY ; }; + { wxASSERT_MSG (false, wxT("wxSVGFILEDC::GetLogicalFunction() Call not implemented")); return wxCOPY ; }; int GetMapMode() ; @@ -282,10 +282,10 @@ class WXDLLIMPEXP_SVG wxSVGFileDC : public wxDC void SetAxisOrientation( bool xLeftRight, bool yBottomUp ) ; void SetClippingRegion(wxCoord WXUNUSED(x), wxCoord WXUNUSED(y), wxCoord WXUNUSED(width), wxCoord WXUNUSED(height)) - { wxASSERT_MSG (FALSE, wxT("wxSVGFILEDC::SetClippingRegion Call not yet implemented")); return ; }; + { wxASSERT_MSG (false, wxT("wxSVGFILEDC::SetClippingRegion Call not yet implemented")); return ; }; void SetPalette(const wxPalette& WXUNUSED(palette)) - { wxASSERT_MSG (FALSE, wxT("wxSVGFILEDC::SetPalette Call not yet implemented")); return ; }; + { wxASSERT_MSG (false, wxT("wxSVGFILEDC::SetPalette Call not yet implemented")); return ; }; void SetBackground( const wxBrush &brush ) ; @@ -296,7 +296,7 @@ class WXDLLIMPEXP_SVG wxSVGFileDC : public wxDC void SetFont(const wxFont& font) ; void SetLogicalFunction(int WXUNUSED(function)) - { wxASSERT_MSG (FALSE, wxT("wxSVGFILEDC::SetLogicalFunction Call implemented")); return ; }; + { wxASSERT_MSG (false, wxT("wxSVGFILEDC::SetLogicalFunction Call implemented")); return ; }; void SetLogicalScale( double x, double y ) ; @@ -311,7 +311,7 @@ class WXDLLIMPEXP_SVG wxSVGFileDC : public wxDC void SetUserScale(double xScale, double yScale) ; bool StartDoc(const wxString& WXUNUSED(message)) - { return FALSE; }; + { return false; }; void StartPage() { return ; }; diff --git a/docs/latex/wx/dc.tex b/docs/latex/wx/dc.tex index 461c52f0c5..febf46d150 100644 --- a/docs/latex/wx/dc.tex +++ b/docs/latex/wx/dc.tex @@ -193,6 +193,15 @@ wxUSE\_DC\_CACHEING preprocessor symbol for portability. \end{comment} +\membersection{wxDC::ComputeScaleAndOrigin}\label{wxdccomputescaleandorigin} + +\func{virtual void}{ComputeScaleAndOrigin}{\void} + +Performs all necessary computations for given platform and context type +after each change of scale and origin parameters. Usually called automatically +internally after such changes. + + \membersection{wxDC::CrossHair}\label{wxdccrosshair} \func{void}{CrossHair}{\param{wxCoord}{ x}, \param{wxCoord}{ y}} diff --git a/include/wx/cocoa/dc.h b/include/wx/cocoa/dc.h index 2eb8eb5429..ccf45da798 100644 --- a/include/wx/cocoa/dc.h +++ b/include/wx/cocoa/dc.h @@ -6,7 +6,7 @@ // Created: 2003/04/01 // RCS-ID: $Id$ // Copyright: (c) 2003 David Elliott -// Licence: wxWindows licence +// Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef __WX_COCOA_DC_H__ @@ -28,7 +28,7 @@ class WXDLLEXPORT wxDC: public wxDCBase public: wxDC(); ~wxDC(); - + //------------------------------------------------------------------------- // wxCocoa specifics //------------------------------------------------------------------------- @@ -69,9 +69,9 @@ public: virtual void Clear(); - virtual bool StartDoc( const wxString& WXUNUSED(message) ) { return TRUE; } + virtual bool StartDoc( const wxString& WXUNUSED(message) ) { return true; } virtual void EndDoc(void) {}; - + virtual void StartPage(void) {}; virtual void EndPage(void) {}; @@ -109,7 +109,7 @@ public: virtual void SetTextForeground(const wxColour& colour) ; virtual void SetTextBackground(const wxColour& colour) ; - void ComputeScaleAndOrigin(void); + virtual void ComputeScaleAndOrigin(); protected: virtual bool DoFloodFill(wxCoord x, wxCoord y, const wxColour& col, int style = wxFLOOD_SURFACE); @@ -122,7 +122,7 @@ protected: virtual void DoDrawArc(wxCoord x1, wxCoord y1, wxCoord x2, wxCoord y2, wxCoord xc, wxCoord yc); - + virtual void DoDrawEllipticArc(wxCoord x, wxCoord y, wxCoord w, wxCoord h, double sa, double ea); @@ -136,7 +136,7 @@ protected: virtual void DoDrawIcon(const wxIcon& icon, wxCoord x, wxCoord y); virtual void DoDrawBitmap(const wxBitmap &bmp, wxCoord x, wxCoord y, - bool useMask = FALSE); + bool useMask = false); virtual void DoDrawText(const wxString& text, wxCoord x, wxCoord y); virtual void DoDrawRotatedText(const wxString& text, wxCoord x, wxCoord y, @@ -144,7 +144,7 @@ protected: virtual bool DoBlit(wxCoord xdest, wxCoord ydest, wxCoord width, wxCoord height, wxDC *source, wxCoord xsrc, wxCoord ysrc, - int rop = wxCOPY, bool useMask = FALSE, wxCoord xsrcMask = -1, wxCoord ysrcMask = -1); + 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 diff --git a/include/wx/dc.h b/include/wx/dc.h index 9ace93ce83..3b5336c86d 100644 --- a/include/wx/dc.h +++ b/include/wx/dc.h @@ -530,6 +530,8 @@ public: { wxCoord x, y; DoGetDeviceOrigin(&x, &y); return wxPoint(x, y); } virtual void SetDeviceOrigin(wxCoord x, wxCoord y) = 0; + virtual void ComputeScaleAndOrigin() {} + virtual void SetAxisOrientation(bool xLeftRight, bool yBottomUp) = 0; int GetLogicalFunction() const { return m_logicalFunction; } diff --git a/include/wx/dcsvg.h b/include/wx/dcsvg.h index 0cae7be4a8..e6e19364da 100644 --- a/include/wx/dcsvg.h +++ b/include/wx/dcsvg.h @@ -57,13 +57,13 @@ class WXDLLIMPEXP_SVG wxSVGFileDC : public wxDC bool DoGetPixel(wxCoord, wxCoord, class wxColour *) const - { wxASSERT_MSG (FALSE, wxT("wxSVGFILEDC::DoGetPixel Call not implemented")); return true; }; + { wxASSERT_MSG (false, wxT("wxSVGFILEDC::DoGetPixel Call not implemented")); return true; }; virtual bool DoBlit(wxCoord, wxCoord, wxCoord, wxCoord, class wxDC *, wxCoord, wxCoord, int = wxCOPY, bool = 0, int = -1, int = -1) ; void DoCrossHair(wxCoord, wxCoord) - { wxASSERT_MSG (FALSE, wxT("wxSVGFILEDC::CrossHair Call not implemented")); return ; }; + { wxASSERT_MSG (false, wxT("wxSVGFILEDC::CrossHair Call not implemented")); return ; }; void DoDrawArc(wxCoord, wxCoord, wxCoord, wxCoord, wxCoord, wxCoord); @@ -93,14 +93,14 @@ class WXDLLIMPEXP_SVG wxSVGFileDC : public wxDC bool DoFloodFill(wxCoord WXUNUSED(x), wxCoord WXUNUSED(y), const wxColour& WXUNUSED(col), int WXUNUSED(style) = wxFLOOD_SURFACE) - { wxASSERT_MSG (FALSE, wxT("wxSVGFILEDC::DoFloodFill Call not implemented")); return FALSE ; }; + { wxASSERT_MSG (false, wxT("wxSVGFILEDC::DoFloodFill Call not implemented")); return false ; }; void DoGetSize(int * x, int *y) const { *x = m_width; *y = m_height ; return ; } ; void DoGetTextExtent(const wxString& string, wxCoord *w, wxCoord *h, wxCoord *descent = NULL, wxCoord *externalLeading = NULL, wxFont *font = NULL) const ; void DoSetClippingRegionAsRegion(const class wxRegion &) - { wxASSERT_MSG (FALSE, wxT("wxSVGFILEDC::DoSetClippingRegionAsRegion Call not yet implemented")); return ; }; + { wxASSERT_MSG (false, wxT("wxSVGFILEDC::DoSetClippingRegionAsRegion Call not yet implemented")); return ; }; void Init (wxString f, int Width, int Height, float dpi); @@ -206,23 +206,23 @@ class WXDLLIMPEXP_SVG wxSVGFileDC : public wxDC bool CanGetTextExtent() const { return true; }; int GetDepth() const - { wxASSERT_MSG (FALSE, wxT("wxSVGFILEDC::GetDepth Call not implemented")); return -1 ; }; + { wxASSERT_MSG (false, wxT("wxSVGFILEDC::GetDepth Call not implemented")); return -1 ; }; void BeginDrawing() { return;}; - bool Blit(wxCoord xdest, wxCoord ydest, wxCoord width, wxCoord height, wxDC* source, wxCoord xsrc, wxCoord ysrc, int logicalFunc = wxCOPY, bool useMask = FALSE) + bool Blit(wxCoord xdest, wxCoord ydest, wxCoord width, wxCoord height, wxDC* source, wxCoord xsrc, wxCoord ysrc, int logicalFunc = wxCOPY, bool useMask = false) { return DoBlit(xdest, ydest, width, height, source, xsrc, ysrc, logicalFunc, useMask); }; void Clear() - { wxASSERT_MSG (FALSE, wxT("wxSVGFILEDC::Clear() Call not implemented \nNot sensible for an output file?")); return ; }; + { wxASSERT_MSG (false, wxT("wxSVGFILEDC::Clear() Call not implemented \nNot sensible for an output file?")); return ; }; void CrossHair(wxCoord x, wxCoord y) { DoCrossHair (x,y); return; }; - void ComputeScaleAndOrigin() ; + virtual void ComputeScaleAndOrigin(); void DestroyClippingRegion() - { wxASSERT_MSG (FALSE, wxT("wxSVGFILEDC::void Call not yet implemented")); return ; }; + { wxASSERT_MSG (false, wxT("wxSVGFILEDC::void Call not yet implemented")); return ; }; wxCoord DeviceToLogicalX(wxCoord x) const ; @@ -257,10 +257,10 @@ class WXDLLIMPEXP_SVG wxSVGFileDC : public wxDC wxCoord GetCharWidth() const; void GetClippingBox(wxCoord *WXUNUSED(x), wxCoord *WXUNUSED(y), wxCoord * WXUNUSED(width), wxCoord * WXUNUSED(height)) - { wxASSERT_MSG (FALSE, wxT("wxSVGFILEDC::GetClippingBox Call not yet implemented")); return ; }; + { wxASSERT_MSG (false, wxT("wxSVGFILEDC::GetClippingBox Call not yet implemented")); return ; }; int GetLogicalFunction() - { wxASSERT_MSG (FALSE, wxT("wxSVGFILEDC::GetLogicalFunction() Call not implemented")); return wxCOPY ; }; + { wxASSERT_MSG (false, wxT("wxSVGFILEDC::GetLogicalFunction() Call not implemented")); return wxCOPY ; }; int GetMapMode() ; @@ -282,10 +282,10 @@ class WXDLLIMPEXP_SVG wxSVGFileDC : public wxDC void SetAxisOrientation( bool xLeftRight, bool yBottomUp ) ; void SetClippingRegion(wxCoord WXUNUSED(x), wxCoord WXUNUSED(y), wxCoord WXUNUSED(width), wxCoord WXUNUSED(height)) - { wxASSERT_MSG (FALSE, wxT("wxSVGFILEDC::SetClippingRegion Call not yet implemented")); return ; }; + { wxASSERT_MSG (false, wxT("wxSVGFILEDC::SetClippingRegion Call not yet implemented")); return ; }; void SetPalette(const wxPalette& WXUNUSED(palette)) - { wxASSERT_MSG (FALSE, wxT("wxSVGFILEDC::SetPalette Call not yet implemented")); return ; }; + { wxASSERT_MSG (false, wxT("wxSVGFILEDC::SetPalette Call not yet implemented")); return ; }; void SetBackground( const wxBrush &brush ) ; @@ -296,7 +296,7 @@ class WXDLLIMPEXP_SVG wxSVGFileDC : public wxDC void SetFont(const wxFont& font) ; void SetLogicalFunction(int WXUNUSED(function)) - { wxASSERT_MSG (FALSE, wxT("wxSVGFILEDC::SetLogicalFunction Call implemented")); return ; }; + { wxASSERT_MSG (false, wxT("wxSVGFILEDC::SetLogicalFunction Call implemented")); return ; }; void SetLogicalScale( double x, double y ) ; @@ -311,7 +311,7 @@ class WXDLLIMPEXP_SVG wxSVGFileDC : public wxDC void SetUserScale(double xScale, double yScale) ; bool StartDoc(const wxString& WXUNUSED(message)) - { return FALSE; }; + { return false; }; void StartPage() { return ; }; diff --git a/include/wx/gtk/dc.h b/include/wx/gtk/dc.h index 84c79d7353..6022c4d728 100644 --- a/include/wx/gtk/dc.h +++ b/include/wx/gtk/dc.h @@ -51,7 +51,7 @@ public: // Resolution in pixels per logical inch virtual wxSize GetPPI() const; - virtual bool StartDoc( const wxString& WXUNUSED(message) ) { return TRUE; } + virtual bool StartDoc( const wxString& WXUNUSED(message) ) { return true; } virtual void EndDoc() { } virtual void StartPage() { } virtual void EndPage() { } diff --git a/include/wx/gtk/dcclient.h b/include/wx/gtk/dcclient.h index fc7e52885e..ad9d68325b 100644 --- a/include/wx/gtk/dcclient.h +++ b/include/wx/gtk/dcclient.h @@ -37,8 +37,8 @@ public: virtual ~wxWindowDC(); - virtual bool CanDrawBitmap() const { return TRUE; } - virtual bool CanGetTextExtent() const { return TRUE; } + virtual bool CanDrawBitmap() const { return true; } + virtual bool CanGetTextExtent() const { return true; } protected: virtual void DoGetSize(int *width, int *height) const; @@ -65,11 +65,11 @@ protected: virtual void DoDrawIcon( const wxIcon &icon, wxCoord x, wxCoord y ); virtual void DoDrawBitmap( const wxBitmap &bitmap, wxCoord x, wxCoord y, - bool useMask = FALSE ); + bool useMask = false ); virtual bool DoBlit( wxCoord xdest, wxCoord ydest, wxCoord width, wxCoord height, wxDC *source, wxCoord xsrc, wxCoord ysrc, - int logical_func = wxCOPY, bool useMask = FALSE, wxCoord xsrcMask = -1, wxCoord ysrcMask = -1 ); + int logical_func = wxCOPY, bool useMask = false, wxCoord xsrcMask = -1, wxCoord ysrcMask = -1 ); virtual void DoDrawText( const wxString &text, wxCoord x, wxCoord y ); virtual void DoDrawRotatedText(const wxString& text, wxCoord x, wxCoord y, @@ -118,7 +118,7 @@ public: wxWindow *m_owner; wxRegion m_currentClippingRegion; wxRegion m_paintClippingRegion; - + // PangoContext stuff for GTK 2.0 #ifdef __WXGTK20__ PangoContext *m_context; @@ -128,7 +128,7 @@ public: void SetUpDC(); void Destroy(); - void ComputeScaleAndOrigin(); + virtual void ComputeScaleAndOrigin(); GdkWindow *GetWindow() { return m_window; } diff --git a/include/wx/gtk1/dc.h b/include/wx/gtk1/dc.h index 84c79d7353..6022c4d728 100644 --- a/include/wx/gtk1/dc.h +++ b/include/wx/gtk1/dc.h @@ -51,7 +51,7 @@ public: // Resolution in pixels per logical inch virtual wxSize GetPPI() const; - virtual bool StartDoc( const wxString& WXUNUSED(message) ) { return TRUE; } + virtual bool StartDoc( const wxString& WXUNUSED(message) ) { return true; } virtual void EndDoc() { } virtual void StartPage() { } virtual void EndPage() { } diff --git a/include/wx/gtk1/dcclient.h b/include/wx/gtk1/dcclient.h index fc7e52885e..ad9d68325b 100644 --- a/include/wx/gtk1/dcclient.h +++ b/include/wx/gtk1/dcclient.h @@ -37,8 +37,8 @@ public: virtual ~wxWindowDC(); - virtual bool CanDrawBitmap() const { return TRUE; } - virtual bool CanGetTextExtent() const { return TRUE; } + virtual bool CanDrawBitmap() const { return true; } + virtual bool CanGetTextExtent() const { return true; } protected: virtual void DoGetSize(int *width, int *height) const; @@ -65,11 +65,11 @@ protected: virtual void DoDrawIcon( const wxIcon &icon, wxCoord x, wxCoord y ); virtual void DoDrawBitmap( const wxBitmap &bitmap, wxCoord x, wxCoord y, - bool useMask = FALSE ); + bool useMask = false ); virtual bool DoBlit( wxCoord xdest, wxCoord ydest, wxCoord width, wxCoord height, wxDC *source, wxCoord xsrc, wxCoord ysrc, - int logical_func = wxCOPY, bool useMask = FALSE, wxCoord xsrcMask = -1, wxCoord ysrcMask = -1 ); + int logical_func = wxCOPY, bool useMask = false, wxCoord xsrcMask = -1, wxCoord ysrcMask = -1 ); virtual void DoDrawText( const wxString &text, wxCoord x, wxCoord y ); virtual void DoDrawRotatedText(const wxString& text, wxCoord x, wxCoord y, @@ -118,7 +118,7 @@ public: wxWindow *m_owner; wxRegion m_currentClippingRegion; wxRegion m_paintClippingRegion; - + // PangoContext stuff for GTK 2.0 #ifdef __WXGTK20__ PangoContext *m_context; @@ -128,7 +128,7 @@ public: void SetUpDC(); void Destroy(); - void ComputeScaleAndOrigin(); + virtual void ComputeScaleAndOrigin(); GdkWindow *GetWindow() { return m_window; } diff --git a/include/wx/mac/carbon/dc.h b/include/wx/mac/carbon/dc.h index 4410680253..57ade632db 100644 --- a/include/wx/mac/carbon/dc.h +++ b/include/wx/mac/carbon/dc.h @@ -64,7 +64,7 @@ class WXDLLEXPORT wxDC: public wxDCBase virtual void Clear(); - virtual bool StartDoc( const wxString& WXUNUSED(message) ) { return TRUE; } + virtual bool StartDoc( const wxString& WXUNUSED(message) ) { return true; } virtual void EndDoc(void) {}; virtual void StartPage(void) {}; @@ -105,9 +105,9 @@ class WXDLLEXPORT wxDC: public wxDCBase virtual void SetTextForeground(const wxColour& colour) ; virtual void SetTextBackground(const wxColour& colour) ; - void ComputeScaleAndOrigin(void); - public: + virtual void ComputeScaleAndOrigin(); + public: wxCoord XDEV2LOG(wxCoord x) const { @@ -216,7 +216,7 @@ protected: virtual void DoDrawIcon(const wxIcon& icon, wxCoord x, wxCoord y); virtual void DoDrawBitmap(const wxBitmap &bmp, wxCoord x, wxCoord y, - bool useMask = FALSE); + bool useMask = false); virtual void DoDrawText(const wxString& text, wxCoord x, wxCoord y); virtual void DoDrawRotatedText(const wxString& text, wxCoord x, wxCoord y, @@ -224,7 +224,7 @@ protected: virtual bool DoBlit(wxCoord xdest, wxCoord ydest, wxCoord width, wxCoord height, wxDC *source, wxCoord xsrc, wxCoord ysrc, - int rop = wxCOPY, bool useMask = FALSE, wxCoord xsrcMask = -1, wxCoord ysrcMask = -1); + 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 diff --git a/include/wx/mac/classic/dc.h b/include/wx/mac/classic/dc.h index 4410680253..57ade632db 100644 --- a/include/wx/mac/classic/dc.h +++ b/include/wx/mac/classic/dc.h @@ -64,7 +64,7 @@ class WXDLLEXPORT wxDC: public wxDCBase virtual void Clear(); - virtual bool StartDoc( const wxString& WXUNUSED(message) ) { return TRUE; } + virtual bool StartDoc( const wxString& WXUNUSED(message) ) { return true; } virtual void EndDoc(void) {}; virtual void StartPage(void) {}; @@ -105,9 +105,9 @@ class WXDLLEXPORT wxDC: public wxDCBase virtual void SetTextForeground(const wxColour& colour) ; virtual void SetTextBackground(const wxColour& colour) ; - void ComputeScaleAndOrigin(void); - public: + virtual void ComputeScaleAndOrigin(); + public: wxCoord XDEV2LOG(wxCoord x) const { @@ -216,7 +216,7 @@ protected: virtual void DoDrawIcon(const wxIcon& icon, wxCoord x, wxCoord y); virtual void DoDrawBitmap(const wxBitmap &bmp, wxCoord x, wxCoord y, - bool useMask = FALSE); + bool useMask = false); virtual void DoDrawText(const wxString& text, wxCoord x, wxCoord y); virtual void DoDrawRotatedText(const wxString& text, wxCoord x, wxCoord y, @@ -224,7 +224,7 @@ protected: virtual bool DoBlit(wxCoord xdest, wxCoord ydest, wxCoord width, wxCoord height, wxDC *source, wxCoord xsrc, wxCoord ysrc, - int rop = wxCOPY, bool useMask = FALSE, wxCoord xsrcMask = -1, wxCoord ysrcMask = -1); + 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 diff --git a/include/wx/mgl/dc.h b/include/wx/mgl/dc.h index b182a2d952..1777302433 100644 --- a/include/wx/mgl/dc.h +++ b/include/wx/mgl/dc.h @@ -165,7 +165,7 @@ public: } MGLDevCtx *GetMGLDC() const { return m_MGLDC; } - void SetMGLDC(MGLDevCtx *mgldc, bool OwnsMGLDC = FALSE); + void SetMGLDC(MGLDevCtx *mgldc, bool OwnsMGLDC = false); protected: virtual bool DoFloodFill(wxCoord x, wxCoord y, const wxColour& col, @@ -192,7 +192,7 @@ protected: virtual void DoDrawIcon(const wxIcon& icon, wxCoord x, wxCoord y); virtual void DoDrawBitmap(const wxBitmap &bmp, wxCoord x, wxCoord y, - bool useMask = FALSE); + bool useMask = false); virtual void DoDrawText(const wxString& text, wxCoord x, wxCoord y); virtual void DoDrawRotatedText(const wxString& text, wxCoord x, wxCoord y, @@ -200,7 +200,7 @@ protected: virtual bool DoBlit(wxCoord xdest, wxCoord ydest, wxCoord width, wxCoord height, wxDC *source, wxCoord xsrc, wxCoord ysrc, - int rop = wxCOPY, bool useMask = FALSE, wxCoord xsrcMask = -1, wxCoord ysrcMask = -1); + 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 diff --git a/include/wx/motif/dc.h b/include/wx/motif/dc.h index f726723241..a7926f69f2 100644 --- a/include/wx/motif/dc.h +++ b/include/wx/motif/dc.h @@ -64,7 +64,7 @@ public: protected: virtual void DoDrawIcon(const wxIcon& icon, wxCoord x, wxCoord y); virtual void DoDrawBitmap(const wxBitmap &bmp, wxCoord x, wxCoord y, - bool useMask = FALSE); + bool useMask = false); virtual void DoSetClippingRegion(wxCoord x, wxCoord y, wxCoord width, wxCoord height); @@ -72,7 +72,7 @@ protected: virtual void DoGetSizeMM(int* width, int* height) const; public: - void ComputeScaleAndOrigin(); + virtual void ComputeScaleAndOrigin(); wxCoord XDEV2LOG(wxCoord x) const { diff --git a/include/wx/x11/dc.h b/include/wx/x11/dc.h index 04af891660..2637aed447 100644 --- a/include/wx/x11/dc.h +++ b/include/wx/x11/dc.h @@ -65,7 +65,7 @@ protected: virtual void DoGetSizeMM(int* width, int* height) const; public: - void ComputeScaleAndOrigin(); + virtual void ComputeScaleAndOrigin(); wxCoord XDEV2LOG(wxCoord x) const { diff --git a/include/wx/x11/dcclient.h b/include/wx/x11/dcclient.h index af67b3ddf2..3dd5f19b50 100644 --- a/include/wx/x11/dcclient.h +++ b/include/wx/x11/dcclient.h @@ -38,49 +38,49 @@ class wxWindowDC : public wxDC public: wxWindowDC(); wxWindowDC( wxWindow *win ); - + ~wxWindowDC(); - - virtual bool CanDrawBitmap() const { return TRUE; } - virtual bool CanGetTextExtent() const { return TRUE; } + + virtual bool CanDrawBitmap() const { return true; } + virtual bool CanGetTextExtent() const { return true; } protected: virtual void DoGetSize(int *width, int *height) const; virtual bool DoFloodFill( wxCoord x, wxCoord y, const wxColour& col, int style = wxFLOOD_SURFACE ); virtual bool DoGetPixel( wxCoord x, wxCoord y, wxColour *col ) const; - + virtual void DoDrawPoint(wxCoord x, wxCoord y); virtual void DoDrawLine(wxCoord x1, wxCoord y1, wxCoord x2, wxCoord y2); - + virtual void DoDrawIcon( const wxIcon &icon, wxCoord x, wxCoord y ); virtual void DoDrawBitmap( const wxBitmap &bitmap, wxCoord x, wxCoord y, - bool useMask = FALSE ); + bool useMask = false ); virtual void DoDrawArc(wxCoord x1, wxCoord y1, wxCoord x2, wxCoord y2, wxCoord xc, wxCoord yc); virtual void DoDrawEllipticArc(wxCoord x, wxCoord y, wxCoord w, wxCoord h, double sa, double ea); - + virtual void DoDrawRectangle(wxCoord x, wxCoord y, wxCoord width, wxCoord height); virtual void DoDrawRoundedRectangle(wxCoord x, wxCoord y, wxCoord width, wxCoord height, double radius); virtual void DoDrawEllipse(wxCoord x, wxCoord y, wxCoord width, wxCoord height); - + virtual void DoCrossHair(wxCoord x, wxCoord y); - + virtual void DoDrawText(const wxString& text, wxCoord x, wxCoord y); virtual void DoDrawRotatedText(const wxString &text, wxCoord x, wxCoord y, double angle); - + virtual bool DoBlit(wxCoord xdest, wxCoord ydest, wxCoord width, wxCoord height, wxDC *source, wxCoord xsrc, wxCoord ysrc, - int rop = wxCOPY, bool useMask = FALSE, wxCoord xsrcMask = -1, wxCoord ysrcMask = -1); - + 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 DoDrawLines(int n, wxPoint points[], wxCoord xoffset, wxCoord yoffset); virtual void DoDrawPolygon(int n, wxPoint points[], @@ -90,7 +90,7 @@ protected: public: virtual void Clear(); - + virtual void SetFont(const wxFont& font); virtual void SetPen(const wxPen& pen); virtual void SetBrush(const wxBrush& brush); @@ -98,10 +98,10 @@ public: virtual void SetBackgroundMode(int mode); virtual void SetPalette(const wxPalette& palette); virtual void SetLogicalFunction( int function ); - + virtual void SetTextForeground(const wxColour& colour); virtual void SetTextBackground(const wxColour& colour); - + virtual wxCoord GetCharHeight() const; virtual wxCoord GetCharWidth() const; virtual void DoGetTextExtent(const wxString& string, @@ -109,14 +109,14 @@ public: wxCoord *descent = NULL, wxCoord *externalLeading = NULL, wxFont *theFont = NULL) const; - + virtual int GetDepth() const; virtual wxSize GetPPI() const; - + virtual void DestroyClippingRegion(); WXWindow GetWindow() const { return m_window; } -protected: +protected: // implementation // -------------- @@ -140,7 +140,7 @@ protected: void SetUpDC(); void Destroy(); - void ComputeScaleAndOrigin(); + virtual void ComputeScaleAndOrigin(); private: DECLARE_DYNAMIC_CLASS(wxWindowDC) diff --git a/src/generic/dcpsg.cpp b/src/generic/dcpsg.cpp index aebcadbdb8..bcd73beb26 100644 --- a/src/generic/dcpsg.cpp +++ b/src/generic/dcpsg.cpp @@ -1473,10 +1473,7 @@ void wxPostScriptDC::SetAxisOrientation( bool xLeftRight, bool yBottomUp ) m_signX = (xLeftRight ? 1 : -1); m_signY = (yBottomUp ? 1 : -1); - // FIXME there is no such function in MSW nor in OS2/PM -#if !defined(__WXMSW__) && !defined(__WXPM__) ComputeScaleAndOrigin(); -#endif } void wxPostScriptDC::SetDeviceOrigin( wxCoord x, wxCoord y ) -- 2.45.2