diff options
Diffstat (limited to 'src/core/text.h')
-rw-r--r-- | src/core/text.h | 39 |
1 files changed, 19 insertions, 20 deletions
diff --git a/src/core/text.h b/src/core/text.h index c1d0956..1cc5b1e 100644 --- a/src/core/text.h +++ b/src/core/text.h @@ -11,17 +11,17 @@ #include <stdbool.h> #include <dom/core/exceptions.h> +#include <dom/core/text.h> #include "core/characterdata.h" struct dom_document; -struct lwc_string_s; /** * A DOM text node */ struct dom_text { - struct dom_characterdata base; /**< Base node */ + dom_characterdata base; /**< Base node */ bool element_content_whitespace; /**< This node is element * content whitespace */ @@ -29,27 +29,27 @@ struct dom_text { /* Constructor and Destructor */ dom_exception _dom_text_create(struct dom_document *doc, - struct lwc_string_s *name, dom_string *value, - struct dom_text **result); + dom_string *name, dom_string *value, + dom_text **result); -void _dom_text_destroy(struct dom_document *doc, struct dom_text *text); +void _dom_text_destroy(dom_text *text); -dom_exception _dom_text_initialise(struct dom_text *text, +dom_exception _dom_text_initialise(dom_text *text, struct dom_document *doc, dom_node_type type, - struct lwc_string_s *name, dom_string *value); + dom_string *name, dom_string *value); -void _dom_text_finalise(struct dom_document *doc, struct dom_text *text); +void _dom_text_finalise(dom_text *text); /* Virtual functions for dom_text */ -dom_exception _dom_text_split_text(struct dom_text *text, - unsigned long offset, struct dom_text **result); +dom_exception _dom_text_split_text(dom_text *text, + unsigned long offset, dom_text **result); dom_exception _dom_text_get_is_element_content_whitespace( - struct dom_text *text, bool *result); -dom_exception _dom_text_get_whole_text(struct dom_text *text, + dom_text *text, bool *result); +dom_exception _dom_text_get_whole_text(dom_text *text, dom_string **result); -dom_exception _dom_text_replace_whole_text(struct dom_text *text, - dom_string *content, struct dom_text **result); +dom_exception _dom_text_replace_whole_text(dom_text *text, + dom_string *content, dom_text **result); #define DOM_TEXT_VTABLE \ _dom_text_split_text, \ @@ -60,17 +60,16 @@ dom_exception _dom_text_replace_whole_text(struct dom_text *text, /* Following comes the protected vtable */ void __dom_text_destroy(struct dom_node_internal *node); -dom_exception _dom_text_alloc(struct dom_document *doc, - struct dom_node_internal *n, struct dom_node_internal **ret); -dom_exception _dom_text_copy(struct dom_node_internal *new, - struct dom_node_internal *old); +dom_exception _dom_text_copy(dom_node_internal *old, dom_node_internal **copy); #define DOM_TEXT_PROTECT_VTABLE \ __dom_text_destroy, \ - _dom_text_alloc, \ _dom_text_copy - extern struct dom_text_vtable text_vtable; +dom_exception _dom_text_copy_internal(dom_text *old, dom_text *new); +#define dom_text_copy_internal(o, n) \ + _dom_text_copy_internal((dom_text *) (o), (dom_text *) (n)) + #endif |