2
3
4
5
6
7
8
11
12
13
14
15
16
20#include <ncursesw/ncurses.h>
30
31
32
33
34
35
36
37
43 if (menu ==
nullptr) {
44 Perror("menu_engine: menu is nullptr");
65 memset(&mbstate, 0,
sizeof(mbstate));
89 wchar_t wstr[2] = {L'\0', L'\0'};
91 MB_CUR_MAX, &mbstate);
96 setcchar(&cc, wstr, WA_NORMAL,
cp_nt_hl,
nullptr);
123
124
125
126
127
128
129
130
131
132
143 memset(&mbstate, 0,
sizeof(mbstate));
147 mousemask(BUTTON1_CLICKED | BUTTON1_DOUBLE_CLICKED,
nullptr);
159 wchar_t wstr[2] = {L'\0', L'\0'};
161 MB_CUR_MAX, &mbstate);
171 event.y = event.x = -1;
181 MB_CUR_MAX, &mbstate);
186 setcchar(&cc, wstr, WA_NORMAL,
cp_nt_hl,
nullptr);
191 event.y = event.x = -1;
216
231 eargv[eargc++] = strdup(
"view");
232 eargv[eargc++] = strdup(
"-Nf");
233 eargv[eargc++] = strdup(tmp_str);
234 eargv[eargc] =
nullptr;
245
251 d = getenv(
"PRTCMD");
252 if (d ==
nullptr || *d ==
'\0')
257 d = getenv(
"PRTFILE");
258 if (d ==
nullptr || *d ==
'\0') {
260 if (d ==
nullptr || *d ==
'\0')
285
309
310
338 eargv[eargc++] = strdup(
"view");
339 eargv[eargc++] = strdup(
"-N");
340 eargv[eargc++] = strdup(
"f");
341 eargv[eargc++] = strdup(tmp_str);
342 eargv[eargc] =
nullptr;
353
364
373
382
int popup_ckeys()
Display Curses Keys Responds to curses keys and mouse events, displaying the key code and description...
int popup_form(Init *, int, char **, int, int)
instantiate a form popup window
int popup_menu(Init *, int, char **, int, int)
instantiate a menu popup window
int popup_view(Init *, int, char **, int, int, int, int)
instantiate a view popup window
int popup_pick(Init *, int, char **, int, int)
instantiate a pick popup window
char * stdio_names(char *, char *)
char stdio_names_str[MAXLEN]
int xwgetch(WINDOW *, Chyron *, int)
Wrapper for wgetch that handles signals, mouse events, checks for clicks on the chyron line,...
void restore_wins()
Restore all windows after a screen resize.
void win_del()
Delete the current window and its associated box window.
void mvwaddstr_fill(WINDOW *, int, int, char *, int)
For lines shorter than their display area, fill the rest with spaces.
int box_new(int, int, int, int, char *)
Create a new window with optional box and title.
int Perror(char *)
Display a simple error message window or print to stderr.
int full_screen_fork_exec(char **)
Execute a command in full screen mode.
int full_screen_shell(char *)
Execute a shell command in full screen mode.
int fork_detach_execvp(char **)
Fork, set new session ID, close files, and execute detached command.
size_t strnz__cpy(char *, const char *, size_t)
safer alternative to strncpy
int destroy_argv(int argc, char **argv)
Deallocates memory allocated for argument strings in argv.
size_t trim(char *)
Trims leading and trailing spaces from string s in place.
size_t ssnprintf(char *, size_t, const char *,...)
ssnprintf was designed to be a safer alternative to snprintf.
size_t strnz__cat(char *, const char *, size_t)
safer alternative to strncat
int str_to_args(char **, char *, int)
Converts a string into an array of argument strings.
int write_config(Init *)
Write the current configuration to a file specified in init->minitrc.
Menu * destroy_menu(Init *init)
Destroy Menu structure.
unsigned int menu_engine(Init *)
The main loop of the menu system.
unsigned int menu_cmd_processor(Init *)
Processes user input for the menu system.
unsigned int parse_menu_description(Init *)
Parse menu description file and create Menu.
unsigned int command_type
Line * line[MAX_MENU_LINES]