|
RMGui 0.15.0
C11 retained-mode UI library: layout kernel, style schema, widget painters, fonts, software framebuffer
|
Tree projection over a caller-owned indexed model. More...
#include "list_row.h"Data Structures | |
| struct | rmgui_tree_t |
| The model contains the currently visible preorder projection. More... | |
Functions | |
| int | rmgui_tree_init (rmgui_tree_t *, rmgui_model_t *, int indent, rmgui_model_selection_t, uint64_t *, size_t) |
| Initializes caller state; indent > 0; model.expand is required. | |
| int | rmgui_tree_expand (rmgui_tree_t *, uint64_t id, int expanded) |
| Expand/collapse a current row by stable ID. | |
| int | rmgui_tree_expand_all (rmgui_tree_t *, int expanded, size_t budget, size_t *out) |
| Visit at most budget rows; budget > 0. | |
| int | rmgui_tree_input (rmgui_tree_t *, rmgui_rect_t, const rmgui_input_t *, const rmgui_model_painter_t *, rmgui_model_result_t *) |
| Right expands, Left collapses or focuses the nearest visible parent; disclosure clicks and double clicks toggle expansion. | |
| int | rmgui_tree_paint_to (rmgui_target_t *, rmgui_font_t *, rmgui_tree_t *, const rmgui_model_style_t *, rmgui_rect_t, rmgui_rect_t, const rmgui_model_painter_t *) |
| Pure visible-row painter. | |
| int | rmgui_tree_prepare (const rmgui_ui_t *, rmgui_tree_t *, const rmgui_model_appearance_t *, rmgui_rect_t viewport) |
| Prepare visible tree labels before recording, using the same indentation and clip as drawing. | |
| int | rmgui_tree_draw (const rmgui_ui_t *, rmgui_tree_t *, const rmgui_model_appearance_t *, rmgui_rect_t viewport) |
| Draw the tree in viewport using its resolved appearance. | |
Tree projection over a caller-owned indexed model.
| int rmgui_tree_init | ( | rmgui_tree_t * | , |
| rmgui_model_t * | , | ||
| int | indent, | ||
| rmgui_model_selection_t | , | ||
| uint64_t * | , | ||
| size_t | ) |
Initializes caller state; indent > 0; model.expand is required.
Initialization returns 0 or -1, leaving out/storage unchanged on refusal.
| int rmgui_tree_expand | ( | rmgui_tree_t * | , |
| uint64_t | id, | ||
| int | expanded ) |
Expand/collapse a current row by stable ID.
Leaves selection/focus IDs untouched, including IDs temporarily hidden under a collapsed parent.
| int rmgui_tree_expand_all | ( | rmgui_tree_t * | , |
| int | expanded, | ||
| size_t | budget, | ||
| size_t * | out ) |
Visit at most budget rows; budget > 0.
Returns 0 when complete, +1 for partial progress (budget exhausted, or a later accessor/expansion refused). out receives the successful callback count for 0/+1; earlier callbacks remain committed. Returns -1 only before mutation, leaving out unchanged, for invalid arguments or an initial refusal. Collapse walks backwards.
| int rmgui_tree_input | ( | rmgui_tree_t * | , |
| rmgui_rect_t | , | ||
| const rmgui_input_t * | , | ||
| const rmgui_model_painter_t * | , | ||
| rmgui_model_result_t * | ) |
Right expands, Left collapses or focuses the nearest visible parent; disclosure clicks and double clicks toggle expansion.
Other events use model selection, navigation, type-ahead and host drag semantics.
| int rmgui_tree_paint_to | ( | rmgui_target_t * | , |
| rmgui_font_t * | , | ||
| rmgui_tree_t * | , | ||
| const rmgui_model_style_t * | , | ||
| rmgui_rect_t | , | ||
| rmgui_rect_t | , | ||
| const rmgui_model_painter_t * | ) |
Pure visible-row painter.
Style is resolved by caller extension classes; disclosure marks use clipped rect primitives, with CPU/RECORD parity.
| int rmgui_tree_prepare | ( | const rmgui_ui_t * | , |
| rmgui_tree_t * | , | ||
| const rmgui_model_appearance_t * | , | ||
| rmgui_rect_t | viewport ) |
Prepare visible tree labels before recording, using the same indentation and clip as drawing.
CPU targets do no work. Updates visible-range counters on the record path. Returns 0 on success, -1 on error.
| int rmgui_tree_draw | ( | const rmgui_ui_t * | , |
| rmgui_tree_t * | , | ||
| const rmgui_model_appearance_t * | , | ||
| rmgui_rect_t | viewport ) |
Draw the tree in viewport using its resolved appearance.
Returns -1 for invalid arguments or model errors, otherwise 0; paint errors latch on the target. Route input with rmgui_tree_input.