~hamo/ubuntu/precise/grub2/grub2.hi_res

« back to all changes in this revision

Viewing changes to include/grub/term.h

  • Committer: Bazaar Package Importer
  • Author(s): Colin Watson, Colin Watson, Robert Millan, Updated translations
  • Date: 2010-11-22 12:24:56 UTC
  • mfrom: (1.26.4 upstream) (17.3.36 sid)
  • mto: (17.3.43 sid)
  • mto: This revision was merged to the branch mainline in revision 89.
  • Revision ID: james.westby@ubuntu.com-20101122122456-y82z3sfb7k4zfdcc
Tags: 1.99~20101122-1
[ Colin Watson ]
* New Bazaar snapshot.  Too many changes to list in full, but some of the
  more user-visible ones are as follows:
  - GRUB script:
    + Function parameters, "break", "continue", "shift", "setparams",
      "return", and "!".
    + "export" command supports multiple variable names.
    + Multi-line quoted strings support.
    + Wildcard expansion.
  - sendkey support.
  - USB hotunplugging and USB serial support.
  - Rename CD-ROM to cd on BIOS.
  - Add new --boot-directory option to grub-install, grub-reboot, and
    grub-set-default; the old --root-directory option is still accepted
    but was often confusing.
  - Basic btrfs detection/UUID support (but no file reading yet).
  - bash-completion for utilities.
  - If a device is listed in device.map, always assume that it is
    BIOS-visible rather than using extra layers such as LVM or RAID.
  - Add grub-mknetdir script (closes: #550658).
  - Remove deprecated "root" command.
  - Handle RAID devices containing virtio components.
  - GRUB Legacy configuration file support (via grub-menulst2cfg).
  - Keyboard layout support (via grub-mklayout and grub-kbdcomp).
  - Check generated grub.cfg for syntax errors before saving.
  - Pause execution for at most ten seconds if any errors are displayed,
    so that the user has a chance to see them.
  - Support submenus.
  - Write embedding zone using Reed-Solomon, so that it's robust against
    being partially overwritten (closes: #550702, #591416, #593347).
  - GRUB_DISABLE_LINUX_RECOVERY and GRUB_DISABLE_NETBSD_RECOVERY merged
    into a single GRUB_DISABLE_RECOVERY variable.
  - Fix loader memory allocation failure (closes: #551627).
  - Don't call savedefault on recovery entries (closes: #589325).
  - Support triple-indirect blocks on ext2 (closes: #543924).
  - Recognise DDF1 fake RAID (closes: #603354).

[ Robert Millan ]
* Use dpkg architecture wildcards.

[ Updated translations ]
* Slovenian (Vanja Cvelbar).  Closes: #604003
* Dzongkha (dawa pemo via Tenzin Dendup).  Closes: #604102

Show diffs side-by-side

added added

removed removed

Lines of Context:
19
19
#ifndef GRUB_TERM_HEADER
20
20
#define GRUB_TERM_HEADER        1
21
21
 
 
22
#define GRUB_TERM_NO_KEY        0
 
23
 
22
24
/* Internal codes used by GRUB to represent terminal input.  */
23
 
#define GRUB_TERM_LEFT          2
24
 
#define GRUB_TERM_RIGHT         6
25
 
#define GRUB_TERM_UP            16
26
 
#define GRUB_TERM_DOWN          14
27
 
#define GRUB_TERM_HOME          1
28
 
#define GRUB_TERM_END           5
29
 
#define GRUB_TERM_DC            4
30
 
#define GRUB_TERM_PPAGE         7
31
 
#define GRUB_TERM_NPAGE         3
 
25
/* Only for keys otherwise not having shifted modification.  */
 
26
#define GRUB_TERM_SHIFT         0x01000000
 
27
#define GRUB_TERM_CTRL          0x02000000
 
28
#define GRUB_TERM_ALT           0x04000000
 
29
 
 
30
/* Keys without associated character.  */
 
31
#define GRUB_TERM_EXTENDED      0x00800000
 
32
#define GRUB_TERM_KEY_MASK      0x00ffffff
 
33
 
 
34
#define GRUB_TERM_KEY_LEFT      (GRUB_TERM_EXTENDED | 0x4b)
 
35
#define GRUB_TERM_KEY_RIGHT     (GRUB_TERM_EXTENDED | 0x4d)
 
36
#define GRUB_TERM_KEY_UP        (GRUB_TERM_EXTENDED | 0x48)
 
37
#define GRUB_TERM_KEY_DOWN      (GRUB_TERM_EXTENDED | 0x50)
 
38
#define GRUB_TERM_KEY_HOME      (GRUB_TERM_EXTENDED | 0x47)
 
39
#define GRUB_TERM_KEY_END       (GRUB_TERM_EXTENDED | 0x4f)
 
40
#define GRUB_TERM_KEY_DC        (GRUB_TERM_EXTENDED | 0x53)
 
41
#define GRUB_TERM_KEY_PPAGE     (GRUB_TERM_EXTENDED | 0x49)
 
42
#define GRUB_TERM_KEY_NPAGE     (GRUB_TERM_EXTENDED | 0x51)
 
43
#define GRUB_TERM_KEY_F1        (GRUB_TERM_EXTENDED | 0x3b)
 
44
#define GRUB_TERM_KEY_F2        (GRUB_TERM_EXTENDED | 0x3c)
 
45
#define GRUB_TERM_KEY_F3        (GRUB_TERM_EXTENDED | 0x3d)
 
46
#define GRUB_TERM_KEY_F4        (GRUB_TERM_EXTENDED | 0x3e)
 
47
#define GRUB_TERM_KEY_F5        (GRUB_TERM_EXTENDED | 0x3f)
 
48
#define GRUB_TERM_KEY_F6        (GRUB_TERM_EXTENDED | 0x40)
 
49
#define GRUB_TERM_KEY_F7        (GRUB_TERM_EXTENDED | 0x41)
 
50
#define GRUB_TERM_KEY_F8        (GRUB_TERM_EXTENDED | 0x42)
 
51
#define GRUB_TERM_KEY_F9        (GRUB_TERM_EXTENDED | 0x43)
 
52
#define GRUB_TERM_KEY_F10       (GRUB_TERM_EXTENDED | 0x44)
 
53
#define GRUB_TERM_KEY_F11       (GRUB_TERM_EXTENDED | 0x57)
 
54
#define GRUB_TERM_KEY_F12       (GRUB_TERM_EXTENDED | 0x58)
 
55
#define GRUB_TERM_KEY_INSERT    (GRUB_TERM_EXTENDED | 0x52)
 
56
#define GRUB_TERM_KEY_CENTER    (GRUB_TERM_EXTENDED | 0x4c)
 
57
 
32
58
#define GRUB_TERM_ESC           '\e'
33
59
#define GRUB_TERM_TAB           '\t'
34
 
#define GRUB_TERM_BACKSPACE     8
 
60
#define GRUB_TERM_BACKSPACE     '\b'
35
61
 
36
62
#ifndef ASM_FILE
37
63
 
38
64
#include <grub/err.h>
39
65
#include <grub/symbol.h>
40
66
#include <grub/types.h>
41
 
#include <grub/handler.h>
 
67
#include <grub/unicode.h>
 
68
#include <grub/list.h>
42
69
 
43
70
/* These are used to represent the various color states we use.  */
44
71
typedef enum
63
90
   to NULL.  */
64
91
 
65
92
/* Set when input characters shouldn't be echoed back.  */
66
 
#define GRUB_TERM_NO_ECHO       (1 << 0)
 
93
#define GRUB_TERM_NO_ECHO               (1 << 0)
67
94
/* Set when the editing feature should be disabled.  */
68
 
#define GRUB_TERM_NO_EDIT       (1 << 1)
 
95
#define GRUB_TERM_NO_EDIT               (1 << 1)
69
96
/* Set when the terminal cannot do fancy things.  */
70
 
#define GRUB_TERM_DUMB          (1 << 2)
 
97
#define GRUB_TERM_DUMB                  (1 << 2)
 
98
/* Which encoding does terminal expect stream to be.  */
 
99
#define GRUB_TERM_CODE_TYPE_SHIFT       3
 
100
#define GRUB_TERM_CODE_TYPE_MASK                (7 << GRUB_TERM_CODE_TYPE_SHIFT)
 
101
/* Only ASCII characters accepted.  */
 
102
#define GRUB_TERM_CODE_TYPE_ASCII               (0 << GRUB_TERM_CODE_TYPE_SHIFT)
 
103
/* Expects CP-437 characters (ASCII + pseudographics).  */
 
104
#define GRUB_TERM_CODE_TYPE_CP437                       (1 << GRUB_TERM_CODE_TYPE_SHIFT)
 
105
/* UTF-8 stream in logical order. Usually used for terminals
 
106
   which just forward the stream to another computer.  */
 
107
#define GRUB_TERM_CODE_TYPE_UTF8_LOGICAL        (2 << GRUB_TERM_CODE_TYPE_SHIFT)
 
108
/* UTF-8 in visual order. Like UTF-8 logical but for buggy endpoints.  */
 
109
#define GRUB_TERM_CODE_TYPE_UTF8_VISUAL         (3 << GRUB_TERM_CODE_TYPE_SHIFT)
 
110
/* Glyph description in visual order.  */
 
111
#define GRUB_TERM_CODE_TYPE_VISUAL_GLYPHS       (4 << GRUB_TERM_CODE_TYPE_SHIFT)
71
112
 
72
113
 
73
114
/* Bitmasks for modifier keys returned by grub_getkeystatus.  */
74
 
#define GRUB_TERM_STATUS_SHIFT  (1 << 0)
75
 
#define GRUB_TERM_STATUS_CTRL   (1 << 1)
76
 
#define GRUB_TERM_STATUS_ALT    (1 << 2)
77
 
 
78
 
 
79
 
/* Unicode characters for fancy graphics.  */
80
 
#define GRUB_TERM_DISP_LEFT     0x2190
81
 
#define GRUB_TERM_DISP_UP       0x2191
82
 
#define GRUB_TERM_DISP_RIGHT    0x2192
83
 
#define GRUB_TERM_DISP_DOWN     0x2193
84
 
#define GRUB_TERM_DISP_HLINE    0x2501
85
 
#define GRUB_TERM_DISP_VLINE    0x2503
86
 
#define GRUB_TERM_DISP_UL       0x250F
87
 
#define GRUB_TERM_DISP_UR       0x2513
88
 
#define GRUB_TERM_DISP_LL       0x2517
89
 
#define GRUB_TERM_DISP_LR       0x251B
90
 
 
 
115
#define GRUB_TERM_STATUS_RSHIFT (1 << 0)
 
116
#define GRUB_TERM_STATUS_LSHIFT (1 << 1)
 
117
#define GRUB_TERM_STATUS_RCTRL  (1 << 2)
 
118
#define GRUB_TERM_STATUS_RALT   (1 << 3)
 
119
#define GRUB_TERM_STATUS_SCROLL (1 << 4)
 
120
#define GRUB_TERM_STATUS_NUM    (1 << 5)
 
121
#define GRUB_TERM_STATUS_CAPS   (1 << 6)
 
122
#define GRUB_TERM_STATUS_LCTRL  (1 << 8)
 
123
#define GRUB_TERM_STATUS_LALT   (1 << 9)
91
124
 
92
125
/* Menu-related geometrical constants.  */
93
126
 
122
155
  const char *name;
123
156
 
124
157
  /* Initialize the terminal.  */
125
 
  grub_err_t (*init) (void);
 
158
  grub_err_t (*init) (struct grub_term_input *term);
126
159
 
127
160
  /* Clean up the terminal.  */
128
 
  grub_err_t (*fini) (void);
129
 
 
130
 
  /* Check if any input character is available.  */
131
 
  int (*checkkey) (void);
132
 
 
133
 
  /* Get a character.  */
134
 
  int (*getkey) (void);
 
161
  grub_err_t (*fini) (struct grub_term_input *term);
 
162
 
 
163
  /* Get a character if any input character is available. Otherwise return -1  */
 
164
  int (*getkey) (struct grub_term_input *term);
135
165
 
136
166
  /* Get keyboard modifier status.  */
137
 
  int (*getkeystatus) (void);
 
167
  int (*getkeystatus) (struct grub_term_input *term);
 
168
 
 
169
  void *data;
138
170
};
139
171
typedef struct grub_term_input *grub_term_input_t;
140
172
 
147
179
  const char *name;
148
180
 
149
181
  /* Initialize the terminal.  */
150
 
  grub_err_t (*init) (void);
 
182
  grub_err_t (*init) (struct grub_term_output *term);
151
183
 
152
184
  /* Clean up the terminal.  */
153
 
  grub_err_t (*fini) (void);
 
185
  grub_err_t (*fini) (struct grub_term_output *term);
154
186
 
155
187
  /* Put a character. C is encoded in Unicode.  */
156
 
  void (*putchar) (grub_uint32_t c);
 
188
  void (*putchar) (struct grub_term_output *term,
 
189
                   const struct grub_unicode_glyph *c);
157
190
 
158
191
  /* Get the number of columns occupied by a given character C. C is
159
192
     encoded in Unicode.  */
160
 
  grub_ssize_t (*getcharwidth) (grub_uint32_t c);
 
193
  grub_ssize_t (*getcharwidth) (struct grub_term_output *term,
 
194
                                const struct grub_unicode_glyph *c);
161
195
 
162
196
  /* Get the screen size. The return value is ((Width << 8) | Height).  */
163
 
  grub_uint16_t (*getwh) (void);
 
197
  grub_uint16_t (*getwh) (struct grub_term_output *term);
164
198
 
165
199
  /* Get the cursor position. The return value is ((X << 8) | Y).  */
166
 
  grub_uint16_t (*getxy) (void);
 
200
  grub_uint16_t (*getxy) (struct grub_term_output *term);
167
201
 
168
202
  /* Go to the position (X, Y).  */
169
 
  void (*gotoxy) (grub_uint8_t x, grub_uint8_t y);
 
203
  void (*gotoxy) (struct grub_term_output *term,
 
204
                  grub_uint8_t x, grub_uint8_t y);
170
205
 
171
206
  /* Clear the screen.  */
172
 
  void (*cls) (void);
 
207
  void (*cls) (struct grub_term_output *term);
173
208
 
174
209
  /* Set the current color to be used */
175
 
  void (*setcolorstate) (grub_term_color_state state);
176
 
 
177
 
  /* Set the normal color and the highlight color. The format of each
178
 
     color is VGA's.  */
179
 
  void (*setcolor) (grub_uint8_t normal_color, grub_uint8_t highlight_color);
180
 
 
181
 
  /* Get the normal color and the highlight color. The format of each
182
 
     color is VGA's.  */
183
 
  void (*getcolor) (grub_uint8_t *normal_color, grub_uint8_t *highlight_color);
 
210
  void (*setcolorstate) (struct grub_term_output *term,
 
211
                         grub_term_color_state state);
184
212
 
185
213
  /* Turn on/off the cursor.  */
186
 
  void (*setcursor) (int on);
 
214
  void (*setcursor) (struct grub_term_output *term, int on);
187
215
 
188
216
  /* Update the screen.  */
189
 
  void (*refresh) (void);
 
217
  void (*refresh) (struct grub_term_output *term);
190
218
 
191
219
  /* The feature flags defined above.  */
192
220
  grub_uint32_t flags;
 
221
 
 
222
  /* Current color state.  */
 
223
  grub_uint8_t normal_color;
 
224
  grub_uint8_t highlight_color;
 
225
 
 
226
  void *data;
193
227
};
194
228
typedef struct grub_term_output *grub_term_output_t;
195
229
 
 
230
#define GRUB_TERM_DEFAULT_NORMAL_COLOR 0x07
 
231
#define GRUB_TERM_DEFAULT_HIGHLIGHT_COLOR 0x70
 
232
#define GRUB_TERM_DEFAULT_STANDARD_COLOR 0x07
 
233
 
196
234
extern struct grub_term_output *EXPORT_VAR(grub_term_outputs_disabled);
197
235
extern struct grub_term_input *EXPORT_VAR(grub_term_inputs_disabled);
198
236
extern struct grub_term_output *EXPORT_VAR(grub_term_outputs);
208
246
  else
209
247
    {
210
248
      /* If this is the first terminal, enable automatically.  */
211
 
      if (! term->init || term->init () == GRUB_ERR_NONE)
 
249
      if (! term->init || term->init (term) == GRUB_ERR_NONE)
212
250
        grub_list_push (GRUB_AS_LIST_P (&grub_term_inputs), GRUB_AS_LIST (term));
213
251
    }
214
252
}
215
253
 
216
254
static inline void
 
255
grub_term_register_input_active (const char *name __attribute__ ((unused)),
 
256
                                 grub_term_input_t term)
 
257
{
 
258
  if (! term->init || term->init (term) == GRUB_ERR_NONE)
 
259
    grub_list_push (GRUB_AS_LIST_P (&grub_term_inputs), GRUB_AS_LIST (term));
 
260
}
 
261
 
 
262
static inline void
217
263
grub_term_register_output (const char *name __attribute__ ((unused)),
218
264
                           grub_term_output_t term)
219
265
{
223
269
  else
224
270
    {
225
271
      /* If this is the first terminal, enable automatically.  */
226
 
      if (! term->init || term->init () == GRUB_ERR_NONE)
 
272
      if (! term->init || term->init (term) == GRUB_ERR_NONE)
227
273
        grub_list_push (GRUB_AS_LIST_P (&grub_term_outputs),
228
274
                        GRUB_AS_LIST (term));
229
275
    }
230
276
}
231
277
 
232
278
static inline void
 
279
grub_term_register_output_active (const char *name __attribute__ ((unused)),
 
280
                                  grub_term_output_t term)
 
281
{
 
282
  if (! term->init || term->init (term) == GRUB_ERR_NONE)
 
283
    grub_list_push (GRUB_AS_LIST_P (&grub_term_outputs),
 
284
                    GRUB_AS_LIST (term));
 
285
}
 
286
 
 
287
static inline void
233
288
grub_term_unregister_input (grub_term_input_t term)
234
289
{
235
290
  grub_list_remove (GRUB_AS_LIST_P (&grub_term_inputs), GRUB_AS_LIST (term));
245
300
                    GRUB_AS_LIST (term));
246
301
}
247
302
 
248
 
#define FOR_ACTIVE_TERM_INPUTS(var) for (var = grub_term_inputs; var; var = var->next)
249
 
#define FOR_DISABLED_TERM_INPUTS(var) for (var = grub_term_inputs_disabled; var; var = var->next)
250
 
#define FOR_ACTIVE_TERM_OUTPUTS(var) for (var = grub_term_outputs; var; var = var->next)
251
 
#define FOR_DISABLED_TERM_OUTPUTS(var) for (var = grub_term_outputs_disabled; var; var = var->next)
 
303
#define FOR_ACTIVE_TERM_INPUTS(var) FOR_LIST_ELEMENTS((var), (grub_term_inputs))
 
304
#define FOR_DISABLED_TERM_INPUTS(var) FOR_LIST_ELEMENTS((var), (grub_term_inputs_disabled))
 
305
#define FOR_ACTIVE_TERM_OUTPUTS(var) FOR_LIST_ELEMENTS((var), (grub_term_outputs))
 
306
#define FOR_DISABLED_TERM_OUTPUTS(var) FOR_LIST_ELEMENTS((var), (grub_term_outputs_disabled))
252
307
 
253
 
void EXPORT_FUNC(grub_putchar) (int c);
254
 
void EXPORT_FUNC(grub_putcode) (grub_uint32_t code,
255
 
                                struct grub_term_output *term);
 
308
void grub_putcode (grub_uint32_t code, struct grub_term_output *term);
256
309
int EXPORT_FUNC(grub_getkey) (void);
257
310
int EXPORT_FUNC(grub_checkkey) (void);
258
 
int EXPORT_FUNC(grub_getkeystatus) (void);
259
 
void EXPORT_FUNC(grub_cls) (void);
260
 
void EXPORT_FUNC(grub_setcolorstate) (grub_term_color_state state);
 
311
void grub_cls (void);
261
312
void EXPORT_FUNC(grub_refresh) (void);
262
313
void grub_puts_terminal (const char *str, struct grub_term_output *term);
263
314
grub_uint16_t *grub_term_save_pos (void);
265
316
 
266
317
static inline unsigned grub_term_width (struct grub_term_output *term)
267
318
{
268
 
  return ((term->getwh()&0xFF00)>>8);
 
319
  return ((term->getwh(term)&0xFF00)>>8);
269
320
}
270
321
 
271
322
static inline unsigned grub_term_height (struct grub_term_output *term)
272
323
{
273
 
  return (term->getwh()&0xFF);
 
324
  return (term->getwh(term)&0xFF);
274
325
}
275
326
 
276
327
/* The width of the border.  */
314
365
static inline grub_uint16_t
315
366
grub_term_getxy (struct grub_term_output *term)
316
367
{
317
 
  return term->getxy ();
 
368
  return term->getxy (term);
318
369
}
319
370
 
320
371
static inline void
321
372
grub_term_refresh (struct grub_term_output *term)
322
373
{
323
374
  if (term->refresh)
324
 
    term->refresh ();
 
375
    term->refresh (term);
325
376
}
326
377
 
327
378
static inline void
328
379
grub_term_gotoxy (struct grub_term_output *term, grub_uint8_t x, grub_uint8_t y)
329
380
{
330
 
  term->gotoxy (x, y);
 
381
  term->gotoxy (term, x, y);
331
382
}
332
383
 
333
384
static inline void 
335
386
                         grub_term_color_state state)
