From f291f0a52c45c9ae14d031c1fc16d772c65d94ce Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sat, 30 Jun 2007 23:33:36 +0000 Subject: Reworked GUI access in a safer way, anticipating various GUI specs (w/o breaking binary compatibility). Increment libtool library version number accordingly (new methods added, still backwards compatible). git-svn-id: http://svn.drobilla.net/lad/slv2@547 a436a847-0d15-0410-975c-d299462d15a1 --- slv2/Makefile.am | 1 + slv2/plugin.h | 4 ++-- slv2/slv2.h | 1 + slv2/types.h | 11 +++++++++++ slv2/value.h | 25 ++++++++++++++++++++++++- 5 files changed, 39 insertions(+), 3 deletions(-) (limited to 'slv2') diff --git a/slv2/Makefile.am b/slv2/Makefile.am index e0a9c0e..f090e22 100644 --- a/slv2/Makefile.am +++ b/slv2/Makefile.am @@ -1,6 +1,7 @@ slv2includedir = $(includedir)/slv2 slv2include_HEADERS = \ + gui.h \ lv2.h \ lv2-gtk2gui.h \ plugin.h \ diff --git a/slv2/plugin.h b/slv2/plugin.h index 9dc53e7..36add35 100644 --- a/slv2/plugin.h +++ b/slv2/plugin.h @@ -338,12 +338,12 @@ slv2_plugin_get_guis(SLV2Plugin plugin); /** Get the URI for a GUI library. * * \param plugin The plugin that the GUI is for. - * \param gui A GUI identifier as returned by slv2_plugin_get_guis(). + * \param gui A GUI identifier as returned by slv2_plugin_get_guis() (with type SLV2_VALUE_GUI). * * Time = Query */ SLV2Value -slv2_plugin_gui_get_library_uri(SLV2Plugin plugin, +slv2_plugin_get_gui_library_uri(SLV2Plugin plugin, SLV2Value gui); diff --git a/slv2/slv2.h b/slv2/slv2.h index e5c2b07..e575229 100644 --- a/slv2/slv2.h +++ b/slv2/slv2.h @@ -24,6 +24,7 @@ extern "C" { #endif #include +#include #include #include #include diff --git a/slv2/types.h b/slv2/types.h index e5c10e2..0eba199 100644 --- a/slv2/types.h +++ b/slv2/types.h @@ -55,6 +55,13 @@ typedef enum _SLV2URIType { } SLV2URIType; +/** A type of plugin GUI (corresponding to some LV2 GUI extension). + */ +typedef enum _SLV2GUIType { + SLV2_GTK2_GUI ///< http://ll-plugins.nongnu.org/lv2/ext/gtk2gui +} SLV2GUIType; + + /** A port on a plugin. Opaque, but valid to compare to NULL. */ typedef struct _SLV2Port* SLV2Port; @@ -87,6 +94,10 @@ typedef struct _SLV2Value* SLV2Value; typedef void* SLV2Values; +/** A plugin GUI */ +typedef void* SLV2GUI; + + #ifdef __cplusplus } #endif diff --git a/slv2/value.h b/slv2/value.h index 1470d36..4fd0cf4 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_qname(\a value) returns true. + * slv2_value_is_gui(\a value) returns true. * Returned value is owned by \a value and must not be freed by caller. * * Time = O(1) @@ -172,6 +172,29 @@ int 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 + * used to find the URI of the corresponding GUI spec itself, with + * slv2_gui_type_get_uri). + * + * Time = O(1) + */ +bool +slv2_value_is_gui(SLV2Value value); + + +/** Return \a value as an SLV2GUIType. + * + * Valid to call only if slv2_value_is_gui(\a value) returns true. + * + * Time = O(1) + */ +SLV2GUIType +slv2_value_as_gui_type(SLV2Value value); + + /** @} */ #ifdef __cplusplus -- cgit v1.2.1