diff options
author | John Mark Bell <jmb@netsurf-browser.org> | 2011-01-05 00:44:04 +0000 |
---|---|---|
committer | John Mark Bell <jmb@netsurf-browser.org> | 2011-01-05 00:44:04 +0000 |
commit | 4860bd14179e94a7d073714c1c5b21fd9c200dd7 (patch) | |
tree | d6343a55826ee6d6ae3801c0453dcce12a0e987e /include/libcss | |
parent | e094fcbc9fcf39fb2d71cd521e8076f4703fa100 (diff) | |
download | libcss-4860bd14179e94a7d073714c1c5b21fd9c200dd7.tar.gz |
Simultaneously select styles for base + pseudo elements.
svn path=/trunk/libcss/; revision=11211
Diffstat (limited to 'include/libcss')
-rw-r--r-- | include/libcss/select.h | 35 |
1 files changed, 28 insertions, 7 deletions
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 <libcss/functypes.h> #include <libcss/hint.h> #include <libcss/types.h> +#include <libcss/computed.h> -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 } |