TTY: fixes after rebase.
Code clean up. Modification of tty_refresh for NCurses: call doupdate() after refresh() every time. tty_draw_box_slow() is not private function of TTY now. Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
Этот коммит содержится в:
родитель
7eb4f84dbd
Коммит
509f4d5c4f
@ -279,7 +279,7 @@ print_to_widget (WEdit *edit, long row, int start_col, int start_col_real,
|
||||
if (option_line_state) {
|
||||
int i;
|
||||
for (i = 0; i < LINE_STATE_WIDTH; i++)
|
||||
if (status[i] == '\0') {
|
||||
if (status[i] == '\0')
|
||||
status[i] = ' ';
|
||||
|
||||
tty_setcolor (LINE_STATE_COLOR);
|
||||
|
@ -154,10 +154,10 @@ tty_try_alloc_color_pair (const char *fg, const char *bg)
|
||||
p->next = NULL;
|
||||
p->fg = fg ? g_strdup (fg) : NULL;
|
||||
p->bg = bg ? g_strdup (bg) : NULL;
|
||||
if (fg == NULL
|
||||
if (fg == NULL)
|
||||
/* Index in color_map array = COLOR_INDEX - 1 */
|
||||
fg = color_map[EDITOR_NORMAL_COLOR_INDEX - 1].fg;
|
||||
if (bg == NULL
|
||||
if (bg == NULL)
|
||||
bg = color_map[EDITOR_NORMAL_COLOR_INDEX - 1].bg;
|
||||
p->index = alloc_color_pair (fg, bg);
|
||||
return p->index;
|
||||
|
@ -455,6 +455,9 @@ static key_define_t qansi_key_defines[] =
|
||||
/* timeout for old_esc_mode in usec */
|
||||
static int keyboard_key_timeout = 1000000; /* settable via env */
|
||||
|
||||
/* This holds all the key definitions */
|
||||
static key_def *keys = NULL;
|
||||
|
||||
static int input_fd;
|
||||
static int disabled_channels = 0; /* Disable channels checking */
|
||||
|
||||
@ -1485,19 +1488,6 @@ get_key_code (int no_delay)
|
||||
return correct_key_code (c);
|
||||
}
|
||||
|
||||
/* Return the code associated with the symbolic name keyname */
|
||||
int
|
||||
lookup_key (char *keyname)
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = 0; key_name_conv_tab [i].code; i++)
|
||||
if (str_casecmp (key_name_conv_tab [i].name, keyname) == 0)
|
||||
return key_name_conv_tab [i].code;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Returns a character read from stdin with appropriate interpretation */
|
||||
/* Also takes care of generated mouse events */
|
||||
/* Returns EV_MOUSE if it is a mouse event */
|
||||
|
@ -14,13 +14,4 @@ extern gboolean slow_tty;
|
||||
/* The mouse is currently: TRUE - enabled, FALSE - disabled */
|
||||
extern gboolean mouse_enabled;
|
||||
|
||||
static inline void
|
||||
tty_draw_box_slow (int y, int x, int ys, int xs)
|
||||
{
|
||||
tty_draw_hline (y, x, ' ', xs);
|
||||
tty_draw_vline (y, x, ' ', ys);
|
||||
tty_draw_vline (y, x + xs - 1, ' ', ys);
|
||||
tty_draw_hline (y + ys - 1, x, ' ', xs);
|
||||
}
|
||||
|
||||
#endif /* MC_TTY_INTERNAL_H */
|
||||
|
@ -41,6 +41,7 @@
|
||||
#endif
|
||||
|
||||
#include "../../src/tty/tty-internal.h" /* slow_tty */
|
||||
#include "../../src/tty/tty.h" /* tty_draw_box_slow */
|
||||
#include "../../src/tty/color-ncurses.h"
|
||||
#include "../../src/tty/color-internal.h"
|
||||
#include "../../src/tty/win.h"
|
||||
@ -316,8 +317,10 @@ tty_refresh (void)
|
||||
#ifdef WITH_BACKGROUND
|
||||
if (!we_are_background)
|
||||
#endif /* WITH_BACKGROUND */
|
||||
{
|
||||
refresh ();
|
||||
doupdate ();
|
||||
doupdate ();
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -43,6 +43,7 @@
|
||||
#include "../../src/global.h"
|
||||
|
||||
#include "../../src/tty/tty-internal.h" /* slow_tty */
|
||||
#include "../../src/tty/tty.h" /* tty_draw_box_slow */
|
||||
#include "../../src/tty/color-slang.h"
|
||||
#include "../../src/tty/color-internal.h"
|
||||
#include "../../src/tty/mouse.h" /* Gpm_Event is required in key.h */
|
||||
|
@ -40,7 +40,6 @@
|
||||
#include "../../src/tty/tty-internal.h"
|
||||
|
||||
#include "../../src/strutil.h"
|
||||
#include "../../src/background.h" /* we_are_background */
|
||||
|
||||
/*** global variables **************************************************/
|
||||
|
||||
@ -136,3 +135,12 @@ tty_print_one_vline (void)
|
||||
else
|
||||
tty_print_alt_char (ACS_VLINE);
|
||||
}
|
||||
|
||||
void
|
||||
tty_draw_box_slow (int y, int x, int ys, int xs)
|
||||
{
|
||||
tty_draw_hline (y, x, ' ', xs);
|
||||
tty_draw_vline (y, x, ' ', ys);
|
||||
tty_draw_vline (y, x + xs - 1, ' ', ys);
|
||||
tty_draw_hline (y + ys - 1, x, ' ', xs);
|
||||
}
|
||||
|
@ -74,6 +74,7 @@ extern void tty_print_one_hline (void);
|
||||
extern void tty_draw_hline (int y, int x, int ch, int len);
|
||||
extern void tty_draw_vline (int y, int x, int ch, int len);
|
||||
extern void tty_draw_box (int y, int x, int rows, int cols);
|
||||
extern void tty_draw_box_slow (int y, int x, int ys, int xs);
|
||||
extern void tty_fill_region (int y, int x, int rows, int cols, unsigned char ch);
|
||||
|
||||
extern char *tty_tgetstr (const char *name);
|
||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user