1530d68baSNigel Croxon #ifndef _EFI_CON_H 2530d68baSNigel Croxon #define _EFI_CON_H 3530d68baSNigel Croxon 4530d68baSNigel Croxon /*++ 5530d68baSNigel Croxon 6530d68baSNigel Croxon Copyright (c) 1998 Intel Corporation 7530d68baSNigel Croxon 8530d68baSNigel Croxon Module Name: 9530d68baSNigel Croxon 10530d68baSNigel Croxon eficon.h 11530d68baSNigel Croxon 12530d68baSNigel Croxon Abstract: 13530d68baSNigel Croxon 14530d68baSNigel Croxon EFI console protocols 15530d68baSNigel Croxon 16530d68baSNigel Croxon 17530d68baSNigel Croxon 18530d68baSNigel Croxon Revision History 19530d68baSNigel Croxon 20530d68baSNigel Croxon --*/ 21530d68baSNigel Croxon 22530d68baSNigel Croxon // 23530d68baSNigel Croxon // Text output protocol 24530d68baSNigel Croxon // 25530d68baSNigel Croxon 26751cbce3SNigel Croxon #define EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL_GUID \ 27530d68baSNigel Croxon { 0x387477c2, 0x69c7, 0x11d2, {0x8e, 0x39, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x3b} } 28751cbce3SNigel Croxon #define SIMPLE_TEXT_OUTPUT_PROTOCOL EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL_GUID 29530d68baSNigel Croxon 30530d68baSNigel Croxon INTERFACE_DECL(_SIMPLE_TEXT_OUTPUT_INTERFACE); 31530d68baSNigel Croxon 32530d68baSNigel Croxon typedef 33530d68baSNigel Croxon EFI_STATUS 34530d68baSNigel Croxon (EFIAPI *EFI_TEXT_RESET) ( 35530d68baSNigel Croxon IN struct _SIMPLE_TEXT_OUTPUT_INTERFACE *This, 36530d68baSNigel Croxon IN BOOLEAN ExtendedVerification 37530d68baSNigel Croxon ); 38530d68baSNigel Croxon 39530d68baSNigel Croxon typedef 40530d68baSNigel Croxon EFI_STATUS 41530d68baSNigel Croxon (EFIAPI *EFI_TEXT_OUTPUT_STRING) ( 42530d68baSNigel Croxon IN struct _SIMPLE_TEXT_OUTPUT_INTERFACE *This, 43530d68baSNigel Croxon IN CHAR16 *String 44530d68baSNigel Croxon ); 45530d68baSNigel Croxon 46530d68baSNigel Croxon typedef 47530d68baSNigel Croxon EFI_STATUS 48530d68baSNigel Croxon (EFIAPI *EFI_TEXT_TEST_STRING) ( 49530d68baSNigel Croxon IN struct _SIMPLE_TEXT_OUTPUT_INTERFACE *This, 50530d68baSNigel Croxon IN CHAR16 *String 51530d68baSNigel Croxon ); 52530d68baSNigel Croxon 53530d68baSNigel Croxon typedef 54530d68baSNigel Croxon EFI_STATUS 55530d68baSNigel Croxon (EFIAPI *EFI_TEXT_QUERY_MODE) ( 56530d68baSNigel Croxon IN struct _SIMPLE_TEXT_OUTPUT_INTERFACE *This, 57530d68baSNigel Croxon IN UINTN ModeNumber, 58530d68baSNigel Croxon OUT UINTN *Columns, 59530d68baSNigel Croxon OUT UINTN *Rows 60530d68baSNigel Croxon ); 61530d68baSNigel Croxon 62530d68baSNigel Croxon typedef 63530d68baSNigel Croxon EFI_STATUS 64530d68baSNigel Croxon (EFIAPI *EFI_TEXT_SET_MODE) ( 65530d68baSNigel Croxon IN struct _SIMPLE_TEXT_OUTPUT_INTERFACE *This, 66530d68baSNigel Croxon IN UINTN ModeNumber 67530d68baSNigel Croxon ); 68530d68baSNigel Croxon 69530d68baSNigel Croxon typedef 70530d68baSNigel Croxon EFI_STATUS 71530d68baSNigel Croxon (EFIAPI *EFI_TEXT_SET_ATTRIBUTE) ( 72530d68baSNigel Croxon IN struct _SIMPLE_TEXT_OUTPUT_INTERFACE *This, 73530d68baSNigel Croxon IN UINTN Attribute 74530d68baSNigel Croxon ); 75530d68baSNigel Croxon 76530d68baSNigel Croxon #define EFI_BLACK 0x00 77530d68baSNigel Croxon #define EFI_BLUE 0x01 78530d68baSNigel Croxon #define EFI_GREEN 0x02 79530d68baSNigel Croxon #define EFI_CYAN (EFI_BLUE | EFI_GREEN) 80530d68baSNigel Croxon #define EFI_RED 0x04 81530d68baSNigel Croxon #define EFI_MAGENTA (EFI_BLUE | EFI_RED) 82530d68baSNigel Croxon #define EFI_BROWN (EFI_GREEN | EFI_RED) 83530d68baSNigel Croxon #define EFI_LIGHTGRAY (EFI_BLUE | EFI_GREEN | EFI_RED) 84530d68baSNigel Croxon #define EFI_BRIGHT 0x08 85530d68baSNigel Croxon #define EFI_DARKGRAY (EFI_BRIGHT) 86530d68baSNigel Croxon #define EFI_LIGHTBLUE (EFI_BLUE | EFI_BRIGHT) 87530d68baSNigel Croxon #define EFI_LIGHTGREEN (EFI_GREEN | EFI_BRIGHT) 88530d68baSNigel Croxon #define EFI_LIGHTCYAN (EFI_CYAN | EFI_BRIGHT) 89530d68baSNigel Croxon #define EFI_LIGHTRED (EFI_RED | EFI_BRIGHT) 90530d68baSNigel Croxon #define EFI_LIGHTMAGENTA (EFI_MAGENTA | EFI_BRIGHT) 91530d68baSNigel Croxon #define EFI_YELLOW (EFI_BROWN | EFI_BRIGHT) 92530d68baSNigel Croxon #define EFI_WHITE (EFI_BLUE | EFI_GREEN | EFI_RED | EFI_BRIGHT) 93530d68baSNigel Croxon 94530d68baSNigel Croxon #define EFI_TEXT_ATTR(f,b) ((f) | ((b) << 4)) 95530d68baSNigel Croxon 96530d68baSNigel Croxon #define EFI_BACKGROUND_BLACK 0x00 97530d68baSNigel Croxon #define EFI_BACKGROUND_BLUE 0x10 98530d68baSNigel Croxon #define EFI_BACKGROUND_GREEN 0x20 99530d68baSNigel Croxon #define EFI_BACKGROUND_CYAN (EFI_BACKGROUND_BLUE | EFI_BACKGROUND_GREEN) 100530d68baSNigel Croxon #define EFI_BACKGROUND_RED 0x40 101530d68baSNigel Croxon #define EFI_BACKGROUND_MAGENTA (EFI_BACKGROUND_BLUE | EFI_BACKGROUND_RED) 102530d68baSNigel Croxon #define EFI_BACKGROUND_BROWN (EFI_BACKGROUND_GREEN | EFI_BACKGROUND_RED) 103530d68baSNigel Croxon #define EFI_BACKGROUND_LIGHTGRAY (EFI_BACKGROUND_BLUE | EFI_BACKGROUND_GREEN | EFI_BACKGROUND_RED) 104530d68baSNigel Croxon 105530d68baSNigel Croxon 106530d68baSNigel Croxon typedef 107530d68baSNigel Croxon EFI_STATUS 108530d68baSNigel Croxon (EFIAPI *EFI_TEXT_CLEAR_SCREEN) ( 109530d68baSNigel Croxon IN struct _SIMPLE_TEXT_OUTPUT_INTERFACE *This 110530d68baSNigel Croxon ); 111530d68baSNigel Croxon 112530d68baSNigel Croxon typedef 113530d68baSNigel Croxon EFI_STATUS 114530d68baSNigel Croxon (EFIAPI *EFI_TEXT_SET_CURSOR_POSITION) ( 115530d68baSNigel Croxon IN struct _SIMPLE_TEXT_OUTPUT_INTERFACE *This, 116530d68baSNigel Croxon IN UINTN Column, 117530d68baSNigel Croxon IN UINTN Row 118530d68baSNigel Croxon ); 119530d68baSNigel Croxon 120530d68baSNigel Croxon typedef 121530d68baSNigel Croxon EFI_STATUS 122530d68baSNigel Croxon (EFIAPI *EFI_TEXT_ENABLE_CURSOR) ( 123530d68baSNigel Croxon IN struct _SIMPLE_TEXT_OUTPUT_INTERFACE *This, 124530d68baSNigel Croxon IN BOOLEAN Enable 125530d68baSNigel Croxon ); 126530d68baSNigel Croxon 127530d68baSNigel Croxon typedef struct { 128530d68baSNigel Croxon INT32 MaxMode; 129530d68baSNigel Croxon // current settings 130530d68baSNigel Croxon INT32 Mode; 131530d68baSNigel Croxon INT32 Attribute; 132530d68baSNigel Croxon INT32 CursorColumn; 133530d68baSNigel Croxon INT32 CursorRow; 134530d68baSNigel Croxon BOOLEAN CursorVisible; 135530d68baSNigel Croxon } SIMPLE_TEXT_OUTPUT_MODE; 136530d68baSNigel Croxon 137530d68baSNigel Croxon typedef struct _SIMPLE_TEXT_OUTPUT_INTERFACE { 138530d68baSNigel Croxon EFI_TEXT_RESET Reset; 139530d68baSNigel Croxon 140530d68baSNigel Croxon EFI_TEXT_OUTPUT_STRING OutputString; 141530d68baSNigel Croxon EFI_TEXT_TEST_STRING TestString; 142530d68baSNigel Croxon 143530d68baSNigel Croxon EFI_TEXT_QUERY_MODE QueryMode; 144530d68baSNigel Croxon EFI_TEXT_SET_MODE SetMode; 145530d68baSNigel Croxon EFI_TEXT_SET_ATTRIBUTE SetAttribute; 146530d68baSNigel Croxon 147530d68baSNigel Croxon EFI_TEXT_CLEAR_SCREEN ClearScreen; 148530d68baSNigel Croxon EFI_TEXT_SET_CURSOR_POSITION SetCursorPosition; 149530d68baSNigel Croxon EFI_TEXT_ENABLE_CURSOR EnableCursor; 150530d68baSNigel Croxon 151530d68baSNigel Croxon // Current mode 152530d68baSNigel Croxon SIMPLE_TEXT_OUTPUT_MODE *Mode; 153*9cdd67daSNigel Croxon } SIMPLE_TEXT_OUTPUT_INTERFACE, EFI_SIMPLE_TEXT_OUT_PROTOCOL; 154530d68baSNigel Croxon 155530d68baSNigel Croxon // 156530d68baSNigel Croxon // Define's for required EFI Unicode Box Draw character 157530d68baSNigel Croxon // 158530d68baSNigel Croxon 159530d68baSNigel Croxon #define BOXDRAW_HORIZONTAL 0x2500 160530d68baSNigel Croxon #define BOXDRAW_VERTICAL 0x2502 161530d68baSNigel Croxon #define BOXDRAW_DOWN_RIGHT 0x250c 162530d68baSNigel Croxon #define BOXDRAW_DOWN_LEFT 0x2510 163530d68baSNigel Croxon #define BOXDRAW_UP_RIGHT 0x2514 164530d68baSNigel Croxon #define BOXDRAW_UP_LEFT 0x2518 165530d68baSNigel Croxon #define BOXDRAW_VERTICAL_RIGHT 0x251c 166530d68baSNigel Croxon #define BOXDRAW_VERTICAL_LEFT 0x2524 167530d68baSNigel Croxon #define BOXDRAW_DOWN_HORIZONTAL 0x252c 168530d68baSNigel Croxon #define BOXDRAW_UP_HORIZONTAL 0x2534 169530d68baSNigel Croxon #define BOXDRAW_VERTICAL_HORIZONTAL 0x253c 170530d68baSNigel Croxon 171530d68baSNigel Croxon #define BOXDRAW_DOUBLE_HORIZONTAL 0x2550 172530d68baSNigel Croxon #define BOXDRAW_DOUBLE_VERTICAL 0x2551 173530d68baSNigel Croxon #define BOXDRAW_DOWN_RIGHT_DOUBLE 0x2552 174530d68baSNigel Croxon #define BOXDRAW_DOWN_DOUBLE_RIGHT 0x2553 175530d68baSNigel Croxon #define BOXDRAW_DOUBLE_DOWN_RIGHT 0x2554 176530d68baSNigel Croxon 177530d68baSNigel Croxon #define BOXDRAW_DOWN_LEFT_DOUBLE 0x2555 178530d68baSNigel Croxon #define BOXDRAW_DOWN_DOUBLE_LEFT 0x2556 179530d68baSNigel Croxon #define BOXDRAW_DOUBLE_DOWN_LEFT 0x2557 180530d68baSNigel Croxon 181530d68baSNigel Croxon #define BOXDRAW_UP_RIGHT_DOUBLE 0x2558 182530d68baSNigel Croxon #define BOXDRAW_UP_DOUBLE_RIGHT 0x2559 183530d68baSNigel Croxon #define BOXDRAW_DOUBLE_UP_RIGHT 0x255a 184530d68baSNigel Croxon 185530d68baSNigel Croxon #define BOXDRAW_UP_LEFT_DOUBLE 0x255b 186530d68baSNigel Croxon #define BOXDRAW_UP_DOUBLE_LEFT 0x255c 187530d68baSNigel Croxon #define BOXDRAW_DOUBLE_UP_LEFT 0x255d 188530d68baSNigel Croxon 189530d68baSNigel Croxon #define BOXDRAW_VERTICAL_RIGHT_DOUBLE 0x255e 190530d68baSNigel Croxon #define BOXDRAW_VERTICAL_DOUBLE_RIGHT 0x255f 191530d68baSNigel Croxon #define BOXDRAW_DOUBLE_VERTICAL_RIGHT 0x2560 192530d68baSNigel Croxon 193530d68baSNigel Croxon #define BOXDRAW_VERTICAL_LEFT_DOUBLE 0x2561 194530d68baSNigel Croxon #define BOXDRAW_VERTICAL_DOUBLE_LEFT 0x2562 195530d68baSNigel Croxon #define BOXDRAW_DOUBLE_VERTICAL_LEFT 0x2563 196530d68baSNigel Croxon 197530d68baSNigel Croxon #define BOXDRAW_DOWN_HORIZONTAL_DOUBLE 0x2564 198530d68baSNigel Croxon #define BOXDRAW_DOWN_DOUBLE_HORIZONTAL 0x2565 199530d68baSNigel Croxon #define BOXDRAW_DOUBLE_DOWN_HORIZONTAL 0x2566 200530d68baSNigel Croxon 201530d68baSNigel Croxon #define BOXDRAW_UP_HORIZONTAL_DOUBLE 0x2567 202530d68baSNigel Croxon #define BOXDRAW_UP_DOUBLE_HORIZONTAL 0x2568 203530d68baSNigel Croxon #define BOXDRAW_DOUBLE_UP_HORIZONTAL 0x2569 204530d68baSNigel Croxon 205530d68baSNigel Croxon #define BOXDRAW_VERTICAL_HORIZONTAL_DOUBLE 0x256a 206530d68baSNigel Croxon #define BOXDRAW_VERTICAL_DOUBLE_HORIZONTAL 0x256b 207530d68baSNigel Croxon #define BOXDRAW_DOUBLE_VERTICAL_HORIZONTAL 0x256c 208530d68baSNigel Croxon 209530d68baSNigel Croxon // 210530d68baSNigel Croxon // EFI Required Block Elements Code Chart 211530d68baSNigel Croxon // 212530d68baSNigel Croxon 213530d68baSNigel Croxon #define BLOCKELEMENT_FULL_BLOCK 0x2588 214530d68baSNigel Croxon #define BLOCKELEMENT_LIGHT_SHADE 0x2591 215530d68baSNigel Croxon // 216530d68baSNigel Croxon // EFI Required Geometric Shapes Code Chart 217530d68baSNigel Croxon // 218530d68baSNigel Croxon 219530d68baSNigel Croxon #define GEOMETRICSHAPE_UP_TRIANGLE 0x25b2 220530d68baSNigel Croxon #define GEOMETRICSHAPE_RIGHT_TRIANGLE 0x25ba 221530d68baSNigel Croxon #define GEOMETRICSHAPE_DOWN_TRIANGLE 0x25bc 222530d68baSNigel Croxon #define GEOMETRICSHAPE_LEFT_TRIANGLE 0x25c4 223530d68baSNigel Croxon 224530d68baSNigel Croxon // 225530d68baSNigel Croxon // EFI Required Arrow shapes 226530d68baSNigel Croxon // 227530d68baSNigel Croxon 228530d68baSNigel Croxon #define ARROW_UP 0x2191 229530d68baSNigel Croxon #define ARROW_DOWN 0x2193 230530d68baSNigel Croxon 231530d68baSNigel Croxon // 232530d68baSNigel Croxon // Text input protocol 233530d68baSNigel Croxon // 234530d68baSNigel Croxon 235751cbce3SNigel Croxon #define EFI_SIMPLE_TEXT_INPUT_PROTOCOL_GUID \ 236530d68baSNigel Croxon { 0x387477c1, 0x69c7, 0x11d2, {0x8e, 0x39, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x3b} } 237751cbce3SNigel Croxon #define SIMPLE_TEXT_INPUT_PROTOCOL EFI_SIMPLE_TEXT_INPUT_PROTOCOL_GUID 238530d68baSNigel Croxon 239530d68baSNigel Croxon INTERFACE_DECL(_SIMPLE_INPUT_INTERFACE); 240530d68baSNigel Croxon 241530d68baSNigel Croxon typedef struct { 242530d68baSNigel Croxon UINT16 ScanCode; 243530d68baSNigel Croxon CHAR16 UnicodeChar; 244530d68baSNigel Croxon } EFI_INPUT_KEY; 245530d68baSNigel Croxon 246530d68baSNigel Croxon // 247530d68baSNigel Croxon // Baseline unicode control chars 248530d68baSNigel Croxon // 249530d68baSNigel Croxon 250530d68baSNigel Croxon #define CHAR_NULL 0x0000 251530d68baSNigel Croxon #define CHAR_BACKSPACE 0x0008 252530d68baSNigel Croxon #define CHAR_TAB 0x0009 253530d68baSNigel Croxon #define CHAR_LINEFEED 0x000A 254530d68baSNigel Croxon #define CHAR_CARRIAGE_RETURN 0x000D 255530d68baSNigel Croxon 256530d68baSNigel Croxon // 257530d68baSNigel Croxon // Scan codes for base line keys 258530d68baSNigel Croxon // 259530d68baSNigel Croxon 260530d68baSNigel Croxon #define SCAN_NULL 0x0000 261530d68baSNigel Croxon #define SCAN_UP 0x0001 262530d68baSNigel Croxon #define SCAN_DOWN 0x0002 263530d68baSNigel Croxon #define SCAN_RIGHT 0x0003 264530d68baSNigel Croxon #define SCAN_LEFT 0x0004 265530d68baSNigel Croxon #define SCAN_HOME 0x0005 266530d68baSNigel Croxon #define SCAN_END 0x0006 267530d68baSNigel Croxon #define SCAN_INSERT 0x0007 268530d68baSNigel Croxon #define SCAN_DELETE 0x0008 269530d68baSNigel Croxon #define SCAN_PAGE_UP 0x0009 270530d68baSNigel Croxon #define SCAN_PAGE_DOWN 0x000A 271530d68baSNigel Croxon #define SCAN_F1 0x000B 272530d68baSNigel Croxon #define SCAN_F2 0x000C 273530d68baSNigel Croxon #define SCAN_F3 0x000D 274530d68baSNigel Croxon #define SCAN_F4 0x000E 275530d68baSNigel Croxon #define SCAN_F5 0x000F 276530d68baSNigel Croxon #define SCAN_F6 0x0010 277530d68baSNigel Croxon #define SCAN_F7 0x0011 278530d68baSNigel Croxon #define SCAN_F8 0x0012 279530d68baSNigel Croxon #define SCAN_F9 0x0013 280530d68baSNigel Croxon #define SCAN_F10 0x0014 281*9cdd67daSNigel Croxon #define SCAN_F11 0x0015 282*9cdd67daSNigel Croxon #define SCAN_F12 0x0016 283530d68baSNigel Croxon #define SCAN_ESC 0x0017 284530d68baSNigel Croxon 285530d68baSNigel Croxon typedef 286530d68baSNigel Croxon EFI_STATUS 287530d68baSNigel Croxon (EFIAPI *EFI_INPUT_RESET) ( 288530d68baSNigel Croxon IN struct _SIMPLE_INPUT_INTERFACE *This, 289530d68baSNigel Croxon IN BOOLEAN ExtendedVerification 290530d68baSNigel Croxon ); 291530d68baSNigel Croxon 292530d68baSNigel Croxon typedef 293530d68baSNigel Croxon EFI_STATUS 294530d68baSNigel Croxon (EFIAPI *EFI_INPUT_READ_KEY) ( 295530d68baSNigel Croxon IN struct _SIMPLE_INPUT_INTERFACE *This, 296530d68baSNigel Croxon OUT EFI_INPUT_KEY *Key 297530d68baSNigel Croxon ); 298530d68baSNigel Croxon 299530d68baSNigel Croxon typedef struct _SIMPLE_INPUT_INTERFACE { 300530d68baSNigel Croxon EFI_INPUT_RESET Reset; 301530d68baSNigel Croxon EFI_INPUT_READ_KEY ReadKeyStroke; 302530d68baSNigel Croxon EFI_EVENT WaitForKey; 303*9cdd67daSNigel Croxon } SIMPLE_INPUT_INTERFACE, EFI_SIMPLE_TEXT_IN_PROTOCOL; 304530d68baSNigel Croxon 305530d68baSNigel Croxon #endif 306530d68baSNigel Croxon 307