X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/4a624f6ed375e4dbf126743ff1068486cb5241a2..d7b20621ef1170ed3c505f65d77227cf18c80499:/include/wx/dc.h diff --git a/include/wx/dc.h b/include/wx/dc.h index 66901ddb6e..f0fe623aa7 100644 --- a/include/wx/dc.h +++ b/include/wx/dc.h @@ -1,7 +1,7 @@ ///////////////////////////////////////////////////////////////////////////// // Name: wx/dc.h // Purpose: wxDC class -// Author: Vadim Zeitlin +// Author: Vadim Zeitlin // Modified by: // Created: 05/25/99 // RCS-ID: $Id$ @@ -46,7 +46,7 @@ class WXDLLIMPEXP_FWD_CORE wxPrintData; // wxDrawObject helper class //----------------------------------------------------------------------------- -class WXDLLEXPORT wxDrawObject +class WXDLLIMPEXP_CORE wxDrawObject { public: @@ -187,7 +187,8 @@ public: virtual void DoGetSize(int *width, int *height) const = 0; void GetSize(int *width, int *height) const { - return DoGetSize(width, height); + DoGetSize(width, height); + return ; } wxSize GetSize() const @@ -499,6 +500,54 @@ protected: m_clipX1 = m_clipX2 = m_clipY1 = m_clipY2 = 0; } +#ifdef __WXWINCE__ + //! Generic method to draw ellipses, circles and arcs with current pen and brush. + /*! \param x Upper left corner of bounding box. + * \param y Upper left corner of bounding box. + * \param w Width of bounding box. + * \param h Height of bounding box. + * \param sa Starting angle of arc + * (counterclockwise, start at 3 o'clock, 360 is full circle). + * \param ea Ending angle of arc. + * \param angle Rotation angle, the Arc will be rotated after + * calculating begin and end. + */ + void DrawEllipticArcRot( wxCoord x, wxCoord y, + wxCoord width, wxCoord height, + double sa = 0, double ea = 0, double angle = 0 ) + { DoDrawEllipticArcRot( x, y, width, height, sa, ea, angle ); } + + void DrawEllipticArcRot( const wxPoint& pt, + const wxSize& sz, + double sa = 0, double ea = 0, double angle = 0 ) + { DoDrawEllipticArcRot( pt.x, pt.y, sz.x, sz.y, sa, ea, angle ); } + + void DrawEllipticArcRot( const wxRect& rect, + double sa = 0, double ea = 0, double angle = 0 ) + { DoDrawEllipticArcRot( rect.x, rect.y, rect.width, rect.height, sa, ea, angle ); } + + virtual void DoDrawEllipticArcRot( wxCoord x, wxCoord y, + wxCoord w, wxCoord h, + double sa = 0, double ea = 0, double angle = 0 ); + + //! Rotates points around center. + /*! This is a quite straight method, it calculates in pixels + * and so it produces rounding errors. + * \param points The points inside will be rotated. + * \param angle Rotating angle (counterclockwise, start at 3 o'clock, 360 is full circle). + * \param center Center of rotation. + */ + void Rotate( wxPointList* points, double angle, wxPoint center = wxPoint(0,0) ); + + // used by DrawEllipticArcRot + // Careful: wxList gets filled with points you have to delete later. + void CalculateEllipticPoints( wxPointList* points, + wxCoord xStart, wxCoord yStart, + wxCoord w, wxCoord h, + double sa, double ea ); +#endif // __WXWINCE__ + + // window on which the DC draws or NULL wxWindow *m_window; @@ -565,7 +614,7 @@ public: const wxDCImpl *GetImpl() const { return m_pimpl; } - wxWindow *GetWindow() + wxWindow *GetWindow() const { return m_pimpl->GetWindow(); } bool IsOk() const @@ -1059,7 +1108,7 @@ private: // restore it automatically when the object goes out of scope // ---------------------------------------------------------------------------- -class WXDLLEXPORT wxDCTextColourChanger +class WXDLLIMPEXP_CORE wxDCTextColourChanger { public: wxDCTextColourChanger(wxDC& dc) : m_dc(dc), m_colFgOld() { } @@ -1095,7 +1144,7 @@ private: // restore it automatically when the object goes out of scope // ---------------------------------------------------------------------------- -class WXDLLEXPORT wxDCPenChanger +class WXDLLIMPEXP_CORE wxDCPenChanger { public: wxDCPenChanger(wxDC& dc, const wxPen& pen) : m_dc(dc), m_penOld(dc.GetPen()) @@ -1122,7 +1171,7 @@ private: // restore it automatically when the object goes out of scope // ---------------------------------------------------------------------------- -class WXDLLEXPORT wxDCBrushChanger +class WXDLLIMPEXP_CORE wxDCBrushChanger { public: wxDCBrushChanger(wxDC& dc, const wxBrush& brush) : m_dc(dc), m_brushOld(dc.GetBrush()) @@ -1149,7 +1198,7 @@ private: // destroys it in the dtor // ---------------------------------------------------------------------------- -class WXDLLEXPORT wxDCClipper +class WXDLLIMPEXP_CORE wxDCClipper { public: wxDCClipper(wxDC& dc, const wxRegion& r) : m_dc(dc)