2 Copyright (C) 2010 Paul Davis
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; either version 2 of the License, or
7 (at your option) any later version.
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
14 You should have received a copy of the GNU General Public License
15 along with this program; if not, write to the Free Software
16 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20 #include <gtkmm/comboboxtext.h>
21 #include <gtkmm/box.h>
22 #include <gtkmm/spinbutton.h>
23 #include <gtkmm/table.h>
24 #include <gtkmm/treeview.h>
25 #include <gtkmm/liststore.h>
26 #include <gtkmm/notebook.h>
27 #include <gtkmm/scrolledwindow.h>
30 class CellRendererCombo;
33 class MackieControlProtocol;
37 class MackieControlProtocolGUI : public Gtk::Notebook
40 MackieControlProtocolGUI (MackieControlProtocol &);
43 void surface_combo_changed ();
45 MackieControlProtocol& _cp;
46 Gtk::ComboBoxText _surface_combo;
48 struct AvailableActionColumns : public Gtk::TreeModel::ColumnRecord {
49 AvailableActionColumns() {
53 Gtk::TreeModelColumn<std::string> name;
54 Gtk::TreeModelColumn<std::string> path;
57 struct FunctionKeyColumns : public Gtk::TreeModel::ColumnRecord {
58 FunctionKeyColumns() {
68 Gtk::TreeModelColumn<std::string> name;
69 Gtk::TreeModelColumn<uint32_t> number;
70 Gtk::TreeModelColumn<std::string> plain;
71 Gtk::TreeModelColumn<std::string> shift;
72 Gtk::TreeModelColumn<std::string> control;
73 Gtk::TreeModelColumn<std::string> option;
74 Gtk::TreeModelColumn<std::string> cmdalt;
75 Gtk::TreeModelColumn<std::string> shiftcontrol;
78 AvailableActionColumns available_action_columns;
79 FunctionKeyColumns function_key_columns;
81 Gtk::ScrolledWindow function_key_scroller;
82 Gtk::TreeView function_key_editor;
83 Glib::RefPtr<Gtk::ListStore> function_key_model;
84 Glib::RefPtr<Gtk::TreeStore> available_action_model;
86 void rebuild_function_key_editor ();
87 void action_changed (const Glib::ustring &sPath, const Glib::ustring &text, Gtk::TreeModelColumnBase);
88 Gtk::CellRendererCombo* make_action_renderer (Glib::RefPtr<Gtk::TreeStore> model, Gtk::TreeModelColumnBase);