2 * Copyright (C) 2009-2015 Paul Davis <paul@linuxaudiosystems.com>
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License along
15 * with this program; if not, write to the Free Software Foundation, Inc.,
16 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19 /* -*- Mode: C ; c-basic-offset: 2 -*- */
20 /*****************************************************************************
22 * This work is in public domain.
24 * This file is distributed in the hope that it will be useful,
25 * but WITHOUT ANY WARRANTY; without even the implied warranty of
26 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
28 * If you have questions, contact Nedko Arnaudov <nedko@arnaudov.name> or
29 * ask in #lad channel, FreeNode IRC network.
31 *****************************************************************************/
33 #ifndef LV2_EXTERNAL_UI_H__5AFE09A5_0FB7_47AF_924E_2AF0F8DE8873__INCLUDED
34 #define LV2_EXTERNAL_UI_H__5AFE09A5_0FB7_47AF_924E_2AF0F8DE8873__INCLUDED
36 /** UI extension suitable for out-of-process UIs */
37 #define LV2_EXTERNAL_UI_URI "http://lv2plug.in/ns/extensions/ui#external"
39 #define LV2_EXTERNAL_UI_KX__Host "http://kxstudio.sf.net/ns/lv2ext/external-ui#Host"
45 } /* Adjust editor indent */
49 * When LV2_EXTERNAL_UI_URI UI is instantiated, the returned
50 * LV2UI_Widget handle must be cast to pointer to struct lv2_external_ui.
51 * UI is created in invisible state.
53 struct lv2_external_ui
56 * Host calls this function regulary. UI library implementing the
57 * callback may do IPC or redraw the UI.
59 * @param _this_ the UI context
61 void (* run)(struct lv2_external_ui * _this_);
64 * Host calls this function to make the plugin UI visible.
66 * @param _this_ the UI context
68 void (* show)(struct lv2_external_ui * _this_);
71 * Host calls this function to make the plugin UI invisible again.
73 * @param _this_ the UI context
75 void (* hide)(struct lv2_external_ui * _this_);
78 #define LV2_EXTERNAL_UI_RUN(ptr) (ptr)->run(ptr)
79 #define LV2_EXTERNAL_UI_SHOW(ptr) (ptr)->show(ptr)
80 #define LV2_EXTERNAL_UI_HIDE(ptr) (ptr)->hide(ptr)
83 * On UI instantiation, host must supply LV2_EXTERNAL_UI_URI
84 * feature. LV2_Feature::data must be pointer to struct lv2_external_ui_host. */
85 struct lv2_external_ui_host
88 * Callback that plugin UI will call
89 * when UI (GUI window) is closed by user.
90 * This callback wil; be called during execution of lv2_external_ui::run()
91 * (i.e. not from background thread).
93 * After this callback is called, UI is defunct. Host must call
94 * LV2UI_Descriptor::cleanup(). If host wants to make the UI visible
95 * again UI must be reinstantiated.
97 * @param controller Host context associated with plugin UI, as
98 * supplied to LV2UI_Descriptor::instantiate()
100 void (* ui_closed)(void* controller);
103 * Optional (may be NULL) "user friendly" identifier which the UI
104 * may display to allow a user to easily associate this particular
105 * UI instance with the correct plugin instance as it is represented
106 * by the host (e.g. "track 1" or "channel 4").
108 * If supplied by host, the string will be referenced only during
109 * LV2UI_Descriptor::instantiate()
111 const char * plugin_human_id;
115 { /* Adjust editor indent */
121 #endif /* #ifndef LV2_EXTERNAL_UI_H__5AFE09A5_0FB7_47AF_924E_2AF0F8DE8873__INCLUDED */