One node's declaration, copied by rmgui_layout_add_* / rmgui_layout_update.
Pixel fields are framebuffer pixels supplied by the caller unchanged; geometry scale affects kernel-owned gutters and anchored overlay gaps. Padding, gap and margins lie in [INT16_MIN, INT16_MAX]; font_px and image_max_scale in [0, INT16_MAX]; sizes and image dimensions are non-negative.
rmgui_layout_node_t.id
Nonzero and unique among the kernel's nodes.
rmgui_layout_node_t.preferred_w, rmgui_layout_node_t.preferred_h
0 on an axis requests the intrinsic measurement for that axis.
rmgui_layout_node_t.text
Borrowed NUL-terminated text, read until replaced or reset. font_px is passed unchanged to the text callback.
rmgui_layout_node_t.text_measure_userdata
Optional override for both measurement and exact-prefix callbacks, including wrapping, ellipsis and scratch prefixes. NULL selects the binding's default userdata. With rmgui_layout_set_font_metrics the override must be a mutable rmgui_font_metrics_t and also supplies this node's paint cache. Other bindings use their explicitly supplied cache independently of the override. Borrowed until replaced or reset; keep any cache alive until snapshots using it are no longer consumed. Except for provider-owned caches the userdata must stay immutable. Changing the pointer invalidates this node and ancestor measurements.
rmgui_layout_node_t.text_lines
Optional retained paragraph breaks. Both arrays have text_line_capacity elements, are disjoint from each other and every other node's arrays, and remain borrowed until all snapshots using them expire. Leave both NULL and capacity 0 for legacy measurement. With storage, wrapping uses the shared text line breaker and the installed prefix provider. Exhaustion fails arrangement, never truncates text. Two arrays preserve the published generation on a failed arrangement. The host must not modify them while borrowed.
rmgui_layout_node_t.shape
Optional additional hit shape, stretched over the arranged rect. NULL preserves rounded-rect hits. Borrowed, never copied: the mask must remain allocated and unmodified and outlive every snapshot generation queried, including generations preceding an update.
rmgui_layout_node_t.max_w, rmgui_layout_node_t.max_h
Upper bounds, enabled per axis by RMGUI_LAYOUT_BOUND_W/_H in max_bound. For BUTTON they bound the content box (padding and any scrollbar reserve are added outside); for every other kind the outer box. INTEGER_SCALE images read them as a scale cap only.
rmgui_layout_node_t.flex
Box main-axis grow/shrink weight; ignored by HBOX WRAP. Arithmetic uses 64-bit intermediates.
rmgui_layout_node_t.grid, rmgui_layout_node_t.scroll, rmgui_layout_node_t.overlay
1-based handles from rmgui_layout_grid_declare / _scroll_declare / _overlay_declare; 0 declares none. GRID requires grid; only SCROLL may carry scroll; overlay requires a LAYER parent. A scroll or overlay handle binds to at most one node per reset.
rmgui_layout_node_t.fitted_anchor
Nonzero: id of an earlier GRAPHIC sibling under a LAYER parent; the node is placed against that graphic's fitted artwork rect, its top at fitted_y/1000 of the artwork height (0..1000) and its right edge fitted_right pixels (0..256) inside the artwork's right edge.
rmgui_layout_node_t.corner_radius
Clamped to [0, 64] and to half the arranged extent.
rmgui_layout_node_t.a11y
Optional borrowed semantic declaration, copied into caller-owned snapshot record storage on arrange. See rmgui_layout_set_a11y.