|
ra8-firmware 0.1.0
Bare-metal firmware for the Renesas RA8 family (RA8D2 / RA8P1)
|
Small shared drawing + formatting helpers for ereader_shelf. More...
Go to the source code of this file.
Enumerations | |
| enum | sh_util_const_t : uint32_t { k_sh_ellipsis_min = 2U } |
| Local layout constants. More... | |
Functions | |
| int32_t | sh_cells (int32_t pixels) |
Cells of the 8px bitmap font that fit in pixels. | |
| 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 "..". | |
| 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. | |
| void | sh_border (ra8_ui_rect_t r, uint32_t colour, int32_t width) |
Draw a width-thick rectangle outline in colour. | |
| void | sh_titlebar (const char *title, const char *right) |
Fill the header bar and draw title left + optional right text. | |
Small shared drawing + formatting helpers for ereader_shelf.
Text/measure/format primitives every screen reuses: bitmap-font cell math, ellipsis truncation, decimal formatting, rectangle outlines, and the common header bar. All drawing goes through ra8_gfx into the bound framebuffer.
[Ring 6 / App] {World: NS}
Definition in file sh_util.c.
| enum sh_util_const_t : uint32_t |
| void sh_border | ( | ra8_ui_rect_t | r, |
| uint32_t | colour, | ||
| int32_t | width ) |
Draw a width-thick rectangle outline in colour.
Definition at line 69 of file sh_util.c.
References ra8_ui_rect_t::h, ra8_gfx_rect(), ra8_ui_rect_t::w, ra8_ui_rect_t::x, and ra8_ui_rect_t::y.
Referenced by sh_draw_card(), and sh_loupe_chrome().
| int32_t sh_cells | ( | int32_t | pixels | ) |
Cells of the 8px bitmap font that fit in pixels.
Definition at line 28 of file sh_util.c.
References k_sh_glyph_w.
Referenced by sh_cover_render(), sh_draw_card(), sh_reader_load_chapter(), and sh_toc_label().
| 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 at line 33 of file sh_util.c.
References k_sh_ellipsis_min, memcpy(), and strlen().
Referenced by sh_cover_render(), sh_draw_card(), and sh_toc_label().
| 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 at line 52 of file sh_util.c.
References k_sh_dec_base.
Referenced by sh_book_chapter_label(), sh_comic_append_banner(), sh_comic_render(), sh_print_banner(), sh_reader_render(), and sh_toc_render().
| void sh_titlebar | ( | const char * | title, |
| const char * | right ) |
Fill the header bar and draw title left + optional right text.
Definition at line 76 of file sh_util.c.
References k_sh_bar_h, k_sh_col_bar, k_sh_col_barfg, k_sh_fb_w, k_sh_glyph_h, k_sh_glyph_w, k_sh_pad, ra8_gfx_font_8x16, ra8_gfx_rect(), ra8_gfx_text_out(), and strlen().
Referenced by sh_comic_render(), sh_cover_render(), sh_reader_render(), sh_shelf_render(), and sh_toc_render().