macroify EFI characters mapping

This commit is contained in:
Vladimir 'phcoder' Serbinenko 2010-05-09 13:20:35 +02:00
parent b764bff263
commit d7fd78dc3d
2 changed files with 42 additions and 39 deletions

View file

@ -188,12 +188,22 @@ enum
GRUB_UNICODE_UPARROW = 0x2191, GRUB_UNICODE_UPARROW = 0x2191,
GRUB_UNICODE_RIGHTARROW = 0x2192, GRUB_UNICODE_RIGHTARROW = 0x2192,
GRUB_UNICODE_DOWNARROW = 0x2193, GRUB_UNICODE_DOWNARROW = 0x2193,
GRUB_UNICODE_LIGHT_HLINE = 0x2500,
GRUB_UNICODE_HLINE = 0x2501, GRUB_UNICODE_HLINE = 0x2501,
GRUB_UNICODE_LIGHT_VLINE = 0x2502,
GRUB_UNICODE_VLINE = 0x2503, GRUB_UNICODE_VLINE = 0x2503,
GRUB_UNICODE_LIGHT_CORNER_UL = 0x250c,
GRUB_UNICODE_CORNER_UL = 0x250f, GRUB_UNICODE_CORNER_UL = 0x250f,
GRUB_UNICODE_LIGHT_CORNER_UR = 0x2510,
GRUB_UNICODE_CORNER_UR = 0x2513, GRUB_UNICODE_CORNER_UR = 0x2513,
GRUB_UNICODE_LIGHT_CORNER_LL = 0x2514,
GRUB_UNICODE_CORNER_LL = 0x2517, GRUB_UNICODE_CORNER_LL = 0x2517,
GRUB_UNICODE_LIGHT_CORNER_LR = 0x2518,
GRUB_UNICODE_CORNER_LR = 0x251b, GRUB_UNICODE_CORNER_LR = 0x251b,
GRUB_UNICODE_BLACK_UP_TRIANGLE = 0x25b2,
GRUB_UNICODE_BLACK_RIGHT_TRIANGLE = 0x25ba,
GRUB_UNICODE_BLACK_DOWN_TRIANGLE = 0x25bc,
GRUB_UNICODE_BLACK_LEFT_TRIANGLE = 0x25c4,
GRUB_UNICODE_VARIATION_SELECTOR_1 = 0xfe00, GRUB_UNICODE_VARIATION_SELECTOR_1 = 0xfe00,
GRUB_UNICODE_VARIATION_SELECTOR_16 = 0xfe0f, GRUB_UNICODE_VARIATION_SELECTOR_16 = 0xfe0f,
GRUB_UNICODE_VARIATION_SELECTOR_17 = 0xe0100, GRUB_UNICODE_VARIATION_SELECTOR_17 = 0xe0100,

View file

@ -33,46 +33,39 @@ static int read_key = -1;
static grub_uint32_t static grub_uint32_t
map_char (grub_uint32_t c) map_char (grub_uint32_t c)
{ {
if (c > 0x7f) /* Map some unicode characters to the EFI character. */
switch (c)
{ {
/* Map some unicode characters to the EFI character. */ case GRUB_UNICODE_LEFTARROW:
switch (c) c = GRUB_UNICODE_BLACK_LEFT_TRIANGLE;
{ break;
case 0x2190: /* left arrow */ case GRUB_UNICODE_UPARROW:
c = 0x25c4; c = GRUB_UNICODE_BLACK_UP_TRIANGLE;
break; break;
case 0x2191: /* up arrow */ case GRUB_UNICODE_RIGHTARROW:
c = 0x25b2; c = GRUB_UNICODE_BLACK_RIGHT_TRIANGLE;
break; break;
case 0x2192: /* right arrow */ case GRUB_UNICODE_DOWNARROW:
c = 0x25ba; c = GRUB_UNICODE_BLACK_DOWN_TRIANGLE;
break; break;
case 0x2193: /* down arrow */ case GRUB_UNICODE_HLINE:
c = 0x25bc; c = GRUB_UNICODE_LIGHT_HLINE;
break; break;
case 0x2501: /* horizontal line */ case GRUB_UNICODE_VLINE:
c = 0x2500; c = GRUB_UNICODE_LIGHT_VLINE;
break; break;
case 0x2503: /* vertical line */ case GRUB_UNICODE_CORNER_UL:
c = 0x2502; c = GRUB_UNICODE_LIGHT_CORNER_UL;
break; break;
case 0x250F: /* upper-left corner */ case GRUB_UNICODE_CORNER_UR:
c = 0x250c; c = GRUB_UNICODE_LIGHT_CORNER_UR;
break; break;
case 0x2513: /* upper-right corner */ case GRUB_UNICODE_CORNER_LL:
c = 0x2510; c = GRUB_UNICODE_LIGHT_CORNER_LL;
break; break;
case 0x2517: /* lower-left corner */ case GRUB_UNICODE_CORNER_LR:
c = 0x2514; c = GRUB_UNICODE_LIGHT_CORNER_LR;
break; break;
case 0x251B: /* lower-right corner */
c = 0x2518;
break;
default:
c = '?';
break;
}
} }
return c; return c;