Move gfxmenu color handling to video, so that gfxterm can use it

too.

* grub-core/gfxmenu/named_colors.c: Move to ...
* grub-core/video/colors.c: ... here.  Rename
grub_gui_get_named_color to grub_video_get_named_color.
* grub-core/gfxmenu/gui_string_util.c (my_isxdigit): Move to ...
* grub-core/video/colors.c (my_isxdigit): ... here.
* grub-core/gfxmenu/gui_string_util.c (parse_hex_color_component):
Move to ...
* grub-core/video/colors.c (parse_hex_color_component): ... here.
* grub-core/gfxmenu/gui_string_util.c (grub_gui_parse_color): Move
to ...
* grub-core/video/colors.c (grub_video_parse_color): ... here.

* include/grub/gui.h (grub_gui_color_t): Move to ...
* include/grub/video.h (grub_video_rgba_color_t): ... here.
* include/grub/gui.h (grub_gui_color_rgb): Move to ...
* include/grub/video.h (grub_video_rgba_color_rgb): ... here.
* include/grub/gui.h (grub_gui_map_color): Move to ...
* include/grub/video.h (grub_video_map_rgba_color): ... here.
* include/grub/gui_string_util.h (grub_gui_get_named_color): Move
to ...
* include/grub/video.h (grub_video_get_named_color): ... here.
* include/grub/gui_string_util.h (grub_gui_parse_color): Move to ...
* include/grub/video.h (grub_video_parse_color): ... here.

* grub-core/Makefile.core.def (kernel) [videoinkernel]: Add
video/colors.c.
(gfxmenu): Remove gfxmenu/named_colors.c.
(video_colors) [videomodules]: New module, containing
video/colors.c.
This commit is contained in:
Colin Watson 2010-12-10 16:45:58 +00:00
parent 5367ecd305
commit 52832c554c
13 changed files with 240 additions and 198 deletions

View file

@ -50,8 +50,8 @@ grub_gfxmenu_view_new (const char *theme_path,
{
grub_gfxmenu_view_t view;
grub_font_t default_font;
grub_gui_color_t default_fg_color;
grub_gui_color_t default_bg_color;
grub_video_rgba_color_t default_fg_color;
grub_video_rgba_color_t default_bg_color;
view = grub_malloc (sizeof (*view));
if (! view)
@ -63,8 +63,8 @@ grub_gfxmenu_view_new (const char *theme_path,
view->screen.height = height;
default_font = grub_font_get ("Unknown Regular 16");
default_fg_color = grub_gui_color_rgb (0, 0, 0);
default_bg_color = grub_gui_color_rgb (255, 255, 255);
default_fg_color = grub_video_rgba_color_rgb (0, 0, 0);
default_bg_color = grub_video_rgba_color_rgb (255, 255, 255);
view->canvas = 0;
@ -131,7 +131,7 @@ redraw_background (grub_gfxmenu_view_t view,
}
else
{
grub_video_fill_rect (grub_gui_map_color (view->desktop_color),
grub_video_fill_rect (grub_video_map_rgba_color (view->desktop_color),
bounds->x, bounds->y,
bounds->width, bounds->height);
}
@ -150,7 +150,7 @@ draw_title (grub_gfxmenu_view_t view)
int y = 40 + grub_font_get_ascent (view->title_font);
grub_font_draw_string (view->title_text,
view->title_font,
grub_gui_map_color (view->title_color),
grub_video_map_rgba_color (view->title_color),
x, y);
}
@ -244,13 +244,13 @@ draw_message (grub_gfxmenu_view_t view)
return;
grub_font_t font = view->message_font;
grub_video_color_t color = grub_gui_map_color (view->message_color);
grub_video_color_t color = grub_video_map_rgba_color (view->message_color);
/* Border. */
grub_video_fill_rect (color,
f.x-1, f.y-1, f.width+2, f.height+2);
/* Fill. */
grub_video_fill_rect (grub_gui_map_color (view->message_bg_color),
grub_video_fill_rect (grub_video_map_rgba_color (view->message_bg_color),
f.x, f.y, f.width, f.height);
/* Center the text. */