|
RMGui 0.15.0
C11 retained-mode UI library: layout kernel, style schema, widget painters, fonts, software framebuffer
|
focus.h — keyboard focus over a layout kernel's published tree. More...
Enumerations | |
| enum | rmgui_focus_direction_t { RMGUI_FOCUS_DIRECTION_NEXT , RMGUI_FOCUS_DIRECTION_PREVIOUS } |
Functions | |
| int | rmgui_focus_traverse (rmgui_layout_t *k, size_t root, rmgui_focus_direction_t direction, size_t *out_index) |
| Moves focus to the next or previous focusable node of the scope under root, wrapping at the ends (from no focus: the first / the last). | |
| int | rmgui_focus_node (const rmgui_layout_t *k, size_t *index) |
| 0 with *index set to the focused node; -1 when nothing is focused. | |
| int | rmgui_focus_set (rmgui_layout_t *k, size_t index) |
| Focuses node index when it is focusable in the current scope of the published snapshot's root. | |
| int | rmgui_focus_clear (rmgui_layout_t *k) |
| Clears the focus: afterwards rmgui_focus_node reports none and the next rmgui_focus_traverse starts from an end. | |
focus.h — keyboard focus over a layout kernel's published tree.
A node is focusable when it is declared focusable, published visible and unclipped, and every ancestor up to the current scope is shown. The scope is the frontmost POPUP or MODAL overlay when one is published, else the given root; nodes inside other overlays are outside it, except that a scope that is the published root also holds each MODELESS layer whose overlays up to that root are all MODELESS (rmgui_layout_overlay_mode_t). Order is tree preorder: the root's tree, then those MODELESS layers in z-order.
| int rmgui_focus_traverse | ( | rmgui_layout_t * | k, |
| size_t | root, | ||
| rmgui_focus_direction_t | direction, | ||
| size_t * | out_index ) |
Moves focus to the next or previous focusable node of the scope under root, wrapping at the ends (from no focus: the first / the last).
0: focus moved to *out_index (if non-NULL). -1: bad arguments, no published snapshot, or nothing focusable; focus unchanged.
| int rmgui_focus_node | ( | const rmgui_layout_t * | k, |
| size_t * | index ) |
0 with *index set to the focused node; -1 when nothing is focused.
| int rmgui_focus_set | ( | rmgui_layout_t * | k, |
| size_t | index ) |
Focuses node index when it is focusable in the current scope of the published snapshot's root.
-1: not focusable or bad arguments; focus unchanged.
| int rmgui_focus_clear | ( | rmgui_layout_t * | k | ) |
Clears the focus: afterwards rmgui_focus_node reports none and the next rmgui_focus_traverse starts from an end.
0, also when nothing was focused; -1 when k is NULL.