25#ifndef SRC_HEADERS_GX_UI_BUILDER_H_
26#define SRC_HEADERS_GX_UI_BUILDER_H_
28#include <gxwmm/controlparameter.h>
29#include <gxwmm/regler.h>
44 const string&
id, sigc::signal<
void(
bool)> *out_ctr,
bool disable);
47 sigc::signal<
void(
bool)> *out_ctr);
76 static Glib::RefPtr<GxBuilder>
create_from_file(
const std::string& filename,
const char* object_id);
77 static Glib::RefPtr<GxBuilder>
create_from_file(
const std::string& filename,
const Glib::ustring& object_id);
78 static Glib::RefPtr<GxBuilder>
create_from_file(
const std::string& filename,
const Glib::StringArrayHandle& object_ids);
79 static Glib::RefPtr<GxBuilder>
create_from_string(
const Glib::ustring& buffer,
const char* object_id);
80 static Glib::RefPtr<GxBuilder>
create_from_string(
const Glib::ustring& buffer,
const Glib::ustring& object_id);
81 static Glib::RefPtr<GxBuilder>
create_from_string(
const Glib::ustring& buffer,
const Glib::StringArrayHandle& object_ids);
84 static inline Glib::RefPtr<GxBuilder>
create() {
return Glib::RefPtr<GxBuilder>(
new GxBuilder()); }
87 const std::string& filename,
gx_engine::GxMachineBase* pmach = 0,
const char* object_id = 0, sigc::signal<
void(
bool)> *out_ctr = 0);
90 const std::string& filename,
gx_engine::GxMachineBase* pmach,
const Glib::StringArrayHandle& object_ids, sigc::signal<
void(
bool)> *out_ctr = 0);
93 const Glib::ustring& buffer,
gx_engine::GxMachineBase* pmach = 0,
const char* object_id = 0, sigc::signal<
void(
bool)> *out_ctr = 0);
96 const Glib::ustring& buffer,
gx_engine::GxMachineBase* pmach,
const Glib::StringArrayHandle& object_ids, sigc::signal<
void(
bool)> *out_ctr = 0);
109 template <
class T_W
idget>
inline
111 widget =
dynamic_cast<T_Widget*
>(get_widget_checked(name, T_Widget::get_base_type()));
116 template <
class T_Object>
inline
118 object =
dynamic_cast<T_Object*
>(get_object(name).get());
122 template <
class T_W
idget,
class F>
inline
125 typedef typename T_Widget::BaseObjectType cwidget_type;
126 cwidget_type* pCWidget = (cwidget_type*)
get_cobject(name);
130 Glib::ObjectBase* pObjectBase = ObjectBase::_get_current_wrapper((GObject*)pCWidget);
132 widget =
dynamic_cast<T_Widget*
>( Glib::wrap((GtkWidget*)pCWidget) );
134 g_critical(
"GxBuilder::get_widget_derived(): dynamic_cast<> failed. An existing C++ instance, of a different type, seems to exist.");
137 widget = f(pCWidget);
142 return gtk_builder_get_object(gobj(), name.c_str()) != 0;
145 template <
class T_W
idget>
inline
147 GType type = T_Widget::get_base_type();
148 widget =
dynamic_cast<T_Widget*
>(get_widget_checked(name, type));
150 assert(!widget->get_parent());
155 template <
class T_W
idget,
class F>
inline
158 typedef typename T_Widget::BaseObjectType cwidget_type;
159 cwidget_type* pCWidget = (cwidget_type*)
get_cobject(name);
163 if (!g_type_is_a(G_OBJECT_TYPE(pCWidget), GTK_TYPE_WINDOW)) {
164 g_object_ref(pCWidget);
166 Glib::ObjectBase* pObjectBase = ObjectBase::_get_current_wrapper((GObject*)pCWidget);
168 widget =
dynamic_cast<T_Widget*
>( Glib::wrap((GtkWidget*)pCWidget) );
170 g_critical(
"GxBuilder::get_widget_derived(): dynamic_cast<> failed. An existing C++ instance, of a different type, seems to exist.");
173 widget = f(pCWidget);
175 assert(!widget->get_parent());
179class StackBoxBuilder;
213 static void create_switch_(
const char *sw_type,
const char *
id,
const char *label);
230GtkWidget *
load_toplevel(GtkBuilder *builder,
const char* filename,
const char* windowname);
static void set_tooltip_text_connect_handler(GtkWidget *widget, const char *text)
void fixup_controlparameters(gx_engine::GxMachineBase &machine, sigc::signal< void(bool)> *out_ctr)
static void connect_gx_tooltip_handler(GtkWidget *widget)
static Glib::RefPtr< GxBuilder > create_from_string(const Glib::ustring &buffer, const Glib::ustring &object_id)
static Glib::RefPtr< GxBuilder > create_from_file(const std::string &filename, const char *object_id)
static void set_show_tooltips(bool v)
static Glib::RefPtr< GxBuilder > create_from_file(const std::string &filename, gx_engine::GxMachineBase *pmach=0, const char *object_id=0, sigc::signal< void(bool)> *out_ctr=0)
static Glib::RefPtr< GxBuilder > create_from_file(const std::string &filename, const Glib::ustring &object_id)
static void set_tooltip_text_connect_handler(Gtk::Widget &widget, const Glib::ustring &text)
GObject * get_cobject(const Glib::ustring &name)
static Glib::RefPtr< GxBuilder > create_from_file(const std::string &filename, gx_engine::GxMachineBase *pmach, const Glib::StringArrayHandle &object_ids, sigc::signal< void(bool)> *out_ctr=0)
static bool show_tooltips
void get_toplevel_derived(const Glib::ustring &name, T_Widget *&widget, F f)
static Glib::RefPtr< GxBuilder > create_from_string(const Glib::ustring &buffer, const Glib::StringArrayHandle &object_ids)
static bool get_show_tooltips()
void get_toplevel(const Glib::ustring &name, T_Widget *&widget)
static Glib::RefPtr< GxBuilder > create_from_file(const std::string &filename, const Glib::StringArrayHandle &object_ids)
void find_widget_derived(const Glib::ustring &name, T_Widget *&widget, F f)
static Glib::RefPtr< GxBuilder > create_from_string(const Glib::ustring &buffer, const char *object_id)
bool has_object(const Glib::ustring &name)
static Glib::RefPtr< GxBuilder > create_from_string(const Glib::ustring &buffer, gx_engine::GxMachineBase *pmach, const Glib::StringArrayHandle &object_ids, sigc::signal< void(bool)> *out_ctr=0)
void find_widget(const Glib::ustring &name, T_Widget *&widget)
Gtk::Window * get_first_window()
static Glib::RefPtr< GxBuilder > create()
void find_object(const Glib::ustring &name, T_Object *&object)
static Glib::RefPtr< GxBuilder > create_from_string(const Glib::ustring &buffer, gx_engine::GxMachineBase *pmach=0, const char *object_id=0, sigc::signal< void(bool)> *out_ctr=0)
static void set_tooltip_text_connect_handler(Gtk::Widget &widget, const char *text)
UiBuilderImpl(PluginDict *i, StackBoxBuilder *b, std::vector< PluginUI * > *pl, PluginUI *pluginui)
static void create_feedback_slider_(const char *id, const char *label)
static void create_selector_(const char *id, const char *label)
static void create_eq_rackslider_no_caption_(const char *id)
static void create_p_display_(const char *id, const char *idl, const char *idh)
static void create_mid_rackknob_(const char *id, const char *label)
static void openVerticalBox1_(const char *label)
static void create_simple_spin_value_(const char *id)
static void load_glade_(const char *data)
static StackBoxBuilder * intf
static void openFlipLabelBox_(const char *label)
static void insertSpacer_()
static void create_fload_switch_(const char *sw_type, const char *id, const char *idf)
static void create_port_display_(const char *id, const char *label)
static void openVerticalBox2_(const char *label)
static void create_wheel_(const char *id, const char *label)
static void openVerticalBox_(const char *label)
static void openTabBox_(const char *label)
static void openHorizontalhideBox_(const char *label)
static void create_feedback_switch_(const char *sw_type, const char *id)
bool load_unit(PluginDef *pl)
static void create_small_rackknobr_(const char *id, const char *label)
static void create_switch_(const char *sw_type, const char *id, const char *label)
static void create_spin_value_(const char *id, const char *label)
static void openHorizontalBox_(const char *label)
virtual bool load(gx_engine::Plugin *p)
static void create_selector_no_caption_(const char *id)
static void load_glade_file_(const char *fname)
static void create_switch_no_caption_(const char *sw_type, const char *id)
static void create_small_rackknob_(const char *id, const char *label)
static void create_master_slider_(const char *id, const char *label)
static void openpaintampBox_(const char *label)
std::vector< PluginUI * > * pluginlist
static void openHorizontalTableBox_(const char *label)
static void create_big_rackknob_(const char *id, const char *label)
static void create_simple_meter_(const char *id)
static void openFrameBox_(const char *label)
static void set_next_flags_(int flags)
static void create_simple_c_meter_(const char *id, const char *idl, const char *label)
gx_engine::Parameter * check_get_parameter(gx_engine::GxMachineBase &machine, const std::string &id, Gtk::Widget *w)
bool ui_connect(gx_engine::GxMachineBase &machine, Gtk::Widget *w, const std::string &id, sigc::signal< void(bool)> *out_ctr)
GtkWidget * load_toplevel(GtkBuilder *builder, const char *filename, const char *windowname)
gx_engine::FloatParameter * check_get_float_parameter(gx_engine::GxMachineBase &machine, const std::string &id, Gtk::Widget *w)
bool ui_connect_switch(gx_engine::GxMachineBase &machine, Gtk::ToggleButton *b, const string &id, sigc::signal< void(bool)> *out_ctr, bool disable)