2005-09-03 16:54:27 +00:00
|
|
|
/*
|
|
|
|
* GRUB -- GRand Unified Bootloader
|
2007-07-21 23:32:33 +00:00
|
|
|
* Copyright (C) 2002,2003,2005,2007 Free Software Foundation, Inc.
|
2005-09-03 16:54:27 +00:00
|
|
|
*
|
2007-07-21 23:32:33 +00:00
|
|
|
* GRUB is free software: you can redistribute it and/or modify
|
2005-09-03 16:54:27 +00:00
|
|
|
* it under the terms of the GNU General Public License as published by
|
2007-07-21 23:32:33 +00:00
|
|
|
* the Free Software Foundation, either version 3 of the License, or
|
2005-09-03 16:54:27 +00:00
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
2007-07-21 23:32:33 +00:00
|
|
|
* GRUB is distributed in the hope that it will be useful,
|
2005-09-03 16:54:27 +00:00
|
|
|
* 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
|
2007-07-21 23:32:33 +00:00
|
|
|
* along with GRUB. If not, see <http://www.gnu.org/licenses/>.
|
2005-09-03 16:54:27 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef GRUB_TERMINFO_HEADER
|
|
|
|
#define GRUB_TERMINFO_HEADER 1
|
|
|
|
|
|
|
|
#include <grub/err.h>
|
|
|
|
#include <grub/types.h>
|
2009-12-24 22:20:43 +00:00
|
|
|
#include <grub/term.h>
|
2005-09-03 16:54:27 +00:00
|
|
|
|
2010-05-07 13:44:43 +00:00
|
|
|
char *EXPORT_FUNC(grub_terminfo_get_current) (struct grub_term_output *term);
|
|
|
|
grub_err_t EXPORT_FUNC(grub_terminfo_set_current) (struct grub_term_output *term,
|
|
|
|
const char *);
|
2005-09-03 16:54:27 +00:00
|
|
|
|
2011-05-13 14:38:23 +00:00
|
|
|
#define GRUB_TERMINFO_READKEY_MAX_LEN 6
|
2010-05-07 13:44:43 +00:00
|
|
|
struct grub_terminfo_input_state
|
|
|
|
{
|
|
|
|
int input_buf[GRUB_TERMINFO_READKEY_MAX_LEN];
|
|
|
|
int npending;
|
2012-09-14 10:23:36 +00:00
|
|
|
#if defined(__powerpc__) && defined(GRUB_MACHINE_IEEE1275)
|
2012-06-20 20:19:26 +00:00
|
|
|
int last_key;
|
|
|
|
grub_uint64_t last_key_time;
|
|
|
|
#endif
|
2010-07-17 23:37:19 +00:00
|
|
|
int (*readkey) (struct grub_term_input *term);
|
2010-05-07 13:44:43 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
struct grub_terminfo_output_state
|
|
|
|
{
|
|
|
|
struct grub_term_output *next;
|
|
|
|
|
|
|
|
char *name;
|
|
|
|
|
|
|
|
char *gotoxy;
|
|
|
|
char *cls;
|
|
|
|
char *reverse_video_on;
|
|
|
|
char *reverse_video_off;
|
|
|
|
char *cursor_on;
|
|
|
|
char *cursor_off;
|
|
|
|
char *setcolor;
|
|
|
|
|
2010-09-20 14:27:33 +00:00
|
|
|
unsigned int width, height;
|
|
|
|
|
2010-05-07 13:44:43 +00:00
|
|
|
unsigned int xpos, ypos;
|
|
|
|
|
2010-07-17 23:37:19 +00:00
|
|
|
void (*put) (struct grub_term_output *term, const int c);
|
2010-05-07 13:44:43 +00:00
|
|
|
};
|
|
|
|
|
2011-01-05 11:23:06 +00:00
|
|
|
grub_err_t EXPORT_FUNC(grub_terminfo_output_init) (struct grub_term_output *term);
|
2010-05-07 13:44:43 +00:00
|
|
|
void EXPORT_FUNC(grub_terminfo_gotoxy) (grub_term_output_t term,
|
|
|
|
grub_uint8_t x, grub_uint8_t y);
|
|
|
|
void EXPORT_FUNC(grub_terminfo_cls) (grub_term_output_t term);
|
|
|
|
grub_uint16_t EXPORT_FUNC (grub_terminfo_getxy) (struct grub_term_output *term);
|
|
|
|
void EXPORT_FUNC (grub_terminfo_setcursor) (struct grub_term_output *term,
|
|
|
|
const int on);
|
|
|
|
void EXPORT_FUNC (grub_terminfo_setcolorstate) (struct grub_term_output *term,
|
|
|
|
const grub_term_color_state state);
|
|
|
|
|
|
|
|
|
|
|
|
grub_err_t EXPORT_FUNC (grub_terminfo_input_init) (struct grub_term_input *term);
|
|
|
|
int EXPORT_FUNC (grub_terminfo_getkey) (struct grub_term_input *term);
|
|
|
|
void EXPORT_FUNC (grub_terminfo_putchar) (struct grub_term_output *term,
|
|
|
|
const struct grub_unicode_glyph *c);
|
2010-09-20 14:27:33 +00:00
|
|
|
grub_uint16_t EXPORT_FUNC (grub_terminfo_getwh) (struct grub_term_output *term);
|
|
|
|
|
2010-05-07 13:44:43 +00:00
|
|
|
|
|
|
|
grub_err_t EXPORT_FUNC (grub_terminfo_output_register) (struct grub_term_output *term,
|
|
|
|
const char *type);
|
|
|
|
grub_err_t EXPORT_FUNC (grub_terminfo_output_unregister) (struct grub_term_output *term);
|
2010-05-06 19:11:59 +00:00
|
|
|
|
2012-02-26 23:28:45 +00:00
|
|
|
void grub_terminfo_init (void);
|
|
|
|
void grub_terminfo_fini (void);
|
|
|
|
|
2005-09-03 16:54:27 +00:00
|
|
|
#endif /* ! GRUB_TERMINFO_HEADER */
|