X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/50d0b061eeeb4f87594ccea7508a7c5975fb36dd..8b3fddc49326c0b6019cd7082218726aa17a5727:/src/generic/dcpsg.cpp?ds=sidebyside diff --git a/src/generic/dcpsg.cpp b/src/generic/dcpsg.cpp index 561102d3f5..fd36a5b783 100644 --- a/src/generic/dcpsg.cpp +++ b/src/generic/dcpsg.cpp @@ -416,10 +416,10 @@ void wxPostScriptDC::DoSetClippingRegion (wxCoord x, wxCoord y, wxCoord w, wxCoo "%d %d lineto\n" "%d %d lineto\n" "closepath clip newpath\n", - XLOG2DEV(x), YLOG2DEV(y), - XLOG2DEV(x+w), YLOG2DEV(y), - XLOG2DEV(x+w), YLOG2DEV(y+h), - XLOG2DEV(x), YLOG2DEV(y+h) ); + LogicalToDeviceX(x), LogicalToDeviceY(y), + LogicalToDeviceX(x+w), LogicalToDeviceY(y), + LogicalToDeviceX(x+w), LogicalToDeviceY(y+h), + LogicalToDeviceX(x), LogicalToDeviceY(y+h) ); } @@ -470,8 +470,8 @@ void wxPostScriptDC::DoDrawLine (wxCoord x1, wxCoord y1, wxCoord x2, wxCoord y2) "%d %d moveto\n" "%d %d lineto\n" "stroke\n", - XLOG2DEV(x1), YLOG2DEV(y1), - XLOG2DEV(x2), YLOG2DEV (y2) ); + LogicalToDeviceX(x1), LogicalToDeviceY(y1), + LogicalToDeviceX(x2), LogicalToDeviceY (y2) ); CalcBoundingBox( x1, y1 ); CalcBoundingBox( x2, y2 ); @@ -521,8 +521,8 @@ void wxPostScriptDC::DoDrawArc (wxCoord x1, wxCoord y1, wxCoord x2, wxCoord y2, "%d %d lineto\n" "closepath\n" "fill\n", - XLOG2DEV(xc), YLOG2DEV(yc), XLOG2DEVREL(radius), YLOG2DEVREL(radius), (wxCoord)alpha1, (wxCoord) alpha2, - XLOG2DEV(xc), YLOG2DEV(yc) ); + LogicalToDeviceX(xc), LogicalToDeviceY(yc), LogicalToDeviceXRel(radius), LogicalToDeviceYRel(radius), (wxCoord)alpha1, (wxCoord) alpha2, + LogicalToDeviceX(xc), LogicalToDeviceY(yc) ); CalcBoundingBox( xc-radius, yc-radius ); CalcBoundingBox( xc+radius, yc+radius ); @@ -538,8 +538,8 @@ void wxPostScriptDC::DoDrawArc (wxCoord x1, wxCoord y1, wxCoord x2, wxCoord y2, "%d %d lineto\n" "stroke\n" "fill\n", - XLOG2DEV(xc), YLOG2DEV(yc), XLOG2DEVREL(radius), YLOG2DEVREL(radius), (wxCoord)alpha1, (wxCoord) alpha2, - XLOG2DEV(xc), YLOG2DEV(yc) ); + LogicalToDeviceX(xc), LogicalToDeviceY(yc), LogicalToDeviceXRel(radius), LogicalToDeviceYRel(radius), (wxCoord)alpha1, (wxCoord) alpha2, + LogicalToDeviceX(xc), LogicalToDeviceY(yc) ); CalcBoundingBox( xc-radius, yc-radius ); CalcBoundingBox( xc+radius, yc+radius ); @@ -568,7 +568,7 @@ void wxPostScriptDC::DoDrawEllipticArc(wxCoord x,wxCoord y,wxCoord w,wxCoord h,d fprintf( m_pstream, "newpath\n" "%d %d %d %d %d %d true ellipticarc\n", - XLOG2DEV(x+w/2), YLOG2DEV(y+h/2), XLOG2DEVREL(w/2), YLOG2DEVREL(h/2), (wxCoord)sa, (wxCoord)ea ); + LogicalToDeviceX(x+w/2), LogicalToDeviceY(y+h/2), LogicalToDeviceXRel(w/2), LogicalToDeviceYRel(h/2), (wxCoord)sa, (wxCoord)ea ); CalcBoundingBox( x ,y ); CalcBoundingBox( x+w, y+h ); @@ -581,7 +581,7 @@ void wxPostScriptDC::DoDrawEllipticArc(wxCoord x,wxCoord y,wxCoord w,wxCoord h,d fprintf(m_pstream, "newpath\n" "%d %d %d %d %d %d false ellipticarc\n", - XLOG2DEV(x+w/2), YLOG2DEV(y+h/2), XLOG2DEVREL(w/2), YLOG2DEVREL(h/2), (wxCoord)sa, (wxCoord)ea ); + LogicalToDeviceX(x+w/2), LogicalToDeviceY(y+h/2), LogicalToDeviceXRel(w/2), LogicalToDeviceYRel(h/2), (wxCoord)sa, (wxCoord)ea ); CalcBoundingBox( x ,y ); CalcBoundingBox( x+w, y+h ); @@ -601,8 +601,8 @@ void wxPostScriptDC::DoDrawPoint (wxCoord x, wxCoord y) "%d %d moveto\n" "%d %d lineto\n" "stroke\n", - XLOG2DEV(x), YLOG2DEV(y), - XLOG2DEV(x+1), YLOG2DEV(y) ); + LogicalToDeviceX(x), LogicalToDeviceY(y), + LogicalToDeviceX(x+1), LogicalToDeviceY(y) ); CalcBoundingBox( x, y ); } @@ -619,8 +619,8 @@ void wxPostScriptDC::DoDrawPolygon (int n, wxPoint points[], wxCoord xoffset, wx fprintf( m_pstream, "newpath\n" ); - wxCoord xx = XLOG2DEV(points[0].x + xoffset); - wxCoord yy = YLOG2DEV(points[0].y + yoffset); + wxCoord xx = LogicalToDeviceX(points[0].x + xoffset); + wxCoord yy = LogicalToDeviceY(points[0].y + yoffset); fprintf( m_pstream, "%d %d moveto\n", xx, yy ); @@ -628,8 +628,8 @@ void wxPostScriptDC::DoDrawPolygon (int n, wxPoint points[], wxCoord xoffset, wx for (int i = 1; i < n; i++) { - xx = XLOG2DEV(points[i].x + xoffset); - yy = YLOG2DEV(points[i].y + yoffset); + xx = LogicalToDeviceX(points[i].x + xoffset); + yy = LogicalToDeviceY(points[i].y + yoffset); fprintf( m_pstream, "%d %d lineto\n", xx, yy ); @@ -645,8 +645,8 @@ void wxPostScriptDC::DoDrawPolygon (int n, wxPoint points[], wxCoord xoffset, wx fprintf( m_pstream, "newpath\n" ); - wxCoord xx = XLOG2DEV(points[0].x + xoffset); - wxCoord yy = YLOG2DEV(points[0].y + yoffset); + wxCoord xx = LogicalToDeviceX(points[0].x + xoffset); + wxCoord yy = LogicalToDeviceY(points[0].y + yoffset); fprintf( m_pstream, "%d %d moveto\n", xx, yy ); @@ -654,8 +654,8 @@ void wxPostScriptDC::DoDrawPolygon (int n, wxPoint points[], wxCoord xoffset, wx for (int i = 1; i < n; i++) { - xx = XLOG2DEV(points[i].x + xoffset); - yy = YLOG2DEV(points[i].y + yoffset); + xx = LogicalToDeviceX(points[i].x + xoffset); + yy = LogicalToDeviceY(points[i].y + yoffset); fprintf( m_pstream, "%d %d lineto\n", xx, yy ); @@ -680,19 +680,19 @@ void wxPostScriptDC::DoDrawLines (int n, wxPoint points[], wxCoord xoffset, wxCo int i; for ( i =0; i maxX ) { wxCoord tmp = minX; minX = maxX; maxX = tmp; } @@ -1957,7 +1957,7 @@ void wxPostScriptDC::DoGetTextExtent(const wxString& string, lastStyle = Style; lastWeight = Weight; - char *name = (char*) NULL; + const char *name = NULL; switch (Family) { @@ -2149,9 +2149,9 @@ void wxPostScriptDC::DoGetTextExtent(const wxString& string, // VS: dirty, but is there any better solution? double *pt; pt = (double*) &m_underlinePosition; - *pt = YLOG2DEVREL((wxCoord)(UnderlinePosition * fontToUse->GetPointSize())) / 1000.0f; + *pt = LogicalToDeviceYRel((wxCoord)(UnderlinePosition * fontToUse->GetPointSize())) / 1000.0f; pt = (double*) &m_underlineThickness; - *pt = YLOG2DEVREL((wxCoord)(UnderlineThickness * fontToUse->GetPointSize())) / 1000.0f; + *pt = LogicalToDeviceYRel((wxCoord)(UnderlineThickness * fontToUse->GetPointSize())) / 1000.0f; }