2
3
4
5
6
7
8
11
12
13
14
15
16
28
29
30
31
32
33
34
35
41 if (menu ==
nullptr) {
62 memset(&mbstate, 0,
sizeof(mbstate));
111
112
113
114
115
116
117
118
119
120
132 memset(&mbstate, 0,
sizeof(mbstate));
139 ui_mice_enable(NCMICE_ALL_EVENTS);
155 event
.y = event
.x = -1;
197
212 eargv[eargc++] = strdup(
"view");
213 eargv[eargc++] = strdup(
"-Nf");
214 eargv[eargc++] = strdup(tmp_str);
215 eargv[eargc] =
nullptr;
226
231 d = getenv(
"PRTCMD");
232 if (d ==
nullptr || *d ==
'\0')
237 d = getenv(
"PRTFILE");
238 if (d ==
nullptr || *d ==
'\0') {
240 if (d ==
nullptr || *d ==
'\0')
266
288
289
317 eargv[eargc++] = strdup(
"view");
318 eargv[eargc++] = strdup(
"-N");
319 eargv[eargc++] = strdup(
"f");
320 eargv[eargc++] = strdup(tmp_str);
321 eargv[eargc] =
nullptr;
332
343
352
361
int popup_form(Init *, int, char **, uint, uint)
instantiate a form popup window
int popup_menu(Init *, int, char **, uint, uint)
instantiate a menu popup window
int popup_pick(Init *, int, char **, uint, uint)
instantiate a pick popup window
int popup_view(Init *, int, char **, uint, uint, uint, uint)
instantiate a view popup window
char stdio_names_str[4096]
char * stdio_names(char *, char *)
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.
void ui_render()
Render the UI by updating panels and refreshing the display.
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...
int ui_wmove(UiSurface *s, ss_t w, uint y, uint x)
Move the cursor to a specified position within a UiSurface.
int ui_cm_surface_destroy(UiSurface *sfc)
Destroy the most recently created surface.
void ui_restore_wins()
Restore the state of all windows in the UI. This function refreshes the standard screen and all surfa...
int ui_mousemask(int mask)
Enable or disable mouse support.
int ui_tracked_sfc_box(uint wlines, uint wcols, uint wbegy, uint wbegx, const char *wtitle)
Create a new surface with a box window.
int ui_scrollok(UiSurface *s, ss_t w, bool enable)
Enable or disable scrolling for a UiSurface.
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.
int ui_keypad(UiSurface *s, ss_t w, bool enable)
Enable or disable the keypad for a UiSurface.
#define UIKEY_BUTTON1_CLICKED
int ui_get_event(UiSurface *s, ss_t w, UiChyron *chyron, UiEvent *ev, int timeout_ms)
Read input events.
UiSurface * ui_surface[UI_SFC_MAX]
int ui_mvwaddch(UiSurface *s, ss_t w, uint y, uint x, const char c)
Draw a character in a surface window.
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 **eargv)
Fork, set new session ID, close files, and execute detached command.
size_t strnz__cpy(char *, const char *, size_t)
safer alternative to strncpy
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.
int str_to_args(char **, char *, uint)
Converts a string into an array of argument strings.
size_t strnz__cat(char *, const char *, size_t)
safer alternative to strncat
int destroy_argv(uint argc, char **argv)
Deallocates memory allocated for argument strings in argv.
int write_config(Init *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.
int ui_perror(char *emsg_str)
Display a simple error message window or print to stderr.
UiMouseAction mouse_action
Line * line[MAX_MENU_LINES]