|
ra8-firmware 0.1.0
Bare-metal firmware for the Renesas RA8 family (RA8D2 / RA8P1)
|
Reflowed-reading-body leaf widget for the ra8_widget tree (#145 Phase 2). More...
Go to the source code of this file.
Data Structures | |
| struct | ra8_widget_reflow_ops |
| struct | ra8_widget_reflow_view |
Typedefs | |
| typedef struct ra8_widget_reflow_ops | ra8_widget_reflow_ops_t |
| typedef struct ra8_widget_reflow_view | ra8_widget_reflow_view_t |
Functions | |
| const ra8_widget_vtable_t * | ra8_widget_reflow_view_vtable (void) |
| Return the shared vtable backing every reflow-view widget. | |
| ra8_err_t | ra8_widget_reflow_view_init (ra8_widget_t *w, ra8_widget_reflow_view_t *view) |
| Bind a widget instance to a reflow view. | |
Reflowed-reading-body leaf widget for the ra8_widget tree (#145 Phase 2).
The e-reader Reading screen's body is a paginated block of reflowed text drawn by ra8_reflow, with page turns on a left / right tap and <a href> links that jump pages. ra8_widget_reflow_view_t wraps that as a reusable ra8_widget leaf that owns the view state (current page, page count, body margins) and the tap routing (link-follow, then page-turn with boundary clamping), while the ra8_reflow engine itself is reached through an injected ra8_widget_reflow_ops_t seam.
That seam is what keeps this widget – and the whole ra8_widget library – free of ra8_reflow (which pulls in ra8_gfx, stb, and the glyph atlas): the app binds render_page to ra8_reflow_render_page_at and follow_link to ra8_reflow_hit_test_link + href navigation, so the pixel-touching and engine-specific work lives on-target in the app, and the pure page-state / routing logic is host-testable with a recording mock seam.
[Ring 5 / UI] {World: NS}
Definition in file ra8_widget_reflow_view.h.
| typedef struct ra8_widget_reflow_ops ra8_widget_reflow_ops_t |
| typedef struct ra8_widget_reflow_view ra8_widget_reflow_view_t |
|
nodiscard |
Bind a widget instance to a reflow view.
Wires w to render + route view: sets its vtable to ra8_widget_reflow_view_vtable, points its ctx at view, 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 reflow view (non-NULL). |
| [in] | view | Reflow-view descriptor (non-NULL; outlives w's use). |
| k_ra8_ok | Bound; w renders + routes view. |
| k_ra8_err_null_ptr | w or view is NULL. |
w and view are non-NULL. view outlives every render / dispatch of w. w is left unchanged.Definition at line 253 of file ra8_widget_reflow_view.c.
References k_ra8_ok, RA8_CHECK_NULL_PTR, ra8_widget_reflow_view_vtable(), and s_tag.
| const ra8_widget_vtable_t * ra8_widget_reflow_view_vtable | ( | void | ) |
Return the shared vtable backing every reflow-view widget.
One immutable vtable serves all reflow views: render clears the body and asks the seam to paint the current page; on_input follows a link or turns the page; measure is NULL. ra8_widget_reflow_view_init binds it.
Definition at line 248 of file ra8_widget_reflow_view.c.
References s_rv_vt.
Referenced by ra8_widget_reflow_view_init().