|
C-Menu 0.2.9
A User Interface Toolkit
|
Populate the C-Menu View Struct and Connect Input. More...
Files | |
| file | init_view.c |
| Initialize C-Menu View Screen IO and Input. | |
Functions | |
| int | init_view_full_screen (Init *init) |
| Initialize C-Menu View in full screen mode. | |
| void | view_calc_full_screen_dimensions (Init *init) |
| Calculate the dimensions for full screen mode. | |
| int | init_view_boxwin (Init *init, char *title) |
| Initialize the C-Menu View in box window mode. | |
| void | view_calc_win_dimensions (Init *init, char *title) |
| Calculate the dimensions and position of the box window for C-Menu View. | |
| int | view_init_input (View *view, char *file_name) |
| Initialize the input for a C-Menu View. | |
Populate the C-Menu View Struct and Connect Input.
| int init_view_boxwin | ( | Init * | init, |
| char * | title ) |
Initialize the C-Menu View in box window mode.
| init | Pointer to the Init structure containing view settings. |
| title | Title for the box window. |
view->cmdln_win: status or command line window
view->ln_win: line number window
pad for main content
Definition at line 172 of file init_view.c.
References View::argv, View::begx, View::begy, View::box, box_new(), CCC_LN, CCC_WIN, View::cmdln_win, View::cols, display_error(), em0, em1, em2, View::f_full_screen, View::f_ln, View::lines, View::ln_win, View::ln_win_cols, View::ln_win_lines, View::pad, View::scroll_lines, ssnprintf(), strnz__cpy(), View::tab_stop, View::title, Init::view, view, view_calc_win_dimensions(), win_box, and win_ptr.
Referenced by main(), and popup_view().
| int init_view_full_screen | ( | Init * | init | ) |
Initialize C-Menu View in full screen mode.
| init | Pointer to the Init structure containing view settings. |
The function creates the following windows: 1. view->cmdln_win: Status or Command Line 2. view->ln_win: Line Number Window 3. view->pad: Main Content Pad
view->cmdln_win: status or command line window
view->ln_win: line number window
view->cmdln_win: status or command line window
Definition at line 45 of file init_view.c.
References abend(), View::begx, View::begy, CCC_LN, CCC_WIN, View::cmdln_win, View::cols, display_error(), em0, em1, em2, View::f_full_screen, View::lines, View::ln_win, View::ln_win_cols, View::ln_win_lines, View::pad, View::scroll_lines, ssnprintf(), View::tab_stop, Init::view, view, and view_calc_full_screen_dimensions().
Referenced by main().
| void view_calc_full_screen_dimensions | ( | Init * | init | ) |
Calculate the dimensions for full screen mode.
This function calculates the dimensions for the full screen mode of the C-Menu View. It retrieves the maximum dimensions of the standard screen and sets the view parameters accordingly. It also resizes the line number window and command line window based on the new dimensions.
| init | Pointer to the Init structure containing view settings. |
Definition at line 140 of file init_view.c.
References View::cmd_line, View::cols, View::lines, View::ln, View::ln_win_cols, View::ln_win_lines, View::page_bot_ln, View::page_top_ln, View::pmincol, View::pminrow, View::scroll_lines, View::smaxcol, View::smaxrow, View::smincol, View::sminrow, Init::view, and view.
Referenced by init_view_full_screen(), and view_full_screen_resize().
| void view_calc_win_dimensions | ( | Init * | init, |
| char * | title ) |
Calculate the dimensions and position of the box window for C-Menu View.
This function calculates the dimensions and position of the box window for the C-Menu View based on the screen size and any specified parameters in the Init structure. It ensures that the box window fits within the screen dimensions and adjusts its size and position accordingly.
| init | Pointer to the Init structure containing view settings. |
| title | Title for the box window, used to ensure minimum width if provided. |
Use view->lines and view->cols if set, otherwise calculate based on screen size with some padding. Ensure the view fits within the screen dimensions.
Definition at line 367 of file init_view.c.
References Init::begx, View::begx, Init::begy, View::begy, View::cmd_line, Init::cols, View::cols, View::f_ln, Init::lines, View::lines, View::ln, View::ln_win_cols, View::ln_win_lines, View::page_bot_ln, View::page_top_ln, View::pmincol, View::pminrow, View::scroll_lines, View::smaxcol, View::smaxrow, View::smincol, View::sminrow, Init::view, and view.
Referenced by init_view_boxwin(), popup_view(), and view_win_resize().
| int view_init_input | ( | View * | view, |
| char * | file_name ) |
Initialize the input for a C-Menu View.
This function initializes the input for view, which can be a file, standard input, or a provider command to be initiated by view. It handles different input sources and sets up the necessary file descriptors and memory mapping for efficient access.
| view | Pointer to the View structure to be initialized. |
| file_name | Name of the input file or "-" for standard input. |
Open the input file for reading and get its size.
< 200ms timeout to check for input
If user cancels while waiting for view input, kill provider_cmd child process and close pipe
If error occurs while waiting for view input, kill provider_cmd child process and close pipe
If timeout occurs while waiting for view input, kill provider_cmd child process and close pipe
If unexpected error occurs while waiting for view input, kill provider_cmd child process and close pipe
Definition at line 443 of file init_view.c.
References abend(), base_name(), View::buf, View::buf_curr_ptr, View::cmd, View::cmd_all, cmd_key, View::cur_file_str, destroy_argv(), display_error(), em0, em1, em2, expand_tilde(), View::f_in_pipe, View::file_name, View::file_size, View::in_fd, View::mark_tbl, Perror(), View::prev_file_pos, View::provider_cmd, ssnprintf(), str_to_args(), strnz__cat(), strnz__cpy(), wait_continue(), wait_destroy(), wait_mk_chyron(), wait_mk_win(), wait_timeout, and waitpid_with_timeout().
Referenced by view_file().