From: erg Date: Tue, 28 Nov 2006 20:08:44 +0000 (+0000) Subject: Re-instantiate showbox functions. X-Git-Tag: LAST_LIBGRAPH~32^2~5809 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b10d939ffc5e4630562741c89243dbc6e018d1ef;p=graphviz Re-instantiate showbox functions. --- diff --git a/lib/common/emit.c b/lib/common/emit.c index 8f6d0982d..e159eb95e 100644 --- a/lib/common/emit.c +++ b/lib/common/emit.c @@ -2677,6 +2677,12 @@ int gvRenderJobs (GVC_t * gvc, graph_t * g) #endif if (! (job->flags & GVRENDER_X11_EVENTS)) { + /* Show_boxes is not defined, if at all, + * until splines are generated in dot + */ +#ifdef DEBUG + job->common->show_boxes = Show_boxes; +#endif emit_graph(job, g); /* FIXME? - this should be a special case of finalize() */ /* Flush is necessary because we may be writing to a pipe. */ diff --git a/lib/common/routespl.c b/lib/common/routespl.c index c5f2c062c..d294e7522 100644 --- a/lib/common/routespl.c +++ b/lib/common/routespl.c @@ -110,6 +110,7 @@ static void psprintspline(Ppolyline_t spl) Show_cnt = newcnt; Show_boxes[Show_cnt+1] = NULL; } + static void psprintline(Ppolyline_t pl) { char buf[BUFSIZ]; @@ -130,6 +131,7 @@ static void psprintline(Ppolyline_t pl) Show_cnt = newcnt; Show_boxes[Show_cnt+1] = NULL; } + static void psprintpoly(Ppoly_t p) { char buf[BUFSIZ]; @@ -157,6 +159,7 @@ static void psprintpoly(Ppoly_t p) Show_cnt = newcnt; Show_boxes[Show_cnt+1] = NULL; } + static void psprintboxes(int boxn, box* boxes) { char buf[BUFSIZ]; @@ -185,6 +188,7 @@ static void psprintboxes(int boxn, box* boxes) Show_cnt = newcnt; Show_boxes[Show_cnt+1] = NULL; } + static void psprintinit (int begin) { int newcnt = Show_cnt + 1; @@ -206,7 +210,7 @@ static int debugleveln(edge_t* realedge, int i) ND_showboxes(realedge->head) == i || ND_showboxes(realedge->tail) == i); } -#endif +#endif /* DEBUG */ #ifdef OBSOLETE static point mkpt(int x, int y) @@ -243,6 +247,7 @@ routesplinesinit() abort(); } maxpn = PINC; +#ifdef DEBUG if (Show_boxes) { int i; for (i = 0; Show_boxes[i]; i++) @@ -251,6 +256,7 @@ routesplinesinit() Show_boxes = NULL; Show_cnt = 0; } +#endif nedges = 0; nboxes = 0; if (Verbose) diff --git a/lib/common/splines.c b/lib/common/splines.c index 9fd352488..def952d33 100644 --- a/lib/common/splines.c +++ b/lib/common/splines.c @@ -21,6 +21,7 @@ #include "render.h" +#ifdef DEBUG static int debugleveln(edge_t* e, int i) { return (GD_showboxes(e->head->graph) == i || @@ -49,6 +50,7 @@ static void showPoints(point ps[], int pn) Show_cnt = newcnt; Show_boxes[Show_cnt+1] = NULL; } +#endif /* arrow_clip: * Clip arrow to node boundary. @@ -1013,8 +1015,10 @@ selfBottom (edge_t* edges[], int ind, int cnt, int sizex, int stepy, splineInfo* dx += width - stepx; } clip_and_install(e, e, points, pointn, sinfo); +#ifdef DEBUG if (debugleveln(e,1)) showPoints (points, pointn); +#endif } } @@ -1080,8 +1084,10 @@ selfTop (edge_t* edges[], int ind, int cnt, int sizex, int stepy, dx += width - stepx; } clip_and_install(e, e, points, pointn, sinfo); +#ifdef DEBUG if (debugleveln(e,1)) showPoints (points, pointn); +#endif } } @@ -1145,8 +1151,10 @@ selfRight (edge_t* edges[], int ind, int cnt, int stepx, int sizey, dy += height - stepy; } clip_and_install(e, e, points, pointn, sinfo); +#ifdef DEBUG if (debugleveln(e,1)) showPoints (points, pointn); +#endif } return; } @@ -1211,8 +1219,10 @@ selfLeft (edge_t* edges[], int ind, int cnt, int stepx, int sizey, dy += height - stepy; } clip_and_install(e, e, points, pointn, sinfo); +#ifdef DEBUG if (debugleveln(e,1)) showPoints (points, pointn); +#endif } } diff --git a/lib/gvc/gvcontext.c b/lib/gvc/gvcontext.c index 56aef5ee6..b4f38da0b 100644 --- a/lib/gvc/gvcontext.c +++ b/lib/gvc/gvcontext.c @@ -33,9 +33,6 @@ #include "gvcint.h" #include "gvcproc.h" -/* for Show_boxes */ -#include "globals.h" - /* from common/utils.c */ extern void *zmalloc(size_t); @@ -53,7 +50,6 @@ GVC_t *gvNEWcontext(char **info, char *user) gvc->common.info = info; gvc->common.user = user; gvc->common.errorfn = agerrorf; - gvc->common.show_boxes = Show_boxes; } return gvc; } diff --git a/plugin/core/gvrender_core_ps.c b/plugin/core/gvrender_core_ps.c index 81141736e..ebbbf377a 100644 --- a/plugin/core/gvrender_core_ps.c +++ b/plugin/core/gvrender_core_ps.c @@ -92,6 +92,12 @@ static void psgen_begin_graph(GVJ_t * job) cat_preamble(job, job->common->lib); /* include epsf */ epsf_define(job->output_file); + if (job->common->show_boxes) { + char* args[2]; + args[0] = job->common->show_boxes[0]; + args[1] = NULL; + cat_libfile(job->output_file, NULL, args); + } } isLatin1 = (GD_charset(obj->u.g) == CHAR_LATIN1); /* We always setup Latin1. The charset info is always output, @@ -152,8 +158,10 @@ static void psgen_begin_page(GVJ_t * job) static void psgen_end_page(GVJ_t * job) { -// if (job->common->show_boxes) -// cat_libfile(job->output_file, NULL, job->common->show_boxes + 1); + if (job->common->show_boxes) { + core_fputs(job, "0 0 0 edgecolor\n"); + cat_libfile(job->output_file, NULL, job->common->show_boxes + 1); + } /* the showpage is really a no-op, but at least one PS processor * out there needs to see this literal token. endpage does the real work. */