2
* GRUB -- GRand Unified Bootloader
3
* Copyright (C) 2002,2003,2005,2007,2008,2009 Free Software Foundation, Inc.
5
* GRUB is free software: you can redistribute it and/or modify
6
* it under the terms of the GNU General Public License as published by
7
* the Free Software Foundation, either version 3 of the License, or
8
* (at your option) any later version.
10
* GRUB is distributed in the hope that it will be useful,
11
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
* GNU General Public License for more details.
15
* You should have received a copy of the GNU General Public License
16
* along with GRUB. If not, see <http://www.gnu.org/licenses/>.
19
#include <grub/term.h>
22
#include <grub/misc.h>
24
#include <grub/time.h>
26
struct grub_term_output *grub_term_outputs_disabled;
27
struct grub_term_input *grub_term_inputs_disabled;
28
struct grub_term_output *grub_term_outputs;
29
struct grub_term_input *grub_term_inputs;
31
/* Put a Unicode character. */
33
grub_putcode_dumb (grub_uint32_t code,
34
struct grub_term_output *term)
36
struct grub_unicode_glyph c =
46
if (code == '\t' && term->getxy)
50
n = 8 - ((term->getxy (term) >> 8) & 7);
52
grub_putcode_dumb (' ', term);
57
(term->putchar) (term, &c);
59
grub_putcode_dumb ('\r', term);
63
grub_xputs_dumb (const char *str)
67
grub_term_output_t term;
68
grub_uint32_t code = *str;
72
FOR_ACTIVE_TERM_OUTPUTS(term)
73
grub_putcode_dumb (code, term);
77
void (*grub_xputs) (const char *str) = grub_xputs_dumb;
82
grub_term_input_t term;
88
FOR_ACTIVE_TERM_INPUTS(term)
90
int key = term->checkkey (term);
92
return term->getkey (term);
102
grub_term_input_t term;
104
FOR_ACTIVE_TERM_INPUTS(term)
106
int key = term->checkkey (term);
115
grub_getkeystatus (void)
118
grub_term_input_t term;
120
FOR_ACTIVE_TERM_INPUTS(term)
122
if (term->getkeystatus)
123
status |= term->getkeystatus (term);
132
struct grub_term_output *term;
134
FOR_ACTIVE_TERM_OUTPUTS(term)
135
grub_term_refresh (term);