C-Menu 0.2.9
A User Interface Toolkit
Loading...
Searching...
No Matches
Window Support

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.

Detailed Description

Manage NCurses windows and color settings.

Function Documentation

◆ cbox()

void cbox ( WINDOW * box)

Draw a box around the specified window.

Parameters
boxPointer to the window to draw the box around
Note
This function uses NCurses functions to draw a box around the specified window. It adds the appropriate characters for the corners and edges of the box based on the current character set. Use this function when you want to visually separate a window from the rest of the screen with a border.

Definition at line 960 of file dwin.c.

960 {
961 int x, y;
962 int maxx;
963 int maxy;
964
965 maxx = getmaxx(box);
966 maxx--;
967 mvwaddnwstr(box, 0, 0, &bw_tl, 1);
968 for (x = 1; x < maxx; x++)
969 waddnwstr(box, &bw_ho, 1);
970 waddnwstr(box, &bw_tr, 1);
971 maxy = getmaxy(box);
972 maxy--;
973 for (y = 1; y < maxy; y++) {
974 mvwaddnwstr(box, y, 0, &bw_ve, 1);
975 mvwaddnwstr(box, y, maxx, &bw_ve, 1);
976 }
977 mvwaddnwstr(box, maxy, 0, &bw_bl, 1);
978 for (x = 1; x < maxx; x++)
979 waddnwstr(box, &bw_ho, 1);
980 waddnwstr(box, &bw_br, 1);
981}
const wchar_t bw_ho
Definition dwin.c:95
const wchar_t bw_tl
Definition dwin.c:97
const wchar_t bw_tr
Definition dwin.c:98
const wchar_t bw_bl
Definition dwin.c:99
const wchar_t bw_ve
Definition dwin.c:96
const wchar_t bw_br
Definition dwin.c:100

References bw_bl, bw_br, bw_ho, bw_tl, bw_tr, and bw_ve.

Referenced by win_new(), and win_resize().

Here is the caller graph for this function:

◆ destroy_curses()

void destroy_curses ( )

Gracefully shut down NCurses and restore terminal settings.

Note
This function should be called before exiting the program to ensure that the terminal is left in a usable state. It checks if NCurses was initialized and, if so, it erases the screen, refreshes it, and ends the NCurses session. It also restores the original terminal settings using restore_shell_tioctl and resets signal handlers to their default state with sig_dfl_mode.

Definition at line 738 of file dwin.c.

738 {
739 if (!f_curses_open)
740 return;
741 while (win_ptr > 0) {
742 if (win_win[win_ptr])
743 delwin(win_win[win_ptr]);
744 if (win_box[win_ptr])
745 delwin(win_box[win_ptr]);
746 win_win[win_ptr] = nullptr;
747 win_box[win_ptr] = nullptr;
748 win_ptr--;
749 }
750 werase(stdscr);
751 wrefresh(stdscr);
752 endwin();
753 delscreen(screen);
754 // screen = nullptr;
755 fclose(ncurses_fp);
756 f_curses_open = false;
758 sig_dfl_mode();
759 return;
760}
bool f_curses_open
Definition sig.c:33
WINDOW * win_win[MAXWIN]
Definition dwin.c:114
SCREEN * screen
Definition dwin.c:75
int win_ptr
Definition dwin.c:121
FILE * ncurses_fp
Definition dwin.c:154
WINDOW * win_box[MAXWIN]
Definition dwin.c:115
bool restore_shell_tioctl()
restore_shell_tioctl() - restore shell terminal settings
Definition scriou.c:56
void sig_dfl_mode()
Set signal handlers to default behavior.
Definition sig.c:42

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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ mvwaddstr_fill()

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.

Parameters
wPointer to window
yY coordinate
xX coordinate
sString to display
lLength of display area

Definition at line 1262 of file dwin.c.

1262 {
1263 char *d, *e;
1264 char tmp_str[MAXLEN];
1265
1266 d = tmp_str;
1267 if (l > MAXLEN - 1)
1268 l = MAXLEN - 1;
1269 e = tmp_str + l;
1270 while (d < e)
1271 if (*s == '\0' || *s == '\n')
1272 *d++ = ' ';
1273 else
1274 *d++ = *s++;
1275 *d++ = '\0';
1276 mvwaddstr(w, y, x, tmp_str);
1277}
#define MAXLEN
Definition curskeys.c:15

Referenced by display_page(), menu_cmd_processor(), picker(), reverse_object(), and unreverse_object().

Here is the caller graph for this function:

◆ open_curses()

bool open_curses ( SIO * sio)

