30 static char *tkgen_string(
char *
s)
42 if (color.
u.
rgba[3] == 0)
53 static void tkgen_print_tags(
GVJ_t *job)
92 ObjType =
"graph label";
109 gvprintf(job,
" -tags {%d%s%p}", ObjFlag, ObjType, ObjId);
112 static void tkgen_canvas(
GVJ_t * job)
120 static void tkgen_comment(
GVJ_t * job,
char *
str)
123 gvputs(job, tkgen_string(str));
127 static void tkgen_begin_job(
GVJ_t * job)
129 gvputs(job,
"# Generated by ");
138 static int first_periphery;
140 static void tkgen_begin_graph(
GVJ_t * job)
154 static void tkgen_begin_node(
GVJ_t * job)
159 static void tkgen_begin_edge(
GVJ_t * job)
161 first_periphery = -1;
178 gvputs(job,
" create text ");
185 tkgen_print_color(job, obj->
pencolor);
199 switch (span->
just) {
201 gvputs(job,
" -anchor w");
204 gvputs(job,
" -anchor e");
210 tkgen_print_tags(job);
216 static void tkgen_ellipse(
GVJ_t * job,
pointf * A,
int filled)
223 r.
x = A[1].
x - A[0].
x;
224 r.
y = A[1].
y - A[0].
y;
228 gvputs(job,
" create oval ");
233 else if (first_periphery)
240 if (first_periphery == 1)
244 gvputs(job,
" -outline ");
245 tkgen_print_color(job, obj->
pencolor);
250 tkgen_print_tags(job);
256 tkgen_bezier(
GVJ_t * job,
pointf * A,
int n,
int arrow_at_start,
257 int arrow_at_end,
int filled)
263 gvputs(job,
" create line ");
266 tkgen_print_color(job, obj->
pencolor);
273 gvputs(job,
" -smooth bezier ");
274 tkgen_print_tags(job);
279 static void tkgen_polygon(
GVJ_t * job,
pointf * A,
int n,
int filled)
285 gvputs(job,
" create polygon ");
290 else if (first_periphery)
297 if (first_periphery == 1)
301 gvputs(job,
" -outline ");
302 tkgen_print_color(job, obj->
pencolor);
307 tkgen_print_tags(job);
312 static void tkgen_polyline(
GVJ_t * job,
pointf * A,
int n)
318 gvputs(job,
" create line ");
321 tkgen_print_color(job, obj->
pencolor);
326 tkgen_print_tags(job);
void gvprintpointflist(GVJ_t *job, pointf *p, int n)
#define GVRENDER_Y_GOES_DOWN
int gvputs(GVJ_t *job, const char *s)
gvplugin_installed_t gvdevice_tk_types[]
CGRAPH_API char * agnameof(void *)
gvplugin_installed_t gvrender_tk_types[]
void gvprintpointf(GVJ_t *job, pointf p)
PostscriptAlias * postscript_alias
#define GVRENDER_NO_WHITE_BG
void gvprintdouble(GVJ_t *job, double num)
gvrender_engine_t tkgen_engine
gvrender_features_t render_features_tk
gvdevice_features_t device_features_tk
void gvprintf(GVJ_t *job, const char *format,...)