2007-12-25 Robert Millan <rmh@aybabtu.com>

* include/grub/term.h (struct grub_term): Add `getcolor' function.
	(grub_getcolor): New function.

	* kern/term.c (grub_getcolor): New function.
	* normal/menu.c (GRUB_COLOR_MENU_NORMAL): New macro.
	(GRUB_COLOR_MENU_HIGHLIGHT): New macro.
	(print_entry): Set normal and highlight colors to
	`GRUB_COLOR_MENU_NORMAL' and `GRUB_COLOR_MENU_HIGHLIGHT',
	respectively, before printing and restore them to old
	values afterwards.
	(grub_menu_init_page): Likewise.  Fill an additional colored space
	that would otherwise be left blank.

	* term/efi/console.c (grub_console_getcolor): New function.
	(struct grub_console_term.getcolor): New variable.
	* term/i386/pc/console.c (grub_console_getcolor): New function.
	(struct grub_console_term.getcolor): New variable.
	* term/ieee1275/ofconsole.c (grub_ofconsole_getcolor): New function.
	(struct grub_console_term.getcolor): New variable.

	* term/i386/pc/serial.c (grub_serial_setcolor): Remove function.
	(struct grub_console_term.setcolor): Remove variable.
	* term/i386/pc/vesafb.c (grub_virtual_screen_setcolor): Remove function.
	(struct grub_console_term.setcolor): Remove variable.
	* term/i386/pc/vga.c (grub_vga_setcolor): Remove function.
	(struct grub_console_term.setcolor): Remove variable.
	* term/gfxterm.c (grub_virtual_screen_setcolor): Remove function.
	(struct grub_console_term.setcolor): Remove variable.
This commit is contained in:
robertmh 2007-12-25 11:10:47 +00:00
parent 4931827fe4
commit 533110ada7
11 changed files with 85 additions and 34 deletions

View file

@ -259,6 +259,13 @@ grub_console_setcolor (grub_uint8_t normal_color, grub_uint8_t highlight_color)
grub_console_highlight_color = highlight_color;
}
static void
grub_console_getcolor (grub_uint8_t *normal_color, grub_uint8_t *highlight_color)
{
*normal_color = grub_console_normal_color;
*highlight_color = grub_console_highlight_color;
}
static void
grub_console_setcursor (int on)
{
@ -283,6 +290,7 @@ static struct grub_term grub_console_term =
.cls = grub_console_cls,
.setcolorstate = grub_console_setcolorstate,
.setcolor = grub_console_setcolor,
.getcolor = grub_console_getcolor,
.setcursor = grub_console_setcursor,
.flags = 0,
.next = 0

View file

@ -839,14 +839,6 @@ grub_virtual_screen_setcolorstate (grub_term_color_state state)
}
}
static void
grub_virtual_screen_setcolor (grub_uint8_t normal_color,
grub_uint8_t highlight_color)
{
virtual_screen.fg_color_setting = grub_video_map_color (normal_color);
virtual_screen.bg_color_setting = grub_video_map_color (highlight_color);
}
static void
grub_gfxterm_setcursor (int on)
{
@ -882,7 +874,6 @@ static struct grub_term grub_video_term =
.gotoxy = grub_gfxterm_gotoxy,
.cls = grub_gfxterm_cls,
.setcolorstate = grub_virtual_screen_setcolorstate,
.setcolor = grub_virtual_screen_setcolor,
.setcursor = grub_gfxterm_setcursor,
.refresh = grub_gfxterm_refresh,
.flags = 0,

View file

@ -117,6 +117,13 @@ grub_console_setcolor (grub_uint8_t normal_color, grub_uint8_t highlight_color)
grub_console_highlight_color = highlight_color;
}
static void
grub_console_getcolor (grub_uint8_t *normal_color, grub_uint8_t *highlight_color)
{
*normal_color = grub_console_normal_color;
*highlight_color = grub_console_highlight_color;
}
static struct grub_term grub_console_term =
{
.name = "console",
@ -132,6 +139,7 @@ static struct grub_term grub_console_term =
.cls = grub_console_cls,
.setcolorstate = grub_console_setcolorstate,
.setcolor = grub_console_setcolor,
.getcolor = grub_console_getcolor,
.setcursor = grub_console_setcursor,
.flags = 0,
.next = 0

View file

@ -453,13 +453,6 @@ grub_serial_setcolorstate (const grub_term_color_state state)
keep_track = 1;
}
static void
grub_serial_setcolor (grub_uint8_t normal_color __attribute__ ((unused)),
grub_uint8_t highlight_color __attribute__ ((unused)))
{
/* FIXME */
}
static void
grub_serial_setcursor (const int on)
{
@ -483,7 +476,6 @@ static struct grub_term grub_serial_term =
.gotoxy = grub_serial_gotoxy,
.cls = grub_serial_cls,
.setcolorstate = grub_serial_setcolorstate,
.setcolor = grub_serial_setcolor,
.setcursor = grub_serial_setcursor,
.flags = 0,
.next = 0

View file

@ -564,13 +564,6 @@ grub_virtual_screen_setcolorstate (grub_term_color_state state)
}
}
static void
grub_virtual_screen_setcolor (grub_uint8_t normal_color __attribute__ ((unused)),
grub_uint8_t highlight_color __attribute__ ((unused)))
{
/* FIXME */
}
static void
grub_vesafb_setcursor (int on)
{
@ -599,7 +592,6 @@ static struct grub_term grub_vesafb_term =
.gotoxy = grub_vesafb_gotoxy,
.cls = grub_vesafb_cls,
.setcolorstate = grub_virtual_screen_setcolorstate,
.setcolor = grub_virtual_screen_setcolor,
.setcursor = grub_vesafb_setcursor,
.flags = 0,
.next = 0

View file

@ -459,13 +459,6 @@ grub_vga_setcolorstate (grub_term_color_state state)
}
}
static void
grub_vga_setcolor (grub_uint8_t normal_color __attribute__ ((unused)),
grub_uint8_t highlight_color __attribute__ ((unused)))
{
/* FIXME */
}
static void
grub_vga_setcursor (int on)
{
@ -494,7 +487,6 @@ static struct grub_term grub_vga_term =
.gotoxy = grub_vga_gotoxy,
.cls = grub_vga_cls,
.setcolorstate = grub_vga_setcolorstate,
.setcolor = grub_vga_setcolor,
.setcursor = grub_vga_setcursor,
.flags = 0,
.next = 0

View file

@ -129,6 +129,13 @@ grub_ofconsole_setcolor (grub_uint8_t normal_color,
bgcolor = highlight_color;
}
static void
grub_ofconsole_getcolor (grub_uint8_t *normal_color, grub_uint8_t *highlight_color)
{
*normal_color = fgcolor;
*highlight_color = bgcolor;
}
static int
grub_ofconsole_readkey (int *key)
{
@ -364,6 +371,7 @@ static struct grub_term grub_ofconsole_term =
.cls = grub_ofconsole_cls,
.setcolorstate = grub_ofconsole_setcolorstate,
.setcolor = grub_ofconsole_setcolor,
.getcolor = grub_ofconsole_getcolor,
.setcursor = grub_ofconsole_setcursor,
.refresh = grub_ofconsole_refresh,
.flags = 0,