From 3b745f0b5e37812ae2d2918ce2762b9e6c726b26 Mon Sep 17 00:00:00 2001 From: Daniel Silverstone Date: Sat, 24 Mar 2012 16:56:00 +0000 Subject: Documents and document types do not have text content svn path=/trunk/libdom/; revision=13602 --- src/core/document.c | 21 ++++++++++++++++++++- src/core/document.h | 44 ++++++++++++++++++++++++++++++++++++++++++++ src/core/document_type.c | 21 ++++++++++++++++++++- src/core/document_type.h | 44 ++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 128 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/core/document.c b/src/core/document.c index df5fffa..3f7ce77 100644 --- a/src/core/document.c +++ b/src/core/document.c @@ -47,7 +47,7 @@ static struct dom_document_vtable document_vtable = { { DOM_NODE_EVENT_TARGET_VTABLE }, - DOM_NODE_VTABLE + DOM_NODE_VTABLE_DOCUMENT }, DOM_DOCUMENT_VTABLE }; @@ -1043,6 +1043,25 @@ dom_exception _dom_document_rename_node(dom_document *doc, return DOM_NOT_SUPPORTED_ERR; } +dom_exception _dom_document_get_text_content(dom_node_internal *node, + dom_string **result) +{ + UNUSED(node); + + *result = NULL; + + return DOM_NO_ERR; +} + +dom_exception _dom_document_set_text_content(dom_node_internal *node, + dom_string *content) +{ + UNUSED(node); + UNUSED(content); + + return DOM_NO_ERR; +} + /*-----------------------------------------------------------------------*/ /* Overload protected virtual functions */ diff --git a/src/core/document.h b/src/core/document.h index 002b0ca..4f9990c 100644 --- a/src/core/document.h +++ b/src/core/document.h @@ -138,6 +138,11 @@ dom_exception _dom_document_rename_node(dom_document *doc, dom_string *namespace, dom_string *qname, dom_node **result); +dom_exception _dom_document_get_text_content(dom_node_internal *node, + dom_string **result); +dom_exception _dom_document_set_text_content(dom_node_internal *node, + dom_string *content); + #define DOM_DOCUMENT_VTABLE \ _dom_document_get_doctype, \ _dom_document_get_implementation, \ @@ -172,6 +177,45 @@ dom_exception _dom_document_rename_node(dom_document *doc, _dom_document_rename_node /* End of vtable */ +#define DOM_NODE_VTABLE_DOCUMENT \ + _dom_node_get_node_name, \ + _dom_node_get_node_value, \ + _dom_node_set_node_value, \ + _dom_node_get_node_type, \ + _dom_node_get_parent_node, \ + _dom_node_get_child_nodes, \ + _dom_node_get_first_child, \ + _dom_node_get_last_child, \ + _dom_node_get_previous_sibling, \ + _dom_node_get_next_sibling, \ + _dom_node_get_attributes, \ + _dom_node_get_owner_document, \ + _dom_node_insert_before, \ + _dom_node_replace_child, \ + _dom_node_remove_child, \ + _dom_node_append_child, \ + _dom_node_has_child_nodes, \ + _dom_node_clone_node, \ + _dom_node_normalize, \ + _dom_node_is_supported, \ + _dom_node_get_namespace, \ + _dom_node_get_prefix, \ + _dom_node_set_prefix, \ + _dom_node_get_local_name, \ + _dom_node_has_attributes, \ + _dom_node_get_base, \ + _dom_node_compare_document_position, \ + _dom_document_get_text_content, \ + _dom_document_set_text_content, \ + _dom_node_is_same, \ + _dom_node_lookup_prefix, \ + _dom_node_is_default_namespace, \ + _dom_node_lookup_namespace, \ + _dom_node_is_equal, \ + _dom_node_get_feature, \ + _dom_node_set_user_data, \ + _dom_node_get_user_data + /** \todo Unused! */ /** * The internal used vtable for document diff --git a/src/core/document_type.c b/src/core/document_type.c index 89a94f4..a01abce 100644 --- a/src/core/document_type.c +++ b/src/core/document_type.c @@ -32,7 +32,7 @@ static struct dom_document_type_vtable document_type_vtable = { { DOM_NODE_EVENT_TARGET_VTABLE }, - DOM_NODE_VTABLE + DOM_NODE_VTABLE_DOCUMENT_TYPE }, DOM_DOCUMENT_TYPE_VTABLE }; @@ -305,6 +305,25 @@ dom_exception _dom_document_type_get_internal_subset( return DOM_NOT_SUPPORTED_ERR; } +dom_exception _dom_document_type_get_text_content(dom_node_internal *node, + dom_string **result) +{ + UNUSED(node); + + *result = NULL; + + return DOM_NO_ERR; +} + +dom_exception _dom_document_type_set_text_content(dom_node_internal *node, + dom_string *content) +{ + UNUSED(node); + UNUSED(content); + + return DOM_NO_ERR; +} + /*-----------------------------------------------------------------------*/ /* Overload protected virtual functions */ diff --git a/src/core/document_type.h b/src/core/document_type.h index e9b1dd5..bccc469 100644 --- a/src/core/document_type.h +++ b/src/core/document_type.h @@ -43,6 +43,11 @@ dom_exception _dom_document_type_get_internal_subset( dom_document_type *doc_type, dom_string **result); +dom_exception _dom_document_type_get_text_content(dom_node_internal *node, + dom_string **result); +dom_exception _dom_document_type_set_text_content(dom_node_internal *node, + dom_string *content); + #define DOM_DOCUMENT_TYPE_VTABLE \ _dom_document_type_get_name, \ _dom_document_type_get_entities, \ @@ -51,6 +56,45 @@ dom_exception _dom_document_type_get_internal_subset( _dom_document_type_get_system_id, \ _dom_document_type_get_internal_subset +#define DOM_NODE_VTABLE_DOCUMENT_TYPE \ + _dom_node_get_node_name, \ + _dom_node_get_node_value, \ + _dom_node_set_node_value, \ + _dom_node_get_node_type, \ + _dom_node_get_parent_node, \ + _dom_node_get_child_nodes, \ + _dom_node_get_first_child, \ + _dom_node_get_last_child, \ + _dom_node_get_previous_sibling, \ + _dom_node_get_next_sibling, \ + _dom_node_get_attributes, \ + _dom_node_get_owner_document, \ + _dom_node_insert_before, \ + _dom_node_replace_child, \ + _dom_node_remove_child, \ + _dom_node_append_child, \ + _dom_node_has_child_nodes, \ + _dom_node_clone_node, \ + _dom_node_normalize, \ + _dom_node_is_supported, \ + _dom_node_get_namespace, \ + _dom_node_get_prefix, \ + _dom_node_set_prefix, \ + _dom_node_get_local_name, \ + _dom_node_has_attributes, \ + _dom_node_get_base, \ + _dom_node_compare_document_position, \ + _dom_document_type_get_text_content, \ + _dom_document_type_set_text_content, \ + _dom_node_is_same, \ + _dom_node_lookup_prefix, \ + _dom_node_is_default_namespace, \ + _dom_node_lookup_namespace, \ + _dom_node_is_equal, \ + _dom_node_get_feature, \ + _dom_node_set_user_data, \ + _dom_node_get_user_data + /* Following comes the protected vtable */ void _dom_dt_destroy(dom_node_internal *node); dom_exception _dom_dt_copy(dom_node_internal *old, dom_node_internal **copy); -- cgit v1.2.3