Functions
mk_ui_beginfunction
bool mk_ui_begin(mk_ui_t ui, const mk_ui_frame_desc_t *frame)
Begin one immediate-mode UI frame and process queued input.
| Parameter | Type | Description |
|---|
ui | mk_ui_t | UI context. |
frame | const mk_ui_frame_desc_t * | Frame dimensions and timing. |
Returns True when declaration may proceed.
mk_ui_box_beginfunction
bool mk_ui_box_begin(mk_ui_t ui, mk_ui_id_t id, const mk_ui_box_desc_t *desc)
Begin a general-purpose layout box.
| Parameter | Type | Description |
|---|
ui | mk_ui_t | UI context. |
id | mk_ui_id_t | Stable element ID. |
desc | const mk_ui_box_desc_t * | Box properties. |
Returns True when the scope opened.
mk_ui_box_desc_initfunction
void mk_ui_box_desc_init(mk_ui_box_desc_t *desc)
Initialize a box descriptor.
| Parameter | Type | Description |
|---|
desc | mk_ui_box_desc_t * | Descriptor to initialize. |
mk_ui_box_endfunction
void mk_ui_box_end(mk_ui_t ui)
End the innermost box, row, column, or scroll scope.
| Parameter | Type | Description |
|---|
ui | mk_ui_t | UI context. |
bool mk_ui_button(mk_ui_t ui, mk_ui_id_t id, const char *label)
Declare a push button.
| Parameter | Type | Description |
|---|
ui | mk_ui_t | UI context. |
id | mk_ui_id_t | Stable widget ID. |
label | const char * | UTF-8 label. |
Returns True when activated this frame.
mk_ui_checkboxfunction
bool mk_ui_checkbox(mk_ui_t ui, mk_ui_id_t id, const char *label, bool *value)
Declare a binary checkbox.
| Parameter | Type | Description |
|---|
ui | mk_ui_t | UI context. |
id | mk_ui_id_t | Stable widget ID. |
label | const char * | UTF-8 label. |
value | bool * | Value read and toggled on activation. |
Returns True when value changed.
mk_ui_clear_focusfunction
void mk_ui_clear_focus(mk_ui_t ui)
Clear keyboard focus.
| Parameter | Type | Description |
|---|
ui | mk_ui_t | UI context. |
mk_ui_column_beginfunction
bool mk_ui_column_begin(mk_ui_t ui, mk_ui_id_t id, const mk_ui_box_desc_t *desc)
Begin a vertical layout box.
| Parameter | Type | Description |
|---|
ui | mk_ui_t | UI context. |
id | mk_ui_id_t | Stable element ID. |
desc | const mk_ui_box_desc_t * | Box properties. |
Returns True when the scope opened.
mk_ui_createfunction
mk_result mk_ui_create(const mk_ui_desc_t *desc, mk_ui_t *ui)
Create a UI context.
| Parameter | Type | Description |
|---|
desc | const mk_ui_desc_t * | Context configuration. |
ui | mk_ui_t * | Receives the created handle. |
Returns MK_SUCCESS or an error result.
mk_ui_desc_initfunction
void mk_ui_desc_init(mk_ui_desc_t *desc)
Initialize a UI context descriptor with documented defaults.
| Parameter | Type | Description |
|---|
desc | mk_ui_desc_t * | Descriptor to initialize. |
mk_ui_destroyfunction
void mk_ui_destroy(mk_ui_t ui)
Destroy a UI context and its retained state.
| Parameter | Type | Description |
|---|
ui | mk_ui_t | Context to destroy. |
mk_ui_endfunction
bool mk_ui_end(mk_ui_t ui)
Resolve layout and finish the current UI frame.
| Parameter | Type | Description |
|---|
ui | mk_ui_t | UI context. |
Returns True when the command stream is renderable.
mk_ui_feed_navigationfunction
void mk_ui_feed_navigation(mk_ui_t ui, const mk_ui_navigation_t *navigation)
Feed application-mapped navigation state.
| Parameter | Type | Description |
|---|
ui | mk_ui_t | UI context. |
navigation | const mk_ui_navigation_t * | Directional axes and actions. |
mk_ui_fitfunction
mk_ui_size_t mk_ui_fit(float min, float max)
Construct a content-fitting size constraint.
| Parameter | Type | Description |
|---|
min | float | Minimum size. |
max | float | Maximum size. |
Returns The size constraint.
mk_ui_fixedfunction
mk_ui_size_t mk_ui_fixed(float value)
Construct a fixed logical-pixel size constraint.
| Parameter | Type | Description |
|---|
value | float | Fixed size. |
Returns The size constraint.
mk_ui_focusedfunction
mk_ui_id_t mk_ui_focused(mk_ui_t ui)
Get the currently focused element.
| Parameter | Type | Description |
|---|
ui | mk_ui_t | UI context. |
Returns Focused ID, or MK_UI_ID_INVALID.
mk_ui_frame_desc_initfunction
void mk_ui_frame_desc_init(mk_ui_frame_desc_t *desc)
Initialize a per-frame descriptor.
| Parameter | Type | Description |
|---|
desc | mk_ui_frame_desc_t * | Descriptor to initialize. |
mk_ui_get_frame_statsfunction
bool mk_ui_get_frame_stats(mk_ui_t ui, mk_ui_frame_stats_t *stats)
Read diagnostics for the most recently completed frame.
| Parameter | Type | Description |
|---|
ui | mk_ui_t | UI context. |
stats | mk_ui_frame_stats_t * | Receives frame counters. |
Returns True when statistics were available.
mk_ui_get_motionfunction
bool mk_ui_get_motion(mk_ui_t ui, mk_ui_motion_t *motion)
Read a context's transition settings.
| Parameter | Type | Description |
|---|
ui | mk_ui_t | UI context. |
motion | mk_ui_motion_t * | Receives the settings. |
Returns True on success.
mk_ui_get_themefunction
bool mk_ui_get_theme(mk_ui_t ui, mk_ui_theme_t *theme)
Read a context's active theme.
| Parameter | Type | Description |
|---|
ui | mk_ui_t | UI context. |
theme | mk_ui_theme_t * | Receives the theme. |
Returns True on success.
mk_ui_growfunction
mk_ui_size_t mk_ui_grow(float min, float max)
Construct an available-space-growing size constraint.
| Parameter | Type | Description |
|---|
min | float | Minimum size. |
max | float | Maximum size. |
Returns The size constraint.
mk_ui_handle_eventfunction
bool mk_ui_handle_event(mk_ui_t ui, const mk_event_t *event)
Feed one platform event to a manual-mode UI context.
| Parameter | Type | Description |
|---|
ui | mk_ui_t | UI context. |
event | const mk_event_t * | Event to process. |
Returns True when the UI consumed the event.
mk_ui_id_strfunction
mk_ui_id_t mk_ui_id_str(mk_ui_t ui, const char *text)
Hash a null-terminated UTF-8 string into the current ID scope.
| Parameter | Type | Description |
|---|
ui | mk_ui_t | UI context. |
text | const char * | Stable identifier text. |
Returns The scoped UI ID.
mk_ui_id_str_nfunction
mk_ui_id_t mk_ui_id_str_n(mk_ui_t ui, const char *text, size_t text_len)
Hash a UTF-8 byte span into the current ID scope.
| Parameter | Type | Description |
|---|
ui | mk_ui_t | UI context. |
text | const char * | Identifier bytes. |
text_len | size_t | Byte length. |
Returns The scoped UI ID.
mk_ui_id_u64function
mk_ui_id_t mk_ui_id_u64(mk_ui_t ui, uint64_t value)
Hash an integer into the current ID scope.
| Parameter | Type | Description |
|---|
ui | mk_ui_t | UI context. |
value | uint64_t | Caller-stable value. |
Returns The scoped UI ID.
mk_ui_imagefunction
void mk_ui_image(mk_ui_t ui, mk_ui_id_t id, mk_texture_t texture, mk_rectf uv, uint32_t tint, float width, float height)
Draw a textured image element.
| Parameter | Type | Description |
|---|
ui | mk_ui_t | UI context. |
id | mk_ui_id_t | Stable element ID. |
texture | mk_texture_t | Source texture. |
uv | mk_rectf | Normalized source rectangle. |
tint | uint32_t | Packed tint color. |
width | float | Logical width. |
height | float | Logical height. |
mk_ui_item_activefunction
bool mk_ui_item_active(mk_ui_t ui)
Test whether the last declared item owns an active interaction.
| Parameter | Type | Description |
|---|
ui | mk_ui_t | UI context. |
Returns True when active.
mk_ui_item_enabledfunction
bool mk_ui_item_enabled(mk_ui_t ui)
Test whether the last declared item accepts interaction.
| Parameter | Type | Description |
|---|
ui | mk_ui_t | UI context. |
Returns True when enabled.
mk_ui_item_focusedfunction
bool mk_ui_item_focused(mk_ui_t ui)
Test whether the last declared item has keyboard focus.
| Parameter | Type | Description |
|---|
ui | mk_ui_t | UI context. |
Returns True when focused.
mk_ui_item_hoveredfunction
bool mk_ui_item_hovered(mk_ui_t ui)
Test whether the last declared item is hovered.
| Parameter | Type | Description |
|---|
ui | mk_ui_t | UI context. |
Returns True when hovered.
mk_ui_item_pressedfunction
bool mk_ui_item_pressed(mk_ui_t ui)
Test whether the last declared item is held by a pointer press.
| Parameter | Type | Description |
|---|
ui | mk_ui_t | UI context. |
Returns True when pressed.
mk_ui_item_visiblefunction
bool mk_ui_item_visible(mk_ui_t ui)
Test whether the last declared item intersects its active clips.
| Parameter | Type | Description |
|---|
ui | mk_ui_t | UI context. |
Returns True when visible.
mk_ui_motion_initfunction
void mk_ui_motion_init(mk_ui_motion_t *motion)
Initialize UI transition settings.
| Parameter | Type | Description |
|---|
motion | mk_ui_motion_t * | Settings to initialize. |
mk_ui_number_floatfunction
bool mk_ui_number_float(mk_ui_t ui, mk_ui_id_t id, const char *label, float *value, float min, float max, float step, mk_ui_range_flags_t flags)
Declare a draggable and editable floating-point field.
| Parameter | Type | Description |
|---|
ui | mk_ui_t | UI context. |
id | mk_ui_id_t | Stable widget ID. |
label | const char * | UTF-8 label. |
value | float * | Value read and updated. |
min | float | Minimum value. |
max | float | Maximum value. |
step | float | Drag and keyboard increment. |
flags | mk_ui_range_flags_t | Presentation flags. |
Returns True when value changed.
mk_ui_number_intfunction
bool mk_ui_number_int(mk_ui_t ui, mk_ui_id_t id, const char *label, int32_t *value, int32_t min, int32_t max, int32_t step, mk_ui_range_flags_t flags)
Declare a draggable and editable integer field.
| Parameter | Type | Description |
|---|
ui | mk_ui_t | UI context. |
id | mk_ui_id_t | Stable widget ID. |
label | const char * | UTF-8 label. |
value | int32_t * | Value read and updated. |
min | int32_t | Minimum value. |
max | int32_t | Maximum value. |
step | int32_t | Drag and keyboard increment. |
flags | mk_ui_range_flags_t | Presentation flags. |
Returns True when value changed.
mk_ui_percentfunction
mk_ui_size_t mk_ui_percent(float value)
Construct a parent-relative size constraint.
| Parameter | Type | Description |
|---|
value | float | Fraction of the parent dimension. |
Returns The size constraint.
mk_ui_pop_idfunction
void mk_ui_pop_id(mk_ui_t ui)
Pop the innermost ID component.
| Parameter | Type | Description |
|---|
ui | mk_ui_t | UI context. |
mk_ui_pop_stylefunction
void mk_ui_pop_style(mk_ui_t ui, uint32_t count)
Pop entries from the typed style stack.
| Parameter | Type | Description |
|---|
ui | mk_ui_t | UI context. |
count | uint32_t | Number of entries to pop. |
mk_ui_presence_beginfunction
bool mk_ui_presence_begin(mk_ui_t ui, mk_ui_id_t id, bool visible, const mk_ui_presence_desc_t *desc)
Begin content that animates while entering or leaving declaration.
| Parameter | Type | Description |
|---|
ui | mk_ui_t | UI context. |
id | mk_ui_id_t | Stable presence ID. |
visible | bool | Desired visibility. |
desc | const mk_ui_presence_desc_t * | Transition options. |
Returns True while the content must still be declared.
mk_ui_presence_desc_initfunction
void mk_ui_presence_desc_init(mk_ui_presence_desc_t *desc)
Initialize a conditional-presence descriptor.
| Parameter | Type | Description |
|---|
desc | mk_ui_presence_desc_t * | Descriptor to initialize. |
mk_ui_presence_endfunction
void mk_ui_presence_end(mk_ui_t ui)
End the innermost presence scope.
| Parameter | Type | Description |
|---|
ui | mk_ui_t | UI context. |
mk_ui_progressfunction
void mk_ui_progress(mk_ui_t ui, mk_ui_id_t id, const char *label, float value, float min, float max)
Draw a read-only progress range.
| Parameter | Type | Description |
|---|
ui | mk_ui_t | UI context. |
id | mk_ui_id_t | Stable element ID. |
label | const char * | UTF-8 label. |
value | float | Current value. |
min | float | Minimum value. |
max | float | Maximum value. |
mk_ui_push_colorfunction
bool mk_ui_push_color(mk_ui_t ui, mk_ui_color_role_t role, uint32_t color)
Push a theme-color override.
| Parameter | Type | Description |
|---|
ui | mk_ui_t | UI context. |
role | mk_ui_color_role_t | Color slot. |
color | uint32_t | Packed replacement color. |
Returns True on success.
mk_ui_push_floatfunction
bool mk_ui_push_float(mk_ui_t ui, mk_ui_float_role_t role, float value)
Push a theme-scalar override.
| Parameter | Type | Description |
|---|
ui | mk_ui_t | UI context. |
role | mk_ui_float_role_t | Scalar slot. |
value | float | Replacement value. |
Returns True on success.
mk_ui_push_fontfunction
bool mk_ui_push_font(mk_ui_t ui, mk_ui_font_role_t role, mk_font_family_t family)
Push a font-family override.
| Parameter | Type | Description |
|---|
ui | mk_ui_t | UI context. |
role | mk_ui_font_role_t | Font slot. |
family | mk_font_family_t | Replacement font family. |
Returns True on success.
mk_ui_push_id_strfunction
bool mk_ui_push_id_str(mk_ui_t ui, const char *text)
Push a string ID component.
| Parameter | Type | Description |
|---|
ui | mk_ui_t | UI context. |
text | const char * | Caller-stable identifier text. |
Returns True on success.
mk_ui_push_id_u64function
bool mk_ui_push_id_u64(mk_ui_t ui, uint64_t value)
Push an integer ID component.
| Parameter | Type | Description |
|---|
ui | mk_ui_t | UI context. |
value | uint64_t | Caller-stable value. |
Returns True on success.
mk_ui_radiofunction
bool mk_ui_radio(mk_ui_t ui, mk_ui_id_t id, const char *label, int32_t option, int32_t *selected)
Declare one option in a radio group.
| Parameter | Type | Description |
|---|
ui | mk_ui_t | UI context. |
id | mk_ui_id_t | Stable widget ID. |
label | const char * | UTF-8 label. |
option | int32_t | Value represented by this option. |
selected | int32_t * | Selected value read and updated. |
Returns True when selection changed.
mk_ui_renderfunction
bool mk_ui_render(mk_ui_t ui)
Render the most recently completed UI frame.
| Parameter | Type | Description |
|---|
ui | mk_ui_t | UI context. |
Returns True when rendering was submitted.
mk_ui_request_focusfunction
bool mk_ui_request_focus(mk_ui_t ui, mk_ui_id_t id)
Request focus for a stable element ID.
| Parameter | Type | Description |
|---|
ui | mk_ui_t | UI context. |
id | mk_ui_id_t | Element ID. |
Returns True when the request was accepted.
mk_ui_row_beginfunction
bool mk_ui_row_begin(mk_ui_t ui, mk_ui_id_t id, const mk_ui_box_desc_t *desc)
Begin a horizontal layout box.
| Parameter | Type | Description |
|---|
ui | mk_ui_t | UI context. |
id | mk_ui_id_t | Stable element ID. |
desc | const mk_ui_box_desc_t * | Box properties. |
Returns True when the scope opened.
bool mk_ui_scroll_begin(mk_ui_t ui, mk_ui_id_t id, const mk_ui_box_desc_t *desc)
Begin a scrollable layout box.
| Parameter | Type | Description |
|---|
ui | mk_ui_t | UI context. |
id | mk_ui_id_t | Stable element ID. |
desc | const mk_ui_box_desc_t * | Box properties and scroll axes. |
Returns True when the scope opened.
mk_ui_semantics_initfunction
void mk_ui_semantics_init(mk_ui_semantics_t *semantics)
Initialize accessibility metadata.
| Parameter | Type | Description |
|---|
semantics | mk_ui_semantics_t * | Metadata to initialize. |
mk_ui_separatorfunction
void mk_ui_separator(mk_ui_t ui, uint32_t color, float thickness)
Draw a separator occupying layout space.
| Parameter | Type | Description |
|---|
ui | mk_ui_t | UI context. |
color | uint32_t | Packed separator color. |
thickness | float | Separator thickness. |
mk_ui_set_motionfunction
bool mk_ui_set_motion(mk_ui_t ui, const mk_ui_motion_t *motion)
Replace a context's transition settings.
| Parameter | Type | Description |
|---|
ui | mk_ui_t | UI context. |
motion | const mk_ui_motion_t * | Settings to copy. |
Returns True on success.
mk_ui_set_next_semanticsfunction
void mk_ui_set_next_semantics(mk_ui_t ui, const mk_ui_semantics_t *semantics)
Apply custom accessibility metadata to the next element.
| Parameter | Type | Description |
|---|
ui | mk_ui_t | UI context. |
semantics | const mk_ui_semantics_t * | Metadata copied for the next declaration. |
mk_ui_set_themefunction
bool mk_ui_set_theme(mk_ui_t ui, const mk_ui_theme_t *theme)
Replace a context's active theme.
| Parameter | Type | Description |
|---|
ui | mk_ui_t | UI context. |
theme | const mk_ui_theme_t * | Theme to copy. |
Returns True on success.
mk_ui_slider_floatfunction
bool mk_ui_slider_float(mk_ui_t ui, mk_ui_id_t id, const char *label, float *value, float min, float max, float step, mk_ui_range_flags_t flags)
Declare a floating-point slider.
| Parameter | Type | Description |
|---|
ui | mk_ui_t | UI context. |
id | mk_ui_id_t | Stable widget ID. |
label | const char * | UTF-8 label. |
value | float * | Value read and updated. |
min | float | Minimum value. |
max | float | Maximum value. |
step | float | Keyboard and navigation increment. |
flags | mk_ui_range_flags_t | Presentation flags. |
Returns True when value changed.
mk_ui_slider_intfunction
bool mk_ui_slider_int(mk_ui_t ui, mk_ui_id_t id, const char *label, int32_t *value, int32_t min, int32_t max, int32_t step, mk_ui_range_flags_t flags)
Declare an integer slider.
| Parameter | Type | Description |
|---|
ui | mk_ui_t | UI context. |
id | mk_ui_id_t | Stable widget ID. |
label | const char * | UTF-8 label. |
value | int32_t * | Value read and updated. |
min | int32_t | Minimum value. |
max | int32_t | Maximum value. |
step | int32_t | Keyboard and navigation increment. |
flags | mk_ui_range_flags_t | Presentation flags. |
Returns True when value changed.
mk_ui_spacerfunction
void mk_ui_spacer(mk_ui_t ui, float width, float height)
Declare empty layout space.
| Parameter | Type | Description |
|---|
ui | mk_ui_t | UI context. |
width | float | Spacer width. |
height | float | Spacer height. |
mk_ui_tabfunction
bool mk_ui_tab(mk_ui_t ui, mk_ui_id_t id, const char *label, int32_t option, int32_t *selected)
Declare one tab selector.
| Parameter | Type | Description |
|---|
ui | mk_ui_t | UI context. |
id | mk_ui_id_t | Stable tab ID. |
label | const char * | UTF-8 label. |
option | int32_t | Value represented by this tab. |
selected | int32_t * | Selected value read and updated. |
Returns True when selection changed.
mk_ui_tab_list_beginfunction
bool mk_ui_tab_list_begin(mk_ui_t ui, mk_ui_id_t id, const mk_ui_box_desc_t *desc)
Begin a tab-list container.
| Parameter | Type | Description |
|---|
ui | mk_ui_t | UI context. |
id | mk_ui_id_t | Stable list ID. |
desc | const mk_ui_box_desc_t * | Layout properties. |
Returns True when the scope opened.
mk_ui_tab_list_endfunction
void mk_ui_tab_list_end(mk_ui_t ui)
End the innermost tab-list scope.
| Parameter | Type | Description |
|---|
ui | mk_ui_t | UI context. |
mk_ui_tab_panel_beginfunction
bool mk_ui_tab_panel_begin(mk_ui_t ui, mk_ui_id_t id, bool active, const mk_ui_box_desc_t *desc)
Begin a conditionally active tab panel.
| Parameter | Type | Description |
|---|
ui | mk_ui_t | UI context. |
id | mk_ui_id_t | Stable panel ID. |
active | bool | Whether the panel is selected. |
desc | const mk_ui_box_desc_t * | Layout properties. |
Returns True when panel content should be declared.
mk_ui_tab_panel_endfunction
void mk_ui_tab_panel_end(mk_ui_t ui)
End the innermost active tab-panel scope.
| Parameter | Type | Description |
|---|
ui | mk_ui_t | UI context. |
mk_ui_textfunction
void mk_ui_text(mk_ui_t ui, mk_ui_id_t id, const mk_ui_text_desc_t *desc)
Lay out and draw shaped UTF-8 text.
| Parameter | Type | Description |
|---|
ui | mk_ui_t | UI context. |
id | mk_ui_id_t | Stable element ID. |
desc | const mk_ui_text_desc_t * | Text content and style. |
mk_ui_text_desc_initfunction
void mk_ui_text_desc_init(mk_ui_text_desc_t *desc)
Initialize a shaped-text descriptor.
| Parameter | Type | Description |
|---|
desc | mk_ui_text_desc_t * | Descriptor to initialize. |
mk_ui_text_editfunction
uint32_t mk_ui_text_edit(mk_ui_t ui, mk_ui_id_t id, const mk_ui_text_edit_desc_t *desc, mk_ui_text_buffer_t *buffer)
Declare an editable UTF-8 text field.
| Parameter | Type | Description |
|---|
ui | mk_ui_t | UI context. |
id | mk_ui_id_t | Stable widget ID. |
desc | const mk_ui_text_edit_desc_t * | Editing and presentation options. |
buffer | mk_ui_text_buffer_t * | Mutable text storage. |
Returns ORed mk_ui_edit_result_t bits.
mk_ui_text_edit_desc_initfunction
void mk_ui_text_edit_desc_init(mk_ui_text_edit_desc_t *desc)
Initialize a text-edit descriptor.
| Parameter | Type | Description |
|---|
desc | mk_ui_text_edit_desc_t * | Descriptor to initialize. |
mk_ui_text_get_selectionfunction
bool mk_ui_text_get_selection(mk_ui_t ui, mk_ui_id_t id, uint32_t *byte_start, uint32_t *byte_end)
Read the current selectable-text byte range.
| Parameter | Type | Description |
|---|
ui | mk_ui_t | UI context. |
id | mk_ui_id_t | Text element ID. |
byte_start | uint32_t * | Receives the first selected byte. |
byte_end | uint32_t * | Receives one past the last selected byte. |
Returns True when the element has a selection.
mk_ui_theme_darkfunction
mk_ui_theme_t mk_ui_theme_dark(void)
Construct the built-in dark theme.
Returns A complete dark theme.
mk_ui_theme_high_contrastfunction
mk_ui_theme_t mk_ui_theme_high_contrast(void)
Construct the built-in high-contrast theme.
Returns A complete high-contrast theme.
mk_ui_theme_lightfunction
mk_ui_theme_t mk_ui_theme_light(void)
Construct the built-in light theme.
Returns A complete light theme.
mk_ui_togglefunction
bool mk_ui_toggle(mk_ui_t ui, mk_ui_id_t id, const char *label, bool *value)
Declare a binary switch.
| Parameter | Type | Description |
|---|
ui | mk_ui_t | UI context. |
id | mk_ui_id_t | Stable widget ID. |
label | const char * | UTF-8 label. |
value | bool * | Value read and toggled on activation. |
Returns True when value changed.
mk_ui_virtual_list_beginfunction
bool mk_ui_virtual_list_begin(mk_ui_t ui, mk_ui_id_t id, const mk_ui_virtual_list_desc_t *desc, mk_ui_virtual_range_t *range)
Begin a fixed-row virtualized scroll list.
| Parameter | Type | Description |
|---|
ui | mk_ui_t | UI context. |
id | mk_ui_id_t | Stable list ID. |
desc | const mk_ui_virtual_list_desc_t * | List dimensions and row count. |
range | mk_ui_virtual_range_t * | Receives the half-open row range to declare. |
Returns True when the scope opened.
mk_ui_virtual_list_desc_initfunction
void mk_ui_virtual_list_desc_init(mk_ui_virtual_list_desc_t *desc)
Initialize a virtual-list descriptor.
| Parameter | Type | Description |
|---|
desc | mk_ui_virtual_list_desc_t * | Descriptor to initialize. |
mk_ui_virtual_list_endfunction
void mk_ui_virtual_list_end(mk_ui_t ui)
End the current virtual list.
| Parameter | Type | Description |
|---|
ui | mk_ui_t | UI context. |
mk_ui_virtual_list_item_beginfunction
bool mk_ui_virtual_list_item_begin(mk_ui_t ui, uint32_t index)
Begin one row in the current virtual list.
| Parameter | Type | Description |
|---|
ui | mk_ui_t | UI context. |
index | uint32_t | Logical row index. |
Returns True when the row scope opened.
mk_ui_virtual_list_item_endfunction
void mk_ui_virtual_list_item_end(mk_ui_t ui)
End the current virtual-list row.
| Parameter | Type | Description |
|---|
ui | mk_ui_t | UI context. |
bool mk_ui_virtual_list_scroll_to(mk_ui_t ui, mk_ui_id_t list_id, uint32_t index, mk_ui_scroll_align_t align)
Request that a virtual-list row be brought into view.
| Parameter | Type | Description |
|---|
ui | mk_ui_t | UI context. |
list_id | mk_ui_id_t | Stable list ID. |
index | uint32_t | Logical row index. |
align | mk_ui_scroll_align_t | Desired viewport alignment. |
Returns True when the request was accepted.
mk_ui_want_capture_keyboardfunction
bool mk_ui_want_capture_keyboard(mk_ui_t ui)
Query whether gameplay should yield keyboard input to the UI.
| Parameter | Type | Description |
|---|
ui | mk_ui_t | UI context. |
Returns True when keyboard input is captured.
mk_ui_want_capture_pointerfunction
bool mk_ui_want_capture_pointer(mk_ui_t ui)
Query whether gameplay should yield pointer input to the UI.
| Parameter | Type | Description |
|---|
ui | mk_ui_t | UI context. |
Returns True when pointer input is captured.
mk_ui_want_capture_textfunction
bool mk_ui_want_capture_text(mk_ui_t ui)
Query whether text input is active in the UI.
| Parameter | Type | Description |
|---|
ui | mk_ui_t | UI context. |
Returns True when text input is captured.
Typedefs
mk_ui_align_ttypedef
typedef enum mk_ui_align mk_ui_align_t
Alignment within a UI container axis.
mk_ui_box_desc_ttypedef
typedef struct mk_ui_box_desc mk_ui_box_desc_t
Layout and presentation properties for a UI box.
mk_ui_box_flags_ttypedef
typedef enum mk_ui_box_flags mk_ui_box_flags_t
Clipping, scrolling, and modal behavior for a box.
mk_ui_color_role_ttypedef
typedef enum mk_ui_color_role mk_ui_color_role_t
Theme color slots addressable by the style stack.
mk_ui_desc_ttypedef
typedef struct mk_ui_desc mk_ui_desc_t
Capacity, input, typography, theme, and navigation options for a UI context.
mk_ui_direction_ttypedef
typedef enum mk_ui_direction mk_ui_direction_t
Main-axis direction for child layout.
mk_ui_edit_result_ttypedef
typedef enum mk_ui_edit_result mk_ui_edit_result_t
Bitmask returned by mk_ui_text_edit.
mk_ui_event_mode_ttypedef
typedef enum mk_ui_event_mode mk_ui_event_mode_t
Selects automatic event subscription or manual event feeding.
mk_ui_float_role_ttypedef
typedef enum mk_ui_float_role mk_ui_float_role_t
Theme scalar slots addressable by the style stack.
mk_ui_follow_flags_ttypedef
typedef enum mk_ui_follow_flags mk_ui_follow_flags_t
System preferences a UI context follows dynamically.
mk_ui_font_role_ttypedef
typedef enum mk_ui_font_role mk_ui_font_role_t
Semantic font-family roles used by UI text.
mk_ui_frame_desc_ttypedef
typedef struct mk_ui_frame_desc mk_ui_frame_desc_t
Per-frame viewport, scale, and timing inputs.
mk_ui_frame_stats_ttypedef
typedef struct mk_ui_frame_stats mk_ui_frame_stats_t
Diagnostics collected while building and rendering the last frame.
mk_ui_id_ttypedef
typedef uint64_t mk_ui_id_t
Stable identifier for a UI element within its ID scope.
mk_ui_insets_ttypedef
typedef struct mk_ui_insets mk_ui_insets_t
Logical inset values for the four sides of a box.
mk_ui_motion_ttypedef
typedef struct mk_ui_motion mk_ui_motion_t
Durations and easing for built-in UI state transitions.
mk_ui_navigation_flags_ttypedef
typedef enum mk_ui_navigation_flags mk_ui_navigation_flags_t
Discrete navigation actions supplied to a UI context.
mk_ui_navigation_ttypedef
typedef struct mk_ui_navigation mk_ui_navigation_t
Directional and discrete navigation state for one feed operation.
mk_ui_presence_desc_ttypedef
typedef struct mk_ui_presence_desc mk_ui_presence_desc_t
Enter and exit transition settings for conditionally present content.
mk_ui_range_flags_ttypedef
typedef enum mk_ui_range_flags mk_ui_range_flags_t
Presentation options for range and numeric widgets.
typedef enum mk_ui_scroll_align mk_ui_scroll_align_t
Alignment used when scrolling a virtual-list item into view.
mk_ui_semantics_ttypedef
typedef struct mk_ui_semantics mk_ui_semantics_t
Accessibility metadata applied to the next declared element.
mk_ui_size_kind_ttypedef
typedef enum mk_ui_size_kind mk_ui_size_kind_t
Constraint model for one box dimension.
mk_ui_size_ttypedef
typedef struct mk_ui_size mk_ui_size_t
Size constraint for one UI box dimension.
mk_ui_ttypedef
typedef struct mk_ui* mk_ui_t
Opaque immediate-mode UI context handle.
mk_ui_text_buffer_ttypedef
typedef struct mk_ui_text_buffer mk_ui_text_buffer_t
Mutable UTF-8 storage used by text-edit widgets.
mk_ui_text_desc_ttypedef
typedef struct mk_ui_text_desc mk_ui_text_desc_t
Shaped-text content, style, wrapping, and selection options.
mk_ui_text_edit_desc_ttypedef
typedef struct mk_ui_text_edit_desc mk_ui_text_edit_desc_t
Presentation and input-mode options for an editable text field.
mk_ui_text_edit_flags_ttypedef
typedef enum mk_ui_text_edit_flags mk_ui_text_edit_flags_t
Behavior flags for an editable text field.
mk_ui_text_flags_ttypedef
typedef enum mk_ui_text_flags mk_ui_text_flags_t
Optional behavior for static text.
mk_ui_theme_ttypedef
typedef struct mk_ui_theme mk_ui_theme_t
Complete color and size palette for built-in widgets.
mk_ui_virtual_list_desc_ttypedef
typedef struct mk_ui_virtual_list_desc mk_ui_virtual_list_desc_t
Fixed-row virtual-list layout and capacity options.
mk_ui_virtual_range_ttypedef
typedef struct mk_ui_virtual_range mk_ui_virtual_range_t
Half-open range of virtual-list rows that should be declared.