summaryrefslogtreecommitdiffstats
path: root/src/gui
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2011-12-05 21:57:49 +0000
committerDavid Robillard <d@drobilla.net>2011-12-05 21:57:49 +0000
commit1a3615279866b201f842ea95addfa0cbb7731d6d (patch)
treef71f3ee16a5b85d898b8187052ff49a8ecafec1f /src/gui
parent0cef0a2e62b3d3c9f33822702fa7603c3448f064 (diff)
downloadingen-1a3615279866b201f842ea95addfa0cbb7731d6d.tar.gz
ingen-1a3615279866b201f842ea95addfa0cbb7731d6d.tar.bz2
ingen-1a3615279866b201f842ea95addfa0cbb7731d6d.zip
Move event handling down to C level.
git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@3809 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/NodeModule.cpp13
-rw-r--r--src/gui/NodeModule.hpp1
-rw-r--r--src/gui/PatchView.cpp4
3 files changed, 12 insertions, 6 deletions
diff --git a/src/gui/NodeModule.cpp b/src/gui/NodeModule.cpp
index 188925c5..8d7dd702 100644
--- a/src/gui/NodeModule.cpp
+++ b/src/gui/NodeModule.cpp
@@ -360,11 +360,16 @@ NodeModule::show_control_window()
app().window_factory()->present_controls(_node);
}
-void
-NodeModule::on_double_click(GdkEventButton* ev)
+bool
+NodeModule::on_event(GdkEvent* ev)
{
- if ( ! popup_gui() )
- show_control_window();
+ if (ev->type == GDK_2BUTTON_PRESS) {
+ if (!popup_gui()) {
+ show_control_window();
+ }
+ return true;
+ }
+ return false;
}
void
diff --git a/src/gui/NodeModule.hpp b/src/gui/NodeModule.hpp
index 0c579d27..16d777ba 100644
--- a/src/gui/NodeModule.hpp
+++ b/src/gui/NodeModule.hpp
@@ -69,6 +69,7 @@ public:
protected:
NodeModule(PatchCanvas& canvas, SharedPtr<const NodeModel> node);
+ bool on_event(GdkEvent* ev);
bool on_click(GdkEventButton* ev);
void on_double_click(GdkEventButton* ev);
diff --git a/src/gui/PatchView.cpp b/src/gui/PatchView.cpp
index fd9a4867..4b920368 100644
--- a/src/gui/PatchView.cpp
+++ b/src/gui/PatchView.cpp
@@ -137,7 +137,7 @@ void
PatchView::on_editable_sig(bool editable)
{
_edit_mode_but->set_active(editable);
- _canvas->lock(!editable);
+ _canvas->set_locked(!editable);
}
void
@@ -151,7 +151,7 @@ void
PatchView::set_editable(bool editable)
{
_patch->set_editable(editable);
- _canvas->lock(!editable);
+ _canvas->set_locked(!editable);
}
#if 0