X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/64698f9af83fd51d3080a0e6fb3789e9f75b4958..bcd2b961ff2545f4daf8ca7150b660a23cb0c8f7:/include/wx/dc.h?ds=sidebyside diff --git a/include/wx/dc.h b/include/wx/dc.h index 052ec417d6..e6183bf8b9 100644 --- a/include/wx/dc.h +++ b/include/wx/dc.h @@ -3,7 +3,6 @@ #ifdef __GNUG__ #pragma interface "dcbase.h" - #pragma implementation "dcbase.h" #endif // ---------------------------------------------------------------------------- @@ -57,7 +56,7 @@ public: m_deviceOriginX = m_deviceOriginY = 0; m_logicalScaleX = m_logicalScaleY = - m_userScaleX = m_userScaleY = + m_userScaleX = m_userScaleY = m_scaleX = m_scaleY = 1.0; m_logicalFunction = -1; @@ -110,7 +109,7 @@ public: { DoDrawArc(pt1.x, pt1.y, pt2.x, pt2.y, centre.x, centre.y); } void DrawEllipticArc(long x, long y, long w, long h, double sa, double ea) - { DoDrawEllipticArc(x, y, x, y, sa, ea); } + { DoDrawEllipticArc(x, y, w, h, sa, ea); } void DrawEllipticArc(const wxPoint& pt, const wxSize& sz, double sa, double ea) { DoDrawEllipticArc(pt.x, pt.y, sz.x, sz.y, sa, ea); } @@ -122,23 +121,7 @@ public: void DrawLines(int n, wxPoint points[], long xoffset = 0, long yoffset = 0) { DoDrawLines(n, points, xoffset, yoffset); } - void DrawLines(const wxList *list, long xoffset = 0, long yoffset = 0) - { - int n = list->Number(); - wxPoint *points = new wxPoint[n]; - - int i = 0; - for ( wxNode *node = list->First(); node; node = node->Next(), i++ ) - { - wxPoint *point = (wxPoint *)node->Data(); - points[i].x = point->x; - points[i].y = point->y; - } - - DoDrawLines(n, points, xoffset, yoffset); - - delete [] points; - } + void DrawLines(const wxList *list, long xoffset = 0, long yoffset = 0); void DrawPolygon(int n, wxPoint points[], long xoffset = 0, long yoffset = 0, @@ -147,23 +130,7 @@ public: void DrawPolygon(const wxList *list, long xoffset = 0, long yoffset = 0, - int fillStyle = wxODDEVEN_RULE) - { - int n = list->Number(); - wxPoint *points = new wxPoint[n]; - - int i = 0; - for ( wxNode *node = list->First(); node; node = node->Next(), i++ ) - { - wxPoint *point = (wxPoint *)node->Data(); - points[i].x = point->x; - points[i].y = point->y; - } - - DoDrawPolygon(n, points, xoffset, yoffset, fillStyle); - - delete [] points; - } + int fillStyle = wxODDEVEN_RULE); void DrawRectangle(long x, long y, long width, long height) { DoDrawRectangle(x, y, width, height); } @@ -181,6 +148,8 @@ public: void DrawRoundedRectangle(const wxRect& r, double radius) { DoDrawRoundedRectangle(r.x, r.y, r.width, r.height, radius); } + void DrawCircle(long x, long y, long radius) + { DoDrawEllipse(x - radius, y - radius, 2*radius, 2*radius); } void DrawEllipse(long x, long y, long width, long height) { DoDrawEllipse(x, y, width, height); } void DrawEllipse(const wxPoint& pt, const wxSize& sz) @@ -220,42 +189,9 @@ public: } #if wxUSE_SPLINES - // TODO: this API needs fixing (wxPointList, why (!const) "wxList *"?) - void DrawSpline(long x1, long y1, long x2, long y2, long x3, long y3) - { - wxList point_list; - - wxPoint *point1 = new wxPoint; - point1->x = x1; point1->y = y1; - point_list.Append((wxObject*)point1); - - wxPoint *point2 = new wxPoint; - point2->x = x2; point2->y = y2; - point_list.Append((wxObject*)point2); - - wxPoint *point3 = new wxPoint; - point3->x = x3; point3->y = y3; - point_list.Append((wxObject*)point3); - - DrawSpline(&point_list); - - for( wxNode *node = point_list.First(); node; node = node->Next() ) - { - wxPoint *p = (wxPoint *)node->Data(); - delete p; - } - } - - void DrawSpline(int n, wxPoint points[]) - { - wxList list; - for (int i =0; i < n; i++) - { - list.Append((wxObject*)&points[i]); - } - - DrawSpline(&list); - } +// TODO: this API needs fixing (wxPointList, why (!const) "wxList *"?) + void DrawSpline(long x1, long y1, long x2, long y2, long x3, long y3); + void DrawSpline(int n, wxPoint points[]); void DrawSpline(wxList *points) { DoDrawSpline(points); } #endif // wxUSE_SPLINES @@ -396,8 +332,6 @@ public: if ( x ) *x = m_userScaleX; if ( y ) *y = m_userScaleY; } - void SetSystemScale(double x, double y) - { SetUserScale(x, y); } virtual void SetUserScale(double x, double y) = 0; virtual void GetLogicalScale(double *x, double *y)