ra8-firmware 0.1.0
Bare-metal firmware for the Renesas RA8 family (RA8D2 / RA8P1)
Loading...
Searching...
No Matches
ra8_widget_nav_bar.h
Go to the documentation of this file.
1
24
25#pragma once
26
27#ifdef __cplusplus
28extern "C" {
29#endif
30
31#include <stdint.h>
32
33#include "ra8_err.h"
34#include "ra8_widget.h"
35
66typedef struct ra8_widget_nav_bar {
68 const char* const* items;
70 void (*on_select)(struct ra8_widget* w, uint16_t index);
71 uint32_t bg;
72 uint32_t fg_active;
73 uint32_t fg_muted;
74 uint16_t count;
75 uint16_t active;
76 uint16_t selected;
78
100
127
128#ifdef __cplusplus
129}
130#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
Zero-heap composable widget layer (dwm-style) over ra8_box + ra8_ui.
const ra8_widget_vtable_t * ra8_widget_nav_bar_vtable(void)
Return the shared vtable backing every navigation-strip widget.
ra8_err_t ra8_widget_nav_bar_init(ra8_widget_t *w, ra8_widget_nav_bar_t *nav)
Bind a widget instance to a navigation strip.
An equal-cell navigation strip: N labels, one active, each tappable.
uint16_t selected
Last-tapped item index (observable).
uint32_t bg
Strip background colour, 0xRRGGBB.
uint16_t count
Number of items / cells.
uint16_t active
Highlighted item index.
const ra8_widget_paint_t * paint
Draw backend (NULL -> draws nothing).
const char *const * items
Array of count label strings.
uint32_t fg_active
Active-item text colour, 0xRRGGBB.
uint32_t fg_muted
Inactive-item text colour, 0xRRGGBB.
void(* on_select)(struct ra8_widget *w, uint16_t index)
Tap callback (opt/NULL).
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