From 8d228466f47c0730f2b00a0e74860ad5987d5295 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sun, 9 Feb 2014 20:32:07 +0000 Subject: Add show interface so UIs can gracefully degrade to separate windows if hosts can not use their widget directly. --- lv2/lv2plug.in/ns/extensions/ui/lv2-ui.doap.ttl | 11 ++++++++++ lv2/lv2plug.in/ns/extensions/ui/manifest.ttl | 2 +- lv2/lv2plug.in/ns/extensions/ui/ui.h | 28 ++++++++++++++++++++++++- lv2/lv2plug.in/ns/extensions/ui/ui.ttl | 12 ++++++++++- 4 files changed, 50 insertions(+), 3 deletions(-) (limited to 'lv2') diff --git a/lv2/lv2plug.in/ns/extensions/ui/lv2-ui.doap.ttl b/lv2/lv2plug.in/ns/extensions/ui/lv2-ui.doap.ttl index b67069b..2abb648 100644 --- a/lv2/lv2plug.in/ns/extensions/ui/lv2-ui.doap.ttl +++ b/lv2/lv2plug.in/ns/extensions/ui/lv2-ui.doap.ttl @@ -13,6 +13,17 @@ doap:developer ; doap:maintainer ; doap:release [ + doap:revision "2.17" ; + doap:created "2014-02-09" ; + dcs:blame ; + dcs:changeset [ + dcs:item [ + rdfs:label "Add show interface so UIs can gracefully degrade to separate windows if hosts can not use their widget directly." + ] , [ + rdfs:label "Fix identifier typos in documentation." + ] + ] + ] , [ doap:revision "2.16" ; doap:created "2014-01-04" ; doap:file-release ; diff --git a/lv2/lv2plug.in/ns/extensions/ui/manifest.ttl b/lv2/lv2plug.in/ns/extensions/ui/manifest.ttl index 23a9da9..8ae13ea 100644 --- a/lv2/lv2plug.in/ns/extensions/ui/manifest.ttl +++ b/lv2/lv2plug.in/ns/extensions/ui/manifest.ttl @@ -4,5 +4,5 @@ a lv2:Specification ; lv2:minorVersion 2 ; - lv2:microVersion 16 ; + lv2:microVersion 17 ; rdfs:seeAlso . \ No newline at end of file diff --git a/lv2/lv2plug.in/ns/extensions/ui/ui.h b/lv2/lv2plug.in/ns/extensions/ui/ui.h index ad51aa3..e59e298 100644 --- a/lv2/lv2plug.in/ns/extensions/ui/ui.h +++ b/lv2/lv2plug.in/ns/extensions/ui/ui.h @@ -51,6 +51,7 @@ #define LV2_UI__portNotification LV2_UI_PREFIX "portNotification" #define LV2_UI__portSubscribe LV2_UI_PREFIX "portSubscribe" #define LV2_UI__resize LV2_UI_PREFIX "resize" +#define LV2_UI__showInterface LV2_UI_PREFIX "showInterface" #define LV2_UI__touch LV2_UI_PREFIX "touch" #define LV2_UI__ui LV2_UI_PREFIX "ui" #define LV2_UI__updateRate LV2_UI_PREFIX "updateRate" @@ -340,7 +341,7 @@ typedef struct _LV2UI_Touch { } LV2UI_Touch; /** - UI Idle Feature (LV2_UI__idle) + UI Idle Feature (LV2_UI__idleInterface) This feature is an addition to the UI API that provides a callback for the host to call rapidly, e.g. to drive the idle callback of a toolkit. @@ -357,6 +358,31 @@ typedef struct _LV2UI_Idle_Interface { int (*idle)(LV2UI_Handle ui); } LV2UI_Idle_Interface; +/** + UI Show Interface (LV2_UI__showInterface) + + UIs can use this interface to provide show/hide methods to pop up a window, + which allows them to function in hosts unable to embed their widget type. + + If used, LV2UI_Idle_Interface should also be used to drive the UI. The UI + should return non-zero from idle() when the window has been closed. +*/ +typedef struct _LV2UI_Show_Interface { + /** + Show a window for this UI. + + @return 0 on success, or anything else to stop being called. + */ + int (*show)(LV2UI_Handle ui); + + /** + Hide the window for this UI. + + @return 0 on success, or anything else to stop being called. + */ + int (*hide)(LV2UI_Handle ui); +} LV2UI_Show_Interface; + /** Peak data for a slice of time, the update format for ui:peakProtocol. */ diff --git a/lv2/lv2plug.in/ns/extensions/ui/ui.ttl b/lv2/lv2plug.in/ns/extensions/ui/ui.ttl index 5ab029d..c8aa10a 100644 --- a/lv2/lv2plug.in/ns/extensions/ui/ui.ttl +++ b/lv2/lv2plug.in/ns/extensions/ui/ui.ttl @@ -325,12 +325,22 @@ ui:idleInterface UI. To support this feature, the UI should list it as a lv2:optionalFeature or lv2:requiredFeature in its data, and also as lv2:extensionData. When the UI's extension_data() is called with this URI (LV2_UI__idleInterface), it should -return a pointer to an LV2_UI_Idle_Interface.

+return a pointer to an LV2UI_Idle_Interface.

To indicate support, the host should pass a feature to instantiate() with this URI, with NULL for data.

""" . +ui:showInterface + a lv2:ExtensionData ; + lv2:documentation """ +

An interface for showing and hiding a window for a UI. This allows UIs to +gracefully degrade to separate windows when the host is unable to embed the UI +widget for whatever reason. When the UI's extension_data() is called with this +URI (LV2_UI__showInterface), it should return a pointer to an +LV2UI_Show_Interface.

+""" . + ui:updateRate a rdf:Property ; rdfs:range xsd:float ; -- cgit v1.2.1