|
ra8-firmware 0.1.0
Bare-metal firmware for the Renesas RA8 family (RA8D2 / RA8P1)
|
E-reader UI chrome – Library + Reading rendering and in-content nav. More...
#include <stddef.h>#include <stdint.h>#include <string.h>#include "er_pageturn.h"#include "ereader_ui_steps.h"#include "figure_fixture.h"#include "ra8_box.h"#include "ra8_err.h"#include "ra8_gfx.h"#include "ra8_gfx_font.h"#include "ra8_glyph_atlas.h"#include "ra8_ui.h"#include "ra8_widget.h"#include "reflow.h"#include "reflow_image.h"Go to the source code of this file.
Enumerations | |
| enum | er_svg_len_t : uint32_t { k_er_logo_svg_len = (uint32_t)(sizeof(k_er_logo_svg) - 1U) , k_er_ext_len = 4U } |
| SVG fixture size + the .svg extension length for href routing. More... | |
| enum | er_filter_t : uint32_t { k_er_match_scan_max = 256U } |
| Search-filter scan bound (NASA Rule 2). More... | |
Functions | |
| static ra8_err_t | er_image_loader (void *ctx, const char *href, uint32_t href_len, const uint8_t **out_bytes, size_t *out_len) |
| reflow image loader: resolve any <img src> to the baked figure. | |
| void | er_text_left (int32_t x, int32_t y, const char *str, uint32_t color) |
| Draw a left-anchored text run in the bundled font. | |
| void | er_text_right (int32_t right, int32_t y, const char *str, uint32_t color) |
Draw a right-anchored text run ending at column right. | |
| static void | er_reset_side_tables (void) |
| Reset the per-node label / progress side tables. | |
| static ra8_box_t | er_leaf (int16_t fixed, uint16_t flex, uint32_t fill, uint32_t border) |
| Make a leaf box template carrying fill / border. | |
| static ra8_box_t | er_container (ra8_box_kind_t kind, int16_t fixed, int16_t pad, int16_t gap, uint8_t cols) |
| Make a container box template (stack or grid). | |
| static void | er_build_toolbar (ra8_box_tree_t *tree, int16_t parent) |
| Add the toolbar (search field + book-count chip) under a parent. | |
| static void | er_add_book_tile (ra8_box_tree_t *tree, int16_t grid, const er_book_t *book) |
| Add one book card (cover, title, author, progress) under a grid. | |
| static void | er_build_nav (ra8_box_tree_t *tree, int16_t parent) |
| Add the bottom navigation strip under a parent. | |
| static char | er_lc (char c) |
| Lower-case an ASCII letter (identity for non-letters). | |
| static bool | er_ci_contains (const char *hay, const char *needle) |
Case-insensitive: does needle occur within hay? | |
| static bool | er_book_matches (const er_book_t *book) |
Does book pass the committed search query (true if no filter)? | |
| static void | er_build_library (ra8_box_tree_t *tree, const ra8_ui_rect_t *frame) |
| Build the Library box tree (status bar, toolbar, grid, nav). | |
| static void | er_render_boxnodes (uint16_t from, uint16_t to) |
| Render box nodes [from, to) of s_nodes (fills, borders, progress bars, labels). | |
| static void | er_collect_targets (const ra8_box_tree_t *tree) |
| Collect tap targets from a laid-out tree's tagged nodes. | |
| static void | er_lib_sb_render (ra8_widget_t *w) |
| Render the full Library screen. | |
| static void | er_lib_body_render (ra8_widget_t *w) |
| Body band widget: toolbar + book grid + nav nodes + the above-nav rule. | |
| void | er_render_library (void) |
| Render the full Library screen. | |
| static void | er_bind_glyph_atlas (void) |
| Bind the Layer-3 glyph atlas (#164) to the reflow engine. | |
| static bool | er_reflow_relayout (int32_t body_w, int32_t body_h, const uint8_t *font_data, uint32_t font_len) |
| Re-init the reflow engine and lay the current chapter into the cache. | |
| static bool | er_draw_reading_body_reflow (int32_t body_top, int32_t height) |
| Render the Reading body through reflow when an SD font is loaded. | |
| static bool | er_draw_reading_body (int32_t height) |
| Paint the Reading body: reflowed text (SD or baked font), else bitmap. | |
| static void | er_read_sb_render (ra8_widget_t *w) |
| Status-bar band widget: wordmark + book title + status-right + hairline. | |
| static void | er_read_body_render (ra8_widget_t *w) |
| Body band widget: the reflowed (or bitmap-fallback) chapter text. | |
| static void | er_read_footer_render (ra8_widget_t *w) |
| Footer band widget: rule + chapter title + page label + progress bar. | |
| void | er_render_reading (void) |
| Render the full Reading screen (status bar, body, footer). | |
| void | er_push_loc (void) |
| Push the current (chapter, page) on the back-stack, capacity permitting. | |
| uint32_t | er_spine_count (void) |
| Number of chapters in the (mock) spine. | |
| bool | er_apply_pageturn (er_dir_t dir) |
| Apply a page turn to the reading location (touch + button shared path). | |
| static bool | er_nav_fragment (uint32_t off, uint32_t frag_off, uint32_t frag_len) |
| Follow a same-chapter #fragment: jump to the anchored page. | |
| static bool | er_nav_chapter (uint32_t off, uint32_t path_len) |
| Follow a cross-chapter link: resolve the path against the mock spine. | |
| bool | er_reading_link_tap (int32_t x, int32_t y) |
| Follow an in-content <a> tap in the Reading body (#110). | |
Variables | |
| const uint8_t | g_ra8_font_literata_latin1 [] |
| Baked Latin-1 font array (generated at build time). | |
| const unsigned int | g_ra8_font_literata_latin1_len |
| static ra8_box_t | s_nodes [k_er_max_nodes] |
| Box-tree node storage for chrome layout. | |
| static const char * | s_label [k_er_max_nodes] |
| Per-node text label (NULL if the node draws no text). | |
| static uint32_t | s_label_col [k_er_max_nodes] |
| Per-node text colour. | |
| static int16_t | s_progress [k_er_max_nodes] |
| Per-node progress percent, or -1 for "not a progress bar". | |
| static uint16_t | s_lib_node_count |
| Library box-node count (set by er_render_library for the band widgets). | |
| static uint16_t | s_lib_body_first = 2U |
| First Library body box-node (root=0, status bar=1, body from here). | |
| static const char | k_er_logo_svg [] |
| In-content SVG (#112): a navy field, a gold disc, and a crimson block. | |
| static const ra8_widget_vtable_t | k_er_lib_sb_vt = {.render = er_lib_sb_render} |
| Vtables for the Library status-bar / body band widgets. | |
| static const ra8_widget_vtable_t | k_er_lib_body_vt = {.render = er_lib_body_render} |
| static bool | s_read_reflowed = false |
| Stash: did the body band reflow live text? | |
| static const ra8_widget_vtable_t | k_er_read_sb_vt = {.render = er_read_sb_render} |
| Vtables for the Reading status-bar / body / footer band widgets. | |
| static const ra8_widget_vtable_t | k_er_read_body_vt = {.render = er_read_body_render} |
| static const ra8_widget_vtable_t | k_er_read_footer_vt = {.render = er_read_footer_render} |
E-reader UI chrome – Library + Reading rendering and in-content nav.
Split out of ereader_ui/main.c to keep every translation unit under the repository's 1000-line cap (a pure code move). This unit owns the box-model Library screen (status bar, toolbar, book grid, bottom nav), the Reading screen (status bar, reflowed / bitmap-fallback body, footer), the shared bundled-font text helpers, and the in-content navigation that follows <a href> links and page turns across the mock spine. The composited chrome is byte-identical to the pre-split monolith.
Definition in file ereader_ui_screens.c.
| enum er_filter_t : uint32_t |
Search-filter scan bound (NASA Rule 2).
| Enumerator | |
|---|---|
| k_er_match_scan_max | Max title chars scanned for a match. |
Definition at line 346 of file ereader_ui_screens.c.
| enum er_svg_len_t : uint32_t |
SVG fixture size + the .svg extension length for href routing.
| Enumerator | |
|---|---|
| k_er_logo_svg_len | SVG byte count. |
| k_er_ext_len | Length of ".svg". |
Definition at line 79 of file ereader_ui_screens.c.
|
static |
Add one book card (cover, title, author, progress) under a grid.
| [in,out] | tree | Tree builder bound to s_nodes. |
| [in] | grid | Grid container index. |
| [in] | book | Book to render in the card. |
tree references s_nodes; grid is a valid grid; book valid. grid. Definition at line 286 of file ereader_ui_screens.c.
References er_book_t::author, er_container(), er_leaf(), k_er_act_open_book, k_er_card_bar_h, k_er_card_label_h, k_er_fill, k_er_ink, k_er_ink_muted, k_er_rule_soft, k_er_tile_gap, k_ra8_box_no_colour, k_ra8_box_stack_v, er_book_t::pct, ra8_box_add(), s_label, s_label_col, s_progress, ra8_box_t::tag, and er_book_t::title.
Referenced by er_build_library().
| bool er_apply_pageturn | ( | er_dir_t | dir | ) |
Apply a page turn to the reading location (touch + button shared path).
| [in] | dir | Direction (k_er_dir_prev / k_er_dir_next / k_er_dir_none). |
| true | A page turn was applied. |
| false | No turn (book end, or k_er_dir_none). |
Definition at line 888 of file ereader_ui_screens.c.
References er_pageturn_step(), er_spine_count(), g_er_turns, k_display_event_chapter, k_display_event_turn, s_chapter_idx, s_pending_event, s_reading_page, and s_reading_pages.
Referenced by er_handle_reading_tap(), and er_poll_buttons().
|
static |
Bind the Layer-3 glyph atlas (#164) to the reflow engine.
A page turn re-renders the same body glyphs, so caching the rasterised bitmaps (cells in SDRAM, like the framebuffer + decode arena) avoids re-running stb_truetype every frame. Re-bound on each relayout (reflow_init zeroes the engine); the cache clears per chapter, the natural working-set boundary. Output is byte-identical to the direct path – oversized glyphs fall back to direct rasterisation. The caller-owned storage is function-static (single reflow engine, single-threaded UI loop).
Definition at line 594 of file ereader_ui_screens.c.
References k_er_glyph_buckets, k_er_glyph_cell_bytes, k_er_glyph_cells, reflow_set_glyph_atlas(), and s_reflow_engine.
Referenced by er_reflow_relayout().
|
static |
Does book pass the committed search query (true if no filter)?
Definition at line 376 of file ereader_ui_screens.c.
References er_ci_contains(), s_query, and er_book_t::title.
Referenced by er_build_library().
|
static |
Build the Library box tree (status bar, toolbar, grid, nav).
| [in,out] | tree | Tree builder bound to s_nodes. |
| [in] | frame | Screen rectangle to lay out within. |
tree references s_nodes. Definition at line 398 of file ereader_ui_screens.c.
References er_add_book_tile(), er_book_matches(), er_build_nav(), er_build_toolbar(), er_container(), er_leaf(), er_reset_side_tables(), k_er_book_count, k_er_books, k_er_grid_cols, k_er_grid_gap, k_er_lib_heading, k_er_max_nodes, k_er_pad_ui, k_er_statusbar_h, k_ra8_box_grid, k_ra8_box_no_colour, k_ra8_box_none, k_ra8_box_stack_v, ra8_box_add(), ra8_box_layout(), ra8_box_tree_init(), s_label, s_lib_body_first, and s_nodes.
Referenced by er_render_library().
|
static |
Add the bottom navigation strip under a parent.
| [in,out] | tree | Tree builder bound to s_nodes. |
| [in] | parent | Parent container index (the screen column). |
tree references s_nodes; parent is a valid container. Definition at line 325 of file ereader_ui_screens.c.
References er_container(), er_leaf(), k_er_act_settings, k_er_ink, k_er_ink_muted, k_er_nav_count, k_er_nav_h, k_er_nav_idx_setting, k_er_nav_items, k_ra8_box_no_colour, k_ra8_box_stack_h, ra8_box_add(), s_label, s_label_col, and ra8_box_t::tag.
Referenced by er_build_library().
|
static |
Add the toolbar (search field + book-count chip) under a parent.
| [in,out] | tree | Tree builder bound to s_nodes. |
| [in] | parent | Parent container index (the screen column). |
tree references s_nodes; parent is a valid container. Definition at line 249 of file ereader_ui_screens.c.
References er_container(), er_leaf(), k_er_act_search, k_er_count_text, k_er_count_w, k_er_ink, k_er_ink_muted, k_er_pad_ui, k_er_search_hint, k_er_toolbar_h, k_ra8_box_no_colour, k_ra8_box_stack_h, ra8_box_add(), s_label, s_label_col, and ra8_box_t::tag.
Referenced by er_build_library().
|
static |
Case-insensitive: does needle occur within hay?
Definition at line 357 of file ereader_ui_screens.c.
References er_lc(), k_er_match_scan_max, and k_ra8_kbd_text_max.
Referenced by er_book_matches().
|
static |
Collect tap targets from a laid-out tree's tagged nodes.
| [in] | tree | Laid-out box tree. |
tree is laid out. Definition at line 487 of file ereader_ui_screens.c.
References ra8_box_tree_t::count, k_er_max_targets, k_ra8_box_none, ra8_box_tree_t::nodes, ra8_box_t::rect, s_target_count, s_targets, and ra8_box_t::tag.
Referenced by er_render_library().
|
static |
Make a container box template (stack or grid).
| [in] | kind | Container kind. |
| [in] | fixed | Fixed main-axis extent (0 => flex). |
| [in] | pad | Inner padding. |
| [in] | gap | Gap between children. |
| [in] | cols | Grid columns (>= 1). |
| node | Configured container node template. |
kind is a container kind. Definition at line 222 of file ereader_ui_screens.c.
References ra8_box_t::fixed, ra8_box_t::flex, ra8_box_t::gap, ra8_box_t::grid_cols, k_ra8_box_none, ra8_box_t::kind, ra8_box_t::pad, and ra8_box_t::tag.
Referenced by er_add_book_tile(), er_build_library(), er_build_nav(), and er_build_toolbar().
|
static |
Paint the Reading body: reflowed text (SD or baked font), else bitmap.
| [in] | height | Framebuffer height in pixels. |
| true | reflow painted the current page (SD font or the baked font). |
| false | The bundled bitmap lines were drawn (reflow-engine failure). |
height matches the bound framebuffer. Definition at line 758 of file ereader_ui_screens.c.
References er_draw_reading_body_reflow(), er_text_left(), k_er_blank_lines, k_er_body_gap, k_er_body_line_count, k_er_body_lines, k_er_chapter, k_er_footer_h, k_er_glyph_h, k_er_ink, k_er_line_h, k_er_margin_x, and k_er_statusbar_h.
Referenced by er_read_body_render().
|
static |
Render the Reading body through reflow when an SD font is loaded.
Lays the chapter XHTML out against the body rectangle (inset below the status bar, above the footer) and paints the current page (s_reading_page) there via reflow_render_page_at. er_render_reading has already cleared the framebuffer to paper and the body colour is dark ink, so the text shows (the reflow_init colour args are the text colours, not the background). Publishes the layout's page count to s_reading_pages and clamps s_reading_page into range.
| [in] | body_top | Top y of the body band (pixels). |
| [in] | height | Framebuffer height (pixels). |
| true | reflow rendered the body. |
| false | No font / init / layout failure – caller draws the bitmap body. |
height matches the bound framebuffer. Definition at line 707 of file ereader_ui_screens.c.
References er_reflow_relayout(), g_ra8_font_literata_latin1, g_ra8_font_literata_latin1_len, k_er_body_gap, k_er_footer_h, k_er_margin_x, k_er_statusbar_h, reflow_render_page_at(), s_chapter_idx, s_fb, s_font_buf, s_font_len, s_have_font, s_reading_page, s_reading_pages, s_reflow_chapter, s_reflow_engine, s_reflow_h, s_reflow_open, and s_reflow_w.
Referenced by er_draw_reading_body().
|
static |
reflow image loader: resolve any <img src> to the baked figure.
The mock library has no EPUB ZIP to read resources from, so every <img> in the demo chapter resolves to the one bundled figure (k_er_figure_png). A real EPUB-backed build would map href to a manifest item and return its bytes; the engine contract is identical either way.
| [in] | ctx | Unused loader context. |
| [in] | href | Image src (unused; single bundled figure). |
| [in] | href_len | Length of href. |
| [out] | out_bytes | Receives the encoded PNG bytes. |
| [out] | out_len | Receives the encoded byte count. |
| k_ra8_ok | The bundled figure bytes were returned. |
out_bytes and out_len are non-null. Definition at line 106 of file ereader_ui_screens.c.
References k_er_ext_len, k_er_figure_png, k_er_figure_png_len, k_er_logo_svg, k_er_logo_svg_len, k_ra8_ok, and memcmp().
Referenced by er_reflow_relayout().
|
static |
Lower-case an ASCII letter (identity for non-letters).
Definition at line 351 of file ereader_ui_screens.c.
Referenced by er_ci_contains().
|
static |
Make a leaf box template carrying fill / border.
| [in] | fixed | Fixed main-axis extent (0 => flex). |
| [in] | flex | Flex weight when not fixed. |
| [in] | fill | Fill colour, or k_ra8_box_no_colour. |
| [in] | border | Border colour, or k_ra8_box_no_colour. |
| node | Configured leaf node template. |
Definition at line 187 of file ereader_ui_screens.c.
References ra8_box_t::border, ra8_box_t::border_w, ra8_box_t::fill, ra8_box_t::fixed, ra8_box_t::flex, ra8_box_t::grid_cols, k_er_border_w, k_ra8_box_leaf, k_ra8_box_no_colour, k_ra8_box_none, ra8_box_t::kind, and ra8_box_t::tag.
Referenced by er_add_book_tile(), er_build_library(), er_build_nav(), and er_build_toolbar().
|
static |
Body band widget: toolbar + book grid + nav nodes + the above-nav rule.
Definition at line 529 of file ereader_ui_screens.c.
References er_render_boxnodes(), k_er_hair, k_er_nav_h, k_er_rule, ra8_gfx_rect(), s_fb, s_lib_body_first, and s_lib_node_count.
|
static |
Render the full Library screen.
Definition at line 512 of file ereader_ui_screens.c.
References er_render_boxnodes(), er_text_right(), k_er_hair, k_er_ink_muted, k_er_pad_ui, k_er_rule, k_er_status_right, k_er_statusbar_h, k_er_text_inset_y, ra8_gfx_rect(), s_fb, and s_lib_body_first.
|
static |
Follow a cross-chapter link: resolve the path against the mock spine.
| [in] | off | Href text-pool offset. |
| [in] | path_len | Length of the path part (excluding any fragment). |
Definition at line 940 of file ereader_ui_screens.c.
References er_push_loc(), er_spine_count(), k_er_spine, memcmp(), s_chapter_idx, s_reading_page, and s_reflow_engine.
Referenced by er_reading_link_tap().
|
static |
Follow a same-chapter #fragment: jump to the anchored page.
| [in] | off | Href text-pool offset. |
| [in] | frag_off | Fragment offset within the href. |
| [in] | frag_len | Fragment length. |
Definition at line 917 of file ereader_ui_screens.c.
References er_push_loc(), k_ra8_ok, reflow_find_anchor(), s_reading_page, and s_reflow_engine.
Referenced by er_reading_link_tap().
| void er_push_loc | ( | void | ) |
Push the current (chapter, page) on the back-stack, capacity permitting.
Definition at line 874 of file ereader_ui_screens.c.
References k_er_page_back_cap, s_chapter_idx, s_loc_back, s_loc_back_count, and s_reading_page.
Referenced by er_nav_chapter(), and er_nav_fragment().
|
static |
Body band widget: the reflowed (or bitmap-fallback) chapter text.
Definition at line 803 of file ereader_ui_screens.c.
References er_draw_reading_body(), s_fb, and s_read_reflowed.
|
static |
Footer band widget: rule + chapter title + page label + progress bar.
Definition at line 810 of file ereader_ui_screens.c.
References er_text_left(), er_text_right(), k_er_book_title, k_er_fill_deep, k_er_footer_h, k_er_hair, k_er_ink_muted, k_er_pad_ui, k_er_page_current, k_er_page_label, k_er_page_total, k_er_progress_gap, k_er_progress_h, k_er_rule, k_er_rule_soft, ra8_gfx_rect(), s_fb, s_read_reflowed, s_reading_page, and s_reading_pages.
|
static |
Status-bar band widget: wordmark + book title + status-right + hairline.
Definition at line 782 of file ereader_ui_screens.c.
References er_text_left(), er_text_right(), k_er_book_title, k_er_glyph_w, k_er_hair, k_er_ink, k_er_ink_muted, k_er_pad_ui, k_er_rule, k_er_status_right, k_er_statusbar_h, k_er_text_inset_y, k_er_wordmark, ra8_gfx_rect(), and s_fb.
| bool er_reading_link_tap | ( | int32_t | x, |
| int32_t | y ) |
Follow an in-content <a> tap in the Reading body (#110).
| [in] | x | Tap X (panel pixels). |
| [in] | y | Tap Y (panel pixels). |
| true | A link was followed; chapter/page updated. |
| false | No link hit, or an unresolved / external target. |
Definition at line 960 of file ereader_ui_screens.c.
References er_nav_chapter(), er_nav_fragment(), k_er_body_gap, k_er_margin_x, k_er_statusbar_h, k_ra8_ok, k_reflow_href_chapter, k_reflow_href_chapter_fragment, k_reflow_href_empty, k_reflow_href_fragment, reflow_hit_test_link(), reflow_href_split(), s_reading_page, and s_reflow_engine.
Referenced by er_handle_reading_tap().
|
static |
Re-init the reflow engine and lay the current chapter into the cache.
Closes any prior layout, binds the font + image arena, paginates the current chapter (s_chapter_idx) and records the cache keys (s_reflow_chapter / s_reflow_w / s_reflow_h) so subsequent same-chapter page turns skip this expensive step. The costliest part of a Reading render.
| [in] | body_w | Body width the chapter is paginated for (px). |
| [in] | body_h | Body height the chapter is paginated for (px). |
| [in] | font_data | Font blob (SD-loaded or baked). |
| [in] | font_len | Font blob length in bytes. |
| true | Layout succeeded; s_reflow_open is set. |
| false | init / layout failed; the engine is closed. |
body_w and body_h are > 0. font_data / font_len describe a usable face. Definition at line 641 of file ereader_ui_screens.c.
References er_bind_glyph_atlas(), er_image_loader(), k_er_img_arena, k_er_reflow_ink, k_er_reflow_link, k_er_reflow_px, k_er_spine, k_ra8_ok, er_chapter_t::len, reflow_close(), reflow_init(), reflow_layout_chapter(), reflow_set_image_loader(), s_chapter_idx, s_img_arena_buf, s_reading_pages, s_reflow_chapter, s_reflow_engine, s_reflow_h, s_reflow_open, s_reflow_w, and er_chapter_t::xhtml.
Referenced by er_draw_reading_body_reflow().
|
static |
Render box nodes [from, to) of s_nodes (fills, borders, progress bars, labels).
| [in] | from | Index of the first node to draw (inclusive). |
| [in] | to | Index one past the last node to draw (exclusive). |
from <= to and to is within the laid-out node count. Definition at line 450 of file ereader_ui_screens.c.
References ra8_box_t::border, ra8_box_t::border_w, er_text_left(), ra8_box_t::fill, ra8_ui_rect_t::h, k_er_fill_deep, k_er_pct_full, k_er_text_pad, k_ra8_box_no_colour, ra8_gfx_rect(), ra8_box_t::rect, s_label, s_label_col, s_nodes, s_progress, ra8_ui_rect_t::w, ra8_ui_rect_t::x, and ra8_ui_rect_t::y.
Referenced by er_lib_body_render(), and er_lib_sb_render().
| void er_render_library | ( | void | ) |
Render the full Library screen.
Definition at line 545 of file ereader_ui_screens.c.
References ra8_box_tree_t::count, er_build_library(), er_collect_targets(), k_er_lib_body_vt, k_er_lib_sb_vt, k_er_paper, k_er_statusbar_h, k_ra8_widget_axis_col, k_ra8_widget_refresh_quality, ra8_gfx_clear(), ra8_widget_invalidate(), ra8_widget_layout_stack(), ra8_widget_render_dirty(), s_fb, and s_lib_node_count.
Referenced by er_app_render().
| void er_render_reading | ( | void | ) |
Render the full Reading screen (status bar, body, footer).
Definition at line 848 of file ereader_ui_screens.c.
References k_er_footer_h, k_er_paper, k_er_read_body_vt, k_er_read_footer_vt, k_er_read_sb_vt, k_er_statusbar_h, k_ra8_widget_axis_col, k_ra8_widget_refresh_quality, ra8_gfx_clear(), ra8_widget_invalidate(), ra8_widget_layout_stack(), ra8_widget_render_dirty(), and s_fb.
Referenced by er_app_render().
|
static |
Reset the per-node label / progress side tables.
Definition at line 159 of file ereader_ui_screens.c.
References k_er_ink, k_er_max_nodes, s_label, s_label_col, and s_progress.
Referenced by er_build_library().
| uint32_t er_spine_count | ( | void | ) |
Number of chapters in the (mock) spine.
| count | The number of spine chapters. |
Definition at line 883 of file ereader_ui_screens.c.
References k_er_spine_count.
Referenced by er_apply_pageturn(), and er_nav_chapter().
| void er_text_left | ( | int32_t | x, |
| int32_t | y, | ||
| const char * | str, | ||
| uint32_t | color ) |
Draw a left-anchored text run in the bundled font.
| [in] | x | Left pixel column. |
| [in] | y | Top pixel row. |
| [in] | str | ASCII string (NUL-terminated). |
| [in] | color | Foreground colour (0xRRGGBB); background is paper. |
Definition at line 129 of file ereader_ui_screens.c.
References k_er_paper, ra8_gfx_font_8x16, and ra8_gfx_text_out().
Referenced by er_draw_reading_body(), er_kbd_search_render(), er_read_footer_render(), er_read_sb_render(), er_render_boxnodes(), and er_text_right().
| void er_text_right | ( | int32_t | right, |
| int32_t | y, | ||
| const char * | str, | ||
| uint32_t | color ) |
Draw a right-anchored text run ending at column right.
| [in] | right | Right pixel column the run ends at. |
| [in] | y | Top pixel row. |
| [in] | str | ASCII string (NUL-terminated). |
| [in] | color | Foreground colour (0xRRGGBB); background is paper. |
right. Definition at line 134 of file ereader_ui_screens.c.
References er_text_left(), k_ra8_ok, ra8_gfx_font_8x16, and ra8_gfx_text_size().
Referenced by er_lib_sb_render(), er_read_footer_render(), and er_read_sb_render().
|
extern |
Baked Latin-1 font array (generated at build time).
|
extern |
|
static |
Definition at line 543 of file ereader_ui_screens.c.
Referenced by er_render_library().
|
static |
Vtables for the Library status-bar / body band widgets.
Definition at line 542 of file ereader_ui_screens.c.
Referenced by er_render_library().
|
static |
In-content SVG (#112): a navy field, a gold disc, and a crimson block.
Returned by er_image_loader for any *.svg <img src>; rendered as vector <rect>/<circle> shapes by ra8_svg_render (no raster decode).
Definition at line 71 of file ereader_ui_screens.c.
Referenced by er_image_loader().
|
static |
Definition at line 845 of file ereader_ui_screens.c.
Referenced by er_render_reading().
|
static |
Definition at line 846 of file ereader_ui_screens.c.
Referenced by er_render_reading().
|
static |
Vtables for the Reading status-bar / body / footer band widgets.
Definition at line 844 of file ereader_ui_screens.c.
Referenced by er_render_reading().
|
static |
Per-node text label (NULL if the node draws no text).
Definition at line 51 of file ereader_ui_screens.c.
|
static |
Per-node text colour.
Definition at line 54 of file ereader_ui_screens.c.
Referenced by er_add_book_tile(), er_build_nav(), er_build_toolbar(), er_render_boxnodes(), and er_reset_side_tables().
|
static |
First Library body box-node (root=0, status bar=1, body from here).
Definition at line 63 of file ereader_ui_screens.c.
Referenced by er_build_library(), er_lib_body_render(), and er_lib_sb_render().
|
static |
Library box-node count (set by er_render_library for the band widgets).
Definition at line 60 of file ereader_ui_screens.c.
Referenced by er_lib_body_render(), and er_render_library().
|
static |
Box-tree node storage for chrome layout.
Definition at line 48 of file ereader_ui_screens.c.
|
static |
Per-node progress percent, or -1 for "not a progress bar".
Definition at line 57 of file ereader_ui_screens.c.
Referenced by er_add_book_tile(), er_render_boxnodes(), and er_reset_side_tables().
|
static |
Stash: did the body band reflow live text?
The footer bar tracks it.
Definition at line 779 of file ereader_ui_screens.c.
Referenced by er_read_body_render(), and er_read_footer_render().