ra8-firmware 0.1.0
Bare-metal firmware for the Renesas RA8 family (RA8D2 / RA8P1)
Loading...
Searching...
No Matches
sh_app.h
Go to the documentation of this file.
1
27#pragma once
28
29#include <stddef.h>
30#include <stdint.h>
31
32#include "book.h"
33#include "book_paged.h"
34#include "library.h"
35#include "ra8_panel.h"
36#include "ra8_ui.h"
37#include "ra8_vsource.h"
38#include "sh_classify.h"
39
73
84typedef enum : uint32_t {
85 k_sh_loupe_w = 320U,
86 k_sh_loupe_h = 320U,
91
97typedef enum : uint32_t {
98 k_sh_col_bg = 0x201A14U,
99 k_sh_col_bar = 0x3A2E22U,
100 k_sh_col_card = 0xF4ECDFU,
101 k_sh_col_card_hi = 0xFFF7E0U,
102 k_sh_col_ink = 0x1A140EU,
103 k_sh_col_sub = 0x6A5C4AU,
104 k_sh_col_edge = 0xB7A789U,
105 k_sh_col_sel = 0xC8762AU,
106 k_sh_col_barfg = 0xF4ECDFU,
107 k_sh_col_rowhi = 0xE7DCC6U,
108} sh_color_t;
109
122
128typedef struct {
129 uint32_t off;
130 uint16_t len;
131} sh_line_t;
132
141typedef struct {
142 bool from_sd;
144 const uint8_t* blob;
145 uint32_t blob_len;
146 const uint8_t* thumb;
147 uint16_t thumb_w;
148 uint16_t thumb_h;
152} sh_entry_t;
153
201
203extern sh_state_t g_sh;
204
205/* ----- sh_image.c : 4bpp grayscale cover / image rendering ----------------- */
206
224 uint32_t img_idx,
225 uint8_t* out,
226 int32_t box_w,
227 int32_t box_h,
228 int32_t* out_w,
229 int32_t* out_h);
230
242void sh_image_blit_gray8(const uint8_t* src, int32_t w, int32_t h, int32_t dst_x, int32_t dst_y);
243
260 uint32_t img_idx,
261 int32_t dst_x,
262 int32_t dst_y,
263 int32_t box_w,
264 int32_t box_h,
265 int32_t* out_w,
266 int32_t* out_h);
267
289 uint32_t img_idx,
290 int32_t src_cx,
291 int32_t src_cy,
292 int32_t dst_x,
293 int32_t dst_y);
294
314bool sh_image_loupe_map(const book_src_t* src,
315 uint32_t img_idx,
316 int32_t box_x,
317 int32_t box_y,
318 int32_t box_w,
319 int32_t box_h,
320 int32_t px,
321 int32_t py,
322 int32_t* out_cx,
323 int32_t* out_cy);
324
325/* ----- shared small helpers (sh_util.c) ------------------------------------ */
326
328int32_t sh_cells(int32_t pixels);
329
331void sh_fit(char* dst, size_t cap, const char* src, int32_t max_chars);
332
334size_t sh_fmt_uint(char* dst, size_t pos, uint32_t v);
335
337void sh_border(ra8_ui_rect_t r, uint32_t colour, int32_t width);
338
340void sh_titlebar(const char* title, const char* right);
341
342/* ----- per-screen render + input (one module each) ------------------------- */
343
344/* ----- sh_sd.c : optional SD-card book source ------------------------------ */
345
354bool sh_sd_mount(void);
355
357void sh_sd_scan(void);
358
369bool sh_sd_book_open(const char* name, uint32_t* out_len);
370
382ra8_err_t sh_sd_book_read(void* ctx, uint64_t offset, uint8_t* buf, uint32_t len);
383
385void sh_sd_book_close(void);
386
404size_t sh_sd_comic_read(void* ctx, uint64_t offset, void* buf, size_t len);
405
417bool sh_sd_open_epub(const char* name, void* out_book);
418
424void sh_sd_close_epub(void* book);
425
427uint16_t* sh_fb_pixels(void);
428
430void sh_decode_cover(uint16_t idx, const book_src_t* src);
431
433void sh_shelf_build_thumbs(void);
434
436void sh_shelf_render(void);
437
439int32_t sh_shelf_hit(int32_t x, int32_t y);
440
446typedef enum : uint8_t {
451
453void sh_cover_render(void);
454
456sh_cover_act_t sh_cover_action(int32_t x, int32_t y);
457
469bool sh_cover_loupe_map(int32_t px, int32_t py, int32_t* out_cx, int32_t* out_cy);
470
472void sh_cover_loupe_render(void);
473
475void sh_toc_render(void);
476
478int32_t sh_toc_hit(int32_t x, int32_t y);
479
481void sh_toc_scroll(int32_t dir);
482
500ra8_err_t sh_inflate(const void* src, size_t src_len, void* dst, size_t dst_cap, size_t* out_len);
501
502/* ----- sh_paged.c : demand-paged .rabook backing (#204/#205) ---------------- */
503
519bool sh_paged_open(ra8_vsource_read_fn file_read, void* file_ctx, uint64_t file_len);
520
531bool sh_paged_open_mram(const uint8_t* blob, uint32_t blob_len);
532
534void sh_paged_close(void);
535
536/* ----- sh_book.c : format-agnostic book backend (rabook + epub) ------------ */
537
547bool sh_book_open(uint16_t idx);
548
558ra8_err_t sh_book_chapter_text(uint32_t chapter, char* out, size_t cap, size_t* out_len);
559
561void sh_book_chapter_label(uint32_t chapter, char* out, size_t cap);
562
564bool sh_book_decode_thumb(uint16_t idx);
565
567void sh_book_cover_fullscreen(int32_t x, int32_t y, int32_t w, int32_t h);
568
570void sh_reader_load_chapter(uint32_t chapter);
571
573uint32_t sh_reader_first_content(void);
574
576void sh_reader_render(void);
577
579bool sh_reader_turn(int32_t dir);
580
598
599/* ----- sh_comic.c : full-page image reader for CBZ / CBR comics (#236) ------ */
600
620bool sh_comic_open(uint16_t idx);
621
623void sh_comic_close(void);
624
626void sh_comic_render(void);
627
644int32_t sh_comic_edge_dir(int32_t x);
645
658bool sh_comic_turn(int32_t dir);
659
672bool sh_comic_tap(int32_t x, bool header);
673
675void sh_comic_toggle_rtl(void);
676
686typedef struct {
687 bool ok;
688 uint32_t pages;
689 int32_t w;
690 int32_t h;
691 uint32_t crc;
693
713void sh_comic_selfcheck(sh_comic_probe_t* cbz, sh_comic_probe_t* cbr, bool* rtl_ok);
714
732void sh_comic_append_banner(char* b,
733 size_t* pos,
734 const sh_comic_probe_t* cbz,
735 const sh_comic_probe_t* cbr,
736 bool rtl_ok);
Flat, execute-in-place container for a build-time "compiled" e-book.
Paged (demand-fetched) accessor mode for book over ra8_vmem (#163).
@generated by tools/epub_compile/src/bake_library.py – do not edit by hand.
ra8_err_codes_t ra8_err_t
Canonical error-return type used by every ra8-firmware API.
Definition ra8_err.h:546
Active display-panel descriptor for the EK-RA8D2 (ER-TFT070-6).
Bounded UI interaction core: hit-testing, screen stack, paging.
Virtual-memory object sources – the page-cache storage seam (Layer 1, #147).
ra8_err_t(* ra8_vsource_read_fn)(void *ctx, uint64_t offset, uint8_t *buf, uint32_t len)
Read len bytes at offset from a paged object's backing.
Definition ra8_vsource.h:79
void sh_book_cover_fullscreen(int32_t x, int32_t y, int32_t w, int32_t h)
Draw the open book's cover full-size, aspect-fit into the box.
Definition sh_book.c:341
int32_t sh_cells(int32_t pixels)
Cells of the 8px bitmap font that fit in pixels.
Definition sh_util.c:28
bool sh_reader_turn(int32_t dir)
Turn the reader page by dir (-1/+1) across chapters; returns changed.
Definition sh_reader.c:254
bool sh_comic_tap(int32_t x, bool header)
Handle a comic-screen tap: header returns to the shelf, else page-turn.
Definition sh_comic.c:285
void sh_decode_cover(uint16_t idx, const book_src_t *src)
Decode the open rabook source's 4bpp cover into thumbnail slot idx.
Definition sh_shelf.c:37
bool sh_paged_open(ra8_vsource_read_fn file_read, void *file_ctx, uint64_t file_len)
Open a chunked .rabook container as the demand-paged book source.
Definition sh_paged.c:223
void sh_comic_render(void)
Render the current comic page full-screen (title bar + fitted image).
Definition sh_comic.c:222
uint32_t sh_reader_first_content(void)
First chapter with substantial prose (skips title/imprint front matter).
Definition sh_reader.c:198
void sh_reader_load_chapter(uint32_t chapter)
Load + wrap a chapter into the reader working set.
Definition sh_reader.c:177
void sh_shelf_build_thumbs(void)
Copy the baked books' pre-decoded covers into sh_state_t::thumb at boot.
Definition sh_shelf.c:62
void sh_toc_scroll(int32_t dir)
Scroll the TOC list by dir pages (-1 up / +1 down), clamped.
Definition sh_toc.c:90
bool sh_paged_open_mram(const uint8_t *blob, uint32_t blob_len)
Open a memory-mapped (baked MRAM) RBKC container as the paged source.
Definition sh_paged.c:267
bool sh_sd_open_epub(const char *name, void *out_book)
Stream-open SD file name as an EPUB via epub_open_streamed_fs.
Definition sh_sd.c:233
ra8_err_t sh_image_blit_cover(const book_src_t *src, uint32_t img_idx, int32_t dst_x, int32_t dst_y, int32_t box_w, int32_t box_h, int32_t *out_w, int32_t *out_h)
Decode + aspect-fit a 4bpp image straight into the framebuffer box.
Definition sh_image.c:228
bool sh_book_open(uint16_t idx)
Open shelf entry idx by its format; sets g_sh.open_fmt + chapter count, and (for SD books on first op...
Definition sh_book.c:431
ra8_err_t sh_image_decode_gray8(const book_src_t *src, uint32_t img_idx, uint8_t *out, int32_t box_w, int32_t box_h, int32_t *out_w, int32_t *out_h)
Decode a 4bpp grayscale image, aspect-fit-scale it into box, and write the result into a gray8 buffer...
Definition sh_image.c:174
void sh_border(ra8_ui_rect_t r, uint32_t colour, int32_t width)
Draw a width-thick rectangle outline in colour.
Definition sh_util.c:69
int32_t sh_shelf_hit(int32_t x, int32_t y)
Hit-test a shelf tap; returns the book index or -1.
Definition sh_shelf.c:170
void sh_book_chapter_label(uint32_t chapter, char *out, size_t cap)
Resolve a chapter's TOC label (or "Chapter N") into out.
Definition sh_book.c:536
void sh_comic_selfcheck(sh_comic_probe_t *cbz, sh_comic_probe_t *cbr, bool *rtl_ok)
Headless boot self-check: decode the baked CBZ + CBR page 0, verify RTL.
Definition sh_comic.c:335
bool sh_comic_turn(int32_t dir)
Turn the comic page by dir in reading order, clamped to the ends.
Definition sh_comic.c:268
sh_screen_t
The active screen in sh_state_t.
Definition sh_app.h:115
@ k_sh_screen_shelf
Book grid with cover thumbnails.
Definition sh_app.h:116
@ k_sh_screen_comic
Full-page image reader (CBZ / CBR).
Definition sh_app.h:120
@ k_sh_screen_reader
Reading a book.
Definition sh_app.h:119
@ k_sh_screen_cover
One book's cover / title page.
Definition sh_app.h:117
@ k_sh_screen_toc
Chapter list.
Definition sh_app.h:118
void sh_sd_scan(void)
Append every root *.RBK file on the card as an SD shelf entry.
Definition sh_sd.c:143
bool sh_sd_book_open(const char *name, uint32_t *out_len)
Open SD file name and hold it as the paged book backing.
Definition sh_sd.c:150
bool sh_book_decode_thumb(uint16_t idx)
Decode the open book's cover into thumbnail slot idx; returns ok.
Definition sh_book.c:328
void sh_titlebar(const char *title, const char *right)
Fill the header bar and draw title left + optional right text.
Definition sh_util.c:76
sh_loupe_const_t
Press-and-hold magnifier-loupe geometry + gesture threshold (#211).
Definition sh_app.h:84
@ k_sh_loupe_w
Lens window width in framebuffer pixels.
Definition sh_app.h:85
@ k_sh_loupe_zoom
Integer magnification of the sampled window.
Definition sh_app.h:87
@ k_sh_loupe_h
Lens window height in framebuffer pixels.
Definition sh_app.h:86
@ k_sh_loupe_border
Lens chrome (frame) thickness in pixels.
Definition sh_app.h:88
@ k_sh_loupe_hold_ms
Press-hold duration that opens the lens (ms).
Definition sh_app.h:89
size_t sh_sd_comic_read(void *ctx, uint64_t offset, void *buf, size_t len)
comic_read_fn over the held-open SD book file (seek + clamped read).
Definition sh_sd.c:203
ra8_err_t sh_book_chapter_text(uint32_t chapter, char *out, size_t cap, size_t *out_len)
Extract one chapter's plain text from the open book (either backend).
Definition sh_book.c:480
ra8_err_t sh_inflate(const void *src, size_t src_len, void *dst, size_t dst_cap, size_t *out_len)
Heap-free zlib inflater matching book_inflate_fn (miniz; main.c).
Definition main.c:160
void sh_comic_close(void)
Close any open comic and release its backing (idempotent).
Definition sh_comic.c:205
bool sh_image_loupe_map(const book_src_t *src, uint32_t img_idx, int32_t box_x, int32_t box_y, int32_t box_w, int32_t box_h, int32_t px, int32_t py, int32_t *out_cx, int32_t *out_cy)
Map a framebuffer touch point over an aspect-fit image box to full-resolution source coordinates (lou...
Definition sh_image.c:305
sh_const_t
Panel geometry, layout, font, and reader sizing constants.
Definition sh_app.h:45
@ k_sh_title_cap
Entry title buffer bytes.
Definition sh_app.h:65
@ k_sh_text_cap
Per-chapter plain-text buffer bytes.
Definition sh_app.h:60
@ k_sh_uart_baud
Console baud.
Definition sh_app.h:68
@ k_sh_gap
Gap between shelf cards.
Definition sh_app.h:53
@ k_sh_thumb_h
Shelf cover-thumbnail box height.
Definition sh_app.h:56
@ k_sh_line_h
Reader text line height.
Definition sh_app.h:50
@ k_sh_glyph_h
Bitmap font cell height.
Definition sh_app.h:49
@ k_sh_fb_h
Panel height in pixels.
Definition sh_app.h:47
@ k_sh_poll_ms
Input poll period in ms.
Definition sh_app.h:70
@ k_sh_glyph_w
Bitmap font cell width.
Definition sh_app.h:48
@ k_sh_pad
Outer margin / content inset.
Definition sh_app.h:52
@ k_sh_thumb_bytes
gray8 bytes per cached thumbnail.
Definition sh_app.h:63
@ k_sh_name_cap
SD file-name buffer bytes (VFAT long).
Definition sh_app.h:64
@ k_sh_thumb_w
Shelf cover-thumbnail box width.
Definition sh_app.h:55
@ k_sh_bar_h
Header / title-bar height.
Definition sh_app.h:51
@ k_sh_linebuf
Per-line draw buffer bytes.
Definition sh_app.h:59
@ k_sh_toc_row_h
TOC list row height.
Definition sh_app.h:58
@ k_sh_poll_pts
Touch points polled per read.
Definition sh_app.h:69
@ k_sh_uart_chan
SCI8 J-Link OB console channel.
Definition sh_app.h:67
@ k_sh_max_lines
Max wrapped reader lines per chapter.
Definition sh_app.h:61
@ k_sh_fb_w
Panel width in pixels.
Definition sh_app.h:46
@ k_sh_dec_base
Decimal formatting base.
Definition sh_app.h:71
@ k_sh_grid_cols
Shelf grid columns.
Definition sh_app.h:57
@ k_sh_author_cap
Entry author buffer bytes.
Definition sh_app.h:66
@ k_sh_card_pad
Inner card inset.
Definition sh_app.h:54
@ k_sh_max_books
Shelf / thumbnail-cache capacity.
Definition sh_app.h:62
void sh_cover_loupe_render(void)
Draw the magnifier loupe over the cover at the current pan centre.
Definition sh_cover.c:124
ra8_err_t sh_image_loupe(const book_src_t *src, uint32_t img_idx, int32_t src_cx, int32_t src_cy, int32_t dst_x, int32_t dst_y)
Draw the magnifier loupe: a k_sh_loupe_zoom-magnified 1:1 window of a full-resolution 4bpp source ima...
Definition sh_image.c:273
sh_cover_act_t
Result of a tap on the cover screen.
Definition sh_app.h:446
@ k_sh_cover_read
Open the reader at chapter 0.
Definition sh_app.h:448
@ k_sh_cover_none
Tap hit nothing actionable.
Definition sh_app.h:447
@ k_sh_cover_toc
Open the table of contents.
Definition sh_app.h:449
void sh_sd_close_epub(void *book)
Close a streamed EPUB opened by sh_sd_open_epub and its source file.
Definition sh_sd.c:244
void sh_toc_render(void)
Render the open book's chapter list (TOC).
Definition sh_toc.c:42
void sh_comic_toggle_rtl(void)
Flip the comic reading direction (LTR <-> RTL); page index unchanged.
Definition sh_comic.c:301
bool sh_cover_loupe_map(int32_t px, int32_t py, int32_t *out_cx, int32_t *out_cy)
Map a cover-screen touch to full-res source coordinates for the loupe.
Definition sh_cover.c:103
void sh_reader_render(void)
Render the current reader page.
Definition sh_reader.c:210
int32_t sh_comic_edge_dir(int32_t x)
Map a comic-screen edge tap to a reading-order page delta (RTL-aware).
Definition sh_comic.c:255
void sh_image_blit_gray8(const uint8_t *src, int32_t w, int32_t h, int32_t dst_x, int32_t dst_y)
Blit a gray8 bitmap to the bound framebuffer at dst_x, dst_y.
Definition sh_image.c:208
void sh_comic_append_banner(char *b, size_t *pos, const sh_comic_probe_t *cbz, const sh_comic_probe_t *cbr, bool rtl_ok)
Append " cbz=P:WxH:CRC cbr=P:WxH:CRC rtl=OK" to the boot banner buffer.
Definition sh_comic.c:359
void sh_reader_prefetch_adjacent(void)
Read-ahead warm the adjacent chapters into the page cache (#207).
Definition sh_reader.c:282
size_t sh_fmt_uint(char *dst, size_t pos, uint32_t v)
Append unsigned v as decimal into dst at pos; returns new pos.
Definition sh_util.c:52
bool sh_sd_mount(void)
Bring up the Pmod2 microSD over ra8_sdmmc_spi and mount its FAT volume.
Definition sh_sd.c:97
void sh_sd_book_close(void)
Close the held SD book file (idempotent).
Definition sh_sd.c:225
void sh_shelf_render(void)
Render the shelf grid (cover cards) into the framebuffer.
Definition sh_shelf.c:160
sh_state_t g_sh
The single whole-app state instance (defined in main.c).
Definition main.c:64
uint16_t * sh_fb_pixels(void)
The live RGB565 framebuffer ra8_gfx scans (defined in main.c).
Definition main.c:180
ra8_err_t sh_sd_book_read(void *ctx, uint64_t offset, uint8_t *buf, uint32_t len)
ra8_vsource_read_fn over the held-open SD book file (seek + read).
Definition sh_sd.c:176
void sh_fit(char *dst, size_t cap, const char *src, int32_t max_chars)
Copy src into dst (cap bytes), truncating past max_chars with "..".
Definition sh_util.c:33
sh_cover_act_t sh_cover_action(int32_t x, int32_t y)
Classify a cover-screen tap into a sh_cover_act_t.
Definition sh_cover.c:91
int32_t sh_toc_hit(int32_t x, int32_t y)
Hit-test a TOC tap; returns the chapter index or -1.
Definition sh_toc.c:79
void sh_paged_close(void)
Unbind the paged book source and release its SD backing (idempotent).
Definition sh_paged.c:279
sh_color_t
0x00RRGGBB palette shared by every screen.
Definition sh_app.h:97
@ k_sh_col_edge
Card / image border.
Definition sh_app.h:104
@ k_sh_col_barfg
Text on the bar.
Definition sh_app.h:106
@ k_sh_col_card_hi
Selected card fill.
Definition sh_app.h:101
@ k_sh_col_bg
App background (dark wood).
Definition sh_app.h:98
@ k_sh_col_ink
Body ink.
Definition sh_app.h:102
@ k_sh_col_rowhi
TOC selected-row fill.
Definition sh_app.h:107
@ k_sh_col_card
Card / page fill (paper).
Definition sh_app.h:100
@ k_sh_col_sub
Secondary ink (author / hints).
Definition sh_app.h:103
@ k_sh_col_sel
Selection accent (amber).
Definition sh_app.h:105
@ k_sh_col_bar
Header / title-bar fill.
Definition sh_app.h:99
void sh_cover_render(void)
Render the selected book's cover / title page.
Definition sh_cover.c:51
bool sh_comic_open(uint16_t idx)
Open shelf entry idx as a comic archive (CBZ / CBR) for page reading.
Definition sh_comic.c:174
Book-format classification by file extension (long-name aware, #633).
sh_book_fmt_t
Book container format behind a shelf entry / the open book.
Definition sh_classify.h:37
A book data source: resident (zero-copy) or paged (demand-fetched).
Definition book_paged.h:69
Axis-aligned rectangle in framebuffer pixel coordinates.
Definition ra8_ui.h:72
One container's headless self-check result (page 0 decode digest).
Definition sh_app.h:686
uint32_t pages
Page count parsed from the archive.
Definition sh_app.h:688
bool ok
true if page 0 opened + decoded successfully.
Definition sh_app.h:687
int32_t w
Blitted (fitted) page width in pixels.
Definition sh_app.h:689
int32_t h
Blitted (fitted) page height in pixels.
Definition sh_app.h:690
uint32_t crc
FNV-1a-32 over the decoded scratch framebuffer.
Definition sh_app.h:691
One shelf book, sourced from MRAM (baked) or the SD card, in either the .rabook or ....
Definition sh_app.h:141
bool from_sd
true: read sd_name from SD; false: use blob.
Definition sh_app.h:142
const uint8_t * blob
Baked RBKC bytes (MRAM), or NULL when SD.
Definition sh_app.h:144
uint16_t thumb_w
Pre-baked thumbnail width.
Definition sh_app.h:147
uint16_t thumb_h
Pre-baked thumbnail height.
Definition sh_app.h:148
const uint8_t * thumb
Pre-baked gray8 cover thumbnail, or NULL.
Definition sh_app.h:146
uint32_t blob_len
Baked length, or SD file size in bytes.
Definition sh_app.h:145
char sd_name[k_sh_name_cap]
SD file name, e.g.
Definition sh_app.h:149
sh_book_fmt_t fmt
Container format (rabook / epub).
Definition sh_app.h:143
char title[k_sh_title_cap]
Display title.
Definition sh_app.h:150
char author[k_sh_author_cap]
Display author.
Definition sh_app.h:151
One wrapped reader line: a byte slice of sh_state_t::text.
Definition sh_app.h:128
uint16_t len
Length in bytes.
Definition sh_app.h:130
uint32_t off
Start offset into the chapter text buffer.
Definition sh_app.h:129
Whole-app UI + reader state (single instance g_sh).
Definition sh_app.h:165
uint16_t thumb_h[k_sh_max_books]
Drawn thumbnail height.
Definition sh_app.h:199
uint32_t line_count
Wrapped lines in the chapter.
Definition sh_app.h:192
uint16_t thumb_w[k_sh_max_books]
Drawn thumbnail width.
Definition sh_app.h:198
int32_t toc_scroll
TOC: first visible row index.
Definition sh_app.h:178
uint16_t book_count
Shelf entries in use (baked + SD).
Definition sh_app.h:168
uint32_t comic_count
Comic reader: open comic page count (0 = none).
Definition sh_app.h:181
uint32_t touch_down_ms
ra8_time_ms() timestamp at the current press start.
Definition sh_app.h:187
book_src_t book_src
Paged source over the open rabook.
Definition sh_app.h:173
size_t text_len
Bytes of valid chapter text.
Definition sh_app.h:191
bool sd_ready
true once an SD volume mounted.
Definition sh_app.h:169
uint32_t page
Reader: current page within the chapter.
Definition sh_app.h:176
bool comic_rtl
Comic reader: right-to-left (manga) reading order.
Definition sh_app.h:182
uint32_t chapter
Reader: current chapter index.
Definition sh_app.h:174
int32_t touch_down_y
Press-start Y in framebuffer pixels.
Definition sh_app.h:189
sh_entry_t entry[k_sh_max_books]
Unified baked+SD book table.
Definition sh_app.h:170
ra8_ui_rect_t card_rect[k_sh_max_books]
Cached shelf card rects.
Definition sh_app.h:196
sh_screen_t screen
Active screen.
Definition sh_app.h:166
int32_t loupe_cy
Loupe pan centre Y in full-res source pixels.
Definition sh_app.h:186
uint8_t thumb[k_sh_max_books][k_sh_thumb_bytes]
gray8 covers.
Definition sh_app.h:197
sh_line_t lines[k_sh_max_lines]
Wrapped line slices.
Definition sh_app.h:194
int32_t loupe_cx
Loupe pan centre X in full-res source pixels.
Definition sh_app.h:185
uint16_t selected
Highlighted shelf book index.
Definition sh_app.h:167
uint32_t chap_pages
Reader: pages in the current chapter.
Definition sh_app.h:177
uint32_t chapter_count
Open book chapter count.
Definition sh_app.h:175
bool loupe_active
Press-hold magnifier loupe currently open (#211).
Definition sh_app.h:184
uint32_t comic_page
Comic reader: current page index (0-based).
Definition sh_app.h:180
sh_book_fmt_t open_fmt
Format of the currently open book.
Definition sh_app.h:172
int32_t touch_down_x
Press-start X in framebuffer pixels.
Definition sh_app.h:188
char text[k_sh_text_cap]
Current chapter plain text.
Definition sh_app.h:193