summaryrefslogtreecommitdiffstats
path: root/src/client
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2011-10-01 04:40:15 +0000
committerDavid Robillard <d@drobilla.net>2011-10-01 04:40:15 +0000
commit5757ab645cae1d844d6d457ab2dea4a12d21a4e7 (patch)
treea04498c8c006365d5d6f8ad7569dc7cbe4e878b8 /src/client
parentb60baed5cca3da9aeaba8bf4957cbf469a4b69c7 (diff)
downloadingen-5757ab645cae1d844d6d457ab2dea4a12d21a4e7.tar.gz
ingen-5757ab645cae1d844d6d457ab2dea4a12d21a4e7.tar.bz2
ingen-5757ab645cae1d844d6d457ab2dea4a12d21a4e7.zip
Support inline display of HTML LV2 documentation via WebKit.
git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@3515 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/client')
-rw-r--r--src/client/PluginModel.cpp28
1 files changed, 20 insertions, 8 deletions
diff --git a/src/client/PluginModel.cpp b/src/client/PluginModel.cpp
index 80b78887..1d13ee5b 100644
--- a/src/client/PluginModel.cpp
+++ b/src/client/PluginModel.cpp
@@ -28,6 +28,8 @@
#include "ingen/client/PluginModel.hpp"
#include "ingen/client/PluginUI.hpp"
+#include "ingen-config.h"
+
using namespace std;
using namespace Raul;
@@ -225,19 +227,27 @@ PluginModel::get_lv2_icon_path(const LilvPlugin* plugin)
}
std::string
-PluginModel::documentation() const
+PluginModel::documentation(bool* html) const
{
std::string doc;
- if (!_lilv_plugin)
+ if (!_lilv_plugin) {
return doc;
+ }
- //LilvNode lv2_documentation = lilv_new_uri(
- // _lilv_world, LILV_NAMESPACE_LV2 "documentation");
- LilvNode* rdfs_comment = lilv_new_uri(
- _lilv_world, "http://www.w3.org/2000/01/rdf-schema#comment");
+ LilvNode* lv2_documentation = lilv_new_uri(_lilv_world,
+ LILV_NS_LV2 "documentation");
+ LilvNode* rdfs_comment = lilv_new_uri(_lilv_world,
+ LILV_NS_RDFS "comment");
+
+ LilvNodes* vals = lilv_plugin_get_value(_lilv_plugin, lv2_documentation);
+ if (vals) {
+ *html = true;
+ doc += std::string("<h2>") + human_name() + "</h2>\n";
+ } else {
+ *html = false;
+ vals = lilv_plugin_get_value(_lilv_plugin, rdfs_comment);
+ }
- LilvNodes* vals = lilv_plugin_get_value(_lilv_plugin,
- rdfs_comment);
if (vals) {
const LilvNode* val = lilv_nodes_get_first(vals);
if (lilv_node_is_string(val)) {
@@ -245,6 +255,8 @@ PluginModel::documentation() const
}
}
lilv_node_free(rdfs_comment);
+ lilv_node_free(lv2_documentation);
+
lilv_nodes_free(vals);
return doc;