Make wxSVGFileDC function parameter names consistent with wxDC

This commit is contained in:
Maarten Bent 2019-08-21 21:49:25 +02:00
parent 72ce980d1e
commit bee6168076
2 changed files with 65 additions and 50 deletions

View File

@ -158,61 +158,71 @@ public:
void SetShapeRenderingMode(wxSVGShapeRenderingMode renderingMode);
private:
virtual bool DoGetPixel(wxCoord, wxCoord, wxColour*) const wxOVERRIDE
virtual bool DoGetPixel(wxCoord WXUNUSED(x), wxCoord WXUNUSED(y),
wxColour* WXUNUSED(col)) const wxOVERRIDE
{
wxFAIL_MSG(wxT("wxSVGFILEDC::DoGetPixel Call not implemented"));
return true;
}
virtual bool DoBlit(wxCoord, wxCoord, wxCoord, wxCoord, wxDC*,
wxCoord, wxCoord, wxRasterOperationMode = wxCOPY,
bool = 0, int = -1, int = -1) wxOVERRIDE;
virtual bool DoBlit(wxCoord xdest, wxCoord ydest,
wxCoord width, wxCoord height,
wxDC* source,
wxCoord xsrc, wxCoord ysrc,
wxRasterOperationMode rop,
bool useMask = false,
wxCoord xsrcMask = wxDefaultCoord,
wxCoord ysrcMask = wxDefaultCoord) wxOVERRIDE;
virtual void DoCrossHair(wxCoord, wxCoord) wxOVERRIDE
virtual void DoCrossHair(wxCoord WXUNUSED(x), wxCoord WXUNUSED(y)) wxOVERRIDE
{
wxFAIL_MSG(wxT("wxSVGFILEDC::CrossHair Call not implemented"));
}
virtual void DoDrawArc(wxCoord, wxCoord, wxCoord, wxCoord, wxCoord, wxCoord) wxOVERRIDE;
virtual void DoDrawArc(wxCoord x1, wxCoord y1,
wxCoord x2, wxCoord y2,
wxCoord xc, wxCoord yc) wxOVERRIDE;
virtual void DoDrawBitmap(const wxBitmap&, wxCoord, wxCoord, bool = false) wxOVERRIDE;
virtual void DoDrawBitmap(const wxBitmap& bmp, wxCoord x, wxCoord y,
bool useMask = false) wxOVERRIDE;
virtual void DoDrawEllipse(wxCoord x, wxCoord y, wxCoord w, wxCoord h) wxOVERRIDE;
virtual void DoDrawEllipse(wxCoord x, wxCoord y,
wxCoord width, wxCoord height) wxOVERRIDE;
virtual void DoDrawEllipticArc(wxCoord x, wxCoord y, wxCoord w, wxCoord h,
double sa, double ea) wxOVERRIDE;
virtual void DoDrawIcon(const wxIcon&, wxCoord, wxCoord) wxOVERRIDE;
virtual void DoDrawIcon(const wxIcon& icon, wxCoord x, wxCoord y) wxOVERRIDE;
virtual void DoDrawLine(wxCoord x1, wxCoord y1, wxCoord x2, wxCoord y2) wxOVERRIDE;
virtual void DoDrawLines(int n, const wxPoint points[],
wxCoord xoffset = 0, wxCoord yoffset = 0) wxOVERRIDE;
wxCoord xoffset, wxCoord yoffset) wxOVERRIDE;
virtual void DoDrawPoint(wxCoord, wxCoord) wxOVERRIDE;
virtual void DoDrawPoint(wxCoord x, wxCoord y) wxOVERRIDE;
virtual void DoDrawPolygon(int n, const wxPoint points[],
wxCoord xoffset, wxCoord yoffset,
wxPolygonFillMode fillStyle) wxOVERRIDE;
wxPolygonFillMode fillStyle = wxODDEVEN_RULE) wxOVERRIDE;
virtual void DoDrawPolyPolygon(int n, const int count[], const wxPoint points[],
wxCoord xoffset, wxCoord yoffset,
wxPolygonFillMode fillStyle) wxOVERRIDE;
virtual void DoDrawRectangle(wxCoord x, wxCoord y, wxCoord w, wxCoord h) wxOVERRIDE;
virtual void DoDrawRectangle(wxCoord x, wxCoord y, wxCoord width, wxCoord height) wxOVERRIDE;
virtual void DoDrawRotatedText(const wxString& text, wxCoord x, wxCoord y,
double angle) wxOVERRIDE;
virtual void DoDrawRoundedRectangle(wxCoord x, wxCoord y,
wxCoord w, wxCoord h,
double radius = 20) wxOVERRIDE;
wxCoord width, wxCoord height,
double radius) wxOVERRIDE;
virtual void DoDrawText(const wxString& text, wxCoord x, wxCoord y) wxOVERRIDE;
virtual bool DoFloodFill(wxCoord WXUNUSED(x), wxCoord WXUNUSED(y),
const wxColour& WXUNUSED(col),
wxFloodFillStyle WXUNUSED(style) = wxFLOOD_SURFACE) wxOVERRIDE
wxFloodFillStyle WXUNUSED(style)) wxOVERRIDE
{
wxFAIL_MSG(wxT("wxSVGFILEDC::DoFloodFill Call not implemented"));
return false;
@ -221,25 +231,26 @@ private:
virtual void DoGradientFillLinear(const wxRect& rect,
const wxColour& initialColour,
const wxColour& destColour,
wxDirection nDirection = wxEAST) wxOVERRIDE;
wxDirection nDirection) wxOVERRIDE;
virtual void DoGradientFillConcentric(const wxRect& rect,
const wxColour& initialColour,
const wxColour& destColour,
const wxPoint& circleCenter) wxOVERRIDE;
virtual void DoGetSize(int* x, int*y) const wxOVERRIDE
virtual void DoGetSize(int* width, int* height) const wxOVERRIDE
{
if ( x )
*x = m_width;
if ( y )
*y = m_height;
if ( width )
*width = m_width;
if ( height )
*height = m_height;
}
virtual void DoGetTextExtent(const wxString& string, wxCoord* w, wxCoord* h,
virtual void DoGetTextExtent(const wxString& string,
wxCoord* x, wxCoord* y,
wxCoord* descent = NULL,
wxCoord* externalLeading = NULL,
const wxFont* font = NULL) const wxOVERRIDE;
const wxFont* theFont = NULL) const wxOVERRIDE;
virtual void DoSetDeviceClippingRegion(const wxRegion& region) wxOVERRIDE
{
@ -247,7 +258,8 @@ private:
region.GetBox().width, region.GetBox().height);
}
virtual void DoSetClippingRegion(int x, int y, int width, int height) wxOVERRIDE;
virtual void DoSetClippingRegion(wxCoord x, wxCoord y,
wxCoord w, wxCoord h) wxOVERRIDE;
virtual void DoGetSizeMM(int* width, int* height) const wxOVERRIDE;

