mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-03 07:43:54 -06:00
console: purge curses bits from console.h
Handle the translation from vga chars to curses chars in curses_update() instead of console_write_ch(). Purge any curses support bits from ui/console.h include file. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Message-id: 20170927103811.19249-1-kraxel@redhat.com
This commit is contained in:
parent
ab16152926
commit
e2f82e924d
3 changed files with 28 additions and 26 deletions
|
@ -336,29 +336,10 @@ static inline pixman_format_code_t surface_format(DisplaySurface *s)
|
|||
return s->format;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_CURSES
|
||||
/* KEY_EVENT is defined in wincon.h and in curses.h. Avoid redefinition. */
|
||||
#undef KEY_EVENT
|
||||
#include <curses.h>
|
||||
#undef KEY_EVENT
|
||||
typedef chtype console_ch_t;
|
||||
extern chtype vga_to_curses[];
|
||||
#else
|
||||
typedef unsigned long console_ch_t;
|
||||
#endif
|
||||
typedef uint32_t console_ch_t;
|
||||
|
||||
static inline void console_write_ch(console_ch_t *dest, uint32_t ch)
|
||||
{
|
||||
uint8_t c = ch;
|
||||
#ifdef CONFIG_CURSES
|
||||
if (vga_to_curses[c]) {
|
||||
ch &= ~(console_ch_t)0xff;
|
||||
ch |= vga_to_curses[c];
|
||||
}
|
||||
#else
|
||||
if (c == '\0') {
|
||||
ch |= ' ';
|
||||
}
|
||||
#endif
|
||||
*dest = ch;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue