/* console.c -- Ncurses console for GRUB. */
/*
* GRUB -- GRand Unified Bootloader
* Copyright (C) 2003,2005,2007,2008 Free Software Foundation, Inc.
*
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* GRUB is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with GRUB. If not, see <http://www.gnu.org/licenses/>.
*/
#include <config.h>
#include <config-util.h>
/* For compatibility. */
#ifndef A_NORMAL
# define A_NORMAL 0
#endif /* ! A_NORMAL */
#ifndef A_STANDOUT
# define A_STANDOUT 0
#endif /* ! A_STANDOUT */
#if defined(HAVE_NCURSES_CURSES_H)
#elif defined(HAVE_NCURSES_H)
# include <ncurses.h>
#elif defined(HAVE_CURSES_H)
# include <curses.h>
#else
#endif
{
};
static int use_color;
static void
const struct grub_unicode_glyph *c)
{
}
static void
{
switch (state)
{
case GRUB_TERM_COLOR_STANDARD:
break;
case GRUB_TERM_COLOR_NORMAL:
break;
break;
default:
break;
}
if (use_color)
{
}
}
static int
{
int c;
c = getch ();
switch (c)
{
case ERR:
return GRUB_TERM_NO_KEY;
case KEY_LEFT:
c = GRUB_TERM_KEY_LEFT;
break;
case KEY_RIGHT:
c = GRUB_TERM_KEY_RIGHT;
break;
case KEY_UP:
c = GRUB_TERM_KEY_UP;
break;
case KEY_DOWN:
c = GRUB_TERM_KEY_DOWN;
break;
case KEY_IC:
c = 24;
break;
case KEY_DC:
c = GRUB_TERM_KEY_DC;
break;
case KEY_BACKSPACE:
/* XXX: For some reason ncurses on xterm does not return
KEY_BACKSPACE. */
case 127:
c = '\b';
break;
case KEY_HOME:
c = GRUB_TERM_KEY_HOME;
break;
case KEY_END:
c = GRUB_TERM_KEY_END;
break;
case KEY_NPAGE:
c = GRUB_TERM_KEY_NPAGE;
break;
case KEY_PPAGE:
c = GRUB_TERM_KEY_PPAGE;
break;
}
return c;
}
static grub_uint16_t
{
int x;
int y;
return (x << 8) | y;
}
static grub_uint16_t
{
int x;
int y;
return (x << 8) | y;
}
static void
grub_uint8_t x, grub_uint8_t y)
{
move (y, x);
}
static void
{
clear ();
refresh ();
}
static void
int on)
{
}
static void
{
refresh ();
}
static grub_err_t
{
initscr ();
raw ();
noecho ();
nonl ();
if (has_colors ())
{
start_color ();
{
int i, j, n;
n = 0;
for (i = 0; i < NUM_COLORS; i++)
for (j = 0; j < NUM_COLORS; j++)
use_color = 1;
}
}
return 0;
}
static grub_err_t
{
endwin ();
return 0;
}
{
.name = "console",
};
{
.name = "console",
.cls = grub_ncurses_cls,
};
void
grub_console_init (void)
{
}
void
grub_console_fini (void)
{
}