336
387
{
337
388
  if (term->setcolorstate)
338
 
    term->setcolorstate (state);
339
 
}
340
 
 
341
 
  /* Set the normal color and the highlight color. The format of each
342
 
     color is VGA's.  */
 
389
    term->setcolorstate (term, state);
 
390
}
 
391
 
 
392
static inline void
 
393
grub_setcolorstate (grub_term_color_state state)
 
394
{
 
395
  struct grub_term_output *term;
 
396
  
 
397
  FOR_ACTIVE_TERM_OUTPUTS(term)
 
398
    grub_term_setcolorstate (term, state);
 
399
}
 
400
 
 
401
/* Set the normal color and the highlight color. The format of each
 
402
   color is VGA's.  */
343
403
static inline void 
344
404
grub_term_setcolor (struct grub_term_output *term,
345
405
                    grub_uint8_t normal_color, grub_uint8_t highlight_color)
346
406
{
347
 
  if (term->setcolor)
348
 
    term->setcolor (normal_color, highlight_color);
 
407
  term->normal_color = normal_color;
 
408
  term->highlight_color = highlight_color;
349
409
}
350
410
 
351
411
/* Turn on/off the cursor.  */
353
413
grub_term_setcursor (struct grub_term_output *term, int on)
354
414
{
355
415
  if (term->setcursor)
356
 
    term->setcursor (on);
 
416
    term->setcursor (term, on);
357
417
}
358
418
 
