summaryrefslogtreecommitdiff
path: root/include/libcss/select.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/libcss/select.h')
-rw-r--r--include/libcss/select.h35
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
}