libcss
Loading...
Searching...
No Matches
select.h
Go to the documentation of this file.
1/*
2 * This file is part of LibCSS
3 * Licensed under the MIT License,
4 * http://www.opensource.org/licenses/mit-license.php
5 * Copyright 2009 John-Mark Bell <jmb@netsurf-browser.org>
6 */
7
8#ifndef libcss_select_h_
9#define libcss_select_h_
10
11#ifdef __cplusplus
12extern "C"
13{
14#endif
15
16#include <libcss/errors.h>
17#include <libcss/functypes.h>
18#include <libcss/hint.h>
19#include <libcss/types.h>
20#include <libcss/computed.h>
21#include <libcss/unit.h>
22
32
46
50
51typedef struct css_select_handler {
54
55 css_error (*node_name)(void *pw, void *node,
56 css_qname *qname);
57 css_error (*node_classes)(void *pw, void *node,
58 lwc_string ***classes,
59 uint32_t *n_classes);
60 css_error (*node_id)(void *pw, void *node,
61 lwc_string **id);
62
64 const css_qname *qname, void **ancestor);
65 css_error (*named_parent_node)(void *pw, void *node,
66 const css_qname *qname, void **parent);
67 css_error (*named_sibling_node)(void *pw, void *node,
68 const css_qname *qname, void **sibling);
70 const css_qname *qname, void **sibling);
71
72 css_error (*parent_node)(void *pw, void *node, void **parent);
73 css_error (*sibling_node)(void *pw, void *node, void **sibling);
74
75 css_error (*node_has_name)(void *pw, void *node,
76 const css_qname *qname, bool *match);
77 css_error (*node_has_class)(void *pw, void *node,
78 lwc_string *name, bool *match);
79 css_error (*node_has_id)(void *pw, void *node,
80 lwc_string *name, bool *match);
81 css_error (*node_has_attribute)(void *pw, void *node,
82 const css_qname *qname, bool *match);
84 const css_qname *qname, lwc_string *value,
85 bool *match);
87 const css_qname *qname, lwc_string *value,
88 bool *match);
90 const css_qname *qname, lwc_string *value,
91 bool *match);
93 const css_qname *qname, lwc_string *value,
94 bool *match);
96 const css_qname *qname, lwc_string *value,
97 bool *match);
99 const css_qname *qname, lwc_string *value,
100 bool *match);
101
102 css_error (*node_is_root)(void *pw, void *node, bool *match);
104 bool same_name, bool after, int32_t *count);
105 css_error (*node_is_empty)(void *pw, void *node, bool *match);
106
107 css_error (*node_is_link)(void *pw, void *node, bool *match);
108 css_error (*node_is_visited)(void *pw, void *node, bool *match);
109 css_error (*node_is_hover)(void *pw, void *node, bool *match);
110 css_error (*node_is_active)(void *pw, void *node, bool *match);
111 css_error (*node_is_focus)(void *pw, void *node, bool *match);
112
113 css_error (*node_is_enabled)(void *pw, void *node, bool *match);
114 css_error (*node_is_disabled)(void *pw, void *node, bool *match);
115 css_error (*node_is_checked)(void *pw, void *node, bool *match);
116
117 css_error (*node_is_target)(void *pw, void *node, bool *match);
118 css_error (*node_is_lang)(void *pw, void *node,
119 lwc_string *lang, bool *match);
120
122 uint32_t *nhints, css_hint **hints);
123
124 css_error (*ua_default_for_property)(void *pw, uint32_t property,
125 css_hint *hint);
126
140 void *libcss_node_data);
150 void **libcss_node_data);
152
163
170
199 css_node_data_action action, void *pw, void *node,
200 void *clone_node, void *libcss_node_data);
201
204
206 const css_stylesheet *sheet,
207 css_origin origin, const char *media);
209 const css_stylesheet *sheet, uint32_t index,
210 css_origin origin, const char *media);
212 const css_stylesheet *sheet);
213
216 const css_stylesheet **sheet);
217
219 css_select_handler *handler, void *pw,
220 css_computed_style **style);
222 const css_unit_ctx *unit_ctx,
223 const css_media *media, const css_stylesheet *inline_style,
224 css_select_handler *handler, void *pw,
225 css_select_results **result);
227
229 const css_media *media,
230 const css_unit_ctx *unit_ctx,
231 lwc_string *font_family,
235
236#ifdef __cplusplus
237}
238#endif
239
240#endif
css_error
Definition errors.h:18
css_error css_select_results_destroy(css_select_results *results)
Definition select.c:1535
css_error css_select_font_faces_results_destroy(css_select_font_faces_results *results)
Definition select.c:1671
css_error css_select_ctx_get_sheet(css_select_ctx *ctx, uint32_t index, const css_stylesheet **sheet)
Definition select.c:446
css_error css_select_style(css_select_ctx *ctx, void *node, const css_unit_ctx *unit_ctx, const css_media *media, const css_stylesheet *inline_style, css_select_handler *handler, void *pw, css_select_results **result)
Definition select.c:1255
css_error css_select_ctx_remove_sheet(css_select_ctx *ctx, const css_stylesheet *sheet)
Definition select.c:394
css_error css_select_ctx_destroy(css_select_ctx *ctx)
Definition select.c:276
css_error css_libcss_node_data_handler(css_select_handler *handler, css_node_data_action action, void *pw, void *node, void *clone_node, void *libcss_node_data)
Definition select.c:184
css_error css_select_font_faces(css_select_ctx *ctx, const css_media *media, const css_unit_ctx *unit_ctx, lwc_string *font_family, css_select_font_faces_results **result)
Definition select.c:1562
css_select_handler_version
Definition select.h:47
@ CSS_SELECT_HANDLER_VERSION_1
Definition select.h:48
css_error css_select_ctx_insert_sheet(css_select_ctx *ctx, const css_stylesheet *sheet, uint32_t index, css_origin origin, const char *media)
Definition select.c:330
css_error css_select_ctx_append_sheet(css_select_ctx *ctx, const css_stylesheet *sheet, css_origin origin, const char *media)
Definition select.c:309
css_node_data_action
Definition select.h:164
@ CSS_NODE_ANCESTORS_MODIFIED
Definition select.h:167
@ CSS_NODE_CLONED
Definition select.h:168
@ CSS_NODE_MODIFIED
Definition select.h:166
@ CSS_NODE_DELETED
Definition select.h:165
css_error css_select_default_style(css_select_ctx *ctx, css_select_handler *handler, void *pw, css_computed_style **style)
Definition select.c:507
css_pseudo_element
Definition select.h:23
@ CSS_PSEUDO_ELEMENT_AFTER
Definition select.h:28
@ CSS_PSEUDO_ELEMENT_COUNT
Definition select.h:30
@ CSS_PSEUDO_ELEMENT_BEFORE
Definition select.h:27
@ CSS_PSEUDO_ELEMENT_NONE
Definition select.h:24
@ CSS_PSEUDO_ELEMENT_FIRST_LINE
Definition select.h:25
@ CSS_PSEUDO_ELEMENT_FIRST_LETTER
Definition select.h:26
css_error css_select_ctx_count_sheets(css_select_ctx *ctx, uint32_t *count)
Definition select.c:428
css_error css_select_ctx_create(css_select_ctx **result)
Definition select.c:240
Definition autogenerated_computed.h:282
Definition font_face.h:26
Definition hint.h:34
Definition types.h:204
Definition types.h:246
Definition select.c:50
Definition select.h:156
css_font_face ** font_faces
Definition select.h:160
uint32_t n_font_faces
Definition select.h:161
Definition select.h:51
css_error(* ua_default_for_property)(void *pw, uint32_t property, css_hint *hint)
Definition select.h:124
css_error(* node_has_attribute_prefix)(void *pw, void *node, const css_qname *qname, lwc_string *value, bool *match)
Definition select.h:92
css_error(* named_parent_node)(void *pw, void *node, const css_qname *qname, void **parent)
Definition select.h:65
css_error(* node_name)(void *pw, void *node, css_qname *qname)
Definition select.h:55
css_error(* node_classes)(void *pw, void *node, lwc_string ***classes, uint32_t *n_classes)
Definition select.h:57
css_error(* node_count_siblings)(void *pw, void *node, bool same_name, bool after, int32_t *count)
Definition select.h:103
css_error(* node_is_hover)(void *pw, void *node, bool *match)
Definition select.h:109
css_error(* node_is_visited)(void *pw, void *node, bool *match)
Definition select.h:108
css_error(* node_is_link)(void *pw, void *node, bool *match)
Definition select.h:107
css_error(* sibling_node)(void *pw, void *node, void **sibling)
Definition select.h:73
css_error(* node_has_attribute_substring)(void *pw, void *node, const css_qname *qname, lwc_string *value, bool *match)
Definition select.h:98
css_error(* named_sibling_node)(void *pw, void *node, const css_qname *qname, void **sibling)
Definition select.h:67
css_error(* node_is_lang)(void *pw, void *node, lwc_string *lang, bool *match)
Definition select.h:118
css_error(* node_is_focus)(void *pw, void *node, bool *match)
Definition select.h:111
uint32_t handler_version
Definition select.h:53
css_error(* get_libcss_node_data)(void *pw, void *node, void **libcss_node_data)
Definition select.h:149
css_error(* node_is_target)(void *pw, void *node, bool *match)
Definition select.h:117
css_error(* named_ancestor_node)(void *pw, void *node, const css_qname *qname, void **ancestor)
Definition select.h:63
css_error(* node_has_attribute)(void *pw, void *node, const css_qname *qname, bool *match)
Definition select.h:81
css_error(* node_has_attribute_suffix)(void *pw, void *node, const css_qname *qname, lwc_string *value, bool *match)
Definition select.h:95
css_error(* parent_node)(void *pw, void *node, void **parent)
Definition select.h:72
css_error(* node_has_class)(void *pw, void *node, lwc_string *name, bool *match)
Definition select.h:77
css_error(* node_is_disabled)(void *pw, void *node, bool *match)
Definition select.h:114
css_error(* set_libcss_node_data)(void *pw, void *node, void *libcss_node_data)
Definition select.h:139
css_error(* node_is_empty)(void *pw, void *node, bool *match)
Definition select.h:105
css_error(* node_is_root)(void *pw, void *node, bool *match)
Definition select.h:102
css_error(* node_is_active)(void *pw, void *node, bool *match)
Definition select.h:110
css_error(* node_has_attribute_dashmatch)(void *pw, void *node, const css_qname *qname, lwc_string *value, bool *match)
Definition select.h:86
css_error(* named_generic_sibling_node)(void *pw, void *node, const css_qname *qname, void **sibling)
Definition select.h:69
css_error(* node_is_checked)(void *pw, void *node, bool *match)
Definition select.h:115
css_error(* node_has_id)(void *pw, void *node, lwc_string *name, bool *match)
Definition select.h:79
css_error(* node_presentational_hint)(void *pw, void *node, uint32_t *nhints, css_hint **hints)
Definition select.h:121
css_error(* node_is_enabled)(void *pw, void *node, bool *match)
Definition select.h:113
css_error(* node_has_name)(void *pw, void *node, const css_qname *qname, bool *match)
Definition select.h:75
css_error(* node_has_attribute_equal)(void *pw, void *node, const css_qname *qname, lwc_string *value, bool *match)
Definition select.h:83
css_error(* node_id)(void *pw, void *node, lwc_string **id)
Definition select.h:60
css_error(* node_has_attribute_includes)(void *pw, void *node, const css_qname *qname, lwc_string *value, bool *match)
Definition select.h:89
Definition select.h:36
css_computed_style * styles[CSS_PSEUDO_ELEMENT_COUNT]
Definition select.h:44
Definition stylesheet.h:170
Definition unit.h:39
Definition select.c:23
css_origin
Definition types.h:72