Details | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
3584 | sourcerer | 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 |
||
6 | */ |
||
7 | |||
8 | #ifndef libcss_computed_h_ |
||
9 | #define libcss_computed_h_ |
||
10 | |||
11 | #ifdef __cplusplus |
||
12 | extern "C" |
||
13 | { |
||
14 | #endif |
||
15 | |||
16 | #include |
||
17 | |||
18 | #include |
||
19 | #include |
||
20 | #include |
||
21 | #include |
||
22 | |||
23 | struct css_hint; |
||
24 | struct css_select_handler; |
||
25 | |||
26 | typedef struct css_computed_counter { |
||
27 | lwc_string *name; |
||
28 | css_fixed value; |
||
29 | } css_computed_counter; |
||
30 | |||
31 | typedef struct css_computed_clip_rect { |
||
32 | css_fixed top; |
||
33 | css_fixed right; |
||
34 | css_fixed bottom; |
||
35 | css_fixed left; |
||
36 | |||
37 | css_unit tunit; |
||
38 | css_unit runit; |
||
39 | css_unit bunit; |
||
40 | css_unit lunit; |
||
41 | |||
42 | bool top_auto; |
||
43 | bool right_auto; |
||
44 | bool bottom_auto; |
||
45 | bool left_auto; |
||
46 | } css_computed_clip_rect; |
||
47 | |||
48 | enum css_computed_content_type { |
||
49 | CSS_COMPUTED_CONTENT_NONE = 0, |
||
50 | CSS_COMPUTED_CONTENT_STRING = 1, |
||
51 | CSS_COMPUTED_CONTENT_URI = 2, |
||
52 | CSS_COMPUTED_CONTENT_COUNTER = 3, |
||
53 | CSS_COMPUTED_CONTENT_COUNTERS = 4, |
||
54 | CSS_COMPUTED_CONTENT_ATTR = 5, |
||
55 | CSS_COMPUTED_CONTENT_OPEN_QUOTE = 6, |
||
56 | CSS_COMPUTED_CONTENT_CLOSE_QUOTE = 7, |
||
57 | CSS_COMPUTED_CONTENT_NO_OPEN_QUOTE = 8, |
||
58 | CSS_COMPUTED_CONTENT_NO_CLOSE_QUOTE = 9 |
||
59 | }; |
||
60 | |||
61 | typedef struct css_computed_content_item { |
||
62 | uint8_t type; |
||
63 | union { |
||
64 | lwc_string *string; |
||
65 | lwc_string *uri; |
||
66 | lwc_string *attr; |
||
67 | struct { |
||
68 | lwc_string *name; |
||
69 | uint8_t style; |
||
70 | } counter; |
||
71 | struct { |
||
72 | lwc_string *name; |
||
73 | lwc_string *sep; |
||
74 | uint8_t style; |
||
75 | } counters; |
||
76 | } data; |
||
77 | } css_computed_content_item; |
||
78 | |||
79 | css_error css_computed_style_create(css_allocator_fn alloc, void *pw, |
||
80 | css_computed_style **result); |
||
81 | css_error css_computed_style_destroy(css_computed_style *style); |
||
82 | |||
83 | css_error css_computed_style_initialise(css_computed_style *style, |
||
84 | struct css_select_handler *handler, void *pw); |
||
85 | |||
86 | css_error css_computed_style_compose(const css_computed_style *parent, |
||
87 | const css_computed_style *child, |
||
88 | css_error (*compute_font_size)(void *pw, |
||
89 | const struct css_hint *parent, |
||
90 | struct css_hint *size), |
||
91 | void *pw, |
||
92 | css_computed_style *result); |
||
93 | |||
94 | /****************************************************************************** |
||
95 | * Property accessors below here * |
||
96 | ******************************************************************************/ |
||
97 | |||
98 | uint8_t css_computed_letter_spacing( |
||
99 | const css_computed_style *style, |
||
100 | css_fixed *length, css_unit *unit); |
||
101 | |||
102 | uint8_t css_computed_outline_color( |
||
103 | const css_computed_style *style, css_color *color); |
||
104 | |||
105 | uint8_t css_computed_outline_width( |
||
106 | const css_computed_style *style, |
||
107 | css_fixed *length, css_unit *unit); |
||
108 | |||
109 | uint8_t css_computed_border_spacing( |
||
110 | const css_computed_style *style, |
||
111 | css_fixed *hlength, css_unit *hunit, |
||
112 | css_fixed *vlength, css_unit *vunit); |
||
113 | |||
114 | uint8_t css_computed_word_spacing( |
||
115 | const css_computed_style *style, |
||
116 | css_fixed *length, css_unit *unit); |
||
117 | |||
118 | uint8_t css_computed_counter_increment( |
||
119 | const css_computed_style *style, |
||
120 | const css_computed_counter **counters); |
||
121 | |||
122 | uint8_t css_computed_counter_reset( |
||
123 | const css_computed_style *style, |
||
124 | const css_computed_counter **counters); |
||
125 | |||
126 | uint8_t css_computed_cursor( |
||
127 | const css_computed_style *style, |
||
128 | lwc_string ***urls); |
||
129 | |||
130 | uint8_t css_computed_clip( |
||
131 | const css_computed_style *style, |
||
132 | css_computed_clip_rect *rect); |
||
133 | |||
134 | uint8_t css_computed_content( |
||
135 | const css_computed_style *style, |
||
136 | const css_computed_content_item **content); |
||
137 | |||
138 | uint8_t css_computed_vertical_align( |
||
139 | const css_computed_style *style, |
||
140 | css_fixed *length, css_unit *unit); |
||
141 | |||
142 | uint8_t css_computed_font_size( |
||
143 | const css_computed_style *style, |
||
144 | css_fixed *length, css_unit *unit); |
||
145 | |||
146 | uint8_t css_computed_border_top_width( |
||
147 | const css_computed_style *style, |
||
148 | css_fixed *length, css_unit *unit); |
||
149 | |||
150 | uint8_t css_computed_border_right_width( |
||
151 | const css_computed_style *style, |
||
152 | css_fixed *length, css_unit *unit); |
||
153 | |||
154 | uint8_t css_computed_border_bottom_width( |
||
155 | const css_computed_style *style, |
||
156 | css_fixed *length, css_unit *unit); |
||
157 | |||
158 | uint8_t css_computed_border_left_width( |
||
159 | const css_computed_style *style, |
||
160 | css_fixed *length, css_unit *unit); |
||
161 | |||
162 | uint8_t css_computed_background_image( |
||
163 | const css_computed_style *style, |
||
164 | lwc_string **url); |
||
165 | |||
166 | uint8_t css_computed_color( |
||
167 | const css_computed_style *style, |
||
168 | css_color *color); |
||
169 | |||
170 | uint8_t css_computed_list_style_image( |
||
171 | const css_computed_style *style, |
||
172 | lwc_string **url); |
||
173 | |||
174 | uint8_t css_computed_quotes( |
||
175 | const css_computed_style *style, |
||
176 | lwc_string ***quotes); |
||
177 | |||
178 | uint8_t css_computed_top( |
||
179 | const css_computed_style *style, |
||
180 | css_fixed *length, css_unit *unit); |
||
181 | |||
182 | uint8_t css_computed_right( |
||
183 | const css_computed_style *style, |
||
184 | css_fixed *length, css_unit *unit); |
||
185 | |||
186 | uint8_t css_computed_bottom( |
||
187 | const css_computed_style *style, |
||
188 | css_fixed *length, css_unit *unit); |
||
189 | |||
190 | uint8_t css_computed_left( |
||
191 | const css_computed_style *style, |
||
192 | css_fixed *length, css_unit *unit); |
||
193 | |||
194 | uint8_t css_computed_border_top_color( |
||
195 | const css_computed_style *style, |
||
196 | css_color *color); |
||
197 | |||
198 | uint8_t css_computed_border_right_color( |
||
199 | const css_computed_style *style, |
||
200 | css_color *color); |
||
201 | |||
202 | uint8_t css_computed_border_bottom_color( |
||
203 | const css_computed_style *style, |
||
204 | css_color *color); |
||
205 | |||
206 | uint8_t css_computed_border_left_color( |
||
207 | const css_computed_style *style, |
||
208 | css_color *color); |
||
209 | |||
210 | uint8_t css_computed_height( |
||
211 | const css_computed_style *style, |
||
212 | css_fixed *length, css_unit *unit); |
||
213 | |||
214 | uint8_t css_computed_line_height( |
||
215 | const css_computed_style *style, |
||
216 | css_fixed *length, css_unit *unit); |
||
217 | |||
218 | uint8_t css_computed_background_color( |
||
219 | const css_computed_style *style, |
||
220 | css_color *color); |
||
221 | |||
222 | uint8_t css_computed_z_index( |
||
223 | const css_computed_style *style, |
||
224 | int32_t *z_index); |
||
225 | |||
226 | uint8_t css_computed_margin_top( |
||
227 | const css_computed_style *style, |
||
228 | css_fixed *length, css_unit *unit); |
||
229 | |||
230 | uint8_t css_computed_margin_right( |
||
231 | const css_computed_style *style, |
||
232 | css_fixed *length, css_unit *unit); |
||
233 | |||
234 | uint8_t css_computed_margin_bottom( |
||
235 | const css_computed_style *style, |
||
236 | css_fixed *length, css_unit *unit); |
||
237 | |||
238 | uint8_t css_computed_margin_left( |
||
239 | const css_computed_style *style, |
||
240 | css_fixed *length, css_unit *unit); |
||
241 | |||
242 | uint8_t css_computed_background_attachment( |
||
243 | const css_computed_style *style); |
||
244 | |||
245 | uint8_t css_computed_border_collapse( |
||
246 | const css_computed_style *style); |
||
247 | |||
248 | uint8_t css_computed_caption_side( |
||
249 | const css_computed_style *style); |
||
250 | |||
251 | uint8_t css_computed_direction( |
||
252 | const css_computed_style *style); |
||
253 | |||
254 | uint8_t css_computed_max_height( |
||
255 | const css_computed_style *style, |
||
256 | css_fixed *length, css_unit *unit); |
||
257 | |||
258 | uint8_t css_computed_max_width( |
||
259 | const css_computed_style *style, |
||
260 | css_fixed *length, css_unit *unit); |
||
261 | |||
262 | uint8_t css_computed_width( |
||
263 | const css_computed_style *style, |
||
264 | css_fixed *length, css_unit *unit); |
||
265 | |||
266 | uint8_t css_computed_empty_cells( |
||
267 | const css_computed_style *style); |
||
268 | |||
269 | uint8_t css_computed_float( |
||
270 | const css_computed_style *style); |
||
271 | |||
272 | uint8_t css_computed_font_style( |
||
273 | const css_computed_style *style); |
||
274 | |||
275 | uint8_t css_computed_min_height( |
||
276 | const css_computed_style *style, |
||
277 | css_fixed *length, css_unit *unit); |
||
278 | |||
279 | uint8_t css_computed_min_width( |
||
280 | const css_computed_style *style, |
||
281 | css_fixed *length, css_unit *unit); |
||
282 | |||
283 | uint8_t css_computed_background_repeat( |
||
284 | const css_computed_style *style); |
||
285 | |||
286 | uint8_t css_computed_clear( |
||
287 | const css_computed_style *style); |
||
288 | |||
289 | uint8_t css_computed_padding_top( |
||
290 | const css_computed_style *style, |
||
291 | css_fixed *length, css_unit *unit); |
||
292 | |||
293 | uint8_t css_computed_padding_right( |
||
294 | const css_computed_style *style, |
||
295 | css_fixed *length, css_unit *unit); |
||
296 | |||
297 | uint8_t css_computed_padding_bottom( |
||
298 | const css_computed_style *style, |
||
299 | css_fixed *length, css_unit *unit); |
||
300 | |||
301 | uint8_t css_computed_padding_left( |
||
302 | const css_computed_style *style, |
||
303 | css_fixed *length, css_unit *unit); |
||
304 | |||
305 | uint8_t css_computed_overflow( |
||
306 | const css_computed_style *style); |
||
307 | |||
308 | uint8_t css_computed_position( |
||
309 | const css_computed_style *style); |
||
310 | |||
311 | uint8_t css_computed_opacity( |
||
312 | const css_computed_style *style, |
||
313 | css_fixed *opacity); |
||
314 | |||
315 | uint8_t css_computed_text_transform( |
||
316 | const css_computed_style *style); |
||
317 | |||
318 | uint8_t css_computed_text_indent( |
||
319 | const css_computed_style *style, |
||
320 | css_fixed *length, css_unit *unit); |
||
321 | |||
322 | uint8_t css_computed_white_space( |
||
323 | const css_computed_style *style); |
||
324 | |||
325 | uint8_t css_computed_background_position( |
||
326 | const css_computed_style *style, |
||
327 | css_fixed *hlength, css_unit *hunit, |
||
328 | css_fixed *vlength, css_unit *vunit); |
||
329 | |||
330 | uint8_t css_computed_display( |
||
331 | const css_computed_style *style, bool root); |
||
332 | |||
333 | uint8_t css_computed_display_static( |
||
334 | const css_computed_style *style); |
||
335 | |||
336 | uint8_t css_computed_font_variant( |
||
337 | const css_computed_style *style); |
||
338 | |||
339 | uint8_t css_computed_text_decoration( |
||
340 | const css_computed_style *style); |
||
341 | |||
342 | uint8_t css_computed_font_family( |
||
343 | const css_computed_style *style, |
||
344 | lwc_string ***names); |
||
345 | |||
346 | uint8_t css_computed_border_top_style( |
||
347 | const css_computed_style *style); |
||
348 | |||
349 | uint8_t css_computed_border_right_style( |
||
350 | const css_computed_style *style); |
||
351 | |||
352 | uint8_t css_computed_border_bottom_style( |
||
353 | const css_computed_style *style); |
||
354 | |||
355 | uint8_t css_computed_border_left_style( |
||
356 | const css_computed_style *style); |
||
357 | |||
358 | uint8_t css_computed_font_weight( |
||
359 | const css_computed_style *style); |
||
360 | |||
361 | uint8_t css_computed_list_style_type( |
||
362 | const css_computed_style *style); |
||
363 | |||
364 | uint8_t css_computed_outline_style( |
||
365 | const css_computed_style *style); |
||
366 | |||
367 | uint8_t css_computed_table_layout( |
||
368 | const css_computed_style *style); |
||
369 | |||
370 | uint8_t css_computed_unicode_bidi( |
||
371 | const css_computed_style *style); |
||
372 | |||
373 | uint8_t css_computed_visibility( |
||
374 | const css_computed_style *style); |
||
375 | |||
376 | uint8_t css_computed_list_style_position( |
||
377 | const css_computed_style *style); |
||
378 | |||
379 | uint8_t css_computed_text_align( |
||
380 | const css_computed_style *style); |
||
381 | |||
382 | uint8_t css_computed_page_break_after( |
||
383 | const css_computed_style *style); |
||
384 | |||
385 | uint8_t css_computed_page_break_before( |
||
386 | const css_computed_style *style); |
||
387 | |||
388 | uint8_t css_computed_page_break_inside( |
||
389 | const css_computed_style *style); |
||
390 | |||
391 | uint8_t css_computed_orphans( |
||
392 | const css_computed_style *style, |
||
393 | int32_t *orphans); |
||
394 | |||
395 | uint8_t css_computed_widows( |
||
396 | const css_computed_style *style, |
||
397 | int32_t *widows); |
||
398 | |||
399 | #ifdef __cplusplus |
||
400 | } |
||
401 | #endif |
||
402 | |||
403 | #endif |