diff options
-rw-r--r-- | src/bltGrElemLine.C | 10 | ||||
-rw-r--r-- | src/bltGrMarkerLine.C | 4 | ||||
-rw-r--r-- | src/bltGrPSOutput.C | 42 | ||||
-rw-r--r-- | src/bltGraph.C | 11 |
4 files changed, 29 insertions, 38 deletions
diff --git a/src/bltGrElemLine.C b/src/bltGrElemLine.C index 1a08eb7..9f8da0a 100644 --- a/src/bltGrElemLine.C +++ b/src/bltGrElemLine.C @@ -2667,16 +2667,14 @@ void LineElement::getSymbolPostScriptInfo(PostScript* psPtr, LinePen* penPtr, in scale = MIN(sx, sy); if (pops->symbol.mask != None) { - psPtr->varAppend("\n % Bitmap mask is \"", - Tk_NameOfBitmap(graphPtr_->display_,pops->symbol.mask), - "\"\n\n ", NULL); + psPtr->format("%%Bitmap mask is \"%s\"\n", + Tk_NameOfBitmap(graphPtr_->display_,pops->symbol.mask)); psPtr->setBackground(fillColor); psPtr->printBitmap(graphPtr_->display_, pops->symbol.mask, scale, scale); } - psPtr->varAppend("\n % Bitmap symbol is \"", - Tk_NameOfBitmap(graphPtr_->display_,pops->symbol.bitmap), - "\"\n\n ", NULL); + psPtr->format("%%Bitmap symbol is \"%s\"\n", + Tk_NameOfBitmap(graphPtr_->display_,pops->symbol.bitmap)); psPtr->setForeground(outlineColor); psPtr->printBitmap(graphPtr_->display_, pops->symbol.bitmap, scale, scale); diff --git a/src/bltGrMarkerLine.C b/src/bltGrMarkerLine.C index 22b788f..f9a432b 100644 --- a/src/bltGrMarkerLine.C +++ b/src/bltGrMarkerLine.C @@ -313,7 +313,9 @@ void LineMarker::print(PostScript* psPtr) psPtr->setBackground(ops->fillColor); psPtr->append(" "); psPtr->setDashes(NULL); - psPtr->varAppend("stroke\n", " grestore\n", "} def\n", NULL); + psPtr->append("stroke\n"); + psPtr->append("grestore\n"); + psPtr->append("} def\n"); } else psPtr->append("/DashesProc {} def\n"); diff --git a/src/bltGrPSOutput.C b/src/bltGrPSOutput.C index 729560f..acc6a56 100644 --- a/src/bltGrPSOutput.C +++ b/src/bltGrPSOutput.C @@ -180,20 +180,6 @@ void PostScript::format(const char* fmt, ...) Tcl_DStringAppend(&dString_, scratchArr_, -1); } -void PostScript::varAppend(const char* fmt, ...) -{ - va_list argList; - - va_start(argList, fmt); - for (;;) { - char* str = va_arg(argList, char *); - if (!str) - break; - Tcl_DStringAppend(&dString_, str, -1); - } - va_end(argList); -} - void PostScript::setLineWidth(int lineWidth) { if (lineWidth < 1) @@ -517,28 +503,28 @@ int PostScript::preamble(const char* fileName) if (!who) who = "???"; - varAppend("8 /Helvetica SetFont\n", - "10 30 moveto\n", - "(Date: ", date, ") show\n", - "10 20 moveto\n", - "(File: ", fileName, ") show\n", - "10 10 moveto\n", - "(Created by: ", who, "@", Tcl_GetHostName(), ") show\n", - "0 0 moveto\n", - (char *)NULL); + append("8 /Helvetica SetFont\n"); + append("10 30 moveto\n"); + format("(Date: %s) show\n", date); + append("10 20 moveto\n"); + format("(File: %s) show\n", fileName); + append("10 10 moveto\n"); + format("(Created by: %s@%s) show\n", who, Tcl_GetHostName()); + append("0 0 moveto\n"); } // Set the conversion from PostScript to X11 coordinates. Scale pica to // pixels and flip the y-axis (the origin is the upperleft corner). - varAppend("% Transform coordinate system to use X11 coordinates\n\n", - "% 1. Flip y-axis over by reversing the scale,\n", - "% 2. Translate the origin to the other side of the page,\n", - "% making the origin the upper left corner\n", NULL); + append("% Transform coordinate system to use X11 coordinates\n\n"); + append("% 1. Flip y-axis over by reversing the scale,\n"); + append("% 2. Translate the origin to the other side of the page,\n"); + append("% making the origin the upper left corner\n"); format("1 -1 scale\n"); // Papersize is in pixels. Translate the new origin *after* changing the scale format("0 %d translate\n\n", -setupPtr->paperHeight); - varAppend("% User defined page layout\n\n", "% Set color level\n", NULL); + append("% User defined page layout\n\n"); + append("% Set color level\n"); format("%% Set origin\n%d %d translate\n\n", setupPtr->left,setupPtr->bottom); if (ops->landscape) format("%% Landscape orientation\n0 %g translate\n-90 rotate\n", diff --git a/src/bltGraph.C b/src/bltGraph.C index a27f2f3..6fa89b4 100644 --- a/src/bltGraph.C +++ b/src/bltGraph.C @@ -438,9 +438,14 @@ int Graph::print(const char* ident, PostScript* psPtr) } printMarkers(psPtr, MARKER_ABOVE); - psPtr->varAppend("\n", "% Unset clipping\n", "grestore\n\n", NULL); - psPtr->varAppend("showpage\n", "%Trailer\n", "grestore\n", "end\n", "%EOF\n", - NULL); + psPtr->append("\n"); + psPtr->append("% Unset clipping\n"); + psPtr->append("grestore\n\n"); + psPtr->append("showpage\n"); + psPtr->append("%Trailer\n"); + psPtr->append("grestore\n"); + psPtr->append("end\n"); + psPtr->append("%EOF\n"); error: width_ = Tk_Width(tkwin_); |