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 strcmp(
s1, *(
char *
const *) s2);
194 color->u.string = name;
206 agxbprint(&missedcolor,
"color %s", name);
208 agwarningf(
"%s is not a known color.\n", name);
377 char *target,
char *
id)
422 if (span->
str && span->
str[0]
442 if ((cp = strchr(name,
':')))
459 if ((cp = strchr(name,
':')))
493 while ((p = line = *
s++)) {
494 if (
streq(line,
"solid"))
496 else if (
streq(line,
"dashed"))
498 else if (
streq(line,
"dotted"))
500 else if (
streq(line,
"invis") ||
streq(line,
"invisible"))
502 else if (
streq(line,
"bold"))
504 else if (
streq(line,
"setlinewidth")) {
509 }
else if (
streq(line,
"filled"))
511 else if (
streq(line,
"unfilled"))
513 else if (
streq(line,
"tapered"));
516 "gvrender_set_style: unsupported style %s - ignoring\n",
535 gvre->
ellipse(job, af, filled);
554 gvre->
polygon(job, af, n, filled);
558 gvre->
polygon(job, AF, n, filled);
633 if (!strcasecmp(
s,
"width"))
635 if (!strcasecmp(
s,
"height"))
637 if (!strcasecmp(
s,
"both"))
648 if (!strcasecmp(
s,
"tl"))
650 if (!strcasecmp(
s,
"tc"))
652 if (!strcasecmp(
s,
"tr"))
654 if (!strcasecmp(
s,
"ml"))
656 if (!strcasecmp(
s,
"mc"))
658 if (!strcasecmp(
s,
"mr"))
660 if (!strcasecmp(
s,
"bl"))
662 if (!strcasecmp(
s,
"bc"))
664 if (!strcasecmp(
s,
"br"))
674 bool filled,
char *imagescale,
char *imagepos) {
677 double iw, ih, pw, ph;
678 double scalex, scaley;
696 if ((isz.
x <= 0) && (isz.
y <= 0))
701 for (
size_t i = 1; i < n; i++) {
716 if (scalex < scaley) {
755 b.
LL.
x += (pw - iw) / 2.0;
756 b.
UR.
x -= (pw - iw) / 2.0;
774 b.
LL.
y += (ph - ih) / 2.0;
775 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 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
COLORPROCS_API char * canontoken(char *str)
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)
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)
static tok_t tok(const char *input, const char *separators)
begin tokenization of a new string
int(* pf)(void *, char *,...)