Initialize NCurses and color settings.

Parameters
sioPointer to SIO struct with terminal and color settings
Returns
true if successful, false if error note This function initializes NCurses and sets up color pairs based on the settings in the SIO struct. It also applies gamma correction to colors. Use this function to initialize NCurses if you don't want NCurses to receive data from the stdin pipe
1. saves stdin and stdout file descriptors in SIO
2. opens a terminal device for NCurses screen IO
3. replaces STDERR_FILENO with terminal file descriptor
The SIO structure encapsulates various aspects of the terminal's state and configuration,...
Definition cm.h:626

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.

423 {
424 char tmp_str[MAXLEN];
425 char emsg0[MAXLEN];
426
427 if (ttyname_r(STDERR_FILENO, sio->tty_name, sizeof(sio->tty_name)) != 0) {
428 strerror_r(errno, tmp_str, MAXLEN - 1);
429 strnz__cpy(emsg0, "ttyname_r failed ", MAXLEN - 1);
430 strnz__cat(emsg0, tmp_str, MAXLEN - 1);
431 fprintf(stderr, "%s\n", tmp_str);
432 exit(0);
433 }
435 ncurses_fp = fopen(sio->tty_name, "r+");
436 if (ncurses_fp == nullptr) {
437 strerror_r(errno, tmp_str, MAXLEN - 1);
438 strnz__cpy(emsg0, "fopen(sio->tty_name) failed ", MAXLEN - 1);
439 strnz__cat(emsg0, tmp_str, MAXLEN - 1);
440 fprintf(stderr, "%s\n", tmp_str);
441 exit(0);
442 }
445 screen = newterm(nullptr, ncurses_fp, ncurses_fp);
446 if (screen == nullptr) {
447 strerror_r(errno, tmp_str, MAXLEN - 1);
448 strnz__cpy(emsg0, "newterm failed ", MAXLEN - 1);
449 strnz__cat(emsg0, tmp_str, MAXLEN - 1);
450 fprintf(stderr, "%s\n", tmp_str);
451 exit(0);
452 }
453 set_term(screen);
454 f_curses_open = true;
455 if (!has_colors()) {
457 abend(-1, "Terminal color support required");
458 }
459 start_color();
460 if (!can_change_color()) {
462 fprintf(stderr, "Terminal cannot change colors\n");
463 fprintf(stderr, "Check TERM environment variable\n");
464 fprintf(stderr, "Check terminfo for missing \"ccc\"\n");
465 abend(-1, "fatal error");
466 }
471 RED_GAMMA = sio->red_gamma;
472 GREEN_GAMMA = sio->green_gamma;
473 BLUE_GAMMA = sio->blue_gamma;
474 GRAY_GAMMA = sio->gray_gamma;
475
482
488 CCC_LN = mkccc(cp_ln);
489 noecho();
490 keypad(stdscr, true);
491 idlok(stdscr, false);
492 idcok(stdscr, false);
493 wbkgrnd(stdscr, &CCC_NORM);
494 wbkgrndset(stdscr, &CCC_NORM);
495#ifdef NCDEBUG
496 immedok(stdscr, true);
497#endif
498 win_ptr = -1;
499 return sio;
500}
@ CLR_FG
Definition cm.h:140
@ CLR_YELLOW
Definition cm.h:126
@ CLR_WHITE
Definition cm.h:130
@ CLR_BLACK
Definition cm.h:123
@ CLR_LN_BG
Definition cm.h:144
@ CLR_BO
Definition cm.h:142
@ CLR_LN
Definition cm.h:143
@ CLR_BG
Definition cm.h:141
int cp_box
Definition dwin.c:138
cchar_t CCC_LN
Definition dwin.c:151
int cp_win
Definition dwin.c:137
cchar_t CCC_WIN
Definition dwin.c:146
double BLUE_GAMMA
Definition dwin.c:110
cchar_t CCC_REVERSE_HIGHLIGHT
Definition dwin.c:150
int cp_ln
Definition dwin.c:141
cchar_t CCC_BOX
Definition dwin.c:148
SIO * sio
Definition dwin.c:77
double GRAY_GAMMA
Definition dwin.c:104
double RED_GAMMA
Definition dwin.c:106
int cp_reverse_highlight
Definition dwin.c:140
cchar_t CCC_REVERSE
Definition dwin.c:149
double GREEN_GAMMA
Definition dwin.c:108
cchar_t CCC_NORM
Definition dwin.c:145
int cp_reverse
Definition dwin.c:139
int cp_norm
Definition dwin.c:136
void destroy_curses()
Gracefully shut down NCurses and restore terminal settings.
Definition dwin.c:738
cchar_t mkccc(int)
Create a cchar_t with the specified color pair index.
Definition dwin.c:766
bool init_clr_palette(SIO *)
Initialize color palette based on SIO settings.
Definition dwin.c:651
int get_clr_pair(int fg, int bg)
Get color pair index for foreground and background colors.
Definition dwin.c:510
void abend(int, char *)
Abnormal program termination.
Definition dwin.c:1331
size_t strnz__cpy(char *, const char *, size_t)
safer alternative to strncpy
Definition futil.c:269
size_t strnz__cat(char *, const char *, size_t)
safer alternative to strncat
Definition futil.c:298

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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ restore_wins()

