38 #ifndef HAVE_STRCASECMP
60 plugin = gvc->
api[API_device];
74 plugin = gvc->
api[API_render];
142 pointf rv, translation, scale;
149 rv.
x = -(p.
y + translation.
y) * scale.
x;
150 rv.
y = (p.
x + translation.
x) * scale.
y;
152 rv.
x = (p.
x + translation.
x) * scale.
x;
153 rv.
y = (p.
y + translation.
y) * scale.
y;
165 pointf translation, scale;
172 for (i = 0; i < n; i++) {
173 t = -(af[i].
y + translation.
y) * scale.
x;
174 AF[i].
y = (af[i].
x + translation.
x) * scale.
y;
178 for (i = 0; i < n; i++) {
179 AF[i].
x = (af[i].
x + translation.
x) * scale.
x;
180 AF[i].
y = (af[i].
y + translation.
y) * scale.
y;
186 static int gvrender_comparestr(
const void *
s1,
const void *s2)
188 return strcmp(*(
char **) s1, *(
char **) s2);
211 sizeof(
char *), gvrender_comparestr)) ==
NULL) {
216 char *missedcolor =
gmalloc(strlen(name) + 16);
217 sprintf(missedcolor,
"color %s", name);
241 if (((
s =
agget(g,
"bgcolor")) != 0) &&
s[0]) {
405 char *target,
char *
id)
450 if (span->
str && span->
str[0]
470 if ((cp = strstr(name,
":")))
487 if ((cp = strstr(name,
":")))
521 while ((p = line = *s++)) {
522 if (
streq(line,
"solid"))
524 else if (
streq(line,
"dashed"))
526 else if (
streq(line,
"dotted"))
528 else if (
streq(line,
"invis") ||
streq(line,
"invisible"))
530 else if (
streq(line,
"bold"))
532 else if (
streq(line,
"setlinewidth")) {
537 }
else if (
streq(line,
"filled"))
539 else if (
streq(line,
"unfilled"))
541 else if (
streq(line,
"tapered"));
544 "gvrender_set_style: unsupported style %s - ignoring\n",
560 af[0].
x = (pf[0].
x + pf[1].
x) / 2.;
561 af[0].
y = (pf[0].
y + pf[1].
y) / 2.;
567 gvre->
ellipse(job, af, filled);
587 gvre->
polygon(job, af, n, filled);
594 gvre->
polygon(job, AF, n, filled);
618 int arrow_at_start,
int arrow_at_end,
626 gvre->
beziercurve(job, af, n, arrow_at_start, arrow_at_end,
634 gvre->
beziercurve(job, AF, n, arrow_at_start, arrow_at_end,
719 boolean filled,
char *imagescale,
char *imagepos)
723 double iw, ih, pw, ph;
724 double scalex, scaley;
743 if ((isz.
x <= 0) && (isz.
y <= 0))
748 for (i = 1; i < n; i++) {
760 switch (get_imagescale(imagescale)) {
763 if (scalex < scaley) {
787 position = get_imagepos(imagepos);
802 b.
LL.
x += (pw - iw) / 2.0;
803 b.
UR.
x -= (pw - iw) / 2.0;
821 b.
LL.
y += (ph - ih) / 2.0;
822 b.
UR.
y -= (ph - ih) / 2.0;
void(* begin_graph)(GVJ_t *job)
void gvrender_comment(GVJ_t *job, char *str)
void s1(graph_t *, node_t *)
shape_desc * find_user_shape(const char *)
void gvrender_box(GVJ_t *job, boxf BF, int filled)
void(* end_layer)(GVJ_t *job)
void gvrender_polygon(GVJ_t *job, pointf *af, int n, int filled)
int gvrender_begin_job(GVJ_t *job)
void gvrender_end_edge(GVJ_t *job)
int gvrender_features(GVJ_t *job)
void * grealloc(void *ptr, size_t size)
void gvloadimage(GVJ_t *job, usershape_t *us, boxf b, boolean filled, const char *target)
void(* beziercurve)(GVJ_t *job, pointf *A, int n, int arrow_at_start, int arrow_at_end, int)
void(* begin_layer)(GVJ_t *job, char *layername, int layerNum, int numLayers)
void gvrender_end_page(GVJ_t *job)
void gvrender_usershape(GVJ_t *job, char *name, pointf *AF, int n, boolean filled, char *imagescale, char *imagepos)
void(* begin_page)(GVJ_t *job)
void gvrender_set_fillcolor(GVJ_t *job, char *name)
void gvrender_end_label(GVJ_t *job)
void * gmalloc(size_t nbytes)
void(* polyline)(GVJ_t *job, pointf *A, int n)
gvplugin_available_t * api[APIS]
void(* begin_label)(GVJ_t *job, label_type type)
int agerr(agerrlevel_t level, const char *fmt,...)
void(* begin_job)(GVJ_t *job)
gvplugin_available_t * gvplugin_load(GVC_t *gvc, api_t api, const char *type)
void gvrender_begin_label(GVJ_t *job, label_type type)
void gvrender_begin_node(GVJ_t *job, node_t *n)
void gvrender_end_nodes(GVJ_t *job)
void(* begin_edges)(GVJ_t *job)
void(* ellipse)(GVJ_t *job, pointf *A, int filled)
#define GVRENDER_DOES_TRANSFORM
void gvrender_end_layer(GVJ_t *job)
void(* resolve_color)(GVJ_t *job, gvcolor_t *color)
void(* textspan)(GVJ_t *job, pointf p, textspan_t *span)
gvplugin_active_device_t device
char * agget(void *obj, char *name)
void(* library_shape)(GVJ_t *job, char *name, pointf *A, int n, int filled)
void(* comment)(GVJ_t *job, char *comment)
gvplugin_active_render_t render
gvrender_features_t * features
void(* end_nodes)(GVJ_t *job)
void gvdevice_finalize(GVJ_t *job)
void(* begin_anchor)(GVJ_t *job, char *href, char *tooltip, char *target, char *id)
void gvrender_begin_anchor(GVJ_t *job, char *href, char *tooltip, char *target, char *id)
void gvrender_set_pencolor(GVJ_t *job, char *name)
void gvrender_begin_cluster(GVJ_t *job, graph_t *sg)
void(* begin_edge)(GVJ_t *job)
void(* end_graph)(GVJ_t *job)
void gvrender_set_style(GVJ_t *job, char **s)
usershape_t * gvusershape_find(char *name)
void gvrender_begin_page(GVJ_t *job)
void gvrender_begin_edges(GVJ_t *job)
void(* end_anchor)(GVJ_t *job)
void gvrender_begin_edge(GVJ_t *job, edge_t *e)
void gvrender_end_graph(GVJ_t *job)
void(* begin_nodes)(GVJ_t *job)
pointf gvrender_ptf(GVJ_t *job, pointf p)
void gvrender_set_gradient_vals(GVJ_t *job, char *stopcolor, int angle, float frac)
void gvrender_set_penwidth(GVJ_t *job, double penwidth)
int colorxlate(char *str, gvcolor_t *color, color_type_t target_type)
char * canontoken(char *str)
void gvrender_textspan(GVJ_t *job, pointf p, textspan_t *span)
void gvrender_end_edges(GVJ_t *job)
void(* end_job)(GVJ_t *job)
void(* end_edges)(GVJ_t *job)
pointf * gvrender_ptf_A(GVJ_t *job, pointf *af, pointf *AF, int n)
void(* begin_cluster)(GVJ_t *job)
void gvdevice_format(GVJ_t *job)
int strcasecmp(const char *s1, const char *s2)
void(* begin_node)(GVJ_t *job)
void(* end_edge)(GVJ_t *job)
void(* end_page)(GVJ_t *job)
void(* end_label)(GVJ_t *job)
void(* pf)(char *, void *)
void gvrender_ellipse(GVJ_t *job, pointf *AF, int n, int filled)
void(* end_cluster)(GVJ_t *job)
void gvrender_beziercurve(GVJ_t *job, pointf *AF, int n, int arrow_at_start, int arrow_at_end, boolean filled)
void gvrender_end_job(GVJ_t *job)
void(* end_node)(GVJ_t *job)
int gvdevice_initialize(GVJ_t *job)
int gvrender_select(GVJ_t *job, const char *lang)
void gvrender_begin_nodes(GVJ_t *job)
void gvrender_end_cluster(GVJ_t *job, graph_t *g)
void gvrender_end_anchor(GVJ_t *job)
gvplugin_installed_t * typeptr
void gvrender_end_node(GVJ_t *job)
gvdevice_engine_t * engine
point gvusershape_size_dpi(usershape_t *us, pointf dpi)
void(* polygon)(GVJ_t *job, pointf *A, int n, int filled)
void gvrender_begin_layer(GVJ_t *job)
gvdevice_features_t * features
gvrender_engine_t * engine
void gvrender_begin_graph(GVJ_t *job, graph_t *g)
void gvrender_polyline(GVJ_t *job, pointf *AF, int n)