From 4f65028b1e27b9b915f31c0fb7488eed145be4a4 Mon Sep 17 00:00:00 2001 From: ellson Date: Thu, 12 Mar 2009 16:06:58 +0000 Subject: [PATCH] various partial fixes and stubs for compiling --with-cgraph --- plugin/core/gvrender_core_dot.c | 8 ++++++++ plugin/core/gvrender_core_tk.c | 25 ++++++++++++++++++++++--- 2 files changed, 30 insertions(+), 3 deletions(-) diff --git a/plugin/core/gvrender_core_dot.c b/plugin/core/gvrender_core_dot.c index 30e45acf8..e1294b9f1 100644 --- a/plugin/core/gvrender_core_dot.c +++ b/plugin/core/gvrender_core_dot.c @@ -414,7 +414,11 @@ static void dot_end_graph(GVJ_t *job) { graph_t *g = job->obj->u.g; +#ifndef WITH_CGRAPH agsetiodisc(NULL, gvfwrite, gvferror); +#else + // FIXME +#endif switch (job->render.id) { case FORMAT_PLAIN: write_plain(job, g, (FILE*)job, FALSE); @@ -433,7 +437,11 @@ static void dot_end_graph(GVJ_t *job) agwrite(g, (FILE*)job); break; } +#ifndef WITH_CGRAPH agsetiodisc(NULL, NULL, NULL); +#else + // FIXME +#endif } static void xdot_textpara(GVJ_t * job, pointf p, textpara_t * para) diff --git a/plugin/core/gvrender_core_tk.c b/plugin/core/gvrender_core_tk.c index b0db577d4..b35074940 100644 --- a/plugin/core/gvrender_core_tk.c +++ b/plugin/core/gvrender_core_tk.c @@ -60,7 +60,10 @@ static void tkgen_print_tags(GVJ_t *job) char *ObjType, *ObjPart; unsigned int ObjId; obj_state_t *obj = job->obj; - int ObjHandle, ObjFlag; + int ObjFlag; +#ifndef WITH_CGRAPH + int ObjHandle; +#endif switch (obj->emit_state) { case EMIT_NDRAW: @@ -68,14 +71,18 @@ static void tkgen_print_tags(GVJ_t *job) ObjPart = "shape"; ObjFlag = 1; ObjId = AGID(obj->u.n); +#ifndef WITH_CGRAPH ObjHandle = obj->u.n->handle; +#endif break; case EMIT_NLABEL: ObjType = "node"; ObjPart = "label"; ObjFlag = 0; ObjId = AGID(obj->u.n); +#ifndef WITH_CGRAPH ObjHandle = obj->u.n->handle; +#endif break; case EMIT_EDRAW: case EMIT_TDRAW: @@ -84,7 +91,9 @@ static void tkgen_print_tags(GVJ_t *job) ObjPart = "shape"; ObjFlag = 1; ObjId = AGID(obj->u.e); +#ifndef WITH_CGRAPH ObjHandle = obj->u.e->handle; +#endif break; case EMIT_ELABEL: case EMIT_TLABEL: @@ -93,14 +102,18 @@ static void tkgen_print_tags(GVJ_t *job) ObjPart = "label"; ObjFlag = 0; ObjId = AGID(obj->u.e); +#ifndef WITH_CGRAPH ObjHandle = obj->u.e->handle; +#endif break; case EMIT_GDRAW: ObjType = "graph"; ObjPart = "shape"; ObjFlag = 1; ObjId = -1; /* hack! */ +#ifndef WITH_CGRAPH ObjHandle = obj->u.g->handle; +#endif break; case EMIT_GLABEL: ObjType = "graph"; @@ -108,7 +121,9 @@ static void tkgen_print_tags(GVJ_t *job) ObjFlag = 0; ObjType = "graph label"; ObjId = -1; /* hack! */ +#ifndef WITH_CGRAPH ObjHandle = obj->u.g->handle; +#endif break; case EMIT_CDRAW: ObjType = "graph"; @@ -116,10 +131,10 @@ static void tkgen_print_tags(GVJ_t *job) ObjFlag = 1; #ifndef WITH_CGRAPH ObjId = obj->u.sg->meta_node->id; + ObjHandle = obj->u.sg->handle; #else ObjId = AGID(obj->u.sg); #endif - ObjHandle = obj->u.sg->handle; break; case EMIT_CLABEL: ObjType = "graph"; @@ -127,16 +142,20 @@ static void tkgen_print_tags(GVJ_t *job) ObjFlag = 0; #ifndef WITH_CGRAPH ObjId = obj->u.sg->meta_node->id; + ObjHandle = obj->u.sg->handle; #else ObjId = AGID(obj->u.sg); #endif - ObjHandle = obj->u.sg->handle; break; default: assert (0); break; } +#ifndef WITH_CGRAPH gvprintf(job, " -tags {%d%s%d}", ObjFlag, ObjType, ObjHandle); +#else + gvprintf(job, " -tags {%d%s%d}", ObjFlag, ObjType, ObjId); +#endif } static void tkgen_canvas(GVJ_t * job) -- 2.40.0