47typedef enum : uint32_t {
69typedef enum : uint16_t {
97typedef enum : uint8_t {
135typedef enum : uint8_t {
153typedef enum : uint8_t {
168typedef enum : uint8_t {
185typedef enum : uint8_t {
208typedef enum : uint32_t {
307 const uint8_t** out_bytes,
337 const uint8_t** out_bytes,
388typedef enum : uint8_t {
411typedef enum : uint8_t {
Error Code Definitions for ra8-firmware.
ra8_err_codes_t ra8_err_t
Canonical error-return type used by every ra8-firmware API.
Fixed-RAM-budget glyph cache with LRU eviction (Layer 3, #147).
Minimal content-CSS cascade for the reflow ereader engine (#111).
Zero-heap raster image decode + scale + blit for reflow (#106).
reflow_html_tag_t
Recognised HTML element kinds.
@ k_reflow_tag_i
Italic (inline).
@ k_reflow_tag_th
Table header cell.
@ k_reflow_tag_td
Table cell.
@ k_reflow_tag_blockquote
Blockquote indent.
@ k_reflow_tag_p
Paragraph block.
@ k_reflow_tag_h5
Heading level 5.
@ k_reflow_tag_h1
Heading level 1.
@ k_reflow_tag_strong
Bold emphasis (inline).
@ k_reflow_tag_hr
Horizontal rule (void).
@ k_reflow_tag_link
<link> (void; stylesheet ref).
@ k_reflow_tag_h4
Heading level 4.
@ k_reflow_tag_tr
Table row.
@ k_reflow_tag_ul
Unordered list block.
@ k_reflow_tag_li
List item.
@ k_reflow_tag_table
Table (grid layout).
@ k_reflow_tag_em
Italic emphasis (inline).
@ k_reflow_tag_b
Bold (inline).
@ k_reflow_tag_h2
Heading level 2.
@ k_reflow_tag_h6
Heading level 6.
@ k_reflow_tag_br
Line break (void).
@ k_reflow_tag_img
Image (placeholder rect).
@ k_reflow_tag_h3
Heading level 3.
@ k_reflow_tag_ol
Ordered list block.
@ k_reflow_tag_a
Anchor (renders underlined).
@ k_reflow_tag_unknown
Anything not in this enum.
reflow_color_t
Sentinel marking a token / run with no CSS colour.
@ k_reflow_color_inherit
No per-run CSS colour.
ra8_err_t(* reflow_css_loader_fn)(void *ctx, const char *href, uint32_t href_len, const uint8_t **out_bytes, size_t *out_len)
External-stylesheet byte loader for <link rel="stylesheet" href>.
reflow_limits_t
Static-allocation caps for the reflow engine.
@ k_reflow_max_tokens
Max parsed token count.
@ k_reflow_max_anchors
Max id= anchor positions.
@ k_reflow_max_link_rects
Max positioned link rectangles.
@ k_reflow_max_faces
Max embedded @font-face typefaces.
@ k_reflow_max_images
Max laid-out <img> boxes.
@ k_reflow_max_links
Max distinct <a href> per chapter.
@ k_reflow_max_glyphs
Total positioned glyphs.
@ k_reflow_text_pool_bytes
Bytes of text pool.
@ k_reflow_max_lines_per_page
Lines per page upper bound.
@ k_reflow_max_pages
Max paginated pages.
ra8_err_t(* reflow_image_loader_fn)(void *ctx, const char *href, uint32_t href_len, const uint8_t **out_bytes, size_t *out_len)
Resolve an <img src> href to its encoded image bytes.
reflow_layout_t
Layout-axis named constants used by the line-break engine.
@ k_reflow_paragraph_gap_px
Vertical gap after a block.
@ k_reflow_margin_px
Page edge inset, pixels.
@ k_reflow_h6_scale_pct
H6 size = 100 % of body.
@ k_reflow_h2_scale_pct
H2 size = 175 % of body.
@ k_reflow_h5_scale_pct
H5 size = 110 % of body.
@ k_reflow_h1_scale_pct
H1 size = 200 % of body.
@ k_reflow_min_font_px
Smallest accepted font size.
@ k_reflow_h4_scale_pct
H4 size = 125 % of body.
@ k_reflow_h3_scale_pct
H3 size = 150 % of body.
@ k_reflow_default_font_px
Default body font size.
@ k_reflow_line_spacing_den
Line height denominator.
@ k_reflow_line_spacing_num
Line height numerator (= 1.2x).
@ k_reflow_max_font_px
Largest accepted font size.
@ k_reflow_indent_px
Indent for blockquote / li.
@ k_reflow_min_font_bytes
Smallest plausible font blob.
@ k_reflow_pct_full
Percentage denominator.
reflow_face_pad_t
Padding geometry for reflow_face_t.
@ k_reflow_face_pad8
Pad bytes to reach an 8-byte struct stride.
reflow_align_t
Block text alignment (from an inline style="text-align:...").
@ k_reflow_align_center
Centred.
@ k_reflow_align_justify
Justified (last line left-aligned).
@ k_reflow_align_right
Right-aligned.
@ k_reflow_align_left
Left (default, ragged right).
reflow_token_kind_t
Parsed token classification.
@ k_reflow_tok_block_end
Close of a block-flow element.
@ k_reflow_tok_break
Forced line break (<br>).
@ k_reflow_tok_image
Image placeholder (<img>).
@ k_reflow_tok_text
Text run (slice into pool).
@ k_reflow_tok_block_start
Open of a block-flow element.
@ k_reflow_tok_rule
Horizontal rule (<hr>).
reflow_font_style_t
Inline font-style flags (bitfield).
@ k_reflow_style_italic
Italic face.
@ k_reflow_style_normal
No emphasis.
@ k_reflow_style_bold
Bold face.
@ k_reflow_style_underline
Underlined run.
reflow_face_pack_t
How a per-run embedded-face index is packed into a glyph/token style.
@ k_reflow_face_shift
Bit position of the face index in style.
@ k_reflow_face_mask
Face-index mask once shifted down.
reflow_href_kind_t
Classification of an in-content <a href> target.
@ k_reflow_href_fragment
"#id" – same-chapter anchor.
@ k_reflow_href_chapter_fragment
"path#id" – chapter + anchor.
@ k_reflow_href_empty
Empty / whitespace-only href.
@ k_reflow_href_chapter
"path" – another chapter, no frag.
@ k_reflow_href_external
Has a URI scheme (http:, mailto:).
A parsed stylesheet: rule + @font-face arrays and a name byte pool.
Glyph-cache state (caller-owned; treat as private).
Caller-owned bump arena backing a single image decode.
A laid-out element id, for same-chapter #fragment jumps.
uint32_t page_index
Page the id landed on.
uint32_t id_len
Id slice length, bytes.
uint32_t id_off
Id slice offset into the text pool.
int32_t y
Page-local top y of the element.
One registered embedded @font-face typeface (#109).
uint8_t css_face_idx
@font-face table index this blob satisfies.
const uint8_t * blob
TTF/OTF bytes; caller-owned, outlives engine.
uint8_t pad8[k_reflow_face_pad8]
Padding to an 8-byte stride.
size_t len
Length of blob, bytes.
One positioned glyph after layout.
uint8_t style
Font-style bitmask.
int32_t cp
Unicode code point.
uint32_t color
32-bit RGB colour.
int32_t x
Pixel column of glyph baseline-left.
uint16_t font_px
Pixel size used for this glyph.
int32_t y
Pixel row of glyph baseline.
One laid-out <img> rectangle (decoded + blitted at render time).
uint32_t src_len
Href slice length, bytes.
int32_t y
Page-local top edge, pixels.
int32_t x
Page-local left edge, pixels.
uint32_t page_index
Page this image belongs to.
uint32_t reserved
Padding to 32-byte stride.
int32_t w
Scaled box width, pixels.
uint32_t src_off
Href slice offset into text pool.
int32_t h
Scaled box height, pixels.
One tappable rectangle covering a run of <a> glyphs on a page.
int32_t w
Rect width, pixels.
uint32_t target
Index into engine->link_targets[].
uint32_t page_index
Page this rect belongs to.
int32_t x
Page-local left edge, pixels.
int32_t h
Rect height, pixels.
int32_t y
Page-local top edge, pixels.
One distinct <a href> destination interned during a parse.
uint32_t href_len
Href slice length, bytes.
uint32_t href_off
Href slice offset into the text pool.
Index range of glyphs that belong to one page.
uint32_t glyph_count
Number of glyphs in this page.
uint32_t glyph_first
Index of first glyph in this page.
Reflow / pagination engine state.
uint32_t page_count
Pages used.
reflow_image_loader_fn img_loader
<img> byte loader (NULL = off).
reflow_css_loader_fn css_loader
<link> CSS loader (NULL = off).
const uint8_t * font_data
TTF blob; outlives the engine.
ra8_img_arena_t * img_arena
Decode scratch (NULL = off).
uint32_t link_color
Anchor text colour (0xRRGGBB).
reflow_glyph_t glyphs[k_reflow_max_glyphs]
Positioned glyphs.
uint32_t glyph_count
Glyphs used.
reflow_link_rect_t link_rects[k_reflow_max_link_rects]
Tappable rects.
reflow_page_t pages[k_reflow_max_pages]
Page index ranges.
uint8_t text_pool[k_reflow_text_pool_bytes]
Text bytes.
ra8_css_sheet_t css
Parsed <style> rules for the chapter.
uint32_t text_pool_used
Bytes consumed in text_pool.
uint32_t link_target_count
Interned link targets.
uint32_t token_count
Tokens used.
reflow_face_t faces[k_reflow_max_faces]
Embedded @font-face set.
reflow_anchor_t anchors[k_reflow_max_anchors]
id= anchor positions.
ra8_glyph_atlas_t * glyph_atlas
Glyph bitmap cache, or NULL for direct raster.
uint8_t in_use
1 = initialized, 0 = closed.
size_t font_len
Length of font_data, bytes.
void * img_loader_ctx
Opaque context for img_loader.
uint16_t font_px
Body font size in pixels.
uint16_t viewport_w
Viewport width, pixels.
reflow_token_t tokens[k_reflow_max_tokens]
Parsed tokens.
const uint8_t * xhtml_buf
Last layout_chapter input.
uint32_t anchor_count
Anchor positions used.
uint16_t reserved16
Padding.
reflow_link_target_t link_targets[k_reflow_max_links]
Distinct hrefs.
uint16_t viewport_h
Viewport height, pixels.
size_t xhtml_len
Length of xhtml_buf.
uint8_t reserved8[3]
Padding.
reflow_image_box_t image_boxes[k_reflow_max_images]
Laid-out images.
uint32_t body_color
Body text colour (0xRRGGBB).
uint32_t image_box_count
Image boxes used.
void * css_loader_ctx
Opaque context for css_loader.
uint32_t link_rect_count
Link rects used.
uint8_t face_count
Embedded face count (0 = single-face).
One parsed token in the engine's token stream.
uint16_t css_font_px
Block-start CSS font px (0 = none -> UA default).
uint32_t text_off
Byte offset into the text pool.
uint32_t text_len
Byte length within the text pool.
uint32_t color
0xRRGGBB CSS colour, or k_reflow_color_inherit.
uint8_t kind
reflow_token_kind_t.
uint8_t tag
reflow_html_tag_t (0 if N/A).
uint8_t style
Font-style bitmask.
uint16_t reserved16
Padding to 4-byte stride.
uint8_t reserved
Block align / <a> link id.