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

Behaviour table shared by all widgets of one kind. More...

#include <ra8_widget.h>

Data Fields

void(* measure )(struct ra8_widget *w, int32_t avail_w, int32_t avail_h, int32_t *out_w, int32_t *out_h)
 Report the widget's desired size within an available box.
void(* render )(struct ra8_widget *w)
 Draw the widget within its current rect (on-target only).
bool(* on_input )(struct ra8_widget *w, const ra8_widget_event_t *ev)
 Handle an input event.

Detailed Description

Behaviour table shared by all widgets of one kind.

measure and on_input are pure (no framebuffer) so the compositor's layout + routing logic is host-testable. render is the only callback that touches pixels; it is invoked on-target and may be NULL for a widget that draws nothing (a pure spacer / hit area).

Definition at line 121 of file ra8_widget.h.

Field Documentation

◆ measure

void(* ra8_widget_vtable_t::measure) (struct ra8_widget *w, int32_t avail_w, int32_t avail_h, int32_t *out_w, int32_t *out_h)

Report the widget's desired size within an available box.

Parameters
[in]wThe widget instance.
[in]avail_wAvailable width (pixels).
[in]avail_hAvailable height (pixels).
[out]out_wDesired width (clamped by the caller).
[out]out_hDesired height (clamped by the caller).

Definition at line 130 of file ra8_widget.h.

◆ on_input

bool(* ra8_widget_vtable_t::on_input) (struct ra8_widget *w, const ra8_widget_event_t *ev)

Handle an input event.

Parameters
[in]wThe widget instance.
[in]evThe event (already routed to this widget).
Returns
true if the widget consumed the event, false to keep routing.

Definition at line 146 of file ra8_widget.h.

◆ render

void(* ra8_widget_vtable_t::render) (struct ra8_widget *w)

Draw the widget within its current rect (on-target only).

Parameters
[in]wThe widget instance. NULL is a no-op (spacer).

Definition at line 139 of file ra8_widget.h.


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