]> granicus.if.org Git - graphviz/commitdiff
Rename gvrender_job_t to GVJ_t
authorellson <devnull@localhost>
Thu, 28 Apr 2005 03:42:05 +0000 (03:42 +0000)
committerellson <devnull@localhost>
Thu, 28 Apr 2005 03:42:05 +0000 (03:42 +0000)
Expose GVJ_t in types.h

Remove one level of indirection in each gvrender function
by passing GVJ_t instead of GVC_t

Now emit_graph is per job (i.e. GVJ_t)

"dot hello.dot -Tx11 -Tx11" now works to produce two (or more) independent
X11 windows on the same graph with independent events (but shared event loop)

19 files changed:
lib/common/arrows.c
lib/common/emit.c
lib/common/htmltable.c
lib/common/htmltable.h
lib/common/labels.c
lib/common/output.c
lib/common/renderprocs.h
lib/common/shapes.c
lib/common/types.h
lib/common/xdgen.c
lib/gvc/gvc.h
lib/gvc/gvcint.h
lib/gvc/gvevent.c
lib/gvc/gvjobs.c
lib/gvc/gvplugin_render.h
lib/gvc/gvrender.c
tclpkg/gv/gv.cpp
tclpkg/tcldot/tcldot.c
tclpkg/tcldot/tkgen.c

index e8a539543ee421afff5605c65e94a50a568a809b..f1c453274106b78f3a6745a109bab514068857f0 100644 (file)
@@ -104,16 +104,16 @@ static arrowname_t Arrownames[] = {
 typedef struct arrowtype_t {
     int type;
     double lenfact;            /* ratio of length of this arrow type to standards arrow */
-    void (*gen) (GVC_t * gvc, pointf p, pointf u, int flag);   /* generator function for type */
+    void (*gen) (GVJ_t * job, pointf p, pointf u, int flag);   /* generator function for type */
 } arrowtype_t;
 
 /* forward declaration of functions used in Arrowtypes[] */
-static void arrow_type_normal(GVC_t * gvc, pointf p, pointf u, int flag);
-static void arrow_type_crow(GVC_t * gvc, pointf p, pointf u, int flag);
-static void arrow_type_tee(GVC_t * gvc, pointf p, pointf u, int flag);
-static void arrow_type_box(GVC_t * gvc, pointf p, pointf u, int flag);
-static void arrow_type_diamond(GVC_t * gvc, pointf p, pointf u, int flag);
-static void arrow_type_dot(GVC_t * gvc, pointf p, pointf u, int flag);
+static void arrow_type_normal(GVJ_t * job, pointf p, pointf u, int flag);
+static void arrow_type_crow(GVJ_t * job, pointf p, pointf u, int flag);
+static void arrow_type_tee(GVJ_t * job, pointf p, pointf u, int flag);
+static void arrow_type_box(GVJ_t * job, pointf p, pointf u, int flag);
+static void arrow_type_diamond(GVJ_t * job, pointf p, pointf u, int flag);
+static void arrow_type_dot(GVJ_t * job, pointf p, pointf u, int flag);
 
 static arrowtype_t Arrowtypes[] = {
     {ARR_TYPE_NORM, 1.0, arrow_type_normal},
@@ -295,37 +295,37 @@ int arrowStartClip(edge_t* e, point * ps, int startp,
 }
 
 /* FIXME - codegens should accept floats directly */
-static void arrow_codegen_polygon(GVC_t * gvc, pointf p[], int np,
+static void arrow_codegen_polygon(GVJ_t * job, pointf p[], int np,
                                  int fill)
 {
     point P[16];               /* ugly - but this should be enough for arrows */
     int i;
     for (i = 0; i < np; i++)
        PF2P(p[i], P[i]);
-    gvrender_polygon(gvc, P, np, fill);
+    gvrender_polygon(job, P, np, fill);
 }
 
 /* FIXME - codegens should accept floats directly */
-static void arrow_codegen_polyline(GVC_t * gvc, pointf p[], int np)
+static void arrow_codegen_polyline(GVJ_t * job, pointf p[], int np)
 {
     point P[16];               /* ugly - but this should be enough for arrows */
     int i;
     for (i = 0; i < np; i++)
        PF2P(p[i], P[i]);
-    gvrender_polyline(gvc, P, np);
+    gvrender_polyline(job, P, np);
 }
 
 /* FIXME - codegens should accept floats directly */
-static void arrow_codegen_ellipse(GVC_t * gvc, pointf p, pointf r,
+static void arrow_codegen_ellipse(GVJ_t * job, pointf p, pointf r,
                                  int fill)
 {
     point P, R;
     PF2P(p, P);
     PF2P(r, R);
-    gvrender_ellipse(gvc, P, R.x, R.y, fill);
+    gvrender_ellipse(job, P, R.x, R.y, fill);
 }
 
-static void arrow_type_normal(GVC_t * gvc, pointf p, pointf u, int flag)
+static void arrow_type_normal(GVJ_t * job, pointf p, pointf u, int flag)
 {
     pointf q, v, a[5];
 
@@ -349,14 +349,14 @@ static void arrow_type_normal(GVC_t * gvc, pointf p, pointf u, int flag)
        a[3].y = q.y + v.y;
     }
     if (flag & ARR_MOD_LEFT)
-       arrow_codegen_polygon(gvc, a, 3, !(flag & ARR_MOD_OPEN));
+       arrow_codegen_polygon(job, a, 3, !(flag & ARR_MOD_OPEN));
     else if (flag & ARR_MOD_RIGHT)
-       arrow_codegen_polygon(gvc, &a[2], 3, !(flag & ARR_MOD_OPEN));
+       arrow_codegen_polygon(job, &a[2], 3, !(flag & ARR_MOD_OPEN));
     else
-       arrow_codegen_polygon(gvc, &a[1], 3, !(flag & ARR_MOD_OPEN));
+       arrow_codegen_polygon(job, &a[1], 3, !(flag & ARR_MOD_OPEN));
 }
 
-static void arrow_type_crow(GVC_t * gvc, pointf p, pointf u, int flag)
+static void arrow_type_crow(GVJ_t * job, pointf p, pointf u, int flag)
 {
     pointf m, n, q, v, a[7];
 
@@ -386,14 +386,14 @@ static void arrow_type_crow(GVC_t * gvc, pointf p, pointf u, int flag)
        a[5].y = p.y + v.y;
     }
     if (flag & ARR_MOD_LEFT)
-       arrow_codegen_polygon(gvc, a, 5, 1);
+       arrow_codegen_polygon(job, a, 5, 1);
     else if (flag & ARR_MOD_RIGHT)
-       arrow_codegen_polygon(gvc, &a[2], 5, 1);
+       arrow_codegen_polygon(job, &a[2], 5, 1);
     else
-       arrow_codegen_polygon(gvc, a, 7, 1);
+       arrow_codegen_polygon(job, a, 7, 1);
 }
 
-static void arrow_type_tee(GVC_t * gvc, pointf p, pointf u, int flag)
+static void arrow_type_tee(GVJ_t * job, pointf p, pointf u, int flag)
 {
     pointf m, n, q, v, a[4];
 
@@ -420,13 +420,13 @@ static void arrow_type_tee(GVC_t * gvc, pointf p, pointf u, int flag)
        a[1] = m;
        a[2] = n;
     }
-    arrow_codegen_polygon(gvc, a, 4, 1);
+    arrow_codegen_polygon(job, a, 4, 1);
     a[0] = p;
     a[1] = q;
-    arrow_codegen_polyline(gvc, a, 2);
+    arrow_codegen_polyline(job, a, 2);
 }
 
-static void arrow_type_box(GVC_t * gvc, pointf p, pointf u, int flag)
+static void arrow_type_box(GVJ_t * job, pointf p, pointf u, int flag)
 {
     pointf m, q, v, a[4];
 
@@ -451,13 +451,13 @@ static void arrow_type_box(GVC_t * gvc, pointf p, pointf u, int flag)
        a[1] = p;
        a[2] = m;
     }
-    arrow_codegen_polygon(gvc, a, 4, !(flag & ARR_MOD_OPEN));
+    arrow_codegen_polygon(job, a, 4, !(flag & ARR_MOD_OPEN));
     a[0] = m;
     a[1] = q;
-    arrow_codegen_polyline(gvc, a, 2);
+    arrow_codegen_polyline(job, a, 2);
 }
 
-static void arrow_type_diamond(GVC_t * gvc, pointf p, pointf u, int flag)
+static void arrow_type_diamond(GVJ_t * job, pointf p, pointf u, int flag)
 {
     pointf q, r, v, a[5];
 
@@ -474,24 +474,24 @@ static void arrow_type_diamond(GVC_t * gvc, pointf p, pointf u, int flag)
     a[3].x = r.x - v.x;
     a[3].y = r.y - v.y;
     if (flag & ARR_MOD_LEFT)
-       arrow_codegen_polygon(gvc, &a[2], 3, !(flag & ARR_MOD_OPEN));
+       arrow_codegen_polygon(job, &a[2], 3, !(flag & ARR_MOD_OPEN));
     else if (flag & ARR_MOD_RIGHT)
-       arrow_codegen_polygon(gvc, a, 3, !(flag & ARR_MOD_OPEN));
+       arrow_codegen_polygon(job, a, 3, !(flag & ARR_MOD_OPEN));
     else
-       arrow_codegen_polygon(gvc, a, 4, !(flag & ARR_MOD_OPEN));
+       arrow_codegen_polygon(job, a, 4, !(flag & ARR_MOD_OPEN));
 }
 
-static void arrow_type_dot(GVC_t * gvc, pointf p, pointf u, int flag)
+static void arrow_type_dot(GVJ_t * job, pointf p, pointf u, int flag)
 {
     pointf r;
 
     r.x = r.y = sqrt(u.x * u.x + u.y * u.y) / 2.;
     p.x += u.x / 2.;
     p.y += u.y / 2.;
-    arrow_codegen_ellipse(gvc, p, r, !(flag & ARR_MOD_OPEN));
+    arrow_codegen_ellipse(job, p, r, !(flag & ARR_MOD_OPEN));
 }
 
-static pointf arrow_gen_type(GVC_t * gvc, pointf p, pointf u, int flag)
+static pointf arrow_gen_type(GVJ_t * job, pointf p, pointf u, int flag)
 {
     int f;
     arrowtype_t *arrowtype;
@@ -501,7 +501,7 @@ static pointf arrow_gen_type(GVC_t * gvc, pointf p, pointf u, int flag)
        if (f == arrowtype->type) {
            u.x *= arrowtype->lenfact;
            u.y *= arrowtype->lenfact;
-           (arrowtype->gen) (gvc, p, u, flag);
+           (arrowtype->gen) (job, p, u, flag);
            p.x = p.x + u.x;
            p.y = p.y + u.y;
            break;
@@ -510,15 +510,15 @@ static pointf arrow_gen_type(GVC_t * gvc, pointf p, pointf u, int flag)
     return p;
 }
 
-void arrow_newgen(GVC_t * gvc, pointf p, pointf u, double scale, int flag)
+void arrow_newgen(GVJ_t * job, pointf p, pointf u, double scale, int flag)
 {
     double s;
     int f;
 
     /* Dotted and dashed styles on the arrowhead are ugly (dds) */
     /* linewidth needs to be reset */
-    gvrender_begin_context(gvc);
-    gvrender_set_style(gvc, gvc->defaultlinestyle);
+    gvrender_begin_context(job);
+    gvrender_set_style(job, job->gvc->defaultlinestyle);
 
     /* generate arrowhead vector */
     u.x -= p.x;
@@ -532,22 +532,22 @@ void arrow_newgen(GVC_t * gvc, pointf p, pointf u, double scale, int flag)
 
     /* arrow head closest to node */
     f = flag & ((1 << 16) - 1);
-    p = arrow_gen_type(gvc, p, u, f);
+    p = arrow_gen_type(job, p, u, f);
 
     /* arrow head furthest from node */
     /*   start where first one ended */
     f = (flag >> 16) & ((1 << 16) - 1);
-    arrow_gen_type(gvc, p, u, f);
+    arrow_gen_type(job, p, u, f);
 
-    gvrender_end_context(gvc);
+    gvrender_end_context(job);
 }
 
 /* FIXME emit.c and output.c require wrapper for int point coords */
-void arrow_gen(GVC_t * gvc, point p, point u, double scale, int flag)
+void arrow_gen(GVJ_t * job, point p, point u, double scale, int flag)
 {
     pointf P, U;
 
     P2PF(p, P);
     P2PF(u, U);
-    arrow_newgen(gvc, P, U, scale, flag);
+    arrow_newgen(job, P, U, scale, flag);
 }
index d819ab769e8a00ae2a23646e5c9c1921560ea53b..8e980c47cd6cb580c7cf6a2715482e1b20617ba8 100644 (file)
@@ -83,7 +83,7 @@ static int chkOrder(graph_t * g)
     return 0;
 }
 
