RMGui 0.15.0
C11 retained-mode UI library: layout kernel, style schema, widget painters, fonts, software framebuffer
Loading...
Searching...
No Matches
rmgui_field_t Struct Reference

Retained state of one field. More...

#include <field.h>

Data Fields

char * text
const char * hint
const rmgui_field_actions_t * actions
uint32_t capacity
uint32_t length
uint32_t caret
uint32_t anchor
uint32_t view_row
int nav_x
uint8_t view_explicit
uint8_t capture
uint8_t states
uint64_t revision
uint8_t multiline
uint8_t action
uint8_t nav_set
const rmgui_host_t * host
rmgui_field_history_t * history
char * preedit
char * clipboard
size_t preedit_capacity
size_t clipboard_capacity
size_t preedit_length
size_t preedit_cursor
size_t preedit_start
size_t preedit_end
const rmgui_text_options_t * text_options
rmgui_text_affinity_t affinity
rmgui_rect_t * selection_rects
size_t selection_rect_capacity
const rmgui_text_options_t * auxiliary_text_options
rmgui_field_mask_t mask

Detailed Description

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.

Field Documentation

◆ text

char* rmgui_field_t::text

◆ hint

const char* rmgui_field_t::hint

◆ actions

const rmgui_field_actions_t* rmgui_field_t::actions

◆ capacity

uint32_t rmgui_field_t::capacity

◆ length

uint32_t rmgui_field_t::length

◆ caret

uint32_t rmgui_field_t::caret

◆ anchor

uint32_t rmgui_field_t::anchor

◆ view_row

uint32_t rmgui_field_t::view_row

◆ nav_x

int rmgui_field_t::nav_x

◆ view_explicit

uint8_t rmgui_field_t::view_explicit

◆ capture

uint8_t rmgui_field_t::capture

◆ states

uint8_t rmgui_field_t::states

◆ revision

uint64_t rmgui_field_t::revision

◆ multiline

uint8_t rmgui_field_t::multiline

◆ action

uint8_t rmgui_field_t::action

◆ nav_set

uint8_t rmgui_field_t::nav_set

◆ host

const rmgui_host_t* rmgui_field_t::host

◆ history

rmgui_field_history_t* rmgui_field_t::history

◆ preedit

char* rmgui_field_t::preedit

◆ clipboard

char * rmgui_field_t::clipboard

◆ preedit_capacity

size_t rmgui_field_t::preedit_capacity

◆ clipboard_capacity

size_t rmgui_field_t::clipboard_capacity

◆ preedit_length

size_t rmgui_field_t::preedit_length

◆ preedit_cursor

size_t rmgui_field_t::preedit_cursor

◆ preedit_start

size_t rmgui_field_t::preedit_start

◆ preedit_end

size_t rmgui_field_t::preedit_end

◆ text_options

const rmgui_text_options_t* rmgui_field_t::text_options

◆ affinity

rmgui_text_affinity_t rmgui_field_t::affinity

◆ selection_rects

rmgui_rect_t* rmgui_field_t::selection_rects

◆ selection_rect_capacity

size_t rmgui_field_t::selection_rect_capacity

◆ auxiliary_text_options

const rmgui_text_options_t* rmgui_field_t::auxiliary_text_options

◆ mask

rmgui_field_mask_t rmgui_field_t::mask

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