Graphviz  2.39.20141224.0545
gvrender.c
Go to the documentation of this file.
1 /* $Id$ $Revision$ */
2 /* vim:set shiftwidth=4 ts=8: */
3 
4 /*************************************************************************
5  * Copyright (c) 2011 AT&T Intellectual Property
6  * All rights reserved. This program and the accompanying materials
7  * are made available under the terms of the Eclipse Public License v1.0
8  * which accompanies this distribution, and is available at
9  * http://www.eclipse.org/legal/epl-v10.html
10  *
11  * Contributors: See CVS logs. Details at http://www.graphviz.org/
12  *************************************************************************/
13 
14 /*
15  * graphics code generator wrapper
16  *
17  * This library forms the socket for run-time loadable render plugins.
18  */
19 
20 #ifdef HAVE_CONFIG_H
21 #include "config.h"
22 #endif
23 
24 #include <string.h>
25 #include "memory.h"
26 #include "const.h"
27 #include "macros.h"
28 #include "colorprocs.h"
29 #include "gvplugin_render.h"
30 #include "cgraph.h"
31 #include "gvcint.h"
32 #include "geom.h"
33 #include "geomprocs.h"
34 #include "gvcproc.h"
35 
36 extern int emit_once(char *str);
37 extern shape_desc *find_user_shape(char *name);
38 extern boolean mapbool(char *s);
39 
40 #ifndef HAVE_STRCASECMP
41 extern int strcasecmp(const char *s1, const char *s2);
42 #endif
43 
44 /* storage for temporary hacks until client API is FP */
45 static pointf *AF;
46 static int sizeAF;
47 /* end hack */
48 
49 int gvrender_select(GVJ_t * job, const char *str)
50 {
51  GVC_t *gvc = job->gvc;
52  gvplugin_available_t *plugin;
53  gvplugin_installed_t *typeptr;
54 
55  gvplugin_load(gvc, API_device, str);
56 
57  /* When job is created, it is zeroed out.
58  * Some flags, such as OUTPUT_NOT_REQUIRED, may already be set,
59  * so don't reset.
60  */
61  /* job->flags = 0; */
62  plugin = gvc->api[API_device];
63  if (plugin) {
64  typeptr = plugin->typeptr;
65  job->device.engine = (gvdevice_engine_t *) (typeptr->engine);
66  job->device.features = (gvdevice_features_t *) (typeptr->features);
67  job->device.id = typeptr->id;
68  job->device.type = plugin->typestr;
69 
70  job->flags |= job->device.features->flags;
71  } else
72  return NO_SUPPORT; /* FIXME - should differentiate problem */
73 
74  /* The device plugin has a dependency on a render plugin,
75  * so the render plugin should be available as well now */
76  plugin = gvc->api[API_render];
77  if (plugin) {
78  typeptr = plugin->typeptr;
79  job->render.engine = (gvrender_engine_t *) (typeptr->engine);
80  job->render.features = (gvrender_features_t *) (typeptr->features);
81  job->render.type = plugin->typestr;
82 
83  job->flags |= job->render.features->flags;
84 
85  if (job->device.engine)
86  job->render.id = typeptr->id;
87  else
88  /* A null device engine indicates that the device id is also the renderer id
89  * and that the renderer doesn't need "device" functions.
90  * Device "features" settings are still available */
91  job->render.id = job->device.id;
92  return GVRENDER_PLUGIN;
93  }
94  job->render.engine = NULL;
95  return NO_SUPPORT; /* FIXME - should differentiate problem */
96 }
97 
99 {
100  gvrender_engine_t *gvre = job->render.engine;
101  int features = 0;
102 
103  if (gvre) {
104  features = job->render.features->flags;
105  }
106  return features;
107 }
108 
109 /* gvrender_begin_job:
110  * Return 0 on success
111  */
113 {
114  gvrender_engine_t *gvre = job->render.engine;
115 
116  if (gvdevice_initialize(job))
117  return 1;
118  if (gvre) {
119  if (gvre->begin_job)
120  gvre->begin_job(job);
121  }
122  return 0;
123 }
124 
126 {
127  gvrender_engine_t *gvre = job->render.engine;
128 
129  if (gvre) {
130  if (gvre->end_job)
131  gvre->end_job(job);
132  }
133  job->gvc->common.lib = NULL; /* FIXME - minimally this doesn't belong here */
134  gvdevice_finalize(job);
135 }
136 
137 /* font modifiers */
138 #define REGULAR 0
139 #define BOLD 1
140 #define ITALIC 2
141 
143 {
144  pointf rv, translation, scale;
145 
146  translation = job->translation;
147  scale.x = job->zoom * job->devscale.x;
148  scale.y = job->zoom * job->devscale.y;
149 
150  if (job->rotation) {
151  rv.x = -(p.y + translation.y) * scale.x;
152  rv.y = (p.x + translation.x) * scale.y;
153  } else {
154  rv.x = (p.x + translation.x) * scale.x;
155  rv.y = (p.y + translation.y) * scale.y;
156  }
157  return rv;
158 }
159 
160 /* transform an array of n points */
161 /* *AF and *af must be preallocated */
162 /* *AF can be the same as *af for inplace transforms */
163 pointf *gvrender_ptf_A(GVJ_t * job, pointf * af, pointf * AF, int n)
164 {
165  int i;
166  double t;
167  pointf translation, scale;
168 
169  translation = job->translation;
170  scale.x = job->zoom * job->devscale.x;
171  scale.y = job->zoom * job->devscale.y;
172 
173  if (job->rotation) {
174  for (i = 0; i < n; i++) {
175  t = -(af[i].y + translation.y) * scale.x;
176  AF[i].y = (af[i].x + translation.x) * scale.y;
177  AF[i].x = t;
178  }
179  } else {
180  for (i = 0; i < n; i++) {
181  AF[i].x = (af[i].x + translation.x) * scale.x;
182  AF[i].y = (af[i].y + translation.y) * scale.y;
183  }
184  }
185  return AF;
186 }
187 
188 static int gvrender_comparestr(const void *s1, const void *s2)
189 {
190  return strcmp(*(char **) s1, *(char **) s2);
191 }
192 
193 static void gvrender_resolve_color(gvrender_features_t * features,
194  char *name, gvcolor_t * color)
195 {
196  char *tok;
197  int rc;
198 
199  color->u.string = name;
200  color->type = COLOR_STRING;
201  tok = canontoken(name);
202  if (!features->knowncolors
203  ||
204  (bsearch
205  (&tok, features->knowncolors, features->sz_knowncolors,
206  sizeof(char *), gvrender_comparestr)) == NULL) {
207  /* if tok was not found in known_colors */
208  rc = colorxlate(name, color, features->color_type);
209  if (rc != COLOR_OK) {
210  if (rc == COLOR_UNKNOWN) {
211  char *missedcolor = gmalloc(strlen(name) + 16);
212  sprintf(missedcolor, "color %s", name);
213  if (emit_once(missedcolor))
214  agerr(AGWARN, "%s is not a known color.\n", name);
215  free(missedcolor);
216  } else {
217  agerr(AGERR, "error in colxlate()\n");
218  }
219  }
220  }
221 }
222 
224 {
225  /* GVC_t *gvc = job->gvc; */
226  gvrender_engine_t *gvre = job->render.engine;
227  /* char *s; */
228 
229  if (gvre) {
230  /* render specific init */
231  if (gvre->begin_graph)
232  gvre->begin_graph(job);
233 
234 #if 0
235  /* background color */
236  if (((s = agget(g, "bgcolor")) != 0) && s[0]) {
237  gvrender_resolve_color(job->render.features, s,
238  &(gvc->bgcolor));
239  if (gvre->resolve_color)
240  gvre->resolve_color(job, &(gvc->bgcolor));
241  }
242 #endif
243 
244  }
245 }
246 
248 {
249  gvrender_engine_t *gvre = job->render.engine;
250 
251  if (gvre) {
252  if (gvre->end_graph)
253  gvre->end_graph(job);
254  }
255  gvdevice_format(job);
256 }
257 
259 {
260  gvrender_engine_t *gvre = job->render.engine;
261 
262  if (gvre) {
263  if (gvre->begin_page)
264  gvre->begin_page(job);
265  }
266 }
267 
269 {
270  gvrender_engine_t *gvre = job->render.engine;
271 
272  if (gvre) {
273  if (gvre->end_page)
274  gvre->end_page(job);
275  }
276 }
277 
279 {
280  gvrender_engine_t *gvre = job->render.engine;
281 
282  if (gvre) {
283  if (gvre->begin_layer)
284  gvre->begin_layer(job, job->gvc->layerIDs[job->layerNum],
285  job->layerNum, job->numLayers);
286  }
287 }
288 
290 {
291  gvrender_engine_t *gvre = job->render.engine;
292 
293  if (gvre) {
294  if (gvre->end_layer)
295  gvre->end_layer(job);
296  }
297 }
298 
300 {
301  gvrender_engine_t *gvre = job->render.engine;
302 
303  if (gvre) {
304  if (gvre->begin_cluster)
305  gvre->begin_cluster(job);
306  }
307 }
308 
310 {
311  gvrender_engine_t *gvre = job->render.engine;
312 
313  if (gvre) {
314  if (gvre->end_cluster)
315  gvre->end_cluster(job);
316  }
317 }
318 
320 {
321  gvrender_engine_t *gvre = job->render.engine;
322 
323  if (gvre) {
324  if (gvre->begin_nodes)
325  gvre->begin_nodes(job);
326  }
327 }
328 
330 {
331  gvrender_engine_t *gvre = job->render.engine;
332 
333  if (gvre) {
334  if (gvre->end_nodes)
335  gvre->end_nodes(job);
336  }
337 }
338 
340 {
341  gvrender_engine_t *gvre = job->render.engine;
342 
343  if (gvre) {
344  if (gvre->begin_edges)
345  gvre->begin_edges(job);
346  }
347 }
348 
350 {
351  gvrender_engine_t *gvre = job->render.engine;
352 
353  if (gvre) {
354  if (gvre->end_edges)
355  gvre->end_edges(job);
356  }
357 }
358 
360 {
361  gvrender_engine_t *gvre = job->render.engine;
362 
363  if (gvre) {
364  if (gvre->begin_node)
365  gvre->begin_node(job);
366  }
367 }
368 
370 {
371  gvrender_engine_t *gvre = job->render.engine;
372 
373  if (gvre) {
374  if (gvre->end_node)
375  gvre->end_node(job);
376  }
377 }
378 
380 {
381  gvrender_engine_t *gvre = job->render.engine;
382 
383  if (gvre) {
384  if (gvre->begin_edge)
385  gvre->begin_edge(job);
386  }
387 }
388 
390 {
391  gvrender_engine_t *gvre = job->render.engine;
392 
393  if (gvre) {
394  if (gvre->end_edge)
395  gvre->end_edge(job);
396  }
397 }
398 
399 void gvrender_begin_anchor(GVJ_t * job, char *href, char *tooltip,
400  char *target, char *id)
401 {
402  gvrender_engine_t *gvre = job->render.engine;
403 
404  if (gvre) {
405  if (gvre->begin_anchor)
406  gvre->begin_anchor(job, href, tooltip, target, id);
407  }
408 }
409 
411 {
412  gvrender_engine_t *gvre = job->render.engine;
413 
414  if (gvre) {
415  if (gvre->end_anchor)
416  gvre->end_anchor(job);
417  }
418 }
419 
421 {
422  gvrender_engine_t *gvre = job->render.engine;
423 
424  if (gvre) {
425  if (gvre->begin_label)
426  gvre->begin_label(job, type);
427  }
428 }
429 
431 {
432  gvrender_engine_t *gvre = job->render.engine;
433 
434  if (gvre) {
435  if (gvre->end_label)
436  gvre->end_label(job);
437  }
438 }
439 
440 void gvrender_textspan(GVJ_t * job, pointf p, textspan_t * span)
441 {
442  gvrender_engine_t *gvre = job->render.engine;
443  pointf PF;
444 
445  if (span->str && span->str[0]
446  && (!job->obj /* because of xdgen non-conformity */
447  || job->obj->pen != PEN_NONE)) {
448  if (job->flags & GVRENDER_DOES_TRANSFORM)
449  PF = p;
450  else
451  PF = gvrender_ptf(job, p);
452  if (gvre) {
453  if (gvre->textspan)
454  gvre->textspan(job, PF, span);
455  }
456  }
457 }
458 
459 void gvrender_set_pencolor(GVJ_t * job, char *name)
460 {
461  gvrender_engine_t *gvre = job->render.engine;
462  gvcolor_t *color = &(job->obj->pencolor);
463  char *cp = NULL;
464 
465  if ((cp = strstr(name, ":"))) /* if its a color list, then use only first */
466  *cp = '\0';
467  if (gvre) {
468  gvrender_resolve_color(job->render.features, name, color);
469  if (gvre->resolve_color)
470  gvre->resolve_color(job, color);
471  }
472  if (cp) /* restore color list */
473  *cp = ':';
474 }
475 
476 void gvrender_set_fillcolor(GVJ_t * job, char *name)
477 {
478  gvrender_engine_t *gvre = job->render.engine;
479  gvcolor_t *color = &(job->obj->fillcolor);
480  char *cp = NULL;
481 
482  if ((cp = strstr(name, ":"))) /* if its a color list, then use only first */
483  *cp = '\0';
484  if (gvre) {
485  gvrender_resolve_color(job->render.features, name, color);
486  if (gvre->resolve_color)
487  gvre->resolve_color(job, color);
488  }
489  if (cp)
490  *cp = ':';
491 }
492 
493 void gvrender_set_gradient_vals (GVJ_t * job, char *stopcolor, int angle, float frac)
494 {
495  gvrender_engine_t *gvre = job->render.engine;
496  gvcolor_t *color = &(job->obj->stopcolor);
497 
498  if (gvre) {
499  gvrender_resolve_color(job->render.features, stopcolor, color);
500  if (gvre->resolve_color)
501  gvre->resolve_color(job, color);
502  }
503  job->obj->gradient_angle = angle;
504  job->obj->gradient_frac = frac;
505 }
506 
507 void gvrender_set_style(GVJ_t * job, char **s)
508 {
509  gvrender_engine_t *gvre = job->render.engine;
510  obj_state_t *obj = job->obj;
511  char *line, *p;
512 
513  obj->rawstyle = s;
514  if (gvre) {
515  if (s)
516  while ((p = line = *s++)) {
517  if (streq(line, "solid"))
518  obj->pen = PEN_SOLID;
519  else if (streq(line, "dashed"))
520  obj->pen = PEN_DASHED;
521  else if (streq(line, "dotted"))
522  obj->pen = PEN_DOTTED;
523  else if (streq(line, "invis") || streq(line, "invisible"))
524  obj->pen = PEN_NONE;
525  else if (streq(line, "bold"))
526  obj->penwidth = PENWIDTH_BOLD;
527  else if (streq(line, "setlinewidth")) {
528  while (*p)
529  p++;
530  p++;
531  obj->penwidth = atof(p);
532  } else if (streq(line, "filled"))
533  obj->fill = FILL_SOLID;
534  else if (streq(line, "unfilled"))
535  obj->fill = FILL_NONE;
536  else if (streq(line, "tapered"));
537  else {
538  agerr(AGWARN,
539  "gvrender_set_style: unsupported style %s - ignoring\n",
540  line);
541  }
542  }
543  }
544 }
545 
546 void gvrender_ellipse(GVJ_t * job, pointf * pf, int n, int filled)
547 {
548  gvrender_engine_t *gvre = job->render.engine;
549 
550  if (gvre) {
551  if (gvre->ellipse && job->obj->pen != PEN_NONE) {
552  pointf af[2];
553 
554  /* center */
555  af[0].x = (pf[0].x + pf[1].x) / 2.;
556  af[0].y = (pf[0].y + pf[1].y) / 2.;
557  /* corner */
558  af[1] = pf[1];
559 
560  if (!(job->flags & GVRENDER_DOES_TRANSFORM))
561  gvrender_ptf_A(job, af, af, 2);
562  gvre->ellipse(job, af, filled);
563  }
564  }
565 }
566 
567 void gvrender_polygon(GVJ_t * job, pointf * af, int n, int filled)
568 {
569  int noPoly = 0;
570  gvcolor_t save_pencolor;
571 
572  gvrender_engine_t *gvre = job->render.engine;
573  if (gvre) {
574  if (gvre->polygon && job->obj->pen != PEN_NONE) {
575  if (filled & NO_POLY) {
576  noPoly = 1;
577  filled &= ~NO_POLY;
578  save_pencolor = job->obj->pencolor;
579  job->obj->pencolor = job->obj->fillcolor;
580  }
581  if (job->flags & GVRENDER_DOES_TRANSFORM)
582  gvre->polygon(job, af, n, filled);
583  else {
584  if (sizeAF < n) {
585  sizeAF = n + 10;
586  AF = grealloc(AF, sizeAF * sizeof(pointf));
587  }
588  gvrender_ptf_A(job, af, AF, n);
589  gvre->polygon(job, AF, n, filled);
590  }
591  if (noPoly)
592  job->obj->pencolor = save_pencolor;
593  }
594  }
595 }
596 
597 
598 void gvrender_box(GVJ_t * job, boxf B, int filled)
599 {
600  pointf A[4];
601 
602  A[0] = B.LL;
603  A[2] = B.UR;
604  A[1].x = A[0].x;
605  A[1].y = A[2].y;
606  A[3].x = A[2].x;
607  A[3].y = A[0].y;
608 
609  gvrender_polygon(job, A, 4, filled);
610 }
611 
612 void gvrender_beziercurve(GVJ_t * job, pointf * af, int n,
613  int arrow_at_start, int arrow_at_end,
614  boolean filled)
615 {
616  gvrender_engine_t *gvre = job->render.engine;
617 
618  if (gvre) {
619  if (gvre->beziercurve && job->obj->pen != PEN_NONE) {
620  if (job->flags & GVRENDER_DOES_TRANSFORM)
621  gvre->beziercurve(job, af, n, arrow_at_start, arrow_at_end,
622  filled);
623  else {
624  if (sizeAF < n) {
625  sizeAF = n + 10;
626  AF = grealloc(AF, sizeAF * sizeof(pointf));
627  }
628  gvrender_ptf_A(job, af, AF, n);
629  gvre->beziercurve(job, AF, n, arrow_at_start, arrow_at_end,
630  filled);
631  }
632  }
633  }
634 }
635 
636 void gvrender_polyline(GVJ_t * job, pointf * af, int n)
637 {
638  gvrender_engine_t *gvre = job->render.engine;
639 
640  if (gvre) {
641  if (gvre->polyline && job->obj->pen != PEN_NONE) {
642  if (job->flags & GVRENDER_DOES_TRANSFORM)
643  gvre->polyline(job, af, n);
644  else {
645  if (sizeAF < n) {
646  sizeAF = n + 10;
647  AF = grealloc(AF, sizeAF * sizeof(pointf));
648  }
649  gvrender_ptf_A(job, af, AF, n);
650  gvre->polyline(job, AF, n);
651  }
652  }
653  }
654 }
655 
656 void gvrender_comment(GVJ_t * job, char *str)
657 {
658  gvrender_engine_t *gvre = job->render.engine;
659 
660  if (!str || !str[0])
661  return;
662 
663  if (gvre) {
664  if (gvre->comment)
665  gvre->comment(job, str);
666  }
667 }
668 
669 static imagescale_t get_imagescale(char *s)
670 {
671  if (*s == '\0')
672  return IMAGESCALE_FALSE;
673  if (!strcasecmp(s, "width"))
674  return IMAGESCALE_WIDTH;
675  if (!strcasecmp(s, "height"))
676  return IMAGESCALE_HEIGHT;
677  if (!strcasecmp(s, "both"))
678  return IMAGESCALE_BOTH;
679  if (mapbool(s))
680  return IMAGESCALE_TRUE;
681  return IMAGESCALE_FALSE;
682 }
683 
684 /* gvrender_usershape:
685  * Scale image to fill polygon bounding box according to "imagescale"
686  */
687 void gvrender_usershape(GVJ_t * job, char *name, pointf * a, int n,
688  boolean filled, char *imagescale)
689 {
690  gvrender_engine_t *gvre = job->render.engine;
691  usershape_t *us;
692  double iw, ih, pw, ph;
693  double scalex, scaley; /* scale factors */
694  boxf b; /* target box */
695  int i;
696  point isz;
697 
698  assert(job);
699  assert(name);
700  assert(name[0]);
701 
702  if (!(us = gvusershape_find(name))) {
703  if (find_user_shape(name)) {
704  if (gvre && gvre->library_shape)
705  gvre->library_shape(job, name, a, n, filled);
706  }
707  return;
708  }
709 
710  isz = gvusershape_size_dpi(us, job->dpi);
711  if ((isz.x <= 0) && (isz.y <= 0))
712  return;
713 
714  /* compute bb of polygon */
715  b.LL = b.UR = a[0];
716  for (i = 1; i < n; i++) {
717  EXPANDBP(b, a[i]);
718  }
719 
720  pw = b.UR.x - b.LL.x;
721  ph = b.UR.y - b.LL.y;
722  ih = (double) isz.y;
723  iw = (double) isz.x;
724 
725  scalex = pw / iw;
726  scaley = ph / ih;
727 
728  switch (get_imagescale(imagescale)) {
729  case IMAGESCALE_TRUE:
730  /* keep aspect ratio fixed by just using the smaller scale */
731  if (scalex < scaley) {
732  iw *= scalex;
733  ih *= scalex;
734  } else {
735  iw *= scaley;
736  ih *= scaley;
737  }
738  break;
739  case IMAGESCALE_WIDTH:
740  iw *= scalex;
741  break;
742  case IMAGESCALE_HEIGHT:
743  ih *= scaley;
744  break;
745  case IMAGESCALE_BOTH:
746  iw *= scalex;
747  ih *= scaley;
748  break;
749  case IMAGESCALE_FALSE:
750  default:
751  break;
752  }
753 
754  /* if image is smaller than target area then center it */
755  if (iw < pw) {
756  b.LL.x += (pw - iw) / 2.0;
757  b.UR.x -= (pw - iw) / 2.0;
758  }
759  if (ih < ph) {
760  b.LL.y += (ph - ih) / 2.0;
761  b.UR.y -= (ph - ih) / 2.0;
762  }
763 
764  /* convert from graph to device coordinates */
765  if (!(job->flags & GVRENDER_DOES_TRANSFORM)) {
766  b.LL = gvrender_ptf(job, b.LL);
767  b.UR = gvrender_ptf(job, b.UR);
768  }
769 
770  if (b.LL.x > b.UR.x) {
771  double d = b.LL.x;
772  b.LL.x = b.UR.x;
773  b.UR.x = d;
774  }
775  if (b.LL.y > b.UR.y) {
776  double d = b.LL.y;
777  b.LL.y = b.UR.y;
778  b.UR.y = d;
779  }
780  if (gvre) {
781  gvloadimage(job, us, b, filled, job->render.type);
782  }
783 }
784 
785 void gvrender_set_penwidth(GVJ_t * job, double penwidth)
786 {
787  gvrender_engine_t *gvre = job->render.engine;
788 
789  if (gvre) {
790  job->obj->penwidth = penwidth;
791  /*if (gvre->set_penwidth) gvre->set_penwidth(job, penwidth); */
792  }
793 }
void(* begin_graph)(GVJ_t *job)
void s1(graph_t *, node_t *)
Definition: stuff.c:688
pointf * gvrender_ptf_A(GVJ_t *job, pointf *af, pointf *AF, int n)
Definition: gvrender.c:163
void gvrender_set_penwidth(GVJ_t *job, double penwidth)
Definition: gvrender.c:785
char ** rawstyle
Definition: gvcjob.h:209
gvcolor_t stopcolor
Definition: gvcjob.h:203
void(* end_layer)(GVJ_t *job)
Definition: cgraph.h:389
void gvrender_usershape(GVJ_t *job, char *name, pointf *a, int n, boolean filled, char *imagescale)
Definition: gvrender.c:687
int rotation
Definition: gvcjob.h:328
union color_s::@10 u
int gvrender_features(GVJ_t *job)
Definition: gvrender.c:98
void gvrender_textspan(GVJ_t *job, pointf p, textspan_t *span)
Definition: gvrender.c:440
void * grealloc(void *ptr, size_t size)
Definition: memory.c:56
void gvrender_begin_nodes(GVJ_t *job)
Definition: gvrender.c:319
void gvloadimage(GVJ_t *job, usershape_t *us, boxf b, boolean filled, const char *target)
Definition: gvloadimage.c:49
#define PENWIDTH_BOLD
Definition: gvcjob.h:41
void gvrender_begin_cluster(GVJ_t *job, graph_t *sg)
Definition: gvrender.c:299
void(* beziercurve)(GVJ_t *job, pointf *A, int n, int arrow_at_start, int arrow_at_end, int)
pen_type pen
Definition: gvcjob.h:206
void(* begin_layer)(GVJ_t *job, char *layername, int layerNum, int numLayers)
int numLayers
Definition: gvcjob.h:310
int emit_once(char *str)
Definition: emit.c:3532
#define assert(x)
Definition: cghdr.h:48
#define GVRENDER_PLUGIN
Definition: const.h:150
void gvrender_end_anchor(GVJ_t *job)
Definition: gvrender.c:410
Definition: geom.h:30
void gvrender_begin_label(GVJ_t *job, label_type type)
Definition: gvrender.c:420
void(* begin_page)(GVJ_t *job)
void gvrender_comment(GVJ_t *job, char *str)
Definition: gvrender.c:656
void * gmalloc(size_t nbytes)
Definition: memory.c:44
const char * typestr
Definition: gvcint.h:51
const char ** lib
Definition: gvcommon.h:28
void gvrender_begin_edge(GVJ_t *job, edge_t *e)
Definition: gvrender.c:379
Definition: color.h:34
void(* polyline)(GVJ_t *job, pointf *A, int n)
gvplugin_available_t * api[APIS]
Definition: gvcint.h:87
void(* begin_label)(GVJ_t *job, label_type type)
int agerr(agerrlevel_t level, const char *fmt,...)
Definition: agerror.c:142
int flags
Definition: gvcjob.h:308
void(* begin_job)(GVJ_t *job)
gvplugin_available_t * gvplugin_load(GVC_t *gvc, api_t api, const char *type)
Definition: gvplugin.c:250
gvcolor_t pencolor
Definition: gvcjob.h:203
char ** layerIDs
Definition: gvcint.h:128
Definition: gvcjob.h:271
int x
Definition: geom.h:28
void gvrender_begin_node(GVJ_t *job, node_t *n)
Definition: gvrender.c:359
void(* begin_edges)(GVJ_t *job)
void(* ellipse)(GVJ_t *job, pointf *A, int filled)
#define GVRENDER_DOES_TRANSFORM
Definition: gvcjob.h:97
void(* resolve_color)(GVJ_t *job, gvcolor_t *color)
void(* textspan)(GVJ_t *job, pointf p, textspan_t *span)
#define NO_SUPPORT
Definition: const.h:151
shape_desc * find_user_shape(char *name)
Definition: cgraph.h:389
obj_state_t * obj
Definition: gvcjob.h:278
gvplugin_active_device_t device
Definition: gvcjob.h:295
char * agget(void *obj, char *name)
Definition: attr.c:428
pointf devscale
Definition: gvcjob.h:343
void(* library_shape)(GVJ_t *job, char *name, pointf *A, int n, int filled)
pointf dpi
Definition: gvcjob.h:334
void gvrender_begin_layer(GVJ_t *job)
Definition: gvrender.c:278
char * str
Definition: textspan.h:59
color_type_t type
Definition: color.h:44
void gvrender_end_edges(GVJ_t *job)
Definition: gvrender.c:349
void gvrender_set_pencolor(GVJ_t *job, char *name)
Definition: gvrender.c:459
void(* comment)(GVJ_t *job, char *comment)
void free()
gvcolor_t bgcolor
Definition: gvcint.h:140
int gvrender_begin_job(GVJ_t *job)
Definition: gvrender.c:112
gvplugin_active_render_t render
Definition: gvcjob.h:294
int i
Definition: gvdevice.c:448
void gvrender_end_cluster(GVJ_t *job, graph_t *g)
Definition: gvrender.c:309
gvrender_features_t * features
Definition: gvcjob.h:140
void(* end_nodes)(GVJ_t *job)
void gvdevice_finalize(GVJ_t *job)
Definition: gvdevice.c:327
color_type_t color_type
Definition: gvcjob.h:118
void gvrender_end_page(GVJ_t *job)
Definition: gvrender.c:268
double y
Definition: geom.h:30
void(* begin_anchor)(GVJ_t *job, char *href, char *tooltip, char *target, char *id)
Definition: gvcint.h:70
char * string
Definition: color.h:41
int strcasecmp(const char *s1, const char *s2)
Definition: strcasecmp.c:23
void(* begin_edge)(GVJ_t *job)
void(* end_graph)(GVJ_t *job)
void gvrender_end_job(GVJ_t *job)
Definition: gvrender.c:125
GVC_t * gvc
Definition: gvcjob.h:272
void gvrender_set_fillcolor(GVJ_t *job, char *name)
Definition: gvrender.c:476
usershape_t * gvusershape_find(char *name)
Definition: gvusershape.c:573
imagescale_t
Definition: usershape.h:29
#define NO_POLY
Definition: const.h:255
label_type
Definition: gvcjob.h:38
void gvrender_begin_page(GVJ_t *job)
Definition: gvrender.c:258
Definition: grammar.c:79
int gradient_angle
Definition: gvcjob.h:204
void gvrender_beziercurve(GVJ_t *job, pointf *af, int n, int arrow_at_start, int arrow_at_end, boolean filled)
Definition: gvrender.c:612
char ** knowncolors
Definition: gvcjob.h:116
void gvrender_begin_anchor(GVJ_t *job, char *href, char *tooltip, char *target, char *id)
Definition: gvrender.c:399
void(* end_anchor)(GVJ_t *job)
void(* begin_nodes)(GVJ_t *job)
const char * type
Definition: gvcjob.h:141
int colorxlate(char *str, gvcolor_t *color, color_type_t target_type)
Definition: colxlate.c:254
char * canontoken(char *str)
Definition: colxlate.c:145
int layerNum
Definition: gvcjob.h:311
void gvrender_end_graph(GVJ_t *job)
Definition: gvrender.c:247
void(* end_job)(GVJ_t *job)
void gvrender_begin_edges(GVJ_t *job)
Definition: gvrender.c:339
#define NULL
Definition: logic.h:50
float gradient_frac
Definition: gvcjob.h:205
pointf translation
Definition: gvcjob.h:342
void(* end_edges)(GVJ_t *job)
void gvrender_ellipse(GVJ_t *job, pointf *pf, int n, int filled)
Definition: gvrender.c:546
Definition: geom.h:28
double x
Definition: geom.h:30
void gvrender_end_layer(GVJ_t *job)
Definition: gvrender.c:289
pointf gvrender_ptf(GVJ_t *job, pointf p)
Definition: gvrender.c:142
void gvrender_set_style(GVJ_t *job, char **s)
Definition: gvrender.c:507
#define streq(s, t)
Definition: cghdr.h:58
void(* begin_cluster)(GVJ_t *job)
void gvdevice_format(GVJ_t *job)
Definition: gvdevice.c:318
GVC_t * gvc
Definition: htmlparse.c:87
void(* begin_node)(GVJ_t *job)
pointf LL
Definition: geom.h:37
void(* end_edge)(GVJ_t *job)
void(* end_page)(GVJ_t *job)
void gvrender_box(GVJ_t *job, boxf B, int filled)
Definition: gvrender.c:598
void gvrender_end_edge(GVJ_t *job)
Definition: gvrender.c:389
void(* end_label)(GVJ_t *job)
#define COLOR_UNKNOWN
Definition: color.h:48
void(* pf)(char *, void *)
Definition: xdot.c:501
#define COLOR_OK
Definition: color.h:49
GVCOMMON_t common
Definition: gvcint.h:71
void gvrender_begin_graph(GVJ_t *job, graph_t *g)
Definition: gvrender.c:223
void(* end_cluster)(GVJ_t *job)
agxbuf * str
Definition: htmlparse.c:85
void(* end_node)(GVJ_t *job)
void gvrender_polygon(GVJ_t *job, pointf *af, int n, int filled)
Definition: gvrender.c:567
int gvdevice_initialize(GVJ_t *job)
Definition: gvdevice.c:130
void gvrender_end_label(GVJ_t *job)
Definition: gvrender.c:430
gvcolor_t fillcolor
Definition: gvcjob.h:203
double penwidth
Definition: gvcjob.h:208
void gvrender_end_node(GVJ_t *job)
Definition: gvrender.c:369
void gvrender_end_nodes(GVJ_t *job)
Definition: gvrender.c:329
fill_type fill
Definition: gvcjob.h:207
int y
Definition: geom.h:28
gvplugin_installed_t * typeptr
Definition: gvcint.h:55
gvdevice_engine_t * engine
Definition: gvcjob.h:131
double zoom
Definition: gvcjob.h:327
const char * type
Definition: gvcjob.h:134
pointf UR
Definition: geom.h:37
void gvrender_polyline(GVJ_t *job, pointf *af, int n)
Definition: gvrender.c:636
int gvrender_select(GVJ_t *job, const char *str)
Definition: gvrender.c:49
Definition: geom.h:37
point gvusershape_size_dpi(usershape_t *us, pointf dpi)
Definition: gvusershape.c:704
void(* polygon)(GVJ_t *job, pointf *A, int n, int filled)
boolean mapbool(char *s)
Definition: utils.c:470
gvdevice_features_t * features
Definition: gvcjob.h:133
gvrender_engine_t * engine
Definition: gvcjob.h:138
void gvrender_set_gradient_vals(GVJ_t *job, char *stopcolor, int angle, float frac)
Definition: gvrender.c:493