From bcb95bf5fa2c5cfd2e7c80f211f7fd6db6ce2f9a Mon Sep 17 00:00:00 2001 From: John Mark Bell Date: Sat, 12 Mar 2011 17:16:31 +0000 Subject: CSS3 Namespaces svn path=/trunk/libcss/; revision=11972 --- include/libcss/select.h | 28 +++++++++++++--------------- include/libcss/types.h | 21 +++++++++++++++++++++ 2 files changed, 34 insertions(+), 15 deletions(-) (limited to 'include') diff --git a/include/libcss/select.h b/include/libcss/select.h index b912fa3..bdc16ac 100644 --- a/include/libcss/select.h +++ b/include/libcss/select.h @@ -13,8 +13,6 @@ extern "C" { #endif -#include - #include #include #include @@ -50,7 +48,7 @@ typedef struct css_select_results { typedef struct css_select_handler { css_error (*node_name)(void *pw, void *node, - lwc_string **name); + css_qname *qname); css_error (*node_classes)(void *pw, void *node, lwc_string ***classes, uint32_t *n_classes); @@ -58,42 +56,42 @@ typedef struct css_select_handler { lwc_string **id); css_error (*named_ancestor_node)(void *pw, void *node, - lwc_string *name, void **ancestor); + const css_qname *qname, void **ancestor); css_error (*named_parent_node)(void *pw, void *node, - lwc_string *name, void **parent); + const css_qname *qname, void **parent); css_error (*named_sibling_node)(void *pw, void *node, - lwc_string *name, void **sibling); + const css_qname *qname, void **sibling); css_error (*named_generic_sibling_node)(void *pw, void *node, - lwc_string *name, void **sibling); + const css_qname *qname, void **sibling); css_error (*parent_node)(void *pw, void *node, void **parent); css_error (*sibling_node)(void *pw, void *node, void **sibling); css_error (*node_has_name)(void *pw, void *node, - lwc_string *name, bool *match); + const css_qname *qname, bool *match); css_error (*node_has_class)(void *pw, void *node, lwc_string *name, bool *match); css_error (*node_has_id)(void *pw, void *node, lwc_string *name, bool *match); css_error (*node_has_attribute)(void *pw, void *node, - lwc_string *name, bool *match); + const css_qname *qname, bool *match); css_error (*node_has_attribute_equal)(void *pw, void *node, - lwc_string *name, lwc_string *value, + const css_qname *qname, lwc_string *value, bool *match); css_error (*node_has_attribute_dashmatch)(void *pw, void *node, - lwc_string *name, lwc_string *value, + const css_qname *qname, lwc_string *value, bool *match); css_error (*node_has_attribute_includes)(void *pw, void *node, - lwc_string *name, lwc_string *value, + const css_qname *qname, lwc_string *value, bool *match); css_error (*node_has_attribute_prefix)(void *pw, void *node, - lwc_string *name, lwc_string *value, + const css_qname *qname, lwc_string *value, bool *match); css_error (*node_has_attribute_suffix)(void *pw, void *node, - lwc_string *name, lwc_string *value, + const css_qname *qname, lwc_string *value, bool *match); css_error (*node_has_attribute_substring)(void *pw, void *node, - lwc_string *name, lwc_string *value, + const css_qname *qname, lwc_string *value, bool *match); css_error (*node_is_root)(void *pw, void *node, bool *match); diff --git a/include/libcss/types.h b/include/libcss/types.h index 8bc65a9..c8b9cf9 100644 --- a/include/libcss/types.h +++ b/include/libcss/types.h @@ -17,6 +17,8 @@ extern "C" #include #include +#include + #include /** @@ -100,6 +102,25 @@ typedef enum css_unit { CSS_UNIT_KHZ = 0xf } css_unit; +/** + * Type of a qualified name + */ +typedef struct css_qname { + /** + * Namespace URI: + * + * NULL for no namespace + * '*' for any namespace (including none) + * URI for a specific namespace + */ + lwc_string *ns; + + /** + * Local part of qualified name + */ + lwc_string *name; +} css_qname; + typedef struct css_stylesheet css_stylesheet; typedef struct css_select_ctx css_select_ctx; -- cgit v1.2.3