diff options
-rw-r--r-- | src/Canvas.cpp | 20 | ||||
-rw-r--r-- | wscript | 18 |
2 files changed, 13 insertions, 25 deletions
diff --git a/src/Canvas.cpp b/src/Canvas.cpp index 987eb6c..988f4f0 100644 --- a/src/Canvas.cpp +++ b/src/Canvas.cpp @@ -58,7 +58,7 @@ #include "./ganv-private.h" #include "./gettext.h" -#if defined(HAVE_AGRAPH_2_20) || defined(HAVE_AGRAPH_2_30) +#ifdef HAVE_AGRAPH // Deal with graphviz API amateur hour... # define _DLL_BLD 0 # define _dll_import 0 @@ -142,7 +142,7 @@ typedef std::set<GanvNode*> Items; for (SelectedPorts::iterator p = _selected_ports.begin(); \ p != _selected_ports.end(); ++p) -#if defined(HAVE_AGRAPH_2_20) || defined(HAVE_AGRAPH_2_30) +#ifdef HAVE_AGRAPH class GVNodes : public std::map<GanvNode*, Agnode_t*> { public: GVNodes() : gvc(0), G(0) {} @@ -301,7 +301,7 @@ struct GanvCanvasImpl { void unselect_ports(); -#if defined(HAVE_AGRAPH_2_20) || defined(HAVE_AGRAPH_2_30) +#ifdef HAVE_AGRAPH GVNodes layout_dot(const std::string& filename); #endif @@ -558,7 +558,7 @@ select_edges(GanvPort* port, void* data) } } -#if defined(HAVE_AGRAPH_2_20) || defined(HAVE_AGRAPH_2_30) +#ifdef HAVE_AGRAPH static void gv_set(void* subject, const char* key, double value) { @@ -576,15 +576,7 @@ GanvCanvasImpl::layout_dot(const std::string& filename) GVC_t* gvc = gvContext(); -#ifndef HAVE_AGRAPH_2_30 -#define agstrdup_html(g, str) agstrdup_html(str) -#define agedge(g, t, h, name, flag) agedge(g, t, h) -#define agnode(g, name, flag) agnode(g, name) -#define agattr(g, t, k, v) agraphattr(g, k, v) - Agraph_t* G = agopen((char*)"g", AGDIGRAPH); -#else Agraph_t* G = agopen((char*)"g", Agdirected, NULL); -#endif agsafeset(G, (char*)"splines", (char*)"false", (char*)""); agsafeset(G, (char*)"compound", (char*)"true", (char*)""); @@ -2537,7 +2529,7 @@ ganv_canvas_move_contents_to(GanvCanvas* canvas, double x, double y) void ganv_canvas_arrange(GanvCanvas* canvas) { -#if defined(HAVE_AGRAPH_2_20) || defined(HAVE_AGRAPH_2_30) +#ifdef HAVE_AGRAPH GVNodes nodes = canvas->impl->layout_dot((char*)""); double least_x=HUGE_VAL, least_y=HUGE_VAL, most_x=0, most_y=0; @@ -2689,7 +2681,7 @@ ganv_canvas_export_image(GanvCanvas* canvas, void ganv_canvas_export_dot(GanvCanvas* canvas, const char* filename) { -#if defined(HAVE_AGRAPH_2_20) || defined(HAVE_AGRAPH_2_30) +#ifdef HAVE_AGRAPH GVNodes nodes = canvas->impl->layout_dot(filename); nodes.cleanup(); #endif @@ -52,11 +52,8 @@ def configure(conf): conf.find_program('yelp-build', var='YELP_BUILD', mandatory=False) if not Options.options.no_graphviz: - autowaf.check_pkg(conf, 'libgvc', uselib_store='AGRAPH_2_30', + autowaf.check_pkg(conf, 'libgvc', uselib_store='AGRAPH', atleast_version='2.30', mandatory=False) - if not conf.env.HAVE_AGRAPH_2_30: - autowaf.check_pkg(conf, 'libgvc', uselib_store='AGRAPH_2_20', - atleast_version='2.20', mandatory=False) if not Options.options.no_fdgl: autowaf.define(conf, 'GANV_FDGL', 1) @@ -77,8 +74,7 @@ def configure(conf): autowaf.display_summary(conf) autowaf.display_msg(conf, "Static (Graphviz) arrange", - bool(conf.env.HAVE_AGRAPH_2_20 or - conf.env.HAVE_AGRAPH_2_30)) + bool(conf.env.HAVE_AGRAPH)) autowaf.display_msg(conf, "Interactive force-directed arrange", bool(conf.env.GANV_FDGL)) autowaf.display_msg(conf, "Native language support", bool(conf.env.ENABLE_NLS)) @@ -115,7 +111,7 @@ def build(bld): # Pkgconfig file autowaf.build_pc(bld, 'GANV', GANV_VERSION, GANV_MAJOR_VERSION, - 'GTKMM AGRAPH_2_20 AGRAPH_2_30', + 'GTKMM AGRAPH', {'GANV_MAJOR_VERSION' : GANV_MAJOR_VERSION}) bld(rule = 'glib-genmarshal --prefix=ganv_marshal --header ${SRC} > ${TGT}', @@ -137,7 +133,7 @@ def build(bld): includes = ['.', './src'], name = 'libganv', target = 'ganv-%s' % GANV_MAJOR_VERSION, - uselib = 'GTKMM AGRAPH_2_20 AGRAPH_2_30', + uselib = 'GTKMM AGRAPH', vnum = GANV_VERSION, install_path = '${LIBDIR}') if bld.is_defined('ENABLE_NLS'): @@ -148,7 +144,7 @@ def build(bld): source = 'src/ganv_bench.cpp', includes = ['.', './src'], use = 'libganv', - uselib = 'GTKMM AGRAPH_2_20 AGRAPH_2_30', + uselib = 'GTKMM AGRAPH', target = 'src/ganv_bench') if bld.env.BUILD_TESTS: @@ -165,7 +161,7 @@ def build(bld): includes = ['.', './src'], name = 'libganv_profiled', target = 'ganv_profiled', - uselib = 'GTKMM AGRAPH_2_20 AGRAPH_2_30', + uselib = 'GTKMM AGRAPH', install_path = '', cflags = test_cflags, linkflags = test_linkflags) @@ -176,7 +172,7 @@ def build(bld): includes = ['.', './src'], use = 'libganv_profiled', lib = test_libs, - uselib = 'GTKMM AGRAPH_2_20 AGRAPH_2_30', + uselib = 'GTKMM AGRAPH', target = 'src/ganv_test', cflags = test_cflags, linkflags = test_linkflags) |