|
ra8-firmware 0.1.0
Bare-metal firmware for the Renesas RA8 family (RA8D2 / RA8P1)
|
Cover / title page for the open book. More...
Go to the source code of this file.
Enumerations | |
| enum | sh_cover_layout_t : int32_t { k_sh_cv_box_x = 32 , k_sh_cv_box_y = 80 , k_sh_cv_box_w = 340 , k_sh_cv_box_h = 490 , k_sh_cv_panel_x = 420 , k_sh_cv_title_y = 110 , k_sh_cv_auth_y = 150 , k_sh_cv_btn_w = 360 , k_sh_cv_btn_h = 52 , k_sh_cv_read_y = 250 , k_sh_cv_toc_y = 326 , k_sh_cv_btn_pad = 16 } |
| Cover-page geometry (framebuffer pixels). More... | |
Functions | |
| static void | sh_cover_button (int32_t y, const char *label) |
| Draw a filled action button with a left-inset label. | |
| void | sh_cover_render (void) |
| Render the selected book's cover / title page. | |
| static bool | sh_in_rect (int32_t x, int32_t y, int32_t rx, int32_t ry, int32_t rw, int32_t rh) |
| Inclusive-left / exclusive-right point-in-rect test. | |
| sh_cover_act_t | sh_cover_action (int32_t x, int32_t y) |
| Classify a cover-screen tap into a sh_cover_act_t. | |
| 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. | |
| void | sh_cover_loupe_render (void) |
| Draw the magnifier loupe over the cover at the current pan centre. | |
Cover / title page for the open book.
Renders the open book's full cover (decoded straight from its 4bpp image pool) on the left, with the title, author, and two action buttons – "Read this book" and "Table of Contents" – on the right. Tapping the cover or the read button starts the reader; the contents button opens the TOC.
[Ring 6 / App] {World: NS}
Definition in file sh_cover.c.
| enum sh_cover_layout_t : int32_t |
Cover-page geometry (framebuffer pixels).
Definition at line 23 of file sh_cover.c.
| 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 at line 91 of file sh_cover.c.
References k_sh_cover_none, k_sh_cover_read, k_sh_cover_toc, k_sh_cv_box_h, k_sh_cv_box_w, k_sh_cv_box_x, k_sh_cv_box_y, k_sh_cv_btn_h, k_sh_cv_btn_w, k_sh_cv_panel_x, k_sh_cv_read_y, k_sh_cv_toc_y, and sh_in_rect().
Referenced by sh_tap_cover().
|
static |
Draw a filled action button with a left-inset label.
Definition at line 39 of file sh_cover.c.
References k_sh_col_bar, k_sh_col_barfg, k_sh_cv_btn_h, k_sh_cv_btn_pad, k_sh_cv_btn_w, k_sh_cv_panel_x, k_sh_glyph_h, ra8_gfx_font_8x16, ra8_gfx_rect(), and ra8_gfx_text_out().
Referenced by sh_cover_render().
| 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.
Only rabook covers with a real 4bpp cover image are magnifiable; EPUB covers (decoded JPEG/PNG) and cover-less books return false.
| [in] | px | Touch X in framebuffer pixels. |
| [in] | py | Touch Y in framebuffer pixels. |
| [out] | out_cx | Receives the source-image X the point maps to. |
| [out] | out_cy | Receives the source-image Y the point maps to. |
Definition at line 103 of file sh_cover.c.
References g_sh, k_book_nil, k_sh_cv_box_h, k_sh_cv_box_w, k_sh_cv_box_x, k_sh_cv_box_y, k_sh_fmt_rabook, and sh_image_loupe_map().
Referenced by sh_loupe_held().
| void sh_cover_loupe_render | ( | void | ) |
Draw the magnifier loupe over the cover at the current pan centre.
Definition at line 124 of file sh_cover.c.
References g_sh, k_book_nil, k_sh_fb_h, k_sh_fb_w, k_sh_fmt_rabook, k_sh_loupe_h, k_sh_loupe_w, and sh_image_loupe().
Referenced by sh_present(), and sh_present_loupe().
| void sh_cover_render | ( | void | ) |
Render the selected book's cover / title page.
Definition at line 51 of file sh_cover.c.
References sh_entry_t::author, sh_entry_t::from_sd, g_sh, k_sh_col_bg, k_sh_col_card, k_sh_col_sub, k_sh_cv_auth_y, k_sh_cv_box_h, k_sh_cv_box_w, k_sh_cv_box_x, k_sh_cv_box_y, k_sh_cv_panel_x, k_sh_cv_read_y, k_sh_cv_title_y, k_sh_cv_toc_y, k_sh_fb_w, k_sh_glyph_h, k_sh_linebuf, k_sh_pad, ra8_gfx_clear(), ra8_gfx_font_8x16, ra8_gfx_text_out(), sh_book_cover_fullscreen(), sh_cells(), sh_cover_button(), sh_fit(), sh_titlebar(), and sh_entry_t::title.
Referenced by sh_present().
|
static |
Inclusive-left / exclusive-right point-in-rect test.
Definition at line 86 of file sh_cover.c.
Referenced by sh_cover_action().