#include <stdexcept>
#include <LASi.h>
-
#include "gvplugin_render.h"
#include "gvplugin_device.h"
#include "gvio.h"
-#include "ps.h"
+#include "gvcint.h"
#include "agxbuf.h"
#include "utils.h"
+#include "ps.h"
using namespace LASi;
using namespace std;
/* for CHAR_LATIN1 */
-#include "const.h"
+// #include "const.h"
/*
* J$: added `pdfmark' URL embedding. PostScript rendered from
#define PDFMAX 14400 /* Maximum size of PDF page */
extern "C" {
- extern void epsf_define(FILE * of);
+ extern void epsf_define(GVJ_t * job);
+ extern void cat_libfile(GVJ_t * job, const char **arglib, const char **stdlib);
}
typedef enum { FORMAT_PS, FORMAT_PS2, FORMAT_EPS } format_type;
//static char setupLatin1;
PostscriptDocument doc;
+size_t (*save_write_fn) (GVJ_t *job, const char *s, size_t len);
-/* cat_libfile:
- * Write library files onto the given file pointer.
- * arglib is an NULL-terminated array of char*
- * Each non-trivial entry should be the name of a file to be included.
- * stdlib is an NULL-terminated array of char*
- * Each of these is a line of a standard library to be included.
- * If any item in arglib is the empty string, the stdlib is not used.
- * The stdlib is printed first, if used, followed by the user libraries.
- * We check that for web-safe file usage.
- */
-static void cat_libfile(GVJ_t *job, const char **arglib, const char **stdlib)
+static size_t lasi_head_writer(GVJ_t * job, const char *s, size_t len)
{
- FILE *fp;
- const char **s, *bp, *p;
- int i;
- boolean use_stdlib = TRUE;
-
- /* check for empty string to turn off stdlib */
- if (arglib) {
- for (i = 0; use_stdlib && ((p = arglib[i])); i++) {
- if (*p == '\0')
- use_stdlib = FALSE;
- }
- }
- if (use_stdlib)
- for (s = stdlib; *s; s++) {
- doc.osBody() << *s << endl;
- }
- if (arglib) {
- for (i = 0; (p = arglib[i]) != 0; i++) {
- if (*p == '\0')
- continue; /* ignore empty string */
- p = safefile(p); /* make sure filename is okay */
- if ((fp = fopen(p, "r"))) {
- while ((bp = Fgets(fp)))
- doc.osBody() << bp;
- doc.osBody() << endl; /* append a newline just in case */
- } else
- job->common->errorfn("can't open library file %s\n", p);
- }
- }
+ doc.osHeader() << s;
+ return len;
}
-static void lasi_printpointf(GVJ_t * job, pointf p)
+static size_t lasi_body_writer(GVJ_t * job, const char *s, size_t len)
{
- doc.osBody() << p.x << ' ' << p.y << ' ' ;
+ doc.osBody() << s;
+ return len;
}
-static void lasi_printpointflist(GVJ_t * job, pointf A[], int n)
+static size_t lasi_footer_writer(GVJ_t * job, const char *s, size_t len)
{
- for (int i = 0; i < n; i++) {
- lasi_printpointf(job, A[i]);
- }
+ doc.osFooter() << s;
+ return len;
}
static void lasi_begin_job(GVJ_t * job)
{
+ save_write_fn = job->gvc->write_fn;
+ job->gvc->write_fn = lasi_head_writer;
+
// gvputs(job, "%!PS-Adobe-3.0 EPSF-3.0\n");
-// gvprintf(job, "%%%%Creator: %s version %s (%s)\n",
-// job->common->info[0], job->common->info[1], job->common->info[2]);
-// gvprintf(job, "%%%%For: %s\n", job->common->user);
- doc.osHeader() << "%%Creator: " << job->common->info[0] \
- << " version " << job->common->info[1] \
- << " (" << job->common->info[2] << ")" << endl;
- doc.osHeader() << "%%For: " << job->common->user << endl;
+ gvprintf(job, "%%%%Creator: %s version %s (%s)\n",
+ job->common->info[0], job->common->info[1], job->common->info[2]);
+ gvprintf(job, "%%%%For: %s\n", job->common->user);
}
static void lasi_end_job(GVJ_t * job)
{
- // create the new stream to "redirect" cout's output to
- ostringstream output;
-
- // smart class that will swap streambufs and replace them
- // when object goes out of scope.
- class StreamBuf_Swapper
- {
- public:
- StreamBuf_Swapper(ostream & orig, ostream & replacement)
- : buf_(orig.rdbuf()), str_(orig)
- {
- orig.rdbuf(replacement.rdbuf());
- }
- ~StreamBuf_Swapper()
- {
- str_.rdbuf(buf_);
- }
- private:
- std::streambuf * buf_;
- std::ostream & str_;
- } swapper(cout, output);
+ job->gvc->write_fn = lasi_footer_writer;
// gvputs(job, "%%Trailer\n");
if (job->render.id != FORMAT_EPS)
-// gvprintf(job, "%%%%Pages: %d\n", job->common->viewNum);
- doc.osFooter() << "%%Pages: " << job->common->viewNum << endl;
+ gvprintf(job, "%%%%Pages: %d\n", job->common->viewNum);
if (job->common->show_boxes == NULL)
if (job->render.id != FORMAT_EPS)
-// gvprintf(job, "%%%%BoundingBox: %d %d %d %d\n",
-// job->boundingBox.LL.x, job->boundingBox.LL.y,
-// job->boundingBox.UR.x, job->boundingBox.UR.y);
- doc.osFooter() << "%%BoundingBox: " << job->pageBoundingBox.LL.x << ' ' \
- << job->pageBoundingBox.LL.y << ' ' \
- << job->pageBoundingBox.UR.x << ' ' \
- << job->pageBoundingBox.UR.y << endl;
-// gvputs(job, "end\nrestore\n");
- doc.osFooter() << "end" << endl;
- doc.osFooter() << "restore" << endl;
+ gvprintf(job, "%%%%BoundingBox: %d %d %d %d\n",
+ job->boundingBox.LL.x, job->boundingBox.LL.y,
+ job->boundingBox.UR.x, job->boundingBox.UR.y);
+ gvputs(job, "end\nrestore\n");
// gvputs(job, "%%EOF\n");
- doc.write(cout);
- gvputs(job, output.str().c_str());
+ {
+ // create the new stream to "redirect" cout's output to
+ ostringstream output;
+
+ // smart class that will swap streambufs and replace them
+ // when object goes out of scope.
+ class StreamBuf_Swapper
+ {
+ public:
+ StreamBuf_Swapper(ostream & orig, ostream & replacement)
+ : buf_(orig.rdbuf()), str_(orig)
+ {
+ orig.rdbuf(replacement.rdbuf());
+ }
+ ~StreamBuf_Swapper()
+ {
+ str_.rdbuf(buf_);
+ }
+ private:
+ std::streambuf * buf_;
+ std::ostream & str_;
+ } swapper(cout, output);
+
+ doc.write(cout);
+
+ job->gvc->write_fn = save_write_fn;
+ gvputs(job, output.str().c_str());
+ }
}
static void lasi_begin_graph(GVJ_t * job)
{
obj_state_t *obj = job->obj;
+ job->gvc->write_fn = lasi_body_writer;
+
// setupLatin1 = FALSE;
if (job->common->viewNum == 0) {
-// gvprintf(job, "%%%%Title: %s\n", obj->u.g->name);
- doc.osBody() << "%%Title: " << obj->u.g->name << endl;
+ gvprintf(job, "%%%%Title: %s\n", obj->u.g->name);
if (job->render.id != FORMAT_EPS)
-// gvputs(job, "%%Pages: (atend)\n");
- doc.osBody() << "%%Pages: (atend)" << endl;
+ gvputs(job, "%%Pages: (atend)\n");
else
-// gvputs(job, "%%Pages: 1\n");
- doc.osBody() << "%%Pages: 1" << endl;
+ gvputs(job, "%%Pages: 1\n");
if (job->common->show_boxes == NULL) {
if (job->render.id != FORMAT_EPS)
-// gvputs(job, "%%BoundingBox: (atend)\n");
- doc.osBody() << "%%BoundingBox: (atend)" << endl;
+ gvputs(job, "%%BoundingBox: (atend)\n");
else
-// gvprintf(job, "%%%%BoundingBox: %d %d %d %d\n",
-// job->pageBoundingBox.LL.x, job->pageBoundingBox.LL.y,
-// job->pageBoundingBox.UR.x, job->pageBoundingBox.UR.y);
- doc.osBody() << "%%BoundingBox: " << job->pageBoundingBox.LL.x << ' ' \
- << job->pageBoundingBox.LL.y << ' ' \
- << job->pageBoundingBox.UR.x << ' ' \
- << job->pageBoundingBox.UR.y << endl;
+ gvprintf(job, "%%%%BoundingBox: %d %d %d %d\n",
+ job->pageBoundingBox.LL.x, job->pageBoundingBox.LL.y,
+ job->pageBoundingBox.UR.x, job->pageBoundingBox.UR.y);
}
-// gvputs(job, "%%EndComments\nsave\n");
- doc.osBody() << "%%EndComments" << endl;
- doc.osBody() << "save" << endl;
+ gvputs(job, "%%EndComments\nsave\n");
/* include shape library */
-// cat_preamble(job, job->common->lib);
cat_libfile(job, job->common->lib, ps_txt);
/* include epsf */
-// FIXME!!
-// epsf_define(job->output_file);
+ epsf_define(job);
if (job->common->show_boxes) {
const char* args[2];
args[0] = job->common->show_boxes[0];
// setupLatin1 = TRUE;
// }
/* Set base URL for relative links (for Distiller >= 3.0) */
- if (obj->url) {
-// gvprintf(job, "[ {Catalog} << /URI << /Base (%s) >> >>\n"
-// "/PUT pdfmark\n", obj->url);
- doc.osBody() << "[ {Catalog} << /URI << /Base (" << obj->url << ") >> >>" << endl;
- doc.osBody() << "/PUT pdfmark" << endl;
- }
+ if (obj->url)
+ gvprintf(job, "[ {Catalog} << /URI << /Base (%s) >> >>\n"
+ "/PUT pdfmark\n", obj->url);
}
static void lasi_begin_layer(GVJ_t * job, char *layername, int layerNum, int numLayers)
{
-// gvprintf(job, "%d %d setlayer\n", layerNum, numLayers);
- doc.osBody() << layerNum << ' ' << numLayers << "setlayer" << endl;
+ gvprintf(job, "%d %d setlayer\n", layerNum, numLayers);
}
static void lasi_begin_page(GVJ_t * job)
{
box pbr = job->pageBoundingBox;
-// gvprintf(job, "%%%%Page: %d %d\n",
-// job->common->viewNum + 1, job->common->viewNum + 1);
- doc.osBody() << "%%Page: " << (job->common->viewNum + 1) << ' ' << (job->common->viewNum + 1) << endl;
+ gvprintf(job, "%%%%Page: %d %d\n",
+ job->common->viewNum + 1, job->common->viewNum + 1);
if (job->common->show_boxes == NULL)
-// gvprintf(job, "%%%%PageBoundingBox: %d %d %d %d\n",
-// pbr.LL.x, pbr.LL.y, pbr.UR.x, pbr.UR.y);
- doc.osBody() << "%%PageBoundingBox: " << pbr.LL.x << ' ' \
- << pbr.LL.y << ' ' \
- << pbr.UR.x << ' ' \
- << pbr.UR.y << endl;
-// gvprintf(job, "%%%%PageOrientation: %s\n",
-// (job->rotation ? "Landscape" : "Portrait"));
- doc.osBody() << "%%PageOrientation: " << (job->rotation ? "Landscape" : "Portrait") << endl;
+ gvprintf(job, "%%%%PageBoundingBox: %d %d %d %d\n",
+ pbr.LL.x, pbr.LL.y, pbr.UR.x, pbr.UR.y);
+ gvprintf(job, "%%%%PageOrientation: %s\n",
+ (job->rotation ? "Landscape" : "Portrait"));
if (job->render.id == FORMAT_PS2)
-// gvprintf(job, "<< /PageSize [%d %d] >> setpagedevice\n",
-// pbr.UR.x, pbr.UR.y);
- doc.osBody() << "<< /PageSize [" << pbr.UR.x << ' ' \
- << pbr.UR.y << "] >> setpagedevice" << endl;
-// gvprintf(job, "%d %d %d beginpage\n",
-// job->pagesArrayElem.x, job->pagesArrayElem.y, job->numPages);
- doc.osBody() << job->pagesArrayElem.x << ' ' << job->pagesArrayElem.y << ' ' << job->numPages \
- << " beginpage" << endl;
+ gvprintf(job, "<< /PageSize [%d %d] >> setpagedevice\n",
+ pbr.UR.x, pbr.UR.y);
+ gvprintf(job, "%d %d %d beginpage\n",
+ job->pagesArrayElem.x, job->pagesArrayElem.y, job->numPages);
if (job->common->show_boxes == NULL)
-// gvprintf(job, "gsave\n%d %d %d %d boxprim clip newpath\n",
-// pbr.LL.x, pbr.LL.y, pbr.UR.x-pbr.LL.x, pbr.UR.y-pbr.LL.y);
- doc.osBody() << "gsave" << endl;
- doc.osBody() << pbr.LL.x << ' ' << pbr.LL.y << ' ' \
- << pbr.UR.x << ' ' << pbr.UR.y << " boxprim clip newpath" << endl;
-
-// gvprintf(job, "%g %g set_scale %d rotate %g %g translate\n",
-// job->scale.x, job->scale.y,
-// job->rotation,
-// job->translation.x, job->translation.y);
- doc.osBody() << job->scale.x << ' ' << job->scale.y << " set_scale " \
- << job->rotation << " rotate " \
- << job->translation.x << ' ' << job->translation.y << " translate" << endl;
+ gvprintf(job, "gsave\n%d %d %d %d boxprim clip newpath\n",
+ pbr.LL.x, pbr.LL.y, pbr.UR.x-pbr.LL.x, pbr.UR.y-pbr.LL.y);
+ gvprintf(job, "%g %g set_scale %d rotate %g %g translate\n",
+ job->scale.x, job->scale.y,
+ job->rotation,
+ job->translation.x, job->translation.y);
/* Define the size of the PS canvas */
if (job->render.id == FORMAT_PS2) {
job->common->errorfn("canvas size (%d,%d) exceeds PDF limit (%d)\n"
"\t(suggest setting a bounding box size, see dot(1))\n",
pbr.UR.x, pbr.UR.y, PDFMAX);
-// gvprintf(job, "[ /CropBox [%d %d %d %d] /PAGES pdfmark\n",
-// pbr.LL.x, pbr.LL.y, pbr.UR.x, pbr.UR.y);
- doc.osBody() << "[ /CropBox [" << pbr.LL.x << ' ' \
- << pbr.LL.y << ' ' \
- << pbr.UR.x << ' ' \
- << pbr.UR.y << "] /PAGES pdfmark" << endl;
+ gvprintf(job, "[ /CropBox [%d %d %d %d] /PAGES pdfmark\n",
+ pbr.LL.x, pbr.LL.y, pbr.UR.x, pbr.UR.y);
}
}
static void lasi_end_page(GVJ_t * job)
{
if (job->common->show_boxes) {
-// gvputs(job, "0 0 0 edgecolor\n");
- doc.osBody() << "0 0 0 edgecolor" << endl;
+ gvputs(job, "0 0 0 edgecolor\n");
cat_libfile(job, NULL, job->common->show_boxes + 1);
}
/* the showpage is really a no-op, but at least one PS processor
* out there needs to see this literal token. endpage does the real work.
*/
-// gvputs(job, "endpage\nshowpage\ngrestore\n");
-// gvputs(job, "%%PageTrailer\n");
-// gvprintf(job, "%%%%EndPage: %d\n", job->common->viewNum);
- doc.osBody() << "endpage" << endl;
- doc.osBody() << "showpage" << endl;
- doc.osBody() << "grestore" << endl;
- doc.osBody() << "%%EndPage: " << job->common->viewNum << endl;
+ gvputs(job, "endpage\nshowpage\ngrestore\n");
+ gvputs(job, "%%PageTrailer\n");
+ gvprintf(job, "%%%%EndPage: %d\n", job->common->viewNum);
}
static void lasi_begin_cluster(GVJ_t * job)
{
obj_state_t *obj = job->obj;
-// gvprintf(job, "%% %s\n", obj->u.sg->name);
-// gvputs(job, "gsave\n");
- doc.osBody() << "% " << obj->u.sg->name << endl;
- doc.osBody() << "gsave" << endl;
+ gvprintf(job, "%% %s\n", obj->u.sg->name);
+ gvputs(job, "gsave\n");
}
static void lasi_end_cluster(GVJ_t * job)
{
-// gvputs(job, "grestore\n");
- doc.osBody() << "grestore" << endl;
+ gvputs(job, "grestore\n");
}
static void lasi_begin_node(GVJ_t * job)
{
-// gvputs(job, "gsave\n");
- doc.osBody() << "gsave" << endl;
+ gvputs(job, "gsave\n");
}
static void lasi_end_node(GVJ_t * job)
{
-// gvputs(job, "grestore\n");
- doc.osBody() << "grestore" << endl;
+ gvputs(job, "grestore\n");
}
static void
lasi_begin_edge(GVJ_t * job)
{
-// gvputs(job, "gsave\n");
- doc.osBody() << "gsave" << endl;
+ gvputs(job, "gsave\n");
}
static void lasi_end_edge(GVJ_t * job)
{
-// gvputs(job, "grestore\n");
- doc.osBody() << "grestore" << endl;
+ gvputs(job, "grestore\n");
}
static void lasi_begin_anchor(GVJ_t *job, char *url, char *tooltip, char *target)
obj_state_t *obj = job->obj;
if (url && obj->url_map_p) {
-// gvputs(job, "[ /Rect [ ");
-// gvprintpointflist(job, obj->url_map_p, 2);
-// gvputs(job, " ]\n");
-// gvprintf(job, " /Border [ 0 0 0 ]\n"
-// " /Action << /Subtype /URI /URI %s >>\n"
-// " /Subtype /Link\n"
-// "/ANN pdfmark\n",
+ gvputs(job, "[ /Rect [ ");
+ gvprintpointflist(job, obj->url_map_p, 2);
+ gvputs(job, " ]\n");
+ gvprintf(job, " /Border [ 0 0 0 ]\n"
+ " /Action << /Subtype /URI /URI %s >>\n"
+ " /Subtype /Link\n"
+ "/ANN pdfmark\n",
// ps_string(url, isLatin1));
- doc.osBody() << "[ /Rect [ ";
- lasi_printpointflist(job, obj->url_map_p, 2);
- doc.osBody() << "]" << endl;
- doc.osBody() << " /Border [ 0 0 0 ]" << endl;
-// doc.osBody() << " /Action << /Subtype /URI /URI " << ps_string(url, isLatin1) << " >>" << endl;
- doc.osBody() << " /Action << /Subtype /URI /URI " << url << " >>" << endl;
- doc.osBody() << "/ANN pdfmark" << endl;
+ url);
}
}
double penwidth = job->obj->penwidth;
char *p, *line, **s = job->obj->rawstyle;
-// gvprintnum(job, penwidth);
-// gvputs(job," setlinewidth\n");
- doc.osBody() << penwidth << " setlinewidth" << endl;
+ gvprintdouble(job, penwidth);
+ gvputs(job," setlinewidth\n");
while (s && (p = line = *s++)) {
if (strcmp(line, "setlinewidth") == 0)
p++;
p++;
while (*p) {
-// gvprintf(job,"%s ", p);
- doc.osBody() << p << ' ';
+ gvprintf(job,"%s ", p);
while (*p)
p++;
p++;
}
if (strcmp(line, "invis") == 0)
job->obj->penwidth = 0;
-// gvprintf(job, "%s\n", line);
- doc.osBody() << line << endl;
+ gvprintf(job, "%s\n", line);
}
}
objtype = "sethsb";
break;
}
-// gvprintf(job, "%.3f %.3f %.3f %scolor\n",
-// color->u.HSVA[0], color->u.HSVA[1], color->u.HSVA[2], objtype);
- doc.osBody() << color->u.HSVA[0] << ' ' << color->u.HSVA[1] << ' ' << color->u.HSVA[2] << ' ' << objtype << "color" << endl;
+ gvprintf(job, "%.3f %.3f %.3f %scolor\n",
+ color->u.HSVA[0], color->u.HSVA[1], color->u.HSVA[2], objtype);
}
}
font = para->postscript_alias->svg_font_family;
}
-//fprintf(stderr,"font=\"%s\"\n", para->fontname);
-//fprintf(stderr,"ps_font=\"%s\"\n", para->postscript_alias->name);
-//fprintf(stderr,"svg_font=\"%s\"\n", para->postscript_alias->svg_font_family);
-//fprintf(stderr,"pango_font=\"%s\"\n", pango_font_description_get_family(pango_font));
-
ps_set_color(job, &(job->obj->pencolor));
-// gvprintnum(job, para->fontsize);
+// gvprintdouble(job, para->fontsize);
// gvprintf(job, " /%s set_font\n", para->fontname);
doc.osBody() << setFont(font) << setFontSize(para->fontsize) << endl;
switch (para->just) {
break;
}
p.y += para->yoffset_centerline;
-// gvprintpointf(job, p);
-// gvputs(job, " moveto ");
- lasi_printpointf(job, p);
- doc.osBody() << "moveto" << endl;
-// gvprintnum(job, para->width);
+ gvprintpointf(job, p);
+ gvputs(job, " moveto ");
+// gvprintdouble(job, para->width);
// str = ps_string(para->str,isLatin1);
// gvprintf(job, " %s alignedtext\n", str);
doc.osBody() << show(para->str) << endl;
if (filled && job->obj->fillcolor.u.HSVA[3] > .5) {
ps_set_color(job, &(job->obj->fillcolor));
-// gvprintpointflist(job, AA, 2);
-// gvputs(job, " ellipse_path fill\n");
- lasi_printpointflist(job, AA, 2);
- doc.osBody() << "ellipse_path fill" << endl;
+ gvprintpointflist(job, AA, 2);
+ gvputs(job, " ellipse_path fill\n");
}
if (job->obj->pencolor.u.HSVA[3] > .5) {
ps_set_pen_style(job);
ps_set_color(job, &(job->obj->pencolor));
-// gvprintpointflist(job, AA, 2);
-// gvputs(job, " ellipse_path stroke\n");
- lasi_printpointflist(job, AA, 2);
- doc.osBody() << "ellipse_path stroke" << endl;
+ gvprintpointflist(job, AA, 2);
+ gvputs(job, " ellipse_path stroke\n");
}
}
if (filled && job->obj->fillcolor.u.HSVA[3] > .5) {
ps_set_color(job, &(job->obj->fillcolor));
-// gvputs(job, "newpath ");
-// gvprintpointf(job, A[0]);
-// gvputs(job, " moveto\n");
- doc.osBody() << "newpath ";
- lasi_printpointf(job, A[0]);
- doc.osBody() << "moveto" << endl;
+ gvputs(job, "newpath ");
+ gvprintpointf(job, A[0]);
+ gvputs(job, " moveto\n");
for (j = 1; j < n; j += 3) {
-// gvprintpointflist(job, &A[j], 3);
-// gvputs(job, " curveto\n");
- lasi_printpointflist(job, &A[j], 3);
- doc.osBody() << "curveto" << endl;
+ gvprintpointflist(job, &A[j], 3);
+ gvputs(job, " curveto\n");
}
-// gvputs(job, "closepath fill\n");
- doc.osBody() << "closepath fill" << endl;
+ gvputs(job, "closepath fill\n");
}
if (job->obj->pencolor.u.HSVA[3] > .5) {
ps_set_pen_style(job);
ps_set_color(job, &(job->obj->pencolor));
-// gvputs(job, "newpath ");
-// gvprintpointf(job, A[0]);
-// gvputs(job, " moveto\n");
- doc.osBody() << "newpath ";
- lasi_printpointf(job, A[0]);
- doc.osBody() << "moveto" << endl;
+ gvputs(job, "newpath ");
+ gvprintpointf(job, A[0]);
+ gvputs(job, " moveto\n");
for (j = 1; j < n; j += 3) {
-// gvprintpointflist(job, &A[j], 3);
-// gvputs(job, " curveto\n");
- lasi_printpointflist(job, &A[j], 3);
- doc.osBody() << "curveto" << endl;
+ gvprintpointflist(job, &A[j], 3);
+ gvputs(job, " curveto\n");
}
-// gvputs(job, "stroke\n");
- doc.osBody() << "stroke" << endl;
+ gvputs(job, "stroke\n");
}
}
if (filled && job->obj->fillcolor.u.HSVA[3] > .5) {
ps_set_color(job, &(job->obj->fillcolor));
-// gvputs(job, "newpath ");
-// gvprintpointf(job, A[0]);
-// gvputs(job, " moveto\n");
- doc.osBody() << "newpath ";
- lasi_printpointf(job, A[0]);
- doc.osBody() << "moveto" << endl;
+ gvputs(job, "newpath ");
+ gvprintpointf(job, A[0]);
+ gvputs(job, " moveto\n");
for (j = 1; j < n; j++) {
-// gvprintpointf(job, A[j]);
-// gvputs(job, " lineto\n");
- lasi_printpointf(job, A[j]);
- doc.osBody() << "lineto" << endl;
+ gvprintpointf(job, A[j]);
+ gvputs(job, " lineto\n");
}
-// gvputs(job, "closepath fill\n");
- doc.osBody() << "closepath fill" << endl;
+ gvputs(job, "closepath fill\n");
}
if (job->obj->pencolor.u.HSVA[3] > .5) {
ps_set_pen_style(job);
ps_set_color(job, &(job->obj->pencolor));
-// gvputs(job, "newpath ");
-// gvprintpointf(job, A[0]);
-// gvputs(job, " moveto\n");
- doc.osBody() << "newpath ";
- lasi_printpointf(job, A[0]);
- doc.osBody() << "moveto" << endl;
+ gvputs(job, "newpath ");
+ gvprintpointf(job, A[0]);
+ gvputs(job, " moveto\n");
for (j = 1; j < n; j++) {
-// gvprintpointf(job, A[j]);
-// gvputs(job, " lineto\n");
- lasi_printpointf(job, A[j]);
- doc.osBody() << "lineto" << endl;
+ gvprintpointf(job, A[j]);
+ gvputs(job, " lineto\n");
}
-// gvputs(job, "closepath stroke\n");
- doc.osBody() << "closepath stroke" << endl;
+ gvputs(job, "closepath stroke\n");
}
}
if (job->obj->pencolor.u.HSVA[3] > .5) {
ps_set_pen_style(job);
ps_set_color(job, &(job->obj->pencolor));
-// gvputs(job, "newpath ");
-// gvprintpointf(job, A[0]);
-// gvputs(job, " moveto\n");
- doc.osBody() << "newpath ";
- lasi_printpointf(job, A[0]);
- doc.osBody() << "moveto" << endl;
+ gvputs(job, "newpath ");
+ gvprintpointf(job, A[0]);
+ gvputs(job, " moveto\n");
for (j = 1; j < n; j++) {
-// gvprintpointf(job, A[j]);
-// gvputs(job, " lineto\n");
- lasi_printpointf(job, A[j]);
- doc.osBody() << "lineto" << endl;
+ gvprintpointf(job, A[j]);
+ gvputs(job, " lineto\n");
}
-// gvputs(job, "stroke\n");
- doc.osBody() << "stroke" << endl;
+ gvputs(job, "stroke\n");
}
}
static void lasi_comment(GVJ_t * job, char *str)
{
-// gvputs(job, "% ");
-// gvputs(job, str);
-// gvputs(job, "\n");
- doc.osBody() << "% " << str << endl;
+ gvputs(job, "% ");
+ gvputs(job, str);
+ gvputs(job, "\n");
}
static void lasi_library_shape(GVJ_t * job, char *name, pointf * A, int n, int filled)
{
if (filled && job->obj->fillcolor.u.HSVA[3] > .5) {
ps_set_color(job, &(job->obj->fillcolor));
-// gvputs(job, "[ ");
-// gvprintpointflist(job, A, n);
-// gvputs(job, " ");
-// gvprintpointf(job, A[0]);
-// gvprintf(job, " ] %d true %s\n", n, name);
- doc.osBody() << "[ ";
- lasi_printpointflist(job, A, n);
- lasi_printpointf(job, A[0]);
- doc.osBody() << "] " << n << " true " << name << endl;
+ gvputs(job, "[ ");
+ gvprintpointflist(job, A, n);
+ gvputs(job, " ");
+ gvprintpointf(job, A[0]);
+ gvprintf(job, " ] %d true %s\n", n, name);
}
if (job->obj->pencolor.u.HSVA[3] > .5) {
ps_set_pen_style(job);
ps_set_color(job, &(job->obj->pencolor));
-// gvputs(job, "[ ");
-// gvprintpointflist(job, A, n);
-// gvputs(job, " ");
-// gvprintpointf(job, A[0]);
-// gvprintf(job, " ] %d false %s\n", n, name);
- doc.osBody() << "[ ";
- lasi_printpointflist(job, A, n);
- lasi_printpointf(job, A[0]);
- doc.osBody() << "] " << n << " false " << name << endl;
+ gvputs(job, "[ ");
+ gvprintpointflist(job, A, n);
+ gvputs(job, " ");
+ gvprintpointf(job, A[0]);
+ gvprintf(job, " ] %d false %s\n", n, name);
}
}