ra8-firmware 0.1.0
Bare-metal firmware for the Renesas RA8 family (RA8D2 / RA8P1)
Loading...
Searching...
No Matches
ra8_widget_keyboard.h
Go to the documentation of this file.
1
29
30#pragma once
31
32#ifdef __cplusplus
33extern "C" {
34#endif
35
36#include <stdint.h>
37
38#include "ra8_err.h"
39#include "ra8_ui.h"
40#include "ra8_widget.h"
41
46typedef enum : uint8_t {
49
65typedef struct ra8_widget_key_info {
67 const char* label;
68 char glyph;
69 uint8_t pad0;
70 uint16_t pad1;
72
92 void* user;
94 uint8_t (*count)(void* user);
96 void (*key_info)(void* user, uint8_t idx, ra8_widget_key_info_t* out);
98 uint8_t (*hit)(void* user, int32_t x, int32_t y);
100 bool (*apply)(void* user, uint8_t idx);
102
144
166
193
194#ifdef __cplusplus
195}
196#endif
Error Code Definitions for ra8-firmware.
ra8_err_codes_t ra8_err_t
Canonical error-return type used by every ra8-firmware API.
Definition ra8_err.h:546
Bounded UI interaction core: hit-testing, screen stack, paging.
Zero-heap composable widget layer (dwm-style) over ra8_box + ra8_ui.
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.
const ra8_widget_vtable_t * ra8_widget_keyboard_vtable(void)
Return the shared vtable backing every on-screen-keyboard widget.
struct ra8_widget_keyboard_ops ra8_widget_keyboard_ops_t
struct ra8_widget_key_info ra8_widget_key_info_t
ra8_widget_key_sentinel_t
Sentinel returned by ra8_widget_keyboard_ops_t::hit for "no key".
@ k_ra8_widget_key_no_hit
The tap hit no key (a gap / off-grid).
Axis-aligned rectangle in framebuffer pixel coordinates.
Definition ra8_ui.h:72
One key's drawable geometry + glyph, supplied by the keyboard seam.
const char * label
Special-key label (NULL for a character key).
char glyph
Current-case char (0 for a special / no key).
ra8_ui_rect_t rect
Key hit / draw rectangle.
uint16_t pad1
Padding to a 4-byte boundary.
Injected seam driving an ra8_keyboard from the keyboard widget.
bool(* apply)(void *user, uint8_t idx)
Apply key idx; return true iff the query is now committed.
uint8_t(* count)(void *user)
Number of keys in the active layer.
uint8_t(* hit)(void *user, int32_t x, int32_t y)
Map a tap to a key index, or k_ra8_widget_key_no_hit.
void(* key_info)(void *user, uint8_t idx, ra8_widget_key_info_t *out)
Fill out with key idx's rect + glyph / label for drawing.
void * user
Opaque keyboard handle passed back to every callback below.
An on-screen keyboard: key styling + engine seam + commit callback.
uint32_t key_face
Key face fill colour, 0xRRGGBB.
const ra8_widget_paint_t * paint
Draw backend (NULL -> draws nothing).
void(* on_commit)(struct ra8_widget *w)
Commit-edge callback (optional/NULL).
uint16_t reserved
Padding to a 4-byte boundary.
int16_t border_w
Key border thickness, px (>= 0).
uint32_t key_border
Key border colour, 0xRRGGBB.
const ra8_widget_keyboard_ops_t * ops
Keyboard engine seam (NULL -> inert).
uint32_t key_fg
Key glyph / label colour, 0xRRGGBB.
uint32_t bg
Keyboard background colour, 0xRRGGBB.
Drawing backend the concrete leaf widgets paint through (a DI seam).
One widget instance (caller-owned, no allocation).
Behaviour table shared by all widgets of one kind.
Definition ra8_widget.h:121