42#define LOCALNAMEPREFIX '%'
56static const char none[] =
"none";
57static const char black[] =
"black";
68 if (
A[0].x <=
A[n-1].x) {
70 for (
size_t i = 0; i < n; i++) {
82 for (
size_t i = n - 1; i !=
SIZE_MAX; i--) {
106 gvprintf(job,
"\" class=\"%s", kind);
119 switch (
color.type) {
127 if (
color.u.rgba[3] == 0)
147 switch (
color.type) {
187 gvprintf(job,
"\" fill-opacity=\"%f",
192 gvputs(job,
"\" stroke=\"");
195 const double GVPRINT_DOUBLE_THRESHOLD = 0.005;
197 gvputs(job,
"\" stroke-width=\"");
207 gvprintf(job,
"\" stroke-opacity=\"%f",
225 "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\n");
226 if ((
s =
agget(job->
gvc->
g,
"stylesheet")) &&
s[0]) {
227 gvputs(job,
"<?xml-stylesheet href=\"");
229 gvputs(job,
"\" type=\"text/css\"?>\n");
231 gvputs(job,
"<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\"\n"
232 " \"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\">\n");
234 gvputs(job,
"<!-- Generated by ");
256 gvprintf(job,
"<svg width=\"%dpt\" height=\"%dpt\"\n",
258 gvprintf(job,
" viewBox=\"%.2f %.2f %.2f %.2f\"",
270 gvputs(job,
" xmlns=\"http://www.w3.org/2000/svg\""
272 " xmlns:xlink=\"http://www.w3.org/1999/xlink\"");
310 gvputs(job,
" transform=\"scale(");
322 gvputs(job,
"</title>\n");
339 gvputs(job,
"</title>\n");
360 gvputs(job,
"</title>\n");
380 gvputs(job,
"</title>\n");
401 if (href && href[0]) {
402 gvputs(job,
" xlink:href=\"");
407 if (tooltip && tooltip[0]) {
408 gvputs(job,
" xlink:title=\"");
413 if (target && target[0]) {
414 gvputs(job,
" target=\"");
435 switch (span->
just) {
437 gvputs(job,
" text-anchor=\"start\"");
440 gvputs(job,
" text-anchor=\"end\"");
444 gvputs(job,
" text-anchor=\"middle\"");
477 gvprintf(job,
" font-family=\"%s", family);
482 gvprintf(job,
" font-weight=\"%s\"", weight);
484 gvprintf(job,
" font-stretch=\"%s\"", stretch);
486 gvprintf(job,
" font-style=\"%s\"", style);
491 gvputs(job,
" font-weight=\"bold\"");
493 gvputs(job,
" font-style=\"italic\"");
496 gvputs(job,
" text-decoration=\"");
502 gvprintf(job,
"%soverline", (comma?
",":
""));
506 gvprintf(job,
"%sline-through", (comma?
",":
""));
510 gvputs(job,
" baseline-shift=\"super\"");
512 gvputs(job,
" baseline-shift=\"sub\"");
522 gvprintf(job,
" fill=\"#%02x%02x%02x\"",
533 gvputs(job,
"<textPath xlink:href=\"#");
535 gvputs(job,
"_p\" startOffset=\"50%\"><tspan x=\"0\" dy=\"");
542 gvputs(job,
"</tspan></textPath>");
548 if (fabs(
offset - 0.0) < 0.0005)
549 gvputs(job,
"<stop offset=\"0\" style=\"stop-color:");
550 else if (fabs(
offset - 1.0) < 0.0005)
551 gvputs(job,
"<stop offset=\"1\" style=\"stop-color:");
553 gvprintf(job,
"<stop offset=\"%.03f\" style=\"stop-color:",
offset);
555 gvputs(job,
";stop-opacity:");
575 G[0].x =
G[0].y =
G[1].x =
G[1].y = 0.;
578 gvputs(job,
"<defs>\n<linearGradient id=\"");
583 gvprintf(job,
"l_%d\" gradientUnits=\"userSpaceOnUse\" ",
id);
597 gvputs(job,
"</linearGradient>\n</defs>\n");
615 ifx = round(50 * (1 + cos(angle)));
616 ify = round(50 * (1 - sin(angle)));
618 gvputs(job,
"<defs>\n<radialGradient id=\"");
623 gvprintf(job,
"r_%d\" cx=\"50%%\" cy=\"50%%\" r=\"75%%\" "
624 "fx=\"%.0f%%\" fy=\"%.0f%%\">\n",
630 gvputs(job,
"</radialGradient>\n</defs>\n");
688 gvputs(job,
" points=\"");
689 for (
size_t i = 0; i < n; i++) {
705 gvputs(job,
" points=\"");
706 for (
size_t i = 0; i < n; i++) {
720 "aliceblue",
"antiquewhite",
"aqua",
"aquamarine",
"azure",
721 "beige",
"bisque",
"black",
"blanchedalmond",
"blue",
722 "blueviolet",
"brown",
"burlywood",
723 "cadetblue",
"chartreuse",
"chocolate",
"coral",
724 "cornflowerblue",
"cornsilk",
"crimson",
"cyan",
725 "darkblue",
"darkcyan",
"darkgoldenrod",
"darkgray",
726 "darkgreen",
"darkgrey",
"darkkhaki",
"darkmagenta",
727 "darkolivegreen",
"darkorange",
"darkorchid",
"darkred",
728 "darksalmon",
"darkseagreen",
"darkslateblue",
"darkslategray",
729 "darkslategrey",
"darkturquoise",
"darkviolet",
"deeppink",
730 "deepskyblue",
"dimgray",
"dimgrey",
"dodgerblue",
731 "firebrick",
"floralwhite",
"forestgreen",
"fuchsia",
732 "gainsboro",
"ghostwhite",
"gold",
"goldenrod",
"gray",
733 "green",
"greenyellow",
"grey",
734 "honeydew",
"hotpink",
"indianred",
735 "indigo",
"ivory",
"khaki",
736 "lavender",
"lavenderblush",
"lawngreen",
"lemonchiffon",
737 "lightblue",
"lightcoral",
"lightcyan",
"lightgoldenrodyellow",
738 "lightgray",
"lightgreen",
"lightgrey",
"lightpink",
739 "lightsalmon",
"lightseagreen",
"lightskyblue",
740 "lightslategray",
"lightslategrey",
"lightsteelblue",
741 "lightyellow",
"lime",
"limegreen",
"linen",
742 "magenta",
"maroon",
"mediumaquamarine",
"mediumblue",
743 "mediumorchid",
"mediumpurple",
"mediumseagreen",
744 "mediumslateblue",
"mediumspringgreen",
"mediumturquoise",
745 "mediumvioletred",
"midnightblue",
"mintcream",
746 "mistyrose",
"moccasin",
747 "navajowhite",
"navy",
"oldlace",
748 "olive",
"olivedrab",
"orange",
"orangered",
"orchid",
749 "palegoldenrod",
"palegreen",
"paleturquoise",
750 "palevioletred",
"papayawhip",
"peachpuff",
"peru",
"pink",
751 "plum",
"powderblue",
"purple",
752 "red",
"rosybrown",
"royalblue",
753 "saddlebrown",
"salmon",
"sandybrown",
"seagreen",
"seashell",
754 "sienna",
"silver",
"skyblue",
"slateblue",
"slategray",
755 "slategrey",
"snow",
"springgreen",
"steelblue",
756 "tan",
"teal",
"thistle",
"tomato",
"transparent",
"turquoise",
758 "wheat",
"white",
"whitesmoke",
759 "yellow",
"yellowgreen"
void get_gradient_points(pointf *A, pointf *G, size_t n, double angle, int flags)
char * agget(void *obj, char *name)
char * agnameof(void *)
returns a string descriptor for the object.
swig_ptr_object_handlers offset
#define GVDEVICE_COMPRESSED_FORMAT
#define GVRENDER_DOES_TOOLTIPS
#define GVRENDER_DOES_LABELS
#define GVDEVICE_DOES_LAYERS
#define GVDEVICE_DOES_TRUECOLOR
#define GVDEVICE_BINARY_FORMAT
#define GVRENDER_DOES_MAPS
#define GVRENDER_DOES_TARGETS
#define GVRENDER_DOES_TRANSFORM
#define GVRENDER_Y_GOES_DOWN
static void color(Agraph_t *g)
size_t gvwrite(GVJ_t *job, const char *s, size_t len)
int gvputc(GVJ_t *job, int c)
int gvputs_xml(GVJ_t *job, const char *s)
int gvputs(GVJ_t *job, const char *s)
void gvprintf(GVJ_t *job, const char *format,...)
void gvprintdouble(GVJ_t *job, double num)
gvdevice_features_t device_features_svgz
static const char transparent[]
static void svg_textspan(GVJ_t *job, pointf p, textspan_t *span)
static int svg_gradstyle(GVJ_t *job, pointf *A, size_t n)
static void svg_end_page(GVJ_t *job)
static void svg_begin_node(GVJ_t *job)
static void svg_print_paint(GVJ_t *job, gvcolor_t color)
static void svg_grstyle(GVJ_t *job, int filled, int gid)
static bool emit_standalone_headers(const GVJ_t *job)
gvrender_features_t render_features_svg
static const char sdasharray[]
static void svg_print_gradient_color(GVJ_t *job, gvcolor_t color)
gvdevice_features_t device_features_svg
static void svg_end_cluster(GVJ_t *job)
static void svg_end_node(GVJ_t *job)
static void svg_begin_cluster(GVJ_t *job)
static void svg_polyline(GVJ_t *job, pointf *A, size_t n)
static void svg_bezier(GVJ_t *job, pointf *A, size_t n, int filled)
static void svg_comment(GVJ_t *job, char *str)
static void svg_end_edge(GVJ_t *job)
gvrender_engine_t svg_engine
gvplugin_installed_t gvdevice_svg_types[]
static char * svg_knowncolors[]
static void svg_begin_page(GVJ_t *job)
static void svg_bzptarray(GVJ_t *job, pointf *A, size_t n)
static const char sdotarray[]
static void svg_end_anchor(GVJ_t *job)
static void svg_polygon(GVJ_t *job, pointf *A, size_t n, int filled)
static void svg_end_layer(GVJ_t *job)
static void svg_print_id_class(GVJ_t *job, char *id, char *idx, char *kind, void *obj)
static void svg_begin_layer(GVJ_t *job, char *layername, int layerNum, int numLayers)
static void svg_begin_anchor(GVJ_t *job, char *href, char *tooltip, char *target, char *id)
static void svg_begin_edge(GVJ_t *job)
static void svg_begin_graph(GVJ_t *job)
static void svg_ellipse(GVJ_t *job, pointf *A, int filled)
static void svg_begin_job(GVJ_t *job)
gvplugin_installed_t gvrender_svg_types[]
static const char black[]
static void svg_end_graph(GVJ_t *job)
static int svg_rgradstyle(GVJ_t *job)
static void svg_print_stop(GVJ_t *job, double offset, gvcolor_t color)
textitem scanner parser str
char * strdup_and_subst_obj(char *str, void *obj)
platform abstraction for case-insensitive string functions
gvplugin_active_render_t render
unsigned labeledgealigned
PostscriptAlias * postscript_alias
double yoffset_centerline
int xml_escape(const char *s, xml_flags_t flags, int(*cb)(void *state, const char *s), void *state)