1N/A/* term_console.c - console input and output */
1N/A/*
1N/A * GRUB -- GRand Unified Bootloader
1N/A * Copyright (C) 2002 Free Software Foundation, Inc.
1N/A *
1N/A * This program is free software; you can redistribute it and/or modify
1N/A * it under the terms of the GNU General Public License as published by
1N/A * the Free Software Foundation; either version 2 of the License, or
1N/A * (at your option) any later version.
1N/A *
1N/A * This program is distributed in the hope that it will be useful,
1N/A * but WITHOUT ANY WARRANTY; without even the implied warranty of
1N/A * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1N/A * GNU General Public License for more details.
1N/A *
1N/A * You should have received a copy of the GNU General Public License
1N/A * along with this program; if not, write to the Free Software
1N/A * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
1N/A */
1N/A
1N/A#include <shared.h>
1N/A#include <term.h>
1N/A
1N/A/* These functions are defined in asm.S instead of this file:
1N/A console_putchar, console_checkkey, console_getkey, console_getxy,
1N/A console_gotoxy, console_cls, and console_nocursor. */
1N/A
1N/Aint console_current_color = A_NORMAL;
1N/Astatic int console_standard_color = A_NORMAL;
1N/Astatic int console_normal_color = A_NORMAL;
1N/Astatic int console_highlight_color = A_REVERSE;
1N/Astatic color_state console_color_state = COLOR_STATE_STANDARD;
1N/A
1N/Avoid
1N/Aconsole_setcolorstate (color_state state)
1N/A{
1N/A switch (state) {
1N/A case COLOR_STATE_STANDARD:
1N/A console_current_color = console_standard_color;
1N/A break;
1N/A case COLOR_STATE_NORMAL:
1N/A console_current_color = console_normal_color;
1N/A break;
1N/A case COLOR_STATE_HIGHLIGHT:
1N/A console_current_color = console_highlight_color;
1N/A break;
1N/A default:
1N/A console_current_color = console_standard_color;
1N/A break;
1N/A }
1N/A
1N/A console_color_state = state;
1N/A}
1N/A
1N/Avoid
1N/Aconsole_setcolor (int normal_color, int highlight_color)
1N/A{
1N/A console_normal_color = normal_color;
1N/A console_highlight_color = highlight_color;
1N/A
1N/A console_setcolorstate (console_color_state);
1N/A}