32static const char*
s_tag =
"ra8_widget_book_grid";
38typedef enum : uint16_t {
63 const int32_t p = (int32_t)pad;
67 r.
w = rect->
w - (p + p);
68 r.
h = rect->
h - (p + p);
99 const int32_t g = (int32_t)gap;
100 const int32_t col = (int32_t)(idx % cols);
101 const int32_t row = (int32_t)(idx / cols);
102 const int32_t cell_w = (content->
w - (g * (int32_t)(cols - 1U))) / (int32_t)cols;
103 const int32_t cell_h = (content->
h - (g * (int32_t)(rows - 1U))) / (int32_t)rows;
105 cell.
x = content->
x + (col * (cell_w + g));
106 cell.
y = content->
y + (row * (cell_h + g));
137 if (text ==
nullptr) {
143 paint->draw_text(paint->user, tx, ty, text, fg, bg);
169 const int32_t bar_h = (int32_t)g->bar_h;
170 const int32_t lbl_h = (int32_t)g->label_h;
171 const int32_t bar_y = (cell->
y + cell->
h) - bar_h;
172 const int32_t auth_y = bar_y - lbl_h;
173 const int32_t title_y = auth_y - lbl_h;
178 if (p->draw_text !=
nullptr) {
188 if ((fw > 0) && (p->fill_rect !=
nullptr)) {
189 p->fill_rect(p->user, cell->
x, bar_y, fw, bar_h, g->bar_fill);
212 return (uint16_t)(((uint32_t)count + (uint32_t)cols - 1U) / (uint32_t)cols);
237 if (g->paint ==
nullptr) {
249 for (uint16_t i = 0U; i < g->count; ++i) {
291 for (uint16_t i = 0U; i < g->count; ++i) {
296 if (g->on_open !=
nullptr) {
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.
bool ra8_ui_rect_contains(const ra8_ui_rect_t *r, int32_t px, int32_t py)
Test whether a point lies inside a rectangle.
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).