28
28
struct grub_term_output *grub_term_outputs;
29
29
struct grub_term_input *grub_term_inputs;
31
void (*grub_newline_hook) (void) = NULL;
33
31
/* Put a Unicode character. */
35
grub_putcode (grub_uint32_t code, struct grub_term_output *term)
33
grub_putcode_dumb (grub_uint32_t code,
34
struct grub_term_output *term)
36
struct grub_unicode_glyph c =
37
46
if (code == '\t' && term->getxy)
41
n = 8 - ((term->getxy () >> 8) & 7);
50
n = 8 - ((term->getxy (term) >> 8) & 7);
43
grub_putcode (' ', term);
52
grub_putcode_dumb (' ', term);
48
(term->putchar) (code);
57
(term->putchar) (term, &c);
50
(term->putchar) ('\r');
59
grub_putcode_dumb ('\r', term);
53
/* Put a character. C is one byte of a UTF-8 stream.
54
This function gathers bytes until a valid Unicode character is found. */
63
grub_xputs_dumb (const char *str)
58
static grub_size_t size = 0;
59
static grub_uint8_t buf[6];
65
while (grub_utf8_to_ucs4 (&code, 1, buf, size, (const grub_uint8_t **) &rest)
68
struct grub_term_output *term;
70
grub_memmove (buf, rest, size);
67
grub_term_output_t term;
68
grub_uint32_t code = *str;
71
72
FOR_ACTIVE_TERM_OUTPUTS(term)
72
grub_putcode (code, term);
73
if (code == '\n' && grub_newline_hook)
73
grub_putcode_dumb (code, term);
77
void (*grub_xputs) (const char *str) = grub_xputs_dumb;
119
120
FOR_ACTIVE_TERM_INPUTS(term)
121
122
if (term->getkeystatus)
122
status |= term->getkeystatus ();
123
status |= term->getkeystatus (term);
131
struct grub_term_output *term;
133
FOR_ACTIVE_TERM_OUTPUTS(term)
135
if ((term->flags & GRUB_TERM_DUMB) || (grub_env_get ("debug")))
137
grub_putcode ('\n', term);
138
grub_term_refresh (term);
146
grub_setcolorstate (grub_term_color_state state)
148
struct grub_term_output *term;
150
FOR_ACTIVE_TERM_OUTPUTS(term)
151
grub_term_setcolorstate (term, state);
155
130
grub_refresh (void)
157
132
struct grub_term_output *term;