41 lines
1.4 KiB
C
41 lines
1.4 KiB
C
#ifndef TUI_H
|
|
#define TUI_H
|
|
|
|
#include "tui_ncurses.h"
|
|
|
|
#define TUI_KEY_RESIZE -2
|
|
#define NT_HK(first, rest) "\033[4m" first "\033[0m" rest
|
|
|
|
/* printf-like writer into the body window; appends newline. Tracks cursor row. */
|
|
void nt_print(const char *fmt, ...);
|
|
/* Reset body window cursor to top + werase */
|
|
void nt_print_reset(void);
|
|
/* Bracket external editor spawn: cleanup curses, run spawn, re-init curses */
|
|
int nt_run_external_editor(int (*spawn)(void *user), void *user);
|
|
/* Build a TuiFrame with the current app title + given breadcrumb */
|
|
TuiFrame nt_frame(const char *breadcrumb);
|
|
/* Build a TuiStatus with current user info */
|
|
TuiStatus nt_status(void);
|
|
/* Set the app name/version used by nt_frame */
|
|
void nt_set_app_info(const char *name, const char *version);
|
|
/* OSC 2 window title (orthogonal to ncurses) */
|
|
void nt_set_window_title(const char *title);
|
|
|
|
/* Set the user label shown in the header. NULL or "" hides it. */
|
|
void nt_set_user(const char *user);
|
|
|
|
/* Footer-log: append a timestamped line to the global log ring buffer.
|
|
* The latest line is shown in the footer status area. */
|
|
void nt_log(const char *fmt, ...);
|
|
|
|
/* Open the full log in a scrollable pager (calls tuin_pager_run). */
|
|
void nt_log_show(void);
|
|
|
|
/* Clear the log buffer. */
|
|
void nt_log_clear(void);
|
|
|
|
/* Show arbitrary text in a full-screen scrollable pager. */
|
|
void nt_pager_show_text(const char *breadcrumb, const char *text);
|
|
|
|
#endif /* TUI_H */
|