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/ui.h | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) (limited to 'lv2/lv2plug.in/ns/extensions/ui/ui.h') 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. */ -- cgit v1.2.1