summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2011-02-23 18:35:59 +0000
committerDavid Robillard <d@drobilla.net>2011-02-23 18:35:59 +0000
commit4f571715ad05ca72172fa149be6bb308ff444695 (patch)
treeff5491afc89335a8ffaab0d15411e37bc6d4ebf8 /src
parent8ab6663147cff82cc4c804a6cbe9839c09d21671 (diff)
downloadsuil-4f571715ad05ca72172fa149be6bb308ff444695.tar.gz
suil-4f571715ad05ca72172fa149be6bb308ff444695.tar.bz2
suil-4f571715ad05ca72172fa149be6bb308ff444695.zip
Gtk2 in Qt4 embedding (untested).
git-svn-id: http://svn.drobilla.net/lad/trunk/suil@3019 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src')
-rw-r--r--src/gtk2_in_qt4.cpp29
1 files changed, 5 insertions, 24 deletions
diff --git a/src/gtk2_in_qt4.cpp b/src/gtk2_in_qt4.cpp
index 837cbac..c876d2e 100644
--- a/src/gtk2_in_qt4.cpp
+++ b/src/gtk2_in_qt4.cpp
@@ -31,19 +31,10 @@ suil_wrap_init(const char* host_type_uri,
const char* ui_type_uri,
const LV2_Feature* const* features)
{
+ // TODO: What Gtk initialisation is required here?
return 0;
}
-static void
-on_window_destroy(GtkWidget* gtk_window,
- gpointer* user_data)
-{
- //SuilInstance instance = (SuilInstance)user_data;
- // TODO: Notify host via callback
- printf("LV2 UI window destroyed\n");
-}
-
-
/** Dynamic module entry point. */
SUIL_API
int
@@ -51,23 +42,13 @@ suil_instance_wrap(SuilInstance instance,
const char* host_type_uri,
const char* ui_type_uri)
{
- GtkWidget* gtk_window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
- gtk_window_set_resizable(GTK_WINDOW(gtk_window), TRUE);
- gtk_window_set_title(GTK_WINDOW(gtk_window), "LV2 Plugin UI");
+ GtkWidget* plug = gtk_plug_new(0);
- gtk_container_add(GTK_CONTAINER(gtk_window),
+ gtk_container_add(GTK_CONTAINER(plug),
(GtkWidget*)instance->ui_widget);
- g_signal_connect(G_OBJECT(gtk_window),
- "destroy",
- G_CALLBACK(on_window_destroy),
- instance);
-
- gtk_widget_show_all(gtk_window);
-
- GdkWindow* gdk_window = gtk_widget_get_window(gtk_window);
- QX11EmbedContainer* wrapper = new QX11EmbedContainer();
- wrapper->embedClient(GDK_WINDOW_XID(gdk_window));
+ QX11EmbedContainer* wrapper = new QX11EmbedContainer();
+ wrapper->embedClient(gtk_plug_get_id(GTK_PLUG(plug)));
instance->host_widget = wrapper;