View File

@ -488,11 +488,11 @@ wxSVGFileDCImpl::wxSVGFileDCImpl(wxSVGFileDC* owner, const wxString& filename,
Init(filename, width, height, dpi, title);
}
void wxSVGFileDCImpl::Init(const wxString& filename, int Width, int Height,
void wxSVGFileDCImpl::Init(const wxString& filename, int width, int height,
double dpi, const wxString& title)
{
m_width = Width;
m_height = Height;
m_width = width;
m_height = height;
m_dpi = dpi;
@ -532,7 +532,7 @@ void wxSVGFileDCImpl::Init(const wxString& filename, int Width, int Height,
s += wxS("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\n");
s += wxS("<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.0//EN\" \"http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd\">\n\n");
s += wxS("<svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\"");
s += wxString::Format(wxS(" width=\"%scm\" height=\"%scm\" viewBox=\"0 0 %d %d\">\n"), NumStr(float(Width) / dpi * 2.54), NumStr(float(Height) / dpi * 2.54), Width, Height);
s += wxString::Format(wxS(" width=\"%scm\" height=\"%scm\" viewBox=\"0 0 %d %d\">\n"), NumStr(float(m_width) / dpi * 2.54), NumStr(float(m_height) / dpi * 2.54), m_width, m_height);
s += wxString::Format(wxS("<title>%s</title>\n"), title);
s += wxString(wxS("<desc>Picture generated by wxSVG ")) + wxSVGVersion + wxS("</desc>\n\n");
s += wxS("<g style=\"fill:black; stroke:black; stroke-width:1\">\n");
@ -615,7 +615,7 @@ void wxSVGFileDCImpl::DoDrawLines(int n, const wxPoint points[], wxCoord xoffset
}
}
void wxSVGFileDCImpl::DoDrawPoint(wxCoord x1, wxCoord y1)
void wxSVGFileDCImpl::DoDrawPoint(wxCoord x, wxCoord y)
{
NewGraphicsIfNeeded();
@ -624,15 +624,15 @@ void wxSVGFileDCImpl::DoDrawPoint(wxCoord x1, wxCoord y1)
s = wxS(" <g style=\"stroke-width:1; stroke-linecap:round;\">\n ");
write(s);
DoDrawLine(x1, y1, x1, y1);
DoDrawLine(x, y, x, y);
s = wxS(" </g>\n");
write(s);
}
void wxSVGFileDCImpl::DoDrawText(const wxString& text, wxCoord x1, wxCoord y1)
void wxSVGFileDCImpl::DoDrawText(const wxString& text, wxCoord x, wxCoord y)
{
DoDrawRotatedText(text, x1, y1, 0.0);
DoDrawRotatedText(text, x, y, 0.0);
}
void wxSVGFileDCImpl::DoDrawRotatedText(const wxString& sText, wxCoord x, wxCoord y, double angle)
@ -752,7 +752,7 @@ void wxSVGFileDCImpl::DoDrawRotatedText(const wxString& sText, wxCoord x, wxCoor
void wxSVGFileDCImpl::DoDrawRectangle(wxCoord x, wxCoord y, wxCoord width, wxCoord height)
{
DoDrawRoundedRectangle(x, y, width, height, 0);
DoDrawRoundedRectangle(x, y, width, height, 0.0);
}
void wxSVGFileDCImpl::DoDrawRoundedRectangle(wxCoord x, wxCoord y, wxCoord width, wxCoord height, double radius)
@ -1093,7 +1093,7 @@ void wxSVGFileDCImpl::DoGradientFillConcentric(const wxRect& rect,
CalcBoundingBox(rect.x + rect.width, rect.y + rect.height);
}
void wxSVGFileDCImpl::DoSetClippingRegion(int x, int y, int width, int height)
void wxSVGFileDCImpl::DoSetClippingRegion(wxCoord x, wxCoord y, wxCoord width, wxCoord height)
{
wxString svg;
@ -1152,16 +1152,16 @@ void wxSVGFileDCImpl::DestroyClippingRegion()
}
void wxSVGFileDCImpl::DoGetTextExtent(const wxString& string,
wxCoord* w,
wxCoord* h,
wxCoord* x,
wxCoord* y,
wxCoord* descent,
wxCoord* externalLeading,
const wxFont* font) const
const wxFont* theFont) const
{
wxScreenDC sDC;
SetScaledScreenDCFont(sDC, font ? *font : m_font);
SetScaledScreenDCFont(sDC, theFont ? *theFont : m_font);
sDC.GetTextExtent(string, w, h, descent, externalLeading);
sDC.GetTextExtent(string, x, y, descent, externalLeading);
}
wxCoord wxSVGFileDCImpl::GetCharHeight() const
@ -1261,13 +1261,15 @@ void wxSVGFileDCImpl::SetFont(const wxFont& font)
m_font = font;
}
// export a bitmap as a raster image in png
bool wxSVGFileDCImpl::DoBlit(wxCoord xdest, wxCoord ydest, wxCoord width, wxCoord height,
wxDC* source, wxCoord xsrc, wxCoord ysrc,
wxRasterOperationMode logicalFunc /*= wxCOPY*/, bool useMask /*= false*/,
wxCoord /*xsrcMask = -1*/, wxCoord /*ysrcMask = -1*/)
bool wxSVGFileDCImpl::DoBlit(wxCoord xdest, wxCoord ydest,
wxCoord width, wxCoord height,
wxDC* source,
wxCoord xsrc, wxCoord ysrc,
wxRasterOperationMode rop,
bool useMask,
wxCoord WXUNUSED(xsrcMask), wxCoord WXUNUSED(ysrcMask))
{
if (logicalFunc != wxCOPY)
if (rop != wxCOPY)
{
wxASSERT_MSG(false, wxS("wxSVGFileDC::DoBlit Call requested nonCopy mode; this is not possible"));
return false;
@ -1286,17 +1288,18 @@ bool wxSVGFileDCImpl::DoBlit(wxCoord xdest, wxCoord ydest, wxCoord width, wxCoor
return false;
}
void wxSVGFileDCImpl::DoDrawIcon(const wxIcon& myIcon, wxCoord x, wxCoord y)
void wxSVGFileDCImpl::DoDrawIcon(const wxIcon& icon, wxCoord x, wxCoord y)
{
wxBitmap myBitmap(myIcon.GetWidth(), myIcon.GetHeight());
wxBitmap myBitmap(icon.GetWidth(), icon.GetHeight());
wxMemoryDC memDC;
memDC.SelectObject(myBitmap);
memDC.DrawIcon(myIcon, 0, 0);
memDC.DrawIcon(icon, 0, 0);
memDC.SelectObject(wxNullBitmap);
DoDrawBitmap(myBitmap, x, y);
}
void wxSVGFileDCImpl::DoDrawBitmap(const wxBitmap& bmp, wxCoord x, wxCoord y, bool WXUNUSED(bTransparent))
void wxSVGFileDCImpl::DoDrawBitmap(const wxBitmap& bmp, wxCoord x, wxCoord y,
bool WXUNUSED(useMask))
{
NewGraphicsIfNeeded();