diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2011-03-04 03:10:48 +0000 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2011-03-04 03:10:48 +0000 |
commit | d08e3b94c5ef75ce5d4d28f3636faa8af4661e17 (patch) | |
tree | 07b81d1a8d8c8c6c7d5a39b64c4d2357e31c6b7d /gtk2_ardour/editor_mouse.cc | |
parent | 3d1fc33abb9592379ed5600a60e3097013eed9fb (diff) |
basic adoption of new mouse binding facility
git-svn-id: svn://localhost/ardour2/branches/3.0@9063 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour/editor_mouse.cc')
-rw-r--r-- | gtk2_ardour/editor_mouse.cc | 27 |
1 files changed, 25 insertions, 2 deletions
diff --git a/gtk2_ardour/editor_mouse.cc b/gtk2_ardour/editor_mouse.cc index 9e6d3922fe..2733280dac 100644 --- a/gtk2_ardour/editor_mouse.cc +++ b/gtk2_ardour/editor_mouse.cc @@ -27,12 +27,14 @@ #include "pbd/error.h" #include "pbd/enumwriter.h" -#include <gtkmm2ext/utils.h> -#include <gtkmm2ext/tearoff.h> #include "pbd/memento_command.h" #include "pbd/basename.h" #include "pbd/stateful_diff_command.h" +#include "gtkmm2ext/bindings.h" +#include "gtkmm2ext/utils.h" +#include "gtkmm2ext/tearoff.h" + #include "ardour_ui.h" #include "actions.h" #include "canvas-note.h" @@ -1168,6 +1170,7 @@ Editor::button_press_handler (ArdourCanvas::Item* item, GdkEvent* event, ItemTyp break; default: + return button_press_dispatch (&event->button); break; } @@ -1176,6 +1179,26 @@ Editor::button_press_handler (ArdourCanvas::Item* item, GdkEvent* event, ItemTyp } bool +Editor::button_press_dispatch (GdkEventButton* ev) +{ + /* this function is intended only for buttons 4 and above. + */ + + Gtkmm2ext::MouseButton b (ev->state, ev->button); + return button_bindings->activate (b, Gtkmm2ext::Bindings::Press); +} + +bool +Editor::button_release_dispatch (GdkEventButton* ev) +{ + /* this function is intended only for buttons 4 and above. + */ + + Gtkmm2ext::MouseButton b (ev->state, ev->button); + return button_bindings->activate (b, Gtkmm2ext::Bindings::Release); +} + +bool Editor::button_release_handler (ArdourCanvas::Item* item, GdkEvent* event, ItemType item_type) { framepos_t where = event_frame (event, 0, 0); |