summaryrefslogtreecommitdiffstats
path: root/slv2
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2011-02-24 09:00:54 +0000
committerDavid Robillard <d@drobilla.net>2011-02-24 09:00:54 +0000
commit25bd8988fb82e6132ae6c1b87e6d0b8087d61f1b (patch)
tree63d8b4a0a69c07d012af30b711a0a9cb80a160e6 /slv2
parent5a7ed3f46fa2e0151a0f403824ae3a7df10a6c34 (diff)
downloadlilv-25bd8988fb82e6132ae6c1b87e6d0b8087d61f1b.tar.gz
lilv-25bd8988fb82e6132ae6c1b87e6d0b8087d61f1b.tar.bz2
lilv-25bd8988fb82e6132ae6c1b87e6d0b8087d61f1b.zip
Make Suil exclusively deal with instantiating (not choosing) UIs.
Add slv2_ui_instance_new as a replacement for slv2_ui_instantiate (now deprecated), which supports cross-toolkit embedding by taking an additional widget type pointer. Remove direct Suil dependency from Ingen. git-svn-id: http://svn.drobilla.net/lad/trunk/slv2@3022 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'slv2')
-rw-r--r--slv2/slv2.h86
1 files changed, 66 insertions, 20 deletions
diff --git a/slv2/slv2.h b/slv2/slv2.h
index e703689..b7ce5bd 100644
--- a/slv2/slv2.h
+++ b/slv2/slv2.h
@@ -1085,17 +1085,31 @@ SLV2UI
slv2_uis_get_by_uri(SLV2UIs uis,
SLV2Value uri);
-/** Get a list of all UIs available for this plugin.
- * Note this returns the URI of the UI, and not the path/URI to its shared
- * library, use slv2_ui_get_library_uri with the values returned
- * here for that.
- *
+/** Get all UIs for @a plugin.
* Returned value must be freed by caller using slv2_uis_free.
*/
SLV2_API
SLV2UIs
slv2_plugin_get_uis(SLV2Plugin plugin);
+/** Get the default UI for @a plugin.
+ * This function makes a best effort at choosing a default UI for the given
+ * widget type. A native UI for the given widget type will be returned if one
+ * exists, otherwise a UI which can be wrapped by SLV2 will be returned.
+ *
+ * This function makes the common case (a plugin with a single UI, or a single
+ * UI per toolkit) simple, but is not fully powerful since a plugin may have
+ * several usable UIs. To support multiple UIs per plugin, use
+ * @ref slv2_ui_supported to determine which UIs are usable and choose a UI
+ * to instantiate from among them.
+ *
+ * @return NULL if there is no suitable UI.
+ */
+SLV2_API
+SLV2UI
+slv2_plugin_get_default_ui(SLV2Plugin plugin,
+ SLV2Value widget_type_uri);
+
/** @name Plugin UI
* @{
*/
@@ -1108,6 +1122,13 @@ SLV2_API
SLV2Value
slv2_ui_get_uri(SLV2UI ui);
+/** Return true iff @a ui can be instantiated to a widget of the given type.
+ */
+SLV2_API
+bool
+slv2_ui_supported(SLV2UI ui,
+ SLV2Value widget_type_uri);
+
/** Get the types (URIs of RDF classes) of a Plugin UI.
* @param ui The Plugin UI
* @return a shared value which must not be modified or freed.
@@ -1147,27 +1168,37 @@ slv2_ui_get_binary_uri(SLV2UI ui);
typedef struct _SLV2UIInstance* SLV2UIInstance;
+/** DEPRECATED: Instantiate a plugin UI.
+ * This function is deprecated, it does not support widget wrapping.
+ * Use @ref slv2_ui_instantiate instead.
+ */
+SLV2_DEPRECATED
+SLV2_API
+SLV2UIInstance
+slv2_ui_instantiate(SLV2Plugin plugin,
+ SLV2UI ui,
+ LV2UI_Write_Function write_function,
+ LV2UI_Controller controller,
+ const LV2_Feature* const* features);
+
/** Instantiate a plugin UI.
* The returned object represents shared library objects loaded into memory,
* it must be cleaned up with slv2_ui_instance_free when no longer
* needed.
*
- * @a plugin is not modified or directly referenced by the returned object
- * (instances store only a copy of the plugin's URI).
- *
- * @a features NULL-terminated array of features the host supports.
- * NULL may be passed if the host supports no additional features (unlike
- * the LV2 specification - SLV2 takes care of it).
+ * @param features NULL-terminated array of features the host supports.
+ * NULL may be passed if the host supports no additional features.
*
* @return NULL if instantiation failed.
*/
SLV2_API
SLV2UIInstance
-slv2_ui_instantiate(SLV2Plugin plugin,
- SLV2UI ui,
- LV2UI_Write_Function write_function,
- LV2UI_Controller controller,
- const LV2_Feature* const* features);
+slv2_ui_instance_new(SLV2Plugin plugin,
+ SLV2UI ui,
+ SLV2Value widget_type_uri,
+ LV2UI_Write_Function write_function,
+ LV2UI_Controller controller,
+ const LV2_Feature* const* features);
/** Free a plugin UI instance.
* @a instance is invalid after this call.
@@ -1185,24 +1216,39 @@ SLV2_API
LV2UI_Widget
slv2_ui_instance_get_widget(SLV2UIInstance instance);
-/** DEPRECATED: Get the LV2UI_Descriptor of the plugin UI instance.
+/** Notify a UI about a change in a plugin port.
+ */
+SLV2_API
+void
+slv2_ui_instance_port_event(SLV2UIInstance instance,
+ uint32_t port_index,
+ uint32_t buffer_size,
+ uint32_t format,
+ const void* buffer);
+
+/** Return a data structure defined by some LV2 extension URI.
+ */
+SLV2_API
+const void*
+slv2_ui_instance_extension_data(SLV2UIInstance instance,
+ const char* uri);
+
+/** Get the LV2UI_Descriptor of the plugin UI instance.
* Normally hosts should not need to access the LV2UI_Descriptor directly,
* use the slv2_ui_instance_* functions.
*
* The returned descriptor is shared and must not be deleted.
*/
-SLV2_DEPRECATED
SLV2_API
const LV2UI_Descriptor*
slv2_ui_instance_get_descriptor(SLV2UIInstance instance);
-/** DEPRECATED: Get the LV2UI_Handle of the plugin UI instance.
+/** Get the LV2UI_Handle of the plugin UI instance.
* Normally hosts should not need to access the LV2UI_Handle directly,
* use the slv2_ui_instance_* functions.
*
* The returned handle is shared and must not be deleted.
*/
-SLV2_DEPRECATED
SLV2_API
LV2UI_Handle
slv2_ui_instance_get_handle(SLV2UIInstance instance);