diff options
author | David Robillard <d@drobilla.net> | 2011-02-12 03:49:06 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2011-02-12 03:49:06 +0000 |
commit | 389408984b381af772d456c60ceaddfe58288eee (patch) | |
tree | aa61aa403a9cc2cb987fe8ac6007b6c6c8d4df73 /src | |
parent | e07eb06e7d29cc2ddee94e24571118d09c624e1e (diff) | |
download | lilv-389408984b381af772d456c60ceaddfe58288eee.tar.gz lilv-389408984b381af772d456c60ceaddfe58288eee.tar.bz2 lilv-389408984b381af772d456c60ceaddfe58288eee.zip |
Document entire API in a single header/page.
git-svn-id: http://svn.drobilla.net/lad/trunk/slv2@2925 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src')
-rw-r--r-- | src/collections.c | 4 | ||||
-rw-r--r-- | src/plugin.c | 5 | ||||
-rw-r--r-- | src/pluginclass.c | 3 | ||||
-rw-r--r-- | src/plugininstance.c | 7 | ||||
-rw-r--r-- | src/plugins.c | 4 | ||||
-rw-r--r-- | src/pluginui.c | 3 | ||||
-rw-r--r-- | src/pluginuiinstance.c | 37 | ||||
-rw-r--r-- | src/port.c | 4 | ||||
-rw-r--r-- | src/query.c | 4 | ||||
-rw-r--r-- | src/scalepoint.c | 3 | ||||
-rw-r--r-- | src/slv2_internal.h | 12 | ||||
-rw-r--r-- | src/util.c | 1 | ||||
-rw-r--r-- | src/value.c | 2 | ||||
-rw-r--r-- | src/world.c | 6 |
14 files changed, 23 insertions, 72 deletions
diff --git a/src/collections.c b/src/collections.c index df84581..862a401 100644 --- a/src/collections.c +++ b/src/collections.c @@ -18,10 +18,6 @@ #include <glib.h> -#include "slv2/collections.h" -#include "slv2/pluginclass.h" -#include "slv2/pluginui.h" -#include "slv2/value.h" #include "slv2_internal.h" /* ARRAYS */ diff --git a/src/plugin.c b/src/plugin.c index 71d4b0f..78c8b73 100644 --- a/src/plugin.c +++ b/src/plugin.c @@ -27,11 +27,6 @@ #include <dlfcn.h> #endif -#include "slv2/collections.h" -#include "slv2/plugin.h" -#include "slv2/pluginclass.h" -#include "slv2/types.h" -#include "slv2/util.h" #include "slv2_internal.h" /** Ownership of @a uri is taken */ diff --git a/src/pluginclass.c b/src/pluginclass.c index 9780e8a..d2de756 100644 --- a/src/pluginclass.c +++ b/src/pluginclass.c @@ -22,9 +22,6 @@ #include <stdlib.h> #include <string.h> -#include "slv2/pluginclass.h" -#include "slv2/types.h" -#include "slv2/value.h" #include "slv2_internal.h" SLV2PluginClass diff --git a/src/plugininstance.c b/src/plugininstance.c index b0402a7..d185b4a 100644 --- a/src/plugininstance.c +++ b/src/plugininstance.c @@ -23,11 +23,6 @@ #include <stdlib.h> #include <string.h> -#include "slv2/plugin.h" -#include "slv2/plugininstance.h" -#include "slv2/types.h" -#include "slv2/util.h" -#include "slv2/value.h" #include "slv2_internal.h" SLV2_API @@ -105,7 +100,7 @@ slv2_plugin_instantiate(SLV2Plugin plugin, result->lv2_descriptor = ld; result->lv2_handle = ld->instantiate(ld, sample_rate, (char*)bundle_path, (features) ? features : local_features); - struct _InstanceImpl* impl = malloc(sizeof(struct _InstanceImpl)); + struct _SLV2InstanceImpl* impl = malloc(sizeof(struct _SLV2InstanceImpl)); impl->lib_handle = lib; result->pimpl = impl; serd_node_free(&abs_uri_node); diff --git a/src/plugins.c b/src/plugins.c index 2f0598a..b966986 100644 --- a/src/plugins.c +++ b/src/plugins.c @@ -23,10 +23,6 @@ #include <stdlib.h> #include <string.h> -#include "slv2/collections.h" -#include "slv2/plugin.h" -#include "slv2/types.h" -#include "slv2/util.h" #include "slv2_internal.h" SLV2Plugins diff --git a/src/pluginui.c b/src/pluginui.c index f5a05f1..d4ce24f 100644 --- a/src/pluginui.c +++ b/src/pluginui.c @@ -22,9 +22,6 @@ #include <stdlib.h> #include <string.h> -#include "slv2/collections.h" -#include "slv2/pluginui.h" -#include "slv2/types.h" #include "slv2_internal.h" SLV2UI diff --git a/src/pluginuiinstance.c b/src/pluginuiinstance.c index 852e394..908d746 100644 --- a/src/pluginuiinstance.c +++ b/src/pluginuiinstance.c @@ -26,11 +26,6 @@ #include <dlfcn.h> -#include "slv2/plugin.h" -#include "slv2/pluginui.h" -#include "slv2/pluginuiinstance.h" -#include "slv2/types.h" -#include "slv2/util.h" #include "slv2_internal.h" SLV2_API @@ -87,31 +82,29 @@ slv2_ui_instantiate(SLV2Plugin plugin, // Create SLV2UIInstance to return result = malloc(sizeof(struct _SLV2UIInstance)); - struct _SLV2UIInstanceImpl* impl = malloc(sizeof(struct _SLV2UIInstanceImpl)); - impl->lv2ui_descriptor = ld; - impl->lv2ui_handle = ld->instantiate(ld, + result->lv2ui_descriptor = ld; + result->lv2ui_handle = ld->instantiate(ld, slv2_value_as_uri(slv2_plugin_get_uri(plugin)), (char*)bundle_path, write_function, controller, - &impl->widget, + &result->widget, features); - impl->lib_handle = lib; - result->pimpl = impl; + result->lib_handle = lib; break; } } } // Failed to instantiate - if (result == NULL || result->pimpl->lv2ui_handle == NULL) { + if (result == NULL || result->lv2ui_handle == NULL) { free(result); return NULL; } // Failed to create a widget, but still got a handle - this means that // the plugin is buggy - if (result->pimpl->widget == NULL) { + if (result->widget == NULL) { slv2_ui_instance_free(result); return NULL; } @@ -130,30 +123,30 @@ slv2_ui_instance_free(SLV2UIInstance instance) return; struct _SLV2UIInstance* i = (struct _SLV2UIInstance*)instance; - i->pimpl->lv2ui_descriptor->cleanup(i->pimpl->lv2ui_handle); - i->pimpl->lv2ui_descriptor = NULL; - dlclose(i->pimpl->lib_handle); - i->pimpl->lib_handle = NULL; - free(i->pimpl); - i->pimpl = NULL; + i->lv2ui_descriptor->cleanup(i->lv2ui_handle); + i->lv2ui_descriptor = NULL; + dlclose(i->lib_handle); + i->lib_handle = NULL; + free(i); + i = NULL; free(i); } SLV2_API LV2UI_Widget slv2_ui_instance_get_widget(SLV2UIInstance instance) { - return instance->pimpl->widget; + return instance->widget; } SLV2_API const LV2UI_Descriptor* slv2_ui_instance_get_descriptor(SLV2UIInstance instance) { - return instance->pimpl->lv2ui_descriptor; + return instance->lv2ui_descriptor; } SLV2_API LV2UI_Handle slv2_ui_instance_get_handle(SLV2UIInstance instance) { - return instance->pimpl->lv2ui_handle; + return instance->lv2ui_handle; } @@ -24,10 +24,6 @@ #include <stdlib.h> #include <string.h> -#include "slv2/collections.h" -#include "slv2/port.h" -#include "slv2/types.h" -#include "slv2/util.h" #include "slv2_internal.h" SLV2Port diff --git a/src/query.c b/src/query.c index dad639b..2f5875e 100644 --- a/src/query.c +++ b/src/query.c @@ -23,10 +23,6 @@ #include <stdlib.h> #include <string.h> -#include "slv2/collections.h" -#include "slv2/plugin.h" -#include "slv2/types.h" -#include "slv2/util.h" #include "slv2_internal.h" SLV2Matches diff --git a/src/scalepoint.c b/src/scalepoint.c index 3b4ea37..f153143 100644 --- a/src/scalepoint.c +++ b/src/scalepoint.c @@ -24,9 +24,6 @@ #include <glib.h> -#include "slv2/scalepoint.h" -#include "slv2/types.h" -#include "slv2/value.h" #include "slv2_internal.h" /** Ownership of value and label is taken */ diff --git a/src/slv2_internal.h b/src/slv2_internal.h index e5aac33..092d633 100644 --- a/src/slv2_internal.h +++ b/src/slv2_internal.h @@ -18,8 +18,8 @@ #include "slv2-config.h" -#ifndef __SLV2_INTERNAL_H__ -#define __SLV2_INTERNAL_H__ +#ifndef SLV2_INTERNAL_H__ +#define SLV2_INTERNAL_H__ #ifdef __cplusplus extern "C" { @@ -41,7 +41,7 @@ extern "C" { #include "lv2/lv2plug.in/ns/ext/dyn-manifest/dyn-manifest.h" #endif -#include "slv2/types.h" +#include "slv2/slv2.h" #include "slv2/lv2_ui.h" #define SLV2_NS_DOAP (const uint8_t*)"http://usefulinc.com/ns/doap#" @@ -144,14 +144,14 @@ slv2_plugins_new(); /* ********* Instance ********* */ /** Pimpl portion of SLV2Instance */ -struct _InstanceImpl { +struct _SLV2InstanceImpl { void* lib_handle; }; /* ********* UI Instance ********* */ -struct _SLV2UIInstanceImpl { +struct _SLV2UIInstance { void* lib_handle; const LV2UI_Descriptor* lv2ui_descriptor; LV2UI_Handle lv2ui_handle; @@ -363,5 +363,5 @@ static const LV2_Feature* const dman_features = { NULL }; } #endif -#endif /* __SLV2_INTERNAL_H__ */ +#endif /* SLV2_INTERNAL_H__ */ @@ -23,7 +23,6 @@ #include <stdlib.h> #include <string.h> -#include "slv2/util.h" #include "slv2_internal.h" char* diff --git a/src/value.c b/src/value.c index dc75e07..81def9e 100644 --- a/src/value.c +++ b/src/value.c @@ -25,8 +25,6 @@ #include <glib.h> -#include "slv2/types.h" -#include "slv2/value.h" #include "slv2_internal.h" static void diff --git a/src/world.c b/src/world.c index a1ed8c9..f1c02bb 100644 --- a/src/world.c +++ b/src/world.c @@ -18,6 +18,7 @@ #define _XOPEN_SOURCE 500 +#include <assert.h> #include <stdlib.h> #include <string.h> @@ -27,11 +28,6 @@ #include <dlfcn.h> #endif -#include "slv2-config.h" -#include "slv2/slv2.h" -#include "slv2/types.h" -#include "slv2/util.h" -#include "slv2/world.h" #include "slv2_internal.h" static void |