1 #ifndef __libgtkmm2ext_bindings_h__
2 #define __libgtkmm2ext_bindings_h__
6 #include <gdk/gdkkeysyms.h>
7 #include <gtkmm/action.h>
8 #include <gtkmm/action.h>
9 #include <gtkmm/radioaction.h>
10 #include <gtkmm/toggleaction.h>
23 _val = GDK_VoidSymbol;
26 KeyboardKey (uint32_t state, uint32_t keycode);
28 uint32_t state() const { return _val >> 32; }
29 uint32_t key() const { return _val & 0xffff; }
31 bool operator<(const KeyboardKey& other) const {
32 return _val < other._val;
35 bool operator==(const KeyboardKey& other) const {
36 return _val == other._val;
39 std::string name() const;
40 static bool make_key (const std::string&, KeyboardKey&);
41 static void set_ignored_state (int mask) {
42 _ignored_state = mask;
47 static uint32_t _ignored_state;
55 Glib::RefPtr<Gtk::Action> register_action (const char* path,
56 const char* name, const char* label, sigc::slot<void> sl);
57 Glib::RefPtr<Gtk::Action> register_radio_action (const char* path, Gtk::RadioAction::Group&,
58 const char* name, const char* label,
59 sigc::slot<void,GtkAction*> sl,
61 Glib::RefPtr<Gtk::Action> register_toggle_action (const char*path,
62 const char* name, const char* label, sigc::slot<void> sl);
64 Glib::RefPtr<Gtk::Action> find_action (const std::string& name);
67 typedef std::map<std::string, Glib::RefPtr<Gtk::Action> > _ActionMap;
76 void add (KeyboardKey, KeyboardKey::Operation, Glib::RefPtr<Gtk::Action>);
77 void remove (KeyboardKey, KeyboardKey::Operation);
78 bool activate (KeyboardKey, KeyboardKey::Operation);
80 bool load (const std::string& path);
81 bool save (const std::string& path);
83 void set_action_map (ActionMap&);
86 typedef std::map<KeyboardKey,Glib::RefPtr<Gtk::Action> > KeybindingMap;
87 KeybindingMap press_bindings;
88 KeybindingMap release_bindings;
90 ActionMap* action_map;
95 #endif /* __libgtkmm2ext_bindings_h__ */