/////////////////////////////////////////////////////////////////////////////
// Name: wx/dc.h
// Purpose: wxDC class
-// Author: Vadim Zeitlin
+// Author: Vadim Zeitlin
// Modified by:
// Created: 05/25/99
// RCS-ID: $Id$
class WXDLLIMPEXP_FWD_CORE wxScreenDC;
class WXDLLIMPEXP_FWD_CORE wxMemoryDC;
class WXDLLIMPEXP_FWD_CORE wxPrinterDC;
+class WXDLLIMPEXP_FWD_CORE wxPrintData;
//-----------------------------------------------------------------------------
// wxDrawObject helper class
virtual wxDCImpl* CreatePrinterDC( wxPrinterDC *owner, const wxPrintData &data ) = 0;
#endif
- static void SetDCFactory( wxDCFactory *factory );
+ static void Set(wxDCFactory *factory);
static wxDCFactory *Get();
private:
// query dimension, colour deps, resolution
virtual void DoGetSize(int *width, int *height) const = 0;
+ void GetSize(int *width, int *height) const
+ {
+ DoGetSize(width, height);
+ return ;
+ }
+
+ wxSize GetSize() const
+ {
+ int w, h;
+ DoGetSize(&w, &h);
+ return wxSize(w, h);
+ }
+
virtual void DoGetSizeMM(int* width, int* height) const = 0;
virtual int GetDepth() const = 0;
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;
const wxDCImpl *GetImpl() const
{ return m_pimpl; }
- wxWindow *GetWindow()
+ wxWindow *GetWindow() const
{ return m_pimpl->GetWindow(); }
bool IsOk() const
void GetSize(int *width, int *height) const
{ m_pimpl->DoGetSize(width, height); }
-
wxSize GetSize() const
- {
- int w, h;
- m_pimpl->DoGetSize(&w, &h);
- return wxSize(w, h);
- }
+ { return m_pimpl->GetSize(); }
void GetSizeMM(int* width, int* height) const
{ m_pimpl->DoGetSizeMM(width, height); }