2008-01-01 Vesa Jaaskelainen <chaac@nic.fi>
* include/grub/video.h: Added grub_video_unmap_color and grub_video_get_active_render_target. (grub_video_adapter): Added unmap_color and get_active_render_target. * video/video.c: Added grub_video_unmap_color and grub_video_get_active_render_target. (grub_video_get_info): Changed method to accept NULL pointer as an argument to allow detection of active video adapter. * video/i386/pc/vbe.c: Renamed grub_video_vbe_unmap_color as grub_video_vbe_unmap_color_int. Added grub_video_vbe_unmap_color and grub_video_vbe_get_active_render_target. (grub_video_vbe_adapter): Added unmap_color and get_active_render_target. * video/i386/pc/vbeblit.c: Replaced grub_video_vbe_unmap_color usage with grub_video_vbe_unmap_color_int. * term/gfxterm.c (DEFAULT_STANDARD_COLOR): Added. (DEFAULT_NORMAL_COLOR): Likewise. (DEFAULT_HIGHLIGHT_COLOR) Likewise. (DEFAULT_FG_COLOR): Removed. (DEFAULT_BG_COLOR): Likewise. (DEFAULT_CURSOR_COLOR): Changed value. (grub_virtual_screen): Added standard_color_setting, normal_color_setting, highlight_color_setting and term_color. (grub_virtual_screen): Removed fg_color_setting and bg_color_setting. (bitmap_width): Added. (bitmap_height): Likewise. (bitmap): Likewise. (set_term_color): Likewise. (grub_virtual_screen_setup): Changed to use new terminal coloring settings. (grub_gfxterm_init): Added init for bitmap. (grub_gfxterm_fini): Added destroy for bitmap. (redraw_screen_rect): Updated to use background bitmap and new terminal coloring. (scroll_up): Added optimization for case when there is no bitmap. (grub_gfxterm_cls): Fixed to use correct background color. (grub_virtual_screen_setcolorstate): Changed to use new terminal coloring. (grub_virtual_screen_setcolor): Likewise. (grub_virtual_screen_getcolor): Added. (grub_gfxterm_background_image_cmd): Likewise. (grub_video_term): Added setcolor and getcolor. (MOD_INIT): Added registration of background_image command. (MOD_TERM): Added unregistration for background_image command.
This commit is contained in:
parent
df26671616
commit
dbfdce36f1
7 changed files with 380 additions and 42 deletions
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
* GRUB -- GRand Unified Bootloader
|
||||
* Copyright (C) 2006,2007 Free Software Foundation, Inc.
|
||||
* Copyright (C) 2006,2007,2008 Free Software Foundation, Inc.
|
||||
*
|
||||
* GRUB is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
@ -134,6 +134,13 @@ grub_video_get_info (struct grub_video_mode_info *mode_info)
|
|||
if (! grub_video_adapter_active)
|
||||
return grub_error (GRUB_ERR_BAD_DEVICE, "No video mode activated");
|
||||
|
||||
/* If mode_info is NULL just report that video adapter is active. */
|
||||
if (! mode_info)
|
||||
{
|
||||
grub_errno = GRUB_ERR_NONE;
|
||||
return grub_errno;
|
||||
}
|
||||
|
||||
return grub_video_adapter_active->get_info (mode_info);
|
||||
}
|
||||
|
||||
|
@ -260,6 +267,22 @@ grub_video_map_rgba (grub_uint8_t red, grub_uint8_t green, grub_uint8_t blue,
|
|||
return grub_video_adapter_active->map_rgba (red, green, blue, alpha);
|
||||
}
|
||||
|
||||
/* Unmap video color back to RGBA components. */
|
||||
grub_err_t
|
||||
grub_video_unmap_color (grub_video_color_t color, grub_uint8_t *red,
|
||||
grub_uint8_t *green, grub_uint8_t *blue,
|
||||
grub_uint8_t *alpha)
|
||||
{
|
||||
if (! grub_video_adapter_active)
|
||||
return grub_error (GRUB_ERR_BAD_DEVICE, "No video mode activated");
|
||||
|
||||
return grub_video_adapter_active->unmap_color (color,
|
||||
red,
|
||||
green,
|
||||
blue,
|
||||
alpha);
|
||||
}
|
||||
|
||||
/* Fill rectangle using specified color. */
|
||||
grub_err_t
|
||||
grub_video_fill_rect (grub_video_color_t color, int x, int y,
|
||||
|
@ -366,6 +389,16 @@ grub_video_set_active_render_target (struct grub_video_render_target *target)
|
|||
return grub_video_adapter_active->set_active_render_target (target);
|
||||
}
|
||||
|
||||
/* Get active render target. */
|
||||
grub_err_t
|
||||
grub_video_get_active_render_target (struct grub_video_render_target **target)
|
||||
{
|
||||
if (! grub_video_adapter_active)
|
||||
return grub_error (GRUB_ERR_BAD_DEVICE, "No video mode activated");
|
||||
|
||||
return grub_video_adapter_active->get_active_render_target (target);
|
||||
}
|
||||
|
||||
/* Initialize Video API module. */
|
||||
GRUB_MOD_INIT(video_video)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue