From 89efaf2b6595e59af618556d7e79492cab50c73c Mon Sep 17 00:00:00 2001 From: Francesco Montorsi Date: Thu, 8 Jan 2009 14:21:53 +0000 Subject: [PATCH] change generic ints to enums in wxDC (closes #9959) git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@57907 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/cocoa/dc.h | 10 +-- include/wx/cocoa/dcmemory.h | 2 +- include/wx/dc.h | 135 +++++++++++++++++++++++++++------- include/wx/dcgraph.h | 21 +++--- include/wx/dcmirror.h | 11 +-- include/wx/dcsvg.h | 14 ++-- include/wx/defs.h | 50 ------------- include/wx/dfb/dc.h | 9 ++- include/wx/gdicmn.h | 7 ++ include/wx/generic/dcpsg.h | 16 ++-- include/wx/graphics.h | 6 +- include/wx/gtk/dcclient.h | 14 ++-- include/wx/gtk/gnome/gprint.h | 12 +-- include/wx/gtk/print.h | 12 +-- include/wx/gtk/region.h | 3 +- include/wx/gtk1/dcclient.h | 9 ++- include/wx/mgl/dc.h | 11 +-- include/wx/motif/dcclient.h | 8 +- include/wx/msw/dc.h | 15 ++-- include/wx/msw/dcprint.h | 3 +- include/wx/msw/metafile.h | 6 +- include/wx/os2/dc.h | 14 ++-- include/wx/os2/dcprint.h | 2 +- include/wx/os2/metafile.h | 2 +- include/wx/palmos/dc.h | 15 ++-- include/wx/palmos/dcprint.h | 3 +- include/wx/palmos/metafile.h | 2 +- include/wx/x11/dcclient.h | 10 ++- interface/wx/dc.h | 25 ++++--- interface/wx/dcsvg.h | 16 ++-- samples/drawing/drawing.cpp | 4 +- src/cocoa/dc.mm | 10 +-- src/common/dcbase.cpp | 8 +- src/common/dcgraph.cpp | 18 +++-- src/common/dcsvg.cpp | 6 +- src/common/graphcmn.cpp | 2 +- src/common/imagfill.cpp | 2 +- src/dfb/dc.cpp | 10 +-- src/generic/dcpsg.cpp | 11 +-- src/generic/graphicc.cpp | 6 +- src/gtk/dcclient.cpp | 49 ++++++------ src/gtk/gnome/gprint.cpp | 10 +-- src/gtk/print.cpp | 14 ++-- src/gtk/region.cpp | 3 +- src/gtk1/dcclient.cpp | 10 +-- src/mgl/dc.cpp | 10 +-- src/motif/dcclient.cpp | 10 +-- src/msw/dc.cpp | 18 ++--- src/msw/dcprint.cpp | 2 +- src/msw/metafile.cpp | 2 +- src/msw/microwin.c | 8 +- src/os2/dc.cpp | 14 ++-- src/os2/dcprint.cpp | 2 +- src/os2/metafile.cpp | 2 +- src/osx/carbon/graphics.cpp | 2 +- src/palmos/dc.cpp | 14 ++-- src/palmos/dcprint.cpp | 2 +- src/palmos/metafile.cpp | 2 +- src/x11/dcclient.cpp | 13 ++-- 59 files changed, 401 insertions(+), 326 deletions(-) diff --git a/include/wx/cocoa/dc.h b/include/wx/cocoa/dc.h index 8e990e080e..4cbe3df7be 100644 --- a/include/wx/cocoa/dc.h +++ b/include/wx/cocoa/dc.h @@ -69,7 +69,7 @@ protected: // Blitting virtual bool CocoaDoBlitOnFocusedDC(wxCoord xdest, wxCoord ydest, wxCoord width, wxCoord height, wxCoord xsrc, wxCoord ysrc, - int logicalFunc, bool useMask, wxCoord xsrcMask, wxCoord ysrcMask); + wxRasterOperationMode logicalFunc, bool useMask, wxCoord xsrcMask, wxCoord ysrcMask); //------------------------------------------------------------------------- // Implementation //------------------------------------------------------------------------- @@ -107,14 +107,14 @@ public: virtual int GetDepth() const; virtual wxSize GetPPI() const; - virtual void SetMapMode(int mode); + virtual void SetMapMode(wxMappingMode mode); virtual void SetUserScale(double x, double y); virtual void SetLogicalScale(double x, double y); virtual void SetLogicalOrigin(wxCoord x, wxCoord y); virtual void SetDeviceOrigin(wxCoord x, wxCoord y); virtual void SetAxisOrientation(bool xLeftRight, bool yBottomUp); - virtual void SetLogicalFunction(int function); + virtual void SetLogicalFunction(wxRasterOperationMode function); virtual void SetTextForeground(const wxColour& colour) ; virtual void SetTextBackground(const wxColour& colour) ; @@ -122,7 +122,7 @@ public: virtual void ComputeScaleAndOrigin(); protected: virtual bool DoFloodFill(wxCoord x, wxCoord y, const wxColour& col, - int style = wxFLOOD_SURFACE); + wxFloodFillStyle style = wxFLOOD_SURFACE); virtual bool DoGetPixel(wxCoord x, wxCoord y, wxColour *col) const; @@ -169,7 +169,7 @@ protected: wxCoord xoffset, wxCoord yoffset); virtual void DoDrawPolygon(int n, wxPoint points[], wxCoord xoffset, wxCoord yoffset, - int fillStyle = wxODDEVEN_RULE); + wxPolygonFillMode fillStyle = wxODDEVEN_RULE); }; #endif // __WX_COCOA_DC_H__ diff --git a/include/wx/cocoa/dcmemory.h b/include/wx/cocoa/dcmemory.h index bb5dc4d916..577eee0480 100644 --- a/include/wx/cocoa/dcmemory.h +++ b/include/wx/cocoa/dcmemory.h @@ -45,7 +45,7 @@ protected: // Blitting virtual bool CocoaDoBlitOnFocusedDC(wxCoord xdest, wxCoord ydest, wxCoord width, wxCoord height, wxCoord xsrc, wxCoord ysrc, - int logicalFunc, bool useMask, wxCoord xsrcMask, wxCoord ysrcMask); + wxRasterOperationMode logicalFunc, bool useMask, wxCoord xsrcMask, wxCoord ysrcMask); private: void Init(); diff --git a/include/wx/dc.h b/include/wx/dc.h index ab19b30997..2357fb12e5 100644 --- a/include/wx/dc.h +++ b/include/wx/dc.h @@ -42,6 +42,83 @@ class WXDLLIMPEXP_FWD_CORE wxMemoryDC; class WXDLLIMPEXP_FWD_CORE wxPrinterDC; class WXDLLIMPEXP_FWD_CORE wxPrintData; +// Logical ops +enum wxRasterOperationMode +{ + wxCLEAR, // 0 + wxXOR, // src XOR dst + wxINVERT, // NOT dst + wxOR_REVERSE, // src OR (NOT dst) + wxAND_REVERSE, // src AND (NOT dst) + wxCOPY, // src + wxAND, // src AND dst + wxAND_INVERT, // (NOT src) AND dst + wxNO_OP, // dst + wxNOR, // (NOT src) AND (NOT dst) + wxEQUIV, // (NOT src) XOR dst + wxSRC_INVERT, // (NOT src) + wxOR_INVERT, // (NOT src) OR dst + wxNAND, // (NOT src) OR (NOT dst) + wxOR, // src OR dst + wxSET // 1 +#ifdef WXWIN_COMPATIBILITY_2_8 + ,wxROP_BLACK = wxCLEAR, + wxBLIT_BLACKNESS = wxCLEAR, + wxROP_XORPEN = wxXOR, + wxBLIT_SRCINVERT = wxXOR, + wxROP_NOT = wxINVERT, + wxBLIT_DSTINVERT = wxINVERT, + wxROP_MERGEPENNOT = wxOR_REVERSE, + wxBLIT_00DD0228 = wxOR_REVERSE, + wxROP_MASKPENNOT = wxAND_REVERSE, + wxBLIT_SRCERASE = wxAND_REVERSE, + wxROP_COPYPEN = wxCOPY, + wxBLIT_SRCCOPY = wxCOPY, + wxROP_MASKPEN = wxAND, + wxBLIT_SRCAND = wxAND, + wxROP_MASKNOTPEN = wxAND_INVERT, + wxBLIT_00220326 = wxAND_INVERT, + wxROP_NOP = wxNO_OP, + wxBLIT_00AA0029 = wxNO_OP, + wxROP_NOTMERGEPEN = wxNOR, + wxBLIT_NOTSRCERASE = wxNOR, + wxROP_NOTXORPEN = wxEQUIV, + wxBLIT_00990066 = wxEQUIV, + wxROP_NOTCOPYPEN = wxSRC_INVERT, + wxBLIT_NOTSCRCOPY = wxSRC_INVERT, + wxROP_MERGENOTPEN = wxOR_INVERT, + wxBLIT_MERGEPAINT = wxOR_INVERT, + wxROP_NOTMASKPEN = wxNAND, + wxBLIT_007700E6 = wxNAND, + wxROP_MERGEPEN = wxOR, + wxBLIT_SRCPAINT = wxOR, + wxROP_WHITE = wxSET, + wxBLIT_WHITENESS = wxSET +#endif //WXWIN_COMPATIBILITY_2_8 +}; + +// Flood styles +enum wxFloodFillStyle +{ + wxFLOOD_SURFACE = 1, + wxFLOOD_BORDER +}; + +// Mapping modes (same values as used by Windows, don't change) +enum wxMappingMode +{ + wxMM_TEXT = 1, + wxMM_LOMETRIC, + wxMM_HIMETRIC, + wxMM_LOENGLISH, + wxMM_HIENGLISH, + wxMM_TWIPS, + wxMM_ISOTROPIC, + wxMM_ANISOTROPIC, + wxMM_POINTS, + wxMM_METRIC +}; + //----------------------------------------------------------------------------- // wxDrawObject helper class //----------------------------------------------------------------------------- @@ -292,8 +369,9 @@ public: // logical functions - virtual void SetLogicalFunction(int function) = 0; - virtual int GetLogicalFunction() const { return m_logicalFunction; } + virtual void SetLogicalFunction(wxRasterOperationMode function) = 0; + virtual wxRasterOperationMode GetLogicalFunction() const + { return m_logicalFunction; } // text measurement @@ -350,8 +428,8 @@ public: virtual wxCoord LogicalToDeviceXRel(wxCoord x) const; virtual wxCoord LogicalToDeviceYRel(wxCoord y) const; - virtual void SetMapMode(int mode); - virtual int GetMapMode() const { return m_mappingMode; } + virtual void SetMapMode(wxMappingMode mode); + virtual wxMappingMode GetMapMode() const { return m_mappingMode; } virtual void SetUserScale(double x, double y); virtual void GetUserScale(double *x, double *y) const @@ -392,7 +470,7 @@ public: // the actual drawing API virtual bool DoFloodFill(wxCoord x, wxCoord y, const wxColour& col, - int style = wxFLOOD_SURFACE) = 0; + wxFloodFillStyle style = wxFLOOD_SURFACE) = 0; virtual void DoGradientFillLinear(const wxRect& rect, const wxColour& initialColour, @@ -438,7 +516,7 @@ public: wxCoord width, wxCoord height, wxDC *source, wxCoord xsrc, wxCoord ysrc, - int rop = wxCOPY, + wxRasterOperationMode rop = wxCOPY, bool useMask = false, wxCoord xsrcMask = wxDefaultCoord, wxCoord ysrcMask = wxDefaultCoord) = 0; @@ -448,7 +526,7 @@ public: wxDC *source, wxCoord xsrc, wxCoord ysrc, wxCoord srcWidth, wxCoord srcHeight, - int rop = wxCOPY, + wxRasterOperationMode rop = wxCOPY, bool useMask = false, wxCoord xsrcMask = wxDefaultCoord, wxCoord ysrcMask = wxDefaultCoord); @@ -463,14 +541,14 @@ public: wxCoord xoffset, wxCoord yoffset ); virtual void DoDrawPolygon(int n, wxPoint points[], - wxCoord xoffset, wxCoord yoffset, - int fillStyle = wxODDEVEN_RULE) = 0; + wxCoord xoffset, wxCoord yoffset, + wxPolygonFillMode fillStyle = wxODDEVEN_RULE) = 0; virtual void DoDrawPolyPolygon(int n, int count[], wxPoint points[], wxCoord xoffset, wxCoord yoffset, - int fillStyle); + wxPolygonFillMode fillStyle); void DrawPolygon(const wxPointList *list, wxCoord xoffset, wxCoord yoffset, - int fillStyle ); + wxPolygonFillMode fillStyle ); #if wxUSE_SPLINES @@ -602,9 +680,9 @@ protected: wxCoord m_minX, m_minY, m_maxX, m_maxY; wxCoord m_clipX1, m_clipY1, m_clipX2, m_clipY2; - int m_logicalFunction; + wxRasterOperationMode m_logicalFunction; int m_backgroundMode; - int m_mappingMode; + wxMappingMode m_mappingMode; wxPen m_pen; wxBrush m_brush; @@ -749,9 +827,9 @@ public: // logical functions - void SetLogicalFunction(int function) + void SetLogicalFunction(wxRasterOperationMode function) { m_pimpl->SetLogicalFunction(function); } - int GetLogicalFunction() const + wxRasterOperationMode GetLogicalFunction() const { return m_pimpl->GetLogicalFunction(); } // text measurement @@ -848,9 +926,9 @@ public: wxCoord LogicalToDeviceYRel(wxCoord y) const { return m_pimpl->LogicalToDeviceYRel(y); } - void SetMapMode(int mode) + void SetMapMode(wxMappingMode mode) { m_pimpl->SetMapMode(mode); } - int GetMapMode() const + wxMappingMode GetMapMode() const { return m_pimpl->GetMapMode(); } void SetUserScale(double x, double y) @@ -898,10 +976,10 @@ public: // the actual drawing API bool FloodFill(wxCoord x, wxCoord y, const wxColour& col, - int style = wxFLOOD_SURFACE) + wxFloodFillStyle style = wxFLOOD_SURFACE) { return m_pimpl->DoFloodFill(x, y, col, style); } bool FloodFill(const wxPoint& pt, const wxColour& col, - int style = wxFLOOD_SURFACE) + wxFloodFillStyle style = wxFLOOD_SURFACE) { return m_pimpl->DoFloodFill(pt.x, pt.y, col, style); } // fill the area specified by rect with a radial gradient, starting from @@ -978,20 +1056,20 @@ public: void DrawPolygon(int n, wxPoint points[], wxCoord xoffset = 0, wxCoord yoffset = 0, - int fillStyle = wxODDEVEN_RULE) + wxPolygonFillMode fillStyle = wxODDEVEN_RULE) { m_pimpl->DoDrawPolygon(n, points, xoffset, yoffset, fillStyle); } void DrawPolygon(const wxPointList *list, wxCoord xoffset = 0, wxCoord yoffset = 0, - int fillStyle = wxODDEVEN_RULE) + wxPolygonFillMode fillStyle = wxODDEVEN_RULE) { m_pimpl->DrawPolygon( list, xoffset, yoffset, fillStyle ); } void DrawPolyPolygon(int n, int count[], wxPoint points[], wxCoord xoffset = 0, wxCoord yoffset = 0, - int fillStyle = wxODDEVEN_RULE) + wxPolygonFillMode fillStyle = wxODDEVEN_RULE) { m_pimpl->DoDrawPolyPolygon(n, count, points, xoffset, yoffset, fillStyle); } #if WXWIN_COMPATIBILITY_2_8 wxDEPRECATED( void DrawPolygon(const wxList *list, wxCoord xoffset = 0, wxCoord yoffset = 0, - int fillStyle = wxODDEVEN_RULE) ); + wxPolygonFillMode fillStyle = wxODDEVEN_RULE) ); #endif // WXWIN_COMPATIBILITY_2_8 void DrawRectangle(wxCoord x, wxCoord y, wxCoord width, wxCoord height) @@ -1062,14 +1140,16 @@ public: bool Blit(wxCoord xdest, wxCoord ydest, wxCoord width, wxCoord height, wxDC *source, wxCoord xsrc, wxCoord ysrc, - int rop = wxCOPY, bool useMask = false, wxCoord xsrcMask = wxDefaultCoord, wxCoord ysrcMask = wxDefaultCoord) + wxRasterOperationMode rop = wxCOPY, bool useMask = false, + wxCoord xsrcMask = wxDefaultCoord, wxCoord ysrcMask = wxDefaultCoord) { return m_pimpl->DoBlit(xdest, ydest, width, height, source, xsrc, ysrc, rop, useMask, xsrcMask, ysrcMask); } bool Blit(const wxPoint& destPt, const wxSize& sz, wxDC *source, const wxPoint& srcPt, - int rop = wxCOPY, bool useMask = false, const wxPoint& srcPtMask = wxDefaultPosition) + wxRasterOperationMode rop = wxCOPY, bool useMask = false, + const wxPoint& srcPtMask = wxDefaultPosition) { return m_pimpl->DoBlit(destPt.x, destPt.y, sz.x, sz.y, source, srcPt.x, srcPt.y, rop, useMask, srcPtMask.x, srcPtMask.y); @@ -1080,7 +1160,7 @@ public: wxDC *source, wxCoord srcX, wxCoord srcY, wxCoord srcWidth, wxCoord srcHeight, - int rop = wxCOPY, bool useMask = false, + wxRasterOperationMode rop = wxCOPY, bool useMask = false, wxCoord srcMaskX = wxDefaultCoord, wxCoord srcMaskY = wxDefaultCoord) { return m_pimpl->DoStretchBlit(dstX, dstY, dstWidth, dstHeight, @@ -1088,7 +1168,8 @@ public: } bool StretchBlit(const wxPoint& dstPt, const wxSize& dstSize, wxDC *source, const wxPoint& srcPt, const wxSize& srcSize, - int rop = wxCOPY, bool useMask = false, const wxPoint& srcMaskPt = wxDefaultPosition) + wxRasterOperationMode rop = wxCOPY, bool useMask = false, + const wxPoint& srcMaskPt = wxDefaultPosition) { return m_pimpl->DoStretchBlit(dstPt.x, dstPt.y, dstSize.x, dstSize.y, source, srcPt.x, srcPt.y, srcSize.x, srcSize.y, rop, useMask, srcMaskPt.x, srcMaskPt.y); diff --git a/include/wx/dcgraph.h b/include/wx/dcgraph.h index 3e9614f239..0db43629ac 100644 --- a/include/wx/dcgraph.h +++ b/include/wx/dcgraph.h @@ -86,9 +86,9 @@ public: virtual int GetDepth() const; virtual wxSize GetPPI() const; - virtual void SetMapMode(int mode); + virtual void SetMapMode(wxMappingMode mode); - virtual void SetLogicalFunction(int function); + virtual void SetLogicalFunction(wxRasterOperationMode function); virtual void SetTextForeground(const wxColour& colour); virtual void SetTextBackground(const wxColour& colour); @@ -100,7 +100,7 @@ public: // the true implementations virtual bool DoFloodFill(wxCoord x, wxCoord y, const wxColour& col, - int style = wxFLOOD_SURFACE); + wxFloodFillStyle style = wxFLOOD_SURFACE); virtual void DoGradientFillLinear(const wxRect& rect, const wxColour& initialColour, @@ -149,15 +149,16 @@ public: 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); + wxDC *source, wxCoord xsrc, wxCoord ysrc, + wxRasterOperationMode rop = wxCOPY, bool useMask = false, + wxCoord xsrcMask = -1, wxCoord ysrcMask = -1); virtual bool DoStretchBlit(wxCoord xdest, wxCoord ydest, wxCoord dstWidth, wxCoord dstHeight, wxDC *source, wxCoord xsrc, wxCoord ysrc, wxCoord srcWidth, wxCoord srcHeight, - int rop = wxCOPY, bool useMask = false, + wxRasterOperationMode = wxCOPY, bool useMask = false, wxCoord xsrcMask = wxDefaultCoord, wxCoord ysrcMask = wxDefaultCoord); virtual void DoGetSize(int *,int *) const; @@ -166,11 +167,11 @@ public: virtual void DoDrawLines(int n, wxPoint points[], wxCoord xoffset, wxCoord yoffset); virtual void DoDrawPolygon(int n, wxPoint points[], - wxCoord xoffset, wxCoord yoffset, - int fillStyle = wxODDEVEN_RULE); + wxCoord xoffset, wxCoord yoffset, + wxPolygonFillMode fillStyle = wxODDEVEN_RULE); virtual void DoDrawPolyPolygon(int n, int count[], wxPoint points[], - wxCoord xoffset, wxCoord yoffset, - int fillStyle); + wxCoord xoffset, wxCoord yoffset, + wxPolygonFillMode fillStyle); virtual void DoSetDeviceClippingRegion(const wxRegion& region); virtual void DoSetClippingRegion(wxCoord x, wxCoord y, diff --git a/include/wx/dcmirror.h b/include/wx/dcmirror.h index 7ab8d88f25..a4c61c327a 100644 --- a/include/wx/dcmirror.h +++ b/include/wx/dcmirror.h @@ -53,7 +53,7 @@ public: virtual int GetDepth() const { return m_dc.GetDepth(); } virtual wxSize GetPPI() const { return m_dc.GetPPI(); } virtual bool IsOk() const { return m_dc.IsOk(); } - virtual void SetMapMode(int mode) { m_dc.SetMapMode(mode); } + virtual void SetMapMode(wxMappingMode mode) { m_dc.SetMapMode(mode); } virtual void SetUserScale(double x, double y) { m_dc.SetUserScale(GetX(x, y), GetY(x, y)); } virtual void SetLogicalOrigin(wxCoord x, wxCoord y) @@ -63,7 +63,7 @@ public: virtual void SetAxisOrientation(bool xLeftRight, bool yBottomUp) { m_dc.SetAxisOrientation(GetX(xLeftRight, yBottomUp), GetY(xLeftRight, yBottomUp)); } - virtual void SetLogicalFunction(int function) + virtual void SetLogicalFunction(wxRasterOperationMode function) { m_dc.SetLogicalFunction(function); } protected: @@ -102,7 +102,7 @@ protected: // wxDCBase functions virtual bool DoFloodFill(wxCoord x, wxCoord y, const wxColour& col, - int style = wxFLOOD_SURFACE) + wxFloodFillStyle style = wxFLOOD_SURFACE) { return m_dc.DoFloodFill(GetX(x, y), GetY(x, y), col, style); } @@ -202,7 +202,8 @@ protected: virtual bool DoBlit(wxCoord xdest, wxCoord ydest, wxCoord w, wxCoord h, wxDC *source, wxCoord xsrc, wxCoord ysrc, - int rop = wxCOPY, bool useMask = false, + wxRasterOperationMode rop = wxCOPY, + bool useMask = false, wxCoord xsrcMask = wxDefaultCoord, wxCoord ysrcMask = wxDefaultCoord) { return m_dc.DoBlit(GetX(xdest, ydest), GetY(xdest, ydest), @@ -235,7 +236,7 @@ protected: virtual void DoDrawPolygon(int n, wxPoint points[], wxCoord xoffset, wxCoord yoffset, - int fillStyle = wxODDEVEN_RULE) + wxPolygonFillMode fillStyle = wxODDEVEN_RULE) { Mirror(n, points); diff --git a/include/wx/dcsvg.h b/include/wx/dcsvg.h index 8921784aae..45147c68cc 100644 --- a/include/wx/dcsvg.h +++ b/include/wx/dcsvg.h @@ -79,15 +79,15 @@ public: wxFAIL_MSG(wxT("wxSVGFILEDC::GetClippingBox not implemented")); } - virtual void SetLogicalFunction(int WXUNUSED(function)) + virtual void SetLogicalFunction(wxRasterOperationMode WXUNUSED(function)) { wxFAIL_MSG(wxT("wxSVGFILEDC::SetLogicalFunction Call not implemented")); } - virtual int GetLogicalFunction() const + virtual wxRasterOperationMode GetLogicalFunction() const { wxFAIL_MSG(wxT("wxSVGFILEDC::GetLogicalFunction() not implemented")); - return -1; + return wxCOPY; } virtual void SetBackground( const wxBrush &brush ); @@ -104,7 +104,7 @@ private: } virtual bool DoBlit(wxCoord, wxCoord, wxCoord, wxCoord, wxDC *, - wxCoord, wxCoord, int = wxCOPY, + wxCoord, wxCoord, wxRasterOperationMode = wxCOPY, bool = 0, int = -1, int = -1); virtual void DoCrossHair(wxCoord, wxCoord) @@ -132,7 +132,9 @@ private: virtual void DoDrawPoint(wxCoord, wxCoord); - virtual void DoDrawPolygon(int n, wxPoint points[], wxCoord xoffset, wxCoord yoffset,int fillStyle); + virtual void DoDrawPolygon(int n, wxPoint points[], + wxCoord xoffset, wxCoord yoffset, + wxPolygonFillMode fillStyle); virtual void DoDrawRectangle(wxCoord x, wxCoord y, wxCoord w, wxCoord h); @@ -147,7 +149,7 @@ private: virtual bool DoFloodFill(wxCoord WXUNUSED(x), wxCoord WXUNUSED(y), const wxColour& WXUNUSED(col), - int WXUNUSED(style) = wxFLOOD_SURFACE) + wxFloodFillStyle WXUNUSED(style) = wxFLOOD_SURFACE) { wxFAIL_MSG(wxT("wxSVGFILEDC::DoFloodFill Call not implemented")); return false; diff --git a/include/wx/defs.h b/include/wx/defs.h index 38bba222a7..1f30bd8e85 100644 --- a/include/wx/defs.h +++ b/include/wx/defs.h @@ -2148,41 +2148,6 @@ enum wxDeprecatedGUIConstants }; #endif -/* Logical ops */ -typedef enum -{ - wxCLEAR, wxROP_BLACK = wxCLEAR, wxBLIT_BLACKNESS = wxCLEAR, /* 0 */ - wxXOR, wxROP_XORPEN = wxXOR, wxBLIT_SRCINVERT = wxXOR, /* src XOR dst */ - wxINVERT, wxROP_NOT = wxINVERT, wxBLIT_DSTINVERT = wxINVERT, /* NOT dst */ - wxOR_REVERSE, wxROP_MERGEPENNOT = wxOR_REVERSE, wxBLIT_00DD0228 = wxOR_REVERSE, /* src OR (NOT dst) */ - wxAND_REVERSE, wxROP_MASKPENNOT = wxAND_REVERSE, wxBLIT_SRCERASE = wxAND_REVERSE, /* src AND (NOT dst) */ - wxCOPY, wxROP_COPYPEN = wxCOPY, wxBLIT_SRCCOPY = wxCOPY, /* src */ - wxAND, wxROP_MASKPEN = wxAND, wxBLIT_SRCAND = wxAND, /* src AND dst */ - wxAND_INVERT, wxROP_MASKNOTPEN = wxAND_INVERT, wxBLIT_00220326 = wxAND_INVERT, /* (NOT src) AND dst */ - wxNO_OP, wxROP_NOP = wxNO_OP, wxBLIT_00AA0029 = wxNO_OP, /* dst */ - wxNOR, wxROP_NOTMERGEPEN = wxNOR, wxBLIT_NOTSRCERASE = wxNOR, /* (NOT src) AND (NOT dst) */ - wxEQUIV, wxROP_NOTXORPEN = wxEQUIV, wxBLIT_00990066 = wxEQUIV, /* (NOT src) XOR dst */ - wxSRC_INVERT, wxROP_NOTCOPYPEN = wxSRC_INVERT, wxBLIT_NOTSCRCOPY = wxSRC_INVERT, /* (NOT src) */ - wxOR_INVERT, wxROP_MERGENOTPEN = wxOR_INVERT, wxBLIT_MERGEPAINT = wxOR_INVERT, /* (NOT src) OR dst */ - wxNAND, wxROP_NOTMASKPEN = wxNAND, wxBLIT_007700E6 = wxNAND, /* (NOT src) OR (NOT dst) */ - wxOR, wxROP_MERGEPEN = wxOR, wxBLIT_SRCPAINT = wxOR, /* src OR dst */ - wxSET, wxROP_WHITE = wxSET, wxBLIT_WHITENESS = wxSET /* 1 */ -} form_ops_t; - -/* Flood styles */ -enum -{ - wxFLOOD_SURFACE = 1, - wxFLOOD_BORDER -}; - -/* Polygon filling mode */ -enum -{ - wxODDEVEN_RULE = 1, - wxWINDING_RULE -}; - /* ToolPanel in wxFrame (VZ: unused?) */ enum { @@ -2380,21 +2345,6 @@ enum wxKeyModifier wxMOD_ALL = 0xffff }; -/* Mapping modes (same values as used by Windows, don't change) */ -enum -{ - wxMM_TEXT = 1, - wxMM_LOMETRIC, - wxMM_HIMETRIC, - wxMM_LOENGLISH, - wxMM_HIENGLISH, - wxMM_TWIPS, - wxMM_ISOTROPIC, - wxMM_ANISOTROPIC, - wxMM_POINTS, - wxMM_METRIC -}; - /* Shortcut for easier dialog-unit-to-pixel conversion */ #define wxDLG_UNIT(parent, pt) parent->ConvertDialogToPixels(pt) diff --git a/include/wx/dfb/dc.h b/include/wx/dfb/dc.h index c650c55ede..d5acf69401 100644 --- a/include/wx/dfb/dc.h +++ b/include/wx/dfb/dc.h @@ -55,7 +55,7 @@ public: virtual void SetPalette(const wxPalette& palette); #endif - virtual void SetLogicalFunction(int function); + virtual void SetLogicalFunction(wxRasterOperationMode function); virtual void DestroyClippingRegion(); @@ -91,7 +91,7 @@ protected: void DFBInit(const wxIDirectFBSurfacePtr& surface); virtual bool DoFloodFill(wxCoord x, wxCoord y, const wxColour& col, - int style = wxFLOOD_SURFACE); + wxFloodFillStyle style = wxFLOOD_SURFACE); virtual bool DoGetPixel(wxCoord x, wxCoord y, wxColour *col) const; @@ -122,7 +122,8 @@ 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); + wxRasterOperationMode rop = wxCOPY, bool useMask = false, + wxCoord xsrcMask = -1, wxCoord ysrcMask = -1); virtual void DoSetClippingRegion(wxCoord x, wxCoord y, wxCoord width, wxCoord height); @@ -135,7 +136,7 @@ protected: wxCoord xoffset, wxCoord yoffset); virtual void DoDrawPolygon(int n, wxPoint points[], wxCoord xoffset, wxCoord yoffset, - int fillStyle = wxODDEVEN_RULE); + wxPolygonFillMode fillStyle = wxODDEVEN_RULE); // implementation from now on: protected: diff --git a/include/wx/gdicmn.h b/include/wx/gdicmn.h index 59c52cd1bb..4c546d93cb 100644 --- a/include/wx/gdicmn.h +++ b/include/wx/gdicmn.h @@ -85,6 +85,13 @@ enum wxBitmapType wxBITMAP_TYPE_ANY = 50 }; +// Polygon filling mode +enum wxPolygonFillMode +{ + wxODDEVEN_RULE = 1, + wxWINDING_RULE +}; + // Standard cursors enum wxStockCursor { diff --git a/include/wx/generic/dcpsg.h b/include/wx/generic/dcpsg.h index 5c0a7ef214..bc544c93fe 100644 --- a/include/wx/generic/dcpsg.h +++ b/include/wx/generic/dcpsg.h @@ -60,7 +60,7 @@ public: void SetFont( const wxFont& font ); void SetPen( const wxPen& pen ); void SetBrush( const wxBrush& brush ); - void SetLogicalFunction( int function ); + void SetLogicalFunction( wxRasterOperationMode function ); void SetBackground( const wxBrush& brush ); void DestroyClippingRegion(); @@ -95,7 +95,8 @@ public: virtual wxRect GetPaperRect() const; protected: - bool DoFloodFill(wxCoord x1, wxCoord y1, const wxColour &col, int style = wxFLOOD_SURFACE); + bool DoFloodFill(wxCoord x1, wxCoord y1, const wxColour &col, + wxFloodFillStyle style = wxFLOOD_SURFACE); bool DoGetPixel(wxCoord x1, wxCoord y1, wxColour *col) const; void DoDrawLine(wxCoord x1, wxCoord y1, wxCoord x2, wxCoord y2); void DoCrossHair(wxCoord x, wxCoord y) ; @@ -103,8 +104,12 @@ protected: void DoDrawEllipticArc(wxCoord x,wxCoord y,wxCoord w,wxCoord h,double sa,double ea); void DoDrawPoint(wxCoord x, wxCoord y); void DoDrawLines(int n, wxPoint points[], wxCoord xoffset = 0, wxCoord yoffset = 0); - void DoDrawPolygon(int n, wxPoint points[], wxCoord xoffset = 0, wxCoord yoffset = 0, int fillStyle = wxODDEVEN_RULE); - void DoDrawPolyPolygon(int n, int count[], wxPoint points[], wxCoord xoffset = 0, wxCoord yoffset = 0, int fillStyle = wxODDEVEN_RULE); + void DoDrawPolygon(int n, wxPoint points[], + wxCoord xoffset = 0, wxCoord yoffset = 0, + wxPolygonFillMode fillStyle = wxODDEVEN_RULE); + void DoDrawPolyPolygon(int n, int count[], wxPoint points[], + wxCoord xoffset = 0, wxCoord yoffset = 0, + wxPolygonFillMode fillStyle = wxODDEVEN_RULE); void DoDrawRectangle(wxCoord x, wxCoord y, wxCoord width, wxCoord height); void DoDrawRoundedRectangle(wxCoord x, wxCoord y, wxCoord width, wxCoord height, double radius = 20); void DoDrawEllipse(wxCoord x, wxCoord y, wxCoord width, wxCoord height); @@ -112,7 +117,8 @@ protected: void DoDrawSpline(const wxPointList *points); #endif bool DoBlit(wxCoord xdest, wxCoord ydest, wxCoord width, wxCoord height, - wxDC *source, wxCoord xsrc, wxCoord ysrc, int rop = wxCOPY, bool useMask = false, + wxDC *source, wxCoord xsrc, wxCoord ysrc, + wxRasterOperationMode rop = wxCOPY, bool useMask = false, wxCoord xsrcMask = wxDefaultCoord, wxCoord ysrcMask = wxDefaultCoord); void DoDrawIcon(const wxIcon& icon, wxCoord x, wxCoord y); void DoDrawBitmap(const wxBitmap& bitmap, wxCoord x, wxCoord y, bool useMask = false); diff --git a/include/wx/graphics.h b/include/wx/graphics.h index ede12ad06c..8f4af2ce66 100644 --- a/include/wx/graphics.h +++ b/include/wx/graphics.h @@ -356,10 +356,10 @@ public: virtual void * GetNativeContext() = 0; // returns the current logical function - virtual int GetLogicalFunction() const { return m_logicalFunction; } + virtual wxRasterModeOperation GetLogicalFunction() const { return m_logicalFunction; } // sets the current logical function, returns true if it supported - virtual bool SetLogicalFunction(int function); + virtual bool SetLogicalFunction(wxRasterOperationMode function); // returns the size of the graphics context in device coordinates virtual void GetSize( wxDouble* width, wxDouble* height); @@ -495,7 +495,7 @@ protected: wxGraphicsPen m_pen; wxGraphicsBrush m_brush; wxGraphicsFont m_font; - int m_logicalFunction; + wxRasterOperationMode m_logicalFunction; private: // implementations of overloaded public functions: we use different names diff --git a/include/wx/gtk/dcclient.h b/include/wx/gtk/dcclient.h index b2fde5265b..da1d79a3f5 100644 --- a/include/wx/gtk/dcclient.h +++ b/include/wx/gtk/dcclient.h @@ -32,7 +32,8 @@ public: virtual bool CanGetTextExtent() const { return true; } virtual void DoGetSize(int *width, int *height) const; - virtual bool DoFloodFill( wxCoord x, wxCoord y, const wxColour& col, int style=wxFLOOD_SURFACE ); + virtual bool DoFloodFill( wxCoord x, wxCoord y, const wxColour& col, + wxFloodFillStyle style=wxFLOOD_SURFACE ); virtual bool DoGetPixel( wxCoord x1, wxCoord y1, wxColour *col ) const; virtual void DoDrawLine( wxCoord x1, wxCoord y1, wxCoord x2, wxCoord y2 ); @@ -47,7 +48,7 @@ public: wxCoord xoffset, wxCoord yoffset); virtual void DoDrawPolygon(int n, wxPoint points[], wxCoord xoffset, wxCoord yoffset, - int fillStyle = wxODDEVEN_RULE); + wxPolygonFillMode fillStyle = wxODDEVEN_RULE); virtual void DoDrawRectangle( wxCoord x, wxCoord y, wxCoord width, wxCoord height ); virtual void DoDrawRoundedRectangle( wxCoord x, wxCoord y, wxCoord width, wxCoord height, double radius = 20.0 ); @@ -57,9 +58,12 @@ public: virtual void DoDrawBitmap( const wxBitmap &bitmap, wxCoord x, wxCoord y, bool useMask = false ); - virtual bool DoBlit( wxCoord xdest, wxCoord ydest, wxCoord width, wxCoord height, + 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 ); + wxRasterOperationMode 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, @@ -82,7 +86,7 @@ public: virtual void SetPen( const wxPen &pen ); virtual void SetBrush( const wxBrush &brush ); virtual void SetBackground( const wxBrush &brush ); - virtual void SetLogicalFunction( int function ); + virtual void SetLogicalFunction( wxRasterOperationMode function ); virtual void SetTextForeground( const wxColour &col ); virtual void SetTextBackground( const wxColour &col ); virtual void SetBackgroundMode( int mode ); diff --git a/include/wx/gtk/gnome/gprint.h b/include/wx/gtk/gnome/gprint.h index 0901dae2e7..853707da91 100644 --- a/include/wx/gtk/gnome/gprint.h +++ b/include/wx/gtk/gnome/gprint.h @@ -234,7 +234,7 @@ public: void SetFont( const wxFont& font ); void SetPen( const wxPen& pen ); void SetBrush( const wxBrush& brush ); - void SetLogicalFunction( int function ); + void SetLogicalFunction( wxRasterOperationMode function ); void SetBackground( const wxBrush& brush ); void DestroyClippingRegion(); bool StartDoc(const wxString& message); @@ -250,7 +250,8 @@ public: void SetPalette(const wxPalette& WXUNUSED(palette)) { } protected: - bool DoFloodFill(wxCoord x1, wxCoord y1, const wxColour &col, int style=wxFLOOD_SURFACE ); + bool DoFloodFill(wxCoord x1, wxCoord y1, const wxColour &col, + wxFloodFillStyle style=wxFLOOD_SURFACE ); bool DoGetPixel(wxCoord x1, wxCoord y1, wxColour *col) const; void DoDrawLine(wxCoord x1, wxCoord y1, wxCoord x2, wxCoord y2); void DoCrossHair(wxCoord x, wxCoord y); @@ -258,8 +259,8 @@ protected: void DoDrawEllipticArc(wxCoord x,wxCoord y,wxCoord w,wxCoord h,double sa,double ea); void DoDrawPoint(wxCoord x, wxCoord y); void DoDrawLines(int n, wxPoint points[], wxCoord xoffset = 0, wxCoord yoffset = 0); - void DoDrawPolygon(int n, wxPoint points[], wxCoord xoffset = 0, wxCoord yoffset = 0, int fillStyle=wxODDEVEN_RULE); - void DoDrawPolyPolygon(int n, int count[], wxPoint points[], wxCoord xoffset = 0, wxCoord yoffset = 0, int fillStyle=wxODDEVEN_RULE); + void DoDrawPolygon(int n, wxPoint points[], wxCoord xoffset = 0, wxCoord yoffset = 0, wxPolygonFillMode fillStyle=wxODDEVEN_RULE); + void DoDrawPolyPolygon(int n, int count[], wxPoint points[], wxCoord xoffset = 0, wxCoord yoffset = 0, wxPolygonFillMode fillStyle=wxODDEVEN_RULE); void DoDrawRectangle(wxCoord x, wxCoord y, wxCoord width, wxCoord height); void DoDrawRoundedRectangle(wxCoord x, wxCoord y, wxCoord width, wxCoord height, double radius = 20.0); void DoDrawEllipse(wxCoord x, wxCoord y, wxCoord width, wxCoord height); @@ -267,7 +268,8 @@ protected: void DoDrawSpline(const wxPointList *points); #endif bool DoBlit(wxCoord xdest, wxCoord ydest, wxCoord width, wxCoord height, - wxDC *source, wxCoord xsrc, wxCoord ysrc, int rop = wxCOPY, bool useMask = false, + wxDC *source, wxCoord xsrc, wxCoord ysrc, + wxRasterOperationMode = wxCOPY, bool useMask = false, wxCoord xsrcMask = wxDefaultCoord, wxCoord ysrcMask = wxDefaultCoord); void DoDrawIcon( const wxIcon& icon, wxCoord x, wxCoord y ); void DoDrawBitmap( const wxBitmap& bitmap, wxCoord x, wxCoord y, bool useMask = false ); diff --git a/include/wx/gtk/print.h b/include/wx/gtk/print.h index 62a3514645..0e91688503 100644 --- a/include/wx/gtk/print.h +++ b/include/wx/gtk/print.h @@ -234,7 +234,7 @@ public: void SetFont( const wxFont& font ); void SetPen( const wxPen& pen ); void SetBrush( const wxBrush& brush ); - void SetLogicalFunction( int function ); + void SetLogicalFunction( wxRasterOperationMode function ); void SetBackground( const wxBrush& brush ); void DestroyClippingRegion(); bool StartDoc(const wxString& message); @@ -255,7 +255,8 @@ public: virtual wxRect GetPaperRect() const; protected: - bool DoFloodFill(wxCoord x1, wxCoord y1, const wxColour &col, int style=wxFLOOD_SURFACE ); + bool DoFloodFill(wxCoord x1, wxCoord y1, const wxColour &col, + wxFloodFillStyle style=wxFLOOD_SURFACE ); void DoGradientFillConcentric(const wxRect& rect, const wxColour& initialColour, const wxColour& destColour, const wxPoint& circleCenter); void DoGradientFillLinear(const wxRect& rect, const wxColour& initialColour, const wxColour& destColour, wxDirection nDirection = wxEAST); bool DoGetPixel(wxCoord x1, wxCoord y1, wxColour *col) const; @@ -265,8 +266,8 @@ protected: void DoDrawEllipticArc(wxCoord x,wxCoord y,wxCoord w,wxCoord h,double sa,double ea); void DoDrawPoint(wxCoord x, wxCoord y); void DoDrawLines(int n, wxPoint points[], wxCoord xoffset = 0, wxCoord yoffset = 0); - void DoDrawPolygon(int n, wxPoint points[], wxCoord xoffset = 0, wxCoord yoffset = 0, int fillStyle=wxODDEVEN_RULE); - void DoDrawPolyPolygon(int n, int count[], wxPoint points[], wxCoord xoffset = 0, wxCoord yoffset = 0, int fillStyle=wxODDEVEN_RULE); + void DoDrawPolygon(int n, wxPoint points[], wxCoord xoffset = 0, wxCoord yoffset = 0, wxPolygonFillMode fillStyle=wxODDEVEN_RULE); + void DoDrawPolyPolygon(int n, int count[], wxPoint points[], wxCoord xoffset = 0, wxCoord yoffset = 0, wxPolygonFillMode fillStyle=wxODDEVEN_RULE); void DoDrawRectangle(wxCoord x, wxCoord y, wxCoord width, wxCoord height); void DoDrawRoundedRectangle(wxCoord x, wxCoord y, wxCoord width, wxCoord height, double radius = 20.0); void DoDrawEllipse(wxCoord x, wxCoord y, wxCoord width, wxCoord height); @@ -274,7 +275,8 @@ protected: void DoDrawSpline(const wxPointList *points); #endif bool DoBlit(wxCoord xdest, wxCoord ydest, wxCoord width, wxCoord height, - wxDC *source, wxCoord xsrc, wxCoord ysrc, int rop = wxCOPY, bool useMask = false, + wxDC *source, wxCoord xsrc, wxCoord ysrc, + wxRasterOperationMode rop = wxCOPY, bool useMask = false, wxCoord xsrcMask = wxDefaultCoord, wxCoord ysrcMask = wxDefaultCoord); void DoDrawIcon( const wxIcon& icon, wxCoord x, wxCoord y ); void DoDrawBitmap( const wxBitmap& bitmap, wxCoord x, wxCoord y, bool useMask = false ); diff --git a/include/wx/gtk/region.h b/include/wx/gtk/region.h index 846f1946cf..e465f0011f 100644 --- a/include/wx/gtk/region.h +++ b/include/wx/gtk/region.h @@ -35,7 +35,8 @@ public: InitRect(rect.x, rect.y, rect.width, rect.height); } - wxRegion( size_t n, const wxPoint *points, int fillStyle = wxODDEVEN_RULE ); + wxRegion( size_t n, const wxPoint *points, + wxPolygonFillMode fillStyle = wxODDEVEN_RULE ); #if wxUSE_IMAGE wxRegion( const wxBitmap& bmp) diff --git a/include/wx/gtk1/dcclient.h b/include/wx/gtk1/dcclient.h index b0e3f9e438..bf094360fa 100644 --- a/include/wx/gtk1/dcclient.h +++ b/include/wx/gtk1/dcclient.h @@ -38,7 +38,7 @@ public: 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 DoFloodFill( wxCoord x, wxCoord y, const wxColour& col, wxFloodFillStyle style=wxFLOOD_SURFACE ); virtual bool DoGetPixel( wxCoord x1, wxCoord y1, wxColour *col ) const; virtual void DoDrawLine( wxCoord x1, wxCoord y1, wxCoord x2, wxCoord y2 ); @@ -53,7 +53,7 @@ protected: wxCoord xoffset, wxCoord yoffset); virtual void DoDrawPolygon(int n, wxPoint points[], wxCoord xoffset, wxCoord yoffset, - int fillStyle = wxODDEVEN_RULE); + wxPolygonFillMode fillStyle = wxODDEVEN_RULE); virtual void DoDrawRectangle( wxCoord x, wxCoord y, wxCoord width, wxCoord height ); virtual void DoDrawRoundedRectangle( wxCoord x, wxCoord y, wxCoord width, wxCoord height, double radius = 20.0 ); @@ -65,7 +65,8 @@ protected: 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 ); + wxRasterOperationMode 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, @@ -86,7 +87,7 @@ public: virtual void SetPen( const wxPen &pen ); virtual void SetBrush( const wxBrush &brush ); virtual void SetBackground( const wxBrush &brush ); - virtual void SetLogicalFunction( int function ); + virtual void SetLogicalFunction( wxRasterOperationMode function ); virtual void SetTextForeground( const wxColour &col ); virtual void SetTextBackground( const wxColour &col ); virtual void SetBackgroundMode( int mode ); diff --git a/include/wx/mgl/dc.h b/include/wx/mgl/dc.h index 02535965b7..ab5a3efc8f 100644 --- a/include/wx/mgl/dc.h +++ b/include/wx/mgl/dc.h @@ -86,13 +86,13 @@ public: virtual int GetDepth() const; virtual wxSize GetPPI() const; - virtual void SetLogicalFunction(int function); + virtual void SetLogicalFunction(wxRasterOperationMode function); // implementation from now on // -------------------------- virtual void ComputeScaleAndOrigin(); - + wxCoord XDEV2LOG(wxCoord x) const { return DeviceToLogicalX(x); } wxCoord XDEV2LOGREL(wxCoord x) const { return DeviceToLogicalXRel(x); } wxCoord YDEV2LOG(wxCoord y) const { return DeviceToLogicalY(y); } @@ -107,7 +107,7 @@ public: protected: virtual bool DoFloodFill(wxCoord x, wxCoord y, const wxColour& col, - int style = wxFLOOD_SURFACE); + wxFloodFillStyle style = wxFLOOD_SURFACE); virtual bool DoGetPixel(wxCoord x, wxCoord y, wxColour *col) const; @@ -138,7 +138,8 @@ 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); + wxRasterOperationMode rop = wxCOPY, bool useMask = false, + wxCoord xsrcMask = -1, wxCoord ysrcMask = -1); virtual void DoSetClippingRegion(wxCoord x, wxCoord y, wxCoord width, wxCoord height); @@ -151,7 +152,7 @@ protected: wxCoord xoffset, wxCoord yoffset); virtual void DoDrawPolygon(int n, wxPoint points[], wxCoord xoffset, wxCoord yoffset, - int fillStyle = wxODDEVEN_RULE); + wxPolygonFillMode fillStyle = wxODDEVEN_RULE); // implementation from now on: diff --git a/include/wx/motif/dcclient.h b/include/wx/motif/dcclient.h index 86f6ce73ee..b13f196eb4 100644 --- a/include/wx/motif/dcclient.h +++ b/include/wx/motif/dcclient.h @@ -42,7 +42,7 @@ public: virtual void SetBackground(const wxBrush& brush); virtual void SetBackgroundMode(int mode); virtual void SetPalette(const wxPalette& palette); - virtual void SetLogicalFunction( int function ); + virtual void SetLogicalFunction( wxRasterOperationMode function ); virtual void SetTextForeground(const wxColour& colour); virtual void SetTextBackground(const wxColour& colour); @@ -89,7 +89,7 @@ protected: void SetForegroundPixelWithLogicalFunction(WXPixel pixel); virtual bool DoFloodFill(wxCoord x, wxCoord y, const wxColour& col, - int style = wxFLOOD_SURFACE); + wxFloodFillStyle style = wxFLOOD_SURFACE); virtual bool DoGetPixel(wxCoord x, wxCoord y, wxColour *col) const; @@ -115,7 +115,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); + wxRasterOperationMode rop = wxCOPY, bool useMask = false, wxCoord xsrcMask = -1, wxCoord ysrcMask = -1); virtual void DoSetClippingRegion(wxCoord x, wxCoord y, wxCoord width, wxCoord height); @@ -125,7 +125,7 @@ protected: wxCoord xoffset, wxCoord yoffset); virtual void DoDrawPolygon(int n, wxPoint points[], wxCoord xoffset, wxCoord yoffset, - int fillStyle = wxODDEVEN_RULE); + wxPolygonFillMode fillStyle = wxODDEVEN_RULE); void DoGetSize( int *width, int *height ) const; diff --git a/include/wx/msw/dc.h b/include/wx/msw/dc.h index 0eea5ca268..908e24bcff 100644 --- a/include/wx/msw/dc.h +++ b/include/wx/msw/dc.h @@ -80,14 +80,14 @@ public: virtual wxSize GetPPI() const; - virtual void SetMapMode(int mode); + virtual void SetMapMode(wxMappingMode mode); virtual void SetUserScale(double x, double y); virtual void SetLogicalScale(double x, double y); virtual void SetLogicalOrigin(wxCoord x, wxCoord y); virtual void SetDeviceOrigin(wxCoord x, wxCoord y); virtual void SetAxisOrientation(bool xLeftRight, bool yBottomUp); - virtual void SetLogicalFunction(int function); + virtual void SetLogicalFunction(wxRasterOperationMode function); // implementation from now on // -------------------------- @@ -173,7 +173,7 @@ public: virtual bool DoGetPartialTextExtents(const wxString& text, wxArrayInt& widths) const; virtual bool DoFloodFill(wxCoord x, wxCoord y, const wxColour& col, - int style = wxFLOOD_SURFACE); + wxFloodFillStyle style = wxFLOOD_SURFACE); virtual void DoGradientFillLinear(const wxRect& rect, const wxColour& initialColour, @@ -215,14 +215,15 @@ public: 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 = wxDefaultCoord, wxCoord ysrcMask = wxDefaultCoord); + wxRasterOperationMode rop = wxCOPY, bool useMask = false, + wxCoord xsrcMask = wxDefaultCoord, wxCoord ysrcMask = wxDefaultCoord); virtual bool DoStretchBlit(wxCoord xdest, wxCoord ydest, wxCoord dstWidth, wxCoord dstHeight, wxDC *source, wxCoord xsrc, wxCoord ysrc, wxCoord srcWidth, wxCoord srcHeight, - int rop = wxCOPY, bool useMask = false, + wxRasterOperationMode rop = wxCOPY, bool useMask = false, wxCoord xsrcMask = wxDefaultCoord, wxCoord ysrcMask = wxDefaultCoord); virtual void DoSetClippingRegion(wxCoord x, wxCoord y, @@ -237,10 +238,10 @@ public: wxCoord xoffset, wxCoord yoffset); virtual void DoDrawPolygon(int n, wxPoint points[], wxCoord xoffset, wxCoord yoffset, - int fillStyle = wxODDEVEN_RULE); + wxPolygonFillMode fillStyle = wxODDEVEN_RULE); virtual void DoDrawPolyPolygon(int n, int count[], wxPoint points[], wxCoord xoffset, wxCoord yoffset, - int fillStyle = wxODDEVEN_RULE); + wxPolygonFillMode fillStyle = wxODDEVEN_RULE); virtual wxBitmap DoGetAsBitmap(const wxRect *subrect) const { return subrect == NULL ? GetSelectedBitmap() diff --git a/include/wx/msw/dcprint.h b/include/wx/msw/dcprint.h index 64ed3c7d53..ee442eddd1 100644 --- a/include/wx/msw/dcprint.h +++ b/include/wx/msw/dcprint.h @@ -43,7 +43,8 @@ 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 = wxDefaultCoord, wxCoord ysrcMask = wxDefaultCoord); + wxRasterOperationMode rop = wxCOPY, bool useMask = false, + wxCoord xsrcMask = wxDefaultCoord, wxCoord ysrcMask = wxDefaultCoord); virtual void DoGetSize(int *w, int *h) const { GetDeviceSize(w, h); diff --git a/include/wx/msw/metafile.h b/include/wx/msw/metafile.h index a454c9690a..11cd119760 100644 --- a/include/wx/msw/metafile.h +++ b/include/wx/msw/metafile.h @@ -86,7 +86,7 @@ public: virtual ~wxMetafileDCImpl(); virtual wxMetafile *Close(); - virtual void SetMapMode(int mode); + virtual void SetMapMode(wxMappingMode mode); virtual void DoGetTextExtent(const wxString& string, wxCoord *x, wxCoord *y, wxCoord *descent = NULL, @@ -125,9 +125,9 @@ public: : wxDC(new wxMetafileDCImpl( this, file, xext, yext, xorg, yorg )) { } - wxMetafile *GetMetafile() const + wxMetafile *GetMetafile() const { return ((wxMetafileDCImpl*)m_pimpl)->GetMetaFile(); } - + wxMetafile *Close() { return ((wxMetafileDCImpl*)m_pimpl)->Close(); } diff --git a/include/wx/os2/dc.h b/include/wx/os2/dc.h index aff30c67ea..f0a70ddb4e 100644 --- a/include/wx/os2/dc.h +++ b/include/wx/os2/dc.h @@ -149,7 +149,7 @@ public: virtual void SetAxisOrientation( bool bXLeftRight ,bool bYBottomUp ); - virtual void SetLogicalFunction(int nFunction); + virtual void SetLogicalFunction(wxRasterOperationMode nFunction); // implementation from now on // -------------------------- @@ -227,10 +227,10 @@ public: ,wxCoord* pExternalLeading = NULL ,const wxFont* pTheFont = NULL ) const; - virtual bool DoFloodFill( wxCoord vX - ,wxCoord vY - ,const wxColour& rCol - ,int nStyle = wxFLOOD_SURFACE + virtual bool DoFloodFill( wxCoord vX + ,wxCoord vY + ,const wxColour& rCol + ,wxFloodFillStyle nStyle = wxFLOOD_SURFACE ); virtual bool DoGetPixel( wxCoord vX @@ -315,7 +315,7 @@ public: ,wxDC* pSource ,wxCoord vXsrc ,wxCoord vYsrc - ,int nRop = wxCOPY + ,wxRasterOperationMode nRop = wxCOPY ,bool bUseMask = FALSE ,wxCoord vXsrcMask = -1 ,wxCoord vYsrcMask = -1 @@ -344,7 +344,7 @@ public: ,wxPoint vaPoints[] ,wxCoord vXoffset ,wxCoord vYoffset - ,int nFillStyle = wxODDEVEN_RULE + ,wxPolygonFillMode nFillStyle = wxODDEVEN_RULE ); #if wxUSE_PALETTE diff --git a/include/wx/os2/dcprint.h b/include/wx/os2/dcprint.h index 47689ebc80..e967827cbe 100644 --- a/include/wx/os2/dcprint.h +++ b/include/wx/os2/dcprint.h @@ -48,7 +48,7 @@ protected: ,wxDC* pSource ,wxCoord vXsrc ,wxCoord vYsrc - ,int nRop = wxCOPY + ,wxRasterOperationMode nRop = wxCOPY ,bool bUseMask = FALSE ,wxCoord vXsrcMask = -1 ,wxCoord vYsrcMask = -1 diff --git a/include/wx/os2/metafile.h b/include/wx/os2/metafile.h index ac5f7c6267..27f04a6604 100644 --- a/include/wx/os2/metafile.h +++ b/include/wx/os2/metafile.h @@ -82,7 +82,7 @@ public: virtual ~wxMetafileDCImpl(); virtual wxMetafile *Close(); - virtual void SetMapMode(int mode); + virtual void SetMapMode(wxMappingMode mode); virtual void DoGetTextExtent(const wxString& string, wxCoord *x, wxCoord *y, wxCoord *descent = NULL, diff --git a/include/wx/palmos/dc.h b/include/wx/palmos/dc.h index 216a802431..c3170a5de4 100644 --- a/include/wx/palmos/dc.h +++ b/include/wx/palmos/dc.h @@ -80,14 +80,14 @@ public: virtual wxSize GetPPI() const; - virtual void SetMapMode(int mode); + virtual void SetMapMode(wxMappingMode mode); virtual void SetUserScale(double x, double y); virtual void SetLogicalScale(double x, double y); virtual void SetLogicalOrigin(wxCoord x, wxCoord y); virtual void SetDeviceOrigin(wxCoord x, wxCoord y); virtual void SetAxisOrientation(bool xLeftRight, bool yBottomUp); - virtual void SetLogicalFunction(int function); + virtual void SetLogicalFunction(wxRasterOperationMode function); // implementation from now on // -------------------------- @@ -173,7 +173,7 @@ public: virtual bool DoGetPartialTextExtents(const wxString& text, wxArrayInt& widths) const; virtual bool DoFloodFill(wxCoord x, wxCoord y, const wxColour& col, - int style = wxFLOOD_SURFACE); + wxFloodFillStyle style = wxFLOOD_SURFACE); virtual void DoGradientFillLinear(const wxRect& rect, const wxColour& initialColour, @@ -215,14 +215,15 @@ public: 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 = wxDefaultCoord, wxCoord ysrcMask = wxDefaultCoord); + wxRasterOperationMode rop = wxCOPY, bool useMask = false, + wxCoord xsrcMask = wxDefaultCoord, wxCoord ysrcMask = wxDefaultCoord); virtual bool DoStretchBlit(wxCoord xdest, wxCoord ydest, wxCoord dstWidth, wxCoord dstHeight, wxDC *source, wxCoord xsrc, wxCoord ysrc, wxCoord srcWidth, wxCoord srcHeight, - int rop = wxCOPY, bool useMask = false, + wxRasterOperationMode rop = wxCOPY, bool useMask = false, wxCoord xsrcMask = wxDefaultCoord, wxCoord ysrcMask = wxDefaultCoord); virtual void DoSetClippingRegion(wxCoord x, wxCoord y, @@ -237,10 +238,10 @@ public: wxCoord xoffset, wxCoord yoffset); virtual void DoDrawPolygon(int n, wxPoint points[], wxCoord xoffset, wxCoord yoffset, - int fillStyle = wxODDEVEN_RULE); + wxPolygonFillMode fillStyle = wxODDEVEN_RULE); virtual void DoDrawPolyPolygon(int n, int count[], wxPoint points[], wxCoord xoffset, wxCoord yoffset, - int fillStyle = wxODDEVEN_RULE); + wxPolygonFillMode fillStyle = wxODDEVEN_RULE); virtual wxBitmap DoGetAsBitmap(const wxRect *subrect) const { return subrect == NULL ? GetSelectedBitmap() diff --git a/include/wx/palmos/dcprint.h b/include/wx/palmos/dcprint.h index a67bb3123a..b0b7b6b28f 100644 --- a/include/wx/palmos/dcprint.h +++ b/include/wx/palmos/dcprint.h @@ -42,7 +42,8 @@ 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); + wxRasterOperationMode rop = wxCOPY, bool useMask = FALSE, + wxCoord xsrcMask = -1, wxCoord ysrcMask = -1); // init the dc void Init(); diff --git a/include/wx/palmos/metafile.h b/include/wx/palmos/metafile.h index 0986bcb4ba..483398e284 100644 --- a/include/wx/palmos/metafile.h +++ b/include/wx/palmos/metafile.h @@ -88,7 +88,7 @@ public: // Should be called at end of drawing virtual wxMetafile *Close(); - virtual void SetMapMode(int mode); + virtual void SetMapMode(wxMappingMode mode); virtual void GetTextExtent(const wxString& string, long *x, long *y, long *descent = NULL, long *externalLeading = NULL, const wxFont *theFont = NULL, bool use16bit = FALSE) const; diff --git a/include/wx/x11/dcclient.h b/include/wx/x11/dcclient.h index 95dfc30f50..e3a52fe81c 100644 --- a/include/wx/x11/dcclient.h +++ b/include/wx/x11/dcclient.h @@ -40,7 +40,8 @@ public: 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 DoFloodFill( wxCoord x, wxCoord y, const wxColour& col, + wxFloodFillStyle style = wxFLOOD_SURFACE ); virtual bool DoGetPixel( wxCoord x, wxCoord y, wxColour *col ) const; virtual void DoDrawPoint(wxCoord x, wxCoord y); @@ -69,7 +70,8 @@ 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); + wxRasterOperationMode rop = wxCOPY, bool useMask = false, + wxCoord xsrcMask = -1, wxCoord ysrcMask = -1); virtual void DoSetClippingRegion(wxCoord x, wxCoord y, wxCoord width, wxCoord height); @@ -79,7 +81,7 @@ protected: wxCoord xoffset, wxCoord yoffset); virtual void DoDrawPolygon(int n, wxPoint points[], wxCoord xoffset, wxCoord yoffset, - int fillStyle = wxODDEVEN_RULE); + wxPolygonFillMode fillStyle = wxODDEVEN_RULE); public: @@ -91,7 +93,7 @@ public: virtual void SetBackground(const wxBrush& brush); virtual void SetBackgroundMode(int mode); virtual void SetPalette(const wxPalette& palette); - virtual void SetLogicalFunction( int function ); + virtual void SetLogicalFunction( wxRasterOperationMode function ); virtual void SetTextForeground(const wxColour& colour); virtual void SetTextBackground(const wxColour& colour); diff --git a/interface/wx/dc.h b/interface/wx/dc.h index 0fa93ce917..bc522c7c6f 100644 --- a/interface/wx/dc.h +++ b/interface/wx/dc.h @@ -107,11 +107,11 @@ public: setting the @c no-maskblt option to 1. @param xsrcMask Source x position on the mask. If both xsrcMask and ysrcMask are - -1, xsrc and ysrc will be assumed for the mask source position. + @c -1, xsrc and ysrc will be assumed for the mask source position. Currently only implemented on Windows. @param ysrcMask Source y position on the mask. If both xsrcMask and ysrcMask are - -1, xsrc and ysrc will be assumed for the mask source position. + @c -1, xsrc and ysrc will be assumed for the mask source position. Currently only implemented on Windows. @remarks There is partial support for Blit() in wxPostScriptDC, under X. @@ -120,7 +120,7 @@ public: */ bool Blit(wxCoord xdest, wxCoord ydest, wxCoord width, wxCoord height, wxDC* source, wxCoord xsrc, wxCoord ysrc, - int logicalFunc = wxCOPY, bool useMask = false, + wxRasterOperationMode logicalFunc = wxCOPY, bool useMask = false, wxCoord xsrcMask = wxDefaultCoord, wxCoord ysrcMask = wxDefaultCoord); /** @@ -325,7 +325,8 @@ public: for filling the shape. Using a transparent brush suppresses filling. */ void DrawPolygon(int n, wxPoint points[], wxCoord xoffset = 0, - wxCoord yoffset = 0, int fill_style = wxODDEVEN_RULE); + wxCoord yoffset = 0, + wxPolygonFillMode fill_style = wxODDEVEN_RULE); /** This method draws a filled polygon using a list of wxPoints, adding the optional offset coordinate. The first and last points are automatically @@ -346,7 +347,7 @@ public: */ void DrawPolygon(const wxPointList* points, wxCoord xoffset = 0, wxCoord yoffset = 0, - int fill_style = wxODDEVEN_RULE); + wxPolygonFillMode fill_style = wxODDEVEN_RULE); /** Draws two or more filled polygons using an array of @a points, adding @@ -377,7 +378,7 @@ public: */ void DrawPolyPolygon(int n, int count[], wxPoint points[], wxCoord xoffset = 0, wxCoord yoffset = 0, - int fill_style = wxODDEVEN_RULE); + wxPolygonFillMode fill_style = wxODDEVEN_RULE); /** Draws a rectangle with the given top left corner, and with the given @@ -469,7 +470,7 @@ public: exactly. However the function will still return @true. */ bool FloodFill(wxCoord x, wxCoord y, const wxColour& colour, - int style = wxFLOOD_SURFACE); + wxFloodFillStyle style = wxFLOOD_SURFACE); /** Gets the brush used for painting the background. @@ -542,14 +543,14 @@ public: @see SetLogicalFunction() */ - int GetLogicalFunction() const; + wxRasterOperationMode GetLogicalFunction() const; /** Gets the mapping mode for the device context. @see SetMapMode() */ - int GetMapMode() const; + wxMappingMode GetMapMode() const; /** Gets the dimensions of the string using the currently selected font. @@ -930,7 +931,7 @@ public: operation. wxINVERT is commonly used for drawing rubber bands or moving outlines, since drawing twice reverts to the original colour. */ - void SetLogicalFunction(int function); + void SetLogicalFunction(wxRasterOperationMode function); /** The mapping mode of the device context defines the unit of measurement @@ -954,7 +955,7 @@ public: - wxMM_LOMETRIC: Each logical unit is 1/10 of a mm. - wxMM_TEXT: Each logical unit is 1 device pixel. */ - void SetMapMode(int mode); + void SetMapMode(wxMappingMode mode); /** If this is a window DC or memory DC, assigns the given palette to the @@ -1082,7 +1083,7 @@ public: wxCoord dstWidth, wxCoord dstHeight, wxDC* source, wxCoord xsrc, wxCoord ysrc, wxCoord srcWidth, wxCoord srcHeight, - int logicalFunc = wxCOPY, + wxRasterOperationMode logicalFunc = wxCOPY, bool useMask = false, wxCoord xsrcMask = wxDefaultCoord, wxCoord ysrcMask = wxDefaultCoord); diff --git a/interface/wx/dcsvg.h b/interface/wx/dcsvg.h index 73b699d67d..110bcd1d17 100644 --- a/interface/wx/dcsvg.h +++ b/interface/wx/dcsvg.h @@ -56,7 +56,7 @@ public: @see wxDC::Blit() */ bool Blit(wxCoord xdest, wxCoord ydest, wxCoord width, wxCoord height, - wxDC* source, wxCoord xsrc, wxCoord ysrc, int rop = wxCOPY, + wxDC* source, wxCoord xsrc, wxCoord ysrc, wxRasterOperationMode rop = wxCOPY, bool useMask = false, wxCoord xsrcMask = wxDefaultCoord, wxCoord ysrcMask = wxDefaultCoord); @@ -230,9 +230,11 @@ public: The programmer is responsible for deleting the list of points. */ void DrawPolygon(int n, wxPoint points[], wxCoord xoffset = 0, - wxCoord yoffset = 0, int fill_style = wxODDEVEN_RULE); + wxCoord yoffset = 0, + wxPolygonFillMode fill_style = wxODDEVEN_RULE); void DrawPolygon(wxList* points, wxCoord xoffset = 0, - wxCoord yoffset = 0, int fill_style = wxODDEVEN_RULE); + wxCoord yoffset = 0, + wxPolygonFillMode fill_style = wxODDEVEN_RULE); //@} /** @@ -310,7 +312,7 @@ public: Not implemented. */ bool FloodFill(wxCoord x, wxCoord y, const wxColour& colour, - int style = wxFLOOD_SURFACE); + wxFloodFillStyle style = wxFLOOD_SURFACE); //@{ /** @@ -369,7 +371,7 @@ public: @see SetLogicalFunction() */ - int GetLogicalFunction() const; + wxRasterOperationMode GetLogicalFunction() const; /** Gets the mapping mode for the device context. @@ -576,9 +578,9 @@ public: /** Does the same as wxDC::SetLogicalFunction(), except that only wxCOPY is - avalaible. Trying to set one of the othe values will fail. + available. Trying to set one of the other values will fail. */ - void SetLogicalFunction(int function); + void SetLogicalFunction(wxRasterOperationMode function); /** The mapping mode of the device context defines the unit of measurement diff --git a/samples/drawing/drawing.cpp b/samples/drawing/drawing.cpp index 3942776124..9b288944fb 100644 --- a/samples/drawing/drawing.cpp +++ b/samples/drawing/drawing.cpp @@ -111,7 +111,7 @@ public: int m_backgroundMode; int m_textureBackground; - int m_mapMode; + wxMappingMode m_mapMode; double m_xUserScale; double m_yUserScale; int m_xLogicalOrigin; @@ -802,7 +802,7 @@ void MyCanvas::DrawText(wxDC& dc) static const struct { const wxChar *name; - int rop; + wxRasterOperationMode rop; } rasterOperations[] = { { wxT("wxAND"), wxAND }, diff --git a/src/cocoa/dc.mm b/src/cocoa/dc.mm index cd4cc76174..db8e22406b 100644 --- a/src/cocoa/dc.mm +++ b/src/cocoa/dc.mm @@ -362,7 +362,7 @@ void wxCocoaDCImpl::DoDrawPoint( int x, int y ) { }; -void wxCocoaDCImpl::DoDrawPolygon( int, wxPoint *, int, int, int) +void wxCocoaDCImpl::DoDrawPolygon( int, wxPoint *, int, int, wxPolygonFillMode) { }; @@ -499,7 +499,7 @@ void wxCocoaDCImpl::DoDrawBitmap(const wxBitmap &bmp, wxCoord x, wxCoord y, bool [context restoreGraphicsState]; } -bool wxCocoaDCImpl::DoFloodFill(wxCoord x, wxCoord y, const wxColour& col, int style) +bool wxCocoaDCImpl::DoFloodFill(wxCoord x, wxCoord y, const wxColour& col, wxFloodFillStyle style) { return false; } @@ -509,7 +509,7 @@ void wxCocoaDCImpl::DoCrossHair(wxCoord x, wxCoord y) } -bool wxCocoaDCImpl::DoBlit(wxCoord xdest, wxCoord ydest, wxCoord width, wxCoord height, wxDC *source, wxCoord xsrc, wxCoord ysrc, int rop, bool useMask , wxCoord xsrcMask, wxCoord ysrcMask) +bool wxCocoaDCImpl::DoBlit(wxCoord xdest, wxCoord ydest, wxCoord width, wxCoord height, wxDC *source, wxCoord xsrc, wxCoord ysrc, wxRasterOperationMode rop, bool useMask , wxCoord xsrcMask, wxCoord ysrcMask) { if(!CocoaTakeFocus()) return false; if(!source) return false; @@ -579,12 +579,12 @@ void wxCocoaDCImpl::SetPalette(const wxPalette&) { } -void wxCocoaDCImpl::SetLogicalFunction(int) +void wxCocoaDCImpl::SetLogicalFunction(wxRasterOperationMode) { } -void wxCocoaDCImpl::SetMapMode( int mode ) +void wxCocoaDCImpl::SetMapMode( wxMappingMode mode ) { switch (mode) { diff --git a/src/common/dcbase.cpp b/src/common/dcbase.cpp index a60da2e657..224cf624a1 100644 --- a/src/common/dcbase.cpp +++ b/src/common/dcbase.cpp @@ -413,7 +413,7 @@ void wxDCImpl::ComputeScaleAndOrigin() m_scaleY = m_logicalScaleY * m_userScaleY; } -void wxDCImpl::SetMapMode( int mode ) +void wxDCImpl::SetMapMode( wxMappingMode mode ) { switch (mode) { @@ -650,7 +650,7 @@ wxDCImpl::DoStretchBlit(wxCoord xdest, wxCoord ydest, wxDC *source, wxCoord xsrc, wxCoord ysrc, wxCoord srcWidth, wxCoord srcHeight, - int rop, + wxRasterOperationMode rop, bool useMask, wxCoord xsrcMask, wxCoord ysrcMask) @@ -696,7 +696,7 @@ void wxDCImpl::DrawLines(const wxPointList *list, wxCoord xoffset, wxCoord yoffs void wxDCImpl::DrawPolygon(const wxPointList *list, wxCoord xoffset, wxCoord yoffset, - int fillStyle) + wxPolygonFillMode fillStyle) { int n = list->GetCount(); wxPoint *points = new wxPoint[n]; @@ -719,7 +719,7 @@ wxDCImpl::DoDrawPolyPolygon(int n, int count[], wxPoint points[], wxCoord xoffset, wxCoord yoffset, - int fillStyle) + wxPolygonFillMode fillStyle) { if ( n == 1 ) { diff --git a/src/common/dcgraph.cpp b/src/common/dcgraph.cpp index 2b9eb8c97a..4a713993a8 100644 --- a/src/common/dcgraph.cpp +++ b/src/common/dcgraph.cpp @@ -336,7 +336,7 @@ void wxGCDCImpl::SetTextBackground( const wxColour &col ) m_textBackgroundColour = col; } -void wxGCDCImpl::SetMapMode( int mode ) +void wxGCDCImpl::SetMapMode( wxMappingMode mode ) { switch (mode) { @@ -450,7 +450,7 @@ void wxGCDCImpl::SetBackground( const wxBrush &brush ) return; } -void wxGCDCImpl::SetLogicalFunction( int function ) +void wxGCDCImpl::SetLogicalFunction( wxRasterOperationMode function ) { if (m_logicalFunction == function) return; @@ -463,7 +463,8 @@ void wxGCDCImpl::SetLogicalFunction( int function ) } bool wxGCDCImpl::DoFloodFill(wxCoord WXUNUSED(x), wxCoord WXUNUSED(y), - const wxColour& WXUNUSED(col), int WXUNUSED(style)) + const wxColour& WXUNUSED(col), + wxFloodFillStyle WXUNUSED(style)) { return false; } @@ -674,8 +675,8 @@ void wxGCDCImpl::DoDrawSpline(const wxPointList *points) #endif // wxUSE_SPLINES void wxGCDCImpl::DoDrawPolygon( int n, wxPoint points[], - wxCoord xoffset, wxCoord yoffset, - int fillStyle ) + wxCoord xoffset, wxCoord yoffset, + wxPolygonFillMode fillStyle ) { wxCHECK_RET( IsOk(), wxT("wxGCDC(cg)::DoDrawPolygon - invalid DC") ); @@ -706,7 +707,7 @@ void wxGCDCImpl::DoDrawPolyPolygon(int n, wxPoint points[], wxCoord xoffset, wxCoord yoffset, - int fillStyle) + wxPolygonFillMode fillStyle) { wxASSERT(n > 1); wxGraphicsPath path = m_graphicContext->CreatePath(); @@ -801,7 +802,8 @@ bool wxGCDCImpl::CanDrawBitmap() const bool wxGCDCImpl::DoBlit( wxCoord xdest, wxCoord ydest, wxCoord width, wxCoord height, - wxDC *source, wxCoord xsrc, wxCoord ysrc, int logical_func , bool useMask, + wxDC *source, wxCoord xsrc, wxCoord ysrc, + wxRasterOperationMode logical_func , bool useMask, wxCoord xsrcMask, wxCoord ysrcMask ) { return DoStretchBlit( xdest, ydest, width, height, @@ -812,7 +814,7 @@ bool wxGCDCImpl::DoBlit( bool wxGCDCImpl::DoStretchBlit( wxCoord xdest, wxCoord ydest, wxCoord dstWidth, wxCoord dstHeight, wxDC *source, wxCoord xsrc, wxCoord ysrc, wxCoord srcWidth, wxCoord srcHeight, - int logical_func , bool useMask, + wxRasterOperationMode logical_func , bool useMask, wxCoord xsrcMask, wxCoord ysrcMask ) { wxCHECK_MSG( IsOk(), false, wxT("wxGCDC(cg)::DoStretchBlit - invalid DC") ); diff --git a/src/common/dcsvg.cpp b/src/common/dcsvg.cpp index 7397e43725..6bec55d34f 100644 --- a/src/common/dcsvg.cpp +++ b/src/common/dcsvg.cpp @@ -289,7 +289,9 @@ void wxSVGFileDCImpl::DoDrawRoundedRectangle(wxCoord x, wxCoord y, wxCoord width CalcBoundingBox(x + width, y + height); } -void wxSVGFileDCImpl::DoDrawPolygon(int n, wxPoint points[], wxCoord xoffset, wxCoord yoffset,int fillStyle) +void wxSVGFileDCImpl::DoDrawPolygon(int n, wxPoint points[], + wxCoord xoffset, wxCoord yoffset, + wxPolygonFillMode fillStyle) { if (m_graphics_changed) NewGraphics (); wxString s, sTmp; @@ -589,7 +591,7 @@ void wxSVGFileDCImpl::SetFont(const wxFont& font) // export a bitmap as a raster image in png bool wxSVGFileDCImpl::DoBlit(wxCoord xdest, wxCoord ydest, wxCoord width, wxCoord height, wxDC* source, wxCoord xsrc, wxCoord ysrc, - int logicalFunc /*= wxCOPY*/, bool useMask /*= false*/, + wxRasterOperationMode logicalFunc /*= wxCOPY*/, bool useMask /*= false*/, wxCoord /*xsrcMask = -1*/, wxCoord /*ysrcMask = -1*/) { if (logicalFunc != wxCOPY) diff --git a/src/common/graphcmn.cpp b/src/common/graphcmn.cpp index f48a1be3dc..590e4a0586 100644 --- a/src/common/graphcmn.cpp +++ b/src/common/graphcmn.cpp @@ -589,7 +589,7 @@ void wxGraphicsContext::SetFont( const wxGraphicsFont& font ) m_font = font; } -bool wxGraphicsContext::SetLogicalFunction( int function ) +bool wxGraphicsContext::SetLogicalFunction( wxRasterOperationMode function ) { if ( function == wxCOPY ) { diff --git a/src/common/imagfill.cpp b/src/common/imagfill.cpp index efe4df5961..fa4992fe6b 100644 --- a/src/common/imagfill.cpp +++ b/src/common/imagfill.cpp @@ -274,7 +274,7 @@ wxImageFloodFill(wxImage *image, bool wxDoFloodFill(wxDC *dc, wxCoord x, wxCoord y, - const wxColour& col, int style) + const wxColour& col, wxFloodFillStyle style) { if (dc->GetBrush().GetStyle() == wxBRUSHSTYLE_TRANSPARENT) return true; diff --git a/src/dfb/dc.cpp b/src/dfb/dc.cpp index aecb71fa44..02bc3d22fa 100644 --- a/src/dfb/dc.cpp +++ b/src/dfb/dc.cpp @@ -148,10 +148,10 @@ void wxDFBDCImpl::Clear() } extern bool wxDoFloodFill(wxDC *dc, wxCoord x, wxCoord y, - const wxColour & col, int style); + const wxColour & col, wxFloodFillStyle style); bool wxDFBDCImpl::DoFloodFill(wxCoord x, wxCoord y, - const wxColour& col, int style) + const wxColour& col, wxFloodFillStyle style) { return wxDoFloodFill(GetOwner(), x, y, col, style); } @@ -241,7 +241,7 @@ void wxDFBDCImpl::DoDrawPoint(wxCoord x, wxCoord y) void wxDFBDCImpl::DoDrawPolygon(int WXUNUSED(n), wxPoint WXUNUSED(points)[], wxCoord WXUNUSED(xoffset), wxCoord WXUNUSED(yoffset), - int WXUNUSED(fillStyle)) + wxPolygonFillMode WXUNUSED(fillStyle)) { wxCHECK_RET( IsOk(), wxT("invalid dc") ); @@ -441,7 +441,7 @@ void wxDFBDCImpl::SetBackgroundMode(int mode) m_backgroundMode = mode; } -void wxDFBDCImpl::SetLogicalFunction(int function) +void wxDFBDCImpl::SetLogicalFunction(wxRasterOperationMode function) { wxCHECK_RET( IsOk(), wxT("invalid dc") ); @@ -583,7 +583,7 @@ wxSize wxDFBDCImpl::GetPPI() const bool wxDFBDCImpl::DoBlit(wxCoord xdest, wxCoord ydest, wxCoord width, wxCoord height, wxDC *source, wxCoord xsrc, wxCoord ysrc, - int rop, bool useMask, + wxRasterOperationMode rop, bool useMask, wxCoord xsrcMask, wxCoord ysrcMask) { wxCHECK_MSG( IsOk(), false, "invalid dc" ); diff --git a/src/generic/dcpsg.cpp b/src/generic/dcpsg.cpp index 12a7b26449..5b04755247 100644 --- a/src/generic/dcpsg.cpp +++ b/src/generic/dcpsg.cpp @@ -406,7 +406,7 @@ void wxPostScriptDCImpl::Clear() // wxFAIL_MSG( wxT("wxPostScriptDCImpl::Clear not implemented.") ); } -bool wxPostScriptDCImpl::DoFloodFill (wxCoord WXUNUSED(x), wxCoord WXUNUSED(y), const wxColour &WXUNUSED(col), int WXUNUSED(style)) +bool wxPostScriptDCImpl::DoFloodFill (wxCoord WXUNUSED(x), wxCoord WXUNUSED(y), const wxColour &WXUNUSED(col), wxFloodFillStyle WXUNUSED(style)) { wxFAIL_MSG( wxT("wxPostScriptDCImpl::FloodFill not implemented.") ); return false; @@ -598,7 +598,7 @@ void wxPostScriptDCImpl::DoDrawPoint (wxCoord x, wxCoord y) CalcBoundingBox( x, y ); } -void wxPostScriptDCImpl::DoDrawPolygon (int n, wxPoint points[], wxCoord xoffset, wxCoord yoffset, int fillStyle) +void wxPostScriptDCImpl::DoDrawPolygon (int n, wxPoint points[], wxCoord xoffset, wxCoord yoffset, wxPolygonFillMode fillStyle) { wxCHECK_RET( m_ok, wxT("invalid postscript dc") ); @@ -668,7 +668,7 @@ void wxPostScriptDCImpl::DoDrawPolygon (int n, wxPoint points[], wxCoord xoffset } } -void wxPostScriptDCImpl::DoDrawPolyPolygon (int n, int count[], wxPoint points[], wxCoord xoffset, wxCoord yoffset, int fillStyle) +void wxPostScriptDCImpl::DoDrawPolyPolygon (int n, int count[], wxPoint points[], wxCoord xoffset, wxCoord yoffset, wxPolygonFillMode fillStyle) { wxCHECK_RET( m_ok, wxT("invalid postscript dc") ); @@ -1507,7 +1507,7 @@ void wxPostScriptDCImpl::SetBackground (const wxBrush& brush) m_backgroundBrush = brush; } -void wxPostScriptDCImpl::SetLogicalFunction (int WXUNUSED(function)) +void wxPostScriptDCImpl::SetLogicalFunction(wxRasterOperationMode WXUNUSED(function)) { wxFAIL_MSG( wxT("wxPostScriptDCImpl::SetLogicalFunction not implemented.") ); } @@ -1935,7 +1935,8 @@ bool wxPostScriptDCImpl::DoBlit( wxCoord xdest, wxCoord ydest, wxCoord fwidth, wxCoord fheight, wxDC *source, wxCoord xsrc, wxCoord ysrc, - int rop, bool WXUNUSED(useMask), wxCoord WXUNUSED(xsrcMask), wxCoord WXUNUSED(ysrcMask) ) + wxRasterOperationMode rop, + bool WXUNUSED(useMask), wxCoord WXUNUSED(xsrcMask), wxCoord WXUNUSED(ysrcMask) ) { wxCHECK_MSG( m_ok, false, wxT("invalid postscript dc") ); diff --git a/src/generic/graphicc.cpp b/src/generic/graphicc.cpp index 6780545914..92843942d5 100644 --- a/src/generic/graphicc.cpp +++ b/src/generic/graphicc.cpp @@ -345,7 +345,7 @@ public: virtual void * GetNativeContext(); - virtual bool SetLogicalFunction( int function ); + virtual bool SetLogicalFunction( wxRasterOperationMode function ); virtual void StrokePath( const wxGraphicsPath& p ); virtual void FillPath( const wxGraphicsPath& p , int fillStyle = wxWINDING_RULE ); @@ -532,7 +532,7 @@ wxCairoPenData::wxCairoPenData( wxGraphicsRenderer* renderer, const wxPen &pen ) } break; default : - if ( m_pen.GetStyle() >= wxPENSTYLE_FIRST_HATCH + if ( m_pen.GetStyle() >= wxPENSTYLE_FIRST_HATCH && m_pen.GetStyle() <= wxPENSTYLE_LAST_HATCH ) { /* @@ -1525,7 +1525,7 @@ void * wxCairoContext::GetNativeContext() // Cairo doesn't support bitwise logical function (a.k.a. ROP, raster output // mode). Cairo supports Porter-Duff compositing operators, but they are quite // different, although in some cases have similar names. -bool wxCairoContext::SetLogicalFunction( int function ) +bool wxCairoContext::SetLogicalFunction( wxRasterOperationMode function ) { if (m_logicalFunction == function) return true; diff --git a/src/gtk/dcclient.cpp b/src/gtk/dcclient.cpp index 943b9b3b02..71c77849b5 100644 --- a/src/gtk/dcclient.cpp +++ b/src/gtk/dcclient.cpp @@ -309,7 +309,7 @@ wxWindowDCImpl::wxWindowDCImpl( wxDC *owner, wxWindow *window ) : m_window = window; - if (m_window && m_window->m_wxwindow && + if (m_window && m_window->m_wxwindow && (m_window->GetLayoutDirection() == wxLayout_RightToLeft)) { // reverse sense @@ -351,7 +351,7 @@ void wxWindowDCImpl::SetUpDC( bool isMemDC ) } if (!done) - { + { if (m_isScreenDC) { m_penGC = wxGetPoolGC( m_gdkwindow, wxPEN_SCREEN ); @@ -424,11 +424,11 @@ void wxWindowDCImpl::DoGetSize( int* width, int* height ) const } bool wxWindowDCImpl::DoFloodFill(wxCoord x, wxCoord y, - const wxColour& col, int style) + const wxColour& col, wxFloodFillStyle style) { #if wxUSE_IMAGE extern bool wxDoFloodFill(wxDC *dc, wxCoord x, wxCoord y, - const wxColour & col, int style); + const wxColour & col, wxFloodFillStyle style); return wxDoFloodFill( GetOwner(), x, y, col, style); #else @@ -475,7 +475,7 @@ bool wxWindowDCImpl::DoGetPixel( wxCoord x1, wxCoord y1, wxColour *col ) const void wxWindowDCImpl::DoDrawLine( wxCoord x1, wxCoord y1, wxCoord x2, wxCoord y2 ) { wxCHECK_RET( IsOk(), wxT("invalid window dc") ); - + if (m_pen.GetStyle() != wxPENSTYLE_TRANSPARENT) { if (m_gdkwindow) @@ -698,7 +698,9 @@ void wxWindowDCImpl::DoDrawLines( int n, wxPoint points[], wxCoord xoffset, wxCo delete[] gpts; } -void wxWindowDCImpl::DoDrawPolygon( int n, wxPoint points[], wxCoord xoffset, wxCoord yoffset, int WXUNUSED(fillStyle) ) +void wxWindowDCImpl::DoDrawPolygon( int n, wxPoint points[], + wxCoord xoffset, wxCoord yoffset, + wxPolygonFillMode WXUNUSED(fillStyle) ) { wxCHECK_RET( IsOk(), wxT("invalid window dc") ); @@ -1158,7 +1160,7 @@ bool wxWindowDCImpl::DoBlit( wxCoord xdest, wxCoord ydest, wxCoord width, wxCoord height, wxDC *source, wxCoord xsrc, wxCoord ysrc, - int logical_func, + wxRasterOperationMode logical_func, bool useMask, wxCoord xsrcMask, wxCoord ysrcMask ) { @@ -1299,7 +1301,7 @@ bool wxWindowDCImpl::DoBlit( wxCoord xdest, wxCoord ydest, src_y = 0; } - const int logical_func_save = m_logicalFunction; + const wxRasterOperationMode logical_func_save = m_logicalFunction; SetLogicalFunction(logical_func); if (memDC == NULL) gdk_gc_set_subwindow(use_gc, GDK_INCLUDE_INFERIORS); @@ -1437,9 +1439,9 @@ void wxWindowDCImpl::DoDrawText( const wxString &text, wxCoord x, wxCoord y ) x_rtl -= w; const GdkColor* bg_col = NULL; - if (m_backgroundMode == wxBRUSHSTYLE_SOLID) + if (m_backgroundMode == wxBRUSHSTYLE_SOLID) bg_col = m_textBackgroundColour.GetColor(); - + gdk_draw_layout_with_colors(m_gdkwindow, m_textGC, x_rtl, y, m_layout, NULL, bg_col); if (isScaled) @@ -1460,7 +1462,7 @@ void wxWindowDCImpl::DoDrawText( const wxString &text, wxCoord x, wxCoord y ) CalcBoundingBox(x, y); } -// TODO: When GTK2.6 is required, merge DoDrawText and DoDrawRotatedText to +// TODO: When GTK2.6 is required, merge DoDrawText and DoDrawRotatedText to // avoid code duplication void wxWindowDCImpl::DoDrawRotatedText( const wxString &text, wxCoord x, wxCoord y, double angle ) { @@ -1506,7 +1508,7 @@ void wxWindowDCImpl::DoDrawRotatedText( const wxString &text, wxCoord x, wxCoord pango_layout_get_pixel_size(m_layout, &w, &h); const GdkColor* bg_col = NULL; - if (m_backgroundMode == wxBRUSHSTYLE_SOLID) + if (m_backgroundMode == wxBRUSHSTYLE_SOLID) bg_col = m_textBackgroundColour.GetColor(); // rotate the text @@ -1515,13 +1517,13 @@ void wxWindowDCImpl::DoDrawRotatedText( const wxString &text, wxCoord x, wxCoord pango_context_set_matrix (m_context, &matrix); pango_layout_context_changed (m_layout); - // To be compatible with MSW, the rotation axis must be in the old + // To be compatible with MSW, the rotation axis must be in the old // top-left corner. - // Calculate the vertices of the rotated rectangle containing the text, + // Calculate the vertices of the rotated rectangle containing the text, // relative to the old top-left vertex. - // We could use the matrix for this, but it's simpler with trignonometry. + // We could use the matrix for this, but it's simpler with trignonometry. double rad = DegToRad(angle); - // the rectangle vertices are counted clockwise with the first one + // the rectangle vertices are counted clockwise with the first one // being at (0, 0) double x2 = w * cos(rad); double y2 = -w * sin(rad); // y axis points to the bottom, hence minus @@ -1535,7 +1537,7 @@ void wxWindowDCImpl::DoDrawRotatedText( const wxString &text, wxCoord x, wxCoord minX = (wxCoord)(dmin(dmin(0, x2), dmin(x3, x4)) - 0.5), minY = (wxCoord)(dmin(dmin(0, y2), dmin(y3, y4)) - 0.5); - gdk_draw_layout_with_colors(m_gdkwindow, m_textGC, x+minX, y+minY, + gdk_draw_layout_with_colors(m_gdkwindow, m_textGC, x+minX, y+minY, m_layout, NULL, bg_col); if (m_font.GetUnderlined()) @@ -2048,7 +2050,7 @@ void wxWindowDCImpl::SetBackground( const wxBrush &brush ) } } -void wxWindowDCImpl::SetLogicalFunction( int function ) +void wxWindowDCImpl::SetLogicalFunction( wxRasterOperationMode function ) { wxCHECK_RET( IsOk(), wxT("invalid window dc") ); @@ -2078,9 +2080,6 @@ void wxWindowDCImpl::SetLogicalFunction( int function ) case wxNO_OP: mode = GDK_NOOP; break; case wxSRC_INVERT: mode = GDK_COPY_INVERT; break; case wxNOR: mode = GDK_NOR; break; - default: - wxFAIL_MSG( wxT("unsupported logical function") ); - mode = GDK_COPY; } m_logicalFunction = function; @@ -2154,7 +2153,7 @@ void wxWindowDCImpl::DoSetClippingRegion( wxCoord x, wxCoord y, wxCoord width, w rect.width = XLOG2DEVREL(width); rect.height = YLOG2DEVREL(height); - if (m_window && m_window->m_wxwindow && + if (m_window && m_window->m_wxwindow && (m_window->GetLayoutDirection() == wxLayout_RightToLeft)) { rect.x -= rect.width; @@ -2246,7 +2245,7 @@ void wxWindowDCImpl::SetAxisOrientation( bool xLeftRight, bool yBottomUp ) m_signX = (xLeftRight ? 1 : -1); m_signY = (yBottomUp ? -1 : 1); - if (m_window && m_window->m_wxwindow && + if (m_window && m_window->m_wxwindow && (m_window->GetLayoutDirection() == wxLayout_RightToLeft)) m_signX = -m_signX; @@ -2303,7 +2302,7 @@ wxClientDCImpl::wxClientDCImpl( wxDC *owner, wxWindow *win ) SetDeviceOrigin(ptOrigin.x, ptOrigin.y); wxSize size = win->GetClientSize(); DoSetClippingRegion(0, 0, size.x, size.y); -#endif +#endif // __WXUNIVERSAL__ } @@ -2369,7 +2368,7 @@ wxPaintDCImpl::wxPaintDCImpl( wxDC *owner, wxWindow *win ) gdk_gc_set_clip_region( m_textGC, region ); gdk_gc_set_clip_region( m_bgGC, region ); } -#endif +#endif } // ---------------------------------------------------------------------------- diff --git a/src/gtk/gnome/gprint.cpp b/src/gtk/gnome/gprint.cpp index 737bfc374b..3823149cad 100644 --- a/src/gtk/gnome/gprint.cpp +++ b/src/gtk/gnome/gprint.cpp @@ -1050,7 +1050,7 @@ bool wxGnomePrinterDCImpl::DoFloodFill(wxCoord WXUNUSED(x1), wxCoord WXUNUSED(y1), const wxColour& WXUNUSED(col), - int WXUNUSED(style)) + wxFloodFillStyle WXUNUSED(style)) { return false; } @@ -1208,7 +1208,7 @@ void wxGnomePrinterDCImpl::DoDrawLines(int n, wxPoint points[], wxCoord xoffset, void wxGnomePrinterDCImpl::DoDrawPolygon(int n, wxPoint points[], wxCoord xoffset, wxCoord yoffset, - int WXUNUSED(fillStyle)) + wxPolygonFillMode WXUNUSED(fillStyle)) { if (n==0) return; @@ -1254,7 +1254,7 @@ void wxGnomePrinterDCImpl::DoDrawPolygon(int n, wxPoint points[], } } -void wxGnomePrinterDCImpl::DoDrawPolyPolygon(int n, int count[], wxPoint points[], wxCoord xoffset, wxCoord yoffset, int fillStyle) +void wxGnomePrinterDCImpl::DoDrawPolyPolygon(int n, int count[], wxPoint points[], wxCoord xoffset, wxCoord yoffset, wxPolygonFillMode fillStyle) { #if wxUSE_NEW_DC wxDCImpl::DoDrawPolyPolygon( n, count, points, xoffset, yoffset, fillStyle ); @@ -1508,7 +1508,7 @@ wxGnomePrinterDCImpl::DoBlit(wxCoord xdest, wxCoord ydest, wxCoord width, wxCoord height, wxDC *source, wxCoord xsrc, wxCoord ysrc, - int rop, + wxRasterOperationMode rop, bool WXUNUSED(useMask), wxCoord WXUNUSED(xsrcMask), wxCoord WXUNUSED(ysrcMask)) { @@ -1802,7 +1802,7 @@ void wxGnomePrinterDCImpl::SetBrush( const wxBrush& brush ) } } -void wxGnomePrinterDCImpl::SetLogicalFunction(int WXUNUSED(function)) +void wxGnomePrinterDCImpl::SetLogicalFunction(wxRasterOperationMode WXUNUSED(function)) { } diff --git a/src/gtk/print.cpp b/src/gtk/print.cpp index 615e986dc5..4c77554f19 100644 --- a/src/gtk/print.cpp +++ b/src/gtk/print.cpp @@ -1173,7 +1173,7 @@ void* wxGtkPrinterDCImpl::GetCairoContext() const bool wxGtkPrinterDCImpl::DoFloodFill(wxCoord WXUNUSED(x1), wxCoord WXUNUSED(y1), const wxColour& WXUNUSED(col), - int WXUNUSED(style)) + wxFloodFillStyle WXUNUSED(style)) { // We can't access the given coord as a Cairo context is scalable, ie a // coord doesn't mean anything in this context. @@ -1427,7 +1427,9 @@ void wxGtkPrinterDCImpl::DoDrawLines(int n, wxPoint points[], wxCoord xoffset, w cairo_stroke ( m_cairo); } -void wxGtkPrinterDCImpl::DoDrawPolygon(int n, wxPoint points[], wxCoord xoffset, wxCoord yoffset, int fillStyle) +void wxGtkPrinterDCImpl::DoDrawPolygon(int n, wxPoint points[], + wxCoord xoffset, wxCoord yoffset, + wxPolygonFillMode fillStyle) { if (n==0) return; @@ -1461,7 +1463,9 @@ void wxGtkPrinterDCImpl::DoDrawPolygon(int n, wxPoint points[], wxCoord xoffset, cairo_restore(m_cairo); } -void wxGtkPrinterDCImpl::DoDrawPolyPolygon(int n, int count[], wxPoint points[], wxCoord xoffset, wxCoord yoffset, int fillStyle) +void wxGtkPrinterDCImpl::DoDrawPolyPolygon(int n, int count[], wxPoint points[], + wxCoord xoffset, wxCoord yoffset, + wxPolygonFillMode fillStyle) { wxDCImpl::DoDrawPolyPolygon( n, count, points, xoffset, yoffset, fillStyle ); } @@ -1620,7 +1624,7 @@ void wxGtkPrinterDCImpl::DoDrawSpline(const wxPointList *points) bool wxGtkPrinterDCImpl::DoBlit(wxCoord xdest, wxCoord ydest, wxCoord width, wxCoord height, wxDC *source, wxCoord xsrc, wxCoord ysrc, - int rop, bool useMask, + wxRasterOperationMode rop, bool useMask, wxCoord WXUNUSED_UNLESS_DEBUG(xsrcMask), wxCoord WXUNUSED_UNLESS_DEBUG(ysrcMask)) { @@ -1987,7 +1991,7 @@ void wxGtkPrinterDCImpl::SetBrush( const wxBrush& brush ) } } -void wxGtkPrinterDCImpl::SetLogicalFunction( int function ) +void wxGtkPrinterDCImpl::SetLogicalFunction( wxRasterOperationMode function ) { if (function == wxCLEAR) cairo_set_operator (m_cairo, CAIRO_OPERATOR_CLEAR); diff --git a/src/gtk/region.cpp b/src/gtk/region.cpp index a18c324df8..a4f3617046 100644 --- a/src/gtk/region.cpp +++ b/src/gtk/region.cpp @@ -90,7 +90,8 @@ wxRegion::wxRegion( GdkRegion *region ) M_REGIONDATA->m_region = gdk_region_copy( region ); } -wxRegion::wxRegion( size_t n, const wxPoint *points, int fillStyle ) +wxRegion::wxRegion( size_t n, const wxPoint *points, + wxPolygonFillMode fillStyle ) { GdkPoint *gdkpoints = new GdkPoint[n]; for ( size_t i = 0 ; i < n ; i++ ) diff --git a/src/gtk1/dcclient.cpp b/src/gtk1/dcclient.cpp index d3770fda9b..d53399562b 100644 --- a/src/gtk1/dcclient.cpp +++ b/src/gtk1/dcclient.cpp @@ -429,10 +429,10 @@ void wxWindowDCImpl::DoGetSize( int* width, int* height ) const } extern bool wxDoFloodFill(wxDC *dc, wxCoord x, wxCoord y, - const wxColour & col, int style); + const wxColour & col, wxFloodFillStyle style); bool wxWindowDCImpl::DoFloodFill(wxCoord x, wxCoord y, - const wxColour& col, int style) + const wxColour& col, wxFloodFillStyle style) { return wxDoFloodFill(GetOwner(), x, y, col, style); } @@ -680,7 +680,7 @@ void wxWindowDCImpl::DoDrawLines( int n, wxPoint points[], wxCoord xoffset, wxCo delete[] gpts; } -void wxWindowDCImpl::DoDrawPolygon( int n, wxPoint points[], wxCoord xoffset, wxCoord yoffset, int WXUNUSED(fillStyle) ) +void wxWindowDCImpl::DoDrawPolygon( int n, wxPoint points[], wxCoord xoffset, wxCoord yoffset, wxPolygonFillMode WXUNUSED(fillStyle) ) { wxCHECK_RET( IsOk(), wxT("invalid window dc") ); @@ -1129,7 +1129,7 @@ bool wxWindowDCImpl::DoBlit( wxCoord xdest, wxCoord ydest, wxCoord width, wxCoord height, wxDC *source, wxCoord xsrc, wxCoord ysrc, - int logical_func, + wxRasterOperationMode logical_func, bool useMask, wxCoord xsrcMask, wxCoord ysrcMask ) { @@ -1882,7 +1882,7 @@ void wxWindowDCImpl::SetBackground( const wxBrush &brush ) } } -void wxWindowDCImpl::SetLogicalFunction( int function ) +void wxWindowDCImpl::SetLogicalFunction( wxRasterOperationMode function ) { wxCHECK_RET( IsOk(), wxT("invalid window dc") ); diff --git a/src/mgl/dc.cpp b/src/mgl/dc.cpp index 81a69d8c58..7e78af7887 100644 --- a/src/mgl/dc.cpp +++ b/src/mgl/dc.cpp @@ -319,10 +319,10 @@ void wxDC::Clear() } extern bool wxDoFloodFill(wxDC *dc, wxCoord x, wxCoord y, - const wxColour & col, int style); + const wxColour & col, wxFloodFillStyle style); bool wxDC::DoFloodFill(wxCoord x, wxCoord y, - const wxColour& col, int style) + const wxColour& col, wxFloodFillStyle style) { return wxDoFloodFill(this, x, y, col, style); } @@ -452,7 +452,7 @@ void wxDC::DoDrawPoint(wxCoord x, wxCoord y) } } -void wxDC::DoDrawPolygon(int n, wxPoint points[], wxCoord xoffset, wxCoord yoffset,int WXUNUSED(fillStyle)) +void wxDC::DoDrawPolygon(int n, wxPoint points[], wxCoord xoffset, wxCoord yoffset,wxPolygonFillMode WXUNUSED(fillStyle)) { wxCHECK_RET( Ok(), wxT("invalid dc") ); @@ -1141,7 +1141,7 @@ void wxDC::SetBackgroundMode(int mode) m_MGLDC->setBackMode(MGL_TRANSPARENT_BACKGROUND); } -void wxDC::SetLogicalFunction(int function) +void wxDC::SetLogicalFunction(wxRasterOperationMode function) { wxCHECK_RET( Ok(), wxT("invalid dc") ); @@ -1298,7 +1298,7 @@ wxSize wxDC::GetPPI() const bool wxDC::DoBlit(wxCoord xdest, wxCoord ydest, wxCoord width, wxCoord height, wxDC *source, wxCoord xsrc, wxCoord ysrc, - int rop, bool useMask, + wxRasterOperationMode rop, bool useMask, wxCoord xsrcMask, wxCoord ysrcMask) { wxCHECK_MSG( Ok(), false, wxT("invalid dc") ); diff --git a/src/motif/dcclient.cpp b/src/motif/dcclient.cpp index a04811cc5c..812b108d80 100644 --- a/src/motif/dcclient.cpp +++ b/src/motif/dcclient.cpp @@ -222,10 +222,10 @@ wxWindowDCImpl::~wxWindowDCImpl() } extern bool wxDoFloodFill(wxDC *dc, wxCoord x, wxCoord y, - const wxColour & col, int style); + const wxColour & col, wxFloodFillStyle style); bool wxWindowDCImpl::DoFloodFill(wxCoord x, wxCoord y, - const wxColour& col, int style) + const wxColour& col, wxFloodFillStyle style) { return wxDoFloodFill(GetOwner(), x, y, col, style); } @@ -471,7 +471,7 @@ void wxWindowDCImpl::DoDrawLines( int n, wxPoint points[], wxCoord xoffset, wxCo } void wxWindowDCImpl::DoDrawPolygon( int n, wxPoint points[], - wxCoord xoffset, wxCoord yoffset, int fillStyle ) + wxCoord xoffset, wxCoord yoffset, wxPolygonFillMode fillStyle ) { wxCHECK_RET( IsOk(), "invalid dc" ); @@ -790,7 +790,7 @@ bool wxWindowDCImpl::CanDrawBitmap() const bool wxWindowDCImpl::DoBlit( wxCoord xdest, wxCoord ydest, wxCoord width, wxCoord height, wxDC *source, wxCoord xsrc, wxCoord ysrc, - int rop, bool useMask, + wxRasterOperationMode rop, bool useMask, wxCoord xsrcMask, wxCoord ysrcMask ) { wxCHECK_MSG( IsOk(), false, "invalid dc" ); @@ -1930,7 +1930,7 @@ void wxWindowDCImpl::SetBackground( const wxBrush &brush ) m_backgroundPixel); } -void wxWindowDCImpl::SetLogicalFunction( int function ) +void wxWindowDCImpl::SetLogicalFunction( wxRasterOperationMode function ) { wxCHECK_RET( IsOk(), "invalid dc" ); diff --git a/src/msw/dc.cpp b/src/msw/dc.cpp index d878f66645..8be0ac0ffe 100644 --- a/src/msw/dc.cpp +++ b/src/msw/dc.cpp @@ -705,7 +705,7 @@ void wxMSWDCImpl::Clear() bool wxMSWDCImpl::DoFloodFill(wxCoord WXUNUSED_IN_WINCE(x), wxCoord WXUNUSED_IN_WINCE(y), const wxColour& WXUNUSED_IN_WINCE(col), - int WXUNUSED_IN_WINCE(style)) + wxFloodFillStyle WXUNUSED_IN_WINCE(style)) { #ifdef __WXWINCE__ return false; @@ -888,7 +888,7 @@ void wxMSWDCImpl::DoDrawPolygon(int n, wxPoint points[], wxCoord xoffset, wxCoord yoffset, - int WXUNUSED_IN_WINCE(fillStyle)) + wxPolygonFillMode WXUNUSED_IN_WINCE(fillStyle)) { WXMICROWIN_CHECK_HDC @@ -937,7 +937,7 @@ wxMSWDCImpl::DoDrawPolyPolygon(int n, wxPoint points[], wxCoord xoffset, wxCoord yoffset, - int fillStyle) + wxPolygonFillMode fillStyle) { #ifdef __WXWINCE__ wxDCImpl::DoDrawPolyPolygon(n, count, points, xoffset, yoffset, fillStyle); @@ -1708,7 +1708,7 @@ void wxMSWDCImpl::SetBackgroundMode(int mode) // and m_backgroundMode is used there } -void wxMSWDCImpl::SetLogicalFunction(int function) +void wxMSWDCImpl::SetLogicalFunction(wxRasterOperationMode function) { WXMICROWIN_CHECK_HDC @@ -1742,10 +1742,6 @@ void wxMSWDCImpl::SetRop(WXHDC dc) case wxNAND: rop = R2_NOTMASKPEN; break; case wxOR: rop = R2_MERGEPEN; break; case wxSET: rop = R2_WHITE; break; - - default: - wxFAIL_MSG( wxT("unsupported logical function") ); - return; } SetROP2(GetHdc(), rop); @@ -1936,7 +1932,7 @@ void wxMSWDCImpl::RealizeScaleAndOrigin() #endif } -void wxMSWDCImpl::SetMapMode(int mode) +void wxMSWDCImpl::SetMapMode(wxMappingMode mode) { WXMICROWIN_CHECK_HDC @@ -2063,7 +2059,7 @@ bool wxMSWDCImpl::DoBlit(wxCoord dstX, wxCoord dstY, wxCoord dstWidth, wxCoord dstHeight, wxDC *source, wxCoord srcX, wxCoord srcY, - int rop, bool useMask, + wxRasterOperationMode rop, bool useMask, wxCoord srcMaskX, wxCoord srcMaskY) { return DoStretchBlit(dstX, dstY, dstWidth, dstHeight, source, srcX, srcY, dstWidth, dstHeight, rop, useMask, srcMaskX, srcMaskY); @@ -2074,7 +2070,7 @@ bool wxMSWDCImpl::DoStretchBlit(wxCoord xdest, wxCoord ydest, wxDC *source, wxCoord xsrc, wxCoord ysrc, wxCoord srcWidth, wxCoord srcHeight, - int rop, bool useMask, + wxRasterOperationMode rop, bool useMask, wxCoord xsrcMask, wxCoord ysrcMask) { wxCHECK_MSG( source, false, _T("wxMSWDCImpl::Blit(): NULL wxDC pointer") ); diff --git a/src/msw/dcprint.cpp b/src/msw/dcprint.cpp index 8a0b13d38f..dfa9d3e656 100644 --- a/src/msw/dcprint.cpp +++ b/src/msw/dcprint.cpp @@ -422,7 +422,7 @@ bool wxPrinterDCImpl::DoBlit(wxCoord xdest, wxCoord ydest, wxCoord width, wxCoord height, wxDC *source, wxCoord WXUNUSED(xsrc), wxCoord WXUNUSED(ysrc), - int WXUNUSED(rop), bool useMask, + wxRasterOperationMode WXUNUSED(rop), bool useMask, wxCoord WXUNUSED(xsrcMask), wxCoord WXUNUSED(ysrcMask)) { wxDCImpl *impl = source->GetImpl(); diff --git a/src/msw/metafile.cpp b/src/msw/metafile.cpp index 36066ae594..1f5593027e 100644 --- a/src/msw/metafile.cpp +++ b/src/msw/metafile.cpp @@ -275,7 +275,7 @@ wxMetafile *wxMetafileDCImpl::Close() return NULL; } -void wxMetafileDCImpl::SetMapMode(int mode) +void wxMetafileDCImpl::SetMapMode(wxMappingMode mode) { m_mappingMode = mode; diff --git a/src/msw/microwin.c b/src/msw/microwin.c index 9b66f8aeb1..d769cbab75 100644 --- a/src/msw/microwin.c +++ b/src/msw/microwin.c @@ -89,12 +89,12 @@ BOOL IsIconic(HWND hWnd) return FALSE; } -int SetMapMode(HDC hDC, int mode) +int SetMapMode(HDC hDC, wxMappingMode mode) { return MM_TEXT; } -int GetMapMode(HDC hDC) +wxMappingMode GetMapMode(HDC hDC) { return MM_TEXT; } @@ -163,7 +163,7 @@ BOOL GetClipBox(HDC hdc, RECT* rect) rect->right = mwrect.right; rect->bottom = mwrect.bottom; - return TRUE; + return TRUE; } BOOL DrawIconEx(HDC hdc, int x, int y, HICON hIcon, int w, int h, UINT istepIfAniCur, HBRUSH hbrFlickerFreeDraw, UINT diFlags) @@ -218,7 +218,7 @@ BOOL MaskBlt(HDC hdc, int x, int y, int w, int h, HDC hDCSource, int xSrc, int ySrc, HBITMAP hBitmapMask, int xMask, int yMask, DWORD rop) { /* TODO */ - return FALSE; + return FALSE; } UINT RealizePalette(HDC hDC) diff --git a/src/os2/dc.cpp b/src/os2/dc.cpp index 47e40bc3bb..9988736141 100644 --- a/src/os2/dc.cpp +++ b/src/os2/dc.cpp @@ -540,7 +540,7 @@ bool wxPMDCImpl::DoFloodFill( wxCoord vX , wxCoord vY , const wxColour& rCol -, int nStyle +, wxFloodFillStyle nStyle ) { POINTL vPtlPos; @@ -839,7 +839,7 @@ void wxPMDCImpl::DoDrawPolygon( int n, wxPoint vPoints[], wxCoord vXoffset, wxCoord vYoffset, - int nFillStyle ) + wxPolygonFillMode nFillStyle ) { ULONG ulCount = 1; // Number of polygons. POLYGON vPlgn; // polygon. @@ -2017,7 +2017,7 @@ void wxPMDCImpl::SetBackgroundMode(int nMode) m_backgroundMode = nMode; } // end of wxPMDCImpl::SetBackgroundMode -void wxPMDCImpl::SetLogicalFunction(int nFunction) +void wxPMDCImpl::SetLogicalFunction(wxRasterOperationMode nFunction) { m_logicalFunction = nFunction; SetRop((WXHDC)m_hDC); @@ -2165,7 +2165,7 @@ void wxPMDCImpl::DoGetTextExtent( ,wxICON_INFORMATION ); } - + bRc = ::GpiQueryTextBox( m_hPS ,l ,rsString.char_str() @@ -2211,7 +2211,7 @@ void wxPMDCImpl::DoGetTextExtent( } void wxPMDCImpl::SetMapMode( - int nMode + wxMappingMode nMode ) { int nPixelWidth = 0; @@ -2285,7 +2285,7 @@ void wxPMDCImpl::SetMapMode( ::GpiSetPS(m_hPS, &vSize, ulOptions); } ComputeScaleAndOrigin(); - + }; // end of wxPMDCImpl::SetMapMode void wxPMDCImpl::SetUserScale( double dX, @@ -2357,7 +2357,7 @@ bool wxPMDCImpl::DoBlit( wxCoord vXdest, wxDC* pSource, wxCoord vXsrc, wxCoord vYsrc, - int nRop, + wxRasterOperationMode nRop, bool bUseMask, wxCoord WXUNUSED(vXsrcMask), wxCoord WXUNUSED(vYsrcMask) ) diff --git a/src/os2/dcprint.cpp b/src/os2/dcprint.cpp index 9c0f88cc2b..6e92526a6f 100644 --- a/src/os2/dcprint.cpp +++ b/src/os2/dcprint.cpp @@ -277,7 +277,7 @@ bool wxPrinterDCImpl::DoBlit( wxCoord WXUNUSED(vXdest), wxDC* WXUNUSED(pSource), wxCoord WXUNUSED(vXsrc), wxCoord WXUNUSED(vYsrc), - int WXUNUSED(nRop), + wxRasterOperationMode WXUNUSED(nRop), bool WXUNUSED(bUseMask), wxCoord WXUNUSED(xsrcMask), wxCoord WXUNUSED(ysrcMask) ) diff --git a/src/os2/metafile.cpp b/src/os2/metafile.cpp index 65d034b572..4cc420425b 100644 --- a/src/os2/metafile.cpp +++ b/src/os2/metafile.cpp @@ -243,7 +243,7 @@ wxMetafile *wxMetafileDCImpl::Close(void) return NULL; } -void wxMetafileDCImpl::SetMapMode(int mode) +void wxMetafileDCImpl::SetMapMode(wxMappingMode mode) { m_mappingMode = mode; diff --git a/src/osx/carbon/graphics.cpp b/src/osx/carbon/graphics.cpp index 27177ea1a5..7d60feaefc 100644 --- a/src/osx/carbon/graphics.cpp +++ b/src/osx/carbon/graphics.cpp @@ -1574,7 +1574,7 @@ void wxMacCoreGraphicsContext::EnsureIsValid() // TODO test whether the private CGContextSetCompositeOperation works under 10.3 (using NSCompositingModes) -bool wxMacCoreGraphicsContext::SetLogicalFunction( int function ) +bool wxMacCoreGraphicsContext::SetLogicalFunction( wxRasterOperationMode function ) { if (m_logicalFunction == function) return true; diff --git a/src/palmos/dc.cpp b/src/palmos/dc.cpp index 07239ebaa5..4a417aa61f 100644 --- a/src/palmos/dc.cpp +++ b/src/palmos/dc.cpp @@ -239,7 +239,7 @@ void wxPalmDCImpl::Clear() bool wxPalmDCImpl::DoFloodFill(wxCoord WXUNUSED_IN_WINCE(x), wxCoord WXUNUSED_IN_WINCE(y), const wxColour& WXUNUSED_IN_WINCE(col), - int WXUNUSED_IN_WINCE(style)) + wxFloodFillStyle WXUNUSED_IN_WINCE(style)) { return false; } @@ -278,7 +278,7 @@ void wxPalmDCImpl::DoDrawPolygon(int n, wxPoint points[], wxCoord xoffset, wxCoord yoffset, - int WXUNUSED_IN_WINCE(fillStyle)) + wxPolygonFillMode WXUNUSED_IN_WINCE(fillStyle)) { } @@ -288,7 +288,7 @@ wxPalmDCImpl::DoDrawPolyPolygon(int n, wxPoint points[], wxCoord xoffset, wxCoord yoffset, - int fillStyle) + wxPolygonFillMode fillStyle) { } @@ -384,7 +384,7 @@ void wxPalmDCImpl::SetBackgroundMode(int mode) { } -void wxPalmDCImpl::SetLogicalFunction(int function) +void wxPalmDCImpl::SetLogicalFunction(wxRasterOperationMode function) { } @@ -443,7 +443,7 @@ void wxPalmDCImpl::RealizeScaleAndOrigin() { } -void wxPalmDCImpl::SetMapMode(int mode) +void wxPalmDCImpl::SetMapMode(wxMappingMode mode) { } @@ -472,7 +472,7 @@ bool wxPalmDCImpl::DoBlit(wxCoord dstX, wxCoord dstY, wxCoord dstWidth, wxCoord dstHeight, wxDC *source, wxCoord srcX, wxCoord srcY, - int rop, bool useMask, + wxRasterOperationMode rop, bool useMask, wxCoord srcMaskX, wxCoord srcMaskY) { return false; @@ -483,7 +483,7 @@ bool wxPalmDCImpl::DoStretchBlit(wxCoord xdest, wxCoord ydest, wxDC *source, wxCoord xsrc, wxCoord ysrc, wxCoord srcWidth, wxCoord srcHeight, - int rop, bool useMask, + wxRasterOperationMode rop, bool useMask, wxCoord xsrcMask, wxCoord ysrcMask) { return false; diff --git a/src/palmos/dcprint.cpp b/src/palmos/dcprint.cpp index 81fabe9cb2..058a2d1fe3 100644 --- a/src/palmos/dcprint.cpp +++ b/src/palmos/dcprint.cpp @@ -143,7 +143,7 @@ bool wxPrinterDC::DoBlit(wxCoord xdest, wxCoord ydest, wxCoord width, wxCoord height, wxDC *source, wxCoord WXUNUSED(xsrc), wxCoord WXUNUSED(ysrc), - int WXUNUSED(rop), bool useMask, + wxRasterOperationMode WXUNUSED(rop), bool useMask, wxCoord WXUNUSED(xsrcMask), wxCoord WXUNUSED(ysrcMask)) { return false; diff --git a/src/palmos/metafile.cpp b/src/palmos/metafile.cpp index 6d98ac45bb..7626591e77 100644 --- a/src/palmos/metafile.cpp +++ b/src/palmos/metafile.cpp @@ -129,7 +129,7 @@ wxMetafile *wxMetafileDC::Close() return NULL; } -void wxMetafileDC::SetMapMode(int mode) +void wxMetafileDC::SetMapMode(wxMappingMode mode) { } diff --git a/src/x11/dcclient.cpp b/src/x11/dcclient.cpp index ec9b8826b5..68164906c9 100644 --- a/src/x11/dcclient.cpp +++ b/src/x11/dcclient.cpp @@ -351,10 +351,10 @@ void wxWindowDCImpl::DoGetSize( int* width, int* height ) const } extern bool wxDoFloodFill(wxDC *dc, wxCoord x, wxCoord y, - const wxColour & col, int style); + const wxColour & col, wxFloodFillStyle style); bool wxWindowDCImpl::DoFloodFill(wxCoord x, wxCoord y, - const wxColour& col, int style) + const wxColour& col, wxFloodFillStyle style) { return wxDoFloodFill(GetOwner(), x, y, col, style); } @@ -643,7 +643,7 @@ void wxWindowDCImpl::DoDrawLines( int n, wxPoint points[], wxCoord xoffset, wxCo void wxWindowDCImpl::DoDrawPolygon( int n, wxPoint points[], wxCoord xoffset, wxCoord yoffset, - int WXUNUSED(fillStyle) ) + wxPolygonFillMode WXUNUSED(fillStyle) ) { wxCHECK_RET( IsOk(), wxT("invalid window dc") ); @@ -1291,7 +1291,8 @@ void wxWindowDCImpl::DoDrawBitmap( const wxBitmap &bitmap, // wxUSE_NANOX/!wxUSE_NANOX bool wxWindowDCImpl::DoBlit( wxCoord xdest, wxCoord ydest, wxCoord width, wxCoord height, - wxDC *source, wxCoord xsrc, wxCoord ysrc, int logical_func, bool useMask, + wxDC *source, wxCoord xsrc, wxCoord ysrc, + wxRasterOperationMode logical_func, bool useMask, wxCoord xsrcMask, wxCoord ysrcMask ) { /* this is the nth try to get this utterly useless function to @@ -1385,7 +1386,7 @@ bool wxWindowDCImpl::DoBlit( wxCoord xdest, wxCoord ydest, wxCoord width, wxCoor return true; } - int old_logical_func = m_logicalFunction; + wxRasterOperationMode old_logical_func = m_logicalFunction; SetLogicalFunction( logical_func ); if (use_bitmap_method) @@ -2044,7 +2045,7 @@ void wxWindowDCImpl::SetBackground( const wxBrush &brush ) } } -void wxWindowDCImpl::SetLogicalFunction( int function ) +void wxWindowDCImpl::SetLogicalFunction( wxRasterOperationMode function ) { wxCHECK_RET( IsOk(), wxT("invalid dc") ); -- 2.45.2