|
C-Menu 0.2.9
A User Interface Toolkit
|
Headder for C-Menu Menu, Form, Pick, and View components. More...
#include "cm.h"#include <form.h>#include <menu.h>#include <pick.h>#include <view.h>#include <stddef.h>Go to the source code of this file.
Data Structures | |
| struct | Init |
| Gathers runtime information for C-Menu Menu, Form, Pick, and View components, used for passing common data and state during initialization and processing of these componentsi. More... | |
Macros | |
| #define | _GNU_SOURCE |
| #define | ABOUT ".about" |
| #define | ACCEPT_PROMPT_CHAR '_' |
| #define | COLOR_LEN 8 |
| #define | DEFAULTEDITOR "vi" |
| #define | destroy_cmenu() |
| #define | EIGHT 8 |
| #define | FORM_HELP_FILE "form.help" |
| #define | MAPP_DIR "~/menuapp" |
| #define | MAX_FORMS 10 |
| #define | MAX_MENUS 10 |
| #define | MAX_PICK_OBJS 1024 |
| #define | MAX_PICKS 10 |
| #define | MAX_VIEWS 10 |
| #define | MAX_WIDE_LEN 1024 |
| #define | MAXOPTS 50 |
| #define | MENU_HELP_FILE "menu.help" |
| #define | MIN_COLS 40 |
| #define | MINITRC ".minitrc" |
| #define | NCURSES_WIDECHAR 1 |
| #define | new_cmenu() |
| #define | P_READ 0 |
| #define | P_WRITE 1 |
| #define | PICK_HELP_FILE "pick.help" |
| #define | PICK_MAX_ARG_LEN 256 |
| #define | PRINTCMD "lp -c -s" |
| #define | TRUE 1 |
| #define | USE_PAD TRUE |
| #define | VIEW_HELP_FILE "view.help" |
| #define | VIEW_PRT_FILE "prtout" |
Typedefs | |
| typedef Form | Form |
| typedef Menu | Menu |
| typedef Pick | Pick |
| typedef View | View |
Enumerations | |
| enum | Caller { VIEW , FORM , PICK , MENU } |
| enum | OptGroup { OG_FILES , OG_DIRS , OG_SPECS , OG_MISC , OG_PARMS , OG_FLAGS , OG_COL } |
| option groups More... | |
| enum | OptType { OT_STRING , OT_INT , OT_BOOL , OT_HEX } |
| option types More... | |
Functions | |
| void | build_prompt (View *) |
| Build Prompt String. | |
| int | cmd_processor (Init *) |
| bool | derive_file_spec (char *, char *, char *) |
| Derive full file specification from directory and file name. | |
| Form * | destroy_form (Init *init) |
| Destroy Form structure. | |
| Init * | destroy_init (Init *init) |
| Destroy Init structure. | |
| void | destroy_line_table (View *) |
| Destroy Line Table. | |
| Menu * | destroy_menu (Init *init) |
| Destroy Menu structure. | |
| Pick * | destroy_pick (Init *init) |
| Destroy Pick structure. | |
| View * | destroy_view (Init *init) |
| Destroy View structure. | |
| void | destroy_view_win (Init *) |
| int | display_prompt (View *, char *) |
| Display Command Line Prompt. | |
| int | init_form (Init *, int, char **, uint, uint) |
| Initialize form data structure and parse description file. | |
| int | init_pick (Init *, int, char **, uint, uint) |
| Initializes pick structure and opens pick input file or pipe. | |
| int | init_view_boxwin (Init *) |
| Initialize the C-Menu View in box window mode. | |
| int | init_view_full_screen (Init *) |
| Initialize C-Menu View in full screen mode. | |
| void | initialize_line_table (View *) |
| Initialize Line Table. | |
| void | mapp_initialization (Init *, int, char **) |
| Main initialization function for MAPP - Menu Application. | |
| unsigned int | menu_engine (Init *) |
| The main loop of the menu system. | |
| Form * | new_form (Init *, int, char **, uint, uint) |
| Create and initialize Form structure. | |
| Init * | new_init (int, char **) |
| Create and initialize Init structure. | |
| Menu * | new_menu (Init *, int, char **, uint, uint) |
| Create and initialize Menu structure. | |
| Pick * | new_pick (Init *, int, char **, uint, uint) |
| Create and initialize Pick structure. | |
| View * | new_view (Init *) |
| Create and initialize View structure. | |
| void | next_page (View *) |
| Advance to Next Page. | |
| int | open_pick_win (Init *) |
| Initializes the pick window based on the parameters specified in the Pick structure. | |
| int | pad_refresh (View *) |
| Refresh Pad and Line Number Window. | |
| unsigned int | parse_menu_description (Init *) |
| Parse menu description file and create Menu. | |
| int | parse_opt_args (Init *, int, char **) |
| Parse command-line options and set Init struct values accordingly. | |
| int | pick_engine (Init *) |
| Initializes pick interface, calculates window size and position, and enters picker loop. | |
| int | popup_ckeys () |
| 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 | |
| int | process_config_file (char *, Init *) |
| void | view_boxwin_resize (Init *) |
| Resize the current window and its box. | |
| void | view_calc_boxwin_dimensions (Init *) |
| Calculate the dimensions and position of the box window for C-Menu View. | |
| void | view_calc_full_screen_dimensions (Init *) |
| Calculate the dimensions for full screen mode. | |
| int | view_cmd_processor (Init *) |
| Main Command Processing Loop for View. | |
| int | view_file (Init *) |
| Start view. | |
| void | view_full_screen_resize (Init *) |
| Resize the full screen view and its components. | |
| int | view_init_input (Init *, char *) |
| Initialize the input for the C-Menu View. | |
| void | view_stack_free (ViewStack *) |
| bool | view_stack_init (ViewStack *, size_t) |
| bool | view_stack_peek (const ViewStack *, View *) |
| bool | view_stack_pop (ViewStack *, View *) |
| bool | view_stack_push (ViewStack *, View) |
| int | write_config (Init *) |
| Write the current configuration to a file specified in init->minitrc. | |
| void | zero_opt_args (Init *) |
| Initialize optional arguments in the Init struct to default values. | |
Variables | |
| int | init_cnt |
| char | minitrc [MAXLEN] |
| ViewStack | view_stack |
Headder for C-Menu Menu, Form, Pick, and View components.
Definition in file common.h.
| #define destroy_cmenu | ( | ) |
Definition at line 67 of file common.h.
| #define new_cmenu | ( | ) |
Definition at line 54 of file common.h.
| enum Caller |
| enum OptGroup |
| enum OptType |
|
extern |
|
extern |
|
extern |
Definition at line 31 of file curskeys.c.
References cell_nt, cell_nt_rev, notcurses_input(), Perror(), sfc_ptr, strnz__cat(), strnz__cpy(), surface_box_win_new(), ui_bkgdset(), ui_get_screen_size(), ui_keypad(), ui_mvwaddstr(), ui_surface, ui_surface_destroy(), and WIN.
Referenced by main(), and menu_cmd_processor().
|
extern |
instantiate a form popup window
| init | the Init struct pointer |
| argc | the number of command line arguments |
| argv | the command line arguments |
| by | the y coordinate for the form window |
| bx | the x coordinate for the form window |
by and bx may be set as command line option arguments, in which case, they will take precedence over arguments passed in the function arguments.
by, and bx may be set by
1. the calling function
or
2. command line arguments
Non-zero command line arguments will override the calling function's
arguments.
Definition at line 113 of file popups.c.
References Init::argc, Init::argv, destroy_form(), Init::form, init_form(), parse_opt_args(), and zero_opt_args().
Referenced by enter_file_spec(), and menu_cmd_processor().
|
extern |
instantiate a menu popup window
| init | the Init struct pointer |
| argc | the number of command line arguments |
| argv | the command line arguments |
| by | the y coordinate for the menu window |
| bx | the x coordinate for the menu window |
by and bx may be set as command line option arguments, in which case, they will take precedence over arguments passed in the function arguments.
by, and bx may be set by
1. the calling function
or
2. command line arguments
Non-zero command line arguments will override the calling function's
arguments.
Definition at line 53 of file popups.c.
References Init::argc, Init::argv, destroy_menu(), Init::menu, menu_engine(), new_menu(), parse_opt_args(), and zero_opt_args().
Referenced by menu_cmd_processor().
|
extern |
instantiate a pick popup window
| init | the Init struct pointer |
| argc | the number of command line arguments |
| argv | the command line arguments |
| by | the y coordinate for the pick window |
| bx | the x coordinate for the pick window |
by and bx may be set as command line option arguments, in which case, they will take precedence over arguments passed in the function arguments.
by, and bx may be set by
1. the calling function
or
2. command line arguments
Non-zero command line arguments will override the calling function's
arguments.
Definition at line 83 of file popups.c.
References Init::argc, Init::argv, destroy_pick(), init_pick(), parse_opt_args(), Init::pick, and zero_opt_args().
Referenced by menu_cmd_processor().
|
extern |
instantiate a view popup window
| init | the Init struct pointer |
| argc | the number of command line arguments |
| argv | the command line arguments |
| ilines | the number of lines for the view window |
| icols | the number of columns for the view window |
| by | the y coordinate for the view window |
| bx | the x coordinate for the view window |
ilines, cols, by, and bx may also be set as command line option arguments, in which case, they will take precedence over arguments passed in the function arguments.
ilines, cols, by, and bx may be set by
1. the calling function
or
2. command line arguments
Non-zero command line arguments will override the calling function's
arguments.
Definition at line 145 of file popups.c.
References Init::begx, View::begx, Init::begy, View::begy, Init::cols, View::cols, destroy_view(), View::f_full_screen, init_view_boxwin(), Init::lines, View::lines, new_view(), parse_opt_args(), Init::view, view_file(), and zero_opt_args().
Referenced by display_pick_help(), exec_objects(), form_engine(), form_exec_receiver(), menu_cmd_processor(), and view_display_help().
|
extern |
Definition at line 663 of file init.c.
References SIO::bblack, SIO::bblue, SIO::bcyan, Init::begx, Init::begy, SIO::bg, SIO::bgreen, SIO::black, SIO::blue, SIO::blue_gamma, SIO::bmagenta, SIO::borange, SIO::border, SIO::box_bg, Init::brackets, SIO::brackets_bg, SIO::brackets_fg, SIO::bred, SIO::bwhite, SIO::byellow, Init::cmd, Init::cmd_all, SIO::cmdln_bg, SIO::cmdln_fg, Init::cols, SIO::cyan, Init::editor, expand_tilde(), Init::f_at_end_remove, Init::f_erase_remainder, Init::f_ignore_case, Init::f_ln, Init::f_multiple_cmd_args, Init::f_read_theme, Init::f_squeeze, Init::f_strip_ansi, SIO::fg, Init::fill_char, SIO::fill_char_bg, SIO::fill_char_fg, SIO::gray_gamma, SIO::green, SIO::green_gamma, Init::h_shift, SIO::ind_bg, SIO::ind_fg, Init::lines, SIO::ln_bg, SIO::ln_fg, SIO::magenta, Init::mapp_data, Init::mapp_help, Init::mapp_home, Init::mapp_msrc, Init::mapp_spec, Init::mapp_theme, Init::mapp_user, Init::minitrc, SIO::nt_bg, SIO::nt_fg, SIO::nt_hl_bg, SIO::nt_hl_fg, SIO::nt_hl_rev_bg, SIO::nt_hl_rev_fg, SIO::nt_rev_bg, SIO::nt_rev_fg, SIO::orange, Init::p_view_files, Init::parent_cmd, process_config_file(), Init::provider_cmd, SIO::ran_bg, SIO::ran_fg, Init::receiver_cmd, SIO::red, SIO::red_gamma, Init::select_max, Init::sio, str_to_bool(), str_to_double(), strnz__cpy(), Init::tab_stop, Init::title, SIO::title_bg, SIO::title_fg, unstr_hex_clr(), SIO::white, Init::wrap, and SIO::yellow.
Referenced by process_config_file(), process_config_files(), and read_theme().
|
extern |
|
extern |
|
extern |
Definition at line 28 of file mem.c.
Referenced by destroy_init(), and new_init().
|
extern |
Definition at line 32 of file init_view.c.