From 030bdc723413808ce738d399fc8758c55b02af69 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Fri, 16 Mar 2012 21:30:05 +0000 Subject: Properly implement non-resizable UIs, not that any plugins that should set this seem to actually do so... git-svn-id: http://svn.drobilla.net/lad/trunk/jalv@4069 a436a847-0d15-0410-975c-d299462d15a1 --- src/jalv.c | 17 +++++++++++++++++ src/jalv_gtk2.c | 3 +-- src/jalv_internal.h | 3 +++ 3 files changed, 21 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/jalv.c b/src/jalv.c index 8deea96..d71d2b4 100644 --- a/src/jalv.c +++ b/src/jalv.c @@ -54,6 +54,7 @@ #define NS_MIDI "http://lv2plug.in/ns/ext/midi#" #define NS_PSET "http://lv2plug.in/ns/ext/presets#" #define NS_RDF "http://www.w3.org/1999/02/22-rdf-syntax-ns#" +#define NS_UI "http://lv2plug.in/ns/extensions/ui#" #define USTR(str) ((const uint8_t*)str) @@ -535,6 +536,22 @@ jack_session_cb(jack_session_event_t* event, void* arg) } #endif /* JALV_JACK_SESSION */ +bool +jalv_ui_is_resizable(Jalv* jalv) +{ + const LilvNode* s = lilv_ui_get_uri(jalv->ui); + LilvNode* p = lilv_new_uri(jalv->world, LV2_CORE__requiredFeature); + LilvNode* o = lilv_new_uri(jalv->world, NS_UI "fixedSize"); + + LilvNodes* matches = lilv_world_find_nodes(jalv->world, s, p, o); + + lilv_node_free(o); + lilv_node_free(p); + lilv_nodes_free(matches); + + return matches == NULL; +} + void jalv_ui_write(SuilController controller, uint32_t port_index, diff --git a/src/jalv_gtk2.c b/src/jalv_gtk2.c index 3e20398..6113caf 100644 --- a/src/jalv_gtk2.c +++ b/src/jalv_gtk2.c @@ -275,8 +275,7 @@ jalv_open_ui(Jalv* jalv, gtk_container_add(GTK_CONTAINER(alignment), button); } - // TODO: Check UI properties for resizable - gtk_window_set_resizable(GTK_WINDOW(window), false); + gtk_window_set_resizable(GTK_WINDOW(window), jalv_ui_is_resizable(jalv)); gtk_container_add(GTK_CONTAINER(window), vbox); gtk_widget_show_all(window); diff --git a/src/jalv_internal.h b/src/jalv_internal.h index 07c40b3..7c63e96 100644 --- a/src/jalv_internal.h +++ b/src/jalv_internal.h @@ -163,6 +163,9 @@ int jalv_open_ui(Jalv* jalv, SuilInstance* instance); +bool +jalv_ui_is_resizable(Jalv* jalv); + void jalv_ui_write(SuilController controller, uint32_t port_index, -- cgit v1.2.1