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

The retained wrap/scroll layout of one field, produced by rmgui_field_layout and kept current by rmgui_field_input. More...

#include <field.h>

Data Fields

rmgui_field_metrics_t metrics
const char * text
rmgui_rect_t box
rmgui_rect_t content
rmgui_rect_t action [RMGUI_FIELD_ACTION_MAX]
rmgui_scroll_t bar
rmgui_field_row_t row [RMGUI_FIELD_ROWS_CAP]
uint32_t length
uint32_t caret
uint32_t anchor
uint32_t view_row
int wrap_w
int caret_x
int caret_y
int sel_x0
int sel_x1
uint16_t rows
uint16_t first
uint16_t visible
uint16_t base
uint16_t count
uint16_t tail
uint16_t caret_row
uint64_t revision
uint8_t valid
uint8_t view_explicit
uint8_t caret_in_view
uint8_t has_bar
uint8_t has_actions
rmgui_text_shaped_t shaped
rmgui_text_shaped_t shaped_aux
const rmgui_text_options_t * text_options
const rmgui_text_options_t * auxiliary_text_options
rmgui_text_affinity_t affinity
rmgui_rect_t * selection_rects
size_t selection_rect_capacity
size_t selection_rect_count
uint16_t shaped_full_rows
rmgui_field_mask_t mask
size_t mask_length
size_t mask_preedit_length
size_t mask_cursor
size_t mask_start
size_t mask_end
uint8_t mask_bytes

Detailed Description

The retained wrap/scroll layout of one field, produced by rmgui_field_layout and kept current by rmgui_field_input.

Zero-initialise before first use; keep one per field and give the same record to layout, input and paint. Public outputs (read-only for hosts): rows: rows the whole text wraps to (>= 1); visible: rows the box shows; first: first visible row; wrap_w: wrap width after the scrollbar gutter; has_bar: 1 when rows > visible and the gutter carries bar; caret_in_view: 1 when the caret row is painted; caret_x/caret_y: caret offset from content.x/content.y (meaningful only when caret_in_view); content: the text column the rows flow in: the content box the layout was computed for, less the action strips; action[i]: the rect of the field's action i, {0,0,0,0} while that action does not exist (needs_content with an empty text) and for i >= count. Every other member is private bookkeeping.

rmgui_field_layout_t.shaped, rmgui_field_layout_t.shaped_aux

Shaped results borrow the per-instance workspaces above. Selection rectangles are in shaped coordinates (font_px + 2 line spacing); paint maps them to metrics.line_height and the scrolled text origin.

Field Documentation

◆ metrics

rmgui_field_metrics_t rmgui_field_layout_t::metrics

◆ text

const char* rmgui_field_layout_t::text

◆ box

rmgui_rect_t rmgui_field_layout_t::box

◆ content

rmgui_rect_t rmgui_field_layout_t::content

◆ action

rmgui_rect_t rmgui_field_layout_t::action[RMGUI_FIELD_ACTION_MAX]

◆ bar

rmgui_scroll_t rmgui_field_layout_t::bar

◆ row

rmgui_field_row_t rmgui_field_layout_t::row[RMGUI_FIELD_ROWS_CAP]

◆ length

uint32_t rmgui_field_layout_t::length

◆ caret

uint32_t rmgui_field_layout_t::caret

◆ anchor

uint32_t rmgui_field_layout_t::anchor

◆ view_row

uint32_t rmgui_field_layout_t::view_row

◆ wrap_w

int rmgui_field_layout_t::wrap_w

◆ caret_x

int rmgui_field_layout_t::caret_x

◆ caret_y

int rmgui_field_layout_t::caret_y

◆ sel_x0

int rmgui_field_layout_t::sel_x0

◆ sel_x1

int rmgui_field_layout_t::sel_x1

◆ rows

uint16_t rmgui_field_layout_t::rows

◆ first

uint16_t rmgui_field_layout_t::first

◆ visible

uint16_t rmgui_field_layout_t::visible

◆ base

uint16_t rmgui_field_layout_t::base

◆ count

uint16_t rmgui_field_layout_t::count

◆ tail

uint16_t rmgui_field_layout_t::tail

◆ caret_row

uint16_t rmgui_field_layout_t::caret_row

◆ revision

uint64_t rmgui_field_layout_t::revision

◆ valid

uint8_t rmgui_field_layout_t::valid

◆ view_explicit

uint8_t rmgui_field_layout_t::view_explicit

◆ caret_in_view

uint8_t rmgui_field_layout_t::caret_in_view

◆ has_bar

uint8_t rmgui_field_layout_t::has_bar

◆ has_actions

uint8_t rmgui_field_layout_t::has_actions

◆ shaped

rmgui_text_shaped_t rmgui_field_layout_t::shaped

◆ shaped_aux

rmgui_text_shaped_t rmgui_field_layout_t::shaped_aux

◆ text_options

const rmgui_text_options_t* rmgui_field_layout_t::text_options

◆ auxiliary_text_options

const rmgui_text_options_t * rmgui_field_layout_t::auxiliary_text_options

◆ affinity

rmgui_text_affinity_t rmgui_field_layout_t::affinity

◆ selection_rects

rmgui_rect_t* rmgui_field_layout_t::selection_rects

◆ selection_rect_capacity

size_t rmgui_field_layout_t::selection_rect_capacity

◆ selection_rect_count

size_t rmgui_field_layout_t::selection_rect_count

◆ shaped_full_rows

uint16_t rmgui_field_layout_t::shaped_full_rows

◆ mask

rmgui_field_mask_t rmgui_field_layout_t::mask

◆ mask_length

size_t rmgui_field_layout_t::mask_length

◆ mask_preedit_length

size_t rmgui_field_layout_t::mask_preedit_length

◆ mask_cursor

size_t rmgui_field_layout_t::mask_cursor

◆ mask_start

size_t rmgui_field_layout_t::mask_start

◆ mask_end

size_t rmgui_field_layout_t::mask_end

◆ mask_bytes

uint8_t rmgui_field_layout_t::mask_bytes

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