- protected:
- void on_show ();
- void on_unmap ();
- bool on_key_press_event (GdkEventKey*);
- bool on_key_release_event (GdkEventKey*);
-
- private:
- struct KeyEditorColumns : public Gtk::TreeModel::ColumnRecord {
- KeyEditorColumns () {
- add (action);
- add (binding);
- add (path);
- add (bindable);
- }
- Gtk::TreeModelColumn<std::string> action;
- Gtk::TreeModelColumn<std::string> binding;
- Gtk::TreeModelColumn<std::string> path;
- Gtk::TreeModelColumn<bool> bindable;
+ void add_tab (std::string const &name, Gtkmm2ext::Bindings&);
+ void remove_tab (std::string const &name);
+
+ static sigc::signal<void> UpdateBindings;
+
+ void disconnect () {
+ _refresh_connection.disconnect ();
+ }
+
+private:
+ class Tab : public Gtk::VBox
+ {
+ public:
+ Tab (KeyEditor&, std::string const &name, Gtkmm2ext::Bindings*);
+
+ uint32_t populate ();
+ void unbind ();
+ void bind (GdkEventKey* release_event, guint pressed_key);
+ void action_selected ();
+ void sort_column_changed ();
+ void tab_mapped ();
+ bool visible_func(const Gtk::TreeModel::const_iterator& iter) const;
+
+ struct KeyEditorColumns : public Gtk::TreeModel::ColumnRecord {
+ KeyEditorColumns () {
+ add (name);
+ add (binding);
+ add (path);
+ add (bindable);
+ add (action);
+ }
+ Gtk::TreeModelColumn<std::string> name;
+ Gtk::TreeModelColumn<std::string> binding;
+ Gtk::TreeModelColumn<std::string> path;
+ Gtk::TreeModelColumn<bool> bindable;
+ Gtk::TreeModelColumn<Glib::RefPtr<Gtk::Action> > action;
+ };
+
+ Gtk::VBox vpacker;
+ /* give KeyEditor full access to these. This is just a helper
+ * class with no special semantics
+ */
+
+ KeyEditor& owner;
+ std::string name;
+ Gtkmm2ext::Bindings* bindings;
+ Gtk::ScrolledWindow scroller;
+ Gtk::TreeView view;
+ Glib::RefPtr<Gtk::TreeStore> data_model;
+ Glib::RefPtr<Gtk::TreeModelFilter> filter;
+ Glib::RefPtr<Gtk::TreeModelSort> sorted_filter;
+ KeyEditorColumns columns;
+ guint last_keyval;
+
+ protected:
+ bool key_press_event (GdkEventKey*);
+ bool key_release_event (GdkEventKey*);
+ Gtk::TreeModel::iterator find_action_path (Gtk::TreeModel::const_iterator begin, Gtk::TreeModel::const_iterator end, const std::string& path) const;