aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/gui/EdgeView.cpp2
-rw-r--r--src/gui/EdgeView.hpp2
-rw-r--r--src/gui/MachinaCanvas.cpp4
-rw-r--r--src/gui/NodeView.cpp6
-rw-r--r--src/gui/NodeView.hpp2
5 files changed, 8 insertions, 8 deletions
diff --git a/src/gui/EdgeView.cpp b/src/gui/EdgeView.cpp
index a8a9f92..b422e5e 100644
--- a/src/gui/EdgeView.cpp
+++ b/src/gui/EdgeView.cpp
@@ -62,7 +62,7 @@ inline static uint32_t edge_color(float prob)
using namespace FlowCanvas;
-EdgeView::EdgeView(SharedPtr<Canvas> canvas,
+EdgeView::EdgeView(Canvas& canvas,
SharedPtr<NodeView> src,
SharedPtr<NodeView> dst,
SharedPtr<Machina::Client::ClientObject> edge)
diff --git a/src/gui/EdgeView.hpp b/src/gui/EdgeView.hpp
index fcdbfa4..30c5b75 100644
--- a/src/gui/EdgeView.hpp
+++ b/src/gui/EdgeView.hpp
@@ -30,7 +30,7 @@ class EdgeView
: public FlowCanvas::Connection
, public Machina::Client::ClientObject::View {
public:
- EdgeView(SharedPtr<FlowCanvas::Canvas> canvas,
+ EdgeView(FlowCanvas::Canvas& canvas,
SharedPtr<NodeView> src,
SharedPtr<NodeView> dst,
SharedPtr<Machina::Client::ClientObject> edge);
diff --git a/src/gui/MachinaCanvas.cpp b/src/gui/MachinaCanvas.cpp
index b65a4bb..efb677f 100644
--- a/src/gui/MachinaCanvas.cpp
+++ b/src/gui/MachinaCanvas.cpp
@@ -100,7 +100,7 @@ MachinaCanvas::on_new_object(SharedPtr<Client::ClientObject> object)
const Raul::Atom& type = object->get(uris.rdf_type);
if (type == "machina:Node") {
SharedPtr<NodeView> view(
- new NodeView(_app->window(), shared_from_this(), object,
+ new NodeView(_app->window(), *this, object,
object->get(uris.machina_canvas_x).get_float(),
object->get(uris.machina_canvas_y).get_float()));
@@ -124,7 +124,7 @@ MachinaCanvas::on_new_object(SharedPtr<Client::ClientObject> object)
SharedPtr<NodeView> head_view = PtrCast<NodeView>(head->view());
SharedPtr<EdgeView> view(
- new EdgeView(shared_from_this(), tail_view, head_view, object));
+ new EdgeView(*this, tail_view, head_view, object));
tail_view->add_connection(view);
head_view->add_connection(view);
diff --git a/src/gui/NodeView.cpp b/src/gui/NodeView.cpp
index 964fc04..e417ffa 100644
--- a/src/gui/NodeView.cpp
+++ b/src/gui/NodeView.cpp
@@ -30,7 +30,7 @@ using namespace std;
using Machina::URIs;
NodeView::NodeView(Gtk::Window* window,
- SharedPtr<FlowCanvas::Canvas> canvas,
+ FlowCanvas::Canvas& canvas,
SharedPtr<Machina::Client::ClientObject> node,
double x,
double y)
@@ -64,7 +64,7 @@ void
NodeView::handle_click(GdkEventButton* event)
{
if (event->state & GDK_CONTROL_MASK) {
- SharedPtr<MachinaCanvas> canvas = PtrCast<MachinaCanvas>(_canvas.lock());
+ MachinaCanvas* canvas = dynamic_cast<MachinaCanvas*>(_canvas);
if (event->button == 1) {
canvas->app()->controller()->set_property(
_node->id(),
@@ -156,7 +156,7 @@ NodeView::on_property(Machina::URIInt key, const Raul::Atom& value)
}
} else if (key == URIs::instance().machina_enter_action) {
const uint64_t action_id = value.get_int32();
- SharedPtr<MachinaCanvas> canvas = PtrCast<MachinaCanvas>(_canvas.lock());
+ MachinaCanvas* canvas = dynamic_cast<MachinaCanvas*>(_canvas);
_enter_action_connection.disconnect();
_enter_action = canvas->app()->client_model()->find(action_id);
_enter_action_connection = _enter_action->signal_property.connect(
diff --git a/src/gui/NodeView.hpp b/src/gui/NodeView.hpp
index 0736af9..29ceb9b 100644
--- a/src/gui/NodeView.hpp
+++ b/src/gui/NodeView.hpp
@@ -29,7 +29,7 @@ class NodeView
, public Machina::Client::ClientObject::View {
public:
NodeView(Gtk::Window* window,
- SharedPtr<FlowCanvas::Canvas> canvas,
+ Canvas& canvas,
SharedPtr<Machina::Client::ClientObject> node,
double x,
double y);