359
419
static inline void 
360
420
grub_term_cls (struct grub_term_output *term)
361
421
{
362
422
  if (term->cls)
363
 
    (term->cls) ();
 
423
    (term->cls) (term);
364
424
  else
365
425
    {
366
426
      grub_putcode ('\n', term);
368
428
    }
369
429
}
370
430
 
 
431
#ifdef HAVE_UNIFONT_WIDTHSPEC
 
432
 
 
433
grub_ssize_t
 
434
grub_unicode_estimate_width (const struct grub_unicode_glyph *c);
 
435
 
 
436
#else
 
437
 
 
438
static inline grub_ssize_t
 
439
grub_unicode_estimate_width (const struct grub_unicode_glyph *c __attribute__ ((unused)))
 
440
{
 
441
  if (grub_unicode_get_comb_type (c->base))
 
442
    return 0;
 
443
  return 1;
 
444
}
 
445
 
 
446
#endif
 
447
 
371
448
static inline grub_ssize_t 
372
 
grub_term_getcharwidth (struct grub_term_output *term, grub_uint32_t c)
 
449
grub_term_getcharwidth (struct grub_term_output *term,
 
450
                        const struct grub_unicode_glyph *c)
373
451
{
374
452
  if (term->getcharwidth)
375
 
    return term->getcharwidth (c);
 
453
    return term->getcharwidth (term, c);
 
454
  else if (((term->flags & GRUB_TERM_CODE_TYPE_MASK)
 
455
            == GRUB_TERM_CODE_TYPE_UTF8_LOGICAL)
 
456
           || ((term->flags & GRUB_TERM_CODE_TYPE_MASK)
 
457
               == GRUB_TERM_CODE_TYPE_UTF8_VISUAL)
 
458
           || ((term->flags & GRUB_TERM_CODE_TYPE_MASK)
 
459
               == GRUB_TERM_CODE_TYPE_VISUAL_GLYPHS))
 
460
    return grub_unicode_estimate_width (c);
376
461
  else
377
462
    return 1;
378
463
}
381
466
grub_term_getcolor (struct grub_term_output *term, 
382
467
                    grub_uint8_t *normal_color, grub_uint8_t *highlight_color)
383
468
{
384
 
  if (term->getcolor)
385
 
    term->getcolor (normal_color, highlight_color);
386
 
  else
387
 
    {
388
 
      *normal_color = 0x07;
389
 
      *highlight_color = 0x07;
390
 
    }
 
469
  *normal_color = term->normal_color;
 
470
  *highlight_color = term->highlight_color;
391
471
}
392
472
 
393
 
extern void (*EXPORT_VAR (grub_newline_hook)) (void);
394
 
 
395
473
struct grub_term_autoload
396
474
{
397
475
  struct grub_term_autoload *next;
409
487
    grub_putcode (' ', term);
410
488
}
411
489
 
 
490
extern void (*EXPORT_VAR (grub_term_poll_usb)) (void);
412
491
 
413
 
/* For convenience.  */
414
 
#define GRUB_TERM_ASCII_CHAR(c) ((c) & 0xff)
 
492
#define GRUB_TERM_REPEAT_PRE_INTERVAL 400
 
493
#define GRUB_TERM_REPEAT_INTERVAL 50
415
494
 
416
495
#endif /* ! ASM_FILE */
417
496