53 plugin =
gvc->
api[API_device];
67 plugin =
gvc->
api[API_render];
163 for (
size_t i = 0; i < n; i++) {
164 t = -(af[i].
y + translation.
y) *
scale.
x;
165 AF[i].
y = (af[i].
x + translation.
x) *
scale.
y;
169 for (
size_t i = 0; i < n; i++) {
170 AF[i].
x = (af[i].
x + translation.
x) *
scale.
x;
171 AF[i].
y = (af[i].
y + translation.
y) *
scale.
y;
179 return strcasecmp(
s1, *(
char *
const *)s2);
193 color->u.string = name;
204 agxbprint(&missedcolor,
"color %s", name);
206 agwarningf(
"%s is not a known color.\n", name);
209 agerrorf(
"error in colorxlate()\n");
374 char *target,
char *
id)
419 if (span->
str && span->
str[0]
439 if ((cp = strchr(name,
':')))
456 if ((cp = strchr(name,
':')))
490 while ((p = line = *
s++)) {
491 if (
streq(line,
"solid"))
493 else if (
streq(line,
"dashed"))
495 else if (
streq(line,
"dotted"))
497 else if (
streq(line,
"invis") ||
streq(line,
"invisible"))
499 else if (
streq(line,
"bold"))
501 else if (
streq(line,
"setlinewidth")) {
506 }
else if (
streq(line,
"filled"))
508 else if (
streq(line,
"unfilled"))
510 else if (
streq(line,
"tapered"));
513 "gvrender_set_style: unsupported style %s - ignoring\n",
532 gvre->
ellipse(job, af, filled);
551 gvre->
polygon(job, af, n, filled);
555 gvre->
polygon(job, AF, n, filled);
630 if (!strcasecmp(
s,
"width"))
632 if (!strcasecmp(
s,
"height"))
634 if (!strcasecmp(
s,
"both"))
645 if (!strcasecmp(
s,
"tl"))
647 if (!strcasecmp(
s,
"tc"))
649 if (!strcasecmp(
s,
"tr"))
651 if (!strcasecmp(
s,
"ml"))
653 if (!strcasecmp(
s,
"mc"))
655 if (!strcasecmp(
s,
"mr"))
657 if (!strcasecmp(
s,
"bl"))
659 if (!strcasecmp(
s,
"bc"))
661 if (!strcasecmp(
s,
"br"))
671 bool filled,
char *imagescale,
char *imagepos) {
674 double iw, ih, pw, ph;
675 double scalex, scaley;
693 if ((isz.
x <= 0) && (isz.
y <= 0))
698 for (
size_t i = 1; i < n; i++) {
713 if (scalex < scaley) {
752 b.
LL.
x += (pw - iw) / 2.0;
753 b.
UR.
x -= (pw - iw) / 2.0;
771 b.
LL.
y += (ph - ih) / 2.0;
772 b.
UR.
y -= (ph - ih) / 2.0;
static void agxbfree(agxbuf *xb)
free any malloced resources
static int agxbprint(agxbuf *xb, const char *fmt,...)
Printf-style output to an agxbuf.
static WUR char * agxbuse(agxbuf *xb)
Memory allocation wrappers that exit on failure.
static void * gv_calloc(size_t nmemb, size_t size)
abstract graph C library, Cgraph API
void colorxlate(char *str, agxbuf *buf)
bool emit_once(char *str)
geometric types and macros (e.g. points and boxes)
geometric functions (e.g. on points and boxes)
static pointf mid_pointf(pointf p, pointf q)
static pointf scale(double c, pointf p)
void agwarningf(const char *fmt,...)
void agerrorf(const char *fmt,...)
#define GVRENDER_DOES_TRANSFORM
static void color(Agraph_t *g)
void gvdevice_finalize(GVJ_t *job)
usershape_t * gvusershape_find(const char *name)
point gvusershape_size_dpi(usershape_t *us, pointf dpi)
int gvdevice_initialize(GVJ_t *job)
gvplugin_available_t * gvplugin_load(GVC_t *gvc, api_t api, const char *type, FILE *debug)
void gvdevice_format(GVJ_t *job)
void gvloadimage(GVJ_t *job, usershape_t *us, boxf b, bool filled, const char *target)
void gvrender_end_nodes(GVJ_t *job)
void gvrender_begin_nodes(GVJ_t *job)
void gvrender_end_job(GVJ_t *job)
void gvrender_beziercurve(GVJ_t *job, pointf *af, size_t n, int filled)
void gvrender_end_label(GVJ_t *job)
void gvrender_usershape(GVJ_t *job, char *name, pointf *a, size_t n, bool filled, char *imagescale, char *imagepos)
void gvrender_comment(GVJ_t *job, char *str)
void gvrender_end_graph(GVJ_t *job)
void gvrender_set_style(GVJ_t *job, char **s)
void gvrender_set_fillcolor(GVJ_t *job, char *name)
void gvrender_begin_edges(GVJ_t *job)
pointf * gvrender_ptf_A(GVJ_t *job, pointf *af, pointf *AF, size_t n)
void gvrender_polygon(GVJ_t *job, pointf *af, size_t n, int filled)
static void gvrender_resolve_color(gvrender_features_t *features, char *name, gvcolor_t *color)
void gvrender_end_edges(GVJ_t *job)
void gvrender_begin_graph(GVJ_t *job)
static int gvrender_comparestr(const void *s1, const void *s2)
bool mapbool(const char *s)
void gvrender_polyline(GVJ_t *job, pointf *af, size_t n)
pointf gvrender_ptf(GVJ_t *job, pointf p)
void gvrender_end_page(GVJ_t *job)
int gvrender_select(GVJ_t *job, const char *str)
static imagescale_t get_imagescale(char *s)
void gvrender_end_layer(GVJ_t *job)
void gvrender_begin_cluster(GVJ_t *job)
void gvrender_ellipse(GVJ_t *job, pointf *pf, int filled)
void gvrender_set_gradient_vals(GVJ_t *job, char *stopcolor, int angle, double frac)
void gvrender_end_edge(GVJ_t *job)
void gvrender_begin_anchor(GVJ_t *job, char *href, char *tooltip, char *target, char *id)
void gvrender_end_anchor(GVJ_t *job)
void gvrender_begin_layer(GVJ_t *job)
void gvrender_begin_page(GVJ_t *job)
static imagepos_t get_imagepos(char *s)
void gvrender_begin_edge(GVJ_t *job)
void gvrender_textspan(GVJ_t *job, pointf p, textspan_t *span)
void gvrender_begin_node(GVJ_t *job)
void gvrender_box(GVJ_t *job, boxf B, int filled)
int gvrender_begin_job(GVJ_t *job)
void gvrender_begin_label(GVJ_t *job, label_type type)
void gvrender_end_cluster(GVJ_t *job)
void gvrender_set_penwidth(GVJ_t *job, double penwidth)
int gvrender_features(GVJ_t *job)
void gvrender_end_node(GVJ_t *job)
void gvrender_set_pencolor(GVJ_t *job, char *name)
textitem scanner parser str
NEATOPROCS_API void s1(graph_t *, node_t *)
shape_desc * find_user_shape(const char *)
platform abstraction for case-insensitive string functions
static bool streq(const char *a, const char *b)
are a and b equal?
gvplugin_available_t * api[APIS]
gvplugin_active_device_t device
gvplugin_active_render_t render
gvdevice_features_t * features
gvdevice_engine_t * engine
gvrender_engine_t * engine
gvrender_features_t * features
gvplugin_installed_t * typeptr
void(* end_label)(GVJ_t *job)
void(* begin_layer)(GVJ_t *job, char *layername, int layerNum, int numLayers)
void(* begin_anchor)(GVJ_t *job, char *href, char *tooltip, char *target, char *id)
void(* begin_cluster)(GVJ_t *job)
void(* begin_page)(GVJ_t *job)
void(* resolve_color)(GVJ_t *job, gvcolor_t *color)
void(* library_shape)(GVJ_t *job, char *name, pointf *A, size_t n, int filled)
void(* end_job)(GVJ_t *job)
void(* begin_node)(GVJ_t *job)
void(* ellipse)(GVJ_t *job, pointf *A, int filled)
void(* end_page)(GVJ_t *job)
void(* polygon)(GVJ_t *job, pointf *A, size_t n, int filled)
void(* textspan)(GVJ_t *job, pointf p, textspan_t *span)
void(* end_edge)(GVJ_t *job)
void(* end_node)(GVJ_t *job)
void(* end_anchor)(GVJ_t *job)
void(* polyline)(GVJ_t *job, pointf *A, size_t n)
void(* begin_edge)(GVJ_t *job)
void(* begin_nodes)(GVJ_t *job)
void(* end_graph)(GVJ_t *job)
void(* end_layer)(GVJ_t *job)
void(* begin_job)(GVJ_t *job)
void(* begin_edges)(GVJ_t *job)
void(* end_edges)(GVJ_t *job)
void(* end_cluster)(GVJ_t *job)
void(* beziercurve)(GVJ_t *job, pointf *A, size_t n, int)
void(* begin_graph)(GVJ_t *job)
void(* begin_label)(GVJ_t *job, label_type type)
void(* end_nodes)(GVJ_t *job)
void(* comment)(GVJ_t *job, char *comment)
int(* pf)(void *, char *,...)