|
ra8-firmware 0.1.0
Bare-metal firmware for the Renesas RA8 family (RA8D2 / RA8P1)
|
On-screen-keyboard leaf widget for the ra8_widget tree (#145 Phase 2). More...
Go to the source code of this file.
Data Structures | |
| struct | ra8_widget_key_info |
| struct | ra8_widget_keyboard_ops |
| struct | ra8_widget_keyboard |
Typedefs | |
| typedef struct ra8_widget_key_info | ra8_widget_key_info_t |
| typedef struct ra8_widget_keyboard_ops | ra8_widget_keyboard_ops_t |
| typedef struct ra8_widget_keyboard | ra8_widget_keyboard_t |
Enumerations | |
| enum | ra8_widget_key_sentinel_t : uint8_t { k_ra8_widget_key_no_hit = 255U } |
| Sentinel returned by ra8_widget_keyboard_ops_t::hit for "no key". More... | |
Functions | |
| const ra8_widget_vtable_t * | ra8_widget_keyboard_vtable (void) |
| Return the shared vtable backing every on-screen-keyboard widget. | |
| ra8_err_t | ra8_widget_keyboard_init (ra8_widget_t *w, ra8_widget_keyboard_t *kbd) |
| Bind a widget instance to an on-screen keyboard. | |
On-screen-keyboard leaf widget for the ra8_widget tree (#145 Phase 2).
The e-reader search field opens the on-screen keyboard modelled by ra8_keyboard (a pure key grid + hit-test + text buffer). ra8_widget_keyboard_t wraps that as a reusable ra8_widget leaf: it draws each key (a bordered face plus its current-case glyph or a special-key label) through the injected ra8_widget_paint_t backend, and routes a tap to a key, applies it, and fires an on_commit callback when the query is committed (RETURN).
The ra8_keyboard engine is reached through an injected ra8_widget_keyboard_ops_t seam (count / key_info / hit / apply), so this widget – and the whole ra8_widget library – never links ra8_keyboard directly. The app binds the seam to ra8_kbd_hit / ra8_kbd_apply / ra8_kbd_key_glyph, keeping the key-drawing + routing logic host-testable with a recording mock seam while the layout logic stays in ra8_keyboard.
[Ring 5 / UI] {World: NS}
Definition in file ra8_widget_keyboard.h.
| typedef struct ra8_widget_key_info ra8_widget_key_info_t |
| typedef struct ra8_widget_keyboard_ops ra8_widget_keyboard_ops_t |
| typedef struct ra8_widget_keyboard ra8_widget_keyboard_t |
| enum ra8_widget_key_sentinel_t : uint8_t |
Sentinel returned by ra8_widget_keyboard_ops_t::hit for "no key".
| Enumerator | |
|---|---|
| k_ra8_widget_key_no_hit | The tap hit no key (a gap / off-grid). |
Definition at line 46 of file ra8_widget_keyboard.h.
|
nodiscard |
Bind a widget instance to an on-screen keyboard.
Wires w to render + route kbd: sets its vtable to ra8_widget_keyboard_vtable, points its ctx at kbd, 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 keyboard (non-NULL). |
| [in] | kbd | Keyboard descriptor (non-NULL; outlives w's use). |
| k_ra8_ok | Bound; w renders + routes kbd. |
| k_ra8_err_null_ptr | w or kbd is NULL. |
w and kbd are non-NULL. kbd outlives every render / dispatch of w. w is left unchanged.Definition at line 176 of file ra8_widget_keyboard.c.
References k_ra8_ok, RA8_CHECK_NULL_PTR, ra8_widget_keyboard_vtable(), and s_tag.
| const ra8_widget_vtable_t * ra8_widget_keyboard_vtable | ( | void | ) |
Return the shared vtable backing every on-screen-keyboard widget.
One immutable vtable serves all keyboards: render fills the background and draws every key through the keyboard's ra8_widget_paint_t + seam; on_input maps a touch to a key, applies it, and fires on_commit on the commit edge; measure is NULL. ra8_widget_keyboard_init binds it.
Definition at line 171 of file ra8_widget_keyboard.c.
References s_kbd_vt.
Referenced by ra8_widget_keyboard_init().