Browse Source

Update lilv UI patch

tags/1.9.4
falkTX 11 years ago
parent
commit
001e73fb3a
5 changed files with 220 additions and 137 deletions
  1. +0
    -137
      source/libs/lilv/custom-patches/lilv_ui-features+lilvmm.patch
  2. +125
    -0
      source/libs/lilv/custom-patches/lilv_ui-features.patch
  3. +19
    -0
      source/libs/lilv/lilv-0.16.0/lilv/lilv.h
  4. +20
    -0
      source/libs/lilv/lilv-0.16.0/lilv/lilvmm.hpp
  5. +56
    -0
      source/libs/lilv/lilv-0.16.0/src/ui.c

+ 0
- 137
source/libs/lilv/custom-patches/lilv_ui-features+lilvmm.patch View File

@@ -1,137 +0,0 @@
diff -U 3 -H -d -r -N -- lilv-0.14.4.old/lilv/lilv.h lilv-0.14.4/lilv/lilv.h
--- lilv-0.14.4.old/lilv/lilv.h 2012-09-07 19:00:48.464571333 +0100
+++ lilv-0.14.4/lilv/lilv.h 2012-09-07 18:54:00.626548936 +0100
@@ -1693,6 +1693,25 @@
lilv_ui_get_binary_uri(const LilvUI* ui);
/**
+ Custom calls
+*/
+LILV_API
+LilvNodes*
+lilv_ui_get_supported_features(const LilvUI* ui);
+
+LILV_API
+LilvNodes*
+lilv_ui_get_required_features(const LilvUI* ui);
+
+LILV_API
+LilvNodes*
+lilv_ui_get_optional_features(const LilvUI* ui);
+
+LILV_API
+LilvNodes*
+lilv_ui_get_extension_data(const LilvUI* ui);
+
+/**
@}
@}
*/
diff -U 3 -H -d -r -N -- lilv-0.14.4.old/lilv/lilvmm.hpp lilv-0.14.4/lilv/lilvmm.hpp
--- lilv-0.14.4.old/lilv/lilvmm.hpp 2012-07-18 02:42:43.000000000 +0100
+++ lilv-0.14.4/lilv/lilvmm.hpp 2012-09-07 18:53:14.134318379 +0100
@@ -136,6 +136,7 @@
struct Nodes {
LILV_WRAP_COLL(Nodes, Node, nodes);
LILV_WRAP1(bool, nodes, contains, const Node, node);
+ LILV_WRAP0(Node, nodes, get_first);
};
struct Port {
@@ -167,6 +168,26 @@
const LilvPort* me;
};
+struct UI {
+ inline UI(const LilvUI* c_obj) : me(c_obj) {}
+ LILV_WRAP_CONVERSION(const LilvUI);
+
+ LILV_WRAP0(Node, ui, get_uri);
+ LILV_WRAP1(bool, ui, is_a, LilvNode*, ui_class);
+ LILV_WRAP0(Node, ui, get_bundle_uri);
+ LILV_WRAP0(Node, ui, get_binary_uri);
+ LILV_WRAP0(Nodes, ui, get_supported_features);
+ LILV_WRAP0(Nodes, ui, get_required_features);
+ LILV_WRAP0(Nodes, ui, get_optional_features);
+ LILV_WRAP0(Nodes, ui, get_extension_data);
+
+ const LilvUI* me;
+};
+
+struct UIs {
+ LILV_WRAP_COLL(UIs, UI, uis);
+};
+
struct Plugin {
inline Plugin(const LilvPlugin* c_obj) : me(c_obj) {}
LILV_WRAP_CONVERSION(const LilvPlugin);
@@ -190,6 +211,8 @@
LILV_WRAP0(Node, plugin, get_author_email);
LILV_WRAP0(Node, plugin, get_author_homepage);
LILV_WRAP0(bool, plugin, is_replaced);
+ LILV_WRAP0(Nodes, plugin, get_extension_data);
+ LILV_WRAP0(UIs, plugin, get_uis);
inline Port get_port_by_index(unsigned index) {
return Port(me, lilv_plugin_get_port_by_index(me, index));
diff -U 3 -H -d -r -N -- lilv-0.14.4.old/src/ui.c lilv-0.14.4/src/ui.c
--- lilv-0.14.4.old/src/ui.c 2012-09-07 19:00:48.464571333 +0100
+++ lilv-0.14.4/src/ui.c 2012-09-07 18:59:51.652289664 +0100
@@ -128,3 +128,57 @@
assert(ui->binary_uri);
return ui->binary_uri;
}
+
+static LilvNodes*
+lilv_ui_get_value_internal(const LilvUI* ui,
+ const SordNode* predicate)
+{
+ return lilv_world_query_values_internal(
+ ui->world, ui->uri->node, predicate, NULL);
+}
+
+LILV_API
+LilvNodes*
+lilv_ui_get_supported_features(const LilvUI* ui)
+{
+ LilvNodes* optional = lilv_ui_get_optional_features(ui);
+ LilvNodes* required = lilv_ui_get_required_features(ui);
+ LilvNodes* result = lilv_nodes_new();
+
+ LILV_FOREACH(nodes, i, optional)
+ zix_tree_insert((ZixTree*)result,
+ lilv_node_duplicate(lilv_nodes_get(optional, i)),
+ NULL);
+ LILV_FOREACH(nodes, i, required)
+ zix_tree_insert((ZixTree*)result,
+ lilv_node_duplicate(lilv_nodes_get(required, i)),
+ NULL);
+
+ lilv_nodes_free(optional);
+ lilv_nodes_free(required);
+
+ return result;
+}
+
+LILV_API
+LilvNodes*
+lilv_ui_get_required_features(const LilvUI* ui)
+{
+ return lilv_ui_get_value_internal(
+ ui, ui->world->uris.lv2_requiredFeature);
+}
+
+LILV_API
+LilvNodes*
+lilv_ui_get_optional_features(const LilvUI* ui)
+{
+ return lilv_ui_get_value_internal(
+ ui, ui->world->uris.lv2_optionalFeature);
+}
+
+LILV_API
+LilvNodes*
+lilv_ui_get_extension_data(const LilvUI* ui)
+{
+ return lilv_ui_get_value_internal(ui, ui->world->uris.lv2_extensionData);
+}

+ 125
- 0
source/libs/lilv/custom-patches/lilv_ui-features.patch View File

@@ -0,0 +1,125 @@
diff --git a/source/libs/lilv/lilv-0.16.0/lilv/lilv.h b/source/libs/lilv/lilv-0.16.0/lilv/lilv.h
index ff1839f..c780326 100644
--- a/source/libs/lilv/lilv-0.16.0/lilv/lilv.h
+++ b/source/libs/lilv/lilv-0.16.0/lilv/lilv.h
@@ -1769,6 +1769,25 @@ const LilvNode*
lilv_ui_get_binary_uri(const LilvUI* ui);
/**
+ Custom calls
+*/
+LILV_API
+const LilvNodes*
+lilv_ui_get_supported_features(const LilvUI* ui);
+
+LILV_API
+const LilvNodes*
+lilv_ui_get_required_features(const LilvUI* ui);
+
+LILV_API
+const LilvNodes*
+lilv_ui_get_optional_features(const LilvUI* ui);
+
+LILV_API
+const LilvNodes*
+lilv_ui_get_extension_data(const LilvUI* ui);
+
+/**
@}
@}
*/
diff --git a/source/libs/lilv/lilv-0.16.0/lilv/lilvmm.hpp b/source/libs/lilv/lilv-0.16.0/lilv/lilvmm.hpp
index 4215ab8..3047930 100644
--- a/source/libs/lilv/lilv-0.16.0/lilv/lilvmm.hpp
+++ b/source/libs/lilv/lilv-0.16.0/lilv/lilvmm.hpp
@@ -169,6 +169,26 @@ struct Port {
const LilvPort* me;
};
+struct UI {
+ inline UI(const LilvUI* c_obj) : me(c_obj) {}
+ LILV_WRAP_CONVERSION(const LilvUI);
+
+ LILV_WRAP0(Node, ui, get_uri);
+ LILV_WRAP1(bool, ui, is_a, LilvNode*, ui_class);
+ LILV_WRAP0(Node, ui, get_bundle_uri);
+ LILV_WRAP0(Node, ui, get_binary_uri);
+ LILV_WRAP0(Nodes, ui, get_supported_features);
+ LILV_WRAP0(Nodes, ui, get_required_features);
+ LILV_WRAP0(Nodes, ui, get_optional_features);
+ LILV_WRAP0(Nodes, ui, get_extension_data);
+
+ const LilvUI* me;
+};
+
+struct UIs {
+ LILV_WRAP_COLL(UIs, UI, uis);
+};
+
struct Plugin {
inline Plugin(const LilvPlugin* c_obj) : me(c_obj) {}
LILV_WRAP_CONVERSION(const LilvPlugin);
diff --git a/source/libs/lilv/lilv-0.16.0/src/ui.c b/source/libs/lilv/lilv-0.16.0/src/ui.c
index 5d2f066..c2780e0 100644
--- a/source/libs/lilv/lilv-0.16.0/src/ui.c
+++ b/source/libs/lilv/lilv-0.16.0/src/ui.c
@@ -128,3 +128,59 @@ lilv_ui_get_binary_uri(const LilvUI* ui)
assert(ui->binary_uri);
return ui->binary_uri;
}
+
+static LilvNodes*
+lilv_ui_get_value_internal(const LilvUI* ui,
+ const SordNode* predicate)
+{
+ assert(ui);
+ return lilv_world_find_nodes_internal(ui->world, ui->uri->node, predicate, NULL);
+}
+
+LILV_API
+const LilvNodes*
+lilv_ui_get_supported_features(const LilvUI* ui)
+{
+ assert(ui);
+ LilvNodes* optional = lilv_ui_get_optional_features(ui);
+ LilvNodes* required = lilv_ui_get_required_features(ui);
+ LilvNodes* result = lilv_nodes_new();
+
+ LILV_FOREACH(nodes, i, optional)
+ zix_tree_insert((ZixTree*)result, lilv_node_duplicate(lilv_nodes_get(optional, i)), NULL);
+
+ LILV_FOREACH(nodes, i, required)
+ zix_tree_insert((ZixTree*)result, lilv_node_duplicate(lilv_nodes_get(required, i)), NULL);
+
+ lilv_nodes_free(optional);
+ lilv_nodes_free(required);
+
+ return result;
+}
+
+LILV_API
+const LilvNodes*
+lilv_ui_get_required_features(const LilvUI* ui)
+{
+ assert(ui);
+ assert(ui->world);
+ return lilv_ui_get_value_internal(ui, ui->world->uris.lv2_requiredFeature);
+}
+
+LILV_API
+const LilvNodes*
+lilv_ui_get_optional_features(const LilvUI* ui)
+{
+ assert(ui);
+ assert(ui->world);
+ return lilv_ui_get_value_internal(ui, ui->world->uris.lv2_optionalFeature);
+}
+
+LILV_API
+const LilvNodes*
+lilv_ui_get_extension_data(const LilvUI* ui)
+{
+ assert(ui);
+ assert(ui->world);
+ return lilv_ui_get_value_internal(ui, ui->world->uris.lv2_extensionData);
+}

+ 19
- 0
source/libs/lilv/lilv-0.16.0/lilv/lilv.h View File

@@ -1768,6 +1768,25 @@ LILV_API
const LilvNode* const LilvNode*
lilv_ui_get_binary_uri(const LilvUI* ui); lilv_ui_get_binary_uri(const LilvUI* ui);


/**
Custom calls
*/
LILV_API
const LilvNodes*
lilv_ui_get_supported_features(const LilvUI* ui);

LILV_API
const LilvNodes*
lilv_ui_get_required_features(const LilvUI* ui);

LILV_API
const LilvNodes*
lilv_ui_get_optional_features(const LilvUI* ui);

LILV_API
const LilvNodes*
lilv_ui_get_extension_data(const LilvUI* ui);

/** /**
@} @}
@} @}


+ 20
- 0
source/libs/lilv/lilv-0.16.0/lilv/lilvmm.hpp View File

@@ -169,6 +169,26 @@ struct Port {
const LilvPort* me; const LilvPort* me;
}; };


struct UI {
inline UI(const LilvUI* c_obj) : me(c_obj) {}
LILV_WRAP_CONVERSION(const LilvUI);

LILV_WRAP0(Node, ui, get_uri);
LILV_WRAP1(bool, ui, is_a, LilvNode*, ui_class);
LILV_WRAP0(Node, ui, get_bundle_uri);
LILV_WRAP0(Node, ui, get_binary_uri);
LILV_WRAP0(Nodes, ui, get_supported_features);
LILV_WRAP0(Nodes, ui, get_required_features);
LILV_WRAP0(Nodes, ui, get_optional_features);
LILV_WRAP0(Nodes, ui, get_extension_data);

const LilvUI* me;
};

struct UIs {
LILV_WRAP_COLL(UIs, UI, uis);
};

struct Plugin { struct Plugin {
inline Plugin(const LilvPlugin* c_obj) : me(c_obj) {} inline Plugin(const LilvPlugin* c_obj) : me(c_obj) {}
LILV_WRAP_CONVERSION(const LilvPlugin); LILV_WRAP_CONVERSION(const LilvPlugin);


+ 56
- 0
source/libs/lilv/lilv-0.16.0/src/ui.c View File

@@ -128,3 +128,59 @@ lilv_ui_get_binary_uri(const LilvUI* ui)
assert(ui->binary_uri); assert(ui->binary_uri);
return ui->binary_uri; return ui->binary_uri;
} }

static LilvNodes*
lilv_ui_get_value_internal(const LilvUI* ui,
const SordNode* predicate)
{
assert(ui);
return lilv_world_find_nodes_internal(ui->world, ui->uri->node, predicate, NULL);
}

LILV_API
const LilvNodes*
lilv_ui_get_supported_features(const LilvUI* ui)
{
assert(ui);
LilvNodes* optional = lilv_ui_get_optional_features(ui);
LilvNodes* required = lilv_ui_get_required_features(ui);
LilvNodes* result = lilv_nodes_new();

LILV_FOREACH(nodes, i, optional)
zix_tree_insert((ZixTree*)result, lilv_node_duplicate(lilv_nodes_get(optional, i)), NULL);

LILV_FOREACH(nodes, i, required)
zix_tree_insert((ZixTree*)result, lilv_node_duplicate(lilv_nodes_get(required, i)), NULL);

lilv_nodes_free(optional);
lilv_nodes_free(required);

return result;
}

LILV_API
const LilvNodes*
lilv_ui_get_required_features(const LilvUI* ui)
{
assert(ui);
assert(ui->world);
return lilv_ui_get_value_internal(ui, ui->world->uris.lv2_requiredFeature);
}

LILV_API
const LilvNodes*
lilv_ui_get_optional_features(const LilvUI* ui)
{
assert(ui);
assert(ui->world);
return lilv_ui_get_value_internal(ui, ui->world->uris.lv2_optionalFeature);
}

LILV_API
const LilvNodes*
lilv_ui_get_extension_data(const LilvUI* ui)
{
assert(ui);
assert(ui->world);
return lilv_ui_get_value_internal(ui, ui->world->uris.lv2_extensionData);
}

Loading…
Cancel
Save