65typedef enum : uint16_t {
78typedef enum : int16_t {
90typedef enum : uint8_t {
108typedef enum : uint8_t {
448 const char** out_src,
Error Code Definitions for ra8-firmware.
ra8_err_codes_t ra8_err_t
Canonical error-return type used by every ra8-firmware API.
bool ra8_css_rule_matches(const ra8_css_rule_t *rule, const ra8_css_element_t *el, const ra8_css_sheet_t *sheet)
Test whether rule rule's selector matches element el.
ra8_err_t ra8_css_parse_inline(const char *decls, uint32_t len, ra8_css_style_t *out)
Parse an inline style="..." declaration body into one style.
ra8_css_style_t ra8_css_cascade_ctx(const ra8_css_sheet_t *sheet, const ra8_css_element_t *el, ra8_css_style_t inherited, ra8_css_style_t inline_decl, const ra8_css_element_t *ancestors, uint8_t n_anc)
Compute an element's cascaded style with descendant-selector context.
ra8_css_set_t
Which properties a declaration block actually set (presence bits).
@ k_ra8_css_set_fontsize
font-size was declared.
@ k_ra8_css_set_underline
text-decoration was declared.
@ k_ra8_css_set_align
text-align was declared.
@ k_ra8_css_set_display
display was declared.
@ k_ra8_css_set_bold
font-weight was declared.
@ k_ra8_css_set_italic
font-style was declared.
@ k_ra8_css_set_color
color was declared.
@ k_ra8_css_set_family
font-family was declared.
ra8_err_t ra8_css_sheet_reset(ra8_css_sheet_t *sheet)
Reset a stylesheet to empty (no rules, no names, order 0).
ra8_css_face_match_t
Sentinel for ra8_css_match_face when no @font-face entry matches.
@ k_ra8_css_no_face
No @font-face matched the requested family.
ra8_css_limits_t
Static-allocation caps for one parsed stylesheet.
@ k_ra8_css_name_pool
Bytes of class / id / font name storage.
@ k_ra8_css_name_max
Max bytes of one class / id / font name.
@ k_ra8_css_max_anc
Max descendant-ancestor parts per selector.
@ k_ra8_css_max_faces
Max @font-face rules kept per sheet.
@ k_ra8_css_max_classes
Max classes matched per element.
@ k_ra8_css_max_rules
Max rules kept across all <style> blocks.
bool ra8_css_face_src(const ra8_css_sheet_t *sheet, uint16_t idx, const char **out_src, uint16_t *out_len)
Read a parsed @font-face entry's src href bytes.
ra8_err_t ra8_css_parse(ra8_css_sheet_t *sheet, const char *css, uint32_t len)
Parse one <style> block's CSS text, appending rules to sheet.
int16_t ra8_css_match_face(const ra8_css_sheet_t *sheet, const char *family, uint16_t family_len, bool want_bold, bool want_italic)
Pick the @font-face whose family + emphasis best fits a run.
ra8_css_style_t ra8_css_cascade(const ra8_css_sheet_t *sheet, const ra8_css_element_t *el, ra8_css_style_t inherited, ra8_css_style_t inline_decl)
Compute an element's cascaded style.
ra8_css_font_unit_t
How a declared font-size value is interpreted.
@ k_ra8_css_font_px
Value is an absolute pixel size.
@ k_ra8_css_font_pct
Value is a percentage of inherited px.
One ancestor part of a descendant selector (e.g.
uint16_t id_off
Id name slice offset (id_len 0 = none).
uint16_t class_len
Class name slice length, bytes.
uint16_t id_len
Id name slice length, bytes.
uint16_t class_off
Class name slice offset (class_len 0 = none).
uint8_t tag
Type tag, or k_reflow_tag_unknown = no type.
The identity of one element, used to match selectors.
uint16_t class_len
Length of class_str, bytes.
const char * id
id attribute bytes (NULL = none).
const char * class_str
class attribute bytes (NULL = none).
uint16_t id_len
Length of id, bytes.
uint8_t tag
reflow_html_tag_t of the element.
One parsed @font-face rule: family + weight/style + src href.
uint16_t src_len
src href slice length.
uint8_t weight_bold
1 = this face is the bold weight.
uint16_t family_len
font-family name slice length.
uint8_t style_italic
1 = this face is italic / oblique.
uint16_t src_off
src href slice offset.
uint16_t family_off
font-family name slice offset.
One selector { ... } rule: a (possibly descendant) selector plus its declarations.
uint16_t class_off
Class name slice offset (class_len 0 = none).
uint16_t id_off
Id name slice offset (id_len 0 = none).
ra8_css_style_t decl
Declared properties.
ra8_css_anc_t anc[k_ra8_css_max_anc]
Descendant ancestor parts.
uint16_t class_len
Class name slice length, bytes.
uint16_t order
Source order (lower = earlier; ties to later).
uint8_t anc_count
Ancestor parts in anc (0 = simple).
uint16_t id_len
Id name slice length, bytes.
uint8_t sel_tag
Type tag, or k_reflow_tag_unknown = no type.
A parsed stylesheet: rule + @font-face arrays and a name byte pool.
uint16_t face_count
@font-face rules in use.
uint16_t rule_count
Rules in use.
ra8_css_rule_t rules[k_ra8_css_max_rules]
Parsed rules.
uint16_t next_order
Running source-order ctr.
uint16_t names_used
Bytes used in names.
ra8_css_fontface_t faces[k_ra8_css_max_faces]
Parsed @font-face rules.
uint8_t names[k_ra8_css_name_pool]
class/id/font name bytes.
A declared or computed style: a presence mask plus property values.
uint16_t font_val
font-size number: px or % (valid iff set & fontsize).
uint16_t family_len
font-family name slice length (0 = none).
uint8_t font_unit
ra8_css_font_unit_t (valid iff set & fontsize).
uint8_t display
1 = display:none (valid iff set & display).
uint8_t style
reflow_font_style_t bit VALUES (bold/italic/ul).
uint8_t set
ra8_css_set_t bitmask: which properties are present.
uint16_t family_off
font-family name slice offset (valid iff set&family).
uint32_t color
0xRRGGBB text colour (valid iff set & color).
uint8_t align
reflow_align_t (valid iff set & align).