aboutsummaryrefslogtreecommitdiff
path: root/clients/tui.h
diff options
context:
space:
mode:
authorAnders Betts <anders.betts@gmail.com>2026-09-20 10:24:18 +0200
committerAnders Betts <anders.betts@gmail.com>2026-09-20 10:24:18 +0200
commitae60b7d2c87cc9ed6878faa57cd4233f77f6f7c3 (patch)
tree918e717a5d226dcd54890901682a980c41d7e1d0 /clients/tui.h
parent5097941fa96ce0c309e5f1af034993781a70fc66 (diff)
downloadbokf-ae60b7d2c87cc9ed6878faa57cd4233f77f6f7c3.tar.gz
bokf-ae60b7d2c87cc9ed6878faa57cd4233f77f6f7c3.zip
tui: pinned report headers, voucher detail headers, clamped pagingv0.1.48
Diffstat (limited to 'clients/tui.h')
-rw-r--r--clients/tui.h15
1 files changed, 13 insertions, 2 deletions
diff --git a/clients/tui.h b/clients/tui.h
index fcab5b7..6df27fb 100644
--- a/clients/tui.h
+++ b/clients/tui.h
@@ -37,13 +37,20 @@ void tui_style(enum tui_style s);
void tui_style_reset(void);
/* Pager line markup. A leading marker selects a style; \x03 is a rule and
- is drawn full width as ACS_HLINE. tui_markup returns the text after the
- marker and sets *style to the matching style, or -1 for plain text. */
+ is drawn full width as ACS_HLINE; \x04 pins the line as a column header
+ above the scrolling body. tui_markup returns the text after the marker(s)
+ and sets *style to the matching style, or -1 for plain text. */
#define TUI_MARK_HEADING 0x01
#define TUI_MARK_DIM 0x02
#define TUI_MARK_RULE 0x03
+#define TUI_MARK_STICKY 0x04
const char *tui_markup(const char *line, int *style);
+/* Moves sticky-marked lines from lines[] to head[] (both in input order),
+ compacts the remaining body lines in lines[] and returns the body count.
+ head must hold at least n pointers and must not alias lines. Pure. */
+int tui_sticky_split(char **lines, int n, char **head, int *nhead);
+
/* Key hooks: widgets call the screen's hook for keys they do not handle. */
#define TUI_HOOK_NONE 0 /* not handled: process the key normally */
#define TUI_HOOK_STAY 1 /* handled: redraw and keep the widget up */
@@ -213,6 +220,10 @@ int tui_form_focus_store(int *focus, int sel, int ret);
are skipped and the ring wraps. dir +1 = Tab/Down, -1 = Shift-Tab/Up. */
int tui_form_act_step(int focus, int nf, const struct tui_form_action *acts,
int na, int dir);
+/* Like tui_form_act_step, but pages (up to TUI_FORM_PAGE rows) and stops at
+ the first/last selectable row instead of wrapping. dir +1 = PgDn. */
+int tui_form_act_page(int focus, int nf, const struct tui_form_action *acts,
+ int na, int dir);
/* Same ring for one key, plus Home/End/PgUp/PgDn and the form return keys
(F5/^Enter/F9/Esc/q). Returns the new focus, a TUI_FORM_* code or
TUI_NAV_NONE. */