summaryrefslogtreecommitdiffstats
path: root/src/libs/gui
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2007-09-22 19:43:11 +0000
committerDavid Robillard <d@drobilla.net>2007-09-22 19:43:11 +0000
commit4bd53e016b8bb912e48d77e756720516d876d5c2 (patch)
treef8d9790c5b4d7d615431c8f0fade26ae8e3ca414 /src/libs/gui
parentd348e467cd87bda8a75337b16fb00ea37c627bcf (diff)
downloadingen-4bd53e016b8bb912e48d77e756720516d876d5c2.tar.gz
ingen-4bd53e016b8bb912e48d77e756720516d876d5c2.tar.bz2
ingen-4bd53e016b8bb912e48d77e756720516d876d5c2.zip
LV2 UI extension updates.
LV2 GUI support in ingen. git-svn-id: http://svn.drobilla.net/lad/ingen@763 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/libs/gui')
-rw-r--r--src/libs/gui/NodeMenu.cpp15
-rw-r--r--src/libs/gui/NodeMenu.hpp2
-rw-r--r--src/libs/gui/NodeModule.cpp30
-rw-r--r--src/libs/gui/ingen_gui.glade16
4 files changed, 55 insertions, 8 deletions
diff --git a/src/libs/gui/NodeMenu.cpp b/src/libs/gui/NodeMenu.cpp
index 54966e7e..9c2d978e 100644
--- a/src/libs/gui/NodeMenu.cpp
+++ b/src/libs/gui/NodeMenu.cpp
@@ -37,10 +37,13 @@ NodeMenu::NodeMenu(BaseObjectType* cobject, const Glib::RefPtr<Gnome::Glade::Xml
Gtk::Menu* node_menu = NULL;
xml->get_widget("node_menu", node_menu);
xml->get_widget("node_controls_menuitem", _controls_menuitem);
+ xml->get_widget("node_gui_menuitem", _gui_menuitem);
node_menu->remove(*_controls_menuitem);
+ node_menu->remove(*_gui_menuitem);
items().push_front(Gtk::Menu_Helpers::SeparatorElem());
insert(*_controls_menuitem, 0);
+ insert(*_gui_menuitem, 0);
}
@@ -52,12 +55,24 @@ NodeMenu::init(SharedPtr<NodeModel> node)
_controls_menuitem->signal_activate().connect(sigc::bind(
sigc::mem_fun(App::instance().window_factory(), &WindowFactory::present_controls),
node));
+
+ if (node->plugin()->ui())
+ _gui_menuitem->signal_activate().connect(sigc::mem_fun(this, &NodeMenu::show_gui));
+ //else
+ // _gui_menuitem->hide();
_enable_signal = true;
}
void
+NodeMenu::show_gui()
+{
+ cerr << "SHOW GUI" << endl;
+}
+
+
+void
NodeMenu::on_menu_clone()
{
cerr << "[NodeMenu] FIXME: clone broken\n";
diff --git a/src/libs/gui/NodeMenu.hpp b/src/libs/gui/NodeMenu.hpp
index 20bc62e7..50226837 100644
--- a/src/libs/gui/NodeMenu.hpp
+++ b/src/libs/gui/NodeMenu.hpp
@@ -55,11 +55,13 @@ protected:
virtual void enable_controls_menuitem();
virtual void disable_controls_menuitem();
+ void show_gui();
void on_menu_clone();
void on_menu_learn();
Gtk::MenuItem* _controls_menuitem;
+ Gtk::MenuItem* _gui_menuitem;
};
diff --git a/src/libs/gui/NodeModule.cpp b/src/libs/gui/NodeModule.cpp
index e1839f37..25cc4aa1 100644
--- a/src/libs/gui/NodeModule.cpp
+++ b/src/libs/gui/NodeModule.cpp
@@ -51,9 +51,7 @@ NodeModule::NodeModule(boost::shared_ptr<PatchCanvas> canvas, SharedPtr<NodeMode
node->signal_metadata.connect(sigc::mem_fun(this, &NodeModule::set_metadata));
node->signal_polyphonic.connect(sigc::mem_fun(this, &NodeModule::set_stacked_border));
node->signal_renamed.connect(sigc::mem_fun(this, &NodeModule::rename));
-
- signal_clicked.connect(sigc::mem_fun(this, &NodeModule::on_click));
-
+
set_stacked_border(node->polyphonic());
}
@@ -123,15 +121,31 @@ NodeModule::show_control_window()
{
#ifdef HAVE_SLV2
if (_node->plugin()->type() == PluginModel::LV2) {
- GtkWidget* gui = (GtkWidget*)_node->plugin()->gui();
- if (gui) {
- cerr << "GUI!\n";
+ // FIXME: check type
+
+ SLV2UIInstance ui = _node->plugin()->ui();
+ if (ui) {
+ cerr << "Showing LV2 GUI" << endl;
+ // FIXME: leak
+ GtkWidget* c_widget = (GtkWidget*)slv2_ui_instance_get_widget(_node->plugin()->ui());
+ Gtk::Window* win = new Gtk::Window();
+ Gtk::Widget* widget = Glib::wrap(c_widget);
+ win->add(*widget);
+ widget->show_all();
+ win->show_all();
+ win->present();
+ widget->show_all();
+ win->show_all();
} else {
- cerr << "No gui :(\n";
+ cerr << "No LV2 GUI, showing builtin controls" << endl;
+ App::instance().window_factory()->present_controls(_node);
}
+ } else {
+ App::instance().window_factory()->present_controls(_node);
}
-#endif
+#else
App::instance().window_factory()->present_controls(_node);
+#endif
}
diff --git a/src/libs/gui/ingen_gui.glade b/src/libs/gui/ingen_gui.glade
index 498faad4..65c2ffdd 100644
--- a/src/libs/gui/ingen_gui.glade
+++ b/src/libs/gui/ingen_gui.glade
@@ -3168,5 +3168,21 @@ Thank you for contributing.</property>
</child>
</widget>
</child>
+ <child>
+ <widget class="GtkImageMenuItem" id="node_gui_menuitem">
+ <property name="visible">True</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <property name="tooltip" translatable="yes">Show this node's custom graphical interface</property>
+ <property name="label" translatable="yes">GUI</property>
+ <property name="use_underline">True</property>
+ <child internal-child="image">
+ <widget class="GtkImage" id="menu-item-image22">
+ <property name="visible">True</property>
+ <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+ <property name="stock">gtk-edit</property>
+ </widget>
+ </child>
+ </widget>
+ </child>
</widget>
</glade-interface>