2
3
4
5
6
7
8
15#define NCURSES_WIDECHAR 1
26#define MAX_WIDE_LEN 1024
28#define PICK_MAX_ARG_LEN 256
29#define MAX_PICK_OBJS 1024
30#define ACCEPT_PROMPT_CHAR '_'
32#define MENU_HELP_FILE "menu.help"
33#define FORM_HELP_FILE "form.help"
34#define PICK_HELP_FILE "pick.help"
35#define VIEW_HELP_FILE "view.help"
36#define VIEW_PRT_FILE "prtout"
37#define DEFAULTEDITOR "vi"
44#define MINITRC ".minitrc"
46#define MAPP_DIR "~/menuapp"
47#define PRINTCMD "lp -c -s"
56 int main(int argc, char **argv) {
58 capture_shell_tioctl();
59 Init *init = new_init(argc, argv);
61 mapp_initialization(init);
64 capture_curses_tioctl();
67#define destroy_cmenu()
107
108
109
110
111
127
138
140
199extern Form *
new_form(Init *,
int,
char **, uint, uint);
200extern Pick *
new_pick(Init *,
int,
char **, uint, uint);
201extern Menu *
new_menu(Init *,
int,
char **, uint, uint);
202extern int popup_menu(Init *,
int,
char **, uint, uint);
203extern int popup_form(Init *,
int,
char **, uint, uint);
204extern int popup_pick(Init *,
int,
char **, uint, uint);
205extern int popup_view(Init *,
int,
char **, uint, uint, uint, uint);
218extern int init_form(Init *,
int,
char **, uint, uint);
219extern int init_pick(Init *,
int,
char **, uint, uint);
int cmd_processor(Init *)
bool view_stack_peek(const ViewStack *, View *)
int popup_form(Init *, int, char **, uint, uint)
instantiate a form popup window
bool view_stack_push(ViewStack *, View)
int popup_menu(Init *, int, char **, uint, uint)
instantiate a menu popup window
void view_stack_free(ViewStack *)
bool view_stack_pop(ViewStack *, View *)
int popup_pick(Init *, int, char **, uint, uint)
instantiate a pick popup window
bool view_stack_init(ViewStack *, size_t)
void destroy_view_win(Init *)
int popup_view(Init *, int, char **, uint, uint, uint, uint)
instantiate a view popup window
#define min(x, y)
min macro evaluates two expressions, returning least result
#define __atexit
This macro registers the end_pgm function to be called when the program exits.
int ui_cursor_move(UiSurface *s, uint w, uint y, uint x)
int ui_mvwaddstr(UiSurface *s, uint w, uint y, uint x, const char *text)
int ui_get_event(UiSurface *s, uint w, UiEvent *ev, int timeout_ms)
Wait for an input event on target (or stdscr if NULL).
int ui_wclrtoeol(UiSurface *s, uint w)
int ui_curs_set(int visibility)
int cf_accept(UiSurface *sfc, uint w, char *accept_s, uint flin, uint fcol, uint flen)
Accepts input for a field in a C-Menu window.
bool f_erase_remainder
Structure to hold field information for C-Menu.
int process_config_file(char *, Init *)
void view_full_screen_resize(Init *)
Resize the full screen view and its components.
void view_boxwin_resize(Init *)
Resize the current window and its box.
int init_form(Init *, int, char **, uint, uint)
Initialize form data structure and parse description file.
int parse_opt_args(Init *, int, char **)
Parse command-line options and set Init struct values accordingly.
bool derive_file_spec(char *, char *, char *)
Derive full file specification from directory and file name.
int write_config(Init *init)
Write the current configuration to a file specified in init->minitrc.
void mapp_initialization(Init *, int, char **)
Main initialization function for MAPP - Menu Application.
void zero_opt_args(Init *)
Initialize optional arguments in the Init struct to default values.
void view_calc_boxwin_dimensions(Init *)
Calculate the dimensions and position of the box window for C-Menu View.
int init_view_full_screen(Init *init)
Initialize C-Menu View in full screen mode.
int init_view_boxwin(Init *init)
Initialize the C-Menu View in box window mode.
void view_calc_full_screen_dimensions(Init *)
Calculate the dimensions for full screen mode.
int view_init_input(Init *init, char *file_name)
Initialize the input for the C-Menu View.
Pick * new_pick(Init *init, int argc, char **argv, uint begy, uint begx)
Create and initialize Pick structure.
View * destroy_view(Init *init)
Destroy View structure.
Menu * new_menu(Init *init, int argc, char **argv, uint begy, uint begx)
Create and initialize Menu structure.
Init * new_init(int argc, char **argv)
Create and initialize Init structure.
Menu * destroy_menu(Init *init)
Destroy Menu structure.
Form * destroy_form(Init *init)
Destroy Form structure.
View * new_view(Init *init)
Create and initialize View structure.
Init * destroy_init(Init *init)
Destroy Init structure.
Form * new_form(Init *init, int argc, char **argv, uint begy, uint begx)
Create and initialize Form structure.
Pick * destroy_pick(Init *init)
Destroy Pick structure.
unsigned int menu_engine(Init *)
The main loop of the menu system.
unsigned int parse_menu_description(Init *)
Parse menu description file and create Menu.
int init_pick(Init *, int, char **, uint, uint)
Initializes pick structure and opens pick input file or pipe.
int pick_engine(Init *)
Initializes pick interface, calculates window size and position, and enters picker loop.
int open_pick_win(Init *)
Initializes the pick window based on the parameters specified in the Pick structure.
int view_file(Init *)
Start view.
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 next_page(View *)
Advance to Next Page.
int pad_refresh(View *)
Refresh Pad and Line Number Window.
int display_prompt(View *, char *)
Display Command Line Prompt.
char receiver_cmd[MAXLEN]
char provider_cmd[MAXLEN]