X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/e26be42b5c22746f21885b84866791505620f628..dabd1377ce769598bda630dfad548be055e2a89b:/include/wx/dc.h diff --git a/include/wx/dc.h b/include/wx/dc.h index b856ef7f83..8366a5c479 100644 --- a/include/wx/dc.h +++ b/include/wx/dc.h @@ -28,7 +28,6 @@ #include "wx/brush.h" #include "wx/pen.h" #include "wx/palette.h" - #include "wx/list.h" // we use wxList in inline functions class WXDLLEXPORT wxDCBase; @@ -227,6 +226,9 @@ public: void DrawCircle(wxCoord x, wxCoord y, wxCoord radius) { DoDrawEllipse(x - radius, y - radius, 2*radius, 2*radius); } + void DrawCircle(const wxPoint& pt, wxCoord radius) + { DrawCircle(pt.x, pt.y, radius); } + void DrawEllipse(wxCoord x, wxCoord y, wxCoord width, wxCoord height) { DoDrawEllipse(x, y, width, height); } void DrawEllipse(const wxPoint& pt, const wxSize& sz) @@ -274,17 +276,17 @@ public: bool Blit(wxCoord xdest, wxCoord ydest, wxCoord width, wxCoord height, wxDC *source, wxCoord xsrc, wxCoord ysrc, - int rop = wxCOPY, bool useMask = FALSE) + int rop = wxCOPY, bool useMask = FALSE, wxCoord xsrcMask = -1, wxCoord ysrcMask = -1) { return DoBlit(xdest, ydest, width, height, - source, xsrc, ysrc, rop, useMask); + 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) + int rop = wxCOPY, bool useMask = FALSE, const wxPoint& srcPtMask = wxPoint(-1, -1)) { return DoBlit(destPt.x, destPt.y, sz.x, sz.y, - source, srcPt.x, srcPt.y, rop, useMask); + source, srcPt.x, srcPt.y, rop, useMask, srcPtMask.x, srcPtMask.y); } #if wxUSE_SPLINES @@ -316,7 +318,9 @@ public: virtual void SetBrush(const wxBrush& brush) = 0; virtual void SetBackground(const wxBrush& brush) = 0; virtual void SetBackgroundMode(int mode) = 0; +#if wxUSE_PALETTE virtual void SetPalette(const wxPalette& palette) = 0; +#endif // wxUSE_PALETTE // clipping region // --------------- @@ -486,6 +490,16 @@ public: virtual void SetOptimization(bool WXUNUSED(opt)) { } virtual bool GetOptimization() { return FALSE; } + // Some platforms have a DC cache, which should be cleared + // at appropriate points such as after a series of DC operations. + // Put ClearCache in the wxDC implementation class, since it has to be + // static. + // static void ClearCache() ; +#if 0 // wxUSE_DC_CACHEING + static void EnableCache(bool cacheing) { sm_cacheing = cacheing; } + static bool CacheEnabled() { return sm_cacheing ; } +#endif + // bounding box // ------------ @@ -578,12 +592,17 @@ public: #endif // !Win16 #if WXWIN_COMPATIBILITY + +#if wxUSE_PALETTE virtual void SetColourMap(const wxPalette& palette) { SetPalette(palette); } +#endif // wxUSE_PALETTE + void GetTextExtent(const wxString& string, float *x, float *y, float *descent = NULL, float *externalLeading = NULL, wxFont *theFont = NULL, bool use16bit = FALSE) const ; void GetSize(float* width, float* height) const { int w, h; GetSize(& w, & h); *width = w; *height = h; } void GetSizeMM(float *width, float *height) const { long w, h; GetSizeMM(& w, & h); *width = (float) w; *height = (float) h; } + #endif // WXWIN_COMPATIBILITY protected: @@ -624,7 +643,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) = 0; + int rop = wxCOPY, bool useMask = FALSE, wxCoord xsrcMask = -1, wxCoord ysrcMask = -1) = 0; virtual void DoGetSize(int *width, int *height) const = 0; virtual void DoGetSizeMM(int* width, int* height) const = 0; @@ -688,6 +707,9 @@ protected: bool m_clipping:1; bool m_isInteractive:1; bool m_isBBoxValid:1; +#if wxUSE_DC_CACHEING +// static bool sm_cacheing; +#endif // coordinate system variables @@ -718,7 +740,11 @@ protected: wxColour m_textForegroundColour; wxColour m_textBackgroundColour; wxFont m_font; + +#if wxUSE_PALETTE wxPalette m_palette; + bool m_hasCustomPalette; +#endif // wxUSE_PALETTE private: DECLARE_NO_COPY_CLASS(wxDCBase) @@ -735,10 +761,10 @@ private: #include "wx/motif/dc.h" #elif defined(__WXGTK__) #include "wx/gtk/dc.h" +#elif defined(__WXX11__) + #include "wx/x11/dc.h" #elif defined(__WXMGL__) #include "wx/mgl/dc.h" -#elif defined(__WXQT__) - #include "wx/qt/dc.h" #elif defined(__WXMAC__) #include "wx/mac/dc.h" #elif defined(__WXPM__)