|
C-Menu 0.2.9
A User Interface Toolkit
|
Manage NCurses windows and color settings. More...
Functions | |
| void | win_init_attrs () |
| Initialize window attributes. | |
| bool | open_curses (SIO *sio) |
| Initialize NCurses and color settings. | |
| void | destroy_curses () |
| Gracefully shut down NCurses and restore terminal settings. | |
| int | win_new (int wlines, int wcols, int wbegy, int wbegx, char *wtitle, int flag) |
| Create a new window with optional box and title. | |
| void | win_resize (int wlines, int wcols, char *title) |
| Resize the current window and its box, and update the title. | |
| void | win_redraw (WINDOW *win) |
| Redraw the specified window. | |
| WINDOW * | win_del () |
| Delete the current window and its associated box window. | |
| void | restore_wins () |
| Restore all windows after a screen resize. | |
| void | cbox (WINDOW *box) |
| Draw a box around the specified window. | |
| void | mvwaddstr_fill (WINDOW *w, int y, int x, char *s, int l) |
| For lines shorter than their display area, fill the rest with spaces. | |
| int | xwgetch (WINDOW *win, Chyron *chyron, int n) |
| Wrapper for wgetch that handles signals, mouse events, checks for clicks on the chyron line, and accepts a sinigle character answer. | |
Manage NCurses windows and color settings.
| void cbox | ( | WINDOW * | box | ) |
Draw a box around the specified window.
| box | Pointer to the window to draw the box around |
Definition at line 960 of file dwin.c.
References bw_bl, bw_br, bw_ho, bw_tl, bw_tr, and bw_ve.
Referenced by win_new(), and win_resize().
| void destroy_curses | ( | ) |
Gracefully shut down NCurses and restore terminal settings.
Definition at line 738 of file dwin.c.
References f_curses_open, ncurses_fp, restore_shell_tioctl(), screen, sig_dfl_mode(), win_box, win_ptr, and win_win.
Referenced by abend(), main(), and open_curses().
| void mvwaddstr_fill | ( | WINDOW * | w, |
| int | y, | ||
| int | x, | ||
| char * | s, | ||
| int | l ) |
For lines shorter than their display area, fill the rest with spaces.
| w | Pointer to window |
| y | Y coordinate |
| x | X coordinate |
| s | String to display |
| l | Length of display area |
Definition at line 1262 of file dwin.c.
Referenced by display_page(), menu_cmd_processor(), picker(), reverse_object(), and unreverse_object().
| bool open_curses | ( | SIO * | sio | ) |
Initialize NCurses and color settings.
| sio | Pointer to SIO struct with terminal and color settings |
open the terminal device for reading and writing
We use SCREEN and newterm because this allows us to
specify the terminal FILE
Set gamma correction values
These are read from ~/.minitrc
We need these values when initializing colors
Definition at line 423 of file dwin.c.
References abend(), BLUE_GAMMA, SIO::blue_gamma, CCC_BOX, CCC_LN, CCC_NORM, CCC_REVERSE, CCC_REVERSE_HIGHLIGHT, CCC_WIN, CLR_BG, CLR_BLACK, CLR_BO, CLR_FG, CLR_LN, CLR_LN_BG, CLR_WHITE, CLR_YELLOW, cp_box, cp_ln, cp_norm, cp_reverse, cp_reverse_highlight, cp_win, destroy_curses(), f_curses_open, get_clr_pair(), GRAY_GAMMA, SIO::gray_gamma, GREEN_GAMMA, SIO::green_gamma, init_clr_palette(), mkccc(), ncurses_fp, RED_GAMMA, SIO::red_gamma, screen, strnz__cat(), strnz__cpy(), SIO::tty_name, and win_ptr.
Referenced by main().
| void restore_wins | ( | ) |
Restore all windows after a screen resize.
Definition at line 938 of file dwin.c.
References win_box, win_ptr, and win_win.
Referenced by enter_file_spec(), exec_objects(), fork_exec(), full_screen_shell(), menu_cmd_processor(), menu_engine(), resize_page(), view_cmd_processor(), and write_view_buffer().
| WINDOW * win_del | ( | ) |
Delete the current window and its associated box window.
Definition at line 902 of file dwin.c.
References CCC_NORM, win_box, win_ptr, and win_win.
Referenced by action_disposition(), answer_yn(), display_error(), init_form(), init_pick(), main(), menu_engine(), mview(), Perror(), popup_ckeys(), popup_view(), and wait_destroy().
| void win_init_attrs | ( | ) |
Initialize window attributes.
Definition at line 162 of file dwin.c.
Referenced by main().
| int win_new | ( | int | wlines, |
| int | wcols, | ||
| int | wbegy, | ||
| int | wbegx, | ||
| char * | wtitle, | ||
| int | flag ) |
Create a new window with optional box and title.
| wlines | Number of lines |
| wcols | Number of columns |
| wbegy | Beginning Y position |
| wbegx | Beginning X position |
| wtitle | Window title |
| flag | Window flags |
Definition at line 783 of file dwin.c.
References bw_lt, bw_rt, bw_sp, cbox(), CCC_BOX, CCC_WIN, win_box, win_ptr, and win_win.
Referenced by action_disposition(), answer_yn(), display_error(), form_display_screen(), init_view_boxwin(), menu_engine(), open_pick_win(), Perror(), popup_ckeys(), and wait_mk_win().
| void win_redraw | ( | WINDOW * | win | ) |
Redraw the specified window.
| win | Pointer to the window to redraw |
| void win_resize | ( | int | wlines, |
| int | wcols, | ||
| char * | title ) |
Resize the current window and its box, and update the title.
| wlines | Number of lines |
| wcols | Number of columns |
| title | Window title |
Definition at line 851 of file dwin.c.
References bw_lt, bw_rt, bw_sp, cbox(), CCC_BOX, CCC_WIN, win_box, win_ptr, and win_win.
Referenced by resize_page().
| int xwgetch | ( | WINDOW * | win, |
| Chyron * | chyron, | ||
| int | n ) |
Wrapper for wgetch that handles signals, mouse events, checks for clicks on the chyron line, and accepts a sinigle character answer.
| win | Pointer to window |
| chyron | Pointer to chyron struct |
| n | Number of seconds to wait before timing out 0: Wait indefinitely for user input (raw mode)
accept a single character answer, and don't wait for Enter key
1: Wait for 1 decisecond
n > 1: Wait for n/10 seconds
|
Get mouse event and check if it's a left click or double click. If the click is outside the window, ignore it. If it's on the chyron line, get the corresponding key command. Otherwise, store the click coordinates as click_y and click_x for later use.
Definition at line 1359 of file dwin.c.
References click_x, click_y, curses_tioctl, display_error(), em0, em1, em2, get_chyron_key(), handle_signal(), mk_raw_tioctl(), restore_curses_tioctl(), and sig_received.
Referenced by action_disposition(), answer_yn(), display_error(), field_editor(), form_post(), form_process(), get_cmd_arg(), get_cmd_char(), menu_cmd_processor(), Perror(), picker(), remove_file(), and wait_continue().