|
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_boxwin (Init *init) |
| Initialize the C-Menu View in box window mode. | |
| int | init_view_full_screen (Init *init) |
| Initialize C-Menu View in full screen mode. | |
| void | view_calc_boxwin_dimensions (Init *init) |
| Calculate the dimensions and position of the box window for C-Menu View. | |
| void | view_calc_full_screen_dimensions (Init *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. | |
Populate the C-Menu View Struct and Connect Input.
| int init_view_boxwin | ( | Init * | init | ) |
Initialize the C-Menu View in box window mode.
| init | Pointer to the Init structure containing view settings. |
sets up the view structure for box window mode, adjusts dimensions based on screen size, and creates a new pad for the view. It also configures various parameters such as scroll lines, command line position, and tab size.
Definition at line 194 of file init_view.c.
References View::begx, View::begy, bl, View::box_pan, View::box_win, br, bs, CC_BOX, CC_LN, CC_NT, View::cmdln_pan, View::cmdln_win, View::cols, em0, View::f_full_screen, View::lines, View::ln_win_cols, View::lnno_pan, View::lnno_win, ls, View::pad, View::pad_view_pan, View::pad_view_win, Perror(), rs, View::scroll_lines, ssnprintf(), View::tab_stop, tl, tr, ts, Init::view, view_calc_boxwin_dimensions(), View::win_pan, and View::win_win.
Referenced by main(), new_pick_view(), popup_view(), and view_boxwin_resize().
| int init_view_full_screen | ( | Init * | init | ) |
Initialize C-Menu View in full screen mode.
| init | Pointer to the Init structure containing view settings. |
This function sets up the view structure for full screen mode and creates a new pad for the view.
The function creates the following windows: 1. view->cmdln_win: Status or Command Line 2. view->lnno_win: Line Number Window 3. view->pad: Main Content Pad
Definition at line 49 of file init_view.c.
References CC_LN, CC_NT, View::cmdln_pan, View::cmdln_win, em0, View::f_full_screen, View::lnno_pan, View::lnno_win, View::pad, View::pad_view_pan, View::pad_view_win, Perror(), View::scroll_lines, ssnprintf(), View::tab_stop, Init::view, view_calc_full_screen_dimensions(), View::win_pan, and View::win_win.
Referenced by main().
| void view_calc_boxwin_dimensions | ( | Init * | init | ) |
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. |
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 362 of file init_view.c.
References View::begx, View::begy, View::cmd_line, View::cols, View::f_ln, View::h_shift, 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, and Init::view.
Referenced by init_view_boxwin().
| 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 159 of file init_view.c.
References View::cmd_line, View::cols, View::h_shift, 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, and Init::view.
Referenced by init_view_full_screen(), and view_full_screen_resize().
| int view_init_input | ( | Init * | init, |
| char * | file_name ) |
Initialize the input for the C-Menu View.
| init | Pointer to the Init structure containing view settings. |
| file_name | Name of the input file or "-" for standard input. |
This function initializes the input for the C-Menu View. It handles both regular files and standard input, setting up pipes if necessary. It also memory-maps the input file for efficient access and sets up the view structure accordingly.
Prevent child process from writing to terminal
Definition at line 447 of file init_view.c.
References abend(), base_name(), View::buf, View::buf_curr_ptr, View::cmd, View::cmd_all, 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, restore_wins(), Init::sio, ssnprintf(), SIO::stdin_fd, stdio_fdnames(), stdio_names(), stdio_names_str, str_to_args(), strnz__cat(), strnz__cpy(), and Init::view.
Referenced by new_view_file(), and view_file().