diff options
-rw-r--r-- | NEWS | 3 | ||||
-rw-r--r-- | src/instance.c | 8 | ||||
-rw-r--r-- | src/qt5_in_gtk.cpp (renamed from src/qt5_in_gtk2.cpp) | 6 | ||||
-rw-r--r-- | wscript | 18 |
4 files changed, 32 insertions, 3 deletions
@@ -1,8 +1,9 @@ suil (0.10.3) unstable; * Add support for min/base size hints for X11 in Gtk (thanks Hermann Meyer) + * Add support for Qt5 in Gtk3 - -- David Robillard <d@drobilla.net> Tue, 19 Feb 2019 08:34:31 +0100 + -- David Robillard <d@drobilla.net> Thu, 06 Jun 2019 21:02:47 +0200 suil (0.10.2) stable; diff --git a/src/instance.c b/src/instance.c index d365ca2..61037fc 100644 --- a/src/instance.c +++ b/src/instance.c @@ -54,6 +54,8 @@ suil_ui_supported(const char* host_type_uri, && !strcmp(ui_type_uri, X11_UI_URI)) || (!strcmp(host_type_uri, GTK3_UI_URI) && !strcmp(ui_type_uri, X11_UI_URI)) + || (!strcmp(host_type_uri, GTK3_UI_URI) + && !strcmp(ui_type_uri, QT5_UI_URI)) || (!strcmp(host_type_uri, GTK2_UI_URI) && !strcmp(ui_type_uri, WIN_UI_URI)) || (!strcmp(host_type_uri, GTK2_UI_URI) @@ -114,6 +116,12 @@ open_wrapper(SuilHost* host, module_name = "suil_x11_in_gtk3"; } #endif +#ifdef SUIL_WITH_QT5_IN_GTK3 + if (!strcmp(container_type_uri, GTK3_UI_URI) + && !strcmp(ui_type_uri, QT5_UI_URI)) { + module_name = "suil_qt5_in_gtk3"; + } +#endif #ifdef SUIL_WITH_WIN_IN_GTK2 if (!strcmp(container_type_uri, GTK2_UI_URI) && !strcmp(ui_type_uri, WIN_UI_URI)) { diff --git a/src/qt5_in_gtk2.cpp b/src/qt5_in_gtk.cpp index eac44af..e74ab5d 100644 --- a/src/qt5_in_gtk2.cpp +++ b/src/qt5_in_gtk.cpp @@ -21,6 +21,10 @@ #include <QWidget> #include <QWindow> +#if GTK_MAJOR_VERSION == 3 +#include <gtk/gtkx.h> +#endif + #include "lv2/options/options.h" #include "lv2/urid/urid.h" @@ -173,7 +177,7 @@ wrapper_free(SuilWrapper* wrapper) { if (wrapper->impl) { SuilQtWrapper* const wrap = SUIL_QT_WRAPPER(wrapper->impl); - gtk_object_destroy(GTK_OBJECT(wrap)); + gtk_widget_destroy(GTK_WIDGET(wrap)); } } @@ -118,6 +118,9 @@ def configure(conf): if conf.env.HAVE_GTK3 and conf.env.HAVE_GTK3_X11: autowaf.define(conf, 'SUIL_WITH_X11_IN_GTK3', 1) + if conf.env.HAVE_GTK3 and conf.env.HAVE_QT5: + autowaf.define(conf, 'SUIL_WITH_QT5_IN_GTK3', 1) + if conf.env.HAVE_GTK2 and conf.env.HAVE_GTK2_QUARTZ: autowaf.define(conf, 'SUIL_WITH_COCOA_IN_GTK2', 1) @@ -174,6 +177,7 @@ def configure(conf): ('win', 'gtk2'), ('x11', 'gtk2'), ('x11', 'gtk3'), + ('qt5', 'gtk3'), ('x11', 'qt4'), ('x11', 'qt5'), ('cocoa', 'qt5')] @@ -271,7 +275,7 @@ def build(bld): if bld.env.SUIL_WITH_QT5_IN_GTK2: obj = bld(features = 'cxx cxxshlib', - source = 'src/qt5_in_gtk2.cpp', + source = 'src/qt5_in_gtk.cpp', target = 'suil_qt5_in_gtk2', includes = ['.'], defines = ['SUIL_SHARED', 'SUIL_INTERNAL'], @@ -305,6 +309,18 @@ def build(bld): uselib = 'GTK3 GTK3_X11 LV2', linkflags = bld.env.NODELETE_FLAGS) + if bld.env.SUIL_WITH_QT5_IN_GTK3: + obj = bld(features = 'cxx cxxshlib', + source = 'src/qt5_in_gtk.cpp', + target = 'suil_qt5_in_gtk3', + includes = ['.'], + defines = ['SUIL_SHARED', 'SUIL_INTERNAL'], + install_path = module_dir, + cflags = cflags, + lib = modlib, + uselib = 'GTK3 QT5 LV2', + linkflags = bld.env.NODELETE_FLAGS) + if bld.env.SUIL_WITH_COCOA_IN_GTK2: obj = bld(features = 'cxx cshlib', source = 'src/cocoa_in_gtk2.mm', |