Graphviz 12.0.1~dev.20240715.2254
Loading...
Searching...
No Matches
gvrender_lasi.cpp
Go to the documentation of this file.
1/*************************************************************************
2 * Copyright (c) 2011 AT&T Intellectual Property
3 * All rights reserved. This program and the accompanying materials
4 * are made available under the terms of the Eclipse Public License v1.0
5 * which accompanies this distribution, and is available at
6 * https://www.eclipse.org/legal/epl-v10.html
7 *
8 * Contributors: Details at https://graphviz.org
9 *************************************************************************/
10
11#include <cstddef>
12#include <iostream>
13#include <fstream>
14#include <stdexcept>
15#include <string>
16#include <LASi.h>
17
18#include "config.h"
19
20#include <gvc/gvplugin_render.h>
21#include <gvc/gvplugin_device.h>
22#include <gvc/gvio.h>
23#include <gvc/gvcint.h>
24#include <cgraph/agxbuf.h>
25#include <cgraph/prisize_t.h>
26#include <cgraph/unreachable.h>
27#include <common/const.h>
28#include <common/utils.h>
29#include "../core/ps.h"
30
31using namespace LASi;
32using namespace std;
33
34// J$: added `pdfmark' URL embedding. PostScript rendered from
35// dot files with URL attributes will get active PDF links
36// from Adobe's Distiller.
37#define PDFMAX 14400
38
40
41struct Context {
42 using write_fn = size_t(*)(GVJ_t*, const char*, size_t);
43
45
46 PostscriptDocument doc;
48};
49
50static size_t lasi_head_writer(GVJ_t * job, const char *s, size_t len)
51{
52 Context *ctxt = reinterpret_cast<Context*>(job->context);
53 ctxt->doc.osHeader() << s;
54 return len;
55}
56
57static size_t lasi_body_writer(GVJ_t * job, const char *s, size_t len)
58{
59 Context *ctxt = reinterpret_cast<Context*>(job->context);
60 ctxt->doc.osBody() << s;
61 return len;
62}
63
64static size_t lasi_footer_writer(GVJ_t * job, const char *s, size_t len)
65{
66 Context *ctxt = reinterpret_cast<Context*>(job->context);
67 ctxt->doc.osFooter() << s;
68 return len;
69}
70
71static void lasi_begin_job(GVJ_t * job)
72{
73 job->context = new Context(job->gvc->write_fn);
75
76 gvprintf(job, "%%%%Creator: %s version %s (%s)\n",
77 job->common->info[0], job->common->info[1], job->common->info[2]);
78}
79
80static void lasi_end_job(GVJ_t * job)
81{
83
84 if (job->render.id != FORMAT_EPS)
85 gvprintf(job, "%%%%Pages: %d\n", job->common->viewNum);
86 if (job->common->show_boxes == nullptr)
87 if (job->render.id != FORMAT_EPS)
88 gvprintf(job, "%%%%BoundingBox: %d %d %d %d\n",
89 job->boundingBox.LL.x, job->boundingBox.LL.y,
90 job->boundingBox.UR.x, job->boundingBox.UR.y);
91 gvputs(job, "end\nrestore\n");
92
93 {
94 // create the new stream to "redirect" cout's output to
95 ostringstream output;
96
97 // smart class that will swap streambufs and replace them
98 // when object goes out of scope.
99 class StreamBuf_Swapper
100 {
101 public:
102 StreamBuf_Swapper(ostream & orig, ostream & replacement)
103 : buf_(orig.rdbuf()), str_(orig)
104 {
105 orig.rdbuf(replacement.rdbuf());
106 }
107 ~StreamBuf_Swapper()
108 {
109 str_.rdbuf(buf_);
110 }
111 private:
112 std::streambuf * buf_;
113 std::ostream & str_;
114 } swapper(cout, output);
115
116 Context *ctxt = reinterpret_cast<Context*>(job->context);
117 ctxt->doc.write(cout);
118
119 job->gvc->write_fn = ctxt->save_write_fn;
120 gvputs(job, output.str().c_str());
121
122 delete ctxt;
123 }
124}
125
126static void lasi_begin_graph(GVJ_t * job)
127{
128 obj_state_t *obj = job->obj;
129
131
132 if (job->common->viewNum == 0) {
133 gvprintf(job, "%%%%Title: %s\n", agnameof(obj->u.g));
134 if (job->render.id != FORMAT_EPS)
135 gvputs(job, "%%Pages: (atend)\n");
136 else
137 gvputs(job, "%%Pages: 1\n");
138 if (job->common->show_boxes == nullptr) {
139 if (job->render.id != FORMAT_EPS)
140 gvputs(job, "%%BoundingBox: (atend)\n");
141 else
142 gvprintf(job, "%%%%BoundingBox: %d %d %d %d\n",
145 }
146 gvputs(job, "%%EndComments\nsave\n");
147 // include shape library
148 cat_libfile(job, job->common->lib, ps_txt);
149 // include epsf
150 epsf_define(job);
151 if (job->common->show_boxes) {
152 const char* args[2];
153 args[0] = job->common->show_boxes[0];
154 args[1] = nullptr;
155 cat_libfile(job, nullptr, args);
156 }
157 }
158 // Set base URL for relative links (for Distiller ≥ 3.0)
159 if (obj->url)
160 gvprintf(job, "[ {Catalog} << /URI << /Base %s >> >>\n"
161 "/PUT pdfmark\n", ps_string(obj->url, CHAR_UTF8));
162}
163
164static void lasi_begin_layer(GVJ_t * job, char*, int layerNum, int numLayers)
165{
166 gvprintf(job, "%d %d setlayer\n", layerNum, numLayers);
167}
168
169static void lasi_begin_page(GVJ_t * job)
170{
171 box pbr = job->pageBoundingBox;
172
173 gvprintf(job, "%%%%Page: %d %d\n",
174 job->common->viewNum + 1, job->common->viewNum + 1);
175 if (job->common->show_boxes == nullptr)
176 gvprintf(job, "%%%%PageBoundingBox: %d %d %d %d\n",
177 pbr.LL.x, pbr.LL.y, pbr.UR.x, pbr.UR.y);
178 gvprintf(job, "%%%%PageOrientation: %s\n",
179 (job->rotation ? "Landscape" : "Portrait"));
180 if (job->render.id == FORMAT_PS2)
181 gvprintf(job, "<< /PageSize [%d %d] >> setpagedevice\n",
182 pbr.UR.x, pbr.UR.y);
183 gvprintf(job, "%d %d %d beginpage\n",
184 job->pagesArrayElem.x, job->pagesArrayElem.y, job->numPages);
185 if (job->common->show_boxes == nullptr)
186 gvprintf(job, "gsave\n%d %d %d %d boxprim clip newpath\n",
187 pbr.LL.x, pbr.LL.y, pbr.UR.x-pbr.LL.x, pbr.UR.y-pbr.LL.y);
188 gvprintf(job, "%g %g set_scale %d rotate %g %g translate\n",
189 job->scale.x, job->scale.y,
190 job->rotation,
191 job->translation.x, job->translation.y);
192
193 // Define the size of the PS canvas
194 if (job->render.id == FORMAT_PS2) {
195 if (pbr.UR.x >= PDFMAX || pbr.UR.y >= PDFMAX)
196 job->common->errorfn("canvas size (%d,%d) exceeds PDF limit (%d)\n"
197 "\t(suggest setting a bounding box size, see dot(1))\n",
198 pbr.UR.x, pbr.UR.y, PDFMAX);
199 gvprintf(job, "[ /CropBox [%d %d %d %d] /PAGES pdfmark\n",
200 pbr.LL.x, pbr.LL.y, pbr.UR.x, pbr.UR.y);
201 }
202}
203
204static void lasi_end_page(GVJ_t * job)
205{
206 if (job->common->show_boxes) {
207 gvputs(job, "0 0 0 edgecolor\n");
208 cat_libfile(job, nullptr, job->common->show_boxes + 1);
209 }
210 // the showpage is really a no-op, but at least one PS processor
211 // out there needs to see this literal token. endpage does the real work.
212 gvputs(job, "endpage\nshowpage\ngrestore\n");
213 gvputs(job, "%%PageTrailer\n");
214 gvprintf(job, "%%%%EndPage: %d\n", job->common->viewNum);
215}
216
217static void lasi_begin_cluster(GVJ_t * job)
218{
219 obj_state_t *obj = job->obj;
220
221 gvprintf(job, "%% %s\n", agnameof(obj->u.sg));
222 gvputs(job, "gsave\n");
223}
224
225static void lasi_end_cluster(GVJ_t * job)
226{
227 gvputs(job, "grestore\n");
228}
229
230static void lasi_begin_node(GVJ_t * job)
231{
232 gvputs(job, "gsave\n");
233}
234
235static void lasi_end_node(GVJ_t * job)
236{
237 gvputs(job, "grestore\n");
238}
239
240static void
242{
243 gvputs(job, "gsave\n");
244}
245
246static void lasi_end_edge(GVJ_t * job)
247{
248 gvputs(job, "grestore\n");
249}
250
251static void lasi_begin_anchor(GVJ_t *job, char *url, char*, char*, char*)
252{
253 obj_state_t *obj = job->obj;
254
255 if (url && obj->url_map_p) {
256 gvputs(job, "[ /Rect [ ");
257 gvprintpointflist(job, obj->url_map_p, 2);
258 gvputs(job, " ]\n");
259 gvprintf(job, " /Border [ 0 0 0 ]\n"
260 " /Action << /Subtype /URI /URI %s >>\n"
261 " /Subtype /Link\n"
262 "/ANN pdfmark\n",
263 ps_string(url, CHAR_UTF8));
264 }
265}
266
267static void ps_set_pen_style(GVJ_t *job)
268{
269 double penwidth = job->obj->penwidth;
270 char *p, *line, **s = job->obj->rawstyle;
271
273 gvputs(job," setlinewidth\n");
274
275 while (s && (p = line = *s++)) {
276 if (line == std::string{"setlinewidth"})
277 continue;
278 while (*p)
279 p++;
280 p++;
281 while (*p) {
282 gvprintf(job,"%s ", p);
283 while (*p)
284 p++;
285 p++;
286 }
287 if (line == std::string{"invis"})
288 job->obj->penwidth = 0;
289 gvprintf(job, "%s\n", line);
290 }
291}
292
294{
295 const char *objtype;
296
297 if (color) {
298 switch (job->obj->type) {
300 case CLUSTER_OBJTYPE:
301 objtype = "graph";
302 break;
303 case NODE_OBJTYPE:
304 objtype = "node";
305 break;
306 case EDGE_OBJTYPE:
307 objtype = "edge";
308 break;
309 default:
310 objtype = "sethsb";
311 break;
312 }
313 gvprintf(job, "%.3g %.3g %.3g %scolor\n",
314 color->u.HSVA[0], color->u.HSVA[1], color->u.HSVA[2], objtype);
315 }
316}
317
318static void lasi_textspan(GVJ_t * job, pointf p, textspan_t * span)
319{
320 const char *font;
321 const PangoFontDescription *pango_font;
322 FontStretch stretch;
323 FontStyle style;
324 FontVariant variant;
325 FontWeight weight;
326 PostscriptAlias *pA;
327
328 if (job->obj->pencolor.u.HSVA[3] < .5)
329 return; // skip transparent text
330
331 if (span->layout) {
332 pango_font = pango_layout_get_font_description((PangoLayout*)(span->layout));
333 font = pango_font_description_get_family(pango_font);
334 switch (pango_font_description_get_stretch(pango_font)) {
335 case PANGO_STRETCH_ULTRA_CONDENSED: stretch = ULTRACONDENSED; break;
336 case PANGO_STRETCH_EXTRA_CONDENSED: stretch = EXTRACONDENSED; break;
337 case PANGO_STRETCH_CONDENSED: stretch = CONDENSED; break;
338 case PANGO_STRETCH_SEMI_CONDENSED: stretch = SEMICONDENSED; break;
339 case PANGO_STRETCH_NORMAL: stretch = NORMAL_STRETCH; break;
340 case PANGO_STRETCH_SEMI_EXPANDED: stretch = SEMIEXPANDED; break;
341 case PANGO_STRETCH_EXPANDED: stretch = EXPANDED; break;
342 case PANGO_STRETCH_EXTRA_EXPANDED: stretch = EXTRAEXPANDED; break;
343 case PANGO_STRETCH_ULTRA_EXPANDED: stretch = ULTRAEXPANDED; break;
344 default:
345 UNREACHABLE();
346 }
347 switch (pango_font_description_get_style(pango_font)) {
348 case PANGO_STYLE_NORMAL: style = NORMAL_STYLE; break;
349 case PANGO_STYLE_OBLIQUE: style = OBLIQUE; break;
350 case PANGO_STYLE_ITALIC: style = ITALIC; break;
351 default:
352 UNREACHABLE();
353 }
354 switch (pango_font_description_get_variant(pango_font)) {
355 case PANGO_VARIANT_NORMAL: variant = NORMAL_VARIANT; break;
356 case PANGO_VARIANT_SMALL_CAPS: variant = SMALLCAPS; break;
357#if PANGO_VERSION_CHECK(1, 50, 0)
358 case PANGO_VARIANT_ALL_SMALL_CAPS: variant = SMALLCAPS; break;
359 case PANGO_VARIANT_PETITE_CAPS: variant = SMALLCAPS; break;
360 case PANGO_VARIANT_ALL_PETITE_CAPS: variant = SMALLCAPS; break;
361 case PANGO_VARIANT_UNICASE: variant = SMALLCAPS; break;
362 case PANGO_VARIANT_TITLE_CAPS: variant = SMALLCAPS; break;
363#endif
364 default:
365 UNREACHABLE();
366 }
367 switch (pango_font_description_get_weight(pango_font)) {
368#if PANGO_VERSION_CHECK(1, 24, 0)
369 case PANGO_WEIGHT_THIN: weight = ULTRALIGHT; break; // no exact match in LASi
370#endif
371 case PANGO_WEIGHT_ULTRALIGHT: weight = ULTRALIGHT; break;
372 case PANGO_WEIGHT_LIGHT: weight = LIGHT; break;
373#if PANGO_VERSION_CHECK(1, 36, 7)
374 case PANGO_WEIGHT_SEMILIGHT: weight = LIGHT; break; // no exact match in LASi
375#endif
376#if PANGO_VERSION_CHECK(1, 24, 0)
377 case PANGO_WEIGHT_BOOK: weight = NORMAL_WEIGHT; break; // no exact match in LASi
378#endif
379 case PANGO_WEIGHT_NORMAL: weight = NORMAL_WEIGHT; break;
380#if PANGO_VERSION_CHECK(1, 24, 0)
381 case PANGO_WEIGHT_MEDIUM: weight = NORMAL_WEIGHT; break; // no exact match in LASi
382#endif
383 case PANGO_WEIGHT_SEMIBOLD: weight = BOLD; break; /* no exact match in lasi */
384 case PANGO_WEIGHT_BOLD: weight = BOLD; break;
385 case PANGO_WEIGHT_ULTRABOLD: weight = ULTRABOLD; break;
386 case PANGO_WEIGHT_HEAVY: weight = HEAVY; break;
387#if PANGO_VERSION_CHECK(1, 24, 0)
388 case PANGO_WEIGHT_ULTRAHEAVY: weight = HEAVY; break; // no exact match in LASi
389#endif
390 default:
391 UNREACHABLE();
392 }
393 }
394 else {
395 pA = span->font->postscript_alias;
396 font = pA->svg_font_family;
397 stretch = NORMAL_STRETCH;
398 if (pA->svg_font_style && pA->svg_font_style == std::string{"italic"})
399 style = ITALIC;
400 else
401 style = NORMAL_STYLE;
402 variant = NORMAL_VARIANT;
403 if (pA->svg_font_weight && pA->svg_font_weight == std::string{"bold"})
404 weight = BOLD;
405 else
406 weight = NORMAL_WEIGHT;
407 }
408
409 ps_set_color(job, &(job->obj->pencolor));
410 Context *ctxt = reinterpret_cast<Context*>(job->context);
411 ctxt->doc.osBody() << setFont(font, style, weight, variant, stretch) << setFontSize(span->font->size) << "\n";
412 switch (span->just) {
413 case 'r':
414 p.x -= span->size.x;
415 break;
416 case 'l':
417 p.x -= 0.0;
418 break;
419 case 'n':
420 default:
421 p.x -= span->size.x / 2.0;
422 break;
423 }
424 p.y += span->yoffset_centerline;
425 gvprintpointf(job, p);
426 gvputs(job, " moveto ");
427 ctxt->doc.osBody() << show(span->str) << "\n";
428
429}
430
431static void lasi_ellipse(GVJ_t * job, pointf * A, int filled)
432{
433 // A[] contains 2 points: the center and corner.
434 pointf AA[2];
435
436 AA[0] = A[0];
437 AA[1].x = A[1].x - A[0].x;
438 AA[1].y = A[1].y - A[0].y;
439
440 if (filled && job->obj->fillcolor.u.HSVA[3] > .5) {
441 ps_set_color(job, &(job->obj->fillcolor));
442 gvprintpointflist(job, AA, 2);
443 gvputs(job, " ellipse_path fill\n");
444 }
445 if (job->obj->pencolor.u.HSVA[3] > .5) {
446 ps_set_pen_style(job);
447 ps_set_color(job, &(job->obj->pencolor));
448 gvprintpointflist(job, AA, 2);
449 gvputs(job, " ellipse_path stroke\n");
450 }
451}
452
453static void lasi_bezier(GVJ_t *job, pointf *A, size_t n, int filled) {
454 if (filled && job->obj->fillcolor.u.HSVA[3] > .5) {
455 ps_set_color(job, &(job->obj->fillcolor));
456 gvputs(job, "newpath ");
457 gvprintpointf(job, A[0]);
458 gvputs(job, " moveto\n");
459 for (size_t j = 1; j < n; j += 3) {
460 gvprintpointflist(job, &A[j], 3);
461 gvputs(job, " curveto\n");
462 }
463 gvputs(job, "closepath fill\n");
464 }
465 if (job->obj->pencolor.u.HSVA[3] > .5) {
466 ps_set_pen_style(job);
467 ps_set_color(job, &(job->obj->pencolor));
468 gvputs(job, "newpath ");
469 gvprintpointf(job, A[0]);
470 gvputs(job, " moveto\n");
471 for (size_t j = 1; j < n; j += 3) {
472 gvprintpointflist(job, &A[j], 3);
473 gvputs(job, " curveto\n");
474 }
475 gvputs(job, "stroke\n");
476 }
477}
478
479static void lasi_polygon(GVJ_t *job, pointf *A, size_t n, int filled) {
480 if (filled && job->obj->fillcolor.u.HSVA[3] > .5) {
481 ps_set_color(job, &(job->obj->fillcolor));
482 gvputs(job, "newpath ");
483 gvprintpointf(job, A[0]);
484 gvputs(job, " moveto\n");
485 for (size_t j = 1; j < n; j++) {
486 gvprintpointf(job, A[j]);
487 gvputs(job, " lineto\n");
488 }
489 gvputs(job, "closepath fill\n");
490 }
491 if (job->obj->pencolor.u.HSVA[3] > .5) {
492 ps_set_pen_style(job);
493 ps_set_color(job, &(job->obj->pencolor));
494 gvputs(job, "newpath ");
495 gvprintpointf(job, A[0]);
496 gvputs(job, " moveto\n");
497 for (size_t j = 1; j < n; j++) {
498 gvprintpointf(job, A[j]);
499 gvputs(job, " lineto\n");
500 }
501 gvputs(job, "closepath stroke\n");
502 }
503}
504
505static void lasi_polyline(GVJ_t *job, pointf *A, size_t n) {
506 if (job->obj->pencolor.u.HSVA[3] > .5) {
507 ps_set_pen_style(job);
508 ps_set_color(job, &(job->obj->pencolor));
509 gvputs(job, "newpath ");
510 gvprintpointf(job, A[0]);
511 gvputs(job, " moveto\n");
512 for (size_t j = 1; j < n; j++) {
513 gvprintpointf(job, A[j]);
514 gvputs(job, " lineto\n");
515 }
516 gvputs(job, "stroke\n");
517 }
518}
519
520static void lasi_comment(GVJ_t * job, char *str)
521{
522 gvputs(job, "% ");
523 gvputs(job, str);
524 gvputs(job, "\n");
525}
526
527static void lasi_library_shape(GVJ_t *job, char *name, pointf *A, size_t n,
528 int filled) {
529 if (filled && job->obj->fillcolor.u.HSVA[3] > .5) {
530 ps_set_color(job, &(job->obj->fillcolor));
531 gvputs(job, "[ ");
532 gvprintpointflist(job, A, n);
533 gvputs(job, " ");
534 gvprintpointf(job, A[0]);
535 gvprintf(job, " ] %" PRISIZE_T " true %s\n", n, name);
536 }
537 if (job->obj->pencolor.u.HSVA[3] > .5) {
538 ps_set_pen_style(job);
539 ps_set_color(job, &(job->obj->pencolor));
540 gvputs(job, "[ ");
541 gvprintpointflist(job, A, n);
542 gvputs(job, " ");
543 gvprintpointf(job, A[0]);
544 gvprintf(job, " ] %" PRISIZE_T " false %s\n", n, name);
545 }
546}
547
552 0, // lasi_end_graph
554 0, // lasi_end_layer
559 0, // lasi_begin_nodes
560 0, // lasi_end_nodes
561 0, // lasi_begin_edges
562 0, // lasi_end_edges
568 0, // lasi_end_anchor
569 0, // lasi_begin_label
570 0, // lasi_end_label
572 0, // lasi_resolve_color
579};
580
586 4., // default pad - graph units
587 nullptr, // knowncolors
588 0, // sizeof knowncolors
589 HSVA_DOUBLE, // color_type
590};
591
594 | GVDEVICE_DOES_LAYERS, // flags
595 {36.,36.}, // default margin - points
596 {612.,792.}, // default page width, height - points
597 {72.,72.}, // default dpi
598};
599
601 0, // flags
602 {36.,36.}, // default margin - points
603 {612.,792.}, // default page width, height - points
604 {72.,72.}, // default dpi
605};
606
609 {0, nullptr, 0, nullptr, nullptr}
610};
611
613 {FORMAT_PS, "ps:lasi", -5, nullptr, &device_features_ps},
614 {FORMAT_PS2, "ps2:lasi", -5, nullptr, &device_features_ps},
615 {FORMAT_EPS, "eps:lasi", -5, nullptr, &device_features_eps},
616 {0, nullptr, 0, nullptr, nullptr}
617};
@ HSVA_DOUBLE
Definition color.h:26
#define CHAR_UTF8
Definition const.h:196
#define A(n, t)
Definition expr.h:76
static double len(glCompPoint p)
Definition glutils.c:150
char * agnameof(void *)
returns a string descriptor for the object.
Definition id.c:158
#define BOLD
Definition gv2gml.c:53
#define GVRENDER_NO_WHITE_BG
Definition gvcjob.h:106
#define GVDEVICE_DOES_PAGES
Definition gvcjob.h:87
#define GVDEVICE_DOES_LAYERS
Definition gvcjob.h:88
#define GVRENDER_DOES_MAPS
Definition gvcjob.h:97
@ CLUSTER_OBJTYPE
Definition gvcjob.h:168
@ EDGE_OBJTYPE
Definition gvcjob.h:168
@ ROOTGRAPH_OBJTYPE
Definition gvcjob.h:168
@ NODE_OBJTYPE
Definition gvcjob.h:168
#define GVRENDER_DOES_TRANSFORM
Definition gvcjob.h:95
#define GVRENDER_DOES_MAP_RECTANGLE
Definition gvcjob.h:98
static void color(Agraph_t *g)
Definition gvcolor.c:128
int gvputs(GVJ_t *job, const char *s)
Definition gvdevice.c:263
void gvprintpointflist(GVJ_t *job, pointf *p, size_t n)
Definition gvdevice.c:537
void gvprintpointf(GVJ_t *job, pointf p)
Definition gvdevice.c:523
void gvprintf(GVJ_t *job, const char *format,...)
Definition gvdevice.c:394
void gvprintdouble(GVJ_t *job, double num)
Definition gvdevice.c:506
#define ITALIC
Definition gvrender.c:131
static double penwidth[]
static gvrender_engine_t lasi_engine
static size_t lasi_head_writer(GVJ_t *job, const char *s, size_t len)
static void lasi_begin_graph(GVJ_t *job)
static gvdevice_features_t device_features_eps
static void lasi_end_cluster(GVJ_t *job)
static size_t lasi_footer_writer(GVJ_t *job, const char *s, size_t len)
static size_t lasi_body_writer(GVJ_t *job, const char *s, size_t len)
static void lasi_end_edge(GVJ_t *job)
gvplugin_installed_t gvdevice_lasi_types[]
static void lasi_begin_cluster(GVJ_t *job)
static void lasi_begin_anchor(GVJ_t *job, char *url, char *, char *, char *)
static void lasi_comment(GVJ_t *job, char *str)
static void lasi_end_node(GVJ_t *job)
static void ps_set_color(GVJ_t *job, gvcolor_t *color)
static void lasi_begin_edge(GVJ_t *job)
static void lasi_polygon(GVJ_t *job, pointf *A, size_t n, int filled)
#define PDFMAX
Maximum size of PDF page.
static void lasi_library_shape(GVJ_t *job, char *name, pointf *A, size_t n, int filled)
static gvdevice_features_t device_features_ps
gvplugin_installed_t gvrender_lasi_types[]
static void lasi_textspan(GVJ_t *job, pointf p, textspan_t *span)
format_type
@ FORMAT_EPS
@ FORMAT_PS2
@ FORMAT_PS
static void lasi_begin_node(GVJ_t *job)
static void lasi_end_job(GVJ_t *job)
static void lasi_polyline(GVJ_t *job, pointf *A, size_t n)
static void lasi_begin_job(GVJ_t *job)
static void lasi_begin_page(GVJ_t *job)
static void lasi_end_page(GVJ_t *job)
static gvrender_features_t render_features_lasi
static void lasi_ellipse(GVJ_t *job, pointf *A, int filled)
static void lasi_begin_layer(GVJ_t *job, char *, int layerNum, int numLayers)
static void lasi_bezier(GVJ_t *job, pointf *A, size_t n, int filled)
static void ps_set_pen_style(GVJ_t *job)
agxbuf * str
Definition htmlparse.c:97
$2 font
Definition htmlparse.y:498
#define PRISIZE_T
PRIu64 alike for printing size_t
Definition prisize_t.h:27
static const char * ps_txt[]
Definition ps.h:5
void epsf_define(GVJ_t *job)
char * ps_string(char *ins, int chset)
void cat_libfile(GVJ_t *job, const char **arglib, const char **stdlib)
Context(write_fn fn)
PostscriptDocument doc
write_fn save_write_fn
size_t(*)(GVJ_t *, const char *, size_t) write_fn
const char ** lib
Definition gvcommon.h:26
char ** info
Definition gvcommon.h:20
void(* errorfn)(const char *fmt,...)
Definition gvcommon.h:24
const char ** show_boxes
emit code for correct box coordinates
Definition gvcommon.h:25
int viewNum
rendering state
Definition gvcommon.h:29
size_t(* write_fn)(GVJ_t *job, const char *s, size_t len)
Definition gvcint.h:103
int rotation
Definition gvcjob.h:319
obj_state_t * obj
Definition gvcjob.h:269
void * context
Definition gvcjob.h:295
point pagesArrayElem
Definition gvcjob.h:308
gvplugin_active_render_t render
Definition gvcjob.h:285
GVCOMMON_t * common
Definition gvcjob.h:267
box pageBoundingBox
Definition gvcjob.h:329
box boundingBox
Definition gvcjob.h:330
pointf scale
Definition gvcjob.h:332
GVC_t * gvc
Definition gvcjob.h:263
int numPages
Definition gvcjob.h:309
pointf translation
Definition gvcjob.h:333
char * svg_font_style
Definition textspan.h:46
char * svg_font_weight
Definition textspan.h:45
char * svg_font_family
Definition textspan.h:44
Definition geom.h:39
point LL
Definition geom.h:39
point UR
Definition geom.h:39
double HSVA[4]
Definition color.h:33
union color_s::@72 u
ingroup plugin_api
Definition gvplugin.h:35
union obj_state_s::@92 u
graph_t * g
Definition gvcjob.h:186
pointf * url_map_p
Definition gvcjob.h:240
gvcolor_t fillcolor
Definition gvcjob.h:194
char * url
Definition gvcjob.h:210
obj_type type
Definition gvcjob.h:184
graph_t * sg
Definition gvcjob.h:187
gvcolor_t pencolor
Definition gvcjob.h:194
char ** rawstyle
Definition gvcjob.h:200
double penwidth
Definition gvcjob.h:199
int y
Definition geom.h:27
int x
Definition geom.h:27
double x
Definition geom.h:29
double y
Definition geom.h:29
PostscriptAlias * postscript_alias
Definition textspan.h:56
double size
Definition textspan.h:57
char * str
Definition textspan.h:65
char just
'l' 'n' 'r'
Definition textspan.h:71
void * layout
Definition textspan.h:67
pointf size
Definition textspan.h:70
textfont_t * font
Definition textspan.h:66
double yoffset_centerline
Definition textspan.h:69
Definition grammar.c:93
#define UNREACHABLE()
Definition unreachable.h:30