ra8-firmware 0.1.0
Bare-metal firmware for the Renesas RA8 family (RA8D2 / RA8P1)
Loading...
Searching...
No Matches
ra8_widget_paint_t Struct Reference

Drawing backend the concrete leaf widgets paint through (a DI seam). More...

#include <ra8_widget.h>

Detailed Description

Drawing backend the concrete leaf widgets paint through (a DI seam).

The compositor logic in this library never touches pixels – that is what keeps the layout / route / damage cycle host-testable and free of any ra8_gfx / framebuffer dependency. The concrete leaf widgets below (ra8_widget_label_t, ra8_widget_button_t) do draw, so their pixel primitives are injected as a small set of callbacks rather than linked directly. On the board the app binds these to its renderer (ra8_gfx_rect, ra8_gfx_text_out, ra8_gfx_text_size); a host test binds a recording mock. This Dependency-Inversion seam lets the very same widget run on the GLCDC panel and under the unit-test harness, and means an app that wants only the pure compositor never pulls in a graphics library.

Invariant
fill_rect is non-NULL for any widget that should paint a face.
draw_text is non-NULL for any widget that should paint a label.
Example:
static void gfx_fill(void* u, int32_t x, int32_t y, int32_t w, int32_t h, uint32_t c) {
(void)u;
(void)ra8_gfx_rect(x, y, w, h, c, true);
}
static const ra8_widget_paint_t paint = {.user = nullptr, .fill_rect = gfx_fill};
ra8_err_t ra8_gfx_rect(int32_t x, int32_t y, int32_t w, int32_t h, uint32_t color, bool filled)
Draw an axis-aligned rectangle.
Drawing backend the concrete leaf widgets paint through (a DI seam).
See also
ra8_widget_label_init
ra8_widget_button_init
Since
0.1.0

The documentation for this struct was generated from the following file: