From 427ce60a0cf055347b2fd7ac4a37bec59d65c3ac Mon Sep 17 00:00:00 2001 From: John Mark Bell Date: Mon, 7 Apr 2008 02:04:05 +0000 Subject: Implement "in body" insertion mode. Modify treebuilder test driver to bring it in line with API changes. A few minimal bits of testdata for various bits of in body. Proper testing will come once we're actually building a tree. svn path=/trunk/hubbub/; revision=4076 --- include/hubbub/functypes.h | 35 +++++++++++++++++++++++++++++------ include/hubbub/tree.h | 6 +++++- 2 files changed, 34 insertions(+), 7 deletions(-) (limited to 'include') diff --git a/include/hubbub/functypes.h b/include/hubbub/functypes.h index ddc307a..80c8388 100644 --- a/include/hubbub/functypes.h +++ b/include/hubbub/functypes.h @@ -9,6 +9,7 @@ #define hubbub_functypes_h_ #include +#include #include #include @@ -52,12 +53,6 @@ typedef int (*hubbub_tree_create_doctype)(void *ctx, const hubbub_string *qname, typedef int (*hubbub_tree_create_element)(void *ctx, const hubbub_tag *tag, void **result); -/** - * Type of tree element node creation function (verbatim name) - */ -typedef int (*hubbub_tree_create_element_verbatim)(void *ctx, - const uint8_t *name, size_t name_len, void **result); - /** * Type of tree text node creation function */ @@ -98,6 +93,34 @@ typedef int (*hubbub_tree_remove_child)(void *ctx, void *parent, void *child, typedef int (*hubbub_tree_clone_node)(void *ctx, void *node, bool deep, void **result); +/** + * Type of child reparenting function + */ +typedef int (*hubbub_tree_reparent_children)(void *ctx, void *node, + void *new_parent); + +/** + * Type of parent node acquisition function + */ +typedef int (*hubbub_tree_get_parent)(void *ctx, void *node, bool element_only, + void **result); + +/** + * Type of child presence query function + */ +typedef int (*hubbub_tree_has_children)(void *ctx, void *node, bool *result); + +/** + * Type of form association function + */ +typedef int (*hubbub_tree_form_associate)(void *ctx, void *form, void *node); + +/** + * Type of attribute addition function + */ +typedef int (*hubbub_tree_add_attributes)(void *ctx, void *node, + const hubbub_attribute *attributes, uint32_t n_attributes); + /** * Type of tree quirks mode notification function */ diff --git a/include/hubbub/tree.h b/include/hubbub/tree.h index cc66acf..7e2e11f 100644 --- a/include/hubbub/tree.h +++ b/include/hubbub/tree.h @@ -17,7 +17,6 @@ typedef struct hubbub_tree_handler { hubbub_tree_create_comment create_comment; hubbub_tree_create_doctype create_doctype; hubbub_tree_create_element create_element; - hubbub_tree_create_element_verbatim create_element_verbatim; hubbub_tree_create_text create_text; hubbub_tree_ref_node ref_node; hubbub_tree_unref_node unref_node; @@ -25,6 +24,11 @@ typedef struct hubbub_tree_handler { hubbub_tree_insert_before insert_before; hubbub_tree_remove_child remove_child; hubbub_tree_clone_node clone_node; + hubbub_tree_reparent_children reparent_children; + hubbub_tree_get_parent get_parent; + hubbub_tree_has_children has_children; + hubbub_tree_form_associate form_associate; + hubbub_tree_add_attributes add_attributes; hubbub_tree_set_quirks_mode set_quirks_mode; void *ctx; } hubbub_tree_handler; -- cgit v1.2.3