diff options
Diffstat (limited to 'src/pluginui.c')
-rw-r--r-- | src/pluginui.c | 33 |
1 files changed, 15 insertions, 18 deletions
diff --git a/src/pluginui.c b/src/pluginui.c index 5de3dcb..9835e41 100644 --- a/src/pluginui.c +++ b/src/pluginui.c @@ -38,16 +38,16 @@ slv2_ui_new(SLV2World world, struct _SLV2UI* ui = malloc(sizeof(struct _SLV2UI)); ui->world = world; - ui->uri = librdf_new_uri_from_uri(uri); - ui->binary_uri = librdf_new_uri_from_uri(binary_uri); + ui->uri = slv2_value_new_librdf_uri(world, uri); + ui->binary_uri = slv2_value_new_librdf_uri(world, binary_uri); assert(ui->binary_uri); // FIXME: kludge - char* bundle = strdup((const char*)librdf_uri_as_string(ui->binary_uri)); + char* bundle = strdup(slv2_value_as_string(ui->binary_uri)); char* last_slash = strrchr(bundle, '/') + 1; *last_slash = '\0'; - ui->bundle_uri = librdf_new_uri(world->world, (const unsigned char*)bundle); + ui->bundle_uri = slv2_value_new_uri(world, bundle); free(bundle); ui->classes = slv2_values_new(); @@ -61,13 +61,13 @@ slv2_ui_new(SLV2World world, void slv2_ui_free(SLV2UI ui) { - librdf_free_uri(ui->uri); + slv2_value_free(ui->uri); ui->uri = NULL; - librdf_free_uri(ui->bundle_uri); + slv2_value_free(ui->bundle_uri); ui->bundle_uri = NULL; - librdf_free_uri(ui->binary_uri); + slv2_value_free(ui->binary_uri); ui->binary_uri = NULL; slv2_values_free(ui->classes); @@ -76,12 +76,12 @@ slv2_ui_free(SLV2UI ui) } -const char* +SLV2Value slv2_ui_get_uri(SLV2UI ui) { assert(ui); assert(ui->uri); - return (const char*)librdf_uri_as_string(ui->uri); + return ui->uri; } @@ -93,29 +93,26 @@ slv2_ui_get_classes(SLV2UI ui) bool -slv2_ui_is_a(SLV2UI ui, const char* type_uri) +slv2_ui_is_a(SLV2UI ui, SLV2Value ui_class_uri) { - SLV2Value type = slv2_value_new(ui->world, SLV2_VALUE_URI, type_uri); - bool ret = slv2_values_contains(ui->classes, type); - slv2_value_free(type); - return ret; + return slv2_values_contains(ui->classes, ui_class_uri); } -const char* +SLV2Value slv2_ui_get_bundle_uri(SLV2UI ui) { assert(ui); assert(ui->bundle_uri); - return (const char*)librdf_uri_as_string(ui->bundle_uri); + return ui->bundle_uri; } -const char* +SLV2Value slv2_ui_get_binary_uri(SLV2UI ui) { assert(ui); assert(ui->binary_uri); - return (const char*)librdf_uri_as_string(ui->binary_uri); + return ui->binary_uri; } |