// Copyright 2017 Stefan Riha
// Documentation copied from http://lv2plug.in/ns/extensions/ui/ui.h
// Copyright text of the original C file:
// LV2 UI Extension
// Copyright 2009-2016 David Robillard <d@drobilla.net>
// Copyright 2006-2011 Lars Luthman <lars.luthman@gmail.com>
//
// Permission to use, copy, modify, and/or distribute this software for any
// purpose with or without fee is hereby granted, provided that the above
// copyright notice and this permission notice appear in all copies.
//
// THIS SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
//
//! Documentation of the corresponding C header files: http://lv2plug.in/ns/extensions/ui/ui.html.
use libc;
use *;
/**
A pointer to UI instance internals.
The host may compare this to NULL, but otherwise MUST NOT interpret it.
*/
pub type LV2UIHandle = *mut c_void;
/**
A pointer to some widget or other type of UI handle.
The actual type is defined by the type of the UI.
*/
pub type LV2UIWidget = *mut c_void;
/**
A pointer to a controller provided by the host.
The UI may compare this to NULL, but otherwise MUST NOT interpret it.
*/
pub type LV2UIControllerRaw = *const c_void;
/**
A host-provided function that sends data to a plugin's input ports.
@param controller The opaque controller pointer passed to
LV2UI_Descriptor::instantiate().
@param port_index Index of the port to update.
@param buffer Buffer containing `buffer_size` bytes of data.
@param buffer_size Size of `buffer` in bytes.
@param port_protocol Either 0 or the URID for a ui:PortProtocol. If 0, the
protocol is implicitly ui:floatProtocol, the port MUST be an lv2:ControlPort
input, `buffer` MUST point to a single float value, and `buffer_size` MUST
be sizeof(float). The UI SHOULD NOT use a protocol not supported by the
host, but the host MUST gracefully ignore any protocol it does not
understand.
*/
pub type LV2UIWriteFunctionRaw = ;
/**
A plugin UI.
A pointer to an object of this type is returned by the lv2ui_descriptor()
function.
*/
/**
UI Idle Interface (LV2_UI__idleInterface)
UIs can provide this interface to have an idle() callback called by the host
rapidly to update the UI.
*/
/**
UI Show Interface (LV2_UI__showInterface)
UIs can provide this interface to show and hide a window, which allows them
to function in hosts unable to embed their widget. This allows any UI to
provide a fallback for embedding that works in any host.
If used:
- The host MUST use LV2UI_Idle_Interface to drive the UI.
- The UI MUST return non-zero from LV2UI_Idle_Interface::idle() when it has been closed.
- If idle() returns non-zero, the host MUST call hide() and stop calling
idle(). It MAY later call show() then resume calling idle().
*/
// RUST_TODO: The following are deprecated, should not declare this here. Ardour and Qtractor do not implement ui:showInterface
// http://lists.lv2plug.in/pipermail/devel-lv2plug.in/2016-May/001649.html
// http://kxstudio.linuxaudio.org/ns/lv2ext/lv2_external_ui.h
/**
* When LV2_EXTERNAL_UI__Widget UI is instantiated, the returned
* LV2UI_Widget handle must be cast to pointer to LV2_External_UI_Widget.
* UI is created in invisible state.
*/
/**
* On UI instantiation, host must supply LV2_EXTERNAL_UI__Host feature.
* LV2_Feature::data must be pointer to LV2_External_UI_Host.
*/