qemu/include/ui
OGAWA Hirofumi 4083733db5 ui/curses: Fix color attribute of monitor for curses
Current text_console_update() writes totally broken color attributes
to console_write_ch(). The format now is writing,

[WRONG]
	bold << 21 | fg << 12 | bg << 8 | char
	fg == 3bits curses color number
	bg == 3bits curses color number

I can't see this format is where come from. Anyway, this doesn't work
at all.

What curses expects is actually (and vga.c is using),

[RIGHT]
	bold << 21 | bg << 11 | fg << 8 | char
	fg == 3bits vga color number
	bg == 3bits vga color number

And curses set COLOR_PAIR() up to match this format, and curses's
chtype. I.e,

	bold | color_pair | char
	color_pair == (bg << 3 | fg)

To fix, this simply uses VGA color number everywhere except curses.c
internal. Then, convert it to above [RIGHT] format to write by
console_write_ch(). And as bonus, this reduces to expose curses define
to other parts (removes COLOR_* from console.c).

[Tested the first line is displayed as white on blue back for monitor
in curses console]

Signed-off-by: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
Message-id: 87r3j95407.fsf@mail.parknet.co.jp
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2016-01-08 12:20:07 +01:00
..
console.h ui/curses: Fix color attribute of monitor for curses 2016-01-08 12:20:07 +01:00
egl-context.h opengl: add egl-context.[ch] helpers 2015-10-08 10:34:53 +02:00
egl-helpers.h ui: add egl-helpers 2015-05-29 11:11:38 +02:00
gtk.h gtk/opengl: add opengl context and scanout support (GtkGLArea) 2015-10-08 10:34:53 +02:00
input.h replay: recording of the user input 2015-11-06 10:16:03 +01:00
pixel_ops.h
qemu-pixman.h spice: fix simple display on bigendian hosts 2015-04-27 12:47:03 +02:00
qemu-spice.h qemu-char: convert spice backend to data-driven creation 2015-10-19 10:13:07 +02:00
sdl2.h sdl2: add support for display rendering using opengl. 2015-05-05 10:48:26 +02:00
shader.h shaders: initialize vertexes once 2015-10-08 10:31:35 +02:00
spice-display.h spice: set pointer position on hotspot 2015-04-27 12:47:04 +02:00