From 4860bd14179e94a7d073714c1c5b21fd9c200dd7 Mon Sep 17 00:00:00 2001 From: John Mark Bell Date: Wed, 5 Jan 2011 00:44:04 +0000 Subject: Simultaneously select styles for base + pseudo elements. svn path=/trunk/libcss/; revision=11211 --- include/libcss/select.h | 35 ++++++++++++++++++++++++++++------- 1 file changed, 28 insertions(+), 7 deletions(-) (limited to 'include/libcss/select.h') diff --git a/include/libcss/select.h b/include/libcss/select.h index a5d6111..76c226b 100644 --- a/include/libcss/select.h +++ b/include/libcss/select.h @@ -19,14 +19,34 @@ extern "C" #include #include #include +#include -enum css_pseudo_element { +typedef enum css_pseudo_element { CSS_PSEUDO_ELEMENT_NONE = 0, CSS_PSEUDO_ELEMENT_FIRST_LINE = 1, CSS_PSEUDO_ELEMENT_FIRST_LETTER = 2, CSS_PSEUDO_ELEMENT_BEFORE = 3, - CSS_PSEUDO_ELEMENT_AFTER = 4 -}; + CSS_PSEUDO_ELEMENT_AFTER = 4, + + CSS_PSEUDO_ELEMENT_COUNT = 5 /**< Number of pseudo elements */ +} css_pseudo_element; + +/** + * Style selection result set + */ +typedef struct css_select_results { + css_allocator_fn alloc; + void *pw; + + /** + * Array of pointers to computed styles, + * indexed by css_pseudo_element. If there + * was no styling for a given pseudo element, + * then no computed style will be created and + * the corresponding pointer will be set to NULL + */ + css_computed_style *styles[]; +} css_select_results; typedef struct css_select_handler { css_error (*node_name)(void *pw, void *node, @@ -102,10 +122,11 @@ css_error css_select_ctx_get_sheet(css_select_ctx *ctx, uint32_t index, const css_stylesheet **sheet); css_error css_select_style(css_select_ctx *ctx, void *node, - uint32_t pseudo_element, uint64_t media, - const css_stylesheet *inline_style, - css_computed_style *result, - css_select_handler *handler, void *pw); + uint64_t media, const css_stylesheet *inline_style, + css_select_handler *handler, void *pw, + css_select_results **result); + +css_error css_select_results_destroy(css_select_results *results); #ifdef __cplusplus } -- cgit v1.2.3