From 79275fc579c0dbe1ce4ca109edb95f2c1e0802a5 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sat, 29 Dec 2012 20:34:32 +0000 Subject: "edge" => "arc". git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@4897 a436a847-0d15-0410-975c-d299462d15a1 --- src/gui/Arc.cpp | 33 +++++++++++++++++++++++++++++ src/gui/Arc.hpp | 53 ++++++++++++++++++++++++++++++++++++++++++++++ src/gui/Edge.cpp | 33 ----------------------------- src/gui/Edge.hpp | 53 ---------------------------------------------- src/gui/GraphCanvas.cpp | 56 ++++++++++++++++++++++++------------------------- src/gui/GraphCanvas.hpp | 6 +++--- src/gui/wscript | 2 +- 7 files changed, 118 insertions(+), 118 deletions(-) create mode 100644 src/gui/Arc.cpp create mode 100644 src/gui/Arc.hpp delete mode 100644 src/gui/Edge.cpp delete mode 100644 src/gui/Edge.hpp (limited to 'src/gui') diff --git a/src/gui/Arc.cpp b/src/gui/Arc.cpp new file mode 100644 index 00000000..b75f30ae --- /dev/null +++ b/src/gui/Arc.cpp @@ -0,0 +1,33 @@ +/* + This file is part of Ingen. + Copyright 2007-2012 David Robillard + + Ingen is free software: you can redistribute it and/or modify it under the + terms of the GNU Affero General Public License as published by the Free + Software Foundation, either version 3 of the License, or any later version. + + Ingen is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR + A PARTICULAR PURPOSE. See the GNU Affero General Public License for details. + + You should have received a copy of the GNU Affero General Public License + along with Ingen. If not, see . +*/ + +#include "Arc.hpp" + +namespace Ingen { +namespace GUI { + +Arc::Arc(Ganv::Canvas& canvas, + boost::shared_ptr model, + Ganv::Node* src, + Ganv::Node* dst, + uint32_t color) + : Ganv::Edge(canvas, src, dst, color) + , _arc_model(model) +{ +} + +} // namespace GUI +} // namespace Ingen diff --git a/src/gui/Arc.hpp b/src/gui/Arc.hpp new file mode 100644 index 00000000..df6dfbfb --- /dev/null +++ b/src/gui/Arc.hpp @@ -0,0 +1,53 @@ +/* + This file is part of Ingen. + Copyright 2007-2012 David Robillard + + Ingen is free software: you can redistribute it and/or modify it under the + terms of the GNU Affero General Public License as published by the Free + Software Foundation, either version 3 of the License, or any later version. + + Ingen is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR + A PARTICULAR PURPOSE. See the GNU Affero General Public License for details. + + You should have received a copy of the GNU Affero General Public License + along with Ingen. If not, see . +*/ + +#ifndef INGEN_GUI_ARC_HPP +#define INGEN_GUI_ARC_HPP + +#include + +#include "ganv/Edge.hpp" +#include "raul/SharedPtr.hpp" + +namespace Ingen { + +namespace Client { class ArcModel; } + +namespace GUI { + +/** An Arc (directed edge) in a Graph. + * + * \ingroup GUI + */ +class Arc : public Ganv::Edge +{ +public: + Arc(Ganv::Canvas& canvas, + boost::shared_ptr model, + Ganv::Node* src, + Ganv::Node* dst, + uint32_t color); + + SharedPtr model() const { return _arc_model; } + +private: + SharedPtr _arc_model; +}; + +} // namespace GUI +} // namespace Ingen + +#endif // INGEN_GUI_EDGE_HPP diff --git a/src/gui/Edge.cpp b/src/gui/Edge.cpp deleted file mode 100644 index 9916959e..00000000 --- a/src/gui/Edge.cpp +++ /dev/null @@ -1,33 +0,0 @@ -/* - This file is part of Ingen. - Copyright 2007-2012 David Robillard - - Ingen is free software: you can redistribute it and/or modify it under the - terms of the GNU Affero General Public License as published by the Free - Software Foundation, either version 3 of the License, or any later version. - - Ingen is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR - A PARTICULAR PURPOSE. See the GNU Affero General Public License for details. - - You should have received a copy of the GNU Affero General Public License - along with Ingen. If not, see . -*/ - -#include "Edge.hpp" - -namespace Ingen { -namespace GUI { - -Edge::Edge(Ganv::Canvas& canvas, - boost::shared_ptr model, - Ganv::Node* src, - Ganv::Node* dst, - uint32_t color) - : Ganv::Edge(canvas, src, dst, color) - , _edge_model(model) -{ -} - -} // namespace GUI -} // namespace Ingen diff --git a/src/gui/Edge.hpp b/src/gui/Edge.hpp deleted file mode 100644 index cf1dafe8..00000000 --- a/src/gui/Edge.hpp +++ /dev/null @@ -1,53 +0,0 @@ -/* - This file is part of Ingen. - Copyright 2007-2012 David Robillard - - Ingen is free software: you can redistribute it and/or modify it under the - terms of the GNU Affero General Public License as published by the Free - Software Foundation, either version 3 of the License, or any later version. - - Ingen is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR - A PARTICULAR PURPOSE. See the GNU Affero General Public License for details. - - You should have received a copy of the GNU Affero General Public License - along with Ingen. If not, see . -*/ - -#ifndef INGEN_GUI_EDGE_HPP -#define INGEN_GUI_EDGE_HPP - -#include - -#include "ganv/Edge.hpp" -#include "raul/SharedPtr.hpp" - -namespace Ingen { - -namespace Client { class EdgeModel; } - -namespace GUI { - -/** An Edge in a Graph. - * - * \ingroup GUI - */ -class Edge : public Ganv::Edge -{ -public: - Edge(Ganv::Canvas& canvas, - boost::shared_ptr model, - Ganv::Node* src, - Ganv::Node* dst, - uint32_t color); - - SharedPtr model() const { return _edge_model; } - -private: - SharedPtr _edge_model; -}; - -} // namespace GUI -} // namespace Ingen - -#endif // INGEN_GUI_EDGE_HPP diff --git a/src/gui/GraphCanvas.cpp b/src/gui/GraphCanvas.cpp index 86b21cc2..d35e678f 100644 --- a/src/gui/GraphCanvas.cpp +++ b/src/gui/GraphCanvas.cpp @@ -38,7 +38,7 @@ #include "lv2/lv2plug.in/ns/ext/atom/atom.h" #include "App.hpp" -#include "Edge.hpp" +#include "Arc.hpp" #include "GraphCanvas.hpp" #include "GraphPortModule.hpp" #include "GraphWindow.hpp" @@ -142,9 +142,9 @@ GraphCanvas::GraphCanvas(App& app, sigc::mem_fun(this, &GraphCanvas::add_port)); _graph->signal_removed_port().connect( sigc::mem_fun(this, &GraphCanvas::remove_port)); - _graph->signal_new_edge().connect( + _graph->signal_new_arc().connect( sigc::mem_fun(this, &GraphCanvas::connection)); - _graph->signal_removed_edge().connect( + _graph->signal_removed_arc().connect( sigc::mem_fun(this, &GraphCanvas::disconnection)); _app.store()->signal_new_plugin().connect( @@ -321,10 +321,10 @@ GraphCanvas::build() add_port(*i); } - // Create edges - for (GraphModel::Edges::const_iterator i = _graph->edges().begin(); - i != _graph->edges().end(); ++i) { - connection(PtrCast(i->second)); + // Create arcs + for (GraphModel::Arcs::const_iterator i = _graph->arcs().begin(); + i != _graph->arcs().end(); ++i) { + connection(PtrCast(i->second)); } } @@ -500,30 +500,30 @@ GraphCanvas::get_port_view(SharedPtr port) } void -GraphCanvas::connection(SharedPtr cm) +GraphCanvas::connection(SharedPtr arc) { - Ganv::Port* const tail = get_port_view(cm->tail()); - Ganv::Port* const head = get_port_view(cm->head()); + Ganv::Port* const tail = get_port_view(arc->tail()); + Ganv::Port* const head = get_port_view(arc->head()); if (tail && head) { - new GUI::Edge(*this, cm, tail, head, tail->get_fill_color()); + new GUI::Arc(*this, arc, tail, head, tail->get_fill_color()); } else { _app.log().error(Raul::fmt("Unable to find ports to connect %1% => %2%\n") - % cm->tail_path() % cm->head_path()); + % arc->tail_path() % arc->head_path()); } } void -GraphCanvas::disconnection(SharedPtr cm) +GraphCanvas::disconnection(SharedPtr arc) { - Ganv::Port* const src = get_port_view(cm->tail()); - Ganv::Port* const dst = get_port_view(cm->head()); + Ganv::Port* const src = get_port_view(arc->tail()); + Ganv::Port* const dst = get_port_view(arc->head()); if (src && dst) { remove_edge(src, dst); } else { _app.log().error(Raul::fmt("Unable to find ports to disconnect %1% => %2%\n") - % cm->tail_path() % cm->head_path()); + % arc->tail_path() % arc->head_path()); } } @@ -647,13 +647,13 @@ destroy_node(GanvNode* node, void* data) } static void -destroy_edge(GanvEdge* edge, void* data) +destroy_arc(GanvEdge* arc, void* data) { - App* app = (App*)data; - Ganv::Edge* edgemm = Glib::wrap(edge); + App* app = (App*)data; + Ganv::Edge* arcmm = Glib::wrap(arc); - Port* tail = dynamic_cast(edgemm->get_tail()); - Port* head = dynamic_cast(edgemm->get_head()); + Port* tail = dynamic_cast(arcmm->get_tail()); + Port* head = dynamic_cast(arcmm->get_head()); app->interface()->disconnect(tail->model()->path(), head->model()->path()); } @@ -661,7 +661,7 @@ void GraphCanvas::destroy_selection() { for_each_selected_node(destroy_node, &_app); - for_each_selected_edge(destroy_edge, &_app); + for_each_selected_edge(destroy_arc, &_app); } static void @@ -686,16 +686,16 @@ serialise_node(GanvNode* node, void* data) } static void -serialise_edge(GanvEdge* edge, void* data) +serialise_arc(GanvEdge* arc, void* data) { Serialisation::Serialiser* serialiser = (Serialisation::Serialiser*)data; - if (!GANV_IS_EDGE(edge)) { + if (!GANV_IS_EDGE(arc)) { return; } - GUI::Edge* gedge = dynamic_cast(Glib::wrap(GANV_EDGE(edge))); - if (gedge) { - serialiser->serialise_edge(Sord::Node(), gedge->model()); + GUI::Arc* garc = dynamic_cast(Glib::wrap(GANV_EDGE(arc))); + if (garc) { + serialiser->serialise_arc(Sord::Node(), garc->model()); } } @@ -707,7 +707,7 @@ GraphCanvas::copy_selection() serialiser.start_to_string(_graph->path(), base_uri); for_each_selected_node(serialise_node, &serialiser); - for_each_selected_edge(serialise_edge, &serialiser); + for_each_selected_edge(serialise_arc, &serialiser); const std::string result = serialiser.finish(); _paste_count = 0; diff --git a/src/gui/GraphCanvas.hpp b/src/gui/GraphCanvas.hpp index 3fb00619..1d04e582 100644 --- a/src/gui/GraphCanvas.hpp +++ b/src/gui/GraphCanvas.hpp @@ -32,7 +32,7 @@ #include "NodeModule.hpp" #include "ingen/Node.hpp" -#include "ingen/client/EdgeModel.hpp" +#include "ingen/client/ArcModel.hpp" namespace Ingen { @@ -68,8 +68,8 @@ public: void remove_block(SharedPtr bm); void add_port(SharedPtr pm); void remove_port(SharedPtr pm); - void connection(SharedPtr cm); - void disconnection(SharedPtr cm); + void connection(SharedPtr am); + void disconnection(SharedPtr am); void get_new_module_location(double& x, double& y); diff --git a/src/gui/wscript b/src/gui/wscript index 4732e56f..1f0a567f 100644 --- a/src/gui/wscript +++ b/src/gui/wscript @@ -28,9 +28,9 @@ def build(bld): obj.source = ''' App.cpp + Arc.cpp BreadCrumbs.cpp ConnectWindow.cpp - Edge.cpp GraphBox.cpp GraphCanvas.cpp GraphPortModule.cpp -- cgit v1.2.1