Merged with trunk R1612.
[ardour.git] / gtk2_ardour / keyboard.h
index d7d527e63edc93c18f992e63fe3f3fcac8c53dc3..ec55dc54db7e4ddd111fb3a983c7d1fc031211be 100644 (file)
@@ -15,7 +15,6 @@
     along with this program; if not, write to the Free Software
     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 
-    $Id$
 */
 
 #ifndef __ardour_keyboard_h__
 #include <vector>
 #include <string>
 
-#include <sigc++/signal_system.h>
+#include <sigc++/signal.h>
 #include <gtk/gtk.h>
 
 #include <ardour/types.h>
-#include <ardour/stateful.h>
+#include <pbd/stateful.h>
+
+#include "selection.h"
 
 using std::vector;
 using std::string;
 
-class KeyboardTarget;
-class ArdourDialog;
-
-class Keyboard : public SigC::Object, Stateful
+class Keyboard : public sigc::trackable, Stateful
 {
   public:
        Keyboard ();
@@ -46,25 +44,6 @@ class Keyboard : public SigC::Object, Stateful
        int set_state (const XMLNode&);
 
        typedef vector<uint32_t> State;
-       
-       void set_target (KeyboardTarget *);
-       void set_default_target (KeyboardTarget *);
-       void allow_focus (bool);
-
-       gint focus_in_handler (GdkEventFocus*);
-       gint focus_out_handler (GdkEventFocus*);
-
-       int  get_prefix(float&, bool& was_floating);
-       void start_prefix ();
-
-       static State  translate_key_name (const string&);
-       static string get_real_keyname (const string& name);
-
-       void register_target (KeyboardTarget *);
-
-       void set_current_dialog (ArdourDialog*);
-       void close_current_dialog ();
-
        typedef uint32_t ModifierMask;
 
        static uint32_t Control;
@@ -80,9 +59,14 @@ class Keyboard : public SigC::Object, Stateful
                return (ev->state & RelevantModifierKeyMask) == 0;
        }
 
+       bool leave_window (GdkEventCrossing *ev, Gtk::Window*);
+       bool enter_window (GdkEventCrossing *ev, Gtk::Window*);
+
        static bool modifier_state_contains (guint state, ModifierMask);
        static bool modifier_state_equals   (guint state, ModifierMask);
 
+       static Selection::Operation selection_type (guint state);
+
        static bool no_modifiers_active (guint state);
 
        static void set_meta_modifier (guint);
@@ -109,23 +93,8 @@ class Keyboard : public SigC::Object, Stateful
   private:
        static Keyboard* _the_keyboard;
 
-       bool   _queue_events;
-       bool   _flush_queue;
-       guint32 playback_ignore_count;
-
        guint           snooper_id;
        State           state;
-       KeyboardTarget* target;
-       KeyboardTarget* default_target;
-       bool            focus_allowed;
-       bool            collecting_prefix;
-       string          current_prefix;
-       int*            modifier_masks;
-       int             modifier_mask;
-       int             min_keycode;
-       int             max_keycode;
-       ArdourDialog*   current_dialog;
-       std::vector<ArdourDialog*> known_dialogs;
 
        static guint     edit_but;
        static guint     edit_mod;
@@ -135,19 +104,6 @@ class Keyboard : public SigC::Object, Stateful
 
        static gint _snooper (GtkWidget*, GdkEventKey*, gpointer);
        gint snooper (GtkWidget*, GdkEventKey*);
-       
-       void maybe_unset_target (KeyboardTarget *);
-       void queue_event (GdkEventKey*);
-       void playback_queue ();
-       void clear_queue ();
-       void get_modifier_masks ();
-       void check_modifier_state ();
-       void clear_modifier_state ();
-       gint enter_window (GdkEventCrossing*, KeyboardTarget*);
-       gint leave_window (GdkEventCrossing*);
-       gint current_dialog_vanished (GdkEventAny*);
-
-       void check_meta_numlock (char keycode, guint mod, string modname);
 };
 
 #endif /* __ardour_keyboard_h__ */