From ec8b5c1d65415b27b752512da559907b39a5db6a Mon Sep 17 00:00:00 2001 From: ellson Date: Tue, 14 Oct 2008 19:12:50 +0000 Subject: [PATCH] going to eliminate common_graphviz next --- configure.ac | 1 - lib/Makefile.am | 8 ++++---- lib/common/arrows.c | 8 ++++++++ lib/common/diagen.c | 17 +++++++++++++++++ lib/common/emit.c | 5 +++++ lib/common/htmltable.c | 4 ++++ lib/common/labels.c | 5 +++++ lib/common/types.h | 12 ++++++------ lib/gvc/Makefile.am | 6 ++---- lib/pack/Makefile.am | 4 +--- lib/patchwork/Makefile.am | 4 +--- 11 files changed, 53 insertions(+), 21 deletions(-) diff --git a/configure.ac b/configure.ac index f3308dac0..bf562dc23 100644 --- a/configure.ac +++ b/configure.ac @@ -2913,7 +2913,6 @@ AC_CONFIG_FILES(Makefile lib/expr/Makefile lib/expr/libexpr.pc lib/common/Makefile - lib/common_cgraph/Makefile lib/ingraphs/Makefile lib/vpsc/Makefile lib/gvc/Makefile diff --git a/lib/Makefile.am b/lib/Makefile.am index dd4ac6c96..15286c0d0 100644 --- a/lib/Makefile.am +++ b/lib/Makefile.am @@ -1,13 +1,13 @@ # $Id$ $Revision$ ## Process this file with automake to produce Makefile.in -GRAPH_DIRS = circogen common dotgen fdpgen neatogen twopigen +GRAPH_DIRS = circogen dotgen fdpgen neatogen twopigen -CGRAPH_DIRS = circogen_cgraph common_cgraph dotgen_cgraph \ +CGRAPH_DIRS = circogen_cgraph dotgen_cgraph \ fdpgen_cgraph neatogen_cgraph twopigen_cgraph SUBDIRS = cdt graph cgraph gd pathplan sfio vmalloc ast vpsc \ - rbtree sparse sfdpgen patchwork inkpot expr pack gvc \ - xdot ingraphs topfish glcomp $(GRAPH_DIRS) $(CGRAPH_DIRS) + rbtree sparse sfdpgen patchwork inkpot expr common \ + pack gvc xdot ingraphs topfish glcomp $(GRAPH_DIRS) $(CGRAPH_DIRS) EXTRA_DIST = Makefile.old diff --git a/lib/common/arrows.c b/lib/common/arrows.c index f0a3e1de5..535385fd7 100644 --- a/lib/common/arrows.c +++ b/lib/common/arrows.c @@ -183,7 +183,11 @@ void arrow_flags(Agedge_t * e, int *sflag, int *eflag) arrowdir_t *arrowdir; *sflag = ARR_TYPE_NONE; +#ifdef WITH_CGRAPH + *eflag = agisdirected(agraphof(e)) ? ARR_TYPE_NORM : ARR_TYPE_NONE; +#else *eflag = AG_IS_DIRECTED(e->tail->graph) ? ARR_TYPE_NORM : ARR_TYPE_NONE; +#endif if (E_dir && ((attr = agxget(e, E_dir->index)))[0]) { for (arrowdir = Arrowdirs; arrowdir->dir; arrowdir++) { if (streq(attr, arrowdir->dir)) { @@ -201,7 +205,11 @@ void arrow_flags(Agedge_t * e, int *sflag, int *eflag) edge_t *f; int s0, e0; /* pick up arrowhead of opposing edge */ +#ifdef WITH_CGRAPH + f = agedge(agraphof(e), aghead(e), agtail(e), (char *)NULL, FALSE); +#else f = agfindedge(e->tail->graph, e->head, e->tail); +#endif arrow_flags(f, &s0, &e0); *eflag = *eflag | s0; *sflag = *sflag | e0; diff --git a/lib/common/diagen.c b/lib/common/diagen.c index 6c4757f56..65faf9c64 100644 --- a/lib/common/diagen.c +++ b/lib/common/diagen.c @@ -834,13 +834,22 @@ dia_bezier(point * A, int n, int arrow_at_start, int arrow_at_end, int filled) || (strcmp(shape_t, "circle") == 0) || (strcmp(shape_t, "doublecircle") == 0)) { cp_h = diaptf(ND_coord(head)); +#ifdef WITH_CGRAPH + if (agisdirected(Rootgraph)) +#else if (AG_IS_DIRECTED(Rootgraph)) +#endif + conn_h = ellipse_connection(cp_h, diapt(A[n - 1])); else conn_h = ellipse_connection(cp_h, diapt(A[0])); } else if (strcmp(shape_t, "record") == 0) { } else { +#ifdef WITH_CGRAPH + if (agisdirected(Rootgraph)) +#else if (AG_IS_DIRECTED(Rootgraph)) +#endif conn_h = box_connection(head, diapt(A[n - 1])); else conn_h = box_connection(head, diapt(A[0])); @@ -850,13 +859,21 @@ dia_bezier(point * A, int n, int arrow_at_start, int arrow_at_end, int filled) || (strcmp(shape_t, "circle") == 0) || (strcmp(shape_t, "doublecircle") == 0)) { cp_t = diaptf(ND_coord(tail)); +#ifdef WITH_CGRAPH + if (agisdirected(Rootgraph)) +#else if (AG_IS_DIRECTED(Rootgraph)) +#endif conn_t = ellipse_connection(cp_t, diapt(A[0])); else conn_t = ellipse_connection(cp_t, diapt(A[n - 1])); } else if (strcmp(shape_t, "record") == 0) { } else { +#ifdef WITH_CGRAPH + if (agisdirected(Rootgraph)) +#else if (AG_IS_DIRECTED(Rootgraph)) +#endif conn_t = box_connection(tail, diapt(A[0])); else conn_t = box_connection(tail, diapt(A[n - 1])); diff --git a/lib/common/emit.c b/lib/common/emit.c index 4f47a9db4..19583041b 100644 --- a/lib/common/emit.c +++ b/lib/common/emit.c @@ -1839,7 +1839,12 @@ static void emit_edge(GVJ_t * job, edge_t * e) s = malloc(strlen(e->tail->name) + 2 + strlen(e->head->name) + 1); strcpy(s,e->tail->name); +#ifdef WITH_CGRAPH + if (agisdirected(agraphof(e))) +#else if (AG_IS_DIRECTED(e->tail->graph)) +#endif + strcat(s,"->"); else strcat(s,"--"); diff --git a/lib/common/htmltable.c b/lib/common/htmltable.c index 2e6b8d523..67453fbb9 100644 --- a/lib/common/htmltable.c +++ b/lib/common/htmltable.c @@ -1581,7 +1581,11 @@ static char *nameOf(void *obj, agxbuf * xb) ep = (Agedge_t *) obj; agxbput(xb, ep->tail->name); agxbput(xb, ep->head->name); +#ifdef WITH_CGRAPH + if (agisdirected(agraphof(ep))) +#else if (AG_IS_DIRECTED(ep->tail->graph)) +#endif agxbput(xb, "->"); else agxbput(xb, "--"); diff --git a/lib/common/labels.c b/lib/common/labels.c index bc9387843..c0beaa38c 100644 --- a/lib/common/labels.c +++ b/lib/common/labels.c @@ -152,8 +152,13 @@ textlabel_t *make_label(void *obj, char *str, int kind, double fontsize, char *f agerr(AGPREV, "in label of node %s\n", n->name); break; case AGEDGE: +#ifdef WITH_CGRAPH + agerr(AGPREV, "in label of edge %s %s %s\n", + e->tail->name, agisdirected(g)?"->":"--", e->head->name); +#else agerr(AGPREV, "in label of edge %s %s %s\n", e->tail->name, AG_IS_DIRECTED(g)?"->":"--", e->head->name); +#endif break; } } diff --git a/lib/common/types.h b/lib/common/types.h index aa3dca4cb..d6452a6a0 100644 --- a/lib/common/types.h +++ b/lib/common/types.h @@ -44,16 +44,16 @@ extern "C" { typedef int (*qsort_cmpf) (const void *, const void *); typedef int (*bsearch_cmpf) (const void *, const void *); - typedef struct Agraph_t graph_t; + typedef struct Agraph_s graph_t; - typedef struct Agnode_t node_t; - typedef struct Agedge_t edge_t; + typedef struct Agnode_s node_t; + typedef struct Agedge_s edge_t; - typedef struct Agsym_t attrsym_t; + typedef struct Agsym_s attrsym_t; - typedef struct htmllabel_t htmllabel_t; + typedef struct htmllabel_s htmllabel_t; - typedef union inside_t { + typedef union inside_s { struct { pointf* p; double* r; diff --git a/lib/gvc/Makefile.am b/lib/gvc/Makefile.am index bf259ae80..4d1553139 100644 --- a/lib/gvc/Makefile.am +++ b/lib/gvc/Makefile.am @@ -3,10 +3,8 @@ if WITH_CGRAPH GRAPH = cgraph -COMMON = common_cgraph else GRAPH = graph -COMMON = common endif pdfdir = $(pkgdatadir)/doc/pdf @@ -14,7 +12,7 @@ pkgconfigdir = $(libdir)/pkgconfig AM_CPPFLAGS = \ -I$(top_srcdir) \ - -I$(top_srcdir)/lib/$(COMMON) \ + -I$(top_srcdir)/lib/common \ -I$(top_srcdir)/lib/pathplan \ -I$(top_srcdir)/lib/$(GRAPH) \ -I$(top_srcdir)/lib/cdt \ @@ -51,7 +49,7 @@ pdf_DATA = gvc.3.pdf libgvc_C_la_SOURCES = gvrender.c gvlayout.c gvdevice.c gvloadimage.c \ gvcontext.c gvjobs.c gvevent.c gvplugin.c gvconfig.c \ gvtextlayout.c gvusershape.c gvc.c -libgvc_C_la_LIBADD = $(top_builddir)/lib/$(COMMON)/libcommon_C.la \ +libgvc_C_la_LIBADD = $(top_builddir)/lib/common/libcommon_C.la \ $(top_builddir)/lib/pack/libpack_C.la libgvc_C_la_DEPENDENCIES = $(top_builddir)/lib/rbtree/librbtree_C.la \ $(top_builddir)/lib/pack/libpack_C.la diff --git a/lib/pack/Makefile.am b/lib/pack/Makefile.am index 290713eac..1ebdc7a05 100644 --- a/lib/pack/Makefile.am +++ b/lib/pack/Makefile.am @@ -6,16 +6,14 @@ pdfdir = $(pkgdatadir)/doc/pdf if WITH_CGRAPH GRAPH = cgraph -COMMON = common_cgraph NEATOGEN = neatogen_cgraph else GRAPH = graph -COMMON = common NEATOGEN = neatogen endif AM_CPPFLAGS = -I$(top_srcdir) \ - -I$(top_srcdir)/lib/$(COMMON) \ + -I$(top_srcdir)/lib/common \ -I$(top_srcdir)/lib/gvc \ -I$(top_srcdir)/lib/$(NEATOGEN) \ -I$(top_srcdir)/lib/pathplan \ diff --git a/lib/patchwork/Makefile.am b/lib/patchwork/Makefile.am index 40b7597a0..e415cdd02 100644 --- a/lib/patchwork/Makefile.am +++ b/lib/patchwork/Makefile.am @@ -3,19 +3,17 @@ if WITH_CGRAPH GRAPH = cgraph -COMMON = common_cgraph NEATOGEN = neatogen_cgraph FDPGEN = fdpgen_cgraph else GRAPH = graph -COMMON = common NEATOGEN = neatogen FDPGEN = fdpgen endif AM_CPPFLAGS = \ -I$(top_srcdir) \ - -I$(top_srcdir)/lib/$(COMMON) \ + -I$(top_srcdir)/lib/common \ -I$(top_srcdir)/lib/gvc \ -I$(top_srcdir)/lib/$(NEATOGEN) \ -I$(top_srcdir)/lib/$(FDPGEN) \ -- 2.40.0