2 * Copyright (C) 2011-2012 Carl Hetherington <carl@carlh.net>
3 * Copyright (C) 2014-2017 Robin Gareus <robin@gareus.org>
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License along
16 * with this program; if not, write to the Free Software Foundation, Inc.,
17 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
21 #include "gtkmm2ext/keyboard.h"
22 #include "gtkmm2ext/persistent_tooltip.h"
24 #include "pbd/controllable.h"
26 #include "panner_interface.h"
27 #include "panner_editor.h"
33 using namespace ARDOUR;
34 using namespace Gtkmm2ext;
36 PannerInterface::PannerInterface (boost::shared_ptr<Panner> p)
42 set_flags (Gtk::CAN_FOCUS);
44 add_events (Gdk::ENTER_NOTIFY_MASK|Gdk::LEAVE_NOTIFY_MASK|
45 Gdk::KEY_PRESS_MASK|Gdk::KEY_RELEASE_MASK|
46 Gdk::BUTTON_PRESS_MASK|Gdk::BUTTON_RELEASE_MASK|
48 Gdk::POINTER_MOTION_MASK);
52 PannerInterface::~PannerInterface ()
58 PannerInterface::on_enter_notify_event (GdkEventCrossing *)
61 Keyboard::magic_widget_grab_focus ();
63 if (!proxy_controllable ().expired ()) {
64 PBD::Controllable::GUIFocusChanged (proxy_controllable ());
70 PannerInterface::on_leave_notify_event (GdkEventCrossing *)
72 Keyboard::magic_widget_drop_focus ();
73 if (!proxy_controllable ().expired ()) {
74 PBD::Controllable::GUIFocusChanged (boost::weak_ptr<PBD::Controllable> ());
80 PannerInterface::on_key_release_event (GdkEventKey*)
86 PannerInterface::value_change ()
93 PannerInterface::on_button_press_event (GdkEventButton* ev)
95 if (Gtkmm2ext::Keyboard::is_edit_event (ev)) {
104 PannerInterface::on_button_release_event (GdkEventButton* ev)
106 if (Gtkmm2ext::Keyboard::is_edit_event (ev)) {
107 /* We edited on the press, so claim the release */
115 PannerInterface::edit ()
123 PannerInterface::set_send_drawing_mode(bool onoff) {
124 if (_send_mode != onoff) {
130 PannerPersistentTooltip::PannerPersistentTooltip (Gtk::Widget* w)
131 : PersistentTooltip (w, true)
138 PannerPersistentTooltip::target_start_drag ()
144 PannerPersistentTooltip::target_stop_drag ()
150 PannerPersistentTooltip::dragging () const