|
ra8-firmware 0.1.0
Bare-metal firmware for the Renesas RA8 family (RA8D2 / RA8P1)
|
Book-card + book-grid leaf widget for the ra8_widget tree (#145 Phase 2). More...
Go to the source code of this file.
Data Structures | |
| struct | ra8_widget_book |
| struct | ra8_widget_book_grid |
Typedefs | |
| typedef struct ra8_widget_book | ra8_widget_book_t |
| typedef struct ra8_widget_book_grid | ra8_widget_book_grid_t |
Functions | |
| const ra8_widget_vtable_t * | ra8_widget_book_grid_vtable (void) |
| Return the shared vtable backing every book-grid widget. | |
| ra8_err_t | ra8_widget_book_grid_init (ra8_widget_t *w, ra8_widget_book_grid_t *grid) |
| Bind a widget instance to a book grid. | |
Book-card + book-grid leaf widget for the ra8_widget tree (#145 Phase 2).
The e-reader Library screen is a grid of book cards: each card is a cover swatch above a title, an author line, and a read-progress bar, and tapping a card opens the book. ra8_widget_book_grid_t extracts that whole grid into one reusable ra8_widget leaf, driven by an array of ra8_widget_book_t records. render fills the grid background, tiles the cards into an N-column grid, and paints each card (cover / title / author / progress) through the injected ra8_widget_paint_t backend, so the widget carries no ra8_gfx dependency. on_input maps a touch to the card it lands on, records it in selected, and fires the optional on_open callback.
[Ring 5 / UI] {World: NS}
Definition in file ra8_widget_book.h.
| typedef struct ra8_widget_book_grid ra8_widget_book_grid_t |
| typedef struct ra8_widget_book ra8_widget_book_t |
|
nodiscard |
Bind a widget instance to a book grid.
Wires w to render + route grid: sets its vtable to ra8_widget_book_grid_vtable, points its ctx at grid, and makes it visible. The caller still sets w's fixed / flex for its parent's layout.
| [in,out] | w | Widget to turn into a book grid (non-NULL). |
| [in] | grid | Book-grid descriptor (non-NULL; outlives w's use). |
| k_ra8_ok | Bound; w renders + routes grid. |
| k_ra8_err_null_ptr | w or grid is NULL. |
w and grid are non-NULL. grid outlives every render / dispatch of w. w is left unchanged.Definition at line 317 of file ra8_widget_book.c.
References k_ra8_ok, RA8_CHECK_NULL_PTR, ra8_widget_book_grid_vtable(), and s_tag.
| const ra8_widget_vtable_t * ra8_widget_book_grid_vtable | ( | void | ) |
Return the shared vtable backing every book-grid widget.
One immutable vtable serves all book grids: render fills the background and tiles + paints every card through the grid's ra8_widget_paint_t; on_input maps a touch to a card and fires on_open; measure is NULL. ra8_widget_book_grid_init binds it.
Definition at line 312 of file ra8_widget_book.c.
References s_bg_vt.
Referenced by ra8_widget_book_grid_init(), and wd_build_tree().