void restore_wins ( )

Restore all windows after a screen resize.

Note
This function is used to restore the display of all windows after a screen resize event. It clears the standard screen and then iterates through all existing windows, touching and refreshing them to ensure they are redrawn correctly on the resized screen. Use this function in response to a SIGWINCH signal to handle terminal resizing gracefully.

Definition at line 938 of file dwin.c.

938 {
939 int i;
940 touchwin(stdscr);
941 wnoutrefresh(stdscr);
942 wrefresh(stdscr);
943 for (i = 0; i <= win_ptr; i++) {
944 touchwin(win_box[i]);
945 wnoutrefresh(win_box[i]);
946 wrefresh(win_box[i]);
947 touchwin(win_win[i]);
948 wnoutrefresh(win_win[i]);
949 wrefresh(win_win[i]);
950 }
951}

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().

Here is the caller graph for this function:

◆ win_del()

WINDOW * win_del ( )

Delete the current window and its associated box window.

Returns
nullptr
Note
This function deletes the current window and its associated box window, if they exist. It also refreshes the remaining windows to ensure the display is updated correctly. After calling this function, the global win_ptr variable is decremented to point to the previous window in the stack.

Definition at line 902 of file dwin.c.

902 {
903 int i;
904 curs_set(0);
905 if (win_ptr >= 0) {
906 touchwin(win_win[win_ptr]);
907 wbkgrnd(win_win[win_ptr], &CCC_NORM);
908 wbkgrndset(win_win[win_ptr], &CCC_NORM);
909 werase(win_win[win_ptr]);
910 wnoutrefresh(win_win[win_ptr]);
911 delwin(win_win[win_ptr]);
912
913 touchwin(win_box[win_ptr]);
914 wbkgrnd(win_box[win_ptr], &CCC_NORM);
915 wbkgrndset(win_box[win_ptr], &CCC_NORM);
916 werase(win_box[win_ptr]);
917 wnoutrefresh(win_box[win_ptr]);
918 delwin(win_box[win_ptr]);
919
920 for (i = 0; i < win_ptr; i++) {
921 touchwin(win_box[i]);
922 wnoutrefresh(win_box[i]);
923 touchwin(win_win[i]);
924 wnoutrefresh(win_win[i]);
925 }
926 win_ptr--;
927 }
928 curs_set(1);
929 return (0);
930}

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().

Here is the caller graph for this function:

◆ win_init_attrs()

void win_init_attrs ( )

Initialize window attributes.

Note
This function initializes color pairs for the window
cp_norm, cp_win, and cp_box are global variables
See also
get_clr_pair

Definition at line 162 of file dwin.c.

162{ return; }

Referenced by main().

Here is the caller graph for this function:

◆ win_new()

int win_new ( int wlines,
int wcols,
int wbegy,
int wbegx,
char * wtitle,
int flag )

Create a new window with optional box and title.

Parameters
wlinesNumber of lines
wcolsNumber of columns
wbegyBeginning Y position
wbegxBeginning X position
wtitleWindow title
flagWindow flags
Note
if flag set to W_BOX, Only create win_box. This is for View which uses the box window for display and doesn't need a separate win_win
Returns
0 if successful, 1 if error

Definition at line 783 of file dwin.c.

