From 1eea83ed8193ae18c3e7b5e152e7e0808511b746 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sun, 13 Sep 2015 02:47:19 +0000 Subject: Require LV2 1.6.0. git-svn-id: http://svn.drobilla.net/lad/trunk/suil@5727 a436a847-0d15-0410-975c-d299462d15a1 --- src/cocoa_in_gtk2.mm | 27 +++++++++------------------ src/win_in_gtk2.cpp | 29 +++++++++-------------------- src/x11_in_gtk2.c | 18 ++---------------- src/x11_in_qt4.cpp | 10 ---------- src/x11_in_qt5.cpp | 12 ------------ wscript | 24 +++++++++++------------- 6 files changed, 31 insertions(+), 89 deletions(-) diff --git a/src/cocoa_in_gtk2.mm b/src/cocoa_in_gtk2.mm index f2866fe..623ded3 100644 --- a/src/cocoa_in_gtk2.mm +++ b/src/cocoa_in_gtk2.mm @@ -22,10 +22,8 @@ #include "./suil_internal.h" -#ifdef HAVE_LV2_1_6_0 -# include "lv2/lv2plug.in/ns/ext/options/options.h" -# include "lv2/lv2plug.in/ns/ext/urid/urid.h" -#endif +#include "lv2/lv2plug.in/ns/ext/options/options.h" +#include "lv2/lv2plug.in/ns/ext/urid/urid.h" extern "C" { @@ -47,11 +45,10 @@ struct _SuilCocoaWrapper { int req_height; int alo_width; int alo_height; -#ifdef HAVE_LV2_1_6_0 + const LV2UI_Idle_Interface* idle_iface; guint idle_id; guint idle_ms; -#endif }; struct _SuilCocoaWrapperClass { @@ -235,10 +232,8 @@ suil_cocoa_wrapper_init(SuilCocoaWrapper* self) self->mapped = false; self->req_width = self->req_height = 0; self->alo_width = self->alo_height = 0; -#ifdef HAVE_LV2_1_6_0 - self->idle_iface = NULL; - self->idle_ms = 1000 / 30; // 30 Hz default -#endif + self->idle_iface = NULL; + self->idle_ms = 1000 / 30; // 30 Hz default } static int @@ -252,7 +247,6 @@ wrapper_resize(LV2UI_Feature_Handle handle, int width, int height) return 0; } -#ifdef HAVE_LV2_1_6_0 static gboolean suil_cocoa_wrapper_idle(void* data) { @@ -260,7 +254,6 @@ suil_cocoa_wrapper_idle(void* data) wrap->idle_iface->idle(wrap->instance->handle); return TRUE; // Continue calling } -#endif static GdkFilterReturn event_filter(GdkXEvent* xevent, GdkEvent* event, gpointer data) @@ -323,7 +316,6 @@ wrapper_wrap(SuilWrapper* wrapper, SuilInstance* instance) wrap->wrapper = wrapper; wrap->instance = instance; -#ifdef HAVE_LV2_1_6_0 const LV2UI_Idle_Interface* idle_iface = NULL; if (instance->descriptor->extension_data) { idle_iface = (const LV2UI_Idle_Interface*) @@ -334,7 +326,7 @@ wrapper_wrap(SuilWrapper* wrapper, SuilInstance* instance) wrap->idle_id = g_timeout_add( wrap->idle_ms, suil_cocoa_wrapper_idle, wrap); } -#endif + return 0; } @@ -343,12 +335,11 @@ wrapper_free(SuilWrapper* wrapper) { if (wrapper->impl) { SuilCocoaWrapper* const wrap = SUIL_COCOA_WRAPPER(wrapper->impl); -#ifdef HAVE_LV2_1_6_0 if (wrap->idle_id) { g_source_remove(wrap->idle_id); wrap->idle_id = 0; } -#endif + gdk_window_remove_filter(wrap->flt_win, event_filter, wrapper->impl); gtk_object_destroy(GTK_OBJECT(wrap)); } @@ -401,7 +392,7 @@ suil_wrapper_new(SuilHost* host, suil_add_feature(features, &n_features, LV2_UI__resize, &wrapper->resize); -#ifdef HAVE_LV2_1_6_0 + suil_add_feature(features, &n_features, LV2_UI__idleInterface, NULL); // Scan for URID map and options @@ -425,7 +416,7 @@ suil_wrapper_new(SuilHost* host, } } } -#endif + return wrapper; } diff --git a/src/win_in_gtk2.cpp b/src/win_in_gtk2.cpp index eabc1ac..a41b05e 100644 --- a/src/win_in_gtk2.cpp +++ b/src/win_in_gtk2.cpp @@ -28,10 +28,8 @@ #include "./suil_internal.h" -#ifdef HAVE_LV2_1_6_0 -# include "lv2/lv2plug.in/ns/ext/options/options.h" -# include "lv2/lv2plug.in/ns/ext/urid/urid.h" -#endif +#include "lv2/lv2plug.in/ns/ext/options/options.h" +#include "lv2/lv2plug.in/ns/ext/urid/urid.h" extern "C" { @@ -42,15 +40,13 @@ typedef struct _SuilWinWrapper SuilWinWrapper; typedef struct _SuilWinWrapperClass SuilWinWrapperClass; struct _SuilWinWrapper { - GtkDrawingArea area; - SuilWrapper* wrapper; - SuilInstance* instance; - GdkWindow* flt_win; -#ifdef HAVE_LV2_1_6_0 + GtkDrawingArea area; + SuilWrapper* wrapper; + SuilInstance* instance; + GdkWindow* flt_win; const LV2UI_Idle_Interface* idle_iface; guint idle_id; guint idle_ms; -#endif }; struct _SuilWinWrapperClass { @@ -110,13 +106,10 @@ suil_win_wrapper_init(SuilWinWrapper* self) { self->instance = NULL; self->flt_win = NULL; -#ifdef HAVE_LV2_1_6_0 self->idle_iface = NULL; self->idle_ms = 1000 / 30; // 30 Hz default -#endif } -#ifdef HAVE_LV2_1_6_0 static gboolean suil_win_wrapper_idle(void* data) { @@ -124,7 +117,6 @@ suil_win_wrapper_idle(void* data) wrap->idle_iface->idle(wrap->instance->handle); return TRUE; // Continue calling } -#endif static int wrapper_resize(LV2UI_Feature_Handle handle, int width, int height) @@ -143,7 +135,6 @@ wrapper_wrap(SuilWrapper* wrapper, wrap->wrapper = wrapper; wrap->instance = instance; -#ifdef HAVE_LV2_1_6_0 const LV2UI_Idle_Interface* idle_iface = NULL; if (instance->descriptor->extension_data) { idle_iface = (const LV2UI_Idle_Interface*) @@ -153,7 +144,7 @@ wrapper_wrap(SuilWrapper* wrapper, wrap->idle_iface = idle_iface; wrap->idle_id = g_timeout_add (wrap->idle_ms, suil_win_wrapper_idle, wrap); } -#endif + return 0; } @@ -180,12 +171,11 @@ wrapper_free(SuilWrapper* wrapper) { if (wrapper->impl) { SuilWinWrapper* const wrap = SUIL_WIN_WRAPPER(wrapper->impl); -#ifdef HAVE_LV2_1_6_0 if (wrap->idle_id) { g_source_remove(wrap->idle_id); wrap->idle_id = 0; } -#endif + gdk_window_remove_filter(wrap->flt_win, event_filter, wrapper->impl); gtk_object_destroy(GTK_OBJECT(wrap)); } @@ -241,7 +231,6 @@ suil_wrapper_new(SuilHost* host, suil_add_feature(features, &n_features, LV2_UI__resize, &wrapper->resize); -#ifdef HAVE_LV2_1_6_0 suil_add_feature(features, &n_features, LV2_UI__idleInterface, NULL); // Scan for URID map and options @@ -265,7 +254,7 @@ suil_wrapper_new(SuilHost* host, } } } -#endif + return wrapper; } diff --git a/src/x11_in_gtk2.c b/src/x11_in_gtk2.c index 51856e9..39f1625 100644 --- a/src/x11_in_gtk2.c +++ b/src/x11_in_gtk2.c @@ -21,10 +21,8 @@ #include "./suil_internal.h" -#ifdef HAVE_LV2_1_6_0 -# include "lv2/lv2plug.in/ns/ext/options/options.h" -# include "lv2/lv2plug.in/ns/ext/urid/urid.h" -#endif +#include "lv2/lv2plug.in/ns/ext/options/options.h" +#include "lv2/lv2plug.in/ns/ext/urid/urid.h" #define SUIL_TYPE_X11_WRAPPER (suil_x11_wrapper_get_type()) #define SUIL_X11_WRAPPER(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), SUIL_TYPE_X11_WRAPPER, SuilX11Wrapper)) @@ -37,11 +35,9 @@ struct _SuilX11Wrapper { GtkPlug* plug; SuilWrapper* wrapper; SuilInstance* instance; -#ifdef HAVE_LV2_1_6_0 const LV2UI_Idle_Interface* idle_iface; guint idle_id; guint idle_ms; -#endif }; struct _SuilX11WrapperClass { @@ -84,12 +80,10 @@ on_plug_removed(GtkSocket* sock, gpointer data) { SuilX11Wrapper* const self = SUIL_X11_WRAPPER(sock); -#ifdef HAVE_LV2_1_6_0 if (self->idle_id) { g_source_remove(self->idle_id); self->idle_id = 0; } -#endif if (self->instance->handle) { self->instance->descriptor->cleanup(self->instance->handle); @@ -221,10 +215,8 @@ suil_x11_wrapper_init(SuilX11Wrapper* self) self->plug = GTK_PLUG(gtk_plug_new(0)); self->wrapper = NULL; self->instance = NULL; -#ifdef HAVE_LV2_1_6_0 self->idle_iface = NULL; self->idle_ms = 1000 / 30; // 30 Hz default -#endif } static int @@ -234,7 +226,6 @@ wrapper_resize(LV2UI_Feature_Handle handle, int width, int height) return 0; } -#ifdef HAVE_LV2_1_6_0 static gboolean suil_x11_wrapper_idle(void* data) { @@ -244,7 +235,6 @@ suil_x11_wrapper_idle(void* data) return TRUE; // Continue calling } -#endif static int wrapper_wrap(SuilWrapper* wrapper, @@ -256,7 +246,6 @@ wrapper_wrap(SuilWrapper* wrapper, wrap->wrapper = wrapper; wrap->instance = instance; -#ifdef HAVE_LV2_1_6_0 const LV2UI_Idle_Interface* idle_iface = NULL; if (instance->descriptor->extension_data) { idle_iface = (const LV2UI_Idle_Interface*) @@ -267,7 +256,6 @@ wrapper_wrap(SuilWrapper* wrapper, wrap->idle_id = g_timeout_add( wrap->idle_ms, suil_x11_wrapper_idle, wrap); } -#endif g_signal_connect(G_OBJECT(wrap), "plug-removed", @@ -319,7 +307,6 @@ suil_wrapper_new(SuilHost* host, suil_add_feature(features, &n_features, LV2_UI__resize, &wrapper->resize); -#ifdef HAVE_LV2_1_6_0 suil_add_feature(features, &n_features, LV2_UI__idleInterface, NULL); // Scan for URID map and options @@ -343,7 +330,6 @@ suil_wrapper_new(SuilHost* host, } } } -#endif return wrapper; } diff --git a/src/x11_in_qt4.cpp b/src/x11_in_qt4.cpp index fa58fc5..61e4313 100644 --- a/src/x11_in_qt4.cpp +++ b/src/x11_in_qt4.cpp @@ -21,10 +21,6 @@ #include "./suil_config.h" #include "./suil_internal.h" -#ifndef HAVE_LV2_1_6_0 -typedef struct _LV2UI_Idle_Interface LV2UI_Idle_Interface; -#endif - extern "C" { typedef struct { @@ -45,7 +41,6 @@ public: , _ui_timer(0) {} -#ifdef HAVE_LV2_1_6_0 void showEvent(QShowEvent* event) { if (_idle_iface && _ui_timer == 0) { _ui_timer = this->startTimer(30); @@ -61,7 +56,6 @@ public: } QX11EmbedContainer::timerEvent(event); } -#endif SuilInstance* const _instance; const LV2UI_Idle_Interface* const _idle_iface; @@ -90,12 +84,10 @@ wrapper_wrap(SuilWrapper* wrapper, SuilInstance* instance) { const LV2UI_Idle_Interface* idle_iface = NULL; -#ifdef HAVE_LV2_1_6_0 if (instance->descriptor->extension_data) { idle_iface = (const LV2UI_Idle_Interface*) instance->descriptor->extension_data(LV2_UI__idleInterface); } -#endif SuilX11InQt4Wrapper* const impl = (SuilX11InQt4Wrapper*)wrapper->impl; QX11EmbedWidget* const ew = impl->parent; @@ -144,9 +136,7 @@ suil_wrapper_new(SuilHost* host, suil_add_feature(features, &n_features, LV2_UI__resize, &wrapper->resize); -#ifdef HAVE_LV2_1_6_0 suil_add_feature(features, &n_features, LV2_UI__idleInterface, NULL); -#endif return wrapper; } diff --git a/src/x11_in_qt5.cpp b/src/x11_in_qt5.cpp index 1f62796..4e8a817 100644 --- a/src/x11_in_qt5.cpp +++ b/src/x11_in_qt5.cpp @@ -24,10 +24,6 @@ #include "./suil_config.h" #include "./suil_internal.h" -#ifndef HAVE_LV2_1_6_0 -typedef struct _LV2UI_Idle_Interface LV2UI_Idle_Interface; -#endif - extern "C" { typedef struct { @@ -40,14 +36,11 @@ class SuilQX11Widget : public QWidget public: SuilQX11Widget(QWidget* parent, Qt::WindowFlags wflags) : QWidget(parent, wflags) -#ifdef HAVE_LV2_1_6_0 , _instance(NULL) , _idle_iface(NULL) , _ui_timer(0) -#endif {} -#ifdef HAVE_LV2_1_6_0 void start_idle(SuilInstance* instance, const LV2UI_Idle_Interface* idle_iface) { _instance = instance; @@ -69,7 +62,6 @@ private: SuilInstance* _instance; const LV2UI_Idle_Interface* _idle_iface; int _ui_timer; -#endif }; static void @@ -95,14 +87,12 @@ wrapper_wrap(SuilWrapper* wrapper, SuilX11InQt5Wrapper* const impl = (SuilX11InQt5Wrapper*)wrapper->impl; SuilQX11Widget* const ew = (SuilQX11Widget*)impl->parent; -#ifdef HAVE_LV2_1_6_0 if (instance->descriptor->extension_data) { const LV2UI_Idle_Interface* idle_iface = (const LV2UI_Idle_Interface*) instance->descriptor->extension_data(LV2_UI__idleInterface); ew->start_idle(instance, idle_iface); } -#endif impl->host_widget = ew; @@ -155,9 +145,7 @@ suil_wrapper_new(SuilHost* host, suil_add_feature(features, &n_features, LV2_UI__resize, &wrapper->resize); -#ifdef HAVE_LV2_1_6_0 suil_add_feature(features, &n_features, LV2_UI__idleInterface, NULL); -#endif return wrapper; } diff --git a/wscript b/wscript index 4479a1f..a5f0141 100644 --- a/wscript +++ b/wscript @@ -60,9 +60,7 @@ def configure(conf): mandatory = False)): conf.env.NODELETE_FLAGS = ['-Wl,-z,nodelete'] - autowaf.check_pkg(conf, 'lv2', atleast_version='1.0.0', uselib_store='LV2') - autowaf.check_pkg(conf, 'lv2', atleast_version='1.6.0', - uselib_store='LV2_1_6_0', mandatory=False) + autowaf.check_pkg(conf, 'lv2', atleast_version='1.6.0', uselib_store='LV2') if not Options.options.no_gtk: autowaf.check_pkg(conf, 'gtk+-2.0', uselib_store='GTK2', @@ -183,7 +181,7 @@ def build(bld): install_path = '${LIBDIR}', cflags = cflags, lib = lib, - uselib = 'LV2 LV2_1_6_0') + uselib = 'LV2') # Static library if bld.env.BUILD_STATIC: @@ -198,7 +196,7 @@ def build(bld): install_path = '${LIBDIR}', cflags = cflags, lib = lib, - uselib = 'LV2 LV2_1_6_0') + uselib = 'LV2') if bld.env.SUIL_WITH_GTK2_IN_QT4: obj = bld(features = 'cxx cxxshlib', @@ -209,7 +207,7 @@ def build(bld): install_path = module_dir, cflags = cflags, lib = modlib) - autowaf.use_lib(bld, obj, 'GTK2 QT4 LV2 LV2_1_6_0') + autowaf.use_lib(bld, obj, 'GTK2 QT4 LV2') if bld.env.SUIL_WITH_GTK2_IN_QT5: obj = bld(features = 'cxx cxxshlib', @@ -220,7 +218,7 @@ def build(bld): install_path = module_dir, cflags = cflags, lib = modlib) - autowaf.use_lib(bld, obj, 'GTK2 QT5 LV2 LV2_1_6_0') + autowaf.use_lib(bld, obj, 'GTK2 QT5 LV2') if bld.env.SUIL_WITH_QT4_IN_GTK2: obj = bld(features = 'cxx cxxshlib', @@ -232,7 +230,7 @@ def build(bld): cflags = cflags, lib = modlib, linkflags = bld.env.NODELETE_FLAGS) - autowaf.use_lib(bld, obj, 'GTK2 QT4 LV2 LV2_1_6_0') + autowaf.use_lib(bld, obj, 'GTK2 QT4 LV2') if bld.env.SUIL_WITH_X11_IN_GTK2: obj = bld(features = 'c cshlib', @@ -244,7 +242,7 @@ def build(bld): cflags = cflags, lib = modlib + ['X11'], linkflags = bld.env.NODELETE_FLAGS) - autowaf.use_lib(bld, obj, 'GTK2 GTK2_X11 LV2 LV2_1_6_0') + autowaf.use_lib(bld, obj, 'GTK2 GTK2_X11 LV2') if bld.env.SUIL_WITH_COCOA_IN_GTK2: obj = bld(features = 'cxx cshlib', @@ -256,7 +254,7 @@ def build(bld): cflags = cflags, lib = modlib, linkflags = ['-framework', 'Cocoa']) - autowaf.use_lib(bld, obj, 'GTK2 LV2 LV2_1_6_0') + autowaf.use_lib(bld, obj, 'GTK2 LV2') if bld.env.SUIL_WITH_WIN_IN_GTK2: obj = bld(features = 'cxx cxxshlib', @@ -268,7 +266,7 @@ def build(bld): cflags = cflags, lib = modlib, linkflags = bld.env.NODELETE_FLAGS) - autowaf.use_lib(bld, obj, 'GTK2 LV2 LV2_1_6_0') + autowaf.use_lib(bld, obj, 'GTK2 LV2') if bld.env.SUIL_WITH_X11_IN_QT4: obj = bld(features = 'cxx cxxshlib', @@ -279,7 +277,7 @@ def build(bld): install_path = module_dir, cflags = cflags, lib = modlib) - autowaf.use_lib(bld, obj, 'QT4 LV2 LV2_1_6_0') + autowaf.use_lib(bld, obj, 'QT4 LV2') if bld.env.SUIL_WITH_X11_IN_QT5: obj = bld(features = 'cxx cxxshlib', @@ -290,7 +288,7 @@ def build(bld): install_path = module_dir, cflags = cflags, lib = modlib) - autowaf.use_lib(bld, obj, 'QT5 LV2 LV2_1_6_0') + autowaf.use_lib(bld, obj, 'QT5 LV2') # Documentation autowaf.build_dox(bld, 'SUIL', SUIL_VERSION, top, out) -- cgit v1.2.1