ra8-firmware 0.1.0
Bare-metal firmware for the Renesas RA8 family (RA8D2 / RA8P1)
Loading...
Searching...
No Matches
sh_state_t Struct Reference

Whole-app UI + reader state (single instance g_sh). More...

#include <sh_app.h>

Collaboration diagram for sh_state_t:

Data Fields

sh_screen_t screen
 Active screen.
uint16_t selected
 Highlighted shelf book index.
uint16_t book_count
 Shelf entries in use (baked + SD).
bool sd_ready
 true once an SD volume mounted.
sh_entry_t entry [k_sh_max_books]
 Unified baked+SD book table.
sh_book_fmt_t open_fmt
 Format of the currently open book.
book_src_t book_src
 Paged source over the open rabook.
uint32_t chapter
 Reader: current chapter index.
uint32_t chapter_count
 Open book chapter count.
uint32_t page
 Reader: current page within the chapter.
uint32_t chap_pages
 Reader: pages in the current chapter.
int32_t toc_scroll
 TOC: first visible row index.
uint32_t comic_page
 Comic reader: current page index (0-based).
uint32_t comic_count
 Comic reader: open comic page count (0 = none).
bool comic_rtl
 Comic reader: right-to-left (manga) reading order.
bool loupe_active
 Press-hold magnifier loupe currently open (#211).
int32_t loupe_cx
 Loupe pan centre X in full-res source pixels.
int32_t loupe_cy
 Loupe pan centre Y in full-res source pixels.
uint32_t touch_down_ms
 ra8_time_ms() timestamp at the current press start.
int32_t touch_down_x
 Press-start X in framebuffer pixels.
int32_t touch_down_y
 Press-start Y in framebuffer pixels.
size_t text_len
 Bytes of valid chapter text.
uint32_t line_count
 Wrapped lines in the chapter.
char text [k_sh_text_cap]
 Current chapter plain text.
sh_line_t lines [k_sh_max_lines]
 Wrapped line slices.
ra8_ui_rect_t card_rect [k_sh_max_books]
 Cached shelf card rects.
uint8_t thumb [k_sh_max_books][k_sh_thumb_bytes]
 gray8 covers.
uint16_t thumb_w [k_sh_max_books]
 Drawn thumbnail width.
uint16_t thumb_h [k_sh_max_books]
 Drawn thumbnail height.

Detailed Description

Whole-app UI + reader state (single instance g_sh).

Holds the active screen, the shelf selection + per-book cover thumbnail cache, the currently open (demand-paged) book, and the reader's chapter/page pagination working set.

Invariant
screen is one of sh_screen_t.
When a rabook is open, book_src.vm != nullptr (paged bind via sh_paged.c); when none is, book_src is all-zero.
Since
0.1.0

Definition at line 165 of file sh_app.h.

Field Documentation

◆ book_count

uint16_t sh_state_t::book_count

Shelf entries in use (baked + SD).

Definition at line 168 of file sh_app.h.

◆ book_src

book_src_t sh_state_t::book_src

Paged source over the open rabook.

Definition at line 173 of file sh_app.h.

◆ card_rect

ra8_ui_rect_t sh_state_t::card_rect[k_sh_max_books]

Cached shelf card rects.

Definition at line 196 of file sh_app.h.

◆ chap_pages

uint32_t sh_state_t::chap_pages

Reader: pages in the current chapter.

Definition at line 177 of file sh_app.h.

◆ chapter

uint32_t sh_state_t::chapter

Reader: current chapter index.

Definition at line 174 of file sh_app.h.

◆ chapter_count

uint32_t sh_state_t::chapter_count

Open book chapter count.

Definition at line 175 of file sh_app.h.

◆ comic_count

uint32_t sh_state_t::comic_count

Comic reader: open comic page count (0 = none).

Definition at line 181 of file sh_app.h.

◆ comic_page

uint32_t sh_state_t::comic_page

Comic reader: current page index (0-based).

Definition at line 180 of file sh_app.h.

◆ comic_rtl

bool sh_state_t::comic_rtl

Comic reader: right-to-left (manga) reading order.

Definition at line 182 of file sh_app.h.

◆ entry

sh_entry_t sh_state_t::entry[k_sh_max_books]

Unified baked+SD book table.

Definition at line 170 of file sh_app.h.

◆ line_count

uint32_t sh_state_t::line_count

Wrapped lines in the chapter.

Definition at line 192 of file sh_app.h.

◆ lines

sh_line_t sh_state_t::lines[k_sh_max_lines]

Wrapped line slices.

Definition at line 194 of file sh_app.h.

◆ loupe_active

bool sh_state_t::loupe_active

Press-hold magnifier loupe currently open (#211).

Definition at line 184 of file sh_app.h.

◆ loupe_cx

int32_t sh_state_t::loupe_cx

Loupe pan centre X in full-res source pixels.

Definition at line 185 of file sh_app.h.

◆ loupe_cy

int32_t sh_state_t::loupe_cy

Loupe pan centre Y in full-res source pixels.

Definition at line 186 of file sh_app.h.

◆ open_fmt

sh_book_fmt_t sh_state_t::open_fmt

Format of the currently open book.

Definition at line 172 of file sh_app.h.

◆ page

uint32_t sh_state_t::page

Reader: current page within the chapter.

Definition at line 176 of file sh_app.h.

◆ screen

sh_screen_t sh_state_t::screen

Active screen.

Definition at line 166 of file sh_app.h.

◆ sd_ready

bool sh_state_t::sd_ready

true once an SD volume mounted.

Definition at line 169 of file sh_app.h.

◆ selected

uint16_t sh_state_t::selected

Highlighted shelf book index.

Definition at line 167 of file sh_app.h.

◆ text

char sh_state_t::text[k_sh_text_cap]

Current chapter plain text.

Definition at line 193 of file sh_app.h.

◆ text_len

size_t sh_state_t::text_len

Bytes of valid chapter text.

Definition at line 191 of file sh_app.h.

◆ thumb

uint8_t sh_state_t::thumb[k_sh_max_books][k_sh_thumb_bytes]

gray8 covers.

Definition at line 197 of file sh_app.h.

◆ thumb_h

uint16_t sh_state_t::thumb_h[k_sh_max_books]

Drawn thumbnail height.

Definition at line 199 of file sh_app.h.

◆ thumb_w

uint16_t sh_state_t::thumb_w[k_sh_max_books]

Drawn thumbnail width.

Definition at line 198 of file sh_app.h.

◆ toc_scroll

int32_t sh_state_t::toc_scroll

TOC: first visible row index.

Definition at line 178 of file sh_app.h.

◆ touch_down_ms

uint32_t sh_state_t::touch_down_ms

ra8_time_ms() timestamp at the current press start.

Definition at line 187 of file sh_app.h.

◆ touch_down_x

int32_t sh_state_t::touch_down_x

Press-start X in framebuffer pixels.

Definition at line 188 of file sh_app.h.

◆ touch_down_y

int32_t sh_state_t::touch_down_y

Press-start Y in framebuffer pixels.

Definition at line 189 of file sh_app.h.


The documentation for this struct was generated from the following file:
  • examples/ek_ra8d2/hil_needs_revalidation/ereader_shelf/inc/sh_app.h