784 {
785 int maxx;
786 if (win_ptr < MAXWIN) {
787 win_ptr++;
788 if (wbegy != 0 || wbegx != 0 || wlines < LINES - 2 ||
789 wcols < COLS - 2) {
790 win_box[win_ptr] = newwin(wlines + 2, wcols + 2, wbegy, wbegx);
791 if (win_box[win_ptr] == nullptr) {
792 win_ptr--;
793 return (1);
794 }
795#ifdef NCDEBUG
796 immedok(win_box[win_ptr], true);
797#endif
798 wbkgrnd(win_box[win_ptr], &CCC_BOX);
799 wbkgrndset(win_box[win_ptr], &CCC_BOX);
801 mvwaddnwstr(win_box[win_ptr], 0, 1, &bw_rt, 1);
802 mvwaddnwstr(win_box[win_ptr], 0, 2, &bw_sp, 1);
803 mvwaddstr(win_box[win_ptr], 0, 3, wtitle);
804 maxx = getmaxx(win_box[win_ptr]);
805 int s = strlen(wtitle);
806 if ((s + 3) < maxx)
807 mvwaddch(win_box[win_ptr], 0, (s + 3), ' ');
808 if ((s + 4) < maxx)
809 mvwaddnwstr(win_box[win_ptr], 0, (s + 4), &bw_lt, 1);
810 wnoutrefresh(win_box[win_ptr]);
811 wbegy += 1;
812 wbegx += 1;
813 } else {
814 win_box[win_ptr] = newwin(wlines, wcols, wbegy, wbegx);
815 if (win_box[win_ptr] == nullptr)
816 win_ptr--;
817 return (1);
818#ifdef NCDEBUG
819 immedok(win_box[win_ptr], true);
820#endif
821 wbkgrnd(win_box[win_ptr], &CCC_BOX);
822 wbkgrndset(win_box[win_ptr], &CCC_BOX);
823 }
824 if (!(flag & W_BOX)) {
825 win_win[win_ptr] = newwin(wlines, wcols, wbegy, wbegx);
826 if (win_win[win_ptr] == nullptr) {
827 delwin(win_box[win_ptr]);
828 return (1);
829 }
830#ifdef NCDEBUG
831 immedok(win_win[win_ptr], true);
832#endif
833 wbkgrnd(win_win[win_ptr], &CCC_WIN);
834 wbkgrndset(win_win[win_ptr], &CCC_WIN);
835 keypad(win_win[win_ptr], true);
836 idlok(win_win[win_ptr], false);
837 idcok(win_win[win_ptr], false);
838 }
839 }
840 return (0);
841}
#define MAXWIN
Definition cm.h:468
#define W_BOX
Definition cm.h:179
const wchar_t bw_rt
Definition dwin.c:102
const wchar_t bw_sp
Definition dwin.c:103
const wchar_t bw_lt
Definition dwin.c:101
void cbox(WINDOW *)
Draw a box around the specified window.
Definition dwin.c:960

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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ win_redraw()

void win_redraw ( WINDOW * win)

Redraw the specified window.

Parameters
winPointer to the window to redraw
Note
This function erases the contents of the specified window and then refreshes it to update the display. Use this function when you need to clear and redraw a window, such as after resizing or when updating its contents.

Definition at line 891 of file dwin.c.

891 {
892 werase(win);
893 wnoutrefresh(win);
894}
WINDOW * win
Definition dwin.c:113

◆ win_resize()

void win_resize ( int wlines,
int wcols,
char * title )

Resize the current window and its box, and update the title.

Parameters
wlinesNumber of lines
wcolsNumber of columns
titleWindow title
Note
This function resizes the current window and its associated box window to the specified number of lines and columns. It also updates the title of the box window if a title is provided. After resizing, it refreshes the windows to apply the changes.

Definition at line 851 of file dwin.c.

851 {
852 int maxx;
853 wrefresh(stdscr);
854 wresize(win_box[win_ptr], wlines + 2, wcols + 2);
855 wbkgrnd(win_box[win_ptr], &CCC_BOX);
856 wbkgrndset(win_box[win_ptr], &CCC_BOX);
858 if (title != nullptr && *title != '\0') {
859 wmove(win_box[win_ptr], 0, 1);
860 waddnstr(win_box[win_ptr], (const char *)&bw_rt, 1);
861 wmove(win_box[win_ptr], 0, 2);
862 waddnstr(win_box[win_ptr], (const char *)&bw_sp, 1);
863 mvwaddnwstr(win_box[win_ptr], 0, 1, &bw_rt, 1);
864 mvwaddnwstr(win_box[win_ptr], 0, 2, &bw_sp, 1);
865 mvwaddstr(win_box[win_ptr], 0, 3, title);
866 maxx = getmaxx(win_box[win_ptr]);
867 int s = strlen(title);
868 if ((s + 3) < maxx)
869 mvwaddch(win_box[win_ptr], 0, (s + 3), ' ');
870 if ((s + 4) < maxx)
871 mvwaddnwstr(win_box[win_ptr], 0, (s + 4), &bw_lt, 1);
872 }
873 wnoutrefresh(win_box[win_ptr]);
874 wresize(win_win[win_ptr], wlines, wcols);
875 wbkgrnd(win_win[win_ptr], &CCC_WIN);
876 wbkgrndset(win_win[win_ptr], &CCC_WIN);
877 wsetscrreg(win_win[win_ptr], 0, wlines - 1);
878 keypad(win_win[win_ptr], TRUE);
879 idlok(win_win[win_ptr], false);
880 idcok(win_win[win_ptr], false);
881#ifdef NCDEBUG
882 immedok(win_win[win_ptr], true);
883#endif
884}
#define TRUE
Definition iloan.c:19

