|
ra8-firmware 0.1.0
Bare-metal firmware for the Renesas RA8 family (RA8D2 / RA8P1)
|
Table-of-contents screen: scrollable chapter list for the open book. More...
Go to the source code of this file.
Enumerations | |
| enum | sh_toc_const_t : int32_t { k_sh_toc_text_pad = 14 , k_sh_toc_num_w = 64 } |
| TOC layout constants. More... | |
Functions | |
| static int32_t | sh_toc_visible_rows (void) |
| Rows of the chapter list visible at once. | |
| static void | sh_toc_label (uint32_t idx, char *buf, size_t cap) |
Resolve chapter idx's display label into buf (cap bytes), truncated. | |
| void | sh_toc_render (void) |
| Render the open book's chapter list (TOC). | |
| int32_t | sh_toc_hit (int32_t x, int32_t y) |
| Hit-test a TOC tap; returns the chapter index or -1. | |
| void | sh_toc_scroll (int32_t dir) |
Scroll the TOC list by dir pages (-1 up / +1 down), clamped. | |
Table-of-contents screen: scrollable chapter list for the open book.
Lists the open book's spine chapters using their book TOC labels (falling back to "Chapter N" for unlabelled spine items). The list scrolls a page at a time via SW1/SW2; tapping a visible row opens the reader at that chapter. The window of visible rows is derived from the panel height and k_sh_toc_row_h.
[Ring 6 / App] {World: NS}
Definition in file sh_toc.c.
| enum sh_toc_const_t : int32_t |
| int32_t sh_toc_hit | ( | int32_t | x, |
| int32_t | y ) |
Hit-test a TOC tap; returns the chapter index or -1.
Definition at line 79 of file sh_toc.c.
References g_sh, k_sh_bar_h, and k_sh_toc_row_h.
Referenced by sh_tap_toc().
|
static |
Resolve chapter idx's display label into buf (cap bytes), truncated.
Definition at line 35 of file sh_toc.c.
References k_sh_fb_w, k_sh_linebuf, k_sh_pad, k_sh_toc_num_w, sh_book_chapter_label(), sh_cells(), and sh_fit().
Referenced by sh_toc_render().
| void sh_toc_render | ( | void | ) |
Render the open book's chapter list (TOC).
Definition at line 42 of file sh_toc.c.
References g_sh, k_sh_bar_h, k_sh_col_card, k_sh_col_edge, k_sh_col_ink, k_sh_col_rowhi, k_sh_col_sub, k_sh_dec_base, k_sh_fb_w, k_sh_glyph_h, k_sh_linebuf, k_sh_toc_num_w, k_sh_toc_row_h, k_sh_toc_text_pad, ra8_gfx_clear(), ra8_gfx_font_8x16, ra8_gfx_rect(), ra8_gfx_text_out(), sh_fmt_uint(), sh_titlebar(), sh_toc_label(), and sh_toc_visible_rows().
Referenced by sh_present().
| void sh_toc_scroll | ( | int32_t | dir | ) |
Scroll the TOC list by dir pages (-1 up / +1 down), clamped.
Definition at line 90 of file sh_toc.c.
References g_sh, and sh_toc_visible_rows().
Referenced by sh_handle_button().
|
static |
Rows of the chapter list visible at once.
Definition at line 29 of file sh_toc.c.
References k_sh_bar_h, k_sh_fb_h, and k_sh_toc_row_h.
Referenced by sh_toc_render(), and sh_toc_scroll().