From 1194b89430f8c187b527e55f16251765794ccf9c Mon Sep 17 00:00:00 2001 From: ellson Date: Thu, 28 Jul 2005 17:52:09 +0000 Subject: [PATCH] move plugin/*/* to lib/plugin since plugins are really libs anyway some plugins depended on libs which was causing unresolvable dependencies resolve lib dependency ordering in lib/Makefile.am move plugin/plugins.c (describing builtins) to lib/gvc/builtins.c (pending something fancier using ./configure --with-builtins=... ) fix cmd/tools/Makefile.am to pick up layout plugin from new location remove plugin/ --- Makefile.am | 2 +- cmd/tools/Makefile.am | 2 +- configure.ac | 4 +- lib/Makefile.am | 2 +- lib/gvc/Makefile.am | 6 +- lib/gvc/builtins.c | 30 ++++++++ plugin/dot_layout/gvlayout_dot_layout.c | 47 ++++++++++++ plugin/dot_layout/gvplugin_dot_layout.c | 26 +++++++ plugin/neato_layout/gvlayout_neato_layout.c | 81 +++++++++++++++++++++ plugin/neato_layout/gvplugin_neato_layout.c | 26 +++++++ 10 files changed, 218 insertions(+), 8 deletions(-) create mode 100644 lib/gvc/builtins.c create mode 100644 plugin/dot_layout/gvlayout_dot_layout.c create mode 100644 plugin/dot_layout/gvplugin_dot_layout.c create mode 100644 plugin/neato_layout/gvlayout_neato_layout.c create mode 100644 plugin/neato_layout/gvplugin_neato_layout.c diff --git a/Makefile.am b/Makefile.am index 942dcfc8a..fc49a5344 100644 --- a/Makefile.am +++ b/Makefile.am @@ -12,7 +12,7 @@ txt_DATA = $(txt) html_DATA = $(html) # $(subdirs) contains the list from: AC_CONFIG_SUBDIRS -SUBDIRS = $(subdirs) lib plugin cmd tclpkg doc contrib graphs +SUBDIRS = $(subdirs) lib cmd tclpkg doc contrib graphs .PHONY: doxygen doxygen: diff --git a/cmd/tools/Makefile.am b/cmd/tools/Makefile.am index d54f04dfd..e064d12f3 100644 --- a/cmd/tools/Makefile.am +++ b/cmd/tools/Makefile.am @@ -102,7 +102,7 @@ gvpack_LDADD = \ $(top_builddir)/lib/gvc/libgvc.la \ $(top_builddir)/lib/ingraphs/libingraphs.la \ $(top_builddir)/lib/graph/libgraph.la \ - $(top_builddir)/plugin/layout/libgvplugin_neato_layout.la + $(top_builddir)/lib/plugin/libgvplugin_neato_layout.la dijkstra_SOURCES = dijkstra.c diff --git a/configure.ac b/configure.ac index d99d5043b..0a225a52c 100644 --- a/configure.ac +++ b/configure.ac @@ -1501,9 +1501,7 @@ AC_CONFIG_FILES(Makefile lib/ingraphs/Makefile lib/gvc/Makefile lib/gvc/libgvc.pc - plugin/Makefile - plugin/layout/Makefile - plugin/usershape/Makefile + lib/plugin/Makefile cmd/Makefile cmd/dot/Makefile cmd/tools/Makefile diff --git a/lib/Makefile.am b/lib/Makefile.am index 430ffaccf..0958a0a71 100644 --- a/lib/Makefile.am +++ b/lib/Makefile.am @@ -1,6 +1,6 @@ ## Process this file with automake to produce Makefile.in SUBDIRS = cdt graph agraph gd pathplan agutil sfio vmalloc ast circogen \ - dotgen fdpgen neatogen pack twopigen common gvc ingraphs expr + dotgen fdpgen neatogen pack twopigen plugin common gvc ingraphs expr EXTRA_DIST = Makefile.old diff --git a/lib/gvc/Makefile.am b/lib/gvc/Makefile.am index 0d3dc89b1..dd5e7d476 100644 --- a/lib/gvc/Makefile.am +++ b/lib/gvc/Makefile.am @@ -18,7 +18,7 @@ pkginclude_HEADERS = gvc.h gvcint.h gvplugin.h gvcproc.h gvplugin_render.h \ pkglib_LTLIBRARIES = libgvc.la pkgconfig_DATA = libgvc.pc -libgvc_la_SOURCES = gvrender.c gvlayout.c gvtextlayout.c gvdevice.c \ +libgvc_la_SOURCES = builtins.c gvrender.c gvlayout.c gvtextlayout.c gvdevice.c \ gvcontext.c gvjobs.c gvevent.c gvplugin.c gvconfig.c gvusershape.c \ gvc.c @@ -26,7 +26,9 @@ libgvc_la_LIBADD = \ $(top_builddir)/lib/common/libcommon.la \ $(top_builddir)/lib/graph/libgraph.la \ $(top_builddir)/lib/pathplan/libpathplan.la \ - $(top_builddir)/plugin/libplugins.la \ + $(top_builddir)/lib/plugin/libgvplugin_dot_layout.la \ + $(top_builddir)/lib/plugin/libgvplugin_neato_layout.la \ + $(top_builddir)/lib/plugin/libgvplugin_usershape_gd.la \ @GD_LIBS@ @EXPAT_LIBS@ @Z_LIBS@ @LIBGEN_LIBS@ EXTRA_DIST = Makefile.old diff --git a/lib/gvc/builtins.c b/lib/gvc/builtins.c new file mode 100644 index 000000000..dcc30668c --- /dev/null +++ b/lib/gvc/builtins.c @@ -0,0 +1,30 @@ +/* $Id$ $Revision$ */ +/* vim:set shiftwidth=4 ts=8: */ + +/********************************************************** +* This software is part of the graphviz package * +* http://www.graphviz.org/ * +* * +* Copyright (c) 1994-2004 AT&T Corp. * +* and is licensed under the * +* Common Public License, Version 1.0 * +* by AT&T Corp. * +* * +* Information and Software Systems Research * +* AT&T Research, Florham Park NJ * +**********************************************************/ + +#include "gvplugin.h" + +extern gvplugin_library_t + gvplugin_dot_layout_LTX_library, + gvplugin_neato_layout_LTX_library, + gvplugin_usershape_gd_LTX_library; + +gvplugin_library_t *builtins[] = { + &gvplugin_dot_layout_LTX_library, + &gvplugin_neato_layout_LTX_library, + &gvplugin_usershape_gd_LTX_library, + NULL +}; + diff --git a/plugin/dot_layout/gvlayout_dot_layout.c b/plugin/dot_layout/gvlayout_dot_layout.c new file mode 100644 index 000000000..dd186ff8a --- /dev/null +++ b/plugin/dot_layout/gvlayout_dot_layout.c @@ -0,0 +1,47 @@ +/* $Id$ $Revision$ */ +/* vim:set shiftwidth=4 ts=8: */ + +/********************************************************** +* This software is part of the graphviz package * +* http://www.graphviz.org/ * +* * +* Copyright (c) 1994-2004 AT&T Corp. * +* and is licensed under the * +* Common Public License, Version 1.0 * +* by AT&T Corp. * +* * +* Information and Software Systems Research * +* AT&T Research, Florham Park NJ * +**********************************************************/ + + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include + +#include "macros.h" +#include "const.h" +#include "types.h" + +#include "gvplugin_layout.h" + +typedef enum { LAYOUT_DOT, } layout_type; + +extern void dot_layout(graph_t * g); +extern void dot_cleanup(graph_t * g); + +gvlayout_engine_t dotgen_engine = { + dot_layout, + dot_cleanup, +}; + +gvlayout_features_t dotgen_features = { + LAYOUT_USES_RANKDIR, +}; + +gvplugin_installed_t gvlayout_dot_layout[] = { + {LAYOUT_DOT, "dot", 0, &dotgen_engine, &dotgen_features}, + {0, NULL, 0, NULL, NULL} +}; diff --git a/plugin/dot_layout/gvplugin_dot_layout.c b/plugin/dot_layout/gvplugin_dot_layout.c new file mode 100644 index 000000000..fb84ecf05 --- /dev/null +++ b/plugin/dot_layout/gvplugin_dot_layout.c @@ -0,0 +1,26 @@ +/* $Id$ $Revision$ */ +/* vim:set shiftwidth=4 ts=8: */ + +/********************************************************** +* This software is part of the graphviz package * +* http://www.graphviz.org/ * +* * +* Copyright (c) 1994-2004 AT&T Corp. * +* and is licensed under the * +* Common Public License, Version 1.0 * +* by AT&T Corp. * +* * +* Information and Software Systems Research * +* AT&T Research, Florham Park NJ * +**********************************************************/ + +#include "gvplugin.h" + +extern gvplugin_installed_t gvlayout_dot_layout; + +static gvplugin_api_t apis[] = { + {API_layout, &gvlayout_dot_layout}, + {(api_t)0, NULL}, +}; + +gvplugin_library_t gvplugin_dot_layout_LTX_library = { "dot_layout", apis }; diff --git a/plugin/neato_layout/gvlayout_neato_layout.c b/plugin/neato_layout/gvlayout_neato_layout.c new file mode 100644 index 000000000..7b7da8c92 --- /dev/null +++ b/plugin/neato_layout/gvlayout_neato_layout.c @@ -0,0 +1,81 @@ +/* $Id$ $Revision$ */ +/* vim:set shiftwidth=4 ts=8: */ + +/********************************************************** +* This software is part of the graphviz package * +* http://www.graphviz.org/ * +* * +* Copyright (c) 1994-2004 AT&T Corp. * +* and is licensed under the * +* Common Public License, Version 1.0 * +* by AT&T Corp. * +* * +* Information and Software Systems Research * +* AT&T Research, Florham Park NJ * +**********************************************************/ + +/* + * neato layout plugin + * + */ + + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include + +#include "macros.h" +#include "const.h" +#include "types.h" + +#include "gvplugin_layout.h" + +typedef enum { LAYOUT_NEATO, + LAYOUT_FDP, + LAYOUT_TWOPI, + LAYOUT_CIRCO, + } layout_type; + +extern void neato_layout(graph_t * g); +extern void fdp_layout(graph_t * g); +extern void twopi_layout(graph_t * g); +extern void circo_layout(graph_t * g); + +extern void neato_cleanup(graph_t * g); +extern void fdp_cleanup(graph_t * g); +extern void twopi_cleanup(graph_t * g); +extern void circo_cleanup(graph_t * g); + +gvlayout_engine_t neatogen_engine = { + neato_layout, + neato_cleanup, +}; + +gvlayout_engine_t fdpgen_engine = { + fdp_layout, + fdp_cleanup, +}; + +gvlayout_engine_t twopigen_engine = { + twopi_layout, + twopi_cleanup, +}; + +gvlayout_engine_t circogen_engine = { + circo_layout, + circo_cleanup, +}; + +gvlayout_features_t neatogen_features = { + 0, +}; + +gvplugin_installed_t gvlayout_neato_types[] = { + {LAYOUT_NEATO, "neato", 0, &neatogen_engine, &neatogen_features}, + {LAYOUT_FDP, "fdp", 0, &fdpgen_engine, &neatogen_features}, + {LAYOUT_TWOPI, "twopi", 0, &twopigen_engine, &neatogen_features}, + {LAYOUT_CIRCO, "circo", 0, &circogen_engine, &neatogen_features}, + {0, NULL, 0, NULL, NULL} +}; diff --git a/plugin/neato_layout/gvplugin_neato_layout.c b/plugin/neato_layout/gvplugin_neato_layout.c new file mode 100644 index 000000000..c56c0a1c4 --- /dev/null +++ b/plugin/neato_layout/gvplugin_neato_layout.c @@ -0,0 +1,26 @@ +/* $Id$ $Revision$ */ +/* vim:set shiftwidth=4 ts=8: */ + +/********************************************************** +* This software is part of the graphviz package * +* http://www.graphviz.org/ * +* * +* Copyright (c) 1994-2004 AT&T Corp. * +* and is licensed under the * +* Common Public License, Version 1.0 * +* by AT&T Corp. * +* * +* Information and Software Systems Research * +* AT&T Research, Florham Park NJ * +**********************************************************/ + +#include "gvplugin.h" + +extern gvplugin_installed_t gvlayout_neato_types; + +static gvplugin_api_t apis[] = { + {API_layout, &gvlayout_neato_types}, + {(api_t)0, NULL}, +}; + +gvplugin_library_t gvplugin_neato_layout_LTX_library = { "neato_layout", apis }; -- 2.40.0