References bw_lt, bw_rt, bw_sp, cbox(), CCC_BOX, CCC_WIN, win_box, win_ptr, and win_win.

Referenced by resize_page().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ xwgetch()

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.

Parameters
winPointer to window
chyronPointer to chyron struct
nNumber 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
Returns
Key code or ERR if interrupted by signal
Note
This, of course, will be expanded into an event loop for message queuing

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.

1359 {
1360 int c;
1361 MEVENT event;
1362 mousemask(BUTTON1_CLICKED | BUTTON1_DOUBLE_CLICKED | BUTTON4_PRESSED |
1363 BUTTON5_PRESSED,
1364 nullptr);
1365 event.y = event.x = -1;
1366 click_y = click_x = -1;
1367
1368 if (n == -1) {
1369 struct termios raw_tioctl;
1370 raw_tioctl = curses_tioctl;
1371 mk_raw_tioctl(&raw_tioctl);
1372 } else if (n == 0)
1373 halfdelay(1);
1374 else
1375 halfdelay(min(255, max(0, n * 10)));
1376 tcflush(2, TCIFLUSH);
1377 curs_set(1);
1378 do {
1379 c = wgetch(win);
1380 if (sig_received != 0) {
1382 c = display_error(em0, em1, em2, nullptr);
1383 if (c == 'q' || c == 'Q' || c == KEY_F(9))
1384 exit(EXIT_FAILURE);
1385 }
1386 if (n > 0 && c == ERR) {
1387 c = 0;
1388 break;
1389 }
1390 if (c == ERR)
1391 continue;
1392 if (c == KEY_MOUSE) {
1393 if (getmouse(&event) != OK) {
1394 c = 0;
1395 continue;
1396 }
1397 if (event.bstate & BUTTON4_PRESSED) {
1398 curs_set(0);
1399 return KEY_UP;
1400 } else if (event.bstate & BUTTON5_PRESSED) {
1401 curs_set(0);
1402 return KEY_DOWN;
1403 }
1404 if (event.bstate & BUTTON1_CLICKED ||
1405 event.bstate & BUTTON1_DOUBLE_CLICKED) {
1406 if (!wenclose(win, event.y, event.x)) {
1407 c = 0;
1408 continue;
1409 }
1410 wmouse_trafo(win, &event.y, &event.x, false);
1411 if (event.y < 0 || event.x < 0 || event.x >= getmaxx(win) ||
1412 event.y >= getmaxy(win)) {
1413 c = 0;
1414 continue;
1415 }
1416 click_y = event.y;
1417 click_x = event.x;
1418 if (chyron && event.y == getmaxy(win) - 1) {
1419 c = get_chyron_key(chyron, event.x);
1420 break;
1421 } else
1422 break;
1423 }
1424 }
1425 } while (c == ERR);
1426 curs_set(0);
1428 return c;
1429}
volatile sig_atomic_t sig_received
Definition sig.c:31
bool handle_signal(sig_atomic_t)
struct termios shell_tioctl curses_tioctl
Definition scriou.c:34
#define min(x, y)
min macro evaluates two expressions, returning least result
Definition cm.h:55
#define max(a, b)
max macro evaluates two expressions, returning greatest result.
Definition cm.h:48
char em1[MAXLEN]
Definition dwin.c:133
int click_x
Definition dwin.c:45
int click_y
Definition dwin.c:44
char em0[MAXLEN]
Definition dwin.c:132
char em2[MAXLEN]
Definition dwin.c:134
int get_chyron_key(Chyron *, int)
Get keycode from chyron.
Definition dwin.c:369
int display_error(char *em0, char *em1, char *em2, char *em3)
Display an error message window or print to stderr.
Definition dwin.c:1054
bool restore_curses_tioctl()
restore_curses_tioctl() - restore curses terminal settings
Definition scriou.c:81
bool mk_raw_tioctl(struct termios *)
mk_raw_tioctl() - set terminal to raw mode
Definition scriou.c:126

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().

Here is the call graph for this function:
Here is the caller graph for this function: