Guitarix
gx_stackbox_builder.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 2011, 2012 Andreas Degert, Hermann Meyer
3 *
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.
8 *
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.
13 *
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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
17 */
18
19#include "guitarix.h" // NOLINT
20
21#include <glibmm/i18n.h> // NOLINT
22
23namespace gx_gui {
24
25/****************************************************************/
26
28private:
29 std::vector<Gtk::Widget*> stack;
30 Gtk::Widget *top() { return stack.back(); }
31public:
34 bool empty() { return stack.empty(); }
35 void push(Gtk::Widget *w) { stack.push_back(w); }
36 void pop() { return stack.pop_back(); }
37 void container_add(Gtk::Widget *w);
38 void box_pack_start(Gtk::Widget *w, bool expand=true, bool fill=true, int padding=0);
39 void notebook_append_page(Gtk::Widget *w, Gtk::Widget *label);
40 bool top_is_notebook() { return dynamic_cast<Gtk::Notebook*>(top()) != 0; }
41 Gtk::Widget *add(Gtk::Widget *w, const Glib::ustring& label = Glib::ustring());
42};
43
45private:
48 Gtk::HBox *widget;
49 Glib::RefPtr<Gtk::AccelGroup> accels;
50 Glib::RefPtr<Gdk::Pixbuf> window_icon;
53
54private:
55 void loadRackFromBuilder(const Glib::RefPtr<GxBuilder>& bld);
56 // functions used in interfaces
57 void create_master_slider(const std::string& id, const char *label);
58
59 void closeBox();
61
62 void check_set_flags(Gxw::Regler *r);
63 void create_simple_meter(const std::string& id);
64 void create_simple_c_meter(const std::string& id, const std::string& idl, const char *label);
65 void create_mid_rackknob(const std::string& id, const char *label);
66 void create_small_rackknob(const std::string& id, const char *label);
67 void create_small_rackknobr(const std::string& id, const char *label);
68 void create_big_rackknob(const std::string& id, const char *label);
69
70 void openVerticalBox(const char* label = "");
71 void openFrameBox(const char* label);
72 void openHorizontalBox(const char* label = "");
73 void openHorizontalhideBox(const char* label = "");
74 void openHorizontalTableBox(const char* label);
75 void create_switch_no_caption(const char *sw_type, const std::string& id);
76 void create_v_switch(const char *sw_type, const std::string& id, const char *label);
77 void openpaintampBox(const char* label = "");
78 void create_wheel(const std::string& id, const char *label=0);
79 void create_spin_value(const std::string& id, const char *label);
80 void create_simple_spin_value(const std::string& id);
81 void create_eq_rackslider_no_caption(const std::string& id);
82 void create_port_display(const std::string& id, const char *label);
83 void create_p_display(const std::string& id, const std::string& idl, const std::string& idh);
84 void create_feedback_switch(const char *sw_type, const std::string& id);
85 void create_feedback_slider(const std::string& id, const char *label);
86 void create_fload_switch(const char *sw_type, const char *id, const std::string& idf);
87 void create_selector(const std::string& id, const char *widget_name=0);
88 void create_selector_with_caption(const std::string& id, const char *label);
89 void openFlipLabelBox(const char* = 0);
90 void openVerticalBox1(const char* label = 0);
91 void openVerticalBox2(const char* label = 0);
92 void openTabBox(const char* label = 0);
93 void set_next_flags(int flags);
94private:
95 // functions used indirectly
96 void addwidget(Gtk::Widget *widget);
97 bool ui_connect(Gtk::Widget *widget, const std::string& id);
98 void add_regler(CpBaseCaption *w, Gxw::Regler *r, const std::string& id, const char *label);
99 void load_file(const std::string& id, const std::string& idf);
100 void on_file_chooser_response(int response_id, Gtk::FileChooserDialog *d,
101 const std::string& id, const std::string& idf);
102 void load_file_f(const std::string& id, const std::string& idf);
103 void loadRackFromGladeData(const char *xmldesc);
104 void loadRackFromGladeFile(const char *fname);
105 friend class UiBuilderImpl;
106
107public:
109 gx_engine::GxMachineBase& machine_, Glib::RefPtr<Gdk::Pixbuf> window_icon);
111 void set_accelgroup(Glib::RefPtr<Gtk::AccelGroup> accels_) { accels = accels_; }
112 void prepare();
113 void fetch(Gtk::Widget*& mainbox, Gtk::Widget*& minibox);
115 void connect_signals(Glib::RefPtr<GxBuilder> builder, Glib::RefPtr<Glib::Object> object,
116 const char *signal_name, const char *handler_name);
117};
118
119} // end namespace gx_gui
void create_switch_no_caption(const char *sw_type, const std::string &id)
void add_regler(CpBaseCaption *w, Gxw::Regler *r, const std::string &id, const char *label)
void create_mid_rackknob(const std::string &id, const char *label)
void openVerticalBox1(const char *label=0)
void create_selector_with_caption(const std::string &id, const char *label)
void openVerticalBox(const char *label="")
void create_wheel(const std::string &id, const char *label=0)
void set_next_flags(int flags)
void openHorizontalhideBox(const char *label="")
void load_file(const std::string &id, const std::string &idf)
StackBoxBuilder(gx_engine::GxMachineBase &machine_, Glib::RefPtr< Gdk::Pixbuf > window_icon)
void create_feedback_switch(const char *sw_type, const std::string &id)
void create_selector(const std::string &id, const char *widget_name=0)
void create_big_rackknob(const std::string &id, const char *label)
void create_spin_value(const std::string &id, const char *label)
void openHorizontalTableBox(const char *label)
void openFlipLabelBox(const char *=0)
void create_fload_switch(const char *sw_type, const char *id, const std::string &idf)
void connect_signals(Glib::RefPtr< GxBuilder > builder, Glib::RefPtr< Glib::Object > object, const char *signal_name, const char *handler_name)
void create_p_display(const std::string &id, const std::string &idl, const std::string &idh)
void loadRackFromGladeData(const char *xmldesc)
void create_simple_spin_value(const std::string &id)
void loadRackFromBuilder(const Glib::RefPtr< GxBuilder > &bld)
void openFrameBox(const char *label)
void loadRackFromGladeFile(const char *fname)
void openpaintampBox(const char *label="")
void addwidget(Gtk::Widget *widget)
void set_accelgroup(Glib::RefPtr< Gtk::AccelGroup > accels_)
void fetch(Gtk::Widget *&mainbox, Gtk::Widget *&minibox)
void create_simple_c_meter(const std::string &id, const std::string &idl, const char *label)
void create_small_rackknobr(const std::string &id, const char *label)
void create_v_switch(const char *sw_type, const std::string &id, const char *label)
bool ui_connect(Gtk::Widget *widget, const std::string &id)
void openHorizontalBox(const char *label="")
void check_set_flags(Gxw::Regler *r)
gx_engine::GxMachineBase & machine
void set_current_plugin(PluginUI *p)
void load_file_f(const std::string &id, const std::string &idf)
void create_eq_rackslider_no_caption(const std::string &id)
Glib::RefPtr< Gdk::Pixbuf > window_icon
void create_feedback_slider(const std::string &id, const char *label)
void create_simple_meter(const std::string &id)
void openTabBox(const char *label=0)
void create_port_display(const std::string &id, const char *label)
void openVerticalBox2(const char *label=0)
void create_small_rackknob(const std::string &id, const char *label)
void on_file_chooser_response(int response_id, Gtk::FileChooserDialog *d, const std::string &id, const std::string &idf)
void create_master_slider(const std::string &id, const char *label)
Glib::RefPtr< Gtk::AccelGroup > accels
void push(Gtk::Widget *w)
void box_pack_start(Gtk::Widget *w, bool expand=true, bool fill=true, int padding=0)
void notebook_append_page(Gtk::Widget *w, Gtk::Widget *label)
void container_add(Gtk::Widget *w)
Gtk::Widget * add(Gtk::Widget *w, const Glib::ustring &label=Glib::ustring())
std::vector< Gtk::Widget * > stack