diff options
author | David Robillard <d@drobilla.net> | 2018-09-16 12:16:12 +0200 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2018-09-16 12:16:12 +0200 |
commit | 955aa3f4bfdcc20d13373500c08748041498da5a (patch) | |
tree | ce470c17591e07738d58bbc7015e30c61388ad39 /src | |
parent | 48a58a89198f4dfa04fb42cd2bd6e8fbb8f3be10 (diff) | |
download | ganv-955aa3f4bfdcc20d13373500c08748041498da5a.tar.gz ganv-955aa3f4bfdcc20d13373500c08748041498da5a.tar.bz2 ganv-955aa3f4bfdcc20d13373500c08748041498da5a.zip |
Remove checks for ancient graphviz
Diffstat (limited to 'src')
-rw-r--r-- | src/Canvas.cpp | 20 |
1 files changed, 6 insertions, 14 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 |