From 996f9015fe055ca63823110175593317ac20c80f Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sat, 22 Sep 2007 19:43:11 +0000 Subject: LV2 UI extension updates. LV2 GUI support in ingen. git-svn-id: http://svn.drobilla.net/lad/slv2@763 a436a847-0d15-0410-975c-d299462d15a1 --- slv2/Makefile.am | 4 +- slv2/gui.h | 60 ---------------------- slv2/plugin.h | 20 ++++---- slv2/pluginguiinstance.h | 129 ----------------------------------------------- slv2/pluginuiinstance.h | 129 +++++++++++++++++++++++++++++++++++++++++++++++ slv2/slv2.h | 4 +- slv2/types.h | 12 ++--- slv2/ui.h | 60 ++++++++++++++++++++++ slv2/value.h | 16 +++--- 9 files changed, 217 insertions(+), 217 deletions(-) delete mode 100644 slv2/gui.h delete mode 100644 slv2/pluginguiinstance.h create mode 100644 slv2/pluginuiinstance.h create mode 100644 slv2/ui.h (limited to 'slv2') diff --git a/slv2/Makefile.am b/slv2/Makefile.am index 8deb4db..9c0aa21 100644 --- a/slv2/Makefile.am +++ b/slv2/Makefile.am @@ -1,13 +1,13 @@ slv2includedir = $(includedir)/slv2 slv2include_HEADERS = \ - gui.h \ + ui.h \ lv2.h \ lv2_gui.h \ plugin.h \ pluginclass.h \ pluginclasses.h \ - pluginguiinstance.h \ + pluginuiinstance.h \ plugininstance.h \ plugins.h \ port.h \ diff --git a/slv2/gui.h b/slv2/gui.h deleted file mode 100644 index 10620c9..0000000 --- a/slv2/gui.h +++ /dev/null @@ -1,60 +0,0 @@ -/* SLV2 - * Copyright (C) 2007 Dave Robillard - * - * This library is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the Free - * Software Foundation; either version 2 of the License, or (at your option) - * any later version. - * - * This library is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - */ - -#ifndef __SLV2_GUI_H__ -#define __SLV2_GUI_H__ - -#ifdef __cplusplus -extern "C" { -#endif - -#include -#include -#include -#include -#include -#include - -/** \defgroup gui Plugin GUI helpers - * - * SLV2 provides access to plugin GUIs, but does not depend on any widget sets - * itself. Paths to libraries and opaque pointers to objects are returned, but - * the GUI extension itself (the URI of which can be had with slv2_gui_get_uri) - * defines the specifics of how to use these objects/files/etc. - * - * @{ - */ - -/** Return the URI of the GUI type (ontology) this GUI corresponds to. - * - * Returned string is shared and must not be freed by the caller. - * - * Time = O(1) - */ -const char* -slv2_gui_type_get_uri(SLV2GUIType type); - - -/** @} */ - -#ifdef __cplusplus -} -#endif - -#endif /* __SLV2_GUI_H__ */ - diff --git a/slv2/plugin.h b/slv2/plugin.h index ed45a90..224a450 100644 --- a/slv2/plugin.h +++ b/slv2/plugin.h @@ -342,30 +342,30 @@ slv2_plugin_get_port_by_symbol(SLV2Plugin plugin, const char* symbol); -/** Get a list of all GUIs available for this plugin. +/** Get a list of all UIs available for this plugin. * - * Note this returns the URI of the GUI, and not the path/URI to its shared - * library, use slv2_plugin_gui_get_library_uri with the values returned + * Note this returns the URI of the UI, and not the path/URI to its shared + * library, use slv2_plugin_ui_get_library_uri with the values returned * here for that. * - * \param plugin The plugin to get the GUIs for. + * \param plugin The plugin to get the UIs for. * * Time = Query */ SLV2Values -slv2_plugin_get_guis(SLV2Plugin plugin); +slv2_plugin_get_uis(SLV2Plugin plugin); -/** Get the URI for a GUI library. +/** Get the URI for a UI library. * - * \param plugin The plugin that the GUI is for. - * \param gui A GUI identifier as returned by slv2_plugin_get_guis() (with type SLV2_VALUE_GUI). + * \param plugin The plugin that the UI is for. + * \param ui A UI identifier as returned by slv2_plugin_get_uis() (with type SLV2_VALUE_UI). * * Time = Query */ SLV2Value -slv2_plugin_get_gui_library_uri(SLV2Plugin plugin, - SLV2Value gui); +slv2_plugin_get_ui_library_uri(SLV2Plugin plugin, + SLV2Value ui); /** @} */ diff --git a/slv2/pluginguiinstance.h b/slv2/pluginguiinstance.h deleted file mode 100644 index 2eb9c60..0000000 --- a/slv2/pluginguiinstance.h +++ /dev/null @@ -1,129 +0,0 @@ -/* SLV2 - * Copyright (C) 2007 Dave Robillard - * Author: Lars Luthman - * - * This library is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the Free - * Software Foundation; either version 2 of the License, or (at your option) - * any later version. - * - * This library is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - */ - -#ifndef __SLV2_PLUGINGUIINSTANCE_H__ -#define __SLV2_PLUGINGUIINSTANCE_H__ - -#ifdef __cplusplus -extern "C" { -#endif - -#include -#include -#include - -/** \defgroup lib Plugin GUI library access - * - * An SLV2GUIInstance is an instantiated GUI for a SLV2Plugin. GUI instances - * are loaded from dynamically loaded libraries. These functions interact - * with the GUI code in the binary library only, they do not read data files - * in any way. - * - * @{ - */ - - -typedef struct _SLV2GUIInstanceImpl* SLV2GUIInstanceImpl; - - -struct _GtkWidget; - - -/** Instance of a plugin GUI. - * - * All details are in hidden in the pimpl member to avoid making the - * implementation a part of the ABI. - */ -typedef struct _SLV2GUIInstance { - SLV2GUIInstanceImpl pimpl; ///< Private implementation -}* SLV2GUIInstance; - - - -/** Instantiate a plugin GUI. - * - * The returned object represents shared library objects loaded into memory, - * it must be cleaned up with slv2_gui_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 host_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). - * - * \return NULL if instantiation failed. - */ -SLV2GUIInstance -slv2_plugin_gtk2_gui_instantiate(SLV2Plugin plugin, - SLV2Value gui, - LV2UI_Write_Function write_function, - LV2UI_Command_Function command_function, - LV2UI_Program_Change_Function program_function, - LV2UI_Program_Save_Function save_function, - LV2UI_Controller controller, - const LV2_Host_Feature* const* host_features); - - -/** Free a plugin GUI instance. - * - * \a instance is invalid after this call. - */ -void -slv2_gtk2_gui_instance_free(SLV2GUIInstance instance); - - -/** Get the widget for the GUI instance. - */ -LV2UI_Widget -slv2_gtk2_gui_instance_get_widget(SLV2GUIInstance instance); - - -/** Get the LV2UI_Descriptor of the plugin GUI instance. - * - * Normally hosts should not need to access the LV2UI_Descriptor directly, - * use the slv2_gui_instance_* functions. - * - * The returned descriptor is shared and must not be deleted. - */ -const LV2UI_Descriptor* -slv2_gtk2_gui_instance_get_descriptor(SLV2GUIInstance instance); - - -/** Get the LV2UI_Handle of the plugin GUI instance. - * - * Normally hosts should not need to access the LV2UI_Handle directly, - * use the slv2_gui_instance_* functions. - * - * The returned handle is shared and must not be deleted. - */ -LV2_Handle -slv2_gtk2_gui_instance_get_handle(SLV2GUIInstance instance); - - -/** @} */ - -#ifdef __cplusplus -} -#endif - - -#endif /* __SLV2_PLUGINGUIINSTANCE_H__ */ - diff --git a/slv2/pluginuiinstance.h b/slv2/pluginuiinstance.h new file mode 100644 index 0000000..48b915e --- /dev/null +++ b/slv2/pluginuiinstance.h @@ -0,0 +1,129 @@ +/* SLV2 + * Copyright (C) 2007 Dave Robillard + * Author: Lars Luthman + * + * This library is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the Free + * Software Foundation; either version 2 of the License, or (at your option) + * any later version. + * + * This library is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +#ifndef __SLV2_PLUGINUIINSTANCE_H__ +#define __SLV2_PLUGINUIINSTANCE_H__ + +#ifdef __cplusplus +extern "C" { +#endif + +#include +#include +#include + +/** \defgroup lib Plugin UI library access + * + * An SLV2UIInstance is an instantiated UI for a SLV2Plugin. UI instances + * are loaded from dynamically loaded libraries. These functions interact + * with the UI code in the binary library only, they do not read data files + * in any way. + * + * @{ + */ + + +typedef struct _SLV2UIInstanceImpl* SLV2UIInstanceImpl; + + +struct _GtkWidget; + + +/** Instance of a plugin UI. + * + * All details are in hidden in the pimpl member to avoid making the + * implementation a part of the ABI. + */ +typedef struct _SLV2UIInstance { + SLV2UIInstanceImpl pimpl; ///< Private implementation +}* SLV2UIInstance; + + + +/** 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 host_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). + * + * \return NULL if instantiation failed. + */ +SLV2UIInstance +slv2_plugin_ui_instantiate(SLV2Plugin plugin, + SLV2Value gui, + LV2UI_Write_Function write_function, + LV2UI_Command_Function command_function, + LV2UI_Program_Change_Function program_function, + LV2UI_Program_Save_Function save_function, + LV2UI_Controller controller, + const LV2_Host_Feature* const* host_features); + + +/** Free a plugin UI instance. + * + * \a instance is invalid after this call. + */ +void +slv2_ui_instance_free(SLV2UIInstance instance); + + +/** Get the widget for the UI instance. + */ +LV2UI_Widget +slv2_ui_instance_get_widget(SLV2UIInstance instance); + + +/** 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. + */ +const LV2UI_Descriptor* +slv2_ui_instance_get_descriptor(SLV2UIInstance 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. + */ +LV2_Handle +slv2_ui_instance_get_handle(SLV2UIInstance instance); + + +/** @} */ + +#ifdef __cplusplus +} +#endif + + +#endif /* __SLV2_PLUGINUIINSTANCE_H__ */ + diff --git a/slv2/slv2.h b/slv2/slv2.h index 14baa46..64c40c6 100644 --- a/slv2/slv2.h +++ b/slv2/slv2.h @@ -24,13 +24,13 @@ extern "C" { #endif #include -#include +#include #include #include #include #include #include -#include +#include #include #include #include diff --git a/slv2/types.h b/slv2/types.h index 5cb21f4..53a27c6 100644 --- a/slv2/types.h +++ b/slv2/types.h @@ -69,11 +69,11 @@ typedef enum _SLV2URIType { } SLV2URIType; -/** A type of plugin GUI (corresponding to some LV2 GUI extension). +/** A type of plugin UI (corresponding to some LV2 UI extension). */ -typedef enum _SLV2GUIType { - SLV2_GUI_TYPE_GTK2 ///< http://ll-plugins.nongnu.org/lv2/ext/gtk2gui -} SLV2GUIType; +typedef enum _SLV2UIType { + SLV2_UI_TYPE_GTK2 ///< http://ll-plugins.nongnu.org/lv2/ext/gui/dev/1#GtkGUI +} SLV2UIType; /** A port on a plugin. Opaque, but valid to compare to NULL. */ @@ -108,8 +108,8 @@ typedef struct _SLV2Value* SLV2Value; typedef void* SLV2Values; -/** A plugin GUI */ -typedef void* SLV2GUI; +/** A plugin UI */ +typedef void* SLV2UI; #ifdef __cplusplus diff --git a/slv2/ui.h b/slv2/ui.h new file mode 100644 index 0000000..ff6c394 --- /dev/null +++ b/slv2/ui.h @@ -0,0 +1,60 @@ +/* SLV2 + * Copyright (C) 2007 Dave Robillard + * + * This library is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the Free + * Software Foundation; either version 2 of the License, or (at your option) + * any later version. + * + * This library is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +#ifndef __SLV2_GUI_H__ +#define __SLV2_GUI_H__ + +#ifdef __cplusplus +extern "C" { +#endif + +#include +#include +#include +#include +#include +#include + +/** \defgroup ui Plugin GUI helpers + * + * SLV2 provides access to plugin GUIs, but does not depend on any widget sets + * itself. Paths to libraries and opaque pointers to objects are returned, but + * the GUI extension itself (the URI of which can be had with slv2_ui_get_uri) + * defines the specifics of how to use these objects/files/etc. + * + * @{ + */ + +/** Return the URI of the GUI type (ontology) this GUI corresponds to. + * + * Returned string is shared and must not be freed by the caller. + * + * Time = O(1) + */ +const char* +slv2_ui_type_get_uri(SLV2UIType type); + + +/** @} */ + +#ifdef __cplusplus +} +#endif + +#endif /* __SLV2_GUI_H__ */ + diff --git a/slv2/value.h b/slv2/value.h index f2db361..47bb1ff 100644 --- a/slv2/value.h +++ b/slv2/value.h @@ -74,7 +74,7 @@ slv2_value_is_uri(SLV2Value value); /** Return this value as a URI string, e.g. "http://example.org/foo". * * Valid to call only if slv2_value_is_uri(\a value) or - * slv2_value_is_gui(\a value) returns true. + * slv2_value_is_ui(\a value) returns true. * Returned value is owned by \a value and must not be freed by caller. * * Time = O(1) @@ -175,24 +175,24 @@ slv2_value_as_int(SLV2Value value); /** Return whether this value is a GUI (URI and type). * * If this returns true, slv2_value_as_uri will return the URI of the GUI, - * and slv2_value_as_gui_type will return the SLV2GUIType (which can be + * and slv2_value_as_ui_type will return the SLV2UIType (which can be * used to find the URI of the corresponding GUI spec itself, with - * slv2_gui_type_get_uri). + * slv2_ui_type_get_uri). * * Time = O(1) */ bool -slv2_value_is_gui(SLV2Value value); +slv2_value_is_ui(SLV2Value value); -/** Return \a value as an SLV2GUIType. +/** Return \a value as an SLV2UIType. * - * Valid to call only if slv2_value_is_gui(\a value) returns true. + * Valid to call only if slv2_value_is_ui(\a value) returns true. * * Time = O(1) */ -SLV2GUIType -slv2_value_as_gui_type(SLV2Value value); +SLV2UIType +slv2_value_as_ui_type(SLV2Value value); /** @} */ -- cgit v1.2.1