use const arrays for wxDC array parameters, closes #10712
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@73382 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -165,9 +165,9 @@ protected:
|
|||||||
virtual void DoGetSize(int *width, int *height) const;
|
virtual void DoGetSize(int *width, int *height) const;
|
||||||
virtual void DoGetSizeMM(int* width, int* height) const;
|
virtual void DoGetSizeMM(int* width, int* height) const;
|
||||||
|
|
||||||
virtual void DoDrawLines(int n, wxPoint points[],
|
virtual void DoDrawLines(int n, const wxPoint points[],
|
||||||
wxCoord xoffset, wxCoord yoffset);
|
wxCoord xoffset, wxCoord yoffset);
|
||||||
virtual void DoDrawPolygon(int n, wxPoint points[],
|
virtual void DoDrawPolygon(int n, const wxPoint points[],
|
||||||
wxCoord xoffset, wxCoord yoffset,
|
wxCoord xoffset, wxCoord yoffset,
|
||||||
wxPolygonFillMode fillStyle = wxODDEVEN_RULE);
|
wxPolygonFillMode fillStyle = wxODDEVEN_RULE);
|
||||||
};
|
};
|
||||||
|
@@ -604,15 +604,15 @@ public:
|
|||||||
{ return wxNullBitmap; }
|
{ return wxNullBitmap; }
|
||||||
|
|
||||||
|
|
||||||
virtual void DoDrawLines(int n, wxPoint points[],
|
virtual void DoDrawLines(int n, const wxPoint points[],
|
||||||
wxCoord xoffset, wxCoord yoffset ) = 0;
|
wxCoord xoffset, wxCoord yoffset ) = 0;
|
||||||
virtual void DrawLines(const wxPointList *list,
|
virtual void DrawLines(const wxPointList *list,
|
||||||
wxCoord xoffset, wxCoord yoffset );
|
wxCoord xoffset, wxCoord yoffset );
|
||||||
|
|
||||||
virtual void DoDrawPolygon(int n, wxPoint points[],
|
virtual void DoDrawPolygon(int n, const wxPoint points[],
|
||||||
wxCoord xoffset, wxCoord yoffset,
|
wxCoord xoffset, wxCoord yoffset,
|
||||||
wxPolygonFillMode fillStyle = wxODDEVEN_RULE) = 0;
|
wxPolygonFillMode fillStyle = wxODDEVEN_RULE) = 0;
|
||||||
virtual void DoDrawPolyPolygon(int n, int count[], wxPoint points[],
|
virtual void DoDrawPolyPolygon(int n, const int count[], const wxPoint points[],
|
||||||
wxCoord xoffset, wxCoord yoffset,
|
wxCoord xoffset, wxCoord yoffset,
|
||||||
wxPolygonFillMode fillStyle);
|
wxPolygonFillMode fillStyle);
|
||||||
void DrawPolygon(const wxPointList *list,
|
void DrawPolygon(const wxPointList *list,
|
||||||
@@ -624,7 +624,7 @@ public:
|
|||||||
void DrawSpline(wxCoord x1, wxCoord y1,
|
void DrawSpline(wxCoord x1, wxCoord y1,
|
||||||
wxCoord x2, wxCoord y2,
|
wxCoord x2, wxCoord y2,
|
||||||
wxCoord x3, wxCoord y3);
|
wxCoord x3, wxCoord y3);
|
||||||
void DrawSpline(int n, wxPoint points[]);
|
void DrawSpline(int n, const wxPoint points[]);
|
||||||
void DrawSpline(const wxPointList *points) { DoDrawSpline(points); }
|
void DrawSpline(const wxPointList *points) { DoDrawSpline(points); }
|
||||||
|
|
||||||
virtual void DoDrawSpline(const wxPointList *points);
|
virtual void DoDrawSpline(const wxPointList *points);
|
||||||
@@ -1139,7 +1139,7 @@ public:
|
|||||||
void DrawPoint(const wxPoint& pt)
|
void DrawPoint(const wxPoint& pt)
|
||||||
{ m_pimpl->DoDrawPoint(pt.x, pt.y); }
|
{ m_pimpl->DoDrawPoint(pt.x, pt.y); }
|
||||||
|
|
||||||
void DrawLines(int n, wxPoint points[],
|
void DrawLines(int n, const wxPoint points[],
|
||||||
wxCoord xoffset = 0, wxCoord yoffset = 0)
|
wxCoord xoffset = 0, wxCoord yoffset = 0)
|
||||||
{ m_pimpl->DoDrawLines(n, points, xoffset, yoffset); }
|
{ m_pimpl->DoDrawLines(n, points, xoffset, yoffset); }
|
||||||
void DrawLines(const wxPointList *list,
|
void DrawLines(const wxPointList *list,
|
||||||
@@ -1150,7 +1150,7 @@ public:
|
|||||||
wxCoord xoffset = 0, wxCoord yoffset = 0) );
|
wxCoord xoffset = 0, wxCoord yoffset = 0) );
|
||||||
#endif // WXWIN_COMPATIBILITY_2_8
|
#endif // WXWIN_COMPATIBILITY_2_8
|
||||||
|
|
||||||
void DrawPolygon(int n, wxPoint points[],
|
void DrawPolygon(int n, const wxPoint points[],
|
||||||
wxCoord xoffset = 0, wxCoord yoffset = 0,
|
wxCoord xoffset = 0, wxCoord yoffset = 0,
|
||||||
wxPolygonFillMode fillStyle = wxODDEVEN_RULE)
|
wxPolygonFillMode fillStyle = wxODDEVEN_RULE)
|
||||||
{ m_pimpl->DoDrawPolygon(n, points, xoffset, yoffset, fillStyle); }
|
{ m_pimpl->DoDrawPolygon(n, points, xoffset, yoffset, fillStyle); }
|
||||||
@@ -1158,7 +1158,7 @@ public:
|
|||||||
wxCoord xoffset = 0, wxCoord yoffset = 0,
|
wxCoord xoffset = 0, wxCoord yoffset = 0,
|
||||||
wxPolygonFillMode fillStyle = wxODDEVEN_RULE)
|
wxPolygonFillMode fillStyle = wxODDEVEN_RULE)
|
||||||
{ m_pimpl->DrawPolygon( list, xoffset, yoffset, fillStyle ); }
|
{ m_pimpl->DrawPolygon( list, xoffset, yoffset, fillStyle ); }
|
||||||
void DrawPolyPolygon(int n, int count[], wxPoint points[],
|
void DrawPolyPolygon(int n, const int count[], const wxPoint points[],
|
||||||
wxCoord xoffset = 0, wxCoord yoffset = 0,
|
wxCoord xoffset = 0, wxCoord yoffset = 0,
|
||||||
wxPolygonFillMode fillStyle = wxODDEVEN_RULE)
|
wxPolygonFillMode fillStyle = wxODDEVEN_RULE)
|
||||||
{ m_pimpl->DoDrawPolyPolygon(n, count, points, xoffset, yoffset, fillStyle); }
|
{ m_pimpl->DoDrawPolyPolygon(n, count, points, xoffset, yoffset, fillStyle); }
|
||||||
@@ -1281,7 +1281,7 @@ public:
|
|||||||
wxCoord x2, wxCoord y2,
|
wxCoord x2, wxCoord y2,
|
||||||
wxCoord x3, wxCoord y3)
|
wxCoord x3, wxCoord y3)
|
||||||
{ m_pimpl->DrawSpline(x1,y1,x2,y2,x3,y3); }
|
{ m_pimpl->DrawSpline(x1,y1,x2,y2,x3,y3); }
|
||||||
void DrawSpline(int n, wxPoint points[])
|
void DrawSpline(int n, const wxPoint points[])
|
||||||
{ m_pimpl->DrawSpline(n,points); }
|
{ m_pimpl->DrawSpline(n,points); }
|
||||||
void DrawSpline(const wxPointList *points)
|
void DrawSpline(const wxPointList *points)
|
||||||
{ m_pimpl->DrawSpline(points); }
|
{ m_pimpl->DrawSpline(points); }
|
||||||
|
@@ -177,12 +177,12 @@ public:
|
|||||||
virtual void DoGetSize(int *,int *) const;
|
virtual void DoGetSize(int *,int *) const;
|
||||||
virtual void DoGetSizeMM(int* width, int* height) const;
|
virtual void DoGetSizeMM(int* width, int* height) const;
|
||||||
|
|
||||||
virtual void DoDrawLines(int n, wxPoint points[],
|
virtual void DoDrawLines(int n, const wxPoint points[],
|
||||||
wxCoord xoffset, wxCoord yoffset);
|
wxCoord xoffset, wxCoord yoffset);
|
||||||
virtual void DoDrawPolygon(int n, wxPoint points[],
|
virtual void DoDrawPolygon(int n, const wxPoint points[],
|
||||||
wxCoord xoffset, wxCoord yoffset,
|
wxCoord xoffset, wxCoord yoffset,
|
||||||
wxPolygonFillMode fillStyle = wxODDEVEN_RULE);
|
wxPolygonFillMode fillStyle = wxODDEVEN_RULE);
|
||||||
virtual void DoDrawPolyPolygon(int n, int count[], wxPoint points[],
|
virtual void DoDrawPolyPolygon(int n, const int count[], const wxPoint points[],
|
||||||
wxCoord xoffset, wxCoord yoffset,
|
wxCoord xoffset, wxCoord yoffset,
|
||||||
wxPolygonFillMode fillStyle);
|
wxPolygonFillMode fillStyle);
|
||||||
|
|
||||||
|
@@ -82,27 +82,23 @@ protected:
|
|||||||
wxCoord *GetX(wxCoord *x, wxCoord *y) const { return m_mirror ? y : x; }
|
wxCoord *GetX(wxCoord *x, wxCoord *y) const { return m_mirror ? y : x; }
|
||||||
wxCoord *GetY(wxCoord *x, wxCoord *y) const { return m_mirror ? x : y; }
|
wxCoord *GetY(wxCoord *x, wxCoord *y) const { return m_mirror ? x : y; }
|
||||||
|
|
||||||
// exchange x and y unconditionally
|
|
||||||
static void Swap(wxCoord& x, wxCoord& y)
|
|
||||||
{
|
|
||||||
wxCoord t = x;
|
|
||||||
x = y;
|
|
||||||
y = t;
|
|
||||||
}
|
|
||||||
|
|
||||||
// exchange x and y components of all points in the array if necessary
|
// exchange x and y components of all points in the array if necessary
|
||||||
void Mirror(int n, wxPoint points[]) const
|
wxPoint* Mirror(int n, const wxPoint*& points) const
|
||||||
{
|
{
|
||||||
|
wxPoint* points_alloc = NULL;
|
||||||
if ( m_mirror )
|
if ( m_mirror )
|
||||||
{
|
{
|
||||||
|
points_alloc = new wxPoint[n];
|
||||||
for ( int i = 0; i < n; i++ )
|
for ( int i = 0; i < n; i++ )
|
||||||
{
|
{
|
||||||
Swap(points[i].x, points[i].y);
|
points_alloc[i].x = points[i].y;
|
||||||
|
points_alloc[i].y = points[i].x;
|
||||||
}
|
}
|
||||||
|
points = points_alloc;
|
||||||
}
|
}
|
||||||
|
return points_alloc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// wxDCBase functions
|
// wxDCBase functions
|
||||||
virtual bool DoFloodFill(wxCoord x, wxCoord y, const wxColour& col,
|
virtual bool DoFloodFill(wxCoord x, wxCoord y, const wxColour& col,
|
||||||
wxFloodFillStyle style = wxFLOOD_SURFACE)
|
wxFloodFillStyle style = wxFLOOD_SURFACE)
|
||||||
@@ -226,28 +222,28 @@ protected:
|
|||||||
m_dc.DoGetSizeMM(GetX(w, h), GetY(w, h));
|
m_dc.DoGetSizeMM(GetX(w, h), GetY(w, h));
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void DoDrawLines(int n, wxPoint points[],
|
virtual void DoDrawLines(int n, const wxPoint points[],
|
||||||
wxCoord xoffset, wxCoord yoffset)
|
wxCoord xoffset, wxCoord yoffset)
|
||||||
{
|
{
|
||||||
Mirror(n, points);
|
wxPoint* points_alloc = Mirror(n, points);
|
||||||
|
|
||||||
m_dc.DoDrawLines(n, points,
|
m_dc.DoDrawLines(n, points,
|
||||||
GetX(xoffset, yoffset), GetY(xoffset, yoffset));
|
GetX(xoffset, yoffset), GetY(xoffset, yoffset));
|
||||||
|
|
||||||
Mirror(n, points);
|
delete[] points_alloc;
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void DoDrawPolygon(int n, wxPoint points[],
|
virtual void DoDrawPolygon(int n, const wxPoint points[],
|
||||||
wxCoord xoffset, wxCoord yoffset,
|
wxCoord xoffset, wxCoord yoffset,
|
||||||
wxPolygonFillMode fillStyle = wxODDEVEN_RULE)
|
wxPolygonFillMode fillStyle = wxODDEVEN_RULE)
|
||||||
{
|
{
|
||||||
Mirror(n, points);
|
wxPoint* points_alloc = Mirror(n, points);
|
||||||
|
|
||||||
m_dc.DoDrawPolygon(n, points,
|
m_dc.DoDrawPolygon(n, points,
|
||||||
GetX(xoffset, yoffset), GetY(xoffset, yoffset),
|
GetX(xoffset, yoffset), GetY(xoffset, yoffset),
|
||||||
fillStyle);
|
fillStyle);
|
||||||
|
|
||||||
Mirror(n, points);
|
delete[] points_alloc;
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void DoSetDeviceClippingRegion(const wxRegion& WXUNUSED(region))
|
virtual void DoSetDeviceClippingRegion(const wxRegion& WXUNUSED(region))
|
||||||
|
@@ -126,12 +126,12 @@ private:
|
|||||||
|
|
||||||
virtual void DoDrawLine (wxCoord x1, wxCoord y1, wxCoord x2, wxCoord y2);
|
virtual void DoDrawLine (wxCoord x1, wxCoord y1, wxCoord x2, wxCoord y2);
|
||||||
|
|
||||||
virtual void DoDrawLines(int n, wxPoint points[],
|
virtual void DoDrawLines(int n, const wxPoint points[],
|
||||||
wxCoord xoffset = 0, wxCoord yoffset = 0);
|
wxCoord xoffset = 0, wxCoord yoffset = 0);
|
||||||
|
|
||||||
virtual void DoDrawPoint(wxCoord, wxCoord);
|
virtual void DoDrawPoint(wxCoord, wxCoord);
|
||||||
|
|
||||||
virtual void DoDrawPolygon(int n, wxPoint points[],
|
virtual void DoDrawPolygon(int n, const wxPoint points[],
|
||||||
wxCoord xoffset, wxCoord yoffset,
|
wxCoord xoffset, wxCoord yoffset,
|
||||||
wxPolygonFillMode fillStyle);
|
wxPolygonFillMode fillStyle);
|
||||||
|
|
||||||
|
@@ -132,9 +132,9 @@ protected:
|
|||||||
virtual void DoGetSize(int *width, int *height) const;
|
virtual void DoGetSize(int *width, int *height) const;
|
||||||
virtual void DoGetSizeMM(int* width, int* height) const;
|
virtual void DoGetSizeMM(int* width, int* height) const;
|
||||||
|
|
||||||
virtual void DoDrawLines(int n, wxPoint points[],
|
virtual void DoDrawLines(int n, const wxPoint points[],
|
||||||
wxCoord xoffset, wxCoord yoffset);
|
wxCoord xoffset, wxCoord yoffset);
|
||||||
virtual void DoDrawPolygon(int n, wxPoint points[],
|
virtual void DoDrawPolygon(int n, const wxPoint points[],
|
||||||
wxCoord xoffset, wxCoord yoffset,
|
wxCoord xoffset, wxCoord yoffset,
|
||||||
wxPolygonFillMode fillStyle = wxODDEVEN_RULE);
|
wxPolygonFillMode fillStyle = wxODDEVEN_RULE);
|
||||||
|
|
||||||
|
@@ -105,11 +105,11 @@ protected:
|
|||||||
void DoDrawArc(wxCoord x1,wxCoord y1,wxCoord x2,wxCoord y2,wxCoord xc,wxCoord yc);
|
void DoDrawArc(wxCoord x1,wxCoord y1,wxCoord x2,wxCoord y2,wxCoord xc,wxCoord yc);
|
||||||
void DoDrawEllipticArc(wxCoord x,wxCoord y,wxCoord w,wxCoord h,double sa,double ea);
|
void DoDrawEllipticArc(wxCoord x,wxCoord y,wxCoord w,wxCoord h,double sa,double ea);
|
||||||
void DoDrawPoint(wxCoord x, wxCoord y);
|
void DoDrawPoint(wxCoord x, wxCoord y);
|
||||||
void DoDrawLines(int n, wxPoint points[], wxCoord xoffset = 0, wxCoord yoffset = 0);
|
void DoDrawLines(int n, const wxPoint points[], wxCoord xoffset = 0, wxCoord yoffset = 0);
|
||||||
void DoDrawPolygon(int n, wxPoint points[],
|
void DoDrawPolygon(int n, const wxPoint points[],
|
||||||
wxCoord xoffset = 0, wxCoord yoffset = 0,
|
wxCoord xoffset = 0, wxCoord yoffset = 0,
|
||||||
wxPolygonFillMode fillStyle = wxODDEVEN_RULE);
|
wxPolygonFillMode fillStyle = wxODDEVEN_RULE);
|
||||||
void DoDrawPolyPolygon(int n, int count[], wxPoint points[],
|
void DoDrawPolyPolygon(int n, const int count[], const wxPoint points[],
|
||||||
wxCoord xoffset = 0, wxCoord yoffset = 0,
|
wxCoord xoffset = 0, wxCoord yoffset = 0,
|
||||||
wxPolygonFillMode fillStyle = wxODDEVEN_RULE);
|
wxPolygonFillMode fillStyle = wxODDEVEN_RULE);
|
||||||
void DoDrawRectangle(wxCoord x, wxCoord y, wxCoord width, wxCoord height);
|
void DoDrawRectangle(wxCoord x, wxCoord y, wxCoord width, wxCoord height);
|
||||||
|
@@ -40,9 +40,9 @@ public:
|
|||||||
double sa, double ea );
|
double sa, double ea );
|
||||||
virtual void DoDrawPoint( wxCoord x, wxCoord y );
|
virtual void DoDrawPoint( wxCoord x, wxCoord y );
|
||||||
|
|
||||||
virtual void DoDrawLines(int n, wxPoint points[],
|
virtual void DoDrawLines(int n, const wxPoint points[],
|
||||||
wxCoord xoffset, wxCoord yoffset);
|
wxCoord xoffset, wxCoord yoffset);
|
||||||
virtual void DoDrawPolygon(int n, wxPoint points[],
|
virtual void DoDrawPolygon(int n, const wxPoint points[],
|
||||||
wxCoord xoffset, wxCoord yoffset,
|
wxCoord xoffset, wxCoord yoffset,
|
||||||
wxPolygonFillMode fillStyle = wxODDEVEN_RULE);
|
wxPolygonFillMode fillStyle = wxODDEVEN_RULE);
|
||||||
|
|
||||||
|
@@ -258,9 +258,9 @@ protected:
|
|||||||
void DoDrawArc(wxCoord x1,wxCoord y1,wxCoord x2,wxCoord y2,wxCoord xc,wxCoord yc);
|
void DoDrawArc(wxCoord x1,wxCoord y1,wxCoord x2,wxCoord y2,wxCoord xc,wxCoord yc);
|
||||||
void DoDrawEllipticArc(wxCoord x,wxCoord y,wxCoord w,wxCoord h,double sa,double ea);
|
void DoDrawEllipticArc(wxCoord x,wxCoord y,wxCoord w,wxCoord h,double sa,double ea);
|
||||||
void DoDrawPoint(wxCoord x, wxCoord y);
|
void DoDrawPoint(wxCoord x, wxCoord y);
|
||||||
void DoDrawLines(int n, wxPoint points[], wxCoord xoffset = 0, wxCoord yoffset = 0);
|
void DoDrawLines(int n, const wxPoint points[], wxCoord xoffset = 0, wxCoord yoffset = 0);
|
||||||
void DoDrawPolygon(int n, wxPoint points[], wxCoord xoffset = 0, wxCoord yoffset = 0, wxPolygonFillMode fillStyle=wxODDEVEN_RULE);
|
void DoDrawPolygon(int n, const 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 DoDrawPolyPolygon(int n, const int count[], const wxPoint points[], wxCoord xoffset = 0, wxCoord yoffset = 0, wxPolygonFillMode fillStyle=wxODDEVEN_RULE);
|
||||||
void DoDrawRectangle(wxCoord x, wxCoord y, wxCoord width, wxCoord height);
|
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 DoDrawRoundedRectangle(wxCoord x, wxCoord y, wxCoord width, wxCoord height, double radius = 20.0);
|
||||||
void DoDrawEllipse(wxCoord x, wxCoord y, wxCoord width, wxCoord height);
|
void DoDrawEllipse(wxCoord x, wxCoord y, wxCoord width, wxCoord height);
|
||||||
|
@@ -266,9 +266,9 @@ protected:
|
|||||||
void DoDrawArc(wxCoord x1,wxCoord y1,wxCoord x2,wxCoord y2,wxCoord xc,wxCoord yc);
|
void DoDrawArc(wxCoord x1,wxCoord y1,wxCoord x2,wxCoord y2,wxCoord xc,wxCoord yc);
|
||||||
void DoDrawEllipticArc(wxCoord x,wxCoord y,wxCoord w,wxCoord h,double sa,double ea);
|
void DoDrawEllipticArc(wxCoord x,wxCoord y,wxCoord w,wxCoord h,double sa,double ea);
|
||||||
void DoDrawPoint(wxCoord x, wxCoord y);
|
void DoDrawPoint(wxCoord x, wxCoord y);
|
||||||
void DoDrawLines(int n, wxPoint points[], wxCoord xoffset = 0, wxCoord yoffset = 0);
|
void DoDrawLines(int n, const wxPoint points[], wxCoord xoffset = 0, wxCoord yoffset = 0);
|
||||||
void DoDrawPolygon(int n, wxPoint points[], wxCoord xoffset = 0, wxCoord yoffset = 0, wxPolygonFillMode fillStyle=wxODDEVEN_RULE);
|
void DoDrawPolygon(int n, const 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 DoDrawPolyPolygon(int n, const int count[], const wxPoint points[], wxCoord xoffset = 0, wxCoord yoffset = 0, wxPolygonFillMode fillStyle=wxODDEVEN_RULE);
|
||||||
void DoDrawRectangle(wxCoord x, wxCoord y, wxCoord width, wxCoord height);
|
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 DoDrawRoundedRectangle(wxCoord x, wxCoord y, wxCoord width, wxCoord height, double radius = 20.0);
|
||||||
void DoDrawEllipse(wxCoord x, wxCoord y, wxCoord width, wxCoord height);
|
void DoDrawEllipse(wxCoord x, wxCoord y, wxCoord width, wxCoord height);
|
||||||
|
@@ -49,9 +49,9 @@ protected:
|
|||||||
double sa, double ea );
|
double sa, double ea );
|
||||||
virtual void DoDrawPoint( wxCoord x, wxCoord y );
|
virtual void DoDrawPoint( wxCoord x, wxCoord y );
|
||||||
|
|
||||||
virtual void DoDrawLines(int n, wxPoint points[],
|
virtual void DoDrawLines(int n, const wxPoint points[],
|
||||||
wxCoord xoffset, wxCoord yoffset);
|
wxCoord xoffset, wxCoord yoffset);
|
||||||
virtual void DoDrawPolygon(int n, wxPoint points[],
|
virtual void DoDrawPolygon(int n, const wxPoint points[],
|
||||||
wxCoord xoffset, wxCoord yoffset,
|
wxCoord xoffset, wxCoord yoffset,
|
||||||
wxPolygonFillMode fillStyle = wxODDEVEN_RULE);
|
wxPolygonFillMode fillStyle = wxODDEVEN_RULE);
|
||||||
|
|
||||||
|
@@ -121,9 +121,9 @@ protected:
|
|||||||
wxCoord width, wxCoord height);
|
wxCoord width, wxCoord height);
|
||||||
virtual void DoSetDeviceClippingRegion(const wxRegion& region);
|
virtual void DoSetDeviceClippingRegion(const wxRegion& region);
|
||||||
|
|
||||||
virtual void DoDrawLines(int n, wxPoint points[],
|
virtual void DoDrawLines(int n, const wxPoint points[],
|
||||||
wxCoord xoffset, wxCoord yoffset);
|
wxCoord xoffset, wxCoord yoffset);
|
||||||
virtual void DoDrawPolygon(int n, wxPoint points[],
|
virtual void DoDrawPolygon(int n, const wxPoint points[],
|
||||||
wxCoord xoffset, wxCoord yoffset,
|
wxCoord xoffset, wxCoord yoffset,
|
||||||
wxPolygonFillMode fillStyle = wxODDEVEN_RULE);
|
wxPolygonFillMode fillStyle = wxODDEVEN_RULE);
|
||||||
|
|
||||||
|
@@ -249,12 +249,12 @@ public:
|
|||||||
|
|
||||||
virtual void DoGetSizeMM(int* width, int* height) const;
|
virtual void DoGetSizeMM(int* width, int* height) const;
|
||||||
|
|
||||||
virtual void DoDrawLines(int n, wxPoint points[],
|
virtual void DoDrawLines(int n, const wxPoint points[],
|
||||||
wxCoord xoffset, wxCoord yoffset);
|
wxCoord xoffset, wxCoord yoffset);
|
||||||
virtual void DoDrawPolygon(int n, wxPoint points[],
|
virtual void DoDrawPolygon(int n, const wxPoint points[],
|
||||||
wxCoord xoffset, wxCoord yoffset,
|
wxCoord xoffset, wxCoord yoffset,
|
||||||
wxPolygonFillMode fillStyle = wxODDEVEN_RULE);
|
wxPolygonFillMode fillStyle = wxODDEVEN_RULE);
|
||||||
virtual void DoDrawPolyPolygon(int n, int count[], wxPoint points[],
|
virtual void DoDrawPolyPolygon(int n, const int count[], const wxPoint points[],
|
||||||
wxCoord xoffset, wxCoord yoffset,
|
wxCoord xoffset, wxCoord yoffset,
|
||||||
wxPolygonFillMode fillStyle = wxODDEVEN_RULE);
|
wxPolygonFillMode fillStyle = wxODDEVEN_RULE);
|
||||||
virtual wxBitmap DoGetAsBitmap(const wxRect *subrect) const
|
virtual wxBitmap DoGetAsBitmap(const wxRect *subrect) const
|
||||||
|
@@ -336,12 +336,12 @@ public:
|
|||||||
) const;
|
) const;
|
||||||
|
|
||||||
virtual void DoDrawLines( int n
|
virtual void DoDrawLines( int n
|
||||||
,wxPoint vaPoints[]
|
,const wxPoint vaPoints[]
|
||||||
,wxCoord vXoffset
|
,wxCoord vXoffset
|
||||||
,wxCoord yYoffset
|
,wxCoord yYoffset
|
||||||
);
|
);
|
||||||
virtual void DoDrawPolygon( int n
|
virtual void DoDrawPolygon( int n
|
||||||
,wxPoint vaPoints[]
|
,const wxPoint vaPoints[]
|
||||||
,wxCoord vXoffset
|
,wxCoord vXoffset
|
||||||
,wxCoord vYoffset
|
,wxCoord vYoffset
|
||||||
,wxPolygonFillMode nFillStyle = wxODDEVEN_RULE
|
,wxPolygonFillMode nFillStyle = wxODDEVEN_RULE
|
||||||
|
@@ -77,9 +77,9 @@ protected:
|
|||||||
wxCoord width, wxCoord height);
|
wxCoord width, wxCoord height);
|
||||||
virtual void DoSetDeviceClippingRegion(const wxRegion& region);
|
virtual void DoSetDeviceClippingRegion(const wxRegion& region);
|
||||||
|
|
||||||
virtual void DoDrawLines(int n, wxPoint points[],
|
virtual void DoDrawLines(int n, const wxPoint points[],
|
||||||
wxCoord xoffset, wxCoord yoffset);
|
wxCoord xoffset, wxCoord yoffset);
|
||||||
virtual void DoDrawPolygon(int n, wxPoint points[],
|
virtual void DoDrawPolygon(int n, const wxPoint points[],
|
||||||
wxCoord xoffset, wxCoord yoffset,
|
wxCoord xoffset, wxCoord yoffset,
|
||||||
wxPolygonFillMode fillStyle = wxODDEVEN_RULE);
|
wxPolygonFillMode fillStyle = wxODDEVEN_RULE);
|
||||||
|
|
||||||
|
@@ -413,7 +413,7 @@ public:
|
|||||||
Not supported by wxPerl.
|
Not supported by wxPerl.
|
||||||
@endWxPerlOnly
|
@endWxPerlOnly
|
||||||
*/
|
*/
|
||||||
void DrawLines(int n, wxPoint points[], wxCoord xoffset = 0,
|
void DrawLines(int n, const wxPoint points[], wxCoord xoffset = 0,
|
||||||
wxCoord yoffset = 0);
|
wxCoord yoffset = 0);
|
||||||
/**
|
/**
|
||||||
This method uses a list of wxPoints, adding the optional offset
|
This method uses a list of wxPoints, adding the optional offset
|
||||||
@@ -455,7 +455,7 @@ public:
|
|||||||
Not supported by wxPerl.
|
Not supported by wxPerl.
|
||||||
@endWxPerlOnly
|
@endWxPerlOnly
|
||||||
*/
|
*/
|
||||||
void DrawPolygon(int n, wxPoint points[], wxCoord xoffset = 0,
|
void DrawPolygon(int n, const wxPoint points[], wxCoord xoffset = 0,
|
||||||
wxCoord yoffset = 0,
|
wxCoord yoffset = 0,
|
||||||
wxPolygonFillMode fill_style = wxODDEVEN_RULE);
|
wxPolygonFillMode fill_style = wxODDEVEN_RULE);
|
||||||
/**
|
/**
|
||||||
@@ -504,7 +504,7 @@ public:
|
|||||||
the DrawPolygon() member function, the polygons created by this
|
the DrawPolygon() member function, the polygons created by this
|
||||||
method are not closed automatically.
|
method are not closed automatically.
|
||||||
*/
|
*/
|
||||||
void DrawPolyPolygon(int n, int count[], wxPoint points[],
|
void DrawPolyPolygon(int n, const int count[], const wxPoint points[],
|
||||||
wxCoord xoffset = 0, wxCoord yoffset = 0,
|
wxCoord xoffset = 0, wxCoord yoffset = 0,
|
||||||
wxPolygonFillMode fill_style = wxODDEVEN_RULE);
|
wxPolygonFillMode fill_style = wxODDEVEN_RULE);
|
||||||
|
|
||||||
@@ -579,7 +579,7 @@ public:
|
|||||||
Not supported by wxPerl.
|
Not supported by wxPerl.
|
||||||
@endWxPerlOnly
|
@endWxPerlOnly
|
||||||
*/
|
*/
|
||||||
void DrawSpline(int n, wxPoint points[]);
|
void DrawSpline(int n, const wxPoint points[]);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@overload
|
@overload
|
||||||
|
@@ -362,11 +362,11 @@ void wxCocoaDCImpl::DoDrawPoint( int x, int y )
|
|||||||
{
|
{
|
||||||
};
|
};
|
||||||
|
|
||||||
void wxCocoaDCImpl::DoDrawPolygon( int, wxPoint *, int, int, wxPolygonFillMode)
|
void wxCocoaDCImpl::DoDrawPolygon( int, const wxPoint *, int, int, wxPolygonFillMode)
|
||||||
{
|
{
|
||||||
};
|
};
|
||||||
|
|
||||||
void wxCocoaDCImpl::DoDrawLines( int, wxPoint *, int, int )
|
void wxCocoaDCImpl::DoDrawLines( int, const wxPoint *, int, int )
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -622,8 +622,8 @@ void wxDCImpl::DrawPolygon(const wxPointList *list,
|
|||||||
|
|
||||||
void
|
void
|
||||||
wxDCImpl::DoDrawPolyPolygon(int n,
|
wxDCImpl::DoDrawPolyPolygon(int n,
|
||||||
int count[],
|
const int count[],
|
||||||
wxPoint points[],
|
const wxPoint points[],
|
||||||
wxCoord xoffset, wxCoord yoffset,
|
wxCoord xoffset, wxCoord yoffset,
|
||||||
wxPolygonFillMode fillStyle)
|
wxPolygonFillMode fillStyle)
|
||||||
{
|
{
|
||||||
@@ -673,11 +673,11 @@ void wxDCImpl::DrawSpline(wxCoord x1, wxCoord y1,
|
|||||||
DrawSpline(WXSIZEOF(points), points);
|
DrawSpline(WXSIZEOF(points), points);
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxDCImpl::DrawSpline(int n, wxPoint points[])
|
void wxDCImpl::DrawSpline(int n, const wxPoint points[])
|
||||||
{
|
{
|
||||||
wxPointList list;
|
wxPointList list;
|
||||||
for ( int i = 0; i < n; i++ )
|
for ( int i = 0; i < n; i++ )
|
||||||
list.Append(&points[i]);
|
list.Append(const_cast<wxPoint*>(&points[i]));
|
||||||
|
|
||||||
DrawSpline(&list);
|
DrawSpline(&list);
|
||||||
}
|
}
|
||||||
@@ -799,7 +799,7 @@ void wxDCImpl::DoDrawSpline( const wxPointList *points )
|
|||||||
{
|
{
|
||||||
wxCHECK_RET( IsOk(), wxT("invalid window dc") );
|
wxCHECK_RET( IsOk(), wxT("invalid window dc") );
|
||||||
|
|
||||||
wxPoint *p;
|
const wxPoint *p;
|
||||||
double cx1, cy1, cx2, cy2, cx3, cy3, cx4, cy4;
|
double cx1, cy1, cx2, cy2, cx3, cy3, cx4, cy4;
|
||||||
double x1, y1, x2, y2;
|
double x1, y1, x2, y2;
|
||||||
|
|
||||||
@@ -808,7 +808,7 @@ void wxDCImpl::DoDrawSpline( const wxPointList *points )
|
|||||||
// empty list
|
// empty list
|
||||||
return;
|
return;
|
||||||
|
|
||||||
p = (wxPoint *)node->GetData();
|
p = node->GetData();
|
||||||
|
|
||||||
x1 = p->x;
|
x1 = p->x;
|
||||||
y1 = p->y;
|
y1 = p->y;
|
||||||
|
@@ -608,7 +608,7 @@ void wxGCDCImpl::DoDrawPoint( wxCoord x, wxCoord y )
|
|||||||
DoDrawLine( x , y , x + 1 , y + 1 );
|
DoDrawLine( x , y , x + 1 , y + 1 );
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxGCDCImpl::DoDrawLines(int n, wxPoint points[],
|
void wxGCDCImpl::DoDrawLines(int n, const wxPoint points[],
|
||||||
wxCoord xoffset, wxCoord yoffset)
|
wxCoord xoffset, wxCoord yoffset)
|
||||||
{
|
{
|
||||||
wxCHECK_RET( IsOk(), wxT("wxGCDC(cg)::DoDrawLines - invalid DC") );
|
wxCHECK_RET( IsOk(), wxT("wxGCDC(cg)::DoDrawLines - invalid DC") );
|
||||||
@@ -642,7 +642,7 @@ void wxGCDCImpl::DoDrawSpline(const wxPointList *points)
|
|||||||
// empty list
|
// empty list
|
||||||
return;
|
return;
|
||||||
|
|
||||||
wxPoint *p = node->GetData();
|
const wxPoint *p = node->GetData();
|
||||||
|
|
||||||
wxCoord x1 = p->x;
|
wxCoord x1 = p->x;
|
||||||
wxCoord y1 = p->y;
|
wxCoord y1 = p->y;
|
||||||
@@ -686,7 +686,7 @@ void wxGCDCImpl::DoDrawSpline(const wxPointList *points)
|
|||||||
}
|
}
|
||||||
#endif // wxUSE_SPLINES
|
#endif // wxUSE_SPLINES
|
||||||
|
|
||||||
void wxGCDCImpl::DoDrawPolygon( int n, wxPoint points[],
|
void wxGCDCImpl::DoDrawPolygon( int n, const wxPoint points[],
|
||||||
wxCoord xoffset, wxCoord yoffset,
|
wxCoord xoffset, wxCoord yoffset,
|
||||||
wxPolygonFillMode fillStyle )
|
wxPolygonFillMode fillStyle )
|
||||||
{
|
{
|
||||||
@@ -715,8 +715,8 @@ void wxGCDCImpl::DoDrawPolygon( int n, wxPoint points[],
|
|||||||
}
|
}
|
||||||
|
|
||||||
void wxGCDCImpl::DoDrawPolyPolygon(int n,
|
void wxGCDCImpl::DoDrawPolyPolygon(int n,
|
||||||
int count[],
|
const int count[],
|
||||||
wxPoint points[],
|
const wxPoint points[],
|
||||||
wxCoord xoffset,
|
wxCoord xoffset,
|
||||||
wxCoord yoffset,
|
wxCoord yoffset,
|
||||||
wxPolygonFillMode fillStyle)
|
wxPolygonFillMode fillStyle)
|
||||||
|
@@ -209,7 +209,7 @@ void wxSVGFileDCImpl::DoDrawLine (wxCoord x1, wxCoord y1, wxCoord x2, wxCoord y2
|
|||||||
CalcBoundingBox(x2, y2);
|
CalcBoundingBox(x2, y2);
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxSVGFileDCImpl::DoDrawLines(int n, wxPoint points[], wxCoord xoffset , wxCoord yoffset )
|
void wxSVGFileDCImpl::DoDrawLines(int n, const wxPoint points[], wxCoord xoffset , wxCoord yoffset )
|
||||||
{
|
{
|
||||||
for ( int i = 1; i < n; i++ )
|
for ( int i = 1; i < n; i++ )
|
||||||
{
|
{
|
||||||
@@ -322,7 +322,7 @@ void wxSVGFileDCImpl::DoDrawRoundedRectangle(wxCoord x, wxCoord y, wxCoord width
|
|||||||
CalcBoundingBox(x + width, y + height);
|
CalcBoundingBox(x + width, y + height);
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxSVGFileDCImpl::DoDrawPolygon(int n, wxPoint points[],
|
void wxSVGFileDCImpl::DoDrawPolygon(int n, const wxPoint points[],
|
||||||
wxCoord xoffset, wxCoord yoffset,
|
wxCoord xoffset, wxCoord yoffset,
|
||||||
wxPolygonFillMode fillStyle)
|
wxPolygonFillMode fillStyle)
|
||||||
{
|
{
|
||||||
|
@@ -239,7 +239,7 @@ void wxDFBDCImpl::DoDrawPoint(wxCoord x, wxCoord y)
|
|||||||
// FIXME_DFB: implement special cases for common formats (RGB24,RGBA/RGB32)
|
// FIXME_DFB: implement special cases for common formats (RGB24,RGBA/RGB32)
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxDFBDCImpl::DoDrawPolygon(int WXUNUSED(n), wxPoint WXUNUSED(points)[],
|
void wxDFBDCImpl::DoDrawPolygon(int WXUNUSED(n), const wxPoint WXUNUSED(points)[],
|
||||||
wxCoord WXUNUSED(xoffset), wxCoord WXUNUSED(yoffset),
|
wxCoord WXUNUSED(xoffset), wxCoord WXUNUSED(yoffset),
|
||||||
wxPolygonFillMode WXUNUSED(fillStyle))
|
wxPolygonFillMode WXUNUSED(fillStyle))
|
||||||
{
|
{
|
||||||
@@ -248,7 +248,7 @@ void wxDFBDCImpl::DoDrawPolygon(int WXUNUSED(n), wxPoint WXUNUSED(points)[],
|
|||||||
wxFAIL_MSG( "DrawPolygon not implemented" );
|
wxFAIL_MSG( "DrawPolygon not implemented" );
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxDFBDCImpl::DoDrawLines(int WXUNUSED(n), wxPoint WXUNUSED(points)[],
|
void wxDFBDCImpl::DoDrawLines(int WXUNUSED(n), const wxPoint WXUNUSED(points)[],
|
||||||
wxCoord WXUNUSED(xoffset), wxCoord WXUNUSED(yoffset))
|
wxCoord WXUNUSED(xoffset), wxCoord WXUNUSED(yoffset))
|
||||||
{
|
{
|
||||||
wxCHECK_RET( IsOk(), wxT("invalid dc") );
|
wxCHECK_RET( IsOk(), wxT("invalid dc") );
|
||||||
|
@@ -597,7 +597,7 @@ void wxPostScriptDCImpl::DoDrawPoint (wxCoord x, wxCoord y)
|
|||||||
CalcBoundingBox( x, y );
|
CalcBoundingBox( x, y );
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxPostScriptDCImpl::DoDrawPolygon (int n, wxPoint points[], wxCoord xoffset, wxCoord yoffset, wxPolygonFillMode fillStyle)
|
void wxPostScriptDCImpl::DoDrawPolygon (int n, const wxPoint points[], wxCoord xoffset, wxCoord yoffset, wxPolygonFillMode fillStyle)
|
||||||
{
|
{
|
||||||
wxCHECK_RET( m_ok, wxT("invalid postscript dc") );
|
wxCHECK_RET( m_ok, wxT("invalid postscript dc") );
|
||||||
|
|
||||||
@@ -667,7 +667,7 @@ void wxPostScriptDCImpl::DoDrawPolygon (int n, wxPoint points[], wxCoord xoffset
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxPostScriptDCImpl::DoDrawPolyPolygon (int n, int count[], wxPoint points[], wxCoord xoffset, wxCoord yoffset, wxPolygonFillMode fillStyle)
|
void wxPostScriptDCImpl::DoDrawPolyPolygon (int n, const int count[], const wxPoint points[], wxCoord xoffset, wxCoord yoffset, wxPolygonFillMode fillStyle)
|
||||||
{
|
{
|
||||||
wxCHECK_RET( m_ok, wxT("invalid postscript dc") );
|
wxCHECK_RET( m_ok, wxT("invalid postscript dc") );
|
||||||
|
|
||||||
@@ -743,7 +743,7 @@ void wxPostScriptDCImpl::DoDrawPolyPolygon (int n, int count[], wxPoint points[]
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxPostScriptDCImpl::DoDrawLines (int n, wxPoint points[], wxCoord xoffset, wxCoord yoffset)
|
void wxPostScriptDCImpl::DoDrawLines (int n, const wxPoint points[], wxCoord xoffset, wxCoord yoffset)
|
||||||
{
|
{
|
||||||
wxCHECK_RET( m_ok, wxT("invalid postscript dc") );
|
wxCHECK_RET( m_ok, wxT("invalid postscript dc") );
|
||||||
|
|
||||||
|
@@ -697,7 +697,7 @@ void wxWindowDCImpl::DoDrawPoint( wxCoord x, wxCoord y )
|
|||||||
CalcBoundingBox (x, y);
|
CalcBoundingBox (x, y);
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxWindowDCImpl::DoDrawLines( int n, wxPoint points[], wxCoord xoffset, wxCoord yoffset )
|
void wxWindowDCImpl::DoDrawLines( int n, const wxPoint points[], wxCoord xoffset, wxCoord yoffset )
|
||||||
{
|
{
|
||||||
wxCHECK_RET( IsOk(), wxT("invalid window dc") );
|
wxCHECK_RET( IsOk(), wxT("invalid window dc") );
|
||||||
|
|
||||||
@@ -711,17 +711,21 @@ void wxWindowDCImpl::DoDrawLines( int n, wxPoint points[], wxCoord xoffset, wxCo
|
|||||||
xoffset != 0 || yoffset != 0 || XLOG2DEV(10) != 10 || YLOG2DEV(10) != 10;
|
xoffset != 0 || yoffset != 0 || XLOG2DEV(10) != 10 || YLOG2DEV(10) != 10;
|
||||||
|
|
||||||
// GdkPoint and wxPoint have the same memory layout, so we can cast one to the other
|
// GdkPoint and wxPoint have the same memory layout, so we can cast one to the other
|
||||||
GdkPoint* gpts = reinterpret_cast<GdkPoint*>(points);
|
const GdkPoint* gpts = reinterpret_cast<const GdkPoint*>(points);
|
||||||
|
GdkPoint* gpts_alloc = NULL;
|
||||||
|
|
||||||
if (doScale)
|
if (doScale)
|
||||||
gpts = new GdkPoint[n];
|
{
|
||||||
|
gpts_alloc = new GdkPoint[n];
|
||||||
|
gpts = gpts_alloc;
|
||||||
|
}
|
||||||
|
|
||||||
for (int i = 0; i < n; i++)
|
for (int i = 0; i < n; i++)
|
||||||
{
|
{
|
||||||
if (doScale)
|
if (doScale)
|
||||||
{
|
{
|
||||||
gpts[i].x = XLOG2DEV(points[i].x + xoffset);
|
gpts_alloc[i].x = XLOG2DEV(points[i].x + xoffset);
|
||||||
gpts[i].y = YLOG2DEV(points[i].y + yoffset);
|
gpts_alloc[i].y = YLOG2DEV(points[i].y + yoffset);
|
||||||
}
|
}
|
||||||
CalcBoundingBox(points[i].x + xoffset, points[i].y + yoffset);
|
CalcBoundingBox(points[i].x + xoffset, points[i].y + yoffset);
|
||||||
}
|
}
|
||||||
@@ -729,11 +733,10 @@ void wxWindowDCImpl::DoDrawLines( int n, wxPoint points[], wxCoord xoffset, wxCo
|
|||||||
if (m_gdkwindow)
|
if (m_gdkwindow)
|
||||||
gdk_draw_lines( m_gdkwindow, m_penGC, gpts, n);
|
gdk_draw_lines( m_gdkwindow, m_penGC, gpts, n);
|
||||||
|
|
||||||
if (doScale)
|
delete[] gpts_alloc;
|
||||||
delete[] gpts;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxWindowDCImpl::DoDrawPolygon( int n, wxPoint points[],
|
void wxWindowDCImpl::DoDrawPolygon( int n, const wxPoint points[],
|
||||||
wxCoord xoffset, wxCoord yoffset,
|
wxCoord xoffset, wxCoord yoffset,
|
||||||
wxPolygonFillMode WXUNUSED(fillStyle) )
|
wxPolygonFillMode WXUNUSED(fillStyle) )
|
||||||
{
|
{
|
||||||
@@ -746,18 +749,22 @@ void wxWindowDCImpl::DoDrawPolygon( int n, wxPoint points[],
|
|||||||
xoffset != 0 || yoffset != 0 || XLOG2DEV(10) != 10 || YLOG2DEV(10) != 10;
|
xoffset != 0 || yoffset != 0 || XLOG2DEV(10) != 10 || YLOG2DEV(10) != 10;
|
||||||
|
|
||||||
// GdkPoint and wxPoint have the same memory layout, so we can cast one to the other
|
// GdkPoint and wxPoint have the same memory layout, so we can cast one to the other
|
||||||
GdkPoint* gdkpoints = reinterpret_cast<GdkPoint*>(points);
|
const GdkPoint* gdkpoints = reinterpret_cast<const GdkPoint*>(points);
|
||||||
|
GdkPoint* gdkpoints_alloc = NULL;
|
||||||
|
|
||||||
if (doScale)
|
if (doScale)
|
||||||
gdkpoints = new GdkPoint[n];
|
{
|
||||||
|
gdkpoints_alloc = new GdkPoint[n];
|
||||||
|
gdkpoints = gdkpoints_alloc;
|
||||||
|
}
|
||||||
|
|
||||||
int i;
|
int i;
|
||||||
for (i = 0 ; i < n ; i++)
|
for (i = 0 ; i < n ; i++)
|
||||||
{
|
{
|
||||||
if (doScale)
|
if (doScale)
|
||||||
{
|
{
|
||||||
gdkpoints[i].x = XLOG2DEV(points[i].x + xoffset);
|
gdkpoints_alloc[i].x = XLOG2DEV(points[i].x + xoffset);
|
||||||
gdkpoints[i].y = YLOG2DEV(points[i].y + yoffset);
|
gdkpoints_alloc[i].y = YLOG2DEV(points[i].y + yoffset);
|
||||||
}
|
}
|
||||||
CalcBoundingBox(points[i].x + xoffset, points[i].y + yoffset);
|
CalcBoundingBox(points[i].x + xoffset, points[i].y + yoffset);
|
||||||
}
|
}
|
||||||
@@ -793,8 +800,7 @@ void wxWindowDCImpl::DoDrawPolygon( int n, wxPoint points[],
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (doScale)
|
delete[] gdkpoints_alloc;
|
||||||
delete[] gdkpoints;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxWindowDCImpl::DoDrawRectangle( wxCoord x, wxCoord y, wxCoord width, wxCoord height )
|
void wxWindowDCImpl::DoDrawRectangle( wxCoord x, wxCoord y, wxCoord width, wxCoord height )
|
||||||
|
@@ -1189,7 +1189,7 @@ void wxGnomePrinterDCImpl::DoDrawPoint(wxCoord WXUNUSED(x), wxCoord WXUNUSED(y))
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxGnomePrinterDCImpl::DoDrawLines(int n, wxPoint points[], wxCoord xoffset, wxCoord yoffset)
|
void wxGnomePrinterDCImpl::DoDrawLines(int n, const wxPoint points[], wxCoord xoffset, wxCoord yoffset)
|
||||||
{
|
{
|
||||||
if (n <= 0) return;
|
if (n <= 0) return;
|
||||||
|
|
||||||
@@ -1210,7 +1210,7 @@ void wxGnomePrinterDCImpl::DoDrawLines(int n, wxPoint points[], wxCoord xoffset,
|
|||||||
gs_libGnomePrint->gnome_print_stroke ( m_gpc);
|
gs_libGnomePrint->gnome_print_stroke ( m_gpc);
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxGnomePrinterDCImpl::DoDrawPolygon(int n, wxPoint points[],
|
void wxGnomePrinterDCImpl::DoDrawPolygon(int n, const wxPoint points[],
|
||||||
wxCoord xoffset, wxCoord yoffset,
|
wxCoord xoffset, wxCoord yoffset,
|
||||||
wxPolygonFillMode WXUNUSED(fillStyle))
|
wxPolygonFillMode WXUNUSED(fillStyle))
|
||||||
{
|
{
|
||||||
@@ -1258,7 +1258,7 @@ void wxGnomePrinterDCImpl::DoDrawPolygon(int n, wxPoint points[],
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxGnomePrinterDCImpl::DoDrawPolyPolygon(int n, int count[], wxPoint points[], wxCoord xoffset, wxCoord yoffset, wxPolygonFillMode fillStyle)
|
void wxGnomePrinterDCImpl::DoDrawPolyPolygon(int n, const int count[], const wxPoint points[], wxCoord xoffset, wxCoord yoffset, wxPolygonFillMode fillStyle)
|
||||||
{
|
{
|
||||||
#if wxUSE_NEW_DC
|
#if wxUSE_NEW_DC
|
||||||
wxDCImpl::DoDrawPolyPolygon( n, count, points, xoffset, yoffset, fillStyle );
|
wxDCImpl::DoDrawPolyPolygon( n, count, points, xoffset, yoffset, fillStyle );
|
||||||
|
@@ -1457,7 +1457,7 @@ void wxGtkPrinterDCImpl::DoDrawPoint(wxCoord x, wxCoord y)
|
|||||||
CalcBoundingBox( x, y );
|
CalcBoundingBox( x, y );
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxGtkPrinterDCImpl::DoDrawLines(int n, wxPoint points[], wxCoord xoffset, wxCoord yoffset)
|
void wxGtkPrinterDCImpl::DoDrawLines(int n, const wxPoint points[], wxCoord xoffset, wxCoord yoffset)
|
||||||
{
|
{
|
||||||
if ( m_pen.IsTransparent() )
|
if ( m_pen.IsTransparent() )
|
||||||
return;
|
return;
|
||||||
@@ -1479,7 +1479,7 @@ void wxGtkPrinterDCImpl::DoDrawLines(int n, wxPoint points[], wxCoord xoffset, w
|
|||||||
cairo_stroke ( m_cairo);
|
cairo_stroke ( m_cairo);
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxGtkPrinterDCImpl::DoDrawPolygon(int n, wxPoint points[],
|
void wxGtkPrinterDCImpl::DoDrawPolygon(int n, const wxPoint points[],
|
||||||
wxCoord xoffset, wxCoord yoffset,
|
wxCoord xoffset, wxCoord yoffset,
|
||||||
wxPolygonFillMode fillStyle)
|
wxPolygonFillMode fillStyle)
|
||||||
{
|
{
|
||||||
@@ -1515,7 +1515,7 @@ void wxGtkPrinterDCImpl::DoDrawPolygon(int n, wxPoint points[],
|
|||||||
cairo_restore(m_cairo);
|
cairo_restore(m_cairo);
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxGtkPrinterDCImpl::DoDrawPolyPolygon(int n, int count[], wxPoint points[],
|
void wxGtkPrinterDCImpl::DoDrawPolyPolygon(int n, const int count[], const wxPoint points[],
|
||||||
wxCoord xoffset, wxCoord yoffset,
|
wxCoord xoffset, wxCoord yoffset,
|
||||||
wxPolygonFillMode fillStyle)
|
wxPolygonFillMode fillStyle)
|
||||||
{
|
{
|
||||||
|
@@ -649,7 +649,7 @@ void wxWindowDCImpl::DoDrawPoint( wxCoord x, wxCoord y )
|
|||||||
CalcBoundingBox (x, y);
|
CalcBoundingBox (x, y);
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxWindowDCImpl::DoDrawLines( int n, wxPoint points[], wxCoord xoffset, wxCoord yoffset )
|
void wxWindowDCImpl::DoDrawLines( int n, const wxPoint points[], wxCoord xoffset, wxCoord yoffset )
|
||||||
{
|
{
|
||||||
wxCHECK_RET( IsOk(), wxT("invalid window dc") );
|
wxCHECK_RET( IsOk(), wxT("invalid window dc") );
|
||||||
|
|
||||||
@@ -680,7 +680,7 @@ void wxWindowDCImpl::DoDrawLines( int n, wxPoint points[], wxCoord xoffset, wxCo
|
|||||||
delete[] gpts;
|
delete[] gpts;
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxWindowDCImpl::DoDrawPolygon( int n, wxPoint points[], wxCoord xoffset, wxCoord yoffset, wxPolygonFillMode WXUNUSED(fillStyle) )
|
void wxWindowDCImpl::DoDrawPolygon( int n, const wxPoint points[], wxCoord xoffset, wxCoord yoffset, wxPolygonFillMode WXUNUSED(fillStyle) )
|
||||||
{
|
{
|
||||||
wxCHECK_RET( IsOk(), wxT("invalid window dc") );
|
wxCHECK_RET( IsOk(), wxT("invalid window dc") );
|
||||||
|
|
||||||
|
@@ -438,7 +438,7 @@ void wxWindowDCImpl::DoDrawPoint( wxCoord x, wxCoord y )
|
|||||||
CalcBoundingBox (x, y);
|
CalcBoundingBox (x, y);
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxWindowDCImpl::DoDrawLines( int n, wxPoint points[], wxCoord xoffset, wxCoord yoffset )
|
void wxWindowDCImpl::DoDrawLines( int n, const wxPoint points[], wxCoord xoffset, wxCoord yoffset )
|
||||||
{
|
{
|
||||||
wxCHECK_RET( IsOk(), "invalid dc" );
|
wxCHECK_RET( IsOk(), "invalid dc" );
|
||||||
|
|
||||||
@@ -470,7 +470,7 @@ void wxWindowDCImpl::DoDrawLines( int n, wxPoint points[], wxCoord xoffset, wxCo
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxWindowDCImpl::DoDrawPolygon( int n, wxPoint points[],
|
void wxWindowDCImpl::DoDrawPolygon( int n, const wxPoint points[],
|
||||||
wxCoord xoffset, wxCoord yoffset, wxPolygonFillMode fillStyle )
|
wxCoord xoffset, wxCoord yoffset, wxPolygonFillMode fillStyle )
|
||||||
{
|
{
|
||||||
wxCHECK_RET( IsOk(), "invalid dc" );
|
wxCHECK_RET( IsOk(), "invalid dc" );
|
||||||
|
@@ -881,7 +881,7 @@ void wxMSWDCImpl::DoDrawPoint(wxCoord x, wxCoord y)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void wxMSWDCImpl::DoDrawPolygon(int n,
|
void wxMSWDCImpl::DoDrawPolygon(int n,
|
||||||
wxPoint points[],
|
const wxPoint points[],
|
||||||
wxCoord xoffset,
|
wxCoord xoffset,
|
||||||
wxCoord yoffset,
|
wxCoord yoffset,
|
||||||
wxPolygonFillMode WXUNUSED_IN_WINCE(fillStyle))
|
wxPolygonFillMode WXUNUSED_IN_WINCE(fillStyle))
|
||||||
@@ -929,8 +929,8 @@ void wxMSWDCImpl::DoDrawPolygon(int n,
|
|||||||
|
|
||||||
void
|
void
|
||||||
wxMSWDCImpl::DoDrawPolyPolygon(int n,
|
wxMSWDCImpl::DoDrawPolyPolygon(int n,
|
||||||
int count[],
|
const int count[],
|
||||||
wxPoint points[],
|
const wxPoint points[],
|
||||||
wxCoord xoffset,
|
wxCoord xoffset,
|
||||||
wxCoord yoffset,
|
wxCoord yoffset,
|
||||||
wxPolygonFillMode fillStyle)
|
wxPolygonFillMode fillStyle)
|
||||||
@@ -982,7 +982,7 @@ wxMSWDCImpl::DoDrawPolyPolygon(int n,
|
|||||||
// __WXWINCE__
|
// __WXWINCE__
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxMSWDCImpl::DoDrawLines(int n, wxPoint points[], wxCoord xoffset, wxCoord yoffset)
|
void wxMSWDCImpl::DoDrawLines(int n, const wxPoint points[], wxCoord xoffset, wxCoord yoffset)
|
||||||
{
|
{
|
||||||
WXMICROWIN_CHECK_HDC
|
WXMICROWIN_CHECK_HDC
|
||||||
|
|
||||||
|
@@ -836,7 +836,7 @@ void wxPMDCImpl::DoDrawPoint(
|
|||||||
} // end of wxPMDCImpl::DoDrawPoint
|
} // end of wxPMDCImpl::DoDrawPoint
|
||||||
|
|
||||||
void wxPMDCImpl::DoDrawPolygon( int n,
|
void wxPMDCImpl::DoDrawPolygon( int n,
|
||||||
wxPoint vPoints[],
|
const wxPoint vPoints[],
|
||||||
wxCoord vXoffset,
|
wxCoord vXoffset,
|
||||||
wxCoord vYoffset,
|
wxCoord vYoffset,
|
||||||
wxPolygonFillMode nFillStyle )
|
wxPolygonFillMode nFillStyle )
|
||||||
@@ -903,7 +903,7 @@ void wxPMDCImpl::DoDrawPolygon( int n,
|
|||||||
|
|
||||||
void wxPMDCImpl::DoDrawLines(
|
void wxPMDCImpl::DoDrawLines(
|
||||||
int n
|
int n
|
||||||
, wxPoint vPoints[]
|
, const wxPoint vPoints[]
|
||||||
, wxCoord vXoffset
|
, wxCoord vXoffset
|
||||||
, wxCoord vYoffset
|
, wxCoord vYoffset
|
||||||
)
|
)
|
||||||
|
@@ -621,7 +621,7 @@ void wxWindowDCImpl::DoDrawPoint( wxCoord x, wxCoord y )
|
|||||||
CalcBoundingBox (x, y);
|
CalcBoundingBox (x, y);
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxWindowDCImpl::DoDrawLines( int n, wxPoint points[], wxCoord xoffset, wxCoord yoffset )
|
void wxWindowDCImpl::DoDrawLines( int n, const wxPoint points[], wxCoord xoffset, wxCoord yoffset )
|
||||||
{
|
{
|
||||||
wxCHECK_RET( IsOk(), wxT("invalid window dc") );
|
wxCHECK_RET( IsOk(), wxT("invalid window dc") );
|
||||||
|
|
||||||
@@ -641,7 +641,7 @@ void wxWindowDCImpl::DoDrawLines( int n, wxPoint points[], wxCoord xoffset, wxCo
|
|||||||
delete[] xpoints;
|
delete[] xpoints;
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxWindowDCImpl::DoDrawPolygon( int n, wxPoint points[],
|
void wxWindowDCImpl::DoDrawPolygon( int n, const wxPoint points[],
|
||||||
wxCoord xoffset, wxCoord yoffset,
|
wxCoord xoffset, wxCoord yoffset,
|
||||||
wxPolygonFillMode WXUNUSED(fillStyle) )
|
wxPolygonFillMode WXUNUSED(fillStyle) )
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user