|
RMGui 0.15.0
C11 retained-mode UI library: layout kernel, style schema, widget painters, fonts, software framebuffer
|
Editable, caller-owned combobox. More...
Data Structures | |
| struct | rmgui_combo_t |
| Zero-initialize before bind. More... | |
| struct | rmgui_combo_view_t |
| A combo and its borrowed, device-resolved field, normal row and active row styles. More... | |
Macros | |
| #define | RMGUI_COMBO_NONE SIZE_MAX |
| No committed or active entry. | |
| #define | RMGUI_COMBO_FREE_TEXT 1u |
| Permit unmatched commits, or paint the first matching prefix as ghost text. | |
| #define | RMGUI_COMBO_AUTOCOMPLETE 2u |
Typedefs | |
| typedef int(*) | rmgui_combo_match_fn(const char *label, const char *query, size_t query_bytes, void *user) |
| Return nonzero to include label. | |
Enumerations | |
| enum | rmgui_combo_match_t { RMGUI_COMBO_PREFIX , RMGUI_COMBO_SUBSTRING } |
| Built-in matching modes; custom matcher overrides either mode. More... | |
Functions | |
| int | rmgui_combo_prepare (const rmgui_ui_t *, const rmgui_combo_view_t *, const rmgui_field_layout_t *) |
| Stage the laid-out field, completion suffix and visible popup labels before recording. | |
| int | rmgui_combo_draw (const rmgui_ui_t *, const rmgui_combo_view_t *, rmgui_rect_t row, rmgui_rect_t popup, const rmgui_field_layout_t *, rmgui_field_caret_t) |
| Draw using the explicit field layout and popup box in target coordinates. | |
| int | rmgui_combo_bind (rmgui_combo_t *, const rmgui_field_t *, const char *const *entries, size_t count, size_t *matches, size_t match_capacity, char *committed, size_t committed_capacity, size_t visible_rows) |
| Bind an already bound single-line field. | |
| int | rmgui_combo_filter (rmgui_combo_t *) |
| Rebuild matches for current text; active becomes the first match. | |
| int | rmgui_combo_open (rmgui_combo_t *, int open) |
| Open/close without changing the committed value. | |
| int | rmgui_combo_commit (rmgui_combo_t *, size_t entry) |
| Commit entry, or NONE to resolve the first exact label, otherwise free text. | |
| int | rmgui_combo_revert (rmgui_combo_t *) |
| Restore the last committed bytes, close, and refilter. | |
| const char * | rmgui_combo_suggestion (const rmgui_combo_t *) |
| Borrowed inline completion suffix, or NULL without a prefix suggestion. | |
| rmgui_input_result_t | rmgui_combo_input (rmgui_combo_t *, rmgui_field_layout_t *, rmgui_rect_t row, rmgui_rect_t popup, const rmgui_input_t *) |
| row is the text field, popup is a virtual list of visible_rows equal-height rows. | |
| void | rmgui_combo_paint_to (rmgui_target_t *, rmgui_font_t *, const rmgui_style_resolved_t *field_style, const rmgui_style_resolved_t *row_style, const rmgui_style_resolved_t *active_style, rmgui_rect_t row, rmgui_rect_t popup, rmgui_rect_t clip, const rmgui_combo_t *, const rmgui_field_layout_t *, rmgui_field_caret_t) |
| Paint caller-resolved extension styles: field_style, row_style and active style. | |
| int | rmgui_combo_style_register (rmgui_style_ext_t *, size_t *class_id) |
| Register extension class "combo": background,text,border COLOR properties. | |
| void | rmgui_combo_paint (rmgui_fb_t *, rmgui_font_t *, const rmgui_style_resolved_t *, const rmgui_style_resolved_t *, const rmgui_style_resolved_t *, rmgui_rect_t, rmgui_rect_t, rmgui_rect_t, const rmgui_combo_t *, const rmgui_field_layout_t *, rmgui_field_caret_t) |
| CPU equivalent of paint_to. | |
| int | rmgui_a11y_from_combo (const rmgui_combo_t *, const char *name, uint64_t active_id, rmgui_a11y_record_t *out) |
| Build COMBOBOX semantics with expanded and caller-supplied active node id (zero when no active item). | |
Editable, caller-owned combobox.
Matching is bytewise and locale-free.
| #define RMGUI_COMBO_NONE SIZE_MAX |
No committed or active entry.
Counts are limited to INT_MAX by input results.
| #define RMGUI_COMBO_FREE_TEXT 1u |
Permit unmatched commits, or paint the first matching prefix as ghost text.
| #define RMGUI_COMBO_AUTOCOMPLETE 2u |
| typedef int(*) rmgui_combo_match_fn(const char *label, const char *query, size_t query_bytes, void *user) |
Return nonzero to include label.
Borrowed arguments last only for the call.
| enum rmgui_combo_match_t |
| int rmgui_combo_prepare | ( | const rmgui_ui_t * | , |
| const rmgui_combo_view_t * | , | ||
| const rmgui_field_layout_t * | ) |
Stage the laid-out field, completion suffix and visible popup labels before recording.
CPU targets need no staging. Returns 0 on success or -1 on error.
| int rmgui_combo_draw | ( | const rmgui_ui_t * | , |
| const rmgui_combo_view_t * | , | ||
| rmgui_rect_t | row, | ||
| rmgui_rect_t | popup, | ||
| const rmgui_field_layout_t * | , | ||
| rmgui_field_caret_t | ) |
Draw using the explicit field layout and popup box in target coordinates.
Returns -1 for invalid arguments, otherwise 0; paint failures latch on the target.
| int rmgui_combo_bind | ( | rmgui_combo_t * | , |
| const rmgui_field_t * | , | ||
| const char *const * | entries, | ||
| size_t | count, | ||
| size_t * | matches, | ||
| size_t | match_capacity, | ||
| char * | committed, | ||
| size_t | committed_capacity, | ||
| size_t | visible_rows ) |
Bind an already bound single-line field.
Requires non-NULL buffers, entries when count>0, valid NUL-terminated labels fitting field.capacity, positive visible_rows, and count<=INT_MAX. -1 leaves self and buffers unchanged.
| int rmgui_combo_filter | ( | rmgui_combo_t * | ) |
Rebuild matches for current text; active becomes the first match.
0 or -1 for unbound/invalid configuration, unchanged on refusal.
| int rmgui_combo_open | ( | rmgui_combo_t * | , |
| int | open ) |
Open/close without changing the committed value.
0 or -1 for NULL/unbound.
| int rmgui_combo_commit | ( | rmgui_combo_t * | , |
| size_t | entry ) |
Commit entry, or NONE to resolve the first exact label, otherwise free text.
Restricted unmatched text refuses. Copies the value into the field and saved commit, closes the popup; -1 leaves everything unchanged on invalid index/text or insufficient capacity.
| int rmgui_combo_revert | ( | rmgui_combo_t * | ) |
Restore the last committed bytes, close, and refilter.
0 or -1 unbound.
| const char * rmgui_combo_suggestion | ( | const rmgui_combo_t * | ) |
Borrowed inline completion suffix, or NULL without a prefix suggestion.
| rmgui_input_result_t rmgui_combo_input | ( | rmgui_combo_t * | , |
| rmgui_field_layout_t * | , | ||
| rmgui_rect_t | row, | ||
| rmgui_rect_t | popup, | ||
| const rmgui_input_t * | ) |
row is the text field, popup is a virtual list of visible_rows equal-height rows.
UP/DOWN open/navigate, ENTER commits active/free text, ESC reverts. Focus loss reverts restricted drafts; editing uses field_input unchanged. Results CHANGE mean draft edits; SUBMIT means commit (value=-1 free text). NULL/malformed geometry yields a zero result.
| void rmgui_combo_paint_to | ( | rmgui_target_t * | , |
| rmgui_font_t * | , | ||
| const rmgui_style_resolved_t * | field_style, | ||
| const rmgui_style_resolved_t * | row_style, | ||
| const rmgui_style_resolved_t * | active_style, | ||
| rmgui_rect_t | row, | ||
| rmgui_rect_t | popup, | ||
| rmgui_rect_t | clip, | ||
| const rmgui_combo_t * | , | ||
| const rmgui_field_layout_t * | , | ||
| rmgui_field_caret_t | ) |
Paint caller-resolved extension styles: field_style, row_style and active style.
Prepare text for RECORD. No allocation; target failures latch.
| int rmgui_combo_style_register | ( | rmgui_style_ext_t * | , |
| size_t * | class_id ) |
Register extension class "combo": background,text,border COLOR properties.
0 or -1 invalid/capacity/duplicate, registry and class_id unchanged.
| void rmgui_combo_paint | ( | rmgui_fb_t * | , |
| rmgui_font_t * | , | ||
| const rmgui_style_resolved_t * | , | ||
| const rmgui_style_resolved_t * | , | ||
| const rmgui_style_resolved_t * | , | ||
| rmgui_rect_t | , | ||
| rmgui_rect_t | , | ||
| rmgui_rect_t | , | ||
| const rmgui_combo_t * | , | ||
| const rmgui_field_layout_t * | , | ||
| rmgui_field_caret_t | ) |
CPU equivalent of paint_to.
| int rmgui_a11y_from_combo | ( | const rmgui_combo_t * | , |
| const char * | name, | ||
| uint64_t | active_id, | ||
| rmgui_a11y_record_t * | out ) |
Build COMBOBOX semantics with expanded and caller-supplied active node id (zero when no active item).
0 or -1 for NULL/unbound, out unchanged.