-static void init_job_flags(gvrender_job_t * job, graph_t * g)
+static void init_job_flags(GVJ_t * job, graph_t * g)
 {
     switch (job->output_lang) {
     case GVRENDER_PLUGIN:
@@ -122,6 +122,7 @@ static void init_job_flags(gvrender_job_t * job, graph_t * g)
 
 static void init_layering(GVC_t * gvc, graph_t * g)
 {
+    GVJ_t *job = gvc->job;
     char *str;
 
     /* free layer strings and pointers from previous graph */
@@ -131,12 +132,12 @@ static void init_layering(GVC_t * gvc, graph_t * g)
        free(gvc->layerIDs);
 
     if ((str = agget(g, "layers")) != 0) {
-       if (gvrender_features(gvc) & GVRENDER_DOES_LAYERS) {
+       if (gvrender_features(job) & GVRENDER_DOES_LAYERS) {
            gvc->numLayers = parse_layers(gvc, g, str);
        }
        else {
            agerr(AGWARN, "layers not supported in %s output\n",
-                 gvc->job->output_langname);
+                 job->output_langname);
            gvc->numLayers = 1;
        }
     } else {
@@ -160,7 +161,7 @@ static void nextlayer(GVC_t *gvc)
     gvc->layerNum++;
 }
 
-static point pagecode(gvrender_job_t *job, char c)
+static point pagecode(GVJ_t *job, char c)
 {
     point rv;
     rv.x = rv.y = 0;
@@ -185,7 +186,7 @@ static point pagecode(gvrender_job_t *job, char c)
 
 static void set_pagedir(GVC_t *gvc, graph_t * g)
 {
-    gvrender_job_t *job = gvc->job;
+    GVJ_t *job = gvc->job;
     char *str;
 
     job->pagesArrayMajor.x = job->pagesArrayMajor.y 
@@ -207,7 +208,7 @@ static void set_pagedir(GVC_t *gvc, graph_t * g)
 
 static void init_job_pagination(GVC_t * gvc, graph_t * g)
 {
-    gvrender_job_t *job = gvc->job;
+    GVJ_t *job = gvc->job;
     pointf pageSizeCenteredLessMargins;         /* page for centering less margins - graph units*/
     pointf deviceSize;                 /* device size for a page of the graph - graph units */
     pointf extra, size;
@@ -309,14 +310,14 @@ fprintf(stderr,"width,height = %d,%d (device units)\n",
 
 static void firstpage(GVC_t *gvc)
 {
-    gvrender_job_t *job = gvc->job;
+    GVJ_t *job = gvc->job;
 
     job->pagesArrayElem = job->pagesArrayFirst;
 }
 
 static boolean validpage(GVC_t *gvc)
 {
-    gvrender_job_t *job = gvc->job;
+    GVJ_t *job = gvc->job;
 
     return ((job->pagesArrayElem.x >= 0)
         && (job->pagesArrayElem.x < job->pagesArraySize.x)
@@ -326,7 +327,7 @@ static boolean validpage(GVC_t *gvc)
 
 static void nextpage(GVC_t *gvc)
 {
-    gvrender_job_t *job = gvc->job;
+    GVJ_t *job = gvc->job;
 
     job->pagesArrayElem = add_points(job->pagesArrayElem, job->pagesArrayMinor);
     if (validpage(gvc) == FALSE) {
@@ -364,9 +365,8 @@ static boolean write_node_test(Agraph_t * g, Agnode_t * n)
     return TRUE;
 }
 
-void emit_background(GVC_t * gvc, graph_t *g)
+void emit_background(GVJ_t * job, graph_t *g)
 {
-    gvrender_job_t * job = gvc->job;
     char *str;
     pointf AF[4];
     point A[4];
@@ -383,23 +383,25 @@ void emit_background(GVC_t * gvc, graph_t *g)
        for (i = 0; i < 4; i++) {
            PF2P(AF[i],A[i]);
        }
-       gvrender_set_fillcolor(gvc, str);
-       gvrender_set_pencolor(gvc, str);
-       gvrender_polygon(gvc, A, 4, TRUE);      /* filled */
+       gvrender_set_fillcolor(job, str);
+       gvrender_set_pencolor(job, str);
+       gvrender_polygon(job, A, 4, TRUE);      /* filled */
     }
 }
 
 static void emit_defaults(GVC_t * gvc)
 {
-    gvrender_set_pencolor(gvc, DEFAULT_COLOR);
-    gvrender_set_font(gvc, gvc->defaultfontname, gvc->defaultfontsize);
+    GVJ_t * job = gvc->job;
+
+    gvrender_set_pencolor(job, DEFAULT_COLOR);
+    gvrender_set_font(job, gvc->defaultfontname, gvc->defaultfontsize);
 }
 
 
 /* even if this makes you cringe, at least it's short */
 static void setup_page(GVC_t * gvc, graph_t * g)
 {
-    gvrender_job_t *job = gvc->job;
+    GVJ_t *job = gvc->job;
 
     /* establish current box in graph coordinates */
     job->pageBox.LL.x = job->pagesArrayElem.x * job->pageSize.x;
@@ -429,14 +431,14 @@ fprintf(stderr,"pagesArrayElem = %d,%d pageSize = %g,%g pageOffset = %g,%g\n",
        job->pageOffset.x, job->pageOffset.y);
 #endif
 
-    gvrender_begin_page(gvc);
-    emit_background(gvc, g);
+    gvrender_begin_page(job);
+    emit_background(job, g);
     emit_defaults(gvc);
 }
 
 static boolean node_in_pageBox(GVC_t *gvc, node_t * n)
 {
-    gvrender_job_t *job = gvc->job;
+    GVJ_t *job = gvc->job;
     boxf nb;
 
 #if 0
@@ -577,8 +579,9 @@ static boolean clust_in_layer(GVC_t *gvc, graph_t * sg)
     return FALSE;
 }
 
-static void emit_node(GVC_t * gvc, node_t * n)
+static void emit_node(GVJ_t * job, node_t * n)
 {
+    GVC_t *gvc = job->gvc;
     char *s, *url = NULL, *tooltip = NULL, *target = NULL;
 
     if (ND_shape(n) == NULL)
@@ -588,13 +591,13 @@ static void emit_node(GVC_t * gvc, node_t * n)
            && node_in_pageBox(gvc, n)
            && (ND_state(n) != gvc->pageNum)) {
 
-        gvrender_comment(gvc, n->name);
+        gvrender_comment(job, n->name);
 
        s = late_string(n, N_comment, "");
        if (s[0])
-           gvrender_comment(gvc, s);
+           gvrender_comment(job, s);
         
-       gvrender_begin_node(gvc, n);
+       gvrender_begin_node(job, n);
        if (((s = agget(n, "href")) && s[0])
            || ((s = agget(n, "URL")) && s[0])) {
            url = strdup_and_subst_node(s, n);
@@ -604,21 +607,21 @@ static void emit_node(GVC_t * gvc, node_t * n)
                tooltip = strdup_and_subst_node(ND_label(n)->text, n);
            if ((s = agget(n, "target")) && s[0])
                target = strdup_and_subst_node(s, n);
-           gvrender_begin_anchor(gvc, url, tooltip, target);
+           gvrender_begin_anchor(job, url, tooltip, target);
        }
-       gvrender_begin_context(gvc);
-       ND_shape(n)->fns->codefn(gvc, n);
+       gvrender_begin_context(job);
+       ND_shape(n)->fns->codefn(job, n);
        ND_state(n) = gvc->pageNum;
-       gvrender_end_context(gvc);
+       gvrender_end_context(job);
        if (url) {
-           gvrender_end_anchor(gvc);
+           gvrender_end_anchor(job);
            free(url);
            if (tooltip)
                free(tooltip);
            if (target)
                free(target);
        }
-       gvrender_end_node(gvc);
+       gvrender_end_node(job);
     }
 }
 
@@ -659,7 +662,7 @@ static pointf computeoffset_qr(pointf p, pointf q, pointf r, pointf s,
     return res;
 }
 
-void emit_attachment(GVC_t * gvc, textlabel_t * lp, splines * spl)
+static void emit_attachment(GVJ_t * job, textlabel_t * lp, splines * spl)
 {
     point sz, A[3];
     unsigned char *s;
@@ -676,18 +679,18 @@ void emit_attachment(GVC_t * gvc, textlabel_t * lp, splines * spl)
     A[1] = pointof(A[0].x - sz.x, A[0].y);
     A[2] = dotneato_closest(spl, lp->p);
     /* Don't use edge style to draw attachment */
-    gvrender_set_style(gvc, gvc->defaultlinestyle);
+    gvrender_set_style(job, job->gvc->defaultlinestyle);
     /* Use font color to draw attachment
        - need something unambiguous in case of multicolored parallel edges
        - defaults to black for html-like labels
      */
-    gvrender_set_pencolor(gvc, lp->fontcolor);
-    gvrender_polyline(gvc, A, 3);
+    gvrender_set_pencolor(job, lp->fontcolor);
+    gvrender_polyline(job, A, 3);
 }
 
 static boolean edge_in_pageBox(GVC_t *gvc, edge_t * e)
 {
-    gvrender_job_t *job = gvc->job;
+    GVJ_t *job = gvc->job;
     int i, j, np;
     bezier bz;
     point *p;
@@ -723,7 +726,7 @@ static boolean edge_in_pageBox(GVC_t *gvc, edge_t * e)
     return boxf_overlap(job->pageBox, b);
 }
 
-void emit_edge_graphics(GVC_t * gvc, edge_t * e)
+void emit_edge_graphics(GVJ_t * job, edge_t * e)
 {
     int i, j, cnum, numc = 0;
     char *color, *style;
@@ -751,7 +754,7 @@ void emit_edge_graphics(GVC_t * gvc, edge_t * e)
        sp = styles;
        while ((p = *sp++)) {
            if (streq(p, "invis")) {
-               gvrender_end_edge(gvc);
+               gvrender_end_edge(job);
                return;
            }
        }
@@ -762,9 +765,9 @@ void emit_edge_graphics(GVC_t * gvc, edge_t * e)
        color = late_string(e, E_color, "");
 
        if (color[0] || styles) {
-           gvrender_begin_context(gvc);
+           gvrender_begin_context(job);
            if (styles)
-               gvrender_set_style(gvc, styles);
+               gvrender_set_style(job, styles);
            saved = TRUE;
        }
        /* need to know how many colors separated by ':' */
@@ -817,10 +820,10 @@ void emit_edge_graphics(GVC_t * gvc, edge_t * e)
            for (cnum = 0, color = strtok(colors, ":"); color;
                 cnum++, color = strtok(0, ":")) {
                if (color[0]) {
-                   gvrender_set_pencolor(gvc, color);
-                   gvrender_set_fillcolor(gvc, color);
+                   gvrender_set_pencolor(job, color);
+                   gvrender_set_fillcolor(job, color);
                } else {
-                   gvrender_set_fillcolor(gvc, DEFAULT_COLOR);
+                   gvrender_set_fillcolor(job, DEFAULT_COLOR);
                }
                for (i = 0; i < tmpspl.size; i++) {
                    tmplist = tmpspl.list[i].list;
@@ -829,16 +832,16 @@ void emit_edge_graphics(GVC_t * gvc, edge_t * e)
                        tmplist[j].x += offlist[j].x;
                        tmplist[j].y += offlist[j].y;
                    }
-                   gvrender_beziercurve(gvc, tmplist, tmpspl.list[i].size,
+                   gvrender_beziercurve(job, tmplist, tmpspl.list[i].size,
                                         FALSE, FALSE, FALSE);
                }
            }
            xdemitState = EMIT_TDRAW;
            if (bz.sflag)
-               arrow_gen(gvc, bz.sp, bz.list[0], scale, bz.sflag);
+               arrow_gen(job, bz.sp, bz.list[0], scale, bz.sflag);
            xdemitState = EMIT_HDRAW;
            if (bz.eflag)
-               arrow_gen(gvc, bz.ep, bz.list[bz.size - 1], scale,
+               arrow_gen(job, bz.ep, bz.list[bz.size - 1], scale,
                          bz.eflag);
            free(colors);
            for (i = 0; i < offspl.size; i++) {
@@ -849,10 +852,10 @@ void emit_edge_graphics(GVC_t * gvc, edge_t * e)
            free(tmpspl.list);
        } else {
            if (color[0]) {
-               gvrender_set_pencolor(gvc, color);
-               gvrender_set_fillcolor(gvc, color);
+               gvrender_set_pencolor(job, color);
+               gvrender_set_fillcolor(job, color);
            } else {
-               gvrender_set_fillcolor(gvc, DEFAULT_COLOR);
+               gvrender_set_fillcolor(job, DEFAULT_COLOR);
            }
            for (i = 0; i < ED_spl(e)->size; i++) {
                bz = ED_spl(e)->list[i];
@@ -861,18 +864,18 @@ void emit_edge_graphics(GVC_t * gvc, edge_t * e)
                bzf.list = malloc(sizeof(pointf) * bzf.size);
                for (j = 0; j < bz.size; j++)
                    P2PF(bz.list[j], bzf.list[j]);
-               if (gvrender_features(gvc) & GVRENDER_DOES_ARROWS) {
-                   gvrender_beziercurve(gvc, bzf.list, bz.size, bz.sflag,
+               if (gvrender_features(job) & GVRENDER_DOES_ARROWS) {
+                   gvrender_beziercurve(job, bzf.list, bz.size, bz.sflag,
                                         bz.eflag, FALSE);
                } else {
-                   gvrender_beziercurve(gvc, bzf.list, bz.size, FALSE,
+                   gvrender_beziercurve(job, bzf.list, bz.size, FALSE,
                                         FALSE, FALSE);
                    xdemitState = EMIT_TDRAW;
                    if (bz.sflag)
-                       arrow_gen(gvc, bz.sp, bz.list[0], scale, bz.sflag);
+                       arrow_gen(job, bz.sp, bz.list[0], scale, bz.sflag);
                    xdemitState = EMIT_HDRAW;
                    if (bz.eflag)
-                       arrow_gen(gvc, bz.ep, bz.list[bz.size - 1], scale,
+                       arrow_gen(job, bz.ep, bz.list[bz.size - 1], scale,
                                  bz.eflag);
                }
                free(bzf.list);
@@ -881,23 +884,24 @@ void emit_edge_graphics(GVC_t * gvc, edge_t * e)
     }
     xdemitState = EMIT_LABEL;
     if (ED_label(e)) {
-       emit_label(gvc, ED_label(e), (void *) e);
+       emit_label(job, ED_label(e), (void *) e);
        if (mapbool(late_string(e, E_decorate, "false")) && ED_spl(e))
-           emit_attachment(gvc, ED_label(e), ED_spl(e));
+           emit_attachment(job, ED_label(e), ED_spl(e));
     }
     xdemitState = EMIT_HLABEL;
     if (ED_head_label(e))
-       emit_label(gvc, ED_head_label(e), (void *) e);  /* vladimir */
+       emit_label(job, ED_head_label(e), (void *) e);  /* vladimir */
     xdemitState = EMIT_TLABEL;
     if (ED_tail_label(e))
-       emit_label(gvc, ED_tail_label(e), (void *) e);  /* vladimir */
+       emit_label(job, ED_tail_label(e), (void *) e);  /* vladimir */
 
     if (saved)
-       gvrender_end_context(gvc);
+       gvrender_end_context(job);
 }
 
-static void emit_edge(GVC_t * gvc, edge_t * e)
+static void emit_edge(GVJ_t * job, edge_t * e)
 {
+    GVC_t *gvc = job->gvc;
     char *s, *url = NULL, *label = NULL, *tooltip = NULL, *target = NULL;
     textlabel_t *lab = NULL;
 
@@ -911,14 +915,14 @@ static void emit_edge(GVC_t * gvc, edge_t * e)
     else
         strcat(s,"--");
     strcat(s,e->head->name);
-    gvrender_comment(gvc, s);
+    gvrender_comment(job, s);
     free(s);
 
     s = late_string(e, E_comment, "");
     if (s[0])
-        gvrender_comment(gvc, s);
+        gvrender_comment(job, s);
 
-    gvrender_begin_edge(gvc, e);
+    gvrender_begin_edge(job, e);
     if (((s = agget(e, "href")) && s[0])
        || ((s = agget(e, "URL")) && s[0])) {
        url = strdup_and_subst_edge(s, e);
@@ -931,18 +935,18 @@ static void emit_edge(GVC_t * gvc, edge_t * e)
            tooltip = strdup_and_subst_edge(label, e);
        if ((s = agget(e, "target")) && s[0])
            target = strdup_and_subst_edge(s, e);
-       gvrender_begin_anchor(gvc, url, tooltip, target);
+       gvrender_begin_anchor(job, url, tooltip, target);
     }
-    emit_edge_graphics (gvc, e);
+    emit_edge_graphics (job, e);
     if (url) {
-       gvrender_end_anchor(gvc);
+       gvrender_end_anchor(job);
        free(url);
        if (tooltip)
            free(tooltip);
        if (target)
            free(target);
     }
-    gvrender_end_edge(gvc);
+    gvrender_end_edge(job);
 }
 
 static void init_gvc_from_graph(GVC_t * gvc, graph_t * g)
@@ -995,7 +999,7 @@ static void init_gvc_from_graph(GVC_t * gvc, graph_t * g)
 
 static void init_job_margin(GVC_t *gvc)
 {
-    gvrender_job_t *job = gvc->job;
+    GVJ_t *job = gvc->job;
     
     if (gvc->graph_sets_margin) {
        job->margin = gvc->margin;
@@ -1023,7 +1027,7 @@ static void init_job_margin(GVC_t *gvc)
 
 static void init_job_dpi(GVC_t *gvc, graph_t *g)
 {
-    gvrender_job_t *job = gvc->job;
+    GVJ_t *job = gvc->job;
     
     job->dpi = GD_drawing(g)->dpi;
     if (job->dpi == 0) {
@@ -1044,7 +1048,7 @@ static void init_job_dpi(GVC_t *gvc, graph_t *g)
 
 static void init_job_viewport(GVC_t * gvc, graph_t * g)
 {
-    gvrender_job_t * job = gvc->job;
+    GVJ_t * job = gvc->job;
     pointf UR, size;
     char *str;
     double X, Y, Z, x, y;
@@ -1089,42 +1093,43 @@ static void init_job_viewport(GVC_t * gvc, graph_t * g)
     job->rotation = gvc->rotation;
 }
 
-void emit_graph(GVC_t * gvc, graph_t * g)
+void emit_graph(GVJ_t * job, graph_t * g)
 {
+    GVC_t * gvc = job->gvc;
     graph_t *sg;
     node_t *n;
     edge_t *e;
     int c;
     char *str, *colors;
     char *s, *url = NULL, *tooltip = NULL, *target = NULL;
-    int flags = gvc->job->flags;
+    int flags = job->flags;
 
     s = late_string(g, agfindattr(g, "comment"), "");
-    gvrender_comment(gvc, s);
+    gvrender_comment(job, s);
 
-    gvrender_begin_graph(gvc, g);
+    gvrender_begin_graph(job, g);
     if (flags & EMIT_COLORS) {
-       gvrender_set_fillcolor(gvc, DEFAULT_FILL);
+       gvrender_set_fillcolor(job, DEFAULT_FILL);
        if (((str = agget(g, "bgcolor")) != 0) && str[0])
-           gvrender_set_fillcolor(gvc, str);
+           gvrender_set_fillcolor(job, str);
        if (((str = agget(g, "fontcolor")) != 0) && str[0])
-           gvrender_set_pencolor(gvc, str);
+           gvrender_set_pencolor(job, str);
        for (c = 1; c <= GD_n_cluster(g); c++) {
            sg = GD_clust(g)[c];
            if (((str = agget(sg, "color")) != 0) && str[0])
-               gvrender_set_pencolor(gvc, str);
+               gvrender_set_pencolor(job, str);
            if (((str = agget(sg, "fillcolor")) != 0) && str[0])
-               gvrender_set_fillcolor(gvc, str);
+               gvrender_set_fillcolor(job, str);
            if (((str = agget(sg, "fontcolor")) != 0) && str[0])
-               gvrender_set_pencolor(gvc, str);
+               gvrender_set_pencolor(job, str);
        }
        for (n = agfstnode(g); n; n = agnxtnode(g, n)) {
            if (((str = agget(n, "color")) != 0) && str[0])
-               gvrender_set_pencolor(gvc, str);
+               gvrender_set_pencolor(job, str);
            if (((str = agget(n, "fillcolor")) != 0) && str[0])
-               gvrender_set_fillcolor(gvc, str);
+               gvrender_set_fillcolor(job, str);
            if (((str = agget(n, "fontcolor")) != 0) && str[0])
-               gvrender_set_pencolor(gvc, str);
+               gvrender_set_pencolor(job, str);
            for (e = agfstout(g, n); e; e = agnxtout(g, e)) {
                if (((str = agget(e, "color")) != 0) && str[0]) {
                    if (strchr(str, ':')) {
@@ -1132,14 +1137,14 @@ void emit_graph(GVC_t * gvc, graph_t * g)
                        for (str = strtok(colors, ":"); str;
                             str = strtok(0, ":")) {
                            if (str[0])
-                               gvrender_set_pencolor(gvc, str);
+                               gvrender_set_pencolor(job, str);
                        }
                        free(colors);
                    } else
-                       gvrender_set_pencolor(gvc, str);
+                       gvrender_set_pencolor(job, str);
                }
                if (((str = agget(e, "fontcolor")) != 0) && str[0])
-                   gvrender_set_pencolor(gvc, str);
+                   gvrender_set_pencolor(job, str);
            }
        }
     }
@@ -1149,7 +1154,7 @@ void emit_graph(GVC_t * gvc, graph_t * g)
     /* iterate layers */
     for (firstlayer(gvc); validlayer(gvc); nextlayer(gvc)) {
        if (gvc->numLayers > 1)
-           gvrender_begin_layer(gvc);
+           gvrender_begin_layer(job);
 
        /* iterate pages */
        for (firstpage(gvc); validpage(gvc); nextpage(gvc)) {
@@ -1169,85 +1174,85 @@ fprintf(stderr,"pageNum = %d pagesArrayElem = %d,%d\n",
                    tooltip = strdup_and_subst_graph(s, g);
                else if (GD_label(g))
                    tooltip = strdup_and_subst_graph(GD_label(g)->text, g);
-               gvrender_begin_anchor(gvc, url, tooltip, target);
+               gvrender_begin_anchor(job, url, tooltip, target);
            }
            if (GD_label(g))
-               emit_label(gvc, GD_label(g), (void *) g);
+               emit_label(job, GD_label(g), (void *) g);
            Obj = CLST;
            /* when drawing, lay clusters down before nodes and edges */
            if (!(flags & EMIT_CLUSTERS_LAST)) {
-               emit_clusters(gvc, g, flags);
+               emit_clusters(job, g, flags);
            }
            if (flags & EMIT_SORTED) {
                /* output all nodes, then all edges */
                Obj = NODE;
-               gvrender_begin_nodes(gvc);
+               gvrender_begin_nodes(job);
                for (n = agfstnode(g); n; n = agnxtnode(g, n)) {
-                   emit_node(gvc, n);
+                   emit_node(job, n);
                }
-               gvrender_end_nodes(gvc);
+               gvrender_end_nodes(job);
                Obj = EDGE;
-               gvrender_begin_edges(gvc);
+               gvrender_begin_edges(job);
                for (n = agfstnode(g); n; n = agnxtnode(g, n)) {
                    for (e = agfstout(g, n); e; e = agnxtout(g, e)) {
-                       emit_edge(gvc, e);
+                       emit_edge(job, e);
                    }
                }
-               gvrender_end_edges(gvc);
+               gvrender_end_edges(job);
            } else if (flags & EMIT_EDGE_SORTED) {
                /* output all edges, then all nodes */
                Obj = EDGE;
-               gvrender_begin_edges(gvc);
+               gvrender_begin_edges(job);
                for (n = agfstnode(g); n; n = agnxtnode(g, n)) {
                    for (e = agfstout(g, n); e; e = agnxtout(g, e)) {
-                       emit_edge(gvc, e);
+                       emit_edge(job, e);
                    }
                }
-               gvrender_end_edges(gvc);
+               gvrender_end_edges(job);
                Obj = NODE;
-               gvrender_begin_nodes(gvc);
+               gvrender_begin_nodes(job);
                for (n = agfstnode(g); n; n = agnxtnode(g, n)) {
-                   emit_node(gvc, n);
+                   emit_node(job, n);
                }
-               gvrender_end_nodes(gvc);
+               gvrender_end_nodes(job);
            } else if (flags & EMIT_PREORDER) {
                Obj = NODE;
-               gvrender_begin_nodes(gvc);
+               gvrender_begin_nodes(job);
                for (n = agfstnode(g); n; n = agnxtnode(g, n)) {
                    if (write_node_test(g, n))
-                       emit_node(gvc, n);
+                       emit_node(job, n);
                }
-               gvrender_end_nodes(gvc);
+               gvrender_end_nodes(job);
                Obj = EDGE;
-               gvrender_begin_edges(gvc);
+               gvrender_begin_edges(job);
 
                for (n = agfstnode(g); n; n = agnxtnode(g, n)) {
                    for (e = agfstout(g, n); e; e = agnxtout(g, e)) {
                        if (write_edge_test(g, e))
-                           emit_edge(gvc, e);
+                           emit_edge(job, e);
                    }
                }
-               gvrender_end_edges(gvc);
+               gvrender_end_edges(job);
            } else {
                /* output in breadth first graph walk order */
                for (n = agfstnode(g); n; n = agnxtnode(g, n)) {
                    Obj = NODE;
-                   emit_node(gvc, n);
+                   emit_node(job, n);
                    for (e = agfstout(g, n); e; e = agnxtout(g, e)) {
                        Obj = NODE;
-                       emit_node(gvc, e->head);
+                       emit_node(job, e->head);
                        Obj = EDGE;
-                       emit_edge(gvc, e);
+                       emit_edge(job, e);
                    }
                }
            }
            /* when mapping, detect events on clusters after nodes and edges */
            if (flags & EMIT_CLUSTERS_LAST) {
-               emit_clusters(gvc, g, flags);
+               emit_clusters(job, g, flags);
            }
            Obj = NONE;
            if (url) {
-               gvrender_end_anchor(gvc);
+               gvrender_end_anchor(job);
                free(url);
                url = NULL;
                if (tooltip) {
@@ -1259,12 +1264,12 @@ fprintf(stderr,"pageNum = %d pagesArrayElem = %d,%d\n",
                    target = NULL;
                }
            }
-           gvrender_end_page(gvc);
+           gvrender_end_page(job);
        } /* pages */
        if (gvc->numLayers > 1)
-           gvrender_end_layer(gvc);
+           gvrender_end_layer(job);
     } /* layers */
-    gvrender_end_graph(gvc);
+    gvrender_end_graph(job);
 }
 
 /* support for stderr_once */
@@ -1311,12 +1316,12 @@ static void emit_once_reset(void)
 
 void emit_jobs_eof(GVC_t * gvc)
 {
-    gvrender_job_t *job;
+    GVJ_t *job;
 
     for (job = gvrender_first_job(gvc); job; job = gvrender_next_job(gvc)) {
         if (job->output_file) {
            if (gvc->pageNum > 0) {
-               gvrender_end_job(gvc);
+               gvrender_end_job(job);
                emit_once_reset();
                gvc->pageNum = 0;
            }
@@ -1326,7 +1331,7 @@ void emit_jobs_eof(GVC_t * gvc)
     }
 }
 
-void emit_clusters(GVC_t * gvc, Agraph_t * g, int flags)
+void emit_clusters(GVJ_t * job, Agraph_t * g, int flags)
 {
     int i, c, filled;
     graph_t *sg;
@@ -1339,14 +1344,14 @@ void emit_clusters(GVC_t * gvc, Agraph_t * g, int flags)
 
     for (c = 1; c <= GD_n_cluster(g); c++) {
        sg = GD_clust(g)[c];
-       if (clust_in_layer(gvc, sg) == FALSE)
+       if (clust_in_layer(job->gvc, sg) == FALSE)
            continue;
        /* when mapping, detect events on clusters after sub_clusters */
        if (flags & EMIT_CLUSTERS_LAST) {
-           emit_clusters(gvc, sg, flags);
+           emit_clusters(job, sg, flags);
        }
        Obj = CLST;
-       gvrender_begin_cluster(gvc, sg);
+       gvrender_begin_cluster(job, sg);
        if (((s = agget(sg, "href")) && s[0])
            || ((s = agget(sg, "URL")) && s[0])) {
            url = strdup_and_subst_graph(s, sg);
@@ -1356,13 +1361,13 @@ void emit_clusters(GVC_t * gvc, Agraph_t * g, int flags)
                tooltip = strdup_and_subst_graph(s, sg);
            else
                tooltip = strdup_and_subst_graph(GD_label(sg)->text, sg);
-           gvrender_begin_anchor(gvc, url, tooltip, target);
+           gvrender_begin_anchor(job, url, tooltip, target);
        }
-       gvrender_begin_context(gvc);
+       gvrender_begin_context(job);
        filled = FALSE;
        xdemitState = EMIT_DRAW;
        if (((str = agget(sg, "style")) != 0) && str[0]) {
-           gvrender_set_style(gvc, (style = parse_style(str)));
+           gvrender_set_style(job, (style = parse_style(str)));
            for (i = 0; style[i]; i++)
                if (strcmp(style[i], "filled") == 0) {
                    filled = TRUE;
@@ -1370,22 +1375,22 @@ void emit_clusters(GVC_t * gvc, Agraph_t * g, int flags)
                }
        }
        if (((str = agget(sg, "pencolor")) != 0) && str[0])
-           gvrender_set_pencolor(gvc, str);
+           gvrender_set_pencolor(job, str);
        else if (((str = agget(sg, "color")) != 0) && str[0])
-           gvrender_set_pencolor(gvc, str);
+           gvrender_set_pencolor(job, str);
        /* bgcolor is supported for backward compatability */
        else if (((str = agget(sg, "bgcolor")) != 0) && str[0])
-           gvrender_set_pencolor(gvc, str);
+           gvrender_set_pencolor(job, str);
 
        str = 0;
        if (((str = agget(sg, "fillcolor")) != 0) && str[0])
-           gvrender_set_fillcolor(gvc, str);
+           gvrender_set_fillcolor(job, str);
        else if (((str = agget(sg, "color")) != 0) && str[0])
-           gvrender_set_fillcolor(gvc, str);
+           gvrender_set_fillcolor(job, str);
        /* bgcolor is supported for backward compatability */
        else if (((str = agget(sg, "bgcolor")) != 0) && str[0]) {
            filled = TRUE;
-           gvrender_set_fillcolor(gvc, str);
+           gvrender_set_fillcolor(job, str);
        }
        A[0] = GD_bb(sg).LL;
        A[2] = GD_bb(sg).UR;
@@ -1394,30 +1399,30 @@ void emit_clusters(GVC_t * gvc, Agraph_t * g, int flags)
        A[3].x = A[0].x;
        A[3].y = A[2].y;
        if (late_int(sg, G_peripheries, 1, 0)) {
-           gvrender_polygon(gvc, A, 4, filled);
+           gvrender_polygon(job, A, 4, filled);
        } else if (filled) {
-           gvrender_set_pencolor(gvc, str);
-           gvrender_polygon(gvc, A, 4, filled);
+           gvrender_set_pencolor(job, str);
+           gvrender_polygon(job, A, 4, filled);
        }
        xdemitState = EMIT_DRAW;
        if (GD_label(sg))
-           emit_label(gvc, GD_label(sg), (void *) sg);
+           emit_label(job, GD_label(sg), (void *) sg);
 
        if (flags & EMIT_PREORDER) {
            for (n = agfstnode(sg); n; n = agnxtnode(sg, n)) {
                Obj = NODE;
-               emit_node(gvc, n);
+               emit_node(job, n);
                for (e = agfstout(sg, n); e; e = agnxtout(sg, e)) {
                    Obj = EDGE;
-                   emit_edge(gvc, e);
+                   emit_edge(job, e);
                }
            }
            Obj = NONE;
        }
 
-       gvrender_end_context(gvc);
+       gvrender_end_context(job);
        if (url) {
-           gvrender_end_anchor(gvc);
+           gvrender_end_anchor(job);
            free(url);
            url = NULL;
            if (tooltip) {
@@ -1429,10 +1434,10 @@ void emit_clusters(GVC_t * gvc, Agraph_t * g, int flags)
                target = NULL;
            }
        }
-       gvrender_end_cluster(gvc);
+       gvrender_end_cluster(job);
        /* when drawing, lay down clusters before sub_clusters */
        if (!(flags & EMIT_CLUSTERS_LAST)) {
-           emit_clusters(gvc, sg, flags);
+           emit_clusters(job, sg, flags);
        }
     }
 }
@@ -1575,9 +1580,9 @@ void use_library(char *name)
     }
 }
 
-static void emit_job(GVC_t * gvc, graph_t * g)
+static void emit_job(GVJ_t * job, graph_t * g)
 {
-    gvrender_job_t *job = gvc->job;
+    GVC_t *gvc = job->gvc;
 
     if (!GD_drawing(g)) {
        fprintf (stderr,"layout was not done\n");
@@ -1591,39 +1596,39 @@ static void emit_job(GVC_t * gvc, graph_t * g)
 
     init_gvc_from_graph(gvc, g);
     init_layering(gvc, g);
-    init_job_flags(gvc->job, g);
+    init_job_flags(job, g);
     init_job_margin(gvc);
     init_job_dpi(gvc, g);
     init_job_viewport(gvc, g);
     init_job_pagination(gvc, g);
 
-    gvrender_begin_job(gvc);
+    gvrender_begin_job(job);
 
-    switch (gvc->job->output_lang) {
+    switch (job->output_lang) {
     case EXTENDED_DOT:
-        write_extended_dot(gvc, g, gvc->job->output_file);
+        write_extended_dot(gvc, g, job->output_file);
         break;
     case ATTRIBUTED_DOT:
-        write_attributed_dot(g, gvc->job->output_file);
+        write_attributed_dot(g, job->output_file);
         break;
     case CANONICAL_DOT:
-        write_canonical_dot(g, gvc->job->output_file);
+        write_canonical_dot(g, job->output_file);
         break;
     case PLAIN:
-        write_plain(gvc, g, gvc->job->output_file);
+        write_plain(gvc, g, job->output_file);
         break;
     case PLAIN_EXT:
-        write_plain_ext(gvc, g, gvc->job->output_file);
+        write_plain_ext(gvc, g, job->output_file);
         break;
     default:
        if (! (job->flags & GVRENDER_X11_EVENTS))
-            emit_graph(gvc, g);
+            emit_graph(job, g);
         break;
     }
 
     /* Flush is necessary because we may be writing to a pipe. */
-    if (! gvc->job->external_surface && gvc->job->output_lang != TK)
-        fflush(gvc->job->output_file);
+    if (! job->external_surface && job->output_lang != TK)
+        fflush(job->output_file);
 }
 
 static FILE *file_select(char *str)
@@ -1639,11 +1644,14 @@ static FILE *file_select(char *str)
 
 void emit_jobs (GVC_t * gvc, graph_t * g)
 {
-    gvrender_job_t *job;
+    GVJ_t *job;
     char *prev_langname = "";
 
     gvc->active_jobs = NULL;
     for (job = gvrender_first_job(gvc); job; job = gvrender_next_job(gvc)) {
+       job->gvc = gvc;
+       job->g = g;
+
         if (!job->output_file) {        /* if not yet opened */
             if (job->output_filename == NULL) {
                 job->output_file = stdout;
@@ -1651,15 +1659,12 @@ void emit_jobs (GVC_t * gvc, graph_t * g)
                 job->output_file = file_select(job->output_filename);
             }
         }
-        job->output_lang = gvrender_select(gvc, job->output_langname);
+        job->output_lang = gvrender_select(job, job->output_langname);
        if (job->output_lang == NO_SUPPORT) {
            fprintf(stderr,"renderer for %s is unavailable\n", job->output_langname);
            return;
        }
 
-       job->gvc = gvc;
-       job->g = g;
-
        /* insert job in active list */
        job->next_active = gvc->active_jobs;
        gvc->active_jobs = job;
@@ -1669,7 +1674,7 @@ void emit_jobs (GVC_t * gvc, graph_t * g)
            gvrender_initialize(gvc);
        }
 
-        emit_job(gvc, g);
+        emit_job(job, g);
 
        if (!job->next || strcmp(job->next->output_langname,prev_langname) != 0) {
            gvrender_finalize(gvc);
index 7c4c0358ded0a94bbb53dcaf7da2f58a0b866fe6..d3ba8c4c20ba2af5e82ed770766362fdae3bc7c1 100644 (file)
@@ -101,7 +101,7 @@ static void popFontInfo(htmlenv_t * env, htmlfont_t * savp)
 }
 
 static void
-emit_html_txt(GVC_t * gvc, htmltxt_t * tp, htmlenv_t * env, void *obj)
+emit_html_txt(GVJ_t * job, htmltxt_t * tp, htmlenv_t * env, void *obj)
 {
     int i, linespacing;
     double left_x, center_x, right_x;
@@ -145,9 +145,9 @@ emit_html_txt(GVC_t * gvc, htmltxt_t * tp, htmlenv_t * env, void *obj)
     p.y = env->p.y + (tp->box.UR.y + tp->box.LL.y) / 2 + (linespacing * (tp->nlines - 1) / 2)  /* cl of topline */
        -fsize / 3.0;           /* cl to baseline */
 
-    gvrender_begin_context(gvc);
-    gvrender_set_pencolor(gvc, fcolor);
-    gvrender_set_font(gvc, fname, fsize);
+    gvrender_begin_context(job);
+    gvrender_set_pencolor(job, fcolor);
+    gvrender_set_font(job, fname, fsize);
 
     for (i = 0; i < tp->nlines; i++) {
        switch (tp->line[i].just) {
@@ -162,16 +162,16 @@ emit_html_txt(GVC_t * gvc, htmltxt_t * tp, htmlenv_t * env, void *obj)
            p.x = center_x;
            break;
        }
-       gvrender_textline(gvc, p, &(tp->line[i]));
+       gvrender_textline(job, p, &(tp->line[i]));
 
        /* position for next line */
        p.y -= linespacing;
     }
 
-    gvrender_end_context(gvc);
+    gvrender_end_context(job);
 }
 
-static void doSide(GVC_t * gvc, point p, int wd, int ht)
+static void doSide(GVJ_t * job, point p, int wd, int ht)
 {
     point A[4];
 
@@ -182,7 +182,7 @@ static void doSide(GVC_t * gvc, point p, int wd, int ht)
     A[2].x = p.x + wd;
     A[3].x = A[2].x;
     A[3].y = p.y;
-    gvrender_polygon(gvc, A, 4, 1);
+    gvrender_polygon(job, A, 4, 1);
 }
 
 /* doBorder:
@@ -195,17 +195,17 @@ static void doSide(GVC_t * gvc, point p, int wd, int ht)
  * from x to x+border will all pixels from x to x+border, and thus have
  * width border+1.
  */
-static void doBorder(GVC_t * gvc, char *color, int border, box pts)
+static void doBorder(GVJ_t * job, char *color, int border, box pts)
 {
     point pt;
     int wd, ht;
 
-    gvrender_begin_context(gvc);
+    gvrender_begin_context(job);
 
     if (!color)
        color = "black";
-    gvrender_set_fillcolor(gvc, color);
-    gvrender_set_pencolor(gvc, color);
+    gvrender_set_fillcolor(job, color);
+    gvrender_set_pencolor(job, color);
 
     if (border == 1) {
        point A[4];
@@ -216,55 +216,55 @@ static void doBorder(GVC_t * gvc, char *color, int border, box pts)
        A[1].y = A[2].y;
        A[3].x = A[2].x;
        A[3].y = A[0].y;
-       gvrender_polygon(gvc, A, 4, 0);
+       gvrender_polygon(job, A, 4, 0);
     } else {
        border--;
        ht = pts.UR.y - pts.LL.y;
        wd = pts.UR.x - pts.LL.x;
-       doSide(gvc, pts.LL, border, ht);
+       doSide(job, pts.LL, border, ht);
        pt.x = pts.LL.x;
        pt.y = pts.UR.y;
-       doSide(gvc, pt, wd, -border);
-       doSide(gvc, pts.UR, -border, -ht);
+       doSide(job, pt, wd, -border);
+       doSide(job, pts.UR, -border, -ht);
        pt.x = pts.UR.x;
        pt.y = pts.LL.y;
-       doSide(gvc, pt, -wd, border);
+       doSide(job, pt, -wd, border);
     }
 
-    gvrender_end_context(gvc);
+    gvrender_end_context(job);
 }
 
-static void doFill(GVC_t * gvc, char *color, box pts)
+static void doFill(GVJ_t * job, char *color, box pts)
 {
     point A[4];
 
-    gvrender_set_fillcolor(gvc, color);
-    gvrender_set_pencolor(gvc, color);
+    gvrender_set_fillcolor(job, color);
+    gvrender_set_pencolor(job, color);
     A[0] = pts.LL;
     A[1].x = pts.LL.x;
     A[1].y = pts.UR.y;
     A[2] = pts.UR;
     A[3].x = pts.UR.x;
     A[3].y = pts.LL.y;
-    gvrender_polygon(gvc, A, 4, 1);
+    gvrender_polygon(job, A, 4, 1);
 }
 
-static void doAnchorStart(GVC_t * gvc, htmldata_t * data, void *obj)
+static void doAnchorStart(GVJ_t * job, htmldata_t * data, void *obj)
 {
-    gvrender_begin_anchor(gvc, data->href, data->title, data->target);
+    gvrender_begin_anchor(job, data->href, data->title, data->target);
 }
 
-static void doAnchorEnd(GVC_t * gvc)
+static void doAnchorEnd(GVJ_t * job)
 {
-    gvrender_end_anchor(gvc);
+    gvrender_end_anchor(job);
 }
 
 /* forward declaration */
-static void emit_html_cell(GVC_t * gvc, htmlcell_t * cp, htmlenv_t * env,
-                          void *obj);
+static void emit_html_cell(GVJ_t * job, htmlcell_t * cp,
+                          htmlenv_t * env, void *obj);
 
 static void
-emit_html_tbl(GVC_t * gvc, htmltbl_t * tbl, htmlenv_t * env, void *obj)
+emit_html_tbl(GVJ_t * job, htmltbl_t * tbl, htmlenv_t * env, void *obj)
 {
     box pts = tbl->data.box;
     point p = env->p;
@@ -279,32 +279,32 @@ emit_html_tbl(GVC_t * gvc, htmltbl_t * tbl, htmlenv_t * env, void *obj)
     pts.LL.y += p.y;
     pts.UR.y += p.y;
 
-    /* gvrender_begin_context(gvc); */
+    /* gvrender_begin_context(job); */
 
     if (tbl->data.href)
-       doAnchorStart(gvc, &tbl->data, obj);
+       doAnchorStart(job, &tbl->data, obj);
 
     if (tbl->data.bgcolor)
-       doFill(gvc, tbl->data.bgcolor, pts);
+       doFill(job, tbl->data.bgcolor, pts);
 
     while (*cells) {
-       emit_html_cell(gvc, *cells, env, obj);
+       emit_html_cell(job, *cells, env, obj);
        cells++;
     }
 
     if (tbl->data.border)
-       doBorder(gvc, NULL, tbl->data.border, pts);
+       doBorder(job, NULL, tbl->data.border, pts);
 
     if (tbl->data.href)
-       doAnchorEnd(gvc);
+       doAnchorEnd(job);
 
-    /* gvrender_end_context(gvc); */
+    /* gvrender_end_context(job); */
     if (tbl->font)
        popFontInfo(env, &savef);
 }
 
 static void
-emit_html_img(GVC_t * gvc, htmlimg_t * cp, htmlenv_t * env, void *obj)
+emit_html_img(GVJ_t * job, htmlimg_t * cp, htmlenv_t * env, void *obj)
 {
     point A[4];
     box bb = cp->box;
@@ -321,11 +321,11 @@ emit_html_img(GVC_t * gvc, htmlimg_t * cp, htmlenv_t * env, void *obj)
     A[3].x = bb.UR.x;
     A[3].y = bb.LL.y;
 
-    gvrender_user_shape(gvc, cp->src, A, 4, 1);
+    gvrender_user_shape(job, cp->src, A, 4, 1);
 }
 
 static void
-emit_html_cell(GVC_t * gvc, htmlcell_t * cp, htmlenv_t * env, void *obj)
+emit_html_cell(GVJ_t * job, htmlcell_t * cp, htmlenv_t * env, void *obj)
 {
     box pts = cp->data.box;
     point p = env->p;
@@ -338,23 +338,23 @@ emit_html_cell(GVC_t * gvc, htmlcell_t * cp, htmlenv_t * env, void *obj)
     /* gvrender_begin_context(); */
 
     if (cp->data.href)
-       doAnchorStart(gvc, &cp->data, obj);
+       doAnchorStart(job, &cp->data, obj);
 
     if (cp->data.bgcolor)
-       doFill(gvc, cp->data.bgcolor, pts);
+       doFill(job, cp->data.bgcolor, pts);
 
     if (cp->child.kind == HTML_TBL)
-       emit_html_tbl(gvc, cp->child.u.tbl, env, obj);
+       emit_html_tbl(job, cp->child.u.tbl, env, obj);
     else if (cp->child.kind == HTML_IMAGE)
-       emit_html_img(gvc, cp->child.u.img, env, obj);
+       emit_html_img(job, cp->child.u.img, env, obj);
     else
-       emit_html_txt(gvc, cp->child.u.txt, env, obj);
+       emit_html_txt(job, cp->child.u.txt, env, obj);
 
     if (cp->data.border)
-       doBorder(gvc, NULL, cp->data.border, pts);
+       doBorder(job, NULL, cp->data.border, pts);
 
     if (cp->data.href)
-       doAnchorEnd(gvc);
+       doAnchorEnd(job);
 
     /* gvrender_end_context(); */
 }
@@ -362,7 +362,7 @@ emit_html_cell(GVC_t * gvc, htmlcell_t * cp, htmlenv_t * env, void *obj)
 /* emit_html_label:
  */
 void
-emit_html_label(GVC_t * gvc, htmllabel_t * lp, textlabel_t * tp, void *obj)
+emit_html_label(GVJ_t * job, htmllabel_t * lp, textlabel_t * tp, void *obj)
 {
     htmlenv_t env;
 
@@ -374,17 +374,17 @@ emit_html_label(GVC_t * gvc, htmllabel_t * lp, textlabel_t * tp, void *obj)
        htmltbl_t *tbl = lp->u.tbl;
 
        /* set basic graphics context */
-       gvrender_begin_context(gvc);
+       gvrender_begin_context(job);
        /* Need to override line style set by node. */
-       gvrender_set_style(gvc, gvc->defaultlinestyle);
+       gvrender_set_style(job, job->gvc->defaultlinestyle);
        if (tbl->data.pencolor)
-           gvrender_set_pencolor(gvc, tbl->data.pencolor);
+           gvrender_set_pencolor(job, tbl->data.pencolor);
        else
-           gvrender_set_pencolor(gvc, DEFAULT_COLOR);
-       emit_html_tbl(gvc, tbl, &env, obj);
-       gvrender_end_context(gvc);
+           gvrender_set_pencolor(job, DEFAULT_COLOR);
+       emit_html_tbl(job, tbl, &env, obj);
+       gvrender_end_context(job);
     } else {
-       emit_html_txt(gvc, lp->u.txt, &env, obj);
+       emit_html_txt(job, lp->u.txt, &env, obj);
     }
 }
 
index 9fba071dbe0feeec0e82aaf7d40f35473363449c..dacf205177f78812df4093da74fbd482ac7c46fb 100644 (file)
@@ -139,7 +139,7 @@ extern "C" {
     extern htmllabel_t *simpleHTML(char *);
 
     extern int make_html_label(textlabel_t * lp, void *obj);
-    extern void emit_html_label(GVC_t * gvc, htmllabel_t * lp,
+    extern void emit_html_label(GVJ_t * job, htmllabel_t * lp,
                                textlabel_t *, void *obj);
 
     extern void free_html_label(htmllabel_t *, int);
index ffabe2efa7c7aa79c5fae81037805ea5d479868f..ccccdc0abd041eaeb820ded979972dc3d88e296f 100644 (file)
@@ -155,14 +155,14 @@ void free_label(textlabel_t * p)
     }
 }
 
-void emit_label(GVC_t * gvc, textlabel_t * lp, void *obj)
+void emit_label(GVJ_t * job, textlabel_t * lp, void *obj)
 {
     int i, linespacing;
     double left_x, center_x, right_x, halfwidth_x;
     pointf p;
 
     if (lp->html) {
-       emit_html_label(gvc, lp->u.html, lp, obj);
+       emit_html_label(job, lp->u.html, lp, obj);
        return;
     }
 
@@ -184,9 +184,9 @@ void emit_label(GVC_t * gvc, textlabel_t * lp, void *obj)
     p.y = lp->p.y + (linespacing * (lp->u.txt.nlines - 1) / 2) /* cl of topline */
        -lp->fontsize / 3.0;    /* cl to baseline */
 
-    gvrender_begin_context(gvc);
-    gvrender_set_pencolor(gvc, lp->fontcolor);
-    gvrender_set_font(gvc, lp->fontname, lp->fontsize);
+    gvrender_begin_context(job);
+    gvrender_set_pencolor(job, lp->fontcolor);
+    gvrender_set_font(job, lp->fontname, lp->fontsize);
 
     for (i = 0; i < lp->u.txt.nlines; i++) {
        switch (lp->u.txt.line[i].just) {
@@ -201,13 +201,13 @@ void emit_label(GVC_t * gvc, textlabel_t * lp, void *obj)
            p.x = center_x;
            break;
        }
-       gvrender_textline(gvc, p, &(lp->u.txt.line[i]));
+       gvrender_textline(job, p, &(lp->u.txt.line[i]));
 
        /* position for next line */
        p.y -= linespacing;
     }
 
-    gvrender_end_context(gvc);
+    gvrender_end_context(job);
 }
 
 
index 11468d69c5cac1aca0eeadf1057c8e15dd3c6414..55da1b32bc884c29e8d29958061c275708f816f9 100644 (file)
@@ -142,7 +142,7 @@ void write_plain_ext(GVC_t * gvc, graph_t * g, FILE * f)
 void write_extended_dot(GVC_t *gvc, graph_t *g, FILE *f)
 {
        attach_attrs(g);
-       extend_attrs(gvc, g, s_arrows, e_arrows);
+       extend_attrs(gvc->job, g, s_arrows, e_arrows);
        agwrite(g, f);
 }
 
index 54068ed09ca2977003359d02518e3df3552682c2..65da8e908db49118f718539776ed614843869290 100644 (file)
@@ -27,7 +27,7 @@ extern "C" {
     extern point add_points(point, point);
     extern pointf add_pointfs(pointf, pointf);
     extern void arrow_flags(Agedge_t * e, int *sflag, int *eflag);
-    extern void arrow_gen(GVC_t * gvc, point p, point u, double scale,
+    extern void arrow_gen(GVJ_t * job, point p, point u, double scale,
                          int flag);
     extern double arrow_length(edge_t * e, int flag);
     extern int arrowEndClip(edge_t*, point*, int, int , bezier*, int eflag);
@@ -70,22 +70,20 @@ extern "C" {
     extern double elapsed_sec(void);
     extern void enqueue(nodequeue *, Agnode_t *);
     extern void enqueue_neighbors(nodequeue *, Agnode_t *, int);
-    extern void emit_attachment(GVC_t * gvc, textlabel_t *, splines *);
-    extern void emit_background(GVC_t * gvc, graph_t *g);
-    extern void emit_clusters(GVC_t * gvc, Agraph_t * g, int flags);
-    extern void emit_edge_graphics(GVC_t * gvc, edge_t * e);
-    extern void emit_graph(GVC_t * gvc, graph_t * g);
-    extern void emit_label(GVC_t * gvc, textlabel_t *, void *obj);
+    extern void emit_background(GVJ_t * job, graph_t *g);
+    extern void emit_clusters(GVJ_t * job, Agraph_t * g, int flags);
+    extern void emit_edge_graphics(GVJ_t * job, edge_t * e);
+    extern void emit_graph(GVJ_t * job, graph_t * g);
+    extern void emit_label(GVJ_t * job, textlabel_t *, void *obj);
     extern int emit_once(char *message);
     extern void emit_jobs(GVC_t * gvc, graph_t *g);
     extern void emit_jobs_eof(GVC_t * gvc);
     extern void endpath(path *, Agedge_t *, int, pathend_t *, boolean);
     extern void epsf_init(node_t * n);
     extern void epsf_free(node_t * n);
-    extern void epsf_gencode(GVC_t * gvc, node_t * n);
     extern point exch_xy(point p);
     extern pointf exch_xyf(pointf p);
-    extern void extend_attrs(GVC_t *, graph_t*, int, int);
+    extern void extend_attrs(GVJ_t * job, graph_t *g, int s_arrows, int e_arrows);
     extern shape_desc *find_user_shape(char *);
     extern box flip_rec_box(box b, point p);
     extern point flip_pt(point p, int rankdir);
index a6cf836aa126ca73a154aa8af408d87671c23ec3..f800b47fc3f470d81ec25074671e9babfea99539 100644 (file)
@@ -53,18 +53,19 @@ static void poly_free(node_t * n);
 static port poly_port(node_t * n, char *portname, char *);
 static boolean poly_inside(inside_t * inside_context, pointf p);
 static int poly_path(node_t* n, port* p, int side, box rv[], int *kptr);
-static void poly_gencode(GVC_t * gvc, node_t * n);
+static void poly_gencode(GVJ_t * job, node_t * n);
 
 static void record_init(node_t * n);
 static void record_free(node_t * n);
 static port record_port(node_t * n, char *portname, char *);
 static boolean record_inside(inside_t * inside_context, pointf p);
 static int record_path(node_t* n, port* p, int side, box rv[], int *kptr);
-static void record_gencode(GVC_t * gvc, node_t * n);
+static void record_gencode(GVJ_t * job, node_t * n);
 
 static void point_init(node_t * n);
 
 static boolean epsf_inside(inside_t * inside_context, pointf p);
+static void epsf_gencode(GVJ_t * job, node_t * n);
 
 /* polygon descriptions.  "polygon" with 0 sides takes all user control */
 
@@ -118,7 +119,7 @@ static polygon_t p_Mcircle =
  * int         SHAPE_path(node *n, edge_t *e, int pt, box path[], int *nbox)
  *                     create a path for the port of e that touches n,
  *                     return side
- * void                SHAPE_gencode(GVC_t *gvc, node_t *n)
+ * void                SHAPE_gencode(GVJ_t *job, node_t *n)
  *                     generate graphics code for a node.
  *
  * some shapes, polygons in particular, use additional shape control data *
@@ -224,13 +225,13 @@ static int same_side(pointf p0, pointf p1, pointf L0, pointf L1)
 }
 
 static
-void pencolor(GVC_t * gvc, node_t * n)
+void pencolor(GVJ_t * job, node_t * n)
 {
     char *color;
 
     color = late_nnstring(n, N_color, "");
     if (color[0])
-       gvrender_set_pencolor(gvc, color);
+       gvrender_set_pencolor(job, color);
 }
 
 static
@@ -256,10 +257,9 @@ char *findFill(node_t * n)
     return color;
 }
 
-static
-void fillcolor(GVC_t * gvc, node_t * n)
+static void fillcolor(GVJ_t * job, node_t * n)
 {
-    gvrender_set_fillcolor(gvc, findFill(n));
+    gvrender_set_fillcolor(job, findFill(n));
 }
 
 static char **checkStyle(node_t * n, int *flagp)
@@ -306,18 +306,17 @@ static char **checkStyle(node_t * n, int *flagp)
     return pstyle;
 }
 
-static
-int stylenode(GVC_t * gvc, node_t * n)
+static int stylenode(GVJ_t * job, node_t * n)
 {
     char **pstyle;
     int istyle;
 
     if ((pstyle = checkStyle(n, &istyle)))
-       gvrender_set_style(gvc, pstyle);
+       gvrender_set_style(job, pstyle);
     return istyle;
 }
 
-static void Mcircle_hack(GVC_t * gvc, node_t * n)
+static void Mcircle_hack(GVJ_t * job, node_t * n)
 {
     double x, y;
     point A[2], p;
@@ -330,10 +329,10 @@ static void Mcircle_hack(GVC_t * gvc, node_t * n)
     A[0] = add_points(p, ND_coord_i(n));
     A[1].y = A[0].y;
     A[1].x = A[0].x - 2 * p.x;
-    gvrender_polyline(gvc, A, 2);
+    gvrender_polyline(job, A, 2);
     A[0].y -= 2 * p.y;
     A[1].y = A[0].y;
-    gvrender_polyline(gvc, A, 2);
+    gvrender_polyline(job, A, 2);
 }
 
 static point interpolate(double t, point p0, point p1)
@@ -344,7 +343,7 @@ static point interpolate(double t, point p0, point p1)
     return rv;
 }
 
-static void round_corners(GVC_t * gvc, node_t * n, point * A, int sides,
+static void round_corners(GVJ_t * job, node_t * n, point * A, int sides,
                          int style)
 {
     point *B, C[2], p0, p1;
@@ -387,45 +386,45 @@ static void round_corners(GVC_t * gvc, node_t * n, point * A, int sides,
            int j = 0;
            char* fillc = findFill(n);
            point* pts = N_GNEW(2*sides,point);
-           gvrender_begin_context(gvc);
-           gvrender_set_pencolor (gvc, fillc);
-           gvrender_set_fillcolor (gvc, fillc);
+           gvrender_begin_context(job);
+           gvrender_set_pencolor (job, fillc);
+           gvrender_set_fillcolor (job, fillc);
            for (seg = 0; seg < sides; seg++) {
                pts[j++] = B[4 * seg + 1];
                pts[j++] = B[4 * seg + 2];
            }
-           gvrender_polygon(gvc, pts, 2*sides, TRUE);
+           gvrender_polygon(job, pts, 2*sides, TRUE);
            free (pts);
            for (seg = 0; seg < sides; seg++) {
                for (i = 0; i < 4; i++)
                    P2PF(B[4 * seg + 2 + i], BF[i]);
-               gvrender_beziercurve(gvc, BF, 4, FALSE, FALSE, TRUE);
+               gvrender_beziercurve(job, BF, 4, FALSE, FALSE, TRUE);
            }
-           gvrender_end_context(gvc);
+           gvrender_end_context(job);
        }
-       pencolor(gvc, n);
+       pencolor(job, n);
        for (seg = 0; seg < sides; seg++) {
-           gvrender_polyline(gvc, B + 4 * seg + 1, 2);
+           gvrender_polyline(job, B + 4 * seg + 1, 2);
 
            /* convert to floats for gvrender api */
            for (i = 0; i < 4; i++)
                P2PF(B[4 * seg + 2 + i], BF[i]);
-           gvrender_beziercurve(gvc, BF, 4, FALSE, FALSE, FALSE);
+           gvrender_beziercurve(job, BF, 4, FALSE, FALSE, FALSE);
        }
     } else {                   /* diagonals are weird.  rewrite someday. */
-       pencolor(gvc, n);
+       pencolor(job, n);
        if (style & FILLED)
-           fillcolor(gvc, n);  /* emit fill color */
-       gvrender_polygon(gvc, A, sides, style & FILLED);
+           fillcolor(job, n);  /* emit fill color */
+       gvrender_polygon(job, A, sides, style & FILLED);
        for (seg = 0; seg < sides; seg++) {
 #ifdef NOTDEF
            C[0] = B[3 * seg];
            C[1] = B[3 * seg + 3];
-           gvrender_polyline(gvc, C, 2);
+           gvrender_polyline(job, C, 2);
 #endif
            C[0] = B[3 * seg + 2];
            C[1] = B[3 * seg + 4];
-           gvrender_polyline(gvc, C, 2);
+           gvrender_polyline(job, C, 2);
        }
     }
     free(B);
@@ -1175,7 +1174,7 @@ static port poly_port(node_t * n, char *portname, char *compass)
 }
 
 /* generic polygon gencode routine */
-static void poly_gencode(GVC_t * gvc, node_t * n)
+static void poly_gencode(GVJ_t * job, node_t * n)
 {
     polygon_t *poly;
     double xsize, ysize;
@@ -1203,7 +1202,7 @@ static void poly_gencode(GVC_t * gvc, node_t * n)
 
 #if !defined(DISABLE_CODEGENS) && defined(HAVE_GD_PNG)
     /* this is bad, but it's because of how the VRML driver works */
-    if ((gvc->job->codegen == &VRML_CodeGen) && (peripheries == 0)) {
+    if ((job->codegen == &VRML_CodeGen) && (peripheries == 0)) {
        peripheries = 1;
     }
 #endif
@@ -1211,20 +1210,20 @@ static void poly_gencode(GVC_t * gvc, node_t * n)
     if (ND_shape(n) == point_desc) {
        checkStyle(n, &style);
        if (style & INVISIBLE)
-           gvrender_set_style(gvc, point_style);
+           gvrender_set_style(job, point_style);
        else
-           gvrender_set_style(gvc, &point_style[1]);
+           gvrender_set_style(job, &point_style[1]);
        style = FILLED;
     } else {
-       style = stylenode(gvc, n);
+       style = stylenode(job, n);
     }
     if (style & FILLED) {
-       fillcolor(gvc, n);      /* emit fill color */
+       fillcolor(job, n);      /* emit fill color */
        filled = 1;
     } else {
        filled = 0;
     }
-    pencolor(gvc, n);          /* emit pen color */
+    pencolor(job, n);          /* emit pen color */
 
     if (ND_shape(n)->usershape) {
        for (i = 0; i < sides; i++) {
@@ -1239,7 +1238,7 @@ static void poly_gencode(GVC_t * gvc, node_t * n)
                A[i].y += ND_coord_i(n).y;
            }
        }
-       gvrender_user_shape(gvc, ND_shape(n)->name, A, sides, filled);
+       gvrender_user_shape(job, ND_shape(n)->name, A, sides, filled);
        filled = 0;
     }
     /* if no boundary but filled, set boundary color to fill color */
@@ -1248,7 +1247,7 @@ static void poly_gencode(GVC_t * gvc, node_t * n)
        peripheries = 1;
        color = findFill(n);
        if (color[0])
-           gvrender_set_pencolor(gvc, color);
+           gvrender_set_pencolor(job, color);
     }
     for (j = 0; j < peripheries; j++) {
        for (i = 0; i < sides; i++) {
@@ -1264,21 +1263,21 @@ static void poly_gencode(GVC_t * gvc, node_t * n)
            }
        }
        if (sides <= 2) {
-           gvrender_ellipse(gvc, ND_coord_i(n), A[0].x, A[0].y, filled);
+           gvrender_ellipse(job, ND_coord_i(n), A[0].x, A[0].y, filled);
            if (style & DIAGONALS) {
-               Mcircle_hack(gvc, n);
+               Mcircle_hack(job, n);
            }
        } else if (style & (ROUNDED | DIAGONALS)) {
-           round_corners(gvc, n, A, sides, style);
+           round_corners(job, n, A, sides, style);
        } else {
-           gvrender_polygon(gvc, A, sides, filled);
+           gvrender_polygon(job, A, sides, filled);
        }
        /* fill innermost periphery only */
        filled = 0;
     }
 
     xdemitState = EMIT_LABEL;
-    emit_label(gvc, ND_label(n), (void *) n);
+    emit_label(job, ND_label(n), (void *) n);
 }
 
 /*=======================end poly======================================*/
@@ -1772,7 +1771,7 @@ static int record_path(node_t* n, port* prt, int side, box rv[], int *kptr)
     return side;
 }
 
-static void gen_fields(GVC_t * gvc, node_t * n, field_t * f)
+static void gen_fields(GVJ_t * job, node_t * n, field_t * f)
 {
     int i;
     double cx, cy;
@@ -1782,7 +1781,7 @@ static void gen_fields(GVC_t * gvc, node_t * n, field_t * f)
        cx = (f->b.LL.x + f->b.UR.x) / 2.0 + ND_coord_i(n).x;
        cy = (f->b.LL.y + f->b.UR.y) / 2.0 + ND_coord_i(n).y;
        f->lp->p = pointof((int) cx, (int) cy);
-       emit_label(gvc, f->lp, (void *) n);
+       emit_label(job, f->lp, (void *) n);
     }
 
     for (i = 0; i < f->n_flds; i++) {
@@ -1798,13 +1797,13 @@ static void gen_fields(GVC_t * gvc, node_t * n, field_t * f)
            }
            A[0] = add_points(A[0], ND_coord_i(n));
            A[1] = add_points(A[1], ND_coord_i(n));
-           gvrender_polyline(gvc, A, 2);
+           gvrender_polyline(job, A, 2);
        }
-       gen_fields(gvc, n, f->fld[i]);
+       gen_fields(job, n, f->fld[i]);
     }
 }
 
-static void record_gencode(GVC_t * gvc, node_t * n)
+static void record_gencode(GVJ_t * job, node_t * n)
 {
     point A[4];
     int i, style;
@@ -1821,18 +1820,18 @@ static void record_gencode(GVC_t * gvc, node_t * n)
     A[3].y = A[2].y;
     for (i = 0; i < 4; i++)
        A[i] = add_points(A[i], ND_coord_i(n));
-    style = stylenode(gvc, n);
-    pencolor(gvc, n);
+    style = stylenode(job, n);
+    pencolor(job, n);
     if (style & FILLED)
-       fillcolor(gvc, n);      /* emit fill color */
+       fillcolor(job, n);      /* emit fill color */
     if (streq(ND_shape(n)->name, "Mrecord"))
        style |= ROUNDED;
     if (style & (ROUNDED | DIAGONALS))
-       round_corners(gvc, n, A, 4, ROUNDED);
+       round_corners(job, n, A, 4, ROUNDED);
     else
-       gvrender_polygon(gvc, A, 4, style & FILLED);
+       gvrender_polygon(job, A, 4, style & FILLED);
     xdemitState = EMIT_LABEL;
-    gen_fields(gvc, n, f);
+    gen_fields(job, n, f);
 }
 
 static shape_desc **UserShape;
@@ -1903,20 +1902,20 @@ static boolean epsf_inside(inside_t * inside_context, pointf p)
            && (P.x <= ND_rw_i(n)));
 }
 
-void epsf_gencode(GVC_t * gvc, node_t * n)
+static void epsf_gencode(GVJ_t * job, node_t * n)
 {
     epsf_t *desc;
 
     desc = (epsf_t *) (ND_shape_info(n));
     if (!desc)
        return;
-    gvrender_begin_context(gvc);
+    gvrender_begin_context(job);
     if (desc)
-       fprintf(gvc->job->output_file,
+       fprintf(job->output_file,
                "%d %d translate newpath user_shape_%d\n",
                ND_coord_i(n).x + desc->offset.x,
                ND_coord_i(n).y + desc->offset.y, desc->macro_id);
     ND_label(n)->p = ND_coord_i(n);
-    gvrender_end_context(gvc);
-    emit_label(gvc, ND_label(n), (void *) n);
+    gvrender_end_context(job);
+    emit_label(job, ND_label(n), (void *) n);
 }
index 14eaa0c392700643c11bc75dcc44cbe17c9325f7..fd0515f1d0c9d916603dba29cbb4e3b44fce2e25 100644 (file)
@@ -34,6 +34,7 @@ extern "C" {
     typedef struct Agsym_t attrsym_t;
 
     typedef struct GVC_s GVC_t;
+    typedef struct GVJ_s GVJ_t;
     typedef struct gvrender_engine_s gvrender_engine_t;
     typedef struct gvlayout_engine_s gvlayout_engine_t;
     typedef struct gvdisplay_engine_s gvdisplay_engine_t;
@@ -186,7 +187,7 @@ extern "C" {
         port(*portfn) (node_t *, char *, char *);      /* finds aiming point and slope of port */
         boolean(*insidefn) (inside_t * inside_context, pointf);        /* clips incident gvc->e spline on shape of gvc->n */
        int (*pboxfn)(node_t* n, port* p, int side, box rv[], int *kptr); /* finds box path to reach port */
-       void (*codefn) (GVC_t * gvc, node_t * n);       /* emits graphics code for node */
+       void (*codefn) (GVJ_t * job, node_t * n);       /* emits graphics code for node */
     } shape_functions;
 
     typedef enum { SH_UNSET, SH_POLY, SH_RECORD, SH_POINT, SH_EPSF,
index 6fc85f98e2ee248ca24939f17b5fe92e9a1fba5c..37641a5a813f8fcd034b5b4bcbfb1379bca58f78 100644 (file)
@@ -63,7 +63,7 @@ static int isInvis(char *style)
  * these would be the arrow/label positions to use if a user want to flip the 
  * direction of an edge (as sometimes is there want).
  */
-void extend_attrs(GVC_t * gvc, graph_t *g, int s_arrows, int e_arrows)
+void extend_attrs(GVJ_t * job, graph_t *g, int s_arrows, int e_arrows)
 {
     node_t *n;
     edge_t *e;
@@ -111,7 +111,7 @@ void extend_attrs(GVC_t * gvc, graph_t *g, int s_arrows, int e_arrows)
 
     for (n = agfstnode(g); n; n = agnxtnode(g, n)) {
        if (ND_shape(n) && !isInvis(late_string(n, N_style, ""))) {
-           ND_shape(n)->fns->codefn(gvc, n);
+           ND_shape(n)->fns->codefn(job, n);
            agxset(n, n_draw->index, agxbuse(xbufs[EMIT_DRAW]));
            agxset(n, n_l_draw->index, agxbuse(xbufs[EMIT_LABEL]));
        }
@@ -125,7 +125,7 @@ void extend_attrs(GVC_t * gvc, graph_t *g, int s_arrows, int e_arrows)
            if (ED_spl(e) == NULL)
                continue;
 
-           emit_edge_graphics (gvc, e);
+           emit_edge_graphics (job, e);
            agxset(e, e_draw->index, agxbuse(xbufs[EMIT_DRAW]));
            if (t_draw) agxset(e, t_draw->index, agxbuse(xbufs[EMIT_TDRAW]));
            if (h_draw) agxset(e, h_draw->index, agxbuse(xbufs[EMIT_HDRAW]));
@@ -136,7 +136,7 @@ void extend_attrs(GVC_t * gvc, graph_t *g, int s_arrows, int e_arrows)
     }
   
     xdemitState = EMIT_DRAW;
-    emit_background(gvc, g);
+    emit_background(job, g);
     if (agxblen(xbufs[EMIT_DRAW])) {
        if (!g_draw)
            g_draw = safe_dcl(g, g, "_draw_", "", agraphattr);
@@ -144,10 +144,10 @@ void extend_attrs(GVC_t * gvc, graph_t *g, int s_arrows, int e_arrows)
     }
     xdemitState = EMIT_LABEL;
     if (GD_label(g)) {
-       emit_label(gvc, GD_label(g), (void *) g);
+       emit_label(job, GD_label(g), (void *) g);
        agxset(g, g_l_draw->index, agxbuse(xbufs[EMIT_LABEL]));
     }
-    emit_clusters(gvc, g, 0);
+    emit_clusters(job, g, 0);
     agxbfree(&xbuf0);
     agxbfree(&xbuf1);
     agxbfree(&xbuf2);
@@ -257,7 +257,7 @@ xd_set_fillcolor (char *name)
 static void 
 xd_set_style (char **s)
 {
-    char buf[BUFSIZ];
+    unsigned char buf[BUFSIZ];
     agxbuf xbuf;
     char* p;
     int more;
index 7af061bf4c9c9c0bbb50026e3702fc75304c250b..db1d9f9115c68bcedc03212fe2619bfc3598f823 100644 (file)
@@ -51,8 +51,8 @@ extern "C" {
 
     extern void gvrender_output_filename_job(GVC_t * gvc, char *name);
     extern boolean gvrender_output_langname_job(GVC_t * gvc, char *name);
-    extern gvrender_job_t *gvrender_first_job(GVC_t * gvc);
-    extern gvrender_job_t *gvrender_next_job(GVC_t * gvc);
+    extern GVJ_t *gvrender_first_job(GVC_t * gvc);
+    extern GVJ_t *gvrender_next_job(GVC_t * gvc);
     extern void gvrender_delete_jobs(GVC_t * gvc);
 
 /* emit */
@@ -67,48 +67,49 @@ extern "C" {
 
 /* render */
 
-    extern int gvrender_select(GVC_t * gvc, char *lang);
-    extern int gvrender_features(GVC_t * gvc);
     extern void gvrender_initialize(GVC_t * gvc);
     extern void gvrender_finalize(GVC_t * gvc);
-    extern void gvrender_begin_job(GVC_t * gvc);
-    extern void gvrender_end_job(GVC_t * gvc);
-    extern void gvrender_begin_graph(GVC_t * gvc, graph_t * g);
-    extern void gvrender_end_graph(GVC_t * gvc);
-    extern void gvrender_begin_page(GVC_t * gvc);
-    extern void gvrender_end_page(GVC_t * gvc);
-    extern void gvrender_begin_layer(GVC_t * gvc);
-    extern void gvrender_end_layer(GVC_t * gvc);
-    extern void gvrender_begin_cluster(GVC_t * gvc, graph_t * sg);
-    extern void gvrender_end_cluster(GVC_t * gvc);
-    extern void gvrender_begin_nodes(GVC_t * gvc);
-    extern void gvrender_end_nodes(GVC_t * gvc);
-    extern void gvrender_begin_edges(GVC_t * gvc);
-    extern void gvrender_end_edges(GVC_t * gvc);
-    extern void gvrender_begin_node(GVC_t * gvc, node_t * n);
-    extern void gvrender_end_node(GVC_t * gvc);
-    extern void gvrender_begin_edge(GVC_t * gvc, edge_t * e);
-    extern void gvrender_end_edge(GVC_t * gvc);
-    extern void gvrender_begin_context(GVC_t * gvc);
-    extern void gvrender_end_context(GVC_t * gvc);
-    extern void gvrender_begin_anchor(GVC_t * gvc, char *href,
+
+    extern void gvrender_begin_job(GVJ_t * job);
+    extern void gvrender_end_job(GVJ_t * job);
+    extern int gvrender_select(GVJ_t * job, char *lang);
+    extern int gvrender_features(GVJ_t * job);
+    extern void gvrender_begin_graph(GVJ_t * job, graph_t * g);
+    extern void gvrender_end_graph(GVJ_t * job);
+    extern void gvrender_begin_page(GVJ_t * job);
+    extern void gvrender_end_page(GVJ_t * job);
+    extern void gvrender_begin_layer(GVJ_t * job);
+    extern void gvrender_end_layer(GVJ_t * job);
+    extern void gvrender_begin_cluster(GVJ_t * job, graph_t * sg);
+    extern void gvrender_end_cluster(GVJ_t * job);
+    extern void gvrender_begin_nodes(GVJ_t * job);
+    extern void gvrender_end_nodes(GVJ_t * job);
+    extern void gvrender_begin_edges(GVJ_t * job);
+    extern void gvrender_end_edges(GVJ_t * job);
+    extern void gvrender_begin_node(GVJ_t * job, node_t * n);
+    extern void gvrender_end_node(GVJ_t * job);
+    extern void gvrender_begin_edge(GVJ_t * job, edge_t * e);
+    extern void gvrender_end_edge(GVJ_t * job);
+    extern void gvrender_begin_context(GVJ_t * job);
+    extern void gvrender_end_context(GVJ_t * job);
+    extern void gvrender_begin_anchor(GVJ_t * job, char *href,
                                      char *tooltip, char *target);
-    extern void gvrender_end_anchor(GVC_t * gvc);
-    extern void gvrender_set_font(GVC_t * gvc, char *fontname,
+    extern void gvrender_end_anchor(GVJ_t * job);
+    extern void gvrender_set_font(GVJ_t * job, char *fontname,
                                  double fontsize);
-    extern void gvrender_textline(GVC_t * gvc, pointf p, textline_t * str);
-    extern void gvrender_set_pencolor(GVC_t * gvc, char *name);
-    extern void gvrender_set_fillcolor(GVC_t * gvc, char *name);
-    extern void gvrender_set_style(GVC_t * gvc, char **s);
-    extern void gvrender_ellipse(GVC_t * gvc, point p, int rx, int ry,
+    extern void gvrender_textline(GVJ_t * job, pointf p, textline_t * str);
+    extern void gvrender_set_pencolor(GVJ_t * job, char *name);
+    extern void gvrender_set_fillcolor(GVJ_t * job, char *name);
+    extern void gvrender_set_style(GVJ_t * job, char **s);
+    extern void gvrender_ellipse(GVJ_t * job, point p, int rx, int ry,
                                 int filled);
-    extern void gvrender_polygon(GVC_t * gvc, point * A, int n,
+    extern void gvrender_polygon(GVJ_t * job, point * A, int n,
                                 int filled);
-    extern void gvrender_beziercurve(GVC_t * gvc, pointf * AF, int n,
+    extern void gvrender_beziercurve(GVJ_t * job, pointf * AF, int n,
                                     int arrow_at_start, int arrow_at_end, int);
-    extern void gvrender_polyline(GVC_t * gvc, point * A, int n);
-    extern void gvrender_comment(GVC_t * gvc, char *str);
-    extern void gvrender_user_shape(GVC_t * gvc, char *name, point * A,
+    extern void gvrender_polyline(GVJ_t * job, point * A, int n);
+    extern void gvrender_comment(GVJ_t * job, char *str);
+    extern void gvrender_user_shape(GVJ_t * job, char *name, point * A,
                                    int sides, int filled);
 
 /* layout */
index a787424abe332cf14daa3914c2dae47ee4ea78cb..2108a277cf952adecd5b1c6689a21bdd8536ebc0 100644 (file)
@@ -66,11 +66,9 @@ extern "C" {
        color_type_t color_type;
     } gvrender_features_t;
 
-    typedef struct gvrender_job_s gvrender_job_t;
-
-    struct gvrender_job_s {
-       gvrender_job_t *next;  /* linked list of jobs */
-       gvrender_job_t *next_active;   /* linked list of active jobs (e.g. multiple windows) */
+    struct GVJ_s {
+       GVJ_t *next;  /* linked list of jobs */
+       GVJ_t *next_active;   /* linked list of active jobs (e.g. multiple windows) */
        char *output_filename;
        char *output_langname;
        FILE *output_file;
@@ -135,7 +133,7 @@ extern "C" {
        gvplugin_type_t *typeptr;
     };
 
-    typedef int (*gvevent_key_callback_t) (gvrender_job_t * job);
+    typedef int (*gvevent_key_callback_t) (GVJ_t * job);
 
     typedef struct gvevent_key_binding_s {
        char *keystring;
@@ -150,8 +148,8 @@ extern "C" {
        char **info;
 
        /* gvrender_config() */
-       gvrender_job_t *jobs;   /* linked list of jobs */
-       gvrender_job_t *job;    /* current job */
+       GVJ_t *jobs;    /* linked list of jobs */
+       GVJ_t *job;     /* current job */
        void (*errorfn) (char *fmt, ...);
 
        /* plugins */
@@ -171,7 +169,7 @@ extern "C" {
        gvlayout_engine_t *layout_engine;       /* current layout engine */
        int layout_id;          /* internal id of current layout */
        char *graphname;        /* name from graph */
-       gvrender_job_t *active_jobs;   /* linked list of active jobs */
+       GVJ_t *active_jobs;   /* linked list of active jobs */
 
        char **lib;
 
index ba0eee9660c5e45af8bc684c6031e8908de683a3..7cdccefeb561c3089ce81670665b4d7bd5b42ae2 100644 (file)
 #define ZOOMFACTOR 1.1
 #define EPSILON .0001
 
-void gvevent_refresh(gvrender_job_t * job)
+void gvevent_refresh(GVJ_t * job)
 {
-    emit_graph(job->gvc, job->g);
+    emit_graph(job, job->g);
 }
 
-void gvevent_button_press(gvrender_job_t * job, int button, double x, double y)
+void gvevent_button_press(GVJ_t * job, int button, double x, double y)
 {
     switch (button) {
     case 1: /* select / create in edit mode */
@@ -71,7 +71,7 @@ void gvevent_button_press(gvrender_job_t * job, int button, double x, double y)
     job->oldy = y;
 }
 
-void gvevent_motion(gvrender_job_t * job, double x, double y)
+void gvevent_motion(GVJ_t * job, double x, double y)
 {
     double dx = x - job->oldx;
     double dy = y - job->oldy;
@@ -98,18 +98,18 @@ void gvevent_motion(gvrender_job_t * job, double x, double y)
     job->oldy = y;
 }
 
-void gvevent_button_release(gvrender_job_t *job, int button, double x, double y)
+void gvevent_button_release(GVJ_t *job, int button, double x, double y)
 {
     job->click = 0;
     job->active = 0;
 }
 
-static int quit_cb(gvrender_job_t * job)
+static int quit_cb(GVJ_t * job)
 {
     return 1;
 }
 
-static int left_cb(gvrender_job_t * job)
+static int left_cb(GVJ_t * job)
 {
     job->fit_mode = 0;
     job->focus.x += PANFACTOR / job->zoom;
@@ -117,7 +117,7 @@ static int left_cb(gvrender_job_t * job)
     return 0;
 }
 
-static int right_cb(gvrender_job_t * job)
+static int right_cb(GVJ_t * job)
 {
     job->fit_mode = 0;
     job->focus.x -= PANFACTOR / job->zoom;
@@ -125,7 +125,7 @@ static int right_cb(gvrender_job_t * job)
     return 0;
 }
 
-static int up_cb(gvrender_job_t * job)
+static int up_cb(GVJ_t * job)
 {
     job->fit_mode = 0;
     job->focus.y += -(PANFACTOR / job->zoom);
@@ -133,7 +133,7 @@ static int up_cb(gvrender_job_t * job)
     return 0;
 }
 
-static int down_cb(gvrender_job_t * job)
+static int down_cb(GVJ_t * job)
 {
     job->fit_mode = 0;
     job->focus.y -= -(PANFACTOR / job->zoom);
@@ -141,7 +141,7 @@ static int down_cb(gvrender_job_t * job)
     return 0;
 }
 
-static int zoom_in_cb(gvrender_job_t * job)
+static int zoom_in_cb(GVJ_t * job)
 {
     job->fit_mode = 0;
     job->zoom *= ZOOMFACTOR;
@@ -149,7 +149,7 @@ static int zoom_in_cb(gvrender_job_t * job)
     return 0;
 }
 
-static int zoom_out_cb(gvrender_job_t * job)
+static int zoom_out_cb(GVJ_t * job)
 {
     job->fit_mode = 0;
     job->zoom /= ZOOMFACTOR;
@@ -157,7 +157,7 @@ static int zoom_out_cb(gvrender_job_t * job)
     return 0;
 }
 
-static int toggle_fit_cb(gvrender_job_t * job)
+static int toggle_fit_cb(GVJ_t * job)
 {
     job->fit_mode = !job->fit_mode;
     if (job->fit_mode) {
index e3f2f3a30bf0f60010d3a9acdd35ce5f2197cf3b..631c3b85314ff3cab98970f3917cc27e71e6d0c7 100644 (file)
@@ -27,8 +27,8 @@
 /* from common/utils.c */
 extern void *zmalloc(size_t);
 
-static gvrender_job_t *output_filename_job;
-static gvrender_job_t *output_langname_job;
+static GVJ_t *output_filename_job;
+static GVJ_t *output_langname_job;
 
 /*
  * -T and -o can be specified in any order relative to the other, e.g.
@@ -53,14 +53,14 @@ void gvrender_output_filename_job(GVC_t * gvc, char *name)
 {
     if (!gvc->jobs) {
        output_filename_job = gvc->job = gvc->jobs =
-           zmalloc(sizeof(gvrender_job_t));
+           zmalloc(sizeof(GVJ_t));
     } else {
        if (!output_filename_job) {
            output_filename_job = gvc->jobs;
        } else {
            if (!output_filename_job->next) {
                output_filename_job->next =
-                   zmalloc(sizeof(gvrender_job_t));
+                   zmalloc(sizeof(GVJ_t));
            }
            output_filename_job = output_filename_job->next;
        }
@@ -73,14 +73,14 @@ boolean gvrender_output_langname_job(GVC_t * gvc, char *name)
 {
     if (!gvc->jobs) {
        output_langname_job = gvc->job = gvc->jobs =
-           zmalloc(sizeof(gvrender_job_t));
+           zmalloc(sizeof(GVJ_t));
     } else {
        if (!output_langname_job) {
            output_langname_job = gvc->jobs;
        } else {
            if (!output_langname_job->next) {
                output_langname_job->next =
-                   zmalloc(sizeof(gvrender_job_t));
+                   zmalloc(sizeof(GVJ_t));
            }
            output_langname_job = output_langname_job->next;
        }
@@ -100,14 +100,14 @@ void gvrender_output_option_job(GVC_t * gvc, char *name, char *value)
 }
 #endif
 
-gvrender_job_t *gvrender_first_job(GVC_t * gvc)
+GVJ_t *gvrender_first_job(GVC_t * gvc)
 {
     return (gvc->job = gvc->jobs);
 }
 
-gvrender_job_t *gvrender_next_job(GVC_t * gvc)
+GVJ_t *gvrender_next_job(GVC_t * gvc)
 {
-    gvrender_job_t *job = gvc->job->next;
+    GVJ_t *job = gvc->job->next;
 
     if (job) {
        /* if langname not specified, then repeat previous value */
@@ -120,7 +120,7 @@ gvrender_job_t *gvrender_next_job(GVC_t * gvc)
 
 void gvrender_delete_jobs(GVC_t * gvc)
 {
-    gvrender_job_t *job, *j;
+    GVJ_t *job, *j;
 
     job = gvc->jobs;
     while ((j = job)) {
index e2e73024525b30285b93484ea897fdecc26e8ac6..894eb9e434895c836323d7c0d1143118aafde92f 100644 (file)
@@ -27,46 +27,46 @@ extern "C" {
     struct gvrender_engine_s {
        void (*initialize) (GVC_t * gvc, gvevent_key_binding_t *keys, int numkeys);
        void (*finalize) (GVC_t * gvc);
-       void (*begin_job) (gvrender_job_t * job);
-       void (*end_job) (gvrender_job_t * job);
-       void (*begin_graph) (gvrender_job_t * job, char *graphname);
-       void (*end_graph) (gvrender_job_t * job);
-       void (*begin_layer) (gvrender_job_t * job, char *layername,
+       void (*begin_job) (GVJ_t * job);
+       void (*end_job) (GVJ_t * job);
+       void (*begin_graph) (GVJ_t * job, char *graphname);
+       void (*end_graph) (GVJ_t * job);
+       void (*begin_layer) (GVJ_t * job, char *layername,
                             int layerNum, int numLayers);
-       void (*end_layer) (gvrender_job_t * job);
-       void (*begin_page) (gvrender_job_t * job);
-       void (*end_page) (gvrender_job_t * job);
-       void (*begin_cluster) (gvrender_job_t * job, char *clustername, long id);
-       void (*end_cluster) (gvrender_job_t * job);
-       void (*begin_nodes) (gvrender_job_t * job);
-       void (*end_nodes) (gvrender_job_t * job);
-       void (*begin_edges) (gvrender_job_t * job);
-       void (*end_edges) (gvrender_job_t * job);
-       void (*begin_node) (gvrender_job_t * job, char *nodename, long id);
-       void (*end_node) (gvrender_job_t * job);
-       void (*begin_edge) (gvrender_job_t * job, char *tailname, boolean directed,
+       void (*end_layer) (GVJ_t * job);
+       void (*begin_page) (GVJ_t * job);
+       void (*end_page) (GVJ_t * job);
+       void (*begin_cluster) (GVJ_t * job, char *clustername, long id);
+       void (*end_cluster) (GVJ_t * job);
+       void (*begin_nodes) (GVJ_t * job);
+       void (*end_nodes) (GVJ_t * job);
+       void (*begin_edges) (GVJ_t * job);
+       void (*end_edges) (GVJ_t * job);
+       void (*begin_node) (GVJ_t * job, char *nodename, long id);
+       void (*end_node) (GVJ_t * job);
+       void (*begin_edge) (GVJ_t * job, char *tailname, boolean directed,
                            char *headname, long id);
-       void (*end_edge) (gvrender_job_t * job);
-       void (*begin_anchor) (gvrender_job_t * job, char *href, char *tooltip,
+       void (*end_edge) (GVJ_t * job);
+       void (*begin_anchor) (GVJ_t * job, char *href, char *tooltip,
                              char *target);
-       void (*end_anchor) (gvrender_job_t * job);
-       void (*textline) (gvrender_job_t * job, pointf p, textline_t * str);
-       void (*resolve_color) (gvrender_job_t * job, color_t * color);
-       void (*ellipse) (gvrender_job_t * job, pointf * A, int filled);
-       void (*polygon) (gvrender_job_t * job, pointf * A, int n, int filled);
-       void (*beziercurve) (gvrender_job_t * job, pointf * A, int n,
+       void (*end_anchor) (GVJ_t * job);
+       void (*textline) (GVJ_t * job, pointf p, textline_t * str);
+       void (*resolve_color) (GVJ_t * job, color_t * color);
+       void (*ellipse) (GVJ_t * job, pointf * A, int filled);
+       void (*polygon) (GVJ_t * job, pointf * A, int n, int filled);
+       void (*beziercurve) (GVJ_t * job, pointf * A, int n,
                             int arrow_at_start, int arrow_at_end, int);
-       void (*polyline) (gvrender_job_t * job, pointf * A, int n);
-       void (*comment) (gvrender_job_t * job, char *comment);
-       void (*user_shape) (gvrender_job_t * job, char *name, pointf * A, int sides,
+       void (*polyline) (GVJ_t * job, pointf * A, int n);
+       void (*comment) (GVJ_t * job, char *comment);
+       void (*user_shape) (GVJ_t * job, char *name, pointf * A, int sides,
                            int filled);
     };
 
 /* callbacks */
-    extern void gvevent_refresh(gvrender_job_t * job);
-    extern void gvevent_button_press(gvrender_job_t * job, int button, double x, double y);
-    extern void gvevent_button_release(gvrender_job_t * job, int button, double x, double y);
-    extern void gvevent_motion(gvrender_job_t * job, double x, double y);
+    extern void gvevent_refresh(GVJ_t * job);
+    extern void gvevent_button_press(GVJ_t * job, int button, double x, double y);
+    extern void gvevent_button_release(GVJ_t * job, int button, double x, double y);
+    extern void gvevent_motion(GVJ_t * job, double x, double y);
 
 #ifdef __cplusplus
 }
index dca8ef18317a49c75dd4c91dd7a1160dbc8f6af0..c0be6736115752acb07ce9e95706dc7bbb8b241d 100644 (file)
@@ -48,9 +48,9 @@ extern void colorxlate(char *str, color_t * color,
                       color_type_t target_type);
 extern char *canontoken(char *str);
 
-int gvrender_select(GVC_t * gvc, char *str)
+int gvrender_select(GVJ_t * job, char *str)
 {
-    gvrender_job_t *job = gvc->job;
+    GVC_t *gvc = job->gvc;
     gv_plugin_t *plugin;
     gvplugin_type_t *typeptr;
 #ifndef DISABLE_CODEGENS
@@ -79,9 +79,8 @@ int gvrender_select(GVC_t * gvc, char *str)
     return NO_SUPPORT;
 }
 
-int gvrender_features(GVC_t * gvc)
+int gvrender_features(GVJ_t * job)
 {
-    gvrender_job_t *job = gvc->job;
     gvrender_engine_t *gvre = job->render_engine;
     int features = 0;
 
@@ -111,7 +110,7 @@ extern int gvevent_key_binding_size;
 
 void gvrender_initialize(GVC_t * gvc)
 {
-    gvrender_job_t *job = gvc->job;
+    GVJ_t *job = gvc->job;
     gvrender_engine_t *gvre = job->render_engine;
 
     if (gvre) {
@@ -133,7 +132,7 @@ void gvrender_initialize(GVC_t * gvc)
 
 void gvrender_finalize(GVC_t * gvc)
 {
-    gvrender_job_t *job = gvc->job;
+    GVJ_t *job = gvc->job;
     gvrender_engine_t *gvre = job->render_engine;
 
     if (gvre) {
@@ -150,9 +149,8 @@ void gvrender_finalize(GVC_t * gvc)
 #endif
 }
 
-void gvrender_begin_job(GVC_t * gvc)
+void gvrender_begin_job(GVJ_t * job)
 {
-    gvrender_job_t *job = gvc->job;
     gvrender_engine_t *gvre = job->render_engine;
 
     if (gvre) {
@@ -164,15 +162,14 @@ void gvrender_begin_job(GVC_t * gvc)
        codegen_t *cg = job->codegen;
 
        if (cg && cg->begin_job)
-           cg->begin_job(job->output_file, job->g, gvc->lib, gvc->user,
-                         gvc->info, job->pagesArraySize);
+           cg->begin_job(job->output_file, job->g, job->gvc->lib, job->gvc->user,
+                         job->gvc->info, job->pagesArraySize);
     }
 #endif
 }
 
-void gvrender_end_job(GVC_t * gvc)
+void gvrender_end_job(GVJ_t * job)
 {
-    gvrender_job_t *job = gvc->job;
     gvrender_engine_t *gvre = job->render_engine;
 
     if (gvre && gvre->end_job)
@@ -185,7 +182,7 @@ void gvrender_end_job(GVC_t * gvc)
            cg->end_job();
     }
 #endif
-    gvc->lib = NULL;
+    job->gvc->lib = NULL;
 }
 
 /* font modifiers */
@@ -193,7 +190,7 @@ void gvrender_end_job(GVC_t * gvc)
 #define BOLD    1
 #define ITALIC  2
 
-static pointf gvrender_ptf(gvrender_job_t *job, pointf p)
+static pointf gvrender_ptf(GVJ_t *job, pointf p)
 {
     pointf rv;
 
@@ -207,7 +204,7 @@ static pointf gvrender_ptf(gvrender_job_t *job, pointf p)
     return rv;
 }
 
-static pointf gvrender_pt(gvrender_job_t *job, point p)
+static pointf gvrender_pt(GVJ_t *job, point p)
 {
     pointf rv;
 
@@ -241,9 +238,9 @@ static void gvrender_resolve_color(gvrender_features_t * features,
     }
 }
 
-void gvrender_begin_graph(GVC_t * gvc, graph_t * g)
+void gvrender_begin_graph(GVJ_t * job, graph_t * g)
 {
-    gvrender_job_t *job = gvc->job;
+    GVC_t *gvc = job->gvc;
     gvrender_engine_t *gvre = job->render_engine;
     char *str;
     double sx, sy;
@@ -275,8 +272,8 @@ void gvrender_begin_graph(GVC_t * gvc, graph_t * g)
        /* init stack */
        gvc->SP = 0;
        job->style = &(gvc->styles[0]);
-       gvrender_set_pencolor(gvc, DEFAULT_COLOR);
-       gvrender_set_fillcolor(gvc, DEFAULT_FILL);
+       gvrender_set_pencolor(job, DEFAULT_COLOR);
+       gvrender_set_fillcolor(job, DEFAULT_FILL);
        job->style->fontfam = DEFAULT_FONTNAME;
        job->style->fontsz = DEFAULT_FONTSIZE;
        job->style->fontopt = FONT_REGULAR;
@@ -304,9 +301,8 @@ fprintf(stderr,"pb = %d,%d %d,%d\n",
 #endif
 }
 
-void gvrender_end_graph(GVC_t * gvc)
+void gvrender_end_graph(GVJ_t * job)
 {
-    gvrender_job_t *job = gvc->job;
     gvrender_engine_t *gvre = job->render_engine;
 
     if (gvre && gvre->end_graph)
@@ -321,9 +317,8 @@ void gvrender_end_graph(GVC_t * gvc)
 #endif
 }
 
-void gvrender_begin_page(GVC_t * gvc)
+void gvrender_begin_page(GVJ_t * job)
 {
-    gvrender_job_t *job = gvc->job;
     gvrender_engine_t *gvre = job->render_engine;
 
     if (gvre && gvre->begin_page)
@@ -342,9 +337,8 @@ void gvrender_begin_page(GVC_t * gvc)
 #endif
 }
 
-void gvrender_end_page(GVC_t * gvc)
+void gvrender_end_page(GVJ_t * job)
 {
-    gvrender_job_t *job = gvc->job;
     gvrender_engine_t *gvre = job->render_engine;
 
     if (gvre && gvre->end_page)
@@ -359,9 +353,9 @@ void gvrender_end_page(GVC_t * gvc)
 #endif
 }
 
-void gvrender_begin_layer(GVC_t * gvc)
+void gvrender_begin_layer(GVJ_t * job)
 {
-    gvrender_job_t *job = gvc->job;
+    GVC_t * gvc = job->gvc;
     gvrender_engine_t *gvre = job->render_engine;
 
     if (gvre && gvre->begin_layer)
@@ -376,9 +370,8 @@ void gvrender_begin_layer(GVC_t * gvc)
 #endif
 }
 
-void gvrender_end_layer(GVC_t * gvc)
+void gvrender_end_layer(GVJ_t * job)
 {
-    gvrender_job_t *job = gvc->job;
     gvrender_engine_t *gvre = job->render_engine;
 
     if (gvre && gvre->end_layer)
@@ -393,9 +386,8 @@ void gvrender_end_layer(GVC_t * gvc)
 #endif
 }
 
-void gvrender_begin_cluster(GVC_t * gvc, graph_t * sg)
+void gvrender_begin_cluster(GVJ_t * job, graph_t * sg)
 {
-    gvrender_job_t *job = gvc->job;
     gvrender_engine_t *gvre = job->render_engine;
 
     if (gvre && gvre->begin_cluster)
@@ -410,9 +402,8 @@ void gvrender_begin_cluster(GVC_t * gvc, graph_t * sg)
 #endif
 }
 
-void gvrender_end_cluster(GVC_t * gvc)
+void gvrender_end_cluster(GVJ_t * job)
 {
-    gvrender_job_t *job = gvc->job;
     gvrender_engine_t *gvre = job->render_engine;
 
     if (gvre && gvre->end_cluster)
@@ -427,9 +418,8 @@ void gvrender_end_cluster(GVC_t * gvc)
 #endif
 }
 
-void gvrender_begin_nodes(GVC_t * gvc)
+void gvrender_begin_nodes(GVJ_t * job)
 {
-    gvrender_job_t *job = gvc->job;
     gvrender_engine_t *gvre = job->render_engine;
 
     if (gvre && gvre->begin_nodes)
@@ -444,9 +434,8 @@ void gvrender_begin_nodes(GVC_t * gvc)
 #endif
 }
 
-void gvrender_end_nodes(GVC_t * gvc)
+void gvrender_end_nodes(GVJ_t * job)
 {
-    gvrender_job_t *job = gvc->job;
     gvrender_engine_t *gvre = job->render_engine;
 
     if (gvre && gvre->end_nodes)
@@ -461,9 +450,8 @@ void gvrender_end_nodes(GVC_t * gvc)
 #endif
 }
 
-void gvrender_begin_edges(GVC_t * gvc)
+void gvrender_begin_edges(GVJ_t * job)
 {
-    gvrender_job_t *job = gvc->job;
     gvrender_engine_t *gvre = job->render_engine;
 
     if (gvre && gvre->begin_edges)
@@ -478,9 +466,8 @@ void gvrender_begin_edges(GVC_t * gvc)
 #endif
 }
 
-void gvrender_end_edges(GVC_t * gvc)
+void gvrender_end_edges(GVJ_t * job)
 {
-    gvrender_job_t *job = gvc->job;
     gvrender_engine_t *gvre = job->render_engine;
 
     if (gvre && gvre->end_edges)
@@ -495,9 +482,8 @@ void gvrender_end_edges(GVC_t * gvc)
 #endif
 }
 
-void gvrender_begin_node(GVC_t * gvc, node_t * n)
+void gvrender_begin_node(GVJ_t * job, node_t * n)
 {
-    gvrender_job_t *job = gvc->job;
     gvrender_engine_t *gvre = job->render_engine;
 
     if (gvre && gvre->begin_node)
@@ -512,9 +498,8 @@ void gvrender_begin_node(GVC_t * gvc, node_t * n)
 #endif
 }
 
-void gvrender_end_node(GVC_t * gvc)
+void gvrender_end_node(GVJ_t * job)
 {
-    gvrender_job_t *job = gvc->job;
     gvrender_engine_t *gvre = job->render_engine;
 
     if (gvre && gvre->end_node)
@@ -529,9 +514,8 @@ void gvrender_end_node(GVC_t * gvc)
 #endif
 }
 
-void gvrender_begin_edge(GVC_t * gvc, edge_t * e)
+void gvrender_begin_edge(GVJ_t * job, edge_t * e)
 {
-    gvrender_job_t *job = gvc->job;
     gvrender_engine_t *gvre = job->render_engine;
 
     if (gvre && gvre->begin_edge)
@@ -548,9 +532,8 @@ void gvrender_begin_edge(GVC_t * gvc, edge_t * e)
 #endif
 }
 
-void gvrender_end_edge(GVC_t * gvc)
+void gvrender_end_edge(GVJ_t * job)
 {
-    gvrender_job_t *job = gvc->job;
     gvrender_engine_t *gvre = job->render_engine;
 
     if (gvre && gvre->end_edge)
@@ -565,9 +548,9 @@ void gvrender_end_edge(GVC_t * gvc)
 #endif
 }
 
-void gvrender_begin_context(GVC_t * gvc)
+void gvrender_begin_context(GVJ_t * job)
 {
-    gvrender_job_t *job = gvc->job;
+    GVC_t *gvc = job->gvc;
     gvrender_engine_t *gvre = job->render_engine;
 
     if (gvre) {
@@ -586,9 +569,9 @@ void gvrender_begin_context(GVC_t * gvc)
 #endif
 }
 
-void gvrender_end_context(GVC_t * gvc)
+void gvrender_end_context(GVJ_t * job)
 {
-    gvrender_job_t *job = gvc->job;
+    GVC_t *gvc = job->gvc;
     gvrender_engine_t *gvre = job->render_engine;
 
     if (gvre) {
@@ -606,10 +589,9 @@ void gvrender_end_context(GVC_t * gvc)
 #endif
 }
 
-void gvrender_begin_anchor(GVC_t * gvc, char *href, char *tooltip,
+void gvrender_begin_anchor(GVJ_t * job, char *href, char *tooltip,
                           char *target)
 {
-    gvrender_job_t *job = gvc->job;
     gvrender_engine_t *gvre = job->render_engine;
 
     if (gvre && gvre->begin_anchor)
@@ -624,9 +606,8 @@ void gvrender_begin_anchor(GVC_t * gvc, char *href, char *tooltip,
 #endif
 }
 
-void gvrender_end_anchor(GVC_t * gvc)
+void gvrender_end_anchor(GVJ_t * job)
 {
-    gvrender_job_t *job = gvc->job;
     gvrender_engine_t *gvre = job->render_engine;
 
     if (gvre && gvre->end_anchor)
@@ -641,9 +622,8 @@ void gvrender_end_anchor(GVC_t * gvc)
 #endif
 }
 
-void gvrender_set_font(GVC_t * gvc, char *fontname, double fontsize)
+void gvrender_set_font(GVJ_t * job, char *fontname, double fontsize)
 {
-    gvrender_job_t *job = gvc->job;
     gvrender_engine_t *gvre = job->render_engine;
 
     if (gvre) {
@@ -660,9 +640,8 @@ void gvrender_set_font(GVC_t * gvc, char *fontname, double fontsize)
 #endif
 }
 
-void gvrender_textline(GVC_t * gvc, pointf p, textline_t * line)
+void gvrender_textline(GVJ_t * job, pointf p, textline_t * line)
 {
-    gvrender_job_t *job = gvc->job;
     gvrender_engine_t *gvre = job->render_engine;
 
     if (line->str && line->str[0]) {
@@ -684,9 +663,8 @@ void gvrender_textline(GVC_t * gvc, pointf p, textline_t * line)
     }
 }
 
-void gvrender_set_pencolor(GVC_t * gvc, char *name)
+void gvrender_set_pencolor(GVJ_t * job, char *name)
 {
-    gvrender_job_t *job = gvc->job;
     gvrender_engine_t *gvre = job->render_engine;
     color_t *color = &(job->style->pencolor);
 
@@ -705,9 +683,8 @@ void gvrender_set_pencolor(GVC_t * gvc, char *name)
 #endif
 }
 
-void gvrender_set_fillcolor(GVC_t * gvc, char *name)
+void gvrender_set_fillcolor(GVJ_t * job, char *name)
 {
-    gvrender_job_t *job = gvc->job;
     gvrender_engine_t *gvre = job->render_engine;
     color_t *color = &(job->style->fillcolor);
 
@@ -726,9 +703,8 @@ void gvrender_set_fillcolor(GVC_t * gvc, char *name)
 #endif
 }
 
-void gvrender_set_style(GVC_t * gvc, char **s)
+void gvrender_set_style(GVJ_t * job, char **s)
 {
-    gvrender_job_t *job = gvc->job;
     gvrender_engine_t *gvre = job->render_engine;
     char *line, *p;
     gvstyle_t *style = job->style;
@@ -771,9 +747,8 @@ void gvrender_set_style(GVC_t * gvc, char **s)
 #endif
 }
 
-void gvrender_ellipse(GVC_t * gvc, point p, int rx, int ry, int filled)
+void gvrender_ellipse(GVJ_t * job, point p, int rx, int ry, int filled)
 {
-    gvrender_job_t *job = gvc->job;
     gvrender_engine_t *gvre = job->render_engine;
 
     if (gvre && gvre->ellipse) {
@@ -804,9 +779,8 @@ void gvrender_ellipse(GVC_t * gvc, point p, int rx, int ry, int filled)
 #endif
 }
 
-void gvrender_polygon(GVC_t * gvc, point * A, int n, int filled)
+void gvrender_polygon(GVJ_t * job, point * A, int n, int filled)
 {
-    gvrender_job_t *job = gvc->job;
     gvrender_engine_t *gvre = job->render_engine;
 
     if (gvre && gvre->polygon) {
@@ -834,10 +808,9 @@ void gvrender_polygon(GVC_t * gvc, point * A, int n, int filled)
 #endif
 }
 
-void gvrender_beziercurve(GVC_t * gvc, pointf * AF, int n,
+void gvrender_beziercurve(GVJ_t * job, pointf * AF, int n,
                          int arrow_at_start, int arrow_at_end, int filled)
 {
-    gvrender_job_t *job = gvc->job;
     gvrender_engine_t *gvre = job->render_engine;
 
     if (gvre && gvre->beziercurve) {
@@ -877,9 +850,8 @@ void gvrender_beziercurve(GVC_t * gvc, pointf * AF, int n,
 #endif
 }
 
-void gvrender_polyline(GVC_t * gvc, point * A, int n)
+void gvrender_polyline(GVJ_t * job, point * A, int n)
 {
-    gvrender_job_t *job = gvc->job;
     gvrender_engine_t *gvre = job->render_engine;
 
     if (gvre && gvre->polyline) {
@@ -907,9 +879,8 @@ void gvrender_polyline(GVC_t * gvc, point * A, int n)
 #endif
 }
 
-void gvrender_comment(GVC_t * gvc, char *str)
+void gvrender_comment(GVJ_t * job, char *str)
 {
-    gvrender_job_t *job = gvc->job;
     gvrender_engine_t *gvre = job->render_engine;
 
     if (!str || !str[0])
@@ -928,10 +899,9 @@ void gvrender_comment(GVC_t * gvc, char *str)
 #endif
 }
 
-void gvrender_user_shape(GVC_t * gvc, char *name, point * A, int n,
+void gvrender_user_shape(GVJ_t * job, char *name, point * A, int n,
                         int filled)
 {
-    gvrender_job_t *job = gvc->job;
     gvrender_engine_t *gvre = job->render_engine;
 
 /* temporary hack until client API is FP */
index 553121568dab2100e04c4e762220a2bd6bd1d4f6..7993ece04cd82e2470f3254641dfa703cf28a771 100644 (file)
@@ -303,7 +303,7 @@ void writegraph(Agraph_t *g, char *filename, char *format)
         return;
     }
 
-    gvc->job->output_lang = gvrender_select(gvc, gvc->job->output_langname);
+    gvc->job->output_lang = gvrender_select(gvc->job, gvc->job->output_langname);
     if (!GD_drawing(g) && gvc->job->output_lang != CANONICAL_DOT) {
         fprintf(stderr, "Layout was not done\n");
         return;
index 0129c948a9bedeabda04e82cd812e8225d0b091d..1643474265770d6c28b3cdc6fa2b2b8214c0f508 100644 (file)
@@ -1256,7 +1256,7 @@ static int graphcmd(ClientData clientData, Tcl_Interp * interp,
        }
        /* populate new job struct with output language and output file data */
        gvc->job->output_lang =
-            gvrender_select(gvc, gvc->job->output_langname);
+            gvrender_select(gvc->job, gvc->job->output_langname);
 
        if (Tcl_GetOpenFile (interp, argv[2], 1, 1,
             (ClientData *) &(gvc->job->output_file)) != TCL_OK)
index 66315fb8e5c9bdc9567b3528b0e1422216f2e551..badacaa937a55ac0f0a0ab4e41c6c5173f26dead 100644 (file)
@@ -415,7 +415,7 @@ static void tk_textline(point p, textline_t * line)
 }
 
 static void
-tk_bezier(point * A, int n, int arrow_at_start, int arrow_at_end)
+tk_bezier(point * A, int n, int arrow_at_start, int arrow_at_end, int filled)
 {
     char buf[20];