Retained state of one field.
Zero-initialise before the first rmgui_field_bind. text is host storage (NUL-terminated at length); capacity/length/caret/anchor are bytes excluding the terminator. Host configuration, written by the host at any time and kept by bind: hint: NUL-terminated UTF-8 painted in the placeholder colour while the text is empty (NULL: none); host-owned. multiline: 0 a one-line entry (ENTER submits); 1 a text area (ENTER inserts a line break, UP/DOWN move between rows, nothing submits from a key). actions: the action buttons inside the field (NULL: none); host-owned. Action chrome consults BUTTON/FACE; the embedded scrollbar follows the metrics' style and the field's skin binding. Action labels, caret and selection remain owned by the field. host, history and scratch pointers/capacities are host configuration kept by bind. Every other member is read-only except the DISABLED bit of states; hosts never write the bytes of text. view_row, view_explicit: when view_explicit is 1 the window is pinned with view_row as its first row (a wheel or scrollbar gesture); any edit or caret key clears it and the window follows the caret again. capture: 0 none, 1 text drag, 2 scrollbar drag, 3 action press (action is its index). states: rmgui_style_states_t subset; HOVER/PRESSED/FOCUSED written by rmgui_field_input, DISABLED by the host. revision: bumped by every byte change so retained layouts detect edits. nav_x, nav_set: the column UP/DOWN keep (nav_set 1), from the caret offset where the first vertical move started; any other caret move or edit clears it.
rmgui_field_t.preedit, rmgui_field_t.clipboard
Host-owned non-aliasing scratch: preedit persists between calls; clipboard scratch is used only by paste. Capacities exclude no terminator: these buffers hold byte spans. NULL/zero storage refuses that feature.
rmgui_field_t.text_options
Explicit opt-in; NULL preserves the legacy measure/input/paint path. Options and their workspace belong to this instance. After changing them in place, call rmgui_field_layout_invalidate before laying out again. Do not use shaped results from a previous layout after changing its workspace. The same rule applies to auxiliary text options. bind preserves these pointers/capacities and resets affinity. auxiliary_text_options owns an independent workspace for a nonempty hint or IME preedit; it is required only while either is displayed. selection_rects retains the visual union (including disjoint bidi pieces); insufficient capacity refuses layout rather than truncating selection. Neither workspace nor selection storage may alias another live field.