diff options
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/MachinaCanvas.cpp | 9 | ||||
-rw-r--r-- | src/gui/MachinaGUI.cpp | 5 | ||||
-rw-r--r-- | src/gui/MachinaGUI.hpp | 4 | ||||
-rw-r--r-- | src/gui/main.cpp | 3 |
4 files changed, 12 insertions, 9 deletions
diff --git a/src/gui/MachinaCanvas.cpp b/src/gui/MachinaCanvas.cpp index 26c805b..ba43b4e 100644 --- a/src/gui/MachinaCanvas.cpp +++ b/src/gui/MachinaCanvas.cpp @@ -18,11 +18,12 @@ #include <map> #include "raul/SharedPtr.hpp" #include "raul/TimeStamp.hpp" -#include "machina/Node.hpp" -#include "machina/Machine.hpp" #include "machina/Action.hpp" #include "machina/Edge.hpp" +#include "machina/Engine.hpp" #include "machina/LearnRequest.hpp" +#include "machina/Machine.hpp" +#include "machina/Node.hpp" #include "MachinaGUI.hpp" #include "MachinaCanvas.hpp" #include "NodeView.hpp" @@ -53,7 +54,7 @@ MachinaCanvas::node_clicked(WeakPtr<NodeView> item, GdkEventButton* event) // Middle click, learn if (event->button == 2) { - _app->machine()->learn(Machina::LearnRequest::create(_app->maid(), node->node())); + _app->engine()->machine()->learn(Machina::LearnRequest::create(_app->maid(), node->node())); return; } else if (event->button == 3) { SharedPtr<NodeView> last = _last_clicked.lock(); @@ -82,7 +83,7 @@ MachinaCanvas::canvas_event(GdkEvent* event) { static int last = 0; - SharedPtr<Machina::Machine> machine = _app->machine(); + SharedPtr<Machina::Machine> machine = _app->engine()->machine(); if (!machine) return false; diff --git a/src/gui/MachinaGUI.cpp b/src/gui/MachinaGUI.cpp index a71a980..2b40b0a 100644 --- a/src/gui/MachinaGUI.cpp +++ b/src/gui/MachinaGUI.cpp @@ -25,6 +25,7 @@ #include <libgnomecanvasmm.h> #include <libglademm/xml.h> #include "redlandmm/Model.hpp" +#include "machina/Engine.hpp" #include "machina/Machine.hpp" #include "machina/Mutation.hpp" #include "machina/SMFDriver.hpp" @@ -240,7 +241,7 @@ MachinaGUI::scrolled_window_event(GdkEvent* event) i != selection.end(); ++i) { SharedPtr<NodeView> view = PtrCast<NodeView>(*i); if (view) { - machine()->remove_node(view->node()); + _engine->machine()->remove_node(view->node()); _canvas->remove_item(view); } } @@ -446,7 +447,7 @@ MachinaGUI::menu_file_save() Redland::Model model(_engine->rdf_world()); model.set_base_uri(_save_uri); - machine()->write_state(model); + _engine->machine()->write_state(model); model.serialise_to_file(_save_uri); } } diff --git a/src/gui/MachinaGUI.hpp b/src/gui/MachinaGUI.hpp index 28ae5c6..64322d0 100644 --- a/src/gui/MachinaGUI.hpp +++ b/src/gui/MachinaGUI.hpp @@ -36,8 +36,8 @@ public: MachinaGUI(SharedPtr<Machina::Engine> engine); ~MachinaGUI(); - boost::shared_ptr<MachinaCanvas> canvas() { return _canvas; } - boost::shared_ptr<Machina::Machine> machine() { return _engine->machine(); } + boost::shared_ptr<MachinaCanvas> canvas() { return _canvas; } + boost::shared_ptr<Machina::Engine> engine() { return _engine; } SharedPtr<Raul::Maid> maid() { return _maid; } diff --git a/src/gui/main.cpp b/src/gui/main.cpp index 62d47c1..8d9b000 100644 --- a/src/gui/main.cpp +++ b/src/gui/main.cpp @@ -21,8 +21,9 @@ #include <string> #include <libgnomecanvasmm.h> #include "redlandmm/World.hpp" -#include "machina/Machine.hpp" +#include "machina/Engine.hpp" #include "machina/Loader.hpp" +#include "machina/Machine.hpp" #include "machina/SMFDriver.hpp" #include "MachinaGUI.hpp" |