From 001e73fb3a2f83649c9c531c57f28e8bd1140d86 Mon Sep 17 00:00:00 2001 From: falkTX Date: Fri, 29 Mar 2013 06:49:15 +0000 Subject: [PATCH] Update lilv UI patch --- .../lilv_ui-features+lilvmm.patch | 137 ------------------ .../custom-patches/lilv_ui-features.patch | 125 ++++++++++++++++ source/libs/lilv/lilv-0.16.0/lilv/lilv.h | 19 +++ source/libs/lilv/lilv-0.16.0/lilv/lilvmm.hpp | 20 +++ source/libs/lilv/lilv-0.16.0/src/ui.c | 56 +++++++ 5 files changed, 220 insertions(+), 137 deletions(-) delete mode 100644 source/libs/lilv/custom-patches/lilv_ui-features+lilvmm.patch create mode 100644 source/libs/lilv/custom-patches/lilv_ui-features.patch diff --git a/source/libs/lilv/custom-patches/lilv_ui-features+lilvmm.patch b/source/libs/lilv/custom-patches/lilv_ui-features+lilvmm.patch deleted file mode 100644 index 9ec36a5e0..000000000 --- a/source/libs/lilv/custom-patches/lilv_ui-features+lilvmm.patch +++ /dev/null @@ -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); -+} diff --git a/source/libs/lilv/custom-patches/lilv_ui-features.patch b/source/libs/lilv/custom-patches/lilv_ui-features.patch new file mode 100644 index 000000000..b2f63b904 --- /dev/null +++ b/source/libs/lilv/custom-patches/lilv_ui-features.patch @@ -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); ++} 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 ff1839f92..c7803260e 100644 --- a/source/libs/lilv/lilv-0.16.0/lilv/lilv.h +++ b/source/libs/lilv/lilv-0.16.0/lilv/lilv.h @@ -1768,6 +1768,25 @@ LILV_API 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 4215ab85a..30479307d 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 5d2f06631..c2780e0a1 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); +}