Strip trailing whitespace and fix other whitespace errors (e.g. space/tab mixing...
[ardour.git] / gtk2_ardour / keyeditor.h
1 #ifndef __ardour_gtk_key_editor_h__
2 #define __ardour_gtk_key_editor_h__
3
4 #include <string>
5
6 #include <gtkmm/buttonbox.h>
7 #include <gtkmm/treeview.h>
8 #include <gtkmm/treestore.h>
9 #include <gtkmm/scrolledwindow.h>
10 #include <glibmm/ustring.h>
11
12 #include "ardour_dialog.h"
13
14 class KeyEditor : public ArdourDialog
15 {
16   public:
17         KeyEditor ();
18
19   protected:
20         void on_show ();
21         void on_unmap ();
22         bool on_key_press_event (GdkEventKey*);
23         bool on_key_release_event (GdkEventKey*);
24
25   private:
26         struct KeyEditorColumns : public Gtk::TreeModel::ColumnRecord {
27             KeyEditorColumns () {
28                     add (action);
29                     add (binding);
30                     add (path);
31                     add (bindable);
32             }
33             Gtk::TreeModelColumn<Glib::ustring> action;
34             Gtk::TreeModelColumn<std::string> binding;
35             Gtk::TreeModelColumn<std::string> path;
36             Gtk::TreeModelColumn<bool> bindable;
37         };
38
39         Gtk::ScrolledWindow scroller;
40         Gtk::TreeView view;
41         Glib::RefPtr<Gtk::TreeStore> model;
42         KeyEditorColumns columns;
43         Gtk::Button unbind_button;
44         Gtk::HButtonBox unbind_box;
45
46         void unbind ();
47
48         bool can_bind;
49         guint last_state;
50
51         void action_selected ();
52         void populate ();
53 };
54
55 #endif /* __ardour_gtk_key_editor_h__ */