C-Menu 0.2.9
A User Interface Toolkit
Loading...
Searching...
No Matches
ui_backend.h
Go to the documentation of this file.
1#pragma once
2
3#ifdef __cplusplus
4extern "C" {
5#endif
6
7/** @defgroup ui_backend Ui Backend
8 @file ui_backend.h
9 @ingroup ui_backend
10 @brief Backend API for terminal UI library
11*/
12#define _XOPEN_SOURCE_EXTENDED 1
13#define _GNU_SOURCE
14
15#ifdef UAL_UI
16#define NCURSES_WIDECHAR 1
17#include <ncursesw/ncurses.h>
18#include <ncursesw/panel.h>
19// #include "../ui/ui_ncurses_internal.h"
20#endif
21#ifdef NOTCURSES_UI
22#include <notcurses/notcurses.h>
23// #include "../ui/ui_notcurses_internal.h"
24#endif
25#include <poll.h>
26#include <stdbool.h>
27#include <stddef.h>
28#include <stdint.h>
29extern int sfc_ptr;
30extern int win_ptr;
31extern bool f_ncurses_open;
32extern bool f_notcurses_open;
33// ---------------------------------------------------------------
34// Surface enums
35// ---------------------------------------------------------------
36#define SUB_SURFACE_LIST(X)
37 X(BOX)
38 X(WIN)
39 X(WIN2)
40 X(LNNO)
41 X(CMDLN)
42 X(PAD)
43 X(WIN3)
44#define AS_ENUM(NAME) NAME,
45typedef enum {
46 SUB_SURFACE_LIST(AS_ENUM)
48} ss_t;
49#define CHYRON_KEY_MAXLEN 64 /**< maximum length of the command text */
50#define CHYRON_KEYS 20 /**< maximum number of key bindings for the chyron */
51
52#define MOUSE_ACTION(X)
53 X(UI_MOUSE_NONE)
54 X(UI_MOUSE_PRESS)
55 X(UI_MOUSE_RELEASE)
56 X(UI_MOUSE_DRAG)
57 X(UI_MOUSE_SCROLL_UP)
58 X(UI_MOUSE_SCROLL_DOWN)
59#define AS_ENUM(NAME) NAME,
60typedef enum {
61 MOUSE_ACTION(AS_ENUM)
63} UiMouseAction;
64
65typedef uint32_t UiKey;
66// ---------------------------------------------------------------
67// Logging enums
68// ---------------------------------------------------------------
69#define LOG_LEVEL_LIST(X)
70 X(FATAL)
71 X(ERROR)
72 X(WARN)
73 X(INFO)
74 X(VERBOSE)
75 X(DEBUG)
76 X(SILENT)
77#define AS_ENUM(NAME) NAME,
78typedef enum {
79 LOG_LEVEL_LIST(AS_ENUM)
81} UiLogLevel;
82// ---------------------------------------------------------------
83// File Types
84// ---------------------------------------------------------------
85#define FILE_TYPE_LIST(X)
86 X(FT_TEXT)
87 X(FT_IMAGE)
88 X(FT_VIDEO)
89 X(FT_AUDIO)
90 X(FT_BINARY_GARBAGE)
91 X(FT_EMPTY)
92 X(FT_UNREADABLE)
93#define AS_ENUM(NAME) NAME,
94typedef enum {
95 FILE_TYPE_LIST(AS_ENUM)
97} FileType;
98// ---------------------------------------------------------------
99// Input
100// ---------------------------------------------------------------
101
102typedef struct {
104 uint32_t ch; /* Unicode codepoint when key == UIKEY_CHAR */
105 bool alt;
106 bool ctrl;
107 bool shift;
108 uint y;
109 uint x;
110 bool active;
112 ss_t in_win;
114 UiMouseAction mouse_action;
116 char keybound[16];
117} UiEvent;
118
119typedef struct {
120 union {
121 uint32_t u32;
122 wchar_t w32;
123 char c[4];
124 };
125} GCluster;
126
127// ---------------------------------------------------------------
128// Multiplexed input
129// ---------------------------------------------------------------
130// Number of registry entries for external file descriptors
131#define MAX_EXT_FDS 8
132// #define UIKEY_STREAM_DATA (-2) (octal 740)
133// registry for external file descriptors
134typedef struct {
135 int fd;
137} ext_fd_reg_t;
138
139// UI input context structure
140typedef struct {
143 ext_fd_reg_t ext_fds[MAX_EXT_FDS];
144 nfds_t ext_nfds;
145} ui_context_t;
146
147extern ui_context_t ui_ctx;
148
149// ---------------------------------------------------------------
150
151// Miscelaneous UI Structures
152typedef struct UiRuntime UiRuntime;
153typedef struct SIO SIO;
154typedef struct UiSurface UiSurface;
155typedef struct UiSplitSurface UiSplitSurface;
156typedef union UiChannels UiChannels;
157typedef struct UiMB UiMB;
158typedef uint16_t UiStyle;
159typedef uint16_t UiPairIdx;
160typedef uint UiColorIdx;
161typedef struct ncinput NcInput;
162typedef struct ncvisual NcVisual;
163
164typedef struct {
165 wchar_t wc; // Wide character 4-bytes
166 short attrs; // attributes 2-bytes
167 short color_pair; // color pair index 2-bytes
168} UiCchar64; // total 8-bytes
169
170#define BORDER_STYLE(X)
171 X(UI_BORDER_NONE)
172 X(UI_BORDER_SINGLE)
173 X(UI_BORDER_DOUBLE)
174 X(UI_BORDER_ROUNDED)
175 X(UI_BORDER_HEAVY)
176#define AS_ENUM(NAME) NAME,
177typedef enum {
178 BORDER_STYLE(AS_ENUM)
180} UiBorderStyle;
181
182typedef struct {
183 int y;
184 int x;
185 int lines;
186 int cols;
187} UiRect;
188
189// ---------------------------------------------------------------
190// Configuration
191// ---------------------------------------------------------------
192#define CCHARW_MAX 5
193#define UI_COLORS 512
194#define UI_PAIRS 512
195#define ALLWINS (uint)1000
196#define UI_SFC_MAX 30
197#define SFC_MAX 30
198#define MAXLEN 256
199extern char em0[MAXLEN]; /**< error message string for error messages */
200extern char em1[MAXLEN]; /**< error message string for error messages */
201extern char em2[MAXLEN]; /**< error message string for error messages */
202extern char em3[MAXLEN]; /**< error message string for error messages */
203
204#ifdef UAL_UI
205// ---------------------------------------------------------------
206// UAL_UI Specific
207// ---------------------------------------------------------------
208extern bool f_curses_open;
209typedef cchar_t UiCell;
210typedef struct {
211 uint r, g, b;
212} STDRGB;
213typedef struct {
214 int r, g, b;
215} RGB;
216struct UiRuntime {
217 SCREEN *screen; /**< NCurses SCREEN created by newterm() */
218 FILE *tty_fp; /**< TTY file handle opened by ui_init() */
219 int tty_fd; /**< TTY file descriptor opened by ui_init() */
220 bool mouse_enabled;
221 bool alt_screen;
222 bool cursor_visible;
223 UiBorderStyle border_style;
224 uint lines;
225 uint cols;
226 PANEL *panel_main;
227 SIO *sio;
228};
229struct UiSurfaceMeta {
230 unsigned int y;
231 unsigned int x;
232 unsigned int lines;
233 unsigned int cols;
234 cchar_t bkgd_cell;
235 bool hidden;
236 char name[MAXLEN];
237 char title[MAXLEN];
238};
239struct UiSurface {
240 union {
241 struct { // DEPRECATED - will be removed
242 PANEL *box_pan;
243 PANEL *win_pan;
244 PANEL *win2_pan;
245 PANEL *lnno_pan;
246 PANEL *cmdln_pan;
247 PANEL *pad_pan;
248 PANEL *plane1_pan;
249 PANEL *plane2_pan;
250 }; // END DEPRECATION
251 struct {
252 PANEL *mpan[SUB_SFC_MAX];
253 };
254 };
255 union {
256 struct { // DEPRECATED - will be removed
257 WINDOW *box;
258 WINDOW *win;
259 WINDOW *win2;
260 WINDOW *lnno;
261 WINDOW *cmdln;
262 WINDOW *pad;
263 WINDOW *plane1;
264 WINDOW *plane2;
265 }; // END DEPRECATION
266 struct {
267 WINDOW *mwin[SUB_SFC_MAX];
268 };
269 };
270 struct UiRuntime *runtime;
271 struct UiSurfaceMeta meta[SUB_SFC_MAX];
272 struct UiSurface *parent;
273 int sfc_idx;
274 int sub_cnt;
275};
276union UiChannels {
277 struct {
278 union {
279 struct {
280 uint8_t b_b, b_g, b_r, b_a;
281 };
282 uint32_t bargb;
283 };
284 union {
285 struct {
286 uint8_t f_b, f_g, f_r, f_a;
287 };
288 uint32_t fargb;
289 };
290 };
291 uint64_t fb;
292};
293struct UiStyle {
294 wchar_t wstr[5];
295 attr_t attrs;
296 short cp;
297};
298#else
299// ---------------------------------------------------------------
300// Notcurses Specific
301// ---------------------------------------------------------------
302typedef struct {
303 uint8_t r, g, b;
304} STDRGB;
305typedef struct {
306 union {
307 struct {
308 uint8_t b, g, r, a;
309 };
310 uint32_t color;
311 };
312} RGB;
313
314struct UiRuntime {
315 struct notcurses *nc;
316 bool mouse_enabled;
317 bool alt_screen;
318 bool cursor_visible;
319 UiBorderStyle border_style;
320 unsigned int lines;
321 unsigned int cols;
322 FILE *tty_fp;
323 int tty_fd;
324 SIO *sio;
325};
326
327struct UiSurfaceMeta {
328 unsigned int y;
329 unsigned int x;
330 unsigned int lines;
331 unsigned int cols;
332 struct nccell bkgd_cell;
333 bool hidden;
334 char name[MAXLEN];
335 char title[MAXLEN];
336};
337
338struct UiSurface {
339 union {
340 struct { // DEPRECATED - will be removed
341 struct ncplane *box;
342 struct ncplane *win;
343 struct ncplane *win2;
344 struct ncplane *lnno;
345 struct ncplane *cmdln;
346 struct ncplane *pad;
347 struct ncplane *plane1;
348 struct ncplane *plane2;
349 }; // END DEPRECATION
350 struct {
351 struct ncplane *mplane[SUB_SFC_MAX];
352 };
353 };
354 struct UiSurfaceMeta meta[SUB_SFC_MAX];
355 struct UiRuntime *runtime;
356 struct UiSurface *parent;
357 int sfc_idx;
358 int sub_cnt;
359};
360
361union UiChannels {
362 struct {
363 union {
364 struct {
365 uint8_t b_b, b_g, b_r, b_a;
366 };
367 uint32_t bargb;
368 };
369 union {
370 struct {
371 uint8_t f_b, f_g, f_r, f_a;
372 };
373 uint32_t fargb;
374 };
375 };
376 uint64_t fb;
377};
378
379struct UiCell {
380 union {
381 uint32_t gcluster;
382 uint32_t u32;
383 // wchar_t u16[2];
384 uint8_t u8[4];
385 char c[4];
386 };
387 char gcluster_backstop;
388 uint8_t width;
389 uint16_t stylemask;
390 uint32_t chhannels;
391 union {
392 struct {
393 union {
394 struct {
395 uint8_t b_b, b_g, b_r, b_a;
396 };
397 uint32_t bargb;
398 };
399 union {
400 struct {
401 uint8_t f_b, f_g, f_r, f_a;
402 };
403 uint32_t fargb;
404 };
405 };
406 uint64_t channels;
407 };
408};
409
410// ---------------------------------------------------------------------------
411// About typedefs
412// ---------------------------------------------------------------------------
413// Linus doesn't consider typedefs for inclusion into the linux kernel because
414// they can obscure the underlying type leading to performance destroying
415// pass-by-value mistakes. We use them to improve code readibility and
416// maintainability while aware of that caveat.
417typedef uint16_t attr_t;
418typedef nccell UiCell;
419typedef struct ncplane NcPlane;
420typedef struct notcurses NotCurses;
421typedef struct notcurses_options NotCursesOptions;
422typedef struct ncplane_options NcPlaneOptions;
423typedef struct UiPair UiPair;
424typedef struct UiColor UiColor;
425extern NcPlane *stdplane;
426extern uint LINES, COLS;
427#define ERR -1
428#define CELL_CHAR_INITIALIZER(c) {
429 .gcluster = (c),
430 .gcluster_backstop = 0,
431 .stylemask = 0,
432 .channels = 0, \
433}
434#define CELL_INITIALIZER(c, s, chan) {
435 .gcluster = (c),
436 .gcluster_backstop = 0,
437 .stylemask = (s),
438 .channels = (chan), \
439}
440#endif
441
442extern UiSurface *stdsfc;
443
444typedef struct {
445 UiBorderStyle border_style;
446 char *log_file; /**< log_file name or NULL for no logging */
447 UiLogLevel log_level; /**< log_level FATAL, ERROR, WARN, INFO, VERBOSE,
448 DEBUG, SILENT */
449} UiConfig;
450
451typedef enum {
452 UI_BACKEND_NCURSES = 0, /**< NCurses / NCursesW backend */
453 UI_BACKEND_NOTCURSES /**< NotCurses backend */
454} UiBackend;
455
456typedef struct {
457 bool truecolor; /**< backend can display 24-bit RGB colors */
458 bool palette256; /**< backend supports at least 256 palette entries */
459 bool mouse; /**< backend can deliver mouse events */
460 bool unicode; /**< backend handles full Unicode / UTF-8 correctly */
461 bool resize; /**< backend emits UIKEY_RESIZE on terminal resize */
462 int color_pairs; /**< max simultaneous color pairs; 0 = unlimited */
463} UiCaps;
464
465extern int click_y; /**< the y coordinate of a mouse click */
466extern int click_x; /**< the x coordinate of a mouse click */
467
468// ---------------------------------------------------------------
469// Colors
470// ---------------------------------------------------------------
471extern ushort cp_default; /**< default color pair index */
472extern ushort cp_box; /**< box color pair index */
473extern ushort cp_ind; /**< indicator color pair index */
474extern ushort cp_bold; /**< bold color pair index */
475extern ushort cp_title; /**< title color pair index */
476extern ushort cp_highlight; /**< highlight color pair index */
477extern ushort cp_fill_char; /**< fill character color pair index */
478extern ushort cp_brackets; /**< color pair index for field brackets */
479extern ushort cp_nt; /**< normal color pair index */
480extern ushort cp_nt_rev; /**< reverse color pair index */
481extern ushort cp_nt_hl; /**< highlight color pair index */
482extern ushort cp_nt_hl_rev; /**< highlight reverse color pair index */
483extern ushort cp_ln_fg; /**< line number color pair index */
484extern ushort cp_ln_bg; /**< line number background color pair index */
485extern ushort cp_cmdln_fg; /**< command line number color pair index */
486extern ushort cp_cmdln_bg; /**< command line number background color pair index */
487extern ushort cp_red; /**< red background color pair index */
488extern ushort cp_green; /**< green background color pair index */
489extern ushort cp_yellow; /**< yellow background color pair index */
490extern ushort cp_blue; /**< blue background color pair index */
491extern uint clr_idx; /**< current color index */
492extern uint clr_cnt; /**< number of colors used */
493extern uint clr_pair_idx; /**< current color pair index */
494extern uint clr_pair_cnt; /**< number of color pairs supported by the terminal */
495
496extern char const colors_text[][10]; /**< color codes for the 16 basic colors */
497
498#define COLOR_LEN 8 /**< length of color code strings */
499#define FG_COLOR 2 /**< default foreground color */
500#define BG_COLOR 0 /**< default background color */
501#define BO_COLOR 1 /**< default bold foreground color */
502#define LN_COLOR 4 /**< default line number color */
503#define LN_BG_COLOR 7 /**< default line number background */
504
505typedef enum {
548} ColorsEnum;
549
550// ---------------------------------------------------------------
551// Borders
552// ---------------------------------------------------------------
553
554/** BOX WIDE UNICODE CODEPOINTS */
555
556extern const wchar_t *border_single;
557extern const wchar_t *border_double;
558extern const wchar_t *border_rounded;
559extern const wchar_t *border_heavy;
560extern const wchar_t *border_none;
561
562typedef union border_wide {
563 wchar_t str[11];
564 struct {
565 wchar_t ho; /**< horizontal line */
566 wchar_t ve; /**< vertical line */
567 wchar_t lt; /**< left tee */
568 wchar_t rt; /**< right tee */
569 wchar_t tt; /**< top tee */
570 wchar_t bt; /**< bottom tee */
571 wchar_t cr; /**< cross */
572 wchar_t tl; /**< top left */
573 wchar_t tr; /**< top right */
574 wchar_t bl; /**< bottom left */
575 wchar_t br; /**< bottom right */
576 };
577} BorderWide;
578
579// Temporary macros to access the border wide characters more easily
580
581#define bw_ho bw.ho
582#define bw_ve bw.ve
583#define bw_lt bw.lt
584#define bw_rt bw.rt
585#define bw_tt bw.tt
586#define bw_bt bw.bt
587#define bw_cr bw.cr
588#define bw_tl bw.tl
589#define bw_tr bw.tr
590#define bw_bl bw.bl
591#define bw_br bw.br
592
593extern BorderWide bw;
594extern const wchar_t *bw_rtl;
595extern const wchar_t *bw_rtr;
596extern const wchar_t *bw_rbl;
597extern const wchar_t *bw_rbr;
598extern const wchar_t *bw_sp;
599extern const wchar_t *bw_ra;
600extern const wchar_t *bw_la;
601extern const wchar_t *bw_ua;
602extern const wchar_t *bw_da;
603extern const wchar_t *bw_ran;
604extern const wchar_t *bw_lan;
605extern const wchar_t *bw_chk;
606extern const wchar_t *bw_h09;
607
608extern UiCell cell_default;
609extern UiCell cell_fill_char;
610extern UiCell cell_brktl;
611extern UiCell cell_brktr;
612extern UiCell cell_nt;
613extern UiCell cell_nt_rev;
614extern UiCell cell_nt_hl;
615extern UiCell cell_nt_hl_rev;
616extern UiCell cell_box;
617extern UiCell cell_ind;
618extern UiCell cell_cmdln;
619extern UiCell cell_title;
620extern UiCell cell_ln;
621extern UiCell cell_ran;
622extern UiCell cell_chk;
623extern UiCell cell_ls;
624extern UiCell cell_rs;
625extern UiCell cell_ts;
626extern UiCell cell_bs;
627extern UiCell cell_tl;
628extern UiCell cell_tr;
629extern UiCell cell_ho;
630extern UiCell cell_ve;
631extern UiCell cell_bl;
632extern UiCell cell_br;
633extern UiCell cell_lt;
634extern UiCell cell_rt;
635extern UiCell cell_tt;
636extern UiCell cell_bt;
637extern UiCell cell_cr;
638extern UiCell cell_sp;
639
640#define XTERM_256COLOR 1
641#if defined(XTERM_256COLOR)
642#define KEY_ALTINS 0x223
643#define KEY_ALTHOME 0x21e
644#define KEY_ALTPGUP 0x232
645#define KEY_ALTDEL 0x20e
646#define KEY_ALTEND 0x219
647#define KEY_ALTPGDN 0x22d
648#define KEY_ALTUP 0x23d
649#define KEY_ALTLEFT 0x228
650#define KEY_ALTDOWN 0x214
651#define KEY_ALTRIGHT 0x237
652#elif defined(XTERM_GHOSTTY)
653#define KEY_ALTINS 0x228
654#define KEY_ALTHOME 0x223
655#define KEY_ALTPGUP 0x237
656#define KEY_ALTDEL 0x213
657#define KEY_ALTEND 0x21e
658#define KEY_ALTPGDN 0x232
659#define KEY_ALTUP 0x242
660#define KEY_ALTLEFT 0x22d
661#define KEY_ALTDOWN 0x219
662#define KEY_ALTRIGHT 0x23c
663#endif
664
665static inline int unicode_to_utf8_gcluster(uint32_t cp, GCluster *g) {
666 if (cp <= 0x7F) {
667 g->c[0] = (char)cp;
668 g->c[1] = '\0';
669 return 1;
670 } else if (cp <= 0x7FF) {
671 g->c[0] = (char)(0xC0 | (cp >> 6));
672 g->c[1] = (char)(0x80 | (cp & 0x3F));
673 g->c[2] = '\0';
674 return 2;
675 } else if (cp <= 0xFFFF) {
676 g->c[0] = (char)(0xE0 | (cp >> 12));
677 g->c[1] = (char)(0x80 | ((cp >> 6) & 0x3F));
678 g->c[2] = (char)(0x80 | (cp & 0x3F));
679 g->c[3] = '\0';
680 return 3;
681 } else if (cp <= 0x10FFFF) {
682 g->c[0] = (char)(0xF0 | (cp >> 18));
683 g->c[1] = (char)(0x80 | ((cp >> 12) & 0x3F));
684 g->c[2] = (char)(0x80 | ((cp >> 6) & 0x3F));
685 g->c[3] = (char)(0x80 | (cp & 0x3F));
686 return 4;
687 }
688 return 0;
689}
690
691struct SIO {
692 double red_gamma; /**< red gamma correction value */
693 double green_gamma; /**< green gamma correction value */
694 double blue_gamma; /**< blue gamma correction value */
695 double gray_gamma; /**< gray gamma correction value */
696 uint32_t black; /**< black */
697 uint32_t red; /**< red */
698 uint32_t green; /**< green */
699 uint32_t yellow; /**< yellow */
700 uint32_t blue; /**< blue */
701 uint32_t magenta; /**< magenta */
702 uint32_t cyan; /**< cyan */
703 uint32_t white; /**< white */
704 uint32_t orange; /**< orange */
705 uint32_t bblack; /**< bold black */
706 uint32_t bred; /**< bold red */
707 uint32_t bgreen; /**< bold green */
708 uint32_t byellow; /**< bold yellow */
709 uint32_t bblue; /**< bold blue */
710 uint32_t bmagenta; /**< bold magenta */
711 uint32_t bcyan; /**< bold cyan */
712 uint32_t bwhite; /**< bold white */
713 uint32_t borange; /**< bold orange */
714 uint32_t abg; /**< background with alpha */
715 uint32_t fg; /**< foreground color */
716 uint32_t bg; /**< background color */
717 uint32_t box_fg; /**< box foreground */
718 uint32_t box_bg; /**< box background */
719 uint32_t ind_fg; /**< indicator foreground */
720 uint32_t ind_bg; /**< indicator background */
721 uint32_t brackets_fg; /**< brackets foreground */
722 uint32_t brackets_bg; /**< brackets background */
723 uint32_t fill_char_fg; /**< fill character foreground */
724 uint32_t fill_char_bg; /**< fill character background */
725 uint32_t ln_fg; /**< line number color index */
726 uint32_t ln_bg; /**< line number background index */
727 uint32_t cmdln_fg; /**< command line color index */
728 uint32_t cmdln_bg; /**< command line background index */
729 uint32_t nt_fg; /**< normal text foreground */
730 uint32_t nt_bg; /**< normal text background */
731 uint32_t nt_rev_fg; /**< normal text reverse foreground */
732 uint32_t nt_rev_bg; /**< normal text reverse background */
733 uint32_t nt_hl_fg; /**< normal text highlight foreground */
734 uint32_t nt_hl_bg; /**< normal text highlight background */
735 uint32_t nt_hl_rev_fg; /**< normal text highlight reverse foreground */
736 uint32_t nt_hl_rev_bg; /**< normal text highlight reverse background */
737 uint32_t title_fg; /**< title foreground */
738 uint32_t title_bg; /**< title background */
739 uint32_t ran_fg; /**< right angle foreground */
740 uint32_t ran_bg; /**< right angle background */
741 FILE *stdin_fp; /**< stdin stream pointer */
742 FILE *stdout_fp; /**< stdout stream pointer */
743 FILE *stderr_fp; /**< stderr stream pointer */
744 FILE *tty_fp; /**< terminal device stream pointer */
745 int stdin_fd; /**< stdin file descriptor */
746 int stdout_fd; /**< stdout file descriptor */
747 int stderr_fd; /**< stderr file descriptor */
748 int tty_fd; /**< terminal device file descriptor */
749 uint clr_cnt; /**< number of colors currently in use */
750 uint clr_pair_cnt; /**< number of color pairs currently in use */
751 uint clr_idx; /**< current color index */
752 uint clr_pair_idx; /**< current color pair index */
753 char brackets[3]; /**< field brackets for Form */
754 char fill_char[2]; /**< fill character for Form fields */
755 char border; /**< Rounded, Single, Double, None */
756 char tty_name[MAXLEN]; /**< name of the terminal device */
757 ushort cp_default; /**< default color pair index */
758 ushort cp_fill_char; /**< fill character color pair index */
759 ushort cp_brackets; /**< brackets color pair index */
760 ushort cp_nt; /**< normal text color pair index */
761 ushort cp_nt_rev; /**< reverse color pair index */
762 ushort cp_nt_hl; /**< highlight color pair index */
763 ushort cp_nt_hl_rev; /**< reverse highlight color pair index */
764 ushort cp_box; /**< box color pair index */
765 ushort cp_ind; /**< indicator color pair index */
766 ushort cp_cmdln; /**< command line color pair index */
767 ushort cp_title; /**< title color pair index */
768 ushort cp_ln; /**< line number color pair index */
769 ushort cp_ran; /**< right angle color pair index */
770 ushort cp_chk; /**< checkmark color pair index */
771 ushort cp_bold; /**< bold color pair index */
772}; /**< Shared Internal Objects */
773/* available to the application and the backend implementation */
774
775typedef struct {
777 UiSurface *sfc;
778} UiMultiMedia;
779
780/* @name UI Backend API
781 @ingroup ui_backend
782 @details The following functions define the API for implementing a backend
783 for the terminal UI library. These functions cover the initialization and
784 shutdown of the UI runtime, management of surfaces, drawing operations,
785 input handling, and cursor control. Each function is designed to be
786 implemented by the backend according to the specifications provided in
787 the function comments. By implementing these functions, you can create a
788 functional backend that allows the terminal UI library to render and
789 interact with users effectively.
790 @note: ui_init should return NULL on failure and set an appropriate error
791 message that can be retrieved by the caller. The error message should provide
792 details about the reason for the failure, such as issues with terminal
793 capabilities, resource allocation failures, or unsupported features. This
794 allows the caller to handle initialization errors gracefully and provide
795 feedback to the user.
796 @see ui_backend.h
797*/
798// -------------------------------------------------------------------------------
799// Lifetime Management
800// -------------------------------------------------------------------------------
801void ui_get_caps(UiCaps *caps);
802UiBackend ui_get_backend();
803void ui_initialize_sio(SIO *sio);
804UiRuntime *ui_init(const UiConfig *config, SIO *sio);
805UiSurface *ui_surface_new(ss_t w, UiSurface *parent, uint p, uint lines, uint cols, uint y, uint x);
806UiSurface *ui_surface_box(UiSurface *parent, uint p, uint lines, uint cols, uint y, uint x, const char *title);
807int ui_tracked_sfc_box(uint wlines, uint wcols, uint wbegy, uint wbegx, const char *wtitle);
808int ui_tracked_sfc_split_box(uint wlines, uint wcols, uint split_y, uint split_x, uint wbegy, uint wbegx, const char *wtitle);
809int ui_surface_addwin(UiSurface *s, ss_t w, uint p, uint lines, uint cols, uint y, uint x);
810int ui_surface_addpad(UiSurface *s, ss_t w, uint view_win, uint lines, uint cols, uint begy, uint begx);
811void ui_surface_destroy(UiSurface *s);
812int ui_cm_surface_destroy(UiSurface *sfc);
813int ui_border_draw(UiSurface *sfc);
814int ui_border_title(UiSurface *sfc, const char *title);
815int ui_border_ysplit(UiSurface *sfc, uint y);
816int ui_border_ysplit_text(UiSurface *sfc, char *text, uint separator_line);
817void ui_shutdown();
818int ui_suspend();
819int ui_resume();
820void ui_endwin();
821void ui_restore_wins();
822int ui_surface_show(UiSurface *s, ss_t w);
823int ui_surface_hide(UiSurface *s, ss_t w);
824int ui_surface_move(UiSurface *s, ss_t w, uint y, uint x);
825int ui_surface_resize(UiSurface *s, ss_t w, uint lines, uint cols);
826int ui_wresize(UiSurface *s, ss_t w, uint lines, uint cols);
827// -------------------------------------------------------------------------------
828// Display Management
829// -------------------------------------------------------------------------------
830int ui_wclrtoeol(UiSurface *s, ss_t w);
831int ui_wclrtobot(UiSurface *s, ss_t w);
832int ui_wclear(UiSurface *s, ss_t w);
833int ui_werase(UiSurface *s, ss_t w);
834int ui_clear();
835int ui_erase();
836int ui_wshow(UiSurface *s, ss_t w);
837int ui_whide(UiSurface *s, ss_t w);
838int ui_top_surface(UiSurface *s, ss_t w);
839int ui_setscrreg(UiSurface *s, ss_t w, uint top, uint bottom);
840int ui_scrollok(UiSurface *s, ss_t w, bool enable);
841int ui_keypad(UiSurface *s, ss_t w, bool enable);
842int ui_idlok(UiSurface *s, ss_t w, bool enable);
843int ui_idcok(UiSurface *s, ss_t w, bool enable);
844int ui_bkgd(UiSurface *s, ss_t w, const UiCell *cell);
845int ui_bkgdset(UiSurface *s, ss_t w, const UiCell *cell);
846int ui_bkgrnd(UiSurface *s, ss_t w, const UiCell *cell);
847int ui_bkgrndset(UiSurface *s, ss_t w, const UiCell *cell);
848void ui_update_panels();
849int ui_doupdate();
850void ui_render();
851int ui_wnoutrefresh(UiSurface *s, ss_t w);
852int ui_mousemask(int mask);
853int ui_mice_enable(int mask);
854int ui_cursor_enable(UiSurface *s, ss_t w, bool visible);
855int ui_cursor_enable_yx(UiSurface *s, ss_t w, uint y, uint x, bool visible);
856int ui_curs_set(int visibility);
857int ui_wmove(UiSurface *s, ss_t w, uint y, uint x);
858int ui_wscrl(UiSurface *s, ss_t w, int rows);
859int ui_cursor_move(UiSurface *s, ss_t w, uint y, uint x);
860int ui_get_event_no_mouse(UiSurface *surface, ss_t w, UiEvent *ev);
861int ui_getch();
862// ---------------------------------------------------------------
863// Screen Navigation
864// ---------------------------------------------------------------
865void ui_get_screen_size(uint *lines, uint *cols);
866void ui_getyx(UiSurface *s, ss_t w, uint *lines, uint *cols);
867void ui_getmaxyx(UiSurface *s, ss_t w, uint *lines, uint *cols);
868int ui_getmaxx(UiSurface *s, ss_t w);
869int ui_getmaxy(UiSurface *s, ss_t w);
870const char *ui_sub_surface_str(ss_t w);
871// -------------------------------------------------------------------------------
872// Drawing
873// -------------------------------------------------------------------------------
874int ui_draw_ch(UiSurface *s, ss_t w, const char c);
875int ui_draw_ch_yx(UiSurface *s, ss_t w, uint y, uint x, const char c);
876int ui_draw_text(UiSurface *s, ss_t w, uint y, uint x, const char *text);
877int ui_draw_text_n(UiSurface *s, ss_t w, uint y, uint x, const char *text, int m);
878int ui_draw_text_fill(UiSurface *s, ss_t w, uint y, uint x, const char *text, int m);
879int ui_draw_hline(UiSurface *s, ss_t w, uint y, uint x, uint len, const UiStyle *style);
880
881/** @brief Legend for drawing functions
882 * @verbatim
883 * mvwaddch()
884 * ch character to add
885 * mvwaddnstr()
886 * n... at most n characters
887 * str string
888 * mvwadd_wchnstr()
889 * mv.... ....... move the cursor to the specified position before drawing
890 * ..w... ....... destination window or plane
891 * ...add ....... action
892 * ...... wch.... wide character cchar_t
893 * ...... ...n... at most n characters
894 * ...... ....str string
895 * @end verbatim
896 * @param s The UiSurface to draw on.
897 * @param w The sub-surface identifier (ss_t) to draw on.
898 * @param y
899 * @param x
900 * @param c character
901 * @param wc wide character
902 * @param text string
903 * @param cell
904 * @param m maximum number of characters
905 * @return 0 on success, or a negative error code on failure.
906 */
907int ui_waddch(UiSurface *s, ss_t w, const char c);
908int ui_mvwaddch(UiSurface *s, ss_t w, uint y, uint x, const char c);
909int ui_waddstr(UiSurface *s, ss_t w, const char *text);
910int ui_mvaddstr(UiSurface *s, ss_t w, uint y, uint x, const char *text);
911int ui_mvwaddstr(UiSurface *s, ss_t w, uint y, uint x, const char *text);
912int ui_waddnstr(UiSurface *s, ss_t w, const char *text, int m);
913int ui_mvwaddstr(UiSurface *s, ss_t w, uint y, uint x, const char *text);
914int ui_mvwaddstr_fill(UiSurface *s, ss_t w, uint y, uint x, const char *str, int m);
915int ui_mvwaddnstr(UiSurface *s, ss_t w, uint y, uint x, const char *text, int m);
916int ui_waddwstr(UiSurface *s, ss_t w, const wchar_t *wstr);
917int ui_mvwaddwstr(UiSurface *s, ss_t w, uint y, uint x, const wchar_t *wstr);
918int ui_waddnwstr(UiSurface *s, ss_t w, const wchar_t *wstr, int m);
919int ui_mvwaddnwstr(UiSurface *s, ss_t w, uint y, uint x, const wchar_t *wstr, int m);
920int ui_wadd_wch(UiSurface *s, ss_t w, const UiCell *cell);
921int ui_mvwadd_wch(UiSurface *s, ss_t w, uint y, uint x, const UiCell *cell);
922int ui_wadd_wchstr(UiSurface *s, ss_t w, const UiCell *cell);
923int ui_mvwadd_wchstr(UiSurface *s, ss_t w, uint y, uint x, const UiCell *cell);
924int ui_wadd_wchnstr(UiSurface *s, ss_t w, const UiCell *cell, uint m);
925int ui_mvwadd_wchnstr(UiSurface *s, ss_t w, uint y, uint x, const UiCell *cell, uint m);
926// ---------------------------------------------------------------
927// Wide Character Cell conversions
928// ---------------------------------------------------------------
929UiCell ui_cell_from_ucp(const wchar_t *ucp, const uint32_t *fg, const uint32_t *bg);
930void ui_mbc_to_wc(wchar_t wc[2], const char mbc);
931wchar_t *ui_mbstr_to_wcstr(const char *mb_str);
932// ---------------------------------------------------------------
933// Color handling
934// ---------------------------------------------------------------
935void ui_apply_gamma(RGB *rgb);
936int ui_chg_color(uint16_t color_idx, uint32_t *color);
937uint32_t ui_get_color(uint16_t color_idx);
938RGB ui_hex_to_rgb(char *s);
939bool ui_init_clr_palette(SIO *sio);
940int ui_pair_from_hex(const char *fg, const char *bg);
941uint ui_rgb_to_xterm256_idx(RGB *rgb);
942RGB ui_xterm256_idx_to_rgb(uint idx);
943// ---------------------------------------------------------------
944// Error handling
945// ---------------------------------------------------------------
946int ui_display_error(char *msg0, char *msg1, char *msg2, char *msg3);
947bool ui_action_disposition(char *title, char *action_str);
948void ui_abend(int ec, char *s);
949int ui_answer_yn(char *msg0, char *msg1, char *msg2, char *msg3);
950// ---------------------------------------------------------------
951// Miscelaneous
952// ---------------------------------------------------------------
953void fast_exit(UiSurface *s);
954int ui_perror(char *emsg_str);
955FileType file_type(const char *filename);
956int utf8_decode(const unsigned char *s, uint32_t *codepoint);
957void ui_parse_ansi(char *ansi_str, attr_t *attr, uint *cpx);
958void ui_def_prog_mode();
959// -------------------------------------------------------------------------------
960// Multiplexed input
961// -------------------------------------------------------------------------------
962void ui_register_read_fd(int fd, int token_id);
963void ui_unregister_read_fd(int fd);
964int ui_timeout_prompt(char *msg0, char *msg1, uint timeout_ms, uint timeout_secs);
965int ui_update_timeout_prompt(UiSurface *s, ss_t w, uint timeout_ms);
966int ui_poll_reg_read_fd(int timeout_ms);
967void ui_flush_input();
968// ---------------------------------------------------------------
969// NOTCURSES Specific
970// ---------------------------------------------------------------
971#ifdef NOTCURSES_UI
972struct UiColor {
973 union {
974 struct {
975 uint8_t b, g, r;
976 };
977 uint32_t rgb;
978 };
979};
980struct UiPair {
981 uint fg;
982 uint bg;
983};
984extern UiCell bkgd_cell;
985extern uint LINES, COLS;
986void ui_cursor_yx(int *y, int *x);
987void ui_abs_yx(UiSurface *s, ss_t w, int *y, int *x);
988int mk_chimera(UiCell *cell, char c);
989// How do you convert "NCurses" to "Notcurses"?
990// Insert "ot" after "N".
991int ui_init_color(uint16_t color, uint8_t r, uint8_t g, uint8_t b);
992int ui_color_content(uint16_t color, uint8_t *r, uint8_t *g, uint8_t *b);
993int ui_init_pair(uint16_t pair, uint fg, uint bg);
994uint64_t ui_get_channels_from_pair(uint16_t pair);
995int ui_get_pair(uint16_t pair, uint *fg, uint *bg);
996uint ui_init_color_hex(char *s);
997uint ui_add_pair(uint fg, uint bg);
998uint ui_color_from_rgb(RGB *rgb);
999uint ui_add_color_hex(char *s);
1000int ui_pair_content(uint16_t pair, uint *fg, uint *bg);
1001int ui_wch_to_utf8(const wchar_t fill_ch);
1002uint ui_get_plane_idx(UiSurface *s, NcPlane *n);
1003NcPlane *ui_ncplane_clicked(UiSurface *s, ss_t w, NcInput *ni);
1004struct ncvisual *ui_display_image(struct notcurses *nc, UiMultiMedia *mm, const char *image_file, int y, int x, int begy, int begx);
1005uint ui_mbstr_to_cellstr(UiSurface *sfc, ss_t w, UiCell *cmplx_buf, const char *str, const UiCell *cell_base, uint *pos, const uint atmost);
1006
1007int ui_get_nccell(
1008 UiSurface *sfc,
1009 ss_t w,
1010 const UiCell *cell,
1011 wchar_t *wstr,
1012 UiStyle *style,
1013 short *pair);
1014
1015#define ui_get_cell(sfc, w, cell, wstr, style, cp, opts)
1016 ui_get_nccell(sfc, w, cell, wstr, style, cp);
1017
1018int ui_set_nccell(
1019 UiSurface *sfc,
1020 ss_t w,
1021 UiCell *cell,
1022 const wchar_t *wstr,
1023 const UiStyle style,
1024 short pair);
1025
1026#define ui_set_cell(sfc, w, cell, wstr, attr, cp, opts)
1027 ui_set_nccell(sfc, w, cell, wstr, attr, cp);
1028
1029#else
1030// ---------------------------------------------------------------
1031// NCURSES Specific
1032// ---------------------------------------------------------------
1033int ui_add_color(uint r, uint g, uint b);
1034uint ui_add_pair(uint fg, uint bg);
1035int ui_chg_pair(uint pair, uint fg, uint bg);
1036int ui_color_content(uint color, uint *r, uint *g, uint *b);
1037int ui_color_from_rgb(RGB *rgb);
1038void ui_destroy_curses();
1039
1040int ui_getcchar(const UiCell *cell, wchar_t *wstr, attr_t *attrs, short *pair, const void *opts);
1041
1042int ui_setcchar(UiCell *cell, const wchar_t *wstr, const attr_t attrs, short pair, const void *opts);
1043
1044int ui_get_pair(uint pair, uint *fg, uint *bg);
1045int ui_init_color(uint color, uint r, uint g, uint b);
1046int ui_init_pair(uint pair, uint fg, uint bg);
1047SCREEN *ui_ncurses_get_screen();
1048int ui_pair_content(uint pair, uint *fg, uint *bg);
1049uint ui__mbstr_to_cellstr(UiCell *cmplx_buf, const char *str, const UiCell *cell_base, uint *pos, const uint atmost);
1050
1051#define ui_mbstr_to_cellstr(sfc, w, cmplx_buf, str, cell_base, pos, atmost)
1052 ui__mbstr_to_cellstr(cmplx_buf, str, cell_base, pos, atmost);
1053
1054#define ui_get_cell(s, w, cell, wstr, attr, pair, opts)
1055 ui_getcchar(cell, wstr, attr, pair, nullptr);
1056
1057#define ui_set_cell(s, w, cell, wstr, attrs, pair, nullptr)
1058 ui_setcchar(cell, wstr, attrs, pair, nullptr);
1059#endif
1060
1061extern STDRGB std_color[];
1062extern UiRuntime *ui;
1063extern UiSurface *ui_surface[UI_SFC_MAX];
1064extern uint ui_color_cnt;
1065extern uint ui_pair_cnt;
1066
1067// ---------------------------------------------------------------
1068// Chyron Data Structures
1069// ---------------------------------------------------------------
1070
1071typedef struct {
1072 bool active; /**< whether the key binding is active */
1073 char text[CHYRON_KEY_MAXLEN]; /**< command text associated with the key code */
1074 uint keycode; /**< key code associated with the command */
1075 uint end_pos; /**< end position of the command text */
1076 UiCell cell_base; /**< cell base for colors/attributes */
1077} UiChyronKey;
1078
1079typedef struct {
1080 UiChyronKey *key[CHYRON_KEYS]; /**< array of key bindings for the chyron */
1081 char s[MAXLEN]; /**< the chyron string, for displaying messages in */
1082 UiCell cmplx_buf[MAXLEN]; /**< the chyron wide character string */
1083 uint l; /**< length of the chyron string, for display */
1084 struct UiSurface *sfc; /** pointer to surface for the chyron */
1085 ss_t w; /** index to window of surface */
1086 uint y; /** y coordinante of the chyron in the window */
1087} UiChyron;
1088
1089// ---------------------------------------------------------------
1090// Chyron API
1091// ---------------------------------------------------------------
1092void ui_activate_chyron_key(UiChyron *chyron, uint k);
1093void ui_activate_all_chyron_keys(UiChyron *chyron);
1094int ui_assign_chyron_win(UiChyron *chyron, UiSurface *sfc, ss_t w, char *y);
1095void ui_deactivate_chyron_key(UiChyron *chyron, uint k);
1096void ui_deactivate_all_chyron_keys(UiChyron *chyron);
1097UiChyron *ui_destroy_chyron(UiChyron *chyron);
1098void ui_display_chyron(UiSurface *sfc, ss_t w, UiChyron *chyron, uint line, uint col);
1099int ui_get_chyron_key(UiChyron *chyron, uint x);
1100bool ui_is_set_chyron_key(UiChyron *chyron, uint k);
1101UiChyron *ui_new_chyron(UiSurface *sfc, ss_t w);
1102void ui_set_chyron_key(UiChyron *chyron, uint k, char *s, uint kc);
1103void ui_set_chyron_key_cb(UiChyron *chyron, uint k, char *s, uint kc, UiCell cell_base);
1104void ui_unset_chyron_key(UiChyron *chyron, uint k);
1105int ui_get_event(UiSurface *s, ss_t w, UiChyron *chyron, UiEvent *ev, int timeout_ms);
1106void ui_compile_chyron(UiChyron *);
1107
1108// ---------------------------------------------------------------
1109// Logging
1110// ---------------------------------------------------------------
1111#define ANSI_RESET "\033[0m"
1112extern char *ui_iso8601_timestamp(char *buf, size_t n, bool local);
1113extern bool ui_timestamp_local;
1114extern const char *const ui_logcolor[LOG_LEVEL_COUNT];
1115extern const char *const ui_log_level_s[LOG_LEVEL_COUNT];
1116extern UiLogLevel ui_min_log_level;
1117extern char ui_timestamp[32];
1118extern FILE *ui_open_log();
1119extern FILE *ui_log_fp;
1120
1121static inline void ui_logrec(const UiLogLevel level, const char *file, const char *func, const int line, const char *fmt, ...) __attribute__((format(printf, 5, 6)));
1122
1123static inline void ui_logrec(const UiLogLevel level, const char *file, const char *func, const int line, const char *fmt, ...) {
1124 UiLogLevel safe_level = (level >= LOG_LEVEL_COUNT) ? INFO : level;
1125 fprintf(ui_log_fp, "[%s] %s[%s]%s <%s:%s:%d> ",
1127 ui_logcolor[safe_level],
1128 ui_log_level_s[safe_level],
1129 ANSI_RESET,
1130 file, func, line);
1131 va_list args;
1132 va_start(args, fmt);
1133 vfprintf(ui_log_fp, fmt, args);
1134 va_end(args);
1135 fprintf(ui_log_fp, "\n");
1136 fflush(ui_log_fp);
1137}
1138#define ui_log(level, fmt, ...)
1139 do {
1140 if (level <= ui_min_log_level) {
1141 ui_logrec(level, __FILE__, __func__, __LINE__, fmt, ##__VA_ARGS__);
1142 }
1143 } while (0)
1144
1145#ifdef __cplusplus
1146}
1147#endif
void form_help(char *)
#define FIELD_MAXLEN
Definition form.h:18
@ FF_DECIMAL_INT
Definition form.h:50
@ FF_STRING
Definition form.h:48
@ FF_HEX_INT
Definition form.h:52
@ FF_YYYYMMDD
Definition form.h:61
@ FF_HHMMSS
Definition form.h:63
@ FF_CURRENCY
Definition form.h:58
@ FF_FLOAT
Definition form.h:54
@ FF_INVALID
Definition form.h:68
@ FF_DOUBLE
Definition form.h:56
@ FF_APR
Definition form.h:65
@ FA_END
Definition form.h:42
@ FA_ACCEPT
Definition form.h:29
@ FA_EDIT
Definition form.h:40
@ FA_CALC
Definition form.h:37
@ FA_HELP
Definition form.h:31
@ FA_REFUSE
Definition form.h:35
@ FA_CANCEL
Definition form.h:33
@ FA_CONTINUE
Definition form.h:27
int form_read_description(Form *)
void form_display_chyron(Form *)
#define FIELD_MAXCNT
Definition form.h:19
int cmd_processor(Init *)
int open_pick_win(Init *)
bool view_stack_peek(const ViewStack *, View *)
@ OT_INT
Definition common.h:88
@ OT_BOOL
Definition common.h:89
@ OT_HEX
Definition common.h:90
@ OT_STRING
Definition common.h:87
int popup_form(Init *, int, char **, uint, uint)
instantiate a form popup window
Definition popups.c:113
bool view_stack_push(ViewStack *, View)
int popup_menu(Init *, int, char **, uint, uint)
instantiate a menu popup window
Definition popups.c:53
void view_stack_free(ViewStack *)
@ FORM
Definition common.h:80
@ MENU
Definition common.h:82
@ VIEW
Definition common.h:79
@ PICK
Definition common.h:81
@ OG_FILES
Definition common.h:95
@ OG_DIRS
Definition common.h:96
@ OG_SPECS
Definition common.h:97
@ OG_MISC
Definition common.h:98
@ OG_FLAGS
Definition common.h:100
@ OG_PARMS
Definition common.h:99
@ OG_COL
Definition common.h:101
bool view_stack_pop(ViewStack *, View *)
int popup_pick(Init *, int, char **, uint, uint)
instantiate a pick popup window
Definition popups.c:83
bool view_stack_init(ViewStack *, size_t)
void destroy_view_win(Init *)
#define COLOR_LEN
Definition common.h:30
int popup_view(Init *, int, char **, uint, uint, uint, uint)
instantiate a view popup window
Definition popups.c:145
int pick_engine(Init *)
char minitrc[MAXLEN]
int mpick(int, char **, int, int, int, int, char *, int)
#define OBJ_MAXCNT
Definition pick.h:21
volatile sig_atomic_t sig_received
Definition sig.c:32
size_t rtrim(char *)
Trims trailing spaces from string s in place.
Definition futil.c:308
bool handle_signal(sig_atomic_t)
void win_Toggle_Attrs()
uint mlines
uint mbegx
bool strnfill(char *, char, uint)
void sig_shell_mode()
void get_rfc3339_s(char *, size_t)
bool f_have_shell_tioctl
Definition scriou.c:24
bool waitpid_with_timeout(pid_t, uint)
void init_stdscr()
struct termios shell_out_tioctl program_out_tioctl
Definition scriou.c:36
char stdio_names_str[4096]
Definition futil.c:122
bool verify_dir_q(char *, uint)
uint dbgfd
@ F_REG
Definition cm.h:218
@ F_BLK
Definition cm.h:216
@ F_FIFO
Definition cm.h:211
@ F_F0
Definition cm.h:210
@ F_F3
Definition cm.h:217
@ F_SOCK
Definition cm.h:222
@ F_CHR
Definition cm.h:212
@ F_F5
Definition cm.h:221
@ F_F1
Definition cm.h:213
@ F_DIR
Definition cm.h:214
@ F_UNKNOWN
Definition cm.h:224
@ F_F2
Definition cm.h:215
@ F_F4
Definition cm.h:219
@ F_LNK
Definition cm.h:220
@ F_F6
Definition cm.h:223
#define KEY_ALTF0
Definition cm.h:331
uint n_lines
void restore_wins()
int stdout_fd
Definition ui_common.c:61
void dump_opts()
void win_del()
void win_resize(uint, uint, char *)
bool construct_file_spec(char *, char *, char *, char *, char *, uint)
struct termios shell_tioctl program_tioctl
Definition scriou.c:34
char * stdio_names(char *, char *)
Definition futil.c:1083
unsigned char uchar
Definition cm.h:345
String mk_string(size_t)
Create a String struct with a dynamically allocated string.
Definition futil.c:1550
uint mg_col
uint n_cols
bool verify_file_q(char *, uint)
char fn[MAXLEN]
Definition ui_common.c:45
void win_init_attrs()
struct termios shell_in_tioctl program_in_tioctl
Definition scriou.c:35
bool f_debug
uint mg_line
#define SCR_COLS
Definition cm.h:65
void dump_opts_by_use(char *, char *)
char errmsg[]
Definition futil.c:126
uint src_line
Definition ui_common.c:43
int wait_timeout
Definition futil.c:140
@ LF_EXC_REGEX
Definition cm.h:184
@ LF_HIDE
Definition cm.h:182
@ LF_ISUID
Definition cm.h:194
@ LF_IRUSR
Definition cm.h:192
@ LF_ICASE
Definition cm.h:183
@ LF_ISGID
Definition cm.h:193
@ LF_EXEC
Definition cm.h:186
@ LF_REGEX
Definition cm.h:185
@ LF_USER
Definition cm.h:187
@ LF_IXUSR
Definition cm.h:190
@ LF_IWUSR
Definition cm.h:191
bool f_restore_screen
@ LF_FIFO
Definition cm.h:199
@ LF_DIR
Definition cm.h:201
@ LF_UNKNOWN
Definition cm.h:206
@ LF_SOCK
Definition cm.h:205
@ LF_BLK
Definition cm.h:202
@ LF_LNK
Definition cm.h:204
@ LF_REG
Definition cm.h:203
@ LF_CHR
Definition cm.h:200
int exit_code
Definition ui_common.c:31
FILE * tty_fp
struct termios shell_err_tioctl program_err_tioctl
Definition scriou.c:37
#define min(x, y)
min macro evaluates two expressions, returning least result
Definition cm.h:104
uint16_t win_attr
Definition ui_common.c:34
int stdin_fd
Definition ui_common.c:61
bool f_program_open
uint mbegy
bool str_to_bool(const char *)
Converts String to boolean true or false.
Definition futil.c:960
uint mcols
#define __atexit
This macro registers the end_pgm function to be called when the program exits.
Definition cm.h:275
bool is_image_file(const char *filename)
char * src_name
Definition ui_common.c:44
char * fill_field(char *, char *, char, uint)
Definition futil.c:1714
uint mg_action
char * stdio_fdnames(char *, char *)
Definition futil.c:1108
void user_end()
UiChyron * wait_mk_chyron()
int display_curses_keys()
bool f_have_program_tioctl
Definition scriou.c:25
uint enter_option()
#define Ctrl(c)
Definition cm.h:67
int stderr_fd
Definition ui_common.c:61
void display_argv_error_msg(char *, char **)
bool wait_destroy(UiChyron *)
char * rep_substring(const char *, const char *, const char *) __attribute__((nonnull(1
Replace all occurrences of "tgt_s" in "org_s" with "rep_s".
Definition futil.c:1449
@ MT_TEXT
Definition menu.h:22
@ MT_CHOICE
Definition menu.h:23
@ MT_NULL
Definition menu.h:21
@ CT_PICK
Definition menu.h:45
@ CT_FORM
Definition menu.h:41
@ CT_DEXE
Definition menu.h:37
@ CT_UNDEFINED
Definition menu.h:51
@ CT_MENU
Definition menu.h:44
@ CT_RETURN
Definition menu.h:48
@ CT_TOGGLE
Definition menu.h:49
@ CT_HELP
Definition menu.h:39
@ CT_WRITE_CONFIG
Definition menu.h:50
@ CT_FORM_WRITE
Definition menu.h:43
@ CT_EXEC
Definition menu.h:38
@ CT_VIEW
Definition menu.h:46
@ CT_NULL
Definition menu.h:36
@ CT_ABOUT
Definition menu.h:40
@ CT_FORM_EXEC
Definition menu.h:42
@ CT_CKEYS
Definition menu.h:47
void free_menu_line(Line *)
@ MA_RETURN
Definition menu.h:28
@ MA_DISPLAY_MENU
Definition menu.h:29
@ MA_RESET_MENU
Definition menu.h:30
@ MA_NEW
Definition menu.h:27
@ MA_CONTINUE
Definition menu.h:31
#define MAX_MENU_LINES
Definition menu.h:18
int ui_border_draw(UiSurface *sfc)
Definition ui_common.c:474
int ui_surface_resize(UiSurface *s, ss_t w, uint lines, uint cols)
Resize a UiSurface to new dimensions.
Definition ui_ncurses.c:536
int ui_draw_ch_yx(UiSurface *s, ss_t w, uint y, uint x, const char c)
Draw a character at a specific position in a surface window.
int ui_surface_addwin(UiSurface *s, ss_t w, uint p, uint lines, uint cols, uint y, uint x)
Add a new window to the specified UiSurface.
Definition ui_ncurses.c:395
const wchar_t * border_none
Definition ui_common.c:72
const wchar_t * bw_sp
Definition ui_common.c:79
#define SUB_SURFACE_LIST(X)
Definition ui_backend.h:36
UiCell cell_sp
Definition ui_common.c:132
UiRuntime * ui_init(const UiConfig *config, SIO *sio)
Initialize the UI runtime with the given configuration and SIO.
Definition ui_ncurses.c:129
void ui_render()
Render the UI by updating panels and refreshing the display.
Definition ui_ncurses.c:884
void ui_getyx(UiSurface *s, ss_t w, uint *lines, uint *cols)
Get the current cursor position within a window of a UI surface.
Definition ui_ncurses.c:675
int ui_wresize(UiSurface *s, ss_t w, uint lines, uint cols)
int ui_draw_text_n(UiSurface *s, ss_t w, uint y, uint x, const char *text, int m)
Draw a text string at a specific position in a surface window.
UiCell cell_ve
Definition ui_common.c:124
ushort cp_nt
Definition ui_common.c:142
int ui_draw_text_fill(UiSurface *s, ss_t w, uint y, uint x, const char *text, int m)
Draw a text string at a specific position in a surface window, filling the remaining space with space...
UiCell cell_tr
Definition ui_common.c:122
UiCell cell_nt
Definition ui_common.c:106
int ui_whide(UiSurface *s, ss_t w)
char const colors_text[][10]
Color names for .minitrc overrides.
Definition ui_common.c:93
int ui_tracked_sfc_split_box(uint wlines, uint wcols, uint split_y, uint split_x, uint wbegy, uint wbegx, const char *wtitle)
Create a new surface with a split box window.
Definition ui_common.c:425
const wchar_t * bw_ran
Definition ui_common.c:84
UiCell cell_ls
Definition ui_common.c:117
UiCell cell_nt_hl_rev
Definition ui_common.c:109
bool f_ncurses_open
Definition ui_common.c:50
char em1[MAXLEN]
Definition ui_common.c:47
int ui_mice_enable(int mask)
Enable or disable mouse support.
int ui_setscrreg(UiSurface *s, ss_t w, uint top, uint bottom)
Set the scrolling region for a UiSurface.
Definition ui_ncurses.c:820
UiCell cell_bt
Definition ui_common.c:130
#define BORDER_STYLE(X)
Definition ui_backend.h:170
UiCell cell_br
Definition ui_common.c:126
@ FT_MAX
Definition ui_backend.h:96
ushort cp_ln_fg
const wchar_t * bw_rbr
Definition ui_common.c:78
int ui_draw_text(UiSurface *s, ss_t w, uint y, uint x, const char *text)
on specified window, move to y, x, add string
ushort cp_green
Definition ui_common.c:151
int ui_draw_hline(UiSurface *s, ss_t w, uint y, uint x, uint len, const UiStyle *style)
const wchar_t * bw_ua
Definition ui_common.c:82
UiCell cell_tl
Definition ui_common.c:121
ushort cp_red
Definition ui_common.c:150
@ LOG_LEVEL_COUNT
Definition ui_backend.h:80
int ui_wmove(UiSurface *s, ss_t w, uint y, uint x)
Move the cursor to a specified position within a UiSurface.
Definition ui_ncurses.c:653
void ui_getmaxyx(UiSurface *s, ss_t w, uint *lines, uint *cols)
Get the maximum dimensions of a UiSurface.
Definition ui_ncurses.c:690
int ui_cursor_enable_yx(UiSurface *s, ss_t w, uint y, uint x, bool visible)
Enable or disable the cursor at a specific position within a UiSurface.
Definition ui_ncurses.c:855
ushort cp_box
Definition ui_common.c:138
uint clr_pair_cnt
char em2[MAXLEN]
Definition ui_common.c:48
int ui_wscrl(UiSurface *s, ss_t w, int rows)
Scroll the contents of a UiSurface by a specified number of lines.
Definition ui_ncurses.c:738
#define MAX_EXT_FDS
Definition ui_backend.h:131
int ui_idcok(UiSurface *s, ss_t w, bool enable)
Enable or disable the use of the insert/delete character capabilities for a UiSurface.
Definition ui_ncurses.c:803
ushort cp_blue
Definition ui_common.c:153
ushort cp_bold
UiCell cell_ln
Definition ui_common.c:114
int ui_surface_addpad(UiSurface *s, ss_t w, uint view_win, uint lines, uint cols, uint begy, uint begx)
Add a new pad to the specified UiSurface.
Definition ui_ncurses.c:369
ui_context_t ui_ctx
Definition ui_common.c:59
const char * ui_sub_surface_str(ss_t w)
Definition ui_common.c:1368
const wchar_t * bw_chk
Definition ui_common.c:86
uint clr_cnt
BorderWide bw
Definition ui_common.c:27
#define CHYRON_KEYS
Definition ui_backend.h:50
UiCell cell_ts
Definition ui_common.c:119
ushort cp_cmdln_bg
ushort cp_highlight
uint clr_idx
int ui_cursor_move(UiSurface *s, ss_t w, uint y, uint x)
Move the cursor to a specified position within a UiSurface.
Definition ui_ncurses.c:666
#define UI_SFC_MAX
Definition ui_backend.h:196
@ BORDER_MAX
Definition ui_backend.h:179
const wchar_t * bw_rtl
Definition ui_common.c:75
ushort cp_nt_hl
Definition ui_common.c:144
int ui_cm_surface_destroy(UiSurface *sfc)
Destroy the most recently created surface.
Definition ui_common.c:466
const wchar_t * bw_rtr
Definition ui_common.c:76
const wchar_t * bw_lan
Definition ui_common.c:85
int ui_suspend()
Suspend the UI, saving the current program state and ending the window session.
Definition ui_ncurses.c:494
ushort cp_cmdln_fg
ushort cp_fill_char
Definition ui_common.c:148
UiCell cell_tt
Definition ui_common.c:129
void ui_surface_destroy(UiSurface *s)
Destroy a UiSurface, cleaning up its windows and panels.
Definition ui_ncurses.c:468
UiCell cell_bs
Definition ui_common.c:120
@ SUB_SFC_MAX
Definition ui_backend.h:47
ushort cp_brackets
Definition ui_common.c:149
uint clr_pair_idx
int ui_wshow(UiSurface *s, ss_t w)
const wchar_t * bw_ra
Definition ui_common.c:80
int ui_border_title(UiSurface *sfc, const char *title)
Draw a box with a title around the specified window.
Definition ui_common.c:563
void ui_update_panels()
Update the panels in the UI.
Definition ui_ncurses.c:890
int ui_bkgd(UiSurface *s, ss_t w, const UiCell *cell)
Set the background of a specific window within a UiSurface.
Definition ui_ncurses.c:927
ushort cp_yellow
Definition ui_common.c:152
void ui_restore_wins()
Restore the state of all windows in the UI. This function refreshes the standard screen and all surfa...
UiCell cell_ho
Definition ui_common.c:123
int ui_idlok(UiSurface *s, ss_t w, bool enable)
Enable or disable the use of the insert/delete line capabilities for a UiSurface.
Definition ui_ncurses.c:787
const wchar_t * border_double
Definition ui_common.c:69
UiCell cell_rs
Definition ui_common.c:118
int ui_surface_move(UiSurface *s, ss_t w, uint y, uint x)
Move a UiSurface to a new position on the screen.
Definition ui_ncurses.c:521
int ui_getmaxy(UiSurface *s, ss_t w)
Get the maximum number of lines (rows) of a UiSurface.
Definition ui_ncurses.c:701
#define XTERM_256COLOR
Definition ui_backend.h:640
uint UiColorIdx
Definition ui_backend.h:160
const wchar_t * bw_h09
Definition ui_common.c:87
UiCell cell_default
Definition ui_common.c:102
int click_x
Definition ui_common.c:30
int ui_draw_ch(UiSurface *s, ss_t w, const char c)
Draw a character in a surface window.
UiSurface * ui_surface_box(UiSurface *parent, uint p, uint lines, uint cols, uint y, uint x, const char *title)
Create a new UI surface with a border box and optional title.
Definition ui_ncurses.c:288
#define CHYRON_KEY_MAXLEN
Definition ui_backend.h:49
int ui_get_event_no_mouse(UiSurface *surface, ss_t w, UiEvent *ev)
Wait for an input event on target (or stdscr if NULL) without mouse support.
int ui_border_ysplit_text(UiSurface *sfc, char *text, uint separator_line)
Draw a box with a separator line and text around the specified window.
Definition ui_common.c:524
const wchar_t * border_single
Definition ui_common.c:68
void ui_get_screen_size(uint *lines, uint *cols)
Get the current screen size (number of lines and columns).
Definition ui_ncurses.c:722
ushort cp_nt_hl_rev
Definition ui_common.c:145
ushort cp_default
Definition ui_common.c:147
int ui_surface_show(UiSurface *s, ss_t w)
Show a UiSurface, making it visible on the screen.
Definition ui_ncurses.c:609
int ui_getch()
Wait for a single input character from the NotCurses context.
int ui_erase()
Erase the entire screen.
Definition ui_ncurses.c:591
void ui_shutdown()
Shutdown the UI runtime, cleaning up resources and freeing memory.
Definition ui_ncurses.c:418
UiCell cell_nt_hl
Definition ui_common.c:108
UiSurface * ui_surface_new(ss_t w, UiSurface *parent, uint p, uint lines, uint cols, uint y, uint x)
Create a new UI surface with the specified parameters.
Definition ui_ncurses.c:229
ushort cp_nt_rev
Definition ui_common.c:143
char em3[MAXLEN]
Definition ui_common.c:49
ushort cp_title
Definition ui_common.c:141
int ui_border_ysplit(UiSurface *sfc, uint y)
Draw a box with a separator line around the specified window.
Definition ui_common.c:504
UiCell cell_lt
Definition ui_common.c:127
int win_ptr
int ui_mousemask(int mask)
Enable or disable mouse support.
#define LOG_LEVEL_LIST(X)
Definition ui_backend.h:69
void ui_initialize_sio(SIO *sio)
Definition ui_common.c:182
@ CLR_CMDLN_BG
Definition ui_backend.h:536
@ CLR_FILL_CHAR_BG
Definition ui_backend.h:532
@ CLR_BOX_BG
Definition ui_backend.h:526
@ CLR_FILL_CHAR_FG
Definition ui_backend.h:531
@ CLR_FG
Definition ui_backend.h:523
@ CLR_RED
Definition ui_backend.h:507
@ CLR_NT_FG
Definition ui_backend.h:537
@ CLR_BRACKETS_FG
Definition ui_backend.h:529
@ CLR_YELLOW
Definition ui_backend.h:509
@ CLR_IND_FG
Definition ui_backend.h:527
@ CLR_BCYAN
Definition ui_backend.h:520
@ CLR_TITLE_FG
Definition ui_backend.h:545
@ CLR_WHITE
Definition ui_backend.h:513
@ CLR_MAGENTA
Definition ui_backend.h:511
@ CLR_BRACKETS_BG
Definition ui_backend.h:530
@ CLR_NT_REV_BG
Definition ui_backend.h:540
@ CLR_BLACK
Definition ui_backend.h:506
@ CLR_BWHITE
Definition ui_backend.h:521
@ CLR_LN_BG
Definition ui_backend.h:534
@ CLR_NT_HL_REV_BG
Definition ui_backend.h:544
@ CLR_BBLACK
Definition ui_backend.h:514
@ CLR_LN_FG
Definition ui_backend.h:533
@ CLR_NT_HL_FG
Definition ui_backend.h:541
@ CLR_BBLUE
Definition ui_backend.h:518
@ CLR_BGREEN
Definition ui_backend.h:516
@ CLR_BYELLOW
Definition ui_backend.h:517
@ CLR_BMAGENTA
Definition ui_backend.h:519
@ CLR_BORANGE
Definition ui_backend.h:522
@ CLR_NT_HL_BG
Definition ui_backend.h:542
@ CLR_NT_HL_REV_FG
Definition ui_backend.h:543
@ CLR_BG
Definition ui_backend.h:524
@ CLR_BOX_FG
Definition ui_backend.h:525
@ CLR_NT_BG
Definition ui_backend.h:538
@ CLR_TITLE_BG
Definition ui_backend.h:546
@ CLR_BRED
Definition ui_backend.h:515
@ CLR_NCOLORS
Definition ui_backend.h:547
@ CLR_BLUE
Definition ui_backend.h:510
@ CLR_IND_BG
Definition ui_backend.h:528
@ CLR_GREEN
Definition ui_backend.h:508
@ CLR_CMDLN_FG
Definition ui_backend.h:535
@ CLR_NT_REV_FG
Definition ui_backend.h:539
@ CLR_CYAN
Definition ui_backend.h:512
UiSurface * stdsfc
Definition ui_ncurses.c:46
int sfc_ptr
Definition ui_ncurses.c:42
int ui_wclrtobot(UiSurface *s, ss_t w)
Set the style of a surface window.
int ui_curs_set(int visibility)
Set the visibility of the cursor.
Definition ui_ncurses.c:840
int ui_resume()
Resume the UI, restoring the previous program state and updating the display.
Definition ui_ncurses.c:503
int ui_bkgrndset(UiSurface *s, ss_t w, const UiCell *cell)
Set the background for new content to be written to a specific window within a UiSurface.
Definition ui_ncurses.c:969
int ui_top_surface(UiSurface *s, ss_t w)
Hide a UiSurface, making it invisible on the screen.
Definition ui_ncurses.c:623
UiCell cell_brktl
Definition ui_common.c:104
int ui_wclear(UiSurface *s, ss_t w)
Clear the contents of a UiSurface or all surfaces.
Definition ui_ncurses.c:571
UiCell cell_cr
Definition ui_common.c:131
UiCell cell_title
Definition ui_common.c:113
uint16_t UiPairIdx
Definition ui_backend.h:159
int click_y
Definition ui_common.c:29
const wchar_t * bw_la
Definition ui_common.c:81
char em0[MAXLEN]
Definition ui_common.c:46
UiCell cell_ind
Definition ui_common.c:111
void ui_endwin()
End the UI application, cleaning up resources and shutting down the UI runtime.
Definition ui_ncurses.c:412
int ui_tracked_sfc_box(uint wlines, uint wcols, uint wbegy, uint wbegx, const char *wtitle)
Create a new surface with a box window.
Definition ui_common.c:387
int ui_cursor_enable(UiSurface *s, ss_t w, bool visible)
Enable or disable the cursor for a UiSurface.
Definition ui_ncurses.c:870
#define MOUSE_ACTION(X)
Definition ui_backend.h:52
UiCell cell_ran
Definition ui_common.c:115
ushort cp_ln_bg
int ui_clear()
Clear the entire screen.
Definition ui_ncurses.c:599
int ui_getmaxx(UiSurface *s, ss_t w)
Get the maximum number of columns of a UiSurface.
Definition ui_ncurses.c:712
const wchar_t * border_heavy
Definition ui_common.c:71
int ui_surface_hide(UiSurface *s, ss_t w)
Hide a UiSurface, making it invisible on the screen.
Definition ui_ncurses.c:635
bool f_notcurses_open
Definition ui_common.c:51
const wchar_t * border_rounded
Definition ui_common.c:70
int ui_bkgrnd(UiSurface *s, ss_t w, const UiCell *cell)
Set the background of a specific window within a UiSurface.
Definition ui_ncurses.c:955
int ui_scrollok(UiSurface *s, ss_t w, bool enable)
Enable or disable scrolling for a UiSurface.
Definition ui_ncurses.c:755
struct ncinput NcInput
Definition ui_backend.h:161
struct ncvisual NcVisual
Definition ui_backend.h:162
UiCell cell_cmdln
Definition ui_common.c:112
int ui_wclrtoeol(UiSurface *s, ss_t w)
Clear to the end of the line in a surface window.
int ui_wnoutrefresh(UiSurface *s, ss_t w)
Refresh a specific window within a UiSurface.
Definition ui_ncurses.c:908
const wchar_t * bw_da
Definition ui_common.c:83
uint16_t UiStyle
Definition ui_backend.h:158
void ui_get_caps(UiCaps *caps)
Get the UI backend capabilities.
Definition ui_ncurses.c:62
int ui_bkgdset(UiSurface *s, ss_t w, const UiCell *cell)
Set the background for new content to be written to a specific window within a UiSurface.
Definition ui_ncurses.c:941
UiCell cell_brktr
Definition ui_common.c:105
int ui_doupdate()
Refresh the display by updating the screen.
Definition ui_ncurses.c:895
ushort cp_ind
Definition ui_common.c:139
int ui_werase(UiSurface *s, ss_t w)
Erase the contents of a UiSurface or all surfaces.
Definition ui_ncurses.c:551
@ UI_BACKEND_NCURSES
Definition ui_backend.h:452
@ UI_BACKEND_NOTCURSES
Definition ui_backend.h:453
@ MOUSE_ACTION_MAX
Definition ui_backend.h:62
UiCell cell_fill_char
Definition ui_common.c:103
UiCell cell_box
Definition ui_common.c:110
UiCell cell_rt
Definition ui_common.c:128
const wchar_t * bw_rbl
Definition ui_common.c:77
UiCell cell_bl
Definition ui_common.c:125
uint32_t UiKey
Definition ui_backend.h:65
UiCell cell_chk
Definition ui_common.c:116
UiCell cell_nt_rev
Definition ui_common.c:107
#define FILE_TYPE_LIST(X)
Definition ui_backend.h:85
int ui_keypad(UiSurface *s, ss_t w, bool enable)
Enable or disable the keypad for a UiSurface.
Definition ui_ncurses.c:771
#define NMARKS
Definition view.h:33
char err_msg[MAXLEN]
@ PT_STRING
Definition view.h:44
@ PT_NONE
Definition view.h:41
@ PT_SHORT
Definition view.h:42
@ PT_LONG
Definition view.h:43
#define BUFSIZ
Definition view.h:38
int get_cmd_spec(View *, char *)
int view_accept_cmd(View *)
void go_to_position(View *, long)
#define PAD_COLS
Definition view.h:39
#define UIKEY_DC
#define UIKEY_BACKSPACE
#define UIKEY_LEFT
#define UIKEY_F09
#define UIKEY_IC
#define UIKEY_END
#define UIKEY_BUTTON1
#define UIKEY_RIGHT
#define UIKEY_HOME
#define UIKEY_ENTER
int ui_get_pair(uint16_t pair, uint *fg, uint *bg)
Get the foreground and background color indices for a given color pair index.
void ui_flush_input()
Flush any pending input events from the NotCurses context. This function discards any input events th...
int ui_get_event(UiSurface *s, ss_t w, UiChyron *chyron, UiEvent *ev, int timeout_ms)
Read input events.
void ui_unset_chyron_key(UiChyron *chyron, uint k)
Unset chyron key.
Definition ui_common.c:732
void ui_set_chyron_key(UiChyron *chyron, uint k, char *s, uint kc)
Set chyron key with default color pair (cp_nt_rev).
Definition ui_common.c:717
bool ui_timestamp_local
Definition ui_common.c:1391
void ui_deactivate_all_chyron_keys(UiChyron *chyron)
Deactivate all chyron keys.
Definition ui_common.c:768
FILE * ui_open_log()
Open the log file for writing.
Definition ui_common.c:1397
wchar_t * ui_mbstr_to_wcstr(const char *mb_str)
Convert a multibyte string to a wide character string.
Definition ui_common.c:322
UiChyron * ui_new_chyron(UiSurface *sfc, ss_t w)
Create new chyron structure.
Definition ui_common.c:601
char * ui_iso8601_timestamp(char *buf, size_t n, bool local)
Generate an ISO 8601 timestamp string.
Definition ui_common.c:1353
const char *const ui_log_level_s[]
Definition ui_common.c:1374
RGB ui_xterm256_idx_to_rgb(uint idx)
Convert XTerm 256 color index to RGB.
Definition ui_common.c:908
void ui_activate_chyron_key(UiChyron *chyron, uint k)
Activate chyron key.
Definition ui_common.c:741
void ui_display_chyron(UiSurface *sfc, ss_t w, UiChyron *chyron, uint line, uint col)
Display chyron on the specified line and column of the surface.
Definition ui_common.c:837
STDRGB std_color[]
Definition ui_common.c:159
void ui_set_chyron_key_cb(UiChyron *chyron, uint k, char *s, uint kc, UiCell cell_base)
Set chyron key with color pair (cp).
Definition ui_common.c:693
int ui_assign_chyron_win(UiChyron *chyron, UiSurface *sfc, ss_t w, char *y)
Assign surface and window to chyron structure.
Definition ui_common.c:634
bool ui_init_clr_palette(SIO *sio)
Definition ui_common.c:247
bool ui_is_set_chyron_key(UiChyron *chyron, uint k)
Check if function key label is set.
Definition ui_common.c:677
UiLogLevel ui_min_log_level
Definition ui_common.c:1390
void ui_abend(int ec, char *s)
Convert multibyte string to complex character array.
Definition ui_common.c:362
void ui_parse_ansi(char *ansi_str, attr_t *attr, uint *cpx)
Parse ANSI escape sequences for color and attributes.
Definition ui_common.c:1435
UiChyron * ui_destroy_chyron(UiChyron *chyron)
Destroy UiChyron structure.
Definition ui_common.c:656
int ui_get_chyron_key(UiChyron *chyron, uint x)
Get keycode from chyron.
Definition ui_common.c:861
void ui_mbc_to_wc(wchar_t wc[2], const char mbc)
Convert a multibyte character to a wide character.
Definition ui_common.c:302
void ui_deactivate_chyron_key(UiChyron *chyron, uint k)
Deactivate chyron key.
Definition ui_common.c:760
const char *const ui_logcolor[]
Definition ui_common.c:1377
void ui_apply_gamma(RGB *rgb)
Apply gamma correction to RGB color.
Definition ui_common.c:941
void ui_activate_all_chyron_keys(UiChyron *chyron)
Deactivate chyron key.
Definition ui_common.c:750
char ui_timestamp[32]
Definition ui_common.c:1392
uint ui_rgb_to_xterm256_idx(RGB *rgb)
Convert RGB color to XTerm 256 color index.
Definition ui_common.c:886
void ui_compile_chyron(UiChyron *chyron)
construct the chyron string from the chyron structure
Definition ui_common.c:782
FILE * ui_log_fp
Definition ui_common.c:1387
int ui_setcchar(UiCell *cell, const wchar_t *wstr, const attr_t attrs, short pair, const void *opts)
Set the character and attributes of a UiCell.
uint ui__mbstr_to_cellstr(UiCell *cmplx_buf, const char *str, const UiCell *cell_base, uint *p, const uint atmost)
int ui_chg_pair(uint pair, uint fg, uint bg)
Change the foreground and background colors of an existing color pair.
int ui_pair_content(uint pair, uint *fg, uint *bg)
Get the foreground and background colors of a specified color pair.
SCREEN * ui_ncurses_get_screen()
Get the current SCREEN pointer used by the UI.
int ui_getcchar(const UiCell *cell, wchar_t *wstr, attr_t *attrs, short *pair, const void *opts)
Get the character and attributes from a UiCell.
Definition ui_ncurses.c:987
int ui_init_color(uint color, uint r, uint g, uint b)
Initialize a color in the curses color table with specified RGB values.
int ui_init_pair(uint pair, uint fg, uint bg)
Initialize a color pair in the curses color table with specified foreground and background colors.
uint ui_add_pair(uint fg, uint bg)
Add a new color pair to the UI, or retrieve the index of an existing pair.
UiSurface * ui_surface[UI_SFC_MAX]
Definition ui_ncurses.c:40
uint32_t ui_get_color(uint16_t color_idx)
Get the RGB color value for a given color index.
int ui_color_content(uint color, uint *r, uint *g, uint *b)
void fast_exit(UiSurface *s)
Exit the UI application quickly, cleaning up resources.
Definition ui_ncurses.c:339
UiRuntime * ui
Definition ui_ncurses.c:39
RGB ui_hex_to_rgb(char *s)
Convert a hexadecimal color string to an RGB structure.
int ui_pair_from_hex(const char *fg, const char *bg)
Convert hex color strings to a curses color pair index.
Definition ui_ncurses.c:86
void ui_destroy_curses()
UiCell ui_cell_from_ucp(const wchar_t *ucp, const uint32_t *fg, const uint32_t *bg)
Convert a Unicode code point to a curses UiCell with specified foreground and background colors.
Definition ui_ncurses.c:101
uint ui_pair_cnt
Definition ui_ncurses.c:44
uint ui_color_cnt
Definition ui_ncurses.c:43
void ui_def_prog_mode()
Definition ui_ncurses.c:826
int ui_color_from_rgb(RGB *rgb)
Convert RGB to curses color index, adding new color if necessary.
int ui_chg_color(uint16_t color_idx, uint32_t *color)
Change the RGB color value for a given color index.
int ui_mvwadd_wchnstr(UiSurface *s, ss_t w, uint y, uint x, const UiCell *cmplx_buf, uint n)
Draw a complex character string at a specific position in a surface window, with a maximum length.
int ui_waddstr(UiSurface *s, ss_t w, const char *text)
Draw a text string in a surface window.
int ui_mvwaddnwstr(UiSurface *s, ss_t w, uint y, uint x, const wchar_t *wstr, int m)
Draw a wide-character string at a specific position in a surface window, with a maximum length.
int ui_waddwstr(UiSurface *s, ss_t w, const wchar_t *wstr)
Draw a wide-character string in a surface window.
int ui_mvwaddch(UiSurface *s, ss_t w, uint y, uint x, const char c)
Draw a character in a surface window.
int ui_waddnstr(UiSurface *s, ss_t w, const char *text, int m)
Draw a text string in a surface window, with a maximum length.
int ui_mvwaddnstr(UiSurface *s, ss_t w, uint y, uint x, const char *text, int m)
Draw a text string at a specific position in a surface window, with a maximum length.
int ui_mvwadd_wchstr(UiSurface *s, ss_t w, uint y, uint x, const UiCell *cmplx_buf)
Draw a complex character string at a specific position in a surface window.
int ui_mvwaddwstr(UiSurface *s, ss_t w, uint y, uint x, const wchar_t *wstr)
Draw a wide-character string at a specific position in a surface window.
int ui_mvwaddstr(UiSurface *s, ss_t w, uint y, uint x, const char *text)
Draw a text string at a specific position in a surface window.
int ui_mvwadd_wch(UiSurface *s, ss_t w, uint y, uint x, const UiCell *cell)
Draw a complex character at a specific position in a surface window.
int ui_mvwaddstr_fill(UiSurface *s, ss_t w, uint y, uint x, const char *str, int m)
Draw a text string at a specific position in a surface window, filling the remaining space with space...
int ui_wadd_wch(UiSurface *s, ss_t w, const UiCell *cell)
Draw a complex character in a surface window.
int ui_waddnwstr(UiSurface *s, ss_t w, const wchar_t *wstr, int m)
Draw a wide-character string in a surface window, with a maximum length.
int ui_wadd_wchstr(UiSurface *s, ss_t w, const UiCell *cmplx_buf)
Draw a complex character string in a surface window.
int ui_wadd_wchnstr(UiSurface *s, ss_t w, const UiCell *cmplx_buf, uint n)
Draw a complex character string in a surface window, with a maximum length.
int ui_waddch(UiSurface *s, ss_t w, const char c)
on specified window, at current location, add character
int init_cnt
Definition mem.c:28
void view_full_screen_resize(Init *)
Resize the full screen view and its components.
Definition init_view.c:111
void view_boxwin_resize(Init *)
Resize the current window and its box.
Definition init_view.c:198
ViewStack view_stack
Definition init_view.c:32
#define TRUE
Definition iloan.c:31
int popup_ckeys()
Definition curskeys.c:31
#define MAXLEN
Definition curskeys.c:15
void cmenu_shutdown(Init *init)
Definition menu.c:88
void cmenu_abend(Init *init, int ec, char *s)
Definition menu.c:94
uint form_yx_to_fidx(Form *, uint, uint)
int cf_accept(UiSurface *sfc, ss_t w, char *accept_s, uint flin, uint fcol, uint flen)
Accepts input for a field in a C-Menu window.
Definition cm_fields.c:41
bool f_erase_remainder
Structure to hold field information for C-Menu.
Definition cm_fields.c:30
int process_config_file(char *, Init *)
Definition init.c:694
void display_field(UiCell *cmplx_buf, uint y, uint x)
Definition fields.c:355
char ff_tbl[][26]
Definition fields.c:25
struct termios shell_tioctl
Definition scriou.c:22
int fork_exec(char **)
Fork and exec a command.
Definition exec.c:122
int shell(char *)
Execute a shell command.
Definition exec.c:74
int full_screen_fork_exec(char **)
Execute a command in full screen mode.
Definition exec.c:45
int full_screen_shell(char *)
Execute a shell command in full screen mode.
Definition exec.c:58
int fork_detach_execvp(char **eargv)
Fork, set new session ID, close files, and execute detached command.
Definition detach.c:41
int form_fmt_field(Form *form, char *s)
Format field according to its format type.
Definition fields.c:449
bool is_valid_date(uint yyyy, uint mm, uint dd)
Check if a given date is valid, including leap years.
Definition fields.c:612
int field_editor(Form *)
Accept input for a field.
Definition fields.c:47
void numeric(char *d, char *s)
Extract numeric characters from source string to destination string.
Definition fields.c:649
bool is_valid_time(uint hh, uint mm, uint ss)
Check if a given time is valid.
Definition fields.c:633
void right_justify(char *, uint)
Right justify string by removing trailing spaces and adding leadingspaces.
Definition fields.c:586
void left_justify(char *s)
Left justify string by removing leading spaces.
Definition fields.c:573
int form_display_field_n(Form *, uint)
Display field n.
Definition fields.c:348
int form_display_field(Form *)
Display current field.
Definition fields.c:370
int form_desc_error(Form *form, int, char *, char *)
Handle errors encountered while parsing the form description file, providing detailed error messages ...
int init_form(Init *, int, char **, uint, uint)
Initialize form data structure and parse description file.
Definition form_engine.c:61
int field_navigator(Form *)
Handle user input for field entry, allowing navigation between fields and looping until an exit actio...
bool locate_file_in_path(char *, char *)
Locates a file in the system PATH.
Definition futil.c:1296
size_t canonicalize_file_spec(char *)
Removes quotes and trims at first space.
Definition futil.c:1350
size_t strnz__cpy(char *, const char *, size_t)
safer alternative to strncpy
Definition whence.c:291
bool parse_local_timestamp(const char *, time_t *)
Parses an ISO 8601 timestamp string in local time and converts it to time_t.
Definition futil.c:250
bool trim_ext(char *, char *)
trims the file extension from "filename" and copies the result to "buf"
Definition futil.c:1035
bool stripz_quotes(char *)
removes leading and trailing double quotes if present
Definition futil.c:723
size_t trim(char *)
Trims leading and trailing spaces from string s in place.
Definition futil.c:361
char * get_local_timestamp()
Returns the current local time as an ISO 8601 formatted string.
Definition futil.c:284
bool is_directory(const char *)
Checks if the given path is a directory.
Definition futil.c:1381
bool file_spec_path(char *, char *)
extracts the path component of a file specification
Definition futil.c:889
bool str_to_upper(char *)
Converts a string to uppercase.
Definition futil.c:496
bool dir_name(char *, char *)
Returns the directory name of a file specification.
Definition futil.c:1158
bool is_hex_str(char *, uint)
Validates that a string consists of exactly len hexadecimal digits.
Definition futil.c:197
double str_to_double(char *)
converts string to double
Definition futil.c:948
bool str_to_lower(char *)
Converts a string to lowercase.
Definition futil.c:482
size_t strnz(char *, size_t)
terminates string at New Line, Carriage Return, or max_len
Definition futil.c:599
size_t ssnprintf(char *, size_t, const char *,...)
ssnprintf was designed to be a safer alternative to snprintf.
Definition futil.c:390
bool strip_quotes(char *)
removes leading and trailing double quotes if present
Definition futil.c:710
int str_to_args(char **, char *, uint)
Converts a string into an array of argument strings.
Definition futil.c:412
bool is_valid_regex(const char *)
Checks if the given regular expression pattern is valid.
Definition futil.c:1409
bool expand_tilde(char *, uint)
Replaces "~/" in string with the user's home directory.
Definition futil.c:989
char * strnz_dup(char *, size_t)
Allocates memory for and duplicates string s up to length l or until line feed or carriage return.
Definition futil.c:642
bool file_spec_name(char *, char *)
extracts the file name component of a file specification
Definition futil.c:916
char size_t strip_ansi(char *, char *)
Strips ANSI SGR escape sequences (ending in 'm') from string s to d.
Definition futil.c:848
bool mk_dir(char *dir)
If directory doesn't exist, make it.
Definition futil.c:1329
size_t strnz__cat(char *, const char *, size_t)
safer alternative to strncat
Definition whence.c:320
bool get_argp_doc_by_name(char *comment, const struct argp_option *, const char *)
Retrieves the documentation string for a given key name from an argp options array.
Definition futil.c:164
char * get_ip_addresses(char *, uint)
Retrieves the IP addresses of the local machine and formats them into a string.
Definition futil.c:324
bool is_symlink_to_dir(const char *)
Checks if the given path is a symbolic link to a directory.
Definition futil.c:1394
bool verify_file(char *, uint)
Verifies that the file specified by "in_spec" exists and is accessible with the permissions specified...
Definition futil.c:1249
size_t strnlf(char *, size_t)
terminates string with line feed
Definition futil.c:619
int a_toi(char *, bool *)
a safer alternative to atoi() for converting ASCII strings to integers.
Definition futil.c:784
bool str_subc(char *, char *, char, char *, uint)
Replaces "ReplaceChr" in "s" with "Withstr" in "d" won't copy more than "l" bytes to "d" Replaces all...
Definition futil.c:680
char * strerror__r(int errnum, char *buf, size_t buflen)
A thread-safe alternative to strerror() that writes the error message corresponding to errnum into th...
Definition futil.c:748
int destroy_argv(uint argc, char **argv)
Deallocates memory allocated for argument strings in argv.
Definition futil.c:468
bool chrep(char *, char, char)
Replaces all occurrences of old_chr in s with new_chr in place.
Definition futil.c:765
bool base_name(char *, char *)
Returns the base name of a file specification.
Definition futil.c:1132
bool normalize_file_spec(char *)
replace backslashes with forward lashes
Definition futil.c:872
char * format_local_timestamp(time_t, char *, size_t)
Formats a time_t as an ISO 8601 string in local time.
Definition futil.c:273
bool is_newer(char *, char *)
Checks if the file specified by "fut" is newer than the file specified by "control".
Definition futil.c:148
char * fdname(int, char *)
Retrieves the file path associated with a given file descriptor.
Definition futil.c:1073
bool verify_dir(char *, uint)
Verifies that the directory specified by "spec" exists and is accessible with the permissions specifi...
Definition futil.c:1198
char * get_user_str(char *, size_t)
Retrieves the current user's name and UID, and formats it into a string.
Definition futil.c:297
bool trim_path(char *)
Trims trailing spaces and slashes from directory path in place.
Definition futil.c:1007
unsigned long a_to_ul(const char *)
Converts a string to an unsigned long long integer, with support for suffixes K, M,...
Definition futil.c:812
bool unstr_hex_clr(char *, char *)
Validates that a string is a hex color code in the format "#RRGGBB".
Definition futil.c:220
size_t string_cpy(String *, const String *)
Copy src String to dest String, allocating additional memory for dest String if necessary.
Definition futil.c:1584
String to_string(const char *)
String functions provide a simple string library to facilitate string manipulation in C,...
Definition futil.c:1530
size_t string_ncpy(String *, const String *, size_t)
copies up to n characters from src String to dest String, allocating additional memory for dest Strin...
Definition futil.c:1641
size_t string_cat(String *, const String *)
Concatenates src String to dest String, allocating additional memory for dest String if necessary.
Definition futil.c:1601
String free_string(String)
Free the dynamically allocated String.
Definition futil.c:1569
size_t string_ncat(String *, const String *, size_t)
Concatenates up to n characters from src String to dest String, allocating additional memory for dest...
Definition futil.c:1620
int segmentation_fault()
Function to intentionally cause a segmentation fault for testing purposes.
Definition futil.c:1666
int parse_opt_args(Init *, int, char **)
Parse command-line options and set Init struct values accordingly.
Definition init.c:622
bool derive_file_spec(char *, char *, char *)
Derive full file specification from directory and file name.
Definition init.c:1436
int write_config(Init *init)
Write the current configuration to a file specified in init->minitrc.
Definition init.c:1160
void mapp_initialization(Init *, int, char **)
Main initialization function for MAPP - Menu Application.
Definition init.c:498
void zero_opt_args(Init *)
Initialize optional arguments in the Init struct to default values.
Definition init.c:637
void view_calc_boxwin_dimensions(Init *)
Calculate the dimensions and position of the box window for C-Menu View.
Definition init_view.c:215
int init_view_full_screen(Init *init)
Initialize C-Menu View in full screen mode.
Definition init_view.c:47
int init_view_boxwin(Init *init)
Initialize the C-Menu View in box window mode.
Definition init_view.c:162
void view_calc_full_screen_dimensions(Init *)
Calculate the dimensions for full screen mode.
Definition init_view.c:128
int view_init_input(Init *init, char *file_name)
Initialize the input for the C-Menu View.
Definition init_view.c:299
bool verify_spec_arg(char *, char *, char *, char *, uint)
Verify file specification argument.
Definition mem.c:361
Pick * new_pick(Init *init, int argc, char **argv, uint begy, uint begx)
Create and initialize Pick structure.
Definition mem.c:178
View * destroy_view(Init *init)
Destroy View structure.
Definition mem.c:337
Menu * new_menu(Init *init, int argc, char **argv, uint begy, uint begx)
Create and initialize Menu structure.
Definition mem.c:126
Init * new_init(int argc, char **argv)
Create and initialize Init structure.
Definition mem.c:60
Menu * destroy_menu(Init *init)
Destroy Menu structure.
Definition mem.c:147
Form * destroy_form(Init *init)
Destroy Form structure.
Definition mem.c:267
View * new_view(Init *init)
Create and initialize View structure.
Definition mem.c:291
Init * destroy_init(Init *init)
Destroy Init structure.
Definition mem.c:91
Form * new_form(Init *init, int argc, char **argv, uint begy, uint begx)
Create and initialize Form structure.
Definition mem.c:244
Pick * destroy_pick(Init *init)
Destroy Pick structure.
Definition mem.c:217
unsigned int menu_engine(Init *)
The main loop of the menu system.
Definition menu_engine.c:36
unsigned int get_command_type(char *)
Get command type from command string.
unsigned int parse_menu_description(Init *)
Parse menu description file and create Menu.
void save_object(Pick *, char *)
Saves a string as an object in the pick structure.
void toggle_object(Pick *)
Toggles the selection state of the currently selected object in pick window.
int output_objects(Pick *)
Outputs selected objects to specified output file.
int init_pick(Init *, int, char **, uint, uint)
Initializes pick structure and opens pick input file or pipe.
Definition pick_engine.c:68
void reverse_object(Pick *)
Reverses the display of the currently selected object in pick window.
void display_pick_page(Pick *)
Displays current page of objects in pick window.
bool restore_program_tioctl()
restore_program_tioctl() - restore program terminal settings
Definition scriou.c:84
bool capture_shell_tioctl()
capture_shell_tioctl() - capture shell terminal settings
Definition scriou.c:43
char di_getch()
get single character from terminal in raw mode
Definition scriou.c:158
bool mk_raw_tioctl(struct termios *)
mk_raw_tioctl() - set terminal to raw mode
Definition scriou.c:132
bool set_sane_tioctl(struct termios *)
set_sane_tioctl() - set terminal to sane settings for C-MENU
Definition scriou.c:99
bool restore_shell_tioctl()
restore_shell_tioctl() - restore shell terminal settings
Definition scriou.c:57
bool capture_program_tioctl()
capture_program_tioctl() - capture program terminal settings
Definition scriou.c:70
void sig_dfl_mode()
Set signal handlers to default behavior.
Definition sig.c:41
void signal_handler(int)
Signal handler for interrupt signals.
Definition sig.c:94
void sig_prog_mode()
Set up signal handlers for interrupt signals.
Definition sig.c:61
int view_file(Init *)
Start view.
void cat_file(View *)
Concatenate File to Standard Output.
int view_cmd_processor(Init *)
Main Command Processing Loop for View.
void build_prompt(View *)
Build Prompt String.
void initialize_line_table(View *)
Initialize Line Table.
void destroy_line_table(View *)
Destroy Line Table.
void page_next(View *)
Advance to Next Page.
int pad_refresh(View *)
Refresh Pad and Line Number Window.
int display_prompt(View *, char *)
Display Command Line Prompt.
int ui_perror(char *emsg_str)
Display a simple error message window or print to stderr.
Definition ui_common.c:1257
void ui_unregister_read_fd(int fd)
Unregister an external file descriptor from polling.
Definition ui_common.c:1134
void ui_register_read_fd(int fd, int token_id)
Register an external file descriptor for polling.
Definition ui_common.c:1117
int ui_timeout_prompt(char *msg0, char *msg1, uint timeout_ms, uint timeout_secs)
Display a timeout prompt window or print to stderr.
Definition ui_common.c:1033
int ui_update_timeout_prompt(UiSurface *sfc, ss_t w, uint timeout_ms)
Update the timeout prompt with the remaining time.
Definition ui_common.c:1096
int ui_poll_reg_read_fd(int timeout_ms)
Poll for input on registered external files.
Definition ui_common.c:1155
bool ui_action_disposition(char *title, char *action_str)
Display a simple action disposition message window or print to stderr.
Definition ui_common.c:1311
int ui_answer_yn(char *msg0, char *msg1, char *msg2, char *msg3)
Accept a single letter answer.
Definition ui_common.c:972
int ui_display_error(char *msg0, char *msg1, char *msg2, char *msg3)
Display an error message window or print to stderr.
Definition ui_common.c:1200
UiBackend ui_get_backend()
Get the UI backend type.
Definition ui_ncurses.c:55
bool active
Definition ui_backend.h:110
uint32_t ch
Definition ui_backend.h:104
UiMouseAction mouse_action
Definition ui_backend.h:114
bool shift
Definition ui_backend.h:107
int bstate
Definition ui_backend.h:113
char keybound[16]
Definition ui_backend.h:116
int chyron
Definition ui_backend.h:111
ss_t in_win
Definition ui_backend.h:112
bool ctrl
Definition ui_backend.h:106
UiKey key
Definition ui_backend.h:103
bool alt
Definition ui_backend.h:105
bool mouse_inside
Definition ui_backend.h:115
wchar_t w32
Definition ui_backend.h:122
char c[4]
Definition ui_backend.h:123
uint32_t u32
Definition ui_backend.h:121
nfds_t ext_nfds
Definition ui_backend.h:144
ext_fd_reg_t ext_fds[MAX_EXT_FDS]
Definition ui_backend.h:143
wchar_t wc
Definition ui_backend.h:165
short attrs
Definition ui_backend.h:166
short color_pair
Definition ui_backend.h:167
int cols
Definition ui_backend.h:186
int lines
Definition ui_backend.h:185
UiBorderStyle border_style
Definition ui_backend.h:445
char * log_file
Definition ui_backend.h:446
UiLogLevel log_level
Definition ui_backend.h:447
bool palette256
Definition ui_backend.h:458
bool mouse
Definition ui_backend.h:459
int color_pairs
Definition ui_backend.h:462
bool truecolor
Definition ui_backend.h:457
bool unicode
Definition ui_backend.h:460
bool resize
Definition ui_backend.h:461
wchar_t cr
Definition ui_backend.h:571
wchar_t tl
Definition ui_backend.h:572
wchar_t bt
Definition ui_backend.h:570
wchar_t rt
Definition ui_backend.h:568
wchar_t tr
Definition ui_backend.h:573
wchar_t br
Definition ui_backend.h:575
wchar_t bl
Definition ui_backend.h:574
wchar_t lt
Definition ui_backend.h:567
wchar_t str[11]
Definition ui_backend.h:563
wchar_t ve
Definition ui_backend.h:566
wchar_t tt
Definition ui_backend.h:569
wchar_t ho
Definition ui_backend.h:565
uint32_t ran_bg
Definition ui_backend.h:740
double green_gamma
Definition ui_backend.h:693
uint32_t ln_bg
Definition ui_backend.h:726
ushort cp_ran
Definition ui_backend.h:769
FILE * stdout_fp
Definition ui_backend.h:742
ushort cp_ind
Definition ui_backend.h:765
double blue_gamma
Definition ui_backend.h:694
ushort cp_nt_hl
Definition ui_backend.h:762
uint32_t abg
Definition ui_backend.h:714
char brackets[3]
Definition ui_backend.h:753
uint32_t magenta
Definition ui_backend.h:701
uint32_t cmdln_bg
Definition ui_backend.h:728
ushort cp_title
Definition ui_backend.h:767
int stdout_fd
Definition ui_backend.h:746
uint32_t cmdln_fg
Definition ui_backend.h:727
ushort cp_default
Definition ui_backend.h:757
int stderr_fd
Definition ui_backend.h:747
uint32_t nt_hl_rev_fg
Definition ui_backend.h:735
uint clr_cnt
Definition ui_backend.h:749
uint32_t ran_fg
Definition ui_backend.h:739
ushort cp_brackets
Definition ui_backend.h:759
ushort cp_cmdln
Definition ui_backend.h:766
FILE * stdin_fp
Definition ui_backend.h:741
uint32_t bgreen
Definition ui_backend.h:707
ushort cp_ln
Definition ui_backend.h:768
double red_gamma
Definition ui_backend.h:692
ushort cp_box
Definition ui_backend.h:764
uint32_t green
Definition ui_backend.h:698
char fill_char[2]
Definition ui_backend.h:754
ushort cp_nt
Definition ui_backend.h:760
FILE * tty_fp
Definition ui_backend.h:744
uint32_t nt_fg
Definition ui_backend.h:729
uint32_t yellow
Definition ui_backend.h:699
uint32_t fill_char_fg
Definition ui_backend.h:723
uint32_t box_fg
Definition ui_backend.h:717
ushort cp_nt_hl_rev
Definition ui_backend.h:763
uint clr_pair_cnt
Definition ui_backend.h:750
uint32_t orange
Definition ui_backend.h:704
ushort cp_bold
Definition ui_backend.h:771
uint32_t ln_fg
Definition ui_backend.h:725
uint32_t ind_bg
Definition ui_backend.h:720
FILE * stderr_fp
Definition ui_backend.h:743
uint32_t bmagenta
Definition ui_backend.h:710
uint32_t ind_fg
Definition ui_backend.h:719
uint32_t byellow
Definition ui_backend.h:708
uint clr_pair_idx
Definition ui_backend.h:752
char tty_name[MAXLEN]
Definition ui_backend.h:756
uint32_t bblue
Definition ui_backend.h:709
uint32_t borange
Definition ui_backend.h:713
uint32_t title_bg
Definition ui_backend.h:738
uint32_t fg
Definition ui_backend.h:715
uint32_t cyan
Definition ui_backend.h:702
uint32_t bblack
Definition ui_backend.h:705
uint32_t red
Definition ui_backend.h:697
ushort cp_fill_char
Definition ui_backend.h:758
uint32_t nt_hl_rev_bg
Definition ui_backend.h:736
uint32_t title_fg
Definition ui_backend.h:737
uint32_t bred
Definition ui_backend.h:706
uint32_t fill_char_bg
Definition ui_backend.h:724
uint32_t black
Definition ui_backend.h:696
ushort cp_chk
Definition ui_backend.h:770
uint32_t nt_rev_bg
Definition ui_backend.h:732
uint32_t brackets_bg
Definition ui_backend.h:722
uint32_t bcyan
Definition ui_backend.h:711
uint clr_idx
Definition ui_backend.h:751
uint32_t nt_bg
Definition ui_backend.h:730
uint32_t blue
Definition ui_backend.h:700
int tty_fd
Definition ui_backend.h:748
uint32_t brackets_fg
Definition ui_backend.h:721
uint32_t white
Definition ui_backend.h:703
uint32_t box_bg
Definition ui_backend.h:718
ushort cp_nt_rev
Definition ui_backend.h:761
uint32_t nt_hl_fg
Definition ui_backend.h:733
int stdin_fd
Definition ui_backend.h:745
uint32_t bwhite
Definition ui_backend.h:712
char border
Definition ui_backend.h:755
uint32_t nt_rev_fg
Definition ui_backend.h:731
double gray_gamma
Definition ui_backend.h:695
uint32_t nt_hl_bg
Definition ui_backend.h:734
uint32_t bg
Definition ui_backend.h:716
NcVisual * ncv
Definition ui_backend.h:776
UiSurface * sfc
Definition ui_backend.h:777
uint mm
Definition cm.h:72
uint dd
Definition cm.h:73
uint yyyy
Definition cm.h:71
uint hh
Definition cm.h:77
uint mm
Definition cm.h:78
uint ss
Definition cm.h:79
char * s
Definition cm.h:402
size_t l
Definition cm.h:403
Arg ** v
Definition cm.h:406
size_t n
Definition cm.h:407
size_t l
Definition cm.h:411
char * s
Definition cm.h:410
size_t l
Definition cm.h:415
wchar_t * s
Definition cm.h:414
char fill_char
Definition cm.h:427
uint ff
Definition cm.h:426
uint flen
Definition cm.h:425
uint fcol
Definition cm.h:424
uint flin
Definition cm.h:423
bool cf_erase_remainder
Definition cm.h:428
char title[MAXLEN]
Definition common.h:132
char mapp_data[MAXLEN]
Definition common.h:151
char minitrc[MAXLEN]
Definition common.h:177
bool f_out_spec
Definition common.h:174
char mapp_help[MAXLEN]
Definition common.h:152
int begx
Definition common.h:121
bool f_title
Definition common.h:169
char chyron_s[MAXLEN]
Definition common.h:131
SIO * sio
Definition common.h:117
int pick_cnt
Definition common.h:192
bool f_cmd_all
Definition common.h:168
Form * form
Definition common.h:189
char in_spec[MAXLEN]
Definition common.h:171
char log_file_spec[MAXLEN]
Definition common.h:181
UiLogLevel min_log_level
Definition common.h:183
char cmd_all[MAXLEN]
Definition common.h:126
bool f_mapp_help
Definition common.h:160
bool f_mapp_msrc
Definition common.h:161
int argc
Definition common.h:133
char fill_char[2]
Definition common.h:149
bool f_cmd
Definition common.h:167
int prompt_type
Definition common.h:129
char about_fn[MAXLEN]
Definition common.h:178
char mapp_msrc[MAXLEN]
Definition common.h:153
int cols
Definition common.h:119
int menu_cnt
Definition common.h:188
int tab_stop
Definition common.h:185
bool f_mapp_home
Definition common.h:157
bool f_erase_remainder
Definition common.h:144
bool f_mapp_data
Definition common.h:158
bool f_read_theme
Definition common.h:145
bool f_mapp_desc
Definition common.h:164
char mapp_home[MAXLEN]
Definition common.h:150
bool f_mapp_user
Definition common.h:162
char prompt_str[MAXLEN]
Definition common.h:128
bool f_squeeze
Definition common.h:140
int begy
Definition common.h:120
char parent_cmd[MAXLEN]
Definition common.h:127
char mapp_spec[MAXLEN]
Definition common.h:179
char receiver_cmd[MAXLEN]
Definition common.h:124
int h_shift
Definition common.h:186
bool wrap
Definition common.h:147
bool f_multiple_cmd_args
Definition common.h:142
int select_max
Definition common.h:184
bool f_ln
Definition common.h:146
bool f_mapp_spec
Definition common.h:159
char provider_cmd[MAXLEN]
Definition common.h:123
char out_spec[MAXLEN]
Definition common.h:172
bool f_strip_ansi
Definition common.h:139
View * view
Definition common.h:193
bool p_view_files
Definition common.h:137
Menu * menu
Definition common.h:187
bool f_at_end_remove
Definition common.h:138
int view_cnt
Definition common.h:194
char brackets[3]
Definition common.h:148
bool f_ignore_case
Definition common.h:136
char ** argv
Definition common.h:134
int lines
Definition common.h:118
char mapp_user[MAXLEN]
Definition common.h:154
char cmd[MAXLEN]
Definition common.h:125
char mapp_theme[MAXLEN]
Definition common.h:155
uint timeout_secs
Definition common.h:182
int optind
Definition common.h:135
bool f_help_spec
Definition common.h:170
bool f_receiver_cmd
Definition common.h:166
bool f_provider_cmd
Definition common.h:165
int form_cnt
Definition common.h:190
char help_spec[MAXLEN]
Definition common.h:180
char editor[MAXLEN]
Definition common.h:175
Pick * pick
Definition common.h:191
bool f_in_spec
Definition common.h:173
char menuapp[MAXLEN]
Definition common.h:176
uint col
Definition form.h:102
char str[SCR_COLS]
Definition form.h:104
uint len
Definition form.h:106
uint line
Definition form.h:100
UiCell accept_cc[FIELD_MAXLEN]
Definition form.h:142
char display_s[FIELD_MAXLEN]
Definition form.h:130
UiCell display_cc[FIELD_MAXLEN]
Definition form.h:135
char accept_s[FIELD_MAXLEN]
Definition form.h:126
uint col
Definition form.h:115
uint ff
Definition form.h:119
uint len
Definition form.h:117
char input_s[FIELD_MAXLEN]
Definition form.h:123
UiCell filler_cc[FIELD_MAXLEN]
Definition form.h:141
uint line
Definition form.h:113
char filler_s[FIELD_MAXLEN]
Definition form.h:136
uint dcnt
Definition form.h:332
uint bo_clr_idx
Definition form.h:149
uint fg_clr_idx
Definition form.h:147
FILE * out_fp
Definition form.h:163
Text * text[FIELD_MAXCNT]
Definition form.h:340
uint cols
Definition form.h:151
bool f_in_pipe
Definition form.h:223
bool f_mapp_spec
Definition form.h:194
wchar_t brktr[5]
Definition form.h:296
bool f_erase_remainder
Definition form.h:237
Field * field[FIELD_MAXCNT]
Definition form.h:353
char receiver_cmd[MAXLEN]
Definition form.h:180
bool f_process
Definition form.h:248
uint fidx
Definition form.h:310
char provider_cmd[MAXLEN]
Definition form.h:172
bool f_query
Definition form.h:250
UiChyron * chyron
Definition form.h:365
int out_fd
Definition form.h:167
uint didx
Definition form.h:325
bool f_out_pipe
Definition form.h:228
uint begy
Definition form.h:152
bool f_provider_cmd
Definition form.h:258
bool f_calculate
Definition form.h:246
char fill_char[4]
Definition form.h:299
bool help
Definition form.h:252
bool f_cmd
Definition form.h:273
bool f_help_spec
Definition form.h:233
FILE * in_fp
Definition form.h:161
char out_spec[MAXLEN]
Definition form.h:210
uint lines
Definition form.h:150
bool f_receiver_cmd
Definition form.h:265
wchar_t brktl[5]
Definition form.h:293
bool f_multiple_cmd_args
Definition form.h:245
uint begx
Definition form.h:154
char in_spec[MAXLEN]
Definition form.h:203
char mapp_spec[FIELD_MAXLEN]
Definition form.h:169
char cmd[MAXLEN]
Definition form.h:187
char title[MAXLEN]
Definition form.h:159
char brackets[3]
Definition form.h:281
uint bg_clr_idx
Definition form.h:148
bool f_out_spec
Definition form.h:220
bool f_in_spec
Definition form.h:217
uint fcnt
Definition form.h:318
int in_fd
Definition form.h:165
char help_spec[MAXLEN]
Definition form.h:196
char * choice_text
Definition menu.h:78
void * ui_surface
Definition menu.h:65
void * ui_runtime
Definition menu.h:58
char * raw_text
Definition menu.h:75
char * command_str
Definition menu.h:93
unsigned int type
Definition menu.h:73
uint letter_pos
Definition menu.h:84
char choice_letter
Definition menu.h:81
uint command_type
Definition menu.h:87
char provider_cmd[MAXLEN]
Definition menu.h:154
uint bg_clr_idx
Definition menu.h:108
char mapp_spec[MAXLEN]
Definition menu.h:143
int argc
Definition menu.h:137
Line * line[MAX_MENU_LINES]
Definition menu.h:222
bool f_help_spec
Definition menu.h:181
char cmd[MAXLEN]
Definition menu.h:169
bool f_provider_cmd
Definition menu.h:186
uint fg_clr_idx
Definition menu.h:105
uint text_max_len
Definition menu.h:209
uint begy
Definition menu.h:117
bool f_mapp_spec
Definition menu.h:176
uint cols
Definition menu.h:115
char receiver_cmd[MAXLEN]
Definition menu.h:162
uint bo_clr_idx
Definition menu.h:111
bool f_receiver_cmd
Definition menu.h:193
bool f_cmd
Definition menu.h:199
uint choice_max_len
Definition menu.h:203
char help_spec[MAXLEN]
Definition menu.h:149
uint begx
Definition menu.h:120
uint line_idx
Definition menu.h:218
uint lines
Definition menu.h:113
char ** argv
Definition menu.h:140
uint item_count
Definition menu.h:215
char title[MAXLEN]
Definition menu.h:134
bool f_mapp_spec
Definition pick.h:56
char ** m_object
Definition pick.h:71
UiChyron * chyron
Definition pick.h:94
uint select_idx
Definition pick.h:72
uint separator_line
Definition pick.h:92
uint tbl_line
Definition pick.h:87
bool f_cmd
Definition pick.h:69
uint pg_objs
Definition pick.h:83
bool f_provider_cmd
Definition pick.h:67
uint y
Definition pick.h:33
uint select_max
Definition pick.h:74
bool p_view_files
Definition pick.h:64
uint m_idx
Definition pick.h:77
uint tbl_cols
Definition pick.h:89
uint tbl_page
Definition pick.h:86
bool f_in_spec
Definition pick.h:57
char ** d_object
Definition pick.h:79
char cmd[MAXLEN]
Definition pick.h:54
bool f_help_spec
Definition pick.h:61
FILE * in_fp
Definition pick.h:44
bool f_out_spec
Definition pick.h:58
int argc
Definition pick.h:42
bool f_multiple_cmd_args
Definition pick.h:63
uint d_cnt
Definition pick.h:76
uint pg_lines
Definition pick.h:82
char mapp_spec[MAXLEN]
Definition pick.h:48
bool f_in_pipe
Definition pick.h:59
bool f_selected[OBJ_MAXCNT]
Definition pick.h:65
int out_fd
Definition pick.h:47
uint m_cnt
Definition pick.h:75
char title[MAXLEN]
Definition pick.h:41
bool help
Definition pick.h:66
char help_spec[MAXLEN]
Definition pick.h:51
char in_buf[BUFSIZ]
Definition pick.h:70
uint tbl_pages
Definition pick.h:85
int in_fd
Definition pick.h:46
uint fg_clr_idx
Definition pick.h:26
bool f_out_pipe
Definition pick.h:60
UiSurface * surface
Definition pick.h:40
char receiver_cmd[MAXLEN]
Definition pick.h:53
char ** argv
Definition pick.h:43
uint tab_idx
Definition pick.h:84
uint tbl_col_width
Definition pick.h:91
bool f_read_theme
Definition pick.h:62
char in_spec[MAXLEN]
Definition pick.h:49
FILE * out_fp
Definition pick.h:45
char parent_cmd[MAXLEN]
Definition pick.h:55
uint lines
Definition pick.h:29
uint x
Definition pick.h:34
uint select_cnt
Definition pick.h:73
uint d_idx
Definition pick.h:78
uint tbl_lines
Definition pick.h:88
uint bo_clr_idx
Definition pick.h:28
uint begy
Definition pick.h:31
uint tbl_col
Definition pick.h:90
uint y_offset
Definition pick.h:80
uint begx
Definition pick.h:32
uint pg_line
Definition pick.h:81
bool f_receiver_cmd
Definition pick.h:68
uint width
Definition pick.h:30
uint bg_clr_idx
Definition pick.h:27
char provider_cmd[MAXLEN]
Definition pick.h:52
char out_spec[MAXLEN]
Definition pick.h:50
off_t sl_ln_no
Definition view.h:50
uint sl_cnt
Definition view.h:56
uint sl_cols[MAXLEN]
Definition view.h:53
uint sl_idx
Definition view.h:55
UiCell * sl_cc[MAXLEN]
Definition view.h:52
uint sl_cells[MAXLEN]
Definition view.h:54
char * sl_s[MAXLEN]
Definition view.h:51
uint smaxrow
Definition view.h:132
char provider_cmd[MAXLEN]
Definition view.h:74
uint sminrow
Definition view.h:128
char in_spec[MAXLEN]
Definition view.h:140
char * lnbuf_curr_ptr
Definition view.h:176
off_t page_top_ln_no
Definition view.h:157
off_t srch_curr_ln_no
Definition view.h:159
uint ln_clr_idx
Definition view.h:63
char ln_bg_clr_x[COLOR_LEN]
Definition view.h:69
char fg_clr_x[COLOR_LEN]
Definition view.h:65
int argc
Definition view.h:80
int optind
Definition view.h:82
char ** argv
Definition view.h:81
bool f_search_complete
Definition view.h:107
int next_cmd_char
Definition view.h:97
uint page_bot_sl_idx
Definition view.h:193
char * buf
Definition view.h:171
uint maxcol
Definition view.h:125
bool wrap
Definition view.h:188
uint smincol
Definition view.h:130
char * line_out_p
Definition view.h:118
char * line_in_end_p
Definition view.h:120
int in_fd
Definition view.h:163
off_t srch_curr_pos
Definition view.h:155
uint bo_clr_idx
Definition view.h:62
bool f_in_spec
Definition view.h:143
off_t page_top_pos
Definition view.h:152
FILE * in_fp
Definition view.h:166
off_t file_pos
Definition view.h:150
bool page_bot_sl
Definition view.h:191
uint lines
Definition view.h:70
off_t ln_no
Definition view.h:182
char prompt_str[MAXLEN]
Definition view.h:78
off_t prev_file_pos
Definition view.h:151
uint begx
Definition view.h:73
bool f_bod
Definition view.h:99
bool f_first_iter
Definition view.h:106
char line_in_s[PAD_COLS]
Definition view.h:114
char help_spec[MAXLEN]
Definition view.h:142
bool f_redisplay_page
Definition view.h:104
char * file_spec_ptr
Definition view.h:146
off_t ln_pos_max
Definition view.h:187
char * next_file_spec_ptr
Definition view.h:147
int stdout_fd
Definition view.h:169
bool f_is_pipe
Definition view.h:102
bool f_ignore_case
Definition view.h:83
char * lnbuf
Definition view.h:175
uint ln_bg_clr_idx
Definition view.h:64
bool f_cmd_all
Definition view.h:112
bool f_help_spec
Definition view.h:145
char cmd[MAXLEN]
Definition view.h:76
bool page_top_sl
Definition view.h:190
off_t srch_beg_ln_no
Definition view.h:160
bool f_in_pipe
Definition view.h:162
int tmp_fd
Definition view.h:164
char receiver_cmd[MAXLEN]
Definition view.h:75
char * buf_curr_ptr
Definition view.h:172
off_t * ln_tbl
Definition view.h:184
bool f_full_screen
Definition view.h:108
bool f_ln
Definition view.h:181
bool f_strip_ansi
Definition view.h:86
bool f_eod
Definition view.h:100
off_t mark_tbl[NMARKS]
Definition view.h:161
char ln_s[10]
Definition view.h:183
off_t ln_no_max
Definition view.h:186
UiCell cmplx_buf[PAD_COLS]
Definition view.h:117
bool f_cmd
Definition view.h:111
uint cmd_line
Definition view.h:124
bool f_forward
Definition view.h:101
char stripped_line_out[PAD_COLS]
Definition view.h:116
uint page_top_sl_cnt
Definition view.h:194
off_t srch_beg_pos
Definition view.h:156
bool f_at_end_remove
Definition view.h:84
uint ln_win_cols
Definition view.h:180
uint first_match_x
Definition view.h:136
char * tmp_file_name_ptr
Definition view.h:148
uint curx
Definition view.h:122
char bo_clr_x[COLOR_LEN]
Definition view.h:67
off_t file_size
Definition view.h:149
uint scroll_lines
Definition view.h:123
char bg_clr_x[COLOR_LEN]
Definition view.h:66
bool f_squeeze
Definition view.h:85
char tmp_prompt_str[MAXLEN]
Definition view.h:90
char cur_file_str[MAXLEN]
Definition view.h:113
char * buf_end_ptr
Definition view.h:173
char line_out_s[PAD_COLS]
Definition view.h:115
uint cury
Definition view.h:121
FILE * stdin_fp
Definition view.h:168
char out_spec[MAXLEN]
Definition view.h:141
bool f_timer
Definition view.h:109
int tab_stop
Definition view.h:95
uint page_bot_sl_cnt
Definition view.h:195
char title[MAXLEN]
Definition view.h:79
uint cols
Definition view.h:71
char cmd_all[MAXLEN]
Definition view.h:77
off_t page_bot_pos
Definition view.h:153
off_t page_bot_ln_no
Definition view.h:158
uint begy
Definition view.h:72
bool f_displaying_help
Definition view.h:105
int h_shift
Definition view.h:96
int curr_argc
Definition view.h:92
int out_fd
Definition view.h:165
char * lnbuf_end_ptr
Definition view.h:177
uint pmincol
Definition view.h:127
FILE * stdout_fp
Definition view.h:170
uint page_top_sl_idx
Definition view.h:192
char ln_clr_x[COLOR_LEN]
Definition view.h:68
uint smaxcol
Definition view.h:134
uint fg_clr_idx
Definition view.h:60
bool f_out_spec
Definition view.h:144
off_t page_bot_end_pos
Definition view.h:154
UiSurface * sfc
Definition view.h:89
SplitLine cur
Definition view.h:189
char file_name[MAXLEN]
Definition view.h:103
int stdin_fd
Definition view.h:167
uint ln_win_lines
Definition view.h:179
uint last_match_x
Definition view.h:138
off_t ln_tbl_size
Definition view.h:185
char * line_in_beg_p
Definition view.h:119
uint bg_clr_idx
Definition view.h:61
uint pminrow
Definition view.h:126
bool f_multiple_cmd_args
Definition view.h:87
char cmd_arg[MAXLEN]
Definition view.h:94
size_t capacity
Definition view.h:201
size_t top
Definition view.h:202
View * items
Definition view.h:200