1
1

* global.h: Eliminate xgetch, update all dependencies.

Этот коммит содержится в:
Pavel Roskin 2002-09-03 22:23:27 +00:00
родитель a62567eed9
Коммит 206fdf6f1d
4 изменённых файлов: 13 добавлений и 13 удалений

Просмотреть файл

@ -1,5 +1,7 @@
2002-09-03 Pavel Roskin <proski@gnu.org> 2002-09-03 Pavel Roskin <proski@gnu.org>
* global.h: Eliminate xgetch, update all dependencies.
* boxes.c: Fix remaining old-style calls to create_dlg(). * boxes.c: Fix remaining old-style calls to create_dlg().
* complete.c: Likewise. * complete.c: Likewise.
* main.c: Likewise. * main.c: Likewise.

Просмотреть файл

@ -142,6 +142,4 @@ void refresh_screen (void *);
#define ESC_CHAR '\033' #define ESC_CHAR '\033'
#define ESC_STR "\033" #define ESC_STR "\033"
#define xgetch getch
#endif /* !__MC_GLOBAL_H */ #endif /* !__MC_GLOBAL_H */

Просмотреть файл

@ -289,7 +289,7 @@ xmouse_get_event (Gpm_Event *ev)
/* Variable btn has following meaning: */ /* Variable btn has following meaning: */
/* 0 = btn1 dn, 1 = btn2 dn, 2 = btn3 dn, 3 = btn up */ /* 0 = btn1 dn, 1 = btn2 dn, 2 = btn3 dn, 3 = btn up */
btn = xgetch () - 32; btn = getch () - 32;
/* There seems to be no way of knowing which button was released */ /* There seems to be no way of knowing which button was released */
/* So we assume all the buttons were released */ /* So we assume all the buttons were released */
@ -334,8 +334,8 @@ xmouse_get_event (Gpm_Event *ev)
} }
/* Coordinates are 33-based */ /* Coordinates are 33-based */
/* Transform them to 1-based */ /* Transform them to 1-based */
ev->x = xgetch () - 32; ev->x = getch () - 32;
ev->y = xgetch () - 32; ev->y = getch () - 32;
} }
static key_def *create_sequence (char *seq, int code, int action) static key_def *create_sequence (char *seq, int code, int action)
@ -484,7 +484,7 @@ int get_key_code (int no_delay)
if (no_delay) { if (no_delay) {
nodelay (stdscr, TRUE); nodelay (stdscr, TRUE);
} }
c = xgetch (); c = getch ();
#if defined(USE_NCURSES) && defined(KEY_RESIZE) #if defined(USE_NCURSES) && defined(KEY_RESIZE)
if (c == KEY_RESIZE) if (c == KEY_RESIZE)
goto nodelay_try_again; goto nodelay_try_again;
@ -519,7 +519,7 @@ int get_key_code (int no_delay)
} else if (c == ERR){ } else if (c == ERR){
/* Maybe we got an incomplete match. /* Maybe we got an incomplete match.
This we do only in delay mode, since otherwise This we do only in delay mode, since otherwise
xgetch can return ERR at any time. */ getch can return ERR at any time. */
if (seq_append) { if (seq_append) {
pending_keys = seq_buffer; pending_keys = seq_buffer;
goto pend_send; goto pend_send;
@ -570,7 +570,7 @@ int get_key_code (int no_delay)
} else { } else {
if (no_delay) if (no_delay)
goto nodelay_try_again; goto nodelay_try_again;
c = xgetch (); c = getch ();
} }
} else { } else {
/* We got a complete match, return and reset search */ /* We got a complete match, return and reset search */
@ -835,7 +835,7 @@ static int xgetch_second (void)
FD_ZERO (&Read_FD_Set); FD_ZERO (&Read_FD_Set);
FD_SET (input_fd, &Read_FD_Set); FD_SET (input_fd, &Read_FD_Set);
select (input_fd + 1, &Read_FD_Set, NULL, NULL, &timeout); select (input_fd + 1, &Read_FD_Set, NULL, NULL, &timeout);
c = xgetch (); c = getch ();
nodelay (stdscr, FALSE); nodelay (stdscr, FALSE);
return c; return c;
} }
@ -871,9 +871,9 @@ char *learn_key (void)
char *p = buffer; char *p = buffer;
keypad(stdscr, FALSE); /* disable intepreting keys by ncurses */ keypad(stdscr, FALSE); /* disable intepreting keys by ncurses */
c = xgetch (); c = getch ();
while (c == ERR) while (c == ERR)
c = xgetch (); /* Sanity check, should be unnecessary */ c = getch (); /* Sanity check, should be unnecessary */
learn_store_key (buffer, &p, c); learn_store_key (buffer, &p, c);
GET_TIME (endtime); GET_TIME (endtime);
endtime.tv_usec += LEARN_TIMEOUT; endtime.tv_usec += LEARN_TIMEOUT;
@ -883,7 +883,7 @@ char *learn_key (void)
} }
nodelay (stdscr, TRUE); nodelay (stdscr, TRUE);
for (;;) { for (;;) {
while ((c = xgetch ()) == ERR) { while ((c = getch ()) == ERR) {
GET_TIME (timeout); GET_TIME (timeout);
timeout.tv_usec = endtime.tv_usec - timeout.tv_usec; timeout.tv_usec = endtime.tv_usec - timeout.tv_usec;
if (timeout.tv_usec < 0) if (timeout.tv_usec < 0)

Просмотреть файл

@ -547,7 +547,7 @@ do_execute (const char *shell, const char *command, int flags)
last_paused = 1; last_paused = 1;
fflush (stdout); fflush (stdout);
mc_raw_mode (); mc_raw_mode ();
xgetch (); getch ();
} }
if (console_flag) { if (console_flag) {
if (output_lines && keybar_visible) { if (output_lines && keybar_visible) {