Reorganization of TTY raw/noraw mode setting functions.
Этот коммит содержится в:
родитель
fb51cb8241
Коммит
d91122a172
@ -51,7 +51,7 @@ edition_post_exec (void)
|
||||
flushinp ();
|
||||
|
||||
keypad (stdscr, TRUE);
|
||||
mc_raw_mode ();
|
||||
tty_raw_mode ();
|
||||
channels_up ();
|
||||
enable_mouse ();
|
||||
if (alternate_plus_minus)
|
||||
@ -144,7 +144,7 @@ do_execute (const char *shell, const char *command, int flags)
|
||||
) {
|
||||
printf (_("Press any key to continue..."));
|
||||
fflush (stdout);
|
||||
mc_raw_mode ();
|
||||
tty_raw_mode ();
|
||||
get_key_code (0);
|
||||
printf ("\r\n");
|
||||
fflush (stdout);
|
||||
@ -231,7 +231,7 @@ toggle_panels (void)
|
||||
numeric_keypad_mode ();
|
||||
#ifndef HAVE_SLANG
|
||||
/* With slang we don't want any of this, since there
|
||||
* is no mc_raw_mode supported
|
||||
* is no tty_raw_mode supported
|
||||
*/
|
||||
reset_shell_mode ();
|
||||
noecho ();
|
||||
@ -239,7 +239,7 @@ toggle_panels (void)
|
||||
keypad (stdscr, FALSE);
|
||||
endwin ();
|
||||
do_exit_ca_mode ();
|
||||
mc_raw_mode ();
|
||||
tty_raw_mode ();
|
||||
if (console_flag)
|
||||
handle_console (CONSOLE_RESTORE);
|
||||
|
||||
|
@ -52,7 +52,6 @@
|
||||
#include "../src/tty/color.h"
|
||||
#include "../src/tty/key.h"
|
||||
#include "../src/tty/mouse.h"
|
||||
#include "../src/tty/win.h"
|
||||
|
||||
#include "dialog.h"
|
||||
#include "widget.h"
|
||||
@ -582,7 +581,7 @@ done_screen ()
|
||||
if (!(quit & SUBSHELL_EXIT))
|
||||
clr_scr ();
|
||||
reset_shell_mode ();
|
||||
mc_noraw_mode ();
|
||||
tty_noraw_mode ();
|
||||
keypad (stdscr, FALSE);
|
||||
tty_colors_done ();
|
||||
}
|
||||
@ -723,7 +722,7 @@ change_screen_size (void)
|
||||
#if defined TIOCGWINSZ
|
||||
|
||||
#ifndef NCURSES_VERSION
|
||||
mc_noraw_mode ();
|
||||
tty_noraw_mode ();
|
||||
endwin ();
|
||||
#endif
|
||||
low_level_change_screen_size ();
|
||||
|
@ -79,7 +79,7 @@ init_curses (void)
|
||||
#endif /* HAVE_ESCDELAY */
|
||||
|
||||
do_enter_ca_mode ();
|
||||
mc_raw_mode ();
|
||||
raw ();
|
||||
noecho ();
|
||||
keypad (stdscr, TRUE);
|
||||
nodelay (stdscr, FALSE);
|
||||
@ -92,6 +92,18 @@ init_curses (void)
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
tty_raw_mode (void)
|
||||
{
|
||||
raw ();
|
||||
}
|
||||
|
||||
void
|
||||
tty_noraw_mode (void)
|
||||
{
|
||||
noraw ();
|
||||
}
|
||||
|
||||
void
|
||||
tty_gotoyx (int y, int x)
|
||||
{
|
||||
|
@ -269,11 +269,16 @@ init_slang (void)
|
||||
}
|
||||
|
||||
void
|
||||
slang_set_raw_mode (void)
|
||||
tty_raw_mode (void)
|
||||
{
|
||||
tcsetattr (SLang_TT_Read_FD, TCSANOW, &new_mode);
|
||||
}
|
||||
|
||||
void
|
||||
tty_noraw_mode (void)
|
||||
{
|
||||
}
|
||||
|
||||
/* Done each time we come back from done mode */
|
||||
void
|
||||
slang_prog_mode (void)
|
||||
|
@ -37,11 +37,7 @@ enum {
|
||||
# define FALSE 0
|
||||
#endif
|
||||
|
||||
void slang_set_raw_mode (void);
|
||||
|
||||
#define doupdate()
|
||||
#define raw() slang_set_raw_mode ()
|
||||
#define noraw()
|
||||
#define nodelay(x, val) set_slang_delay (val)
|
||||
#define noecho()
|
||||
#define beep() SLtt_beep ()
|
||||
|
@ -26,6 +26,8 @@ extern void tty_enable_interrupt_key(void);
|
||||
extern void tty_disable_interrupt_key(void);
|
||||
extern gboolean tty_got_interrupt(void);
|
||||
|
||||
extern void tty_raw_mode (void);
|
||||
extern void tty_noraw_mode (void);
|
||||
|
||||
/* {{{ Output }}} */
|
||||
|
||||
|
@ -120,17 +120,6 @@ check_movement_keys (int key, int page_size, void *data, movefn backfn,
|
||||
return MSG_HANDLED;
|
||||
}
|
||||
|
||||
/* Classification routines */
|
||||
void mc_raw_mode (void)
|
||||
{
|
||||
raw ();
|
||||
}
|
||||
|
||||
void mc_noraw_mode (void)
|
||||
{
|
||||
noraw ();
|
||||
}
|
||||
|
||||
/* This flag is set by xterm detection routine in function main() */
|
||||
/* It is used by function view_other_cmd() */
|
||||
int xterm_flag = 0;
|
||||
|
@ -20,7 +20,4 @@ extern int xterm_flag;
|
||||
void do_enter_ca_mode (void);
|
||||
void do_exit_ca_mode (void);
|
||||
|
||||
void mc_raw_mode (void);
|
||||
void mc_noraw_mode (void);
|
||||
|
||||
#endif /* MC_WIN_H */
|
||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user