aboutsummaryrefslogtreecommitdiffstats
path: root/src/gui/NodeView.cpp
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2013-01-11 21:07:26 +0000
committerDavid Robillard <d@drobilla.net>2013-01-11 21:07:26 +0000
commitbef1c2ea010da638ffbb437c37a6d32ddc99b568 (patch)
tree3c40f06df385e40edd512247eda23b1f650623df /src/gui/NodeView.cpp
parentd88a8a0a01baff2c4038c315672c6c670361b82c (diff)
downloadmachina-bef1c2ea010da638ffbb437c37a6d32ddc99b568.tar.gz
machina-bef1c2ea010da638ffbb437c37a6d32ddc99b568.tar.bz2
machina-bef1c2ea010da638ffbb437c37a6d32ddc99b568.zip
Bring Machina back into the fold (fix #844).
git-svn-id: http://svn.drobilla.net/lad/trunk/machina@4921 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/gui/NodeView.cpp')
-rw-r--r--src/gui/NodeView.cpp35
1 files changed, 20 insertions, 15 deletions
diff --git a/src/gui/NodeView.cpp b/src/gui/NodeView.cpp
index 5e8ceb4..bf7c0b6 100644
--- a/src/gui/NodeView.cpp
+++ b/src/gui/NodeView.cpp
@@ -40,8 +40,8 @@ NodeView::NodeView(Gtk::Window* window,
, _default_border_color(get_border_color())
, _default_fill_color(get_fill_color())
{
- signal_click().connect(
- sigc::mem_fun(this, &NodeView::on_click));
+ signal_event().connect(
+ sigc::mem_fun(this, &NodeView::on_event));
node->signal_property.connect(
sigc::mem_fun(this, &NodeView::on_property));
@@ -54,29 +54,34 @@ NodeView::on_double_click(GdkEventButton*)
}
bool
-NodeView::node_is(Machina::URIInt key)
+NodeView::node_is(Raul::Forge& forge, Machina::URIInt key)
{
const Raul::Atom& value = _node->get(key);
- return value.type() == Raul::Atom::BOOL && value.get_bool();
+ return value.type() == forge.Bool && value.get_bool();
}
bool
-NodeView::on_click(GdkEventButton* event)
+NodeView::on_event(GdkEvent* event)
{
- if (event->state & GDK_CONTROL_MASK) {
- MachinaCanvas* canvas = dynamic_cast<MachinaCanvas*>(this->canvas());
- if (event->button == 1) {
- canvas->app()->controller()->set_property(
+ MachinaCanvas* canvas = dynamic_cast<MachinaCanvas*>(this->canvas());
+ Raul::Forge& forge = canvas->app()->forge();
+ if (event->type == GDK_BUTTON_PRESS) {
+ if (event->button.state & GDK_CONTROL_MASK) {
+ if (event->button.button == 1) {
+ canvas->app()->controller()->set_property(
_node->id(),
URIs::instance().machina_initial,
- !node_is(URIs::instance().machina_initial));
- return true;
- } else if (event->button == 3) {
- canvas->app()->controller()->set_property(
+ forge.make(!node_is(forge, URIs::instance().machina_initial)));
+ return true;
+ } else if (event->button.button == 3) {
+ canvas->app()->controller()->set_property(
_node->id(),
URIs::instance().machina_selector,
- !node_is(URIs::instance().machina_selector));
- return true;
+ forge.make(!node_is(forge, URIs::instance().machina_selector)));
+ return true;
+ }
+ } else {
+ _signal_clicked.emit(&event->button);
}
}
return false;