summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/plugin.c19
-rw-r--r--src/pluginui.c18
-rw-r--r--src/pluginuiinstance.c24
-rw-r--r--src/pluginuis.c24
-rw-r--r--src/slv2_internal.h17
5 files changed, 47 insertions, 55 deletions
diff --git a/src/plugin.c b/src/plugin.c
index 758b256..055d727 100644
--- a/src/plugin.c
+++ b/src/plugin.c
@@ -566,7 +566,7 @@ slv2_plugin_get_port_by_symbol(SLV2Plugin p,
}
-SLV2PluginUIs
+SLV2UIs
slv2_plugin_get_uis(SLV2Plugin plugin)
{
const char* const query_str =
@@ -579,14 +579,14 @@ slv2_plugin_get_uis(SLV2Plugin plugin)
librdf_query_results* results = slv2_plugin_query(plugin, query_str);
- SLV2PluginUIs result = slv2_plugin_uis_new();
+ SLV2UIs result = slv2_uis_new();
while (!librdf_query_results_finished(results)) {
librdf_node* uri_node = librdf_query_results_get_binding_value(results, 0);
librdf_node* type_node = librdf_query_results_get_binding_value(results, 1);
librdf_node* binary_node = librdf_query_results_get_binding_value(results, 2);
- SLV2PluginUI ui = slv2_plugin_ui_new(plugin->world,
+ SLV2UI ui = slv2_ui_new(plugin->world,
librdf_node_get_uri(uri_node),
librdf_node_get_uri(type_node),
librdf_node_get_uri(binary_node));
@@ -602,10 +602,10 @@ slv2_plugin_get_uis(SLV2Plugin plugin)
librdf_free_query_results(results);
- if (slv2_plugin_uis_size(result) > 0) {
+ if (slv2_uis_size(result) > 0) {
return result;
} else {
- slv2_plugin_uis_free(result);
+ slv2_uis_free(result);
return NULL;
}
}
@@ -641,15 +641,6 @@ slv2_plugin_get_ui_library_uri(SLV2Plugin plugin,
}
#endif
-const char*
-slv2_ui_type_get_uri(SLV2UIType type)
-{
- if (type == SLV2_UI_TYPE_GTK2)
- return "http://ll-plugins.nongnu.org/ext/gui/dev/1#GtkUI";
- else
- return NULL;
-}
-
void*
slv2_plugin_load_ui(SLV2Plugin plugin,
diff --git a/src/pluginui.c b/src/pluginui.c
index ed9eec5..9237382 100644
--- a/src/pluginui.c
+++ b/src/pluginui.c
@@ -26,13 +26,13 @@
/* private */
-SLV2PluginUI
-slv2_plugin_ui_new(SLV2World world,
+SLV2UI
+slv2_ui_new(SLV2World world,
librdf_uri* uri,
librdf_uri* type_uri,
librdf_uri* binary_uri)
{
- struct _SLV2PluginUI* ui = malloc(sizeof(struct _SLV2PluginUI));
+ struct _SLV2UI* ui = malloc(sizeof(struct _SLV2UI));
ui->uri = librdf_new_uri_from_uri(uri);
ui->binary_uri = librdf_new_uri_from_uri(binary_uri);
@@ -53,7 +53,7 @@ slv2_plugin_ui_new(SLV2World world,
/* private */
void
-slv2_plugin_ui_free(SLV2PluginUI ui)
+slv2_ui_free(SLV2UI ui)
{
librdf_free_uri(ui->uri);
ui->uri = NULL;
@@ -71,7 +71,7 @@ slv2_plugin_ui_free(SLV2PluginUI ui)
const char*
-slv2_plugin_ui_get_uri(SLV2PluginUI ui)
+slv2_ui_get_uri(SLV2UI ui)
{
assert(ui);
assert(ui->uri);
@@ -80,14 +80,14 @@ slv2_plugin_ui_get_uri(SLV2PluginUI ui)
SLV2Values
-slv2_plugin_ui_get_types(SLV2PluginUI ui)
+slv2_ui_get_types(SLV2UI ui)
{
return ui->types;
}
bool
-slv2_plugin_ui_is_type(SLV2PluginUI ui, const char* type_uri)
+slv2_ui_is_type(SLV2UI ui, const char* type_uri)
{
SLV2Value type = slv2_value_new(SLV2_VALUE_URI, type_uri);
bool ret = slv2_values_contains(ui->types, type);
@@ -97,7 +97,7 @@ slv2_plugin_ui_is_type(SLV2PluginUI ui, const char* type_uri)
const char*
-slv2_plugin_ui_get_bundle_uri(SLV2PluginUI ui)
+slv2_ui_get_bundle_uri(SLV2UI ui)
{
assert(ui);
assert(ui->bundle_uri);
@@ -106,7 +106,7 @@ slv2_plugin_ui_get_bundle_uri(SLV2PluginUI ui)
const char*
-slv2_plugin_ui_get_binary_uri(SLV2PluginUI ui)
+slv2_ui_get_binary_uri(SLV2UI ui)
{
assert(ui);
assert(ui->binary_uri);
diff --git a/src/pluginuiinstance.c b/src/pluginuiinstance.c
index 60a3267..662f1b7 100644
--- a/src/pluginuiinstance.c
+++ b/src/pluginuiinstance.c
@@ -33,14 +33,14 @@
SLV2UIInstance
-slv2_plugin_ui_instantiate(SLV2Plugin plugin,
- SLV2PluginUI ui,
- 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)
+slv2_ui_instantiate(SLV2Plugin plugin,
+ SLV2UI ui,
+ 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)
{
struct _SLV2UIInstance* result = NULL;
@@ -50,7 +50,7 @@ slv2_plugin_ui_instantiate(SLV2Plugin plugin,
((LV2_Host_Feature**)host_features)[0] = NULL;
}
- const char* const lib_uri = slv2_plugin_ui_get_binary_uri(ui);
+ const char* const lib_uri = slv2_ui_get_binary_uri(ui);
const char* const lib_path = slv2_uri_to_path(lib_uri);
if (!lib_path)
@@ -72,7 +72,7 @@ slv2_plugin_ui_instantiate(SLV2Plugin plugin,
return NULL;
} else {
- const char* bundle_path = slv2_uri_to_path(slv2_plugin_ui_get_bundle_uri(ui));
+ const char* bundle_path = slv2_uri_to_path(slv2_ui_get_bundle_uri(ui));
for (uint32_t i=0; 1; ++i) {
@@ -80,10 +80,10 @@ slv2_plugin_ui_instantiate(SLV2Plugin plugin,
if (!ld) {
fprintf(stderr, "Did not find UI %s in %s\n",
- slv2_plugin_ui_get_uri(ui), lib_path);
+ slv2_ui_get_uri(ui), lib_path);
dlclose(lib);
break; // return NULL
- } else if (!strcmp(ld->URI, slv2_plugin_ui_get_uri(ui))) {
+ } else if (!strcmp(ld->URI, slv2_ui_get_uri(ui))) {
printf("Found UI %s at index %u in:\n\t%s\n\n",
librdf_uri_as_string(plugin->plugin_uri), i, lib_path);
diff --git a/src/pluginuis.c b/src/pluginuis.c
index 6e0f77f..5d01bae 100644
--- a/src/pluginuis.c
+++ b/src/pluginuis.c
@@ -30,30 +30,30 @@
#include "slv2_internal.h"
-SLV2PluginUIs
-slv2_plugin_uis_new()
+SLV2UIs
+slv2_uis_new()
{
- return raptor_new_sequence((void (*)(void*))&slv2_plugin_ui_free, NULL);
+ return raptor_new_sequence((void (*)(void*))&slv2_ui_free, NULL);
//return raptor_new_sequence(NULL, NULL);
}
void
-slv2_plugin_uis_free(SLV2PluginUIs list)
+slv2_uis_free(SLV2UIs list)
{
raptor_free_sequence(list);
}
unsigned
-slv2_plugin_uis_size(SLV2PluginUIs list)
+slv2_uis_size(SLV2UIs list)
{
return raptor_sequence_size(list);
}
-SLV2PluginUI
-slv2_plugin_uis_get_by_uri(SLV2PluginUIs list, const char* uri)
+SLV2UI
+slv2_uis_get_by_uri(SLV2UIs list, const char* uri)
{
// good old fashioned binary search
@@ -64,9 +64,9 @@ slv2_plugin_uis_get_by_uri(SLV2PluginUIs list, const char* uri)
while (upper >= lower) {
i = lower + ((upper - lower) / 2);
- SLV2PluginUI ui = raptor_sequence_get_at(list, i);
+ SLV2UI ui = raptor_sequence_get_at(list, i);
- int cmp = strcmp(slv2_plugin_ui_get_uri(ui), uri);
+ int cmp = strcmp(slv2_ui_get_uri(ui), uri);
if (cmp == 0)
return ui;
@@ -80,12 +80,12 @@ slv2_plugin_uis_get_by_uri(SLV2PluginUIs list, const char* uri)
}
-SLV2PluginUI
-slv2_plugin_uis_get_at(SLV2PluginUIs list, unsigned index)
+SLV2UI
+slv2_uis_get_at(SLV2UIs list, unsigned index)
{
if (index > INT_MAX)
return NULL;
else
- return (SLV2PluginUI)raptor_sequence_get_at(list, (int)index);
+ return (SLV2UI)raptor_sequence_get_at(list, (int)index);
}
diff --git a/src/slv2_internal.h b/src/slv2_internal.h
index 57343fe..6aba9de 100644
--- a/src/slv2_internal.h
+++ b/src/slv2_internal.h
@@ -171,20 +171,21 @@ slv2_world_load_file(SLV2World world, librdf_uri* file_uri);
/* ********* Plugin UI ********* */
-struct _SLV2PluginUI {
+struct _SLV2UI {
librdf_uri* uri;
librdf_uri* bundle_uri;
librdf_uri* binary_uri;
SLV2Values types;
};
-SLV2PluginUIs slv2_plugin_uis_new();
-SLV2PluginUI
-slv2_plugin_ui_new(SLV2World world,
- librdf_uri* uri,
- librdf_uri* type_uri,
- librdf_uri* binary_uri);
-void slv2_plugin_ui_free(SLV2PluginUI ui);
+SLV2UIs slv2_uis_new();
+SLV2UI
+slv2_ui_new(SLV2World world,
+ librdf_uri* uri,
+ librdf_uri* type_uri,
+ librdf_uri* binary_uri);
+
+void slv2_ui_free(SLV2UI ui);
/* ********* Value ********* */