2
3
4
5
6
7
8
18#define NCURSES_WIDECHAR 1
29#define MAX_WIDE_LEN 1024
31#define PICK_MAX_ARG_LEN 256
32#define MAX_PICK_OBJS 1024
33#define ACCEPT_PROMPT_CHAR '_'
35#define MENU_HELP_FILE "menu.help"
36#define FORM_HELP_FILE "form.help"
37#define PICK_HELP_FILE "pick.help"
38#define VIEW_HELP_FILE "view.help"
39#define VIEW_PRT_FILE "prtout"
40#define DEFAULTEDITOR "vi"
47#define MINITRC ".minitrc"
49#define MAPP_DIR "~/menuapp"
50#define PRINTCMD "lp -c -s"
59 int main(int argc, char **argv) {
61 capture_shell_tioctl();
62 Init *init = new_init(argc, argv);
64 mapp_initialization(init);
67 capture_curses_tioctl();
70#define destroy_cmenu()
110
111
112
113
114
130
141
143
203extern Form *
new_form(Init *,
int,
char **, uint, uint);
204extern Pick *
new_pick(Init *,
int,
char **, uint, uint);
205extern Menu *
new_menu(Init *,
int,
char **, uint, uint);
206extern int popup_menu(Init *,
int,
char **, uint, uint);
207extern int popup_form(Init *,
int,
char **, uint, uint);
208extern int popup_pick(Init *,
int,
char **, uint, uint);
209extern int popup_view(Init *,
int,
char **, uint, uint, uint, uint);
222extern int init_form(Init *,
int,
char **, uint, uint);
223extern int init_pick(Init *,
int,
char **, uint, uint);
int cmd_processor(Init *)
int open_pick_win(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.
void ui_render()
Render the UI by updating panels and refreshing the display.
int ui_cursor_move(UiSurface *s, ss_t w, uint y, uint x)
Move the cursor to a specified position within a UiSurface.
int ui_curs_set(int visibility)
Set the visibility of the cursor.
int ui_wclrtoeol(UiSurface *s, ss_t w)
Clear to the end of the line in a surface window.
int ui_get_event(UiSurface *s, ss_t w, UiChyron *chyron, UiEvent *ev, int timeout_ms)
Read input events.
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.
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.
void cmenu_shutdown(Init *init)
void cmenu_abend(Init *init, int ec, char *s)
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.
bool f_erase_remainder
Structure to hold field information for C-Menu.
int process_config_file(char *, Init *)
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 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 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.
char log_file_spec[MAXLEN]
char receiver_cmd[MAXLEN]
char provider_cmd[MAXLEN]