X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=gtk2_ardour%2Fkeyboard.h;h=f7b52d3ae1f161afc036291806742a9e7bc33801;hb=refs%2Ftags%2F5.4;hp=95e40f6e3e6b6dcdbca15a0ef42757fefe152d7d;hpb=186736043cb277b8352a08d1cf61bc81f3169852;p=ardour.git diff --git a/gtk2_ardour/keyboard.h b/gtk2_ardour/keyboard.h index 95e40f6e3e..f7b52d3ae1 100644 --- a/gtk2_ardour/keyboard.h +++ b/gtk2_ardour/keyboard.h @@ -20,6 +20,9 @@ #ifndef __ardour_keyboard_h__ #define __ardour_keyboard_h__ +#include +#include + #include "ardour/types.h" #include "gtkmm2ext/keyboard.h" @@ -30,7 +33,7 @@ class ARDOUR_UI; class ArdourKeyboard : public Gtkmm2ext::Keyboard { public: - ArdourKeyboard(ARDOUR_UI& ardour_ui) : ui(ardour_ui) {} + ArdourKeyboard(ARDOUR_UI&); XMLNode& get_state (void); int set_state (const XMLNode&, int version); @@ -41,6 +44,33 @@ class ArdourKeyboard : public Gtkmm2ext::Keyboard ARDOUR_UI& ui; + void reset_relevant_modifier_key_mask (); + + /** @param state The button state from a GdkEvent. + * @return true if the modifier state indicates snap modifier + */ + static bool indicates_snap (guint state); + + /** @param state The button state from a GdkEvent. + * @return true if the modifier state indicates snap delta + */ + static bool indicates_snap_delta (guint state); + + /** @param state The button state from a GdkEvent. + * @return true if the modifier state indicates copy modifier + */ + static bool indicates_copy (guint state); + + /** @param state The button state from a GdkEvent. + * @return true if the modifier state indicates constraint modifier + */ + static bool indicates_constraint (guint state); + + static void set_constraint_modifier (guint); + /** @return Modifier mask to constrain drags in a particular direction; + */ + static ModifierMask constraint_modifier () { return ModifierMask (constraint_mod); } + static void set_trim_contents_modifier (guint); /** @return Modifier mask to move contents rather than region bounds during trim; */ @@ -71,12 +101,15 @@ class ArdourKeyboard : public Gtkmm2ext::Keyboard */ static ModifierMask note_size_relative_modifier () { return ModifierMask (note_size_relative_mod); } private: + static guint constraint_mod; static guint trim_contents_mod; static guint trim_overlap_mod; static guint trim_anchored_mod; static guint fine_adjust_mod; static guint push_points_mod; static guint note_size_relative_mod; + + void find_bindings_files (std::map& files); }; #endif /* __ardour_keyboard_h__ */