30static const char*
s_tag =
"ra8_widget_nav_bar";
35typedef enum : uint16_t {
59 const int32_t x0 = (strip->
w * (int32_t)idx) / (int32_t)count;
60 const int32_t x1 = (strip->
w * (int32_t)(idx + 1U)) / (int32_t)count;
93 if (text ==
nullptr) {
99 paint->draw_text(paint->user, tx, ty, text, fg, bg);
121 if (nav ==
nullptr) {
124 if (nav->paint ==
nullptr) {
133 if ((p->draw_text ==
nullptr) || (nav->items ==
nullptr)) {
136 for (uint16_t i = 0U; i < nav->count; ++i) {
138 const uint32_t fg = (i == nav->active) ? nav->fg_active : nav->fg_muted;
172 if ((px < strip->x) || (px >= (strip->
x + strip->
w))) {
175 const int32_t idx = ((px - strip->
x) * (int32_t)count) / strip->
w;
176 *out = (uint16_t)idx;
201 if (nav ==
nullptr) {
213 if (nav->on_select !=
nullptr) {
214 nav->on_select(w, idx);
static const char * s_tag
Logging / check tag.
#define RA8_INTERNAL
Marker that a function is intended to be static (file-local).
Validation and Error-Checking Macros for ra8-firmware.
#define RA8_CHECK_NULL_PTR(ptr, tag, message)
Reject nullptr pointer, returning k_ra8_err_null_ptr.
@ k_ra8_ok
Success – operation completed with all postconditions satisfied.
ra8_err_codes_t ra8_err_t
Canonical error-return type used by every ra8-firmware API.
Bounded UI interaction core: hit-testing, screen stack, paging.
Axis-aligned rectangle in framebuffer pixel coordinates.
int32_t w
Width (pixels, >= 0).
int32_t h
Height (pixels, >= 0).
int32_t x
Left edge (pixels).
int32_t y
Top edge (pixels).