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:
parent
5367ecd305
commit
52832c554c
13 changed files with 240 additions and 198 deletions
|
@ -41,9 +41,9 @@ struct grub_gui_list_impl
|
|||
int item_spacing;
|
||||
grub_font_t item_font;
|
||||
grub_font_t selected_item_font;
|
||||
grub_gui_color_t item_color;
|
||||
grub_video_rgba_color_t item_color;
|
||||
int selected_item_color_set;
|
||||
grub_gui_color_t selected_item_color;
|
||||
grub_video_rgba_color_t selected_item_color;
|
||||
|
||||
int draw_scrollbar;
|
||||
int need_to_recreate_scrollbar;
|
||||
|
@ -267,13 +267,13 @@ draw_menu (list_impl_t self, int num_shown_items)
|
|||
(is_selected && self->selected_item_font
|
||||
? self->selected_item_font
|
||||
: self->item_font);
|
||||
grub_gui_color_t text_color =
|
||||
grub_video_rgba_color_t text_color =
|
||||
((is_selected && self->selected_item_color_set)
|
||||
? self->selected_item_color
|
||||
: self->item_color);
|
||||
grub_font_draw_string (item_title,
|
||||
font,
|
||||
grub_gui_map_color (text_color),
|
||||
grub_video_map_rgba_color (text_color),
|
||||
sel_leftpad + self->icon_width + icon_text_space,
|
||||
(item_top + (item_height - (ascent + descent))
|
||||
/ 2 + ascent));
|
||||
|
@ -429,7 +429,7 @@ list_set_property (void *vself, const char *name, const char *value)
|
|||
}
|
||||
else if (grub_strcmp (name, "item_color") == 0)
|
||||
{
|
||||
grub_gui_parse_color (value, &self->item_color);
|
||||
grub_video_parse_color (value, &self->item_color);
|
||||
}
|
||||
else if (grub_strcmp (name, "selected_item_color") == 0)
|
||||
{
|
||||
|
@ -439,7 +439,7 @@ list_set_property (void *vself, const char *name, const char *value)
|
|||
}
|
||||
else
|
||||
{
|
||||
if (grub_gui_parse_color (value, &self->selected_item_color)
|
||||
if (grub_video_parse_color (value, &self->selected_item_color)
|
||||
== GRUB_ERR_NONE)
|
||||
self->selected_item_color_set = 1;
|
||||
}
|
||||
|
@ -562,7 +562,7 @@ grub_gui_list_new (void)
|
|||
{
|
||||
list_impl_t self;
|
||||
grub_font_t default_font;
|
||||
grub_gui_color_t default_fg_color;
|
||||
grub_video_rgba_color_t default_fg_color;
|
||||
|
||||
self = grub_zalloc (sizeof (*self));
|
||||
if (! self)
|
||||
|
@ -574,7 +574,7 @@ grub_gui_list_new (void)
|
|||
self->visible = 1;
|
||||
|
||||
default_font = grub_font_get ("Unknown Regular 16");
|
||||
default_fg_color = grub_gui_color_rgb (0, 0, 0);
|
||||
default_fg_color = grub_video_rgba_color_rgb (0, 0, 0);
|
||||
|
||||
self->icon_width = 32;
|
||||
self->icon_height = 32;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue