summaryrefslogtreecommitdiffstats
path: root/src/pluginui.c
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2011-04-22 06:26:38 +0000
committerDavid Robillard <d@drobilla.net>2011-04-22 06:26:38 +0000
commitbeccc26909e9976d33f3be2951b6ef8cd63353ff (patch)
tree16a48029560ae8f78580827c75ce53f7596ebc6d /src/pluginui.c
parent12defde9074ff2b6f4588960151f3ce41441c266 (diff)
downloadlilv-beccc26909e9976d33f3be2951b6ef8cd63353ff.tar.gz
lilv-beccc26909e9976d33f3be2951b6ef8cd63353ff.tar.bz2
lilv-beccc26909e9976d33f3be2951b6ef8cd63353ff.zip
Remove UI instance API from SLV2 (apps should implement UIs via Suil now).
Remove UI extension API and header from public APIs entirely. Rework UI instance API to support multiple UIs and a more precise notion of embedding support. git-svn-id: http://svn.drobilla.net/lad/trunk/slv2@3186 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/pluginui.c')
-rw-r--r--src/pluginui.c26
1 files changed, 18 insertions, 8 deletions
diff --git a/src/pluginui.c b/src/pluginui.c
index c81a5dd..fdc32ea 100644
--- a/src/pluginui.c
+++ b/src/pluginui.c
@@ -90,17 +90,27 @@ slv2_ui_get_uri(SLV2UI ui)
}
SLV2_API
-bool
-slv2_ui_supported(SLV2UI ui,
- SLV2Value widget_type_uri)
+unsigned
+slv2_ui_is_supported(SLV2UI ui,
+ SLV2UISupportedFunc supported_func,
+ SLV2Value container_type,
+ SLV2Value* ui_type)
{
#ifdef HAVE_SUIL
- return suil_ui_type_supported(
- slv2_value_as_uri(widget_type_uri),
- slv2_value_as_uri(slv2_values_get_first(ui->classes)));
-#else
- return false;
+ SLV2Values classes = slv2_ui_get_classes(ui);
+ SLV2_FOREACH(c, classes) {
+ SLV2Value type = slv2_values_get(classes, c);
+ const unsigned q = supported_func(slv2_value_as_uri(container_type),
+ slv2_value_as_uri(type));
+ if (q) {
+ if (ui_type) {
+ *ui_type = slv2_value_duplicate(type);
+ }
+ return q;
+ }
+ }
#endif
+ return 0;
}
SLV2_API