|
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 *) |
| void | cmenu_abend (Init *init, int ec, char *s) |
| void | cmenu_shutdown (Init *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. | |
| int | open_pick_win (Init *) |
| int | pad_refresh (View *) |
| Refresh Pad and Line Number Window. | |
| void | page_next (View *) |
| Advance to Next Page. | |
| 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 *) |
| 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 70 of file common.h.
| #define new_cmenu | ( | ) |
Definition at line 57 of file common.h.
| enum Caller |
| enum OptGroup |
| enum OptType |
|
extern |
| void cmenu_abend | ( | Init * | init, |
| int | ec, | ||
| char * | s ) |
Definition at line 94 of file menu.c.
References cmenu_shutdown(), restore_shell_tioctl(), and sig_dfl_mode().
Referenced by view_init_input().
| void cmenu_shutdown | ( | Init * | init | ) |
Definition at line 88 of file menu.c.
References destroy_init(), destroy_view(), and ui_shutdown().
Referenced by cmenu_abend().
|
extern |
|
extern |
Definition at line 247 of file pick_engine.c.
References Init::begx, Pick::begx, Init::begy, Pick::begy, Pick::chyron, Init::cols, Pick::d_cnt, Pick::d_idx, Pick::d_object, Init::lines, Pick::lines, Pick::m_cnt, Pick::m_idx, Pick::m_object, Pick::p_view_files, Init::pick, pick_std_chyron(), Pick::separator_line, sfc_ptr, ssnprintf(), Pick::surface, Pick::tbl_col_width, Pick::tbl_cols, Pick::tbl_lines, Pick::tbl_page, Pick::tbl_pages, Pick::title, ui_compile_chyron(), ui_get_screen_size(), ui_keypad(), ui_new_chyron(), ui_perror(), ui_scrollok(), ui_set_chyron_key(), ui_setscrreg(), ui_surface, ui_tracked_sfc_split_box(), Pick::width, and Pick::x.
Referenced by init_pick().
|
extern |
Enter picker loop to handle user input and interactions
< Buffer for user input in the field
Definition at line 353 of file pick_engine.c.
References Pick::chyron, Pick::cmd, deselect_object(), display_pick_page(), exec_objects(), Pick::f_cmd, Pick::f_out_spec, Pick::f_read_theme, Pick::out_spec, output_objects(), Init::pick, picker(), read_theme(), Pick::select_cnt, Pick::surface, ui_destroy_chyron(), ui_mvwaddstr(), and ui_wclrtoeol().
Referenced by init_pick().
|
extern |
Definition at line 31 of file curskeys.c.
References cell_nt, cell_nt_rev, sfc_ptr, strnz__cat(), strnz__cpy(), ui_bkgdset(), ui_get_screen_size(), ui_keypad(), ui_mvwaddstr(), ui_perror(), ui_surface, and ui_tracked_sfc_box().
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 694 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, Init::log_file_spec, SIO::magenta, Init::mapp_data, Init::mapp_help, Init::mapp_home, Init::mapp_msrc, Init::mapp_spec, Init::mapp_theme, Init::mapp_user, Init::min_log_level, 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(), str_to_upper(), strnz__cpy(), Init::tab_stop, Init::timeout_secs, 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 |
Resize the current window and its box.
| init | Pointer to the Init structure containing view settings. |
This function resizes the current window and its associated box window to the specified number of lines and columns.
Definition at line 198 of file init_view.c.
References init_view_boxwin(), View::sfc, View::title, ui_border_title(), ui_render(), ui_surface_destroy(), and Init::view.
Referenced by view_cmd_processor().
|
extern |
Resize the full screen view and its components.
| init | Pointer to the Init structure containing view settings. |
This function resizes the full screen view and its components, including the command line window, line number window, and main content pad. It also recalculates the dimensions for the full screen mode and updates the scroll regions accordingly.
Definition at line 111 of file init_view.c.
References View::cols, init_view_full_screen(), View::lines, View::ln_win_cols, View::ln_win_lines, View::scroll_lines, View::sfc, ui_erase(), ui_render(), ui_surface_destroy(), Init::view, and view_calc_full_screen_dimensions().
Referenced by view_cmd_processor().
|
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.