eficon.h 9.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306
  1. #ifndef _EFI_CON_H
  2. #define _EFI_CON_H
  3. /*++
  4. Copyright (c) 1998 Intel Corporation
  5. Module Name:
  6. eficon.h
  7. Abstract:
  8. EFI console protocols
  9. Revision History
  10. --*/
  11. //
  12. // Text output protocol
  13. //
  14. #define EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL_GUID \
  15. { 0x387477c2, 0x69c7, 0x11d2, {0x8e, 0x39, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x3b} }
  16. #define SIMPLE_TEXT_OUTPUT_PROTOCOL EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL_GUID
  17. INTERFACE_DECL(_SIMPLE_TEXT_OUTPUT_INTERFACE);
  18. typedef
  19. EFI_STATUS
  20. (EFIAPI *EFI_TEXT_RESET) (
  21. IN struct _SIMPLE_TEXT_OUTPUT_INTERFACE *This,
  22. IN BOOLEAN ExtendedVerification
  23. );
  24. typedef
  25. EFI_STATUS
  26. (EFIAPI *EFI_TEXT_OUTPUT_STRING) (
  27. IN struct _SIMPLE_TEXT_OUTPUT_INTERFACE *This,
  28. IN CHAR16 *String
  29. );
  30. typedef
  31. EFI_STATUS
  32. (EFIAPI *EFI_TEXT_TEST_STRING) (
  33. IN struct _SIMPLE_TEXT_OUTPUT_INTERFACE *This,
  34. IN CHAR16 *String
  35. );
  36. typedef
  37. EFI_STATUS
  38. (EFIAPI *EFI_TEXT_QUERY_MODE) (
  39. IN struct _SIMPLE_TEXT_OUTPUT_INTERFACE *This,
  40. IN UINTN ModeNumber,
  41. OUT UINTN *Columns,
  42. OUT UINTN *Rows
  43. );
  44. typedef
  45. EFI_STATUS
  46. (EFIAPI *EFI_TEXT_SET_MODE) (
  47. IN struct _SIMPLE_TEXT_OUTPUT_INTERFACE *This,
  48. IN UINTN ModeNumber
  49. );
  50. typedef
  51. EFI_STATUS
  52. (EFIAPI *EFI_TEXT_SET_ATTRIBUTE) (
  53. IN struct _SIMPLE_TEXT_OUTPUT_INTERFACE *This,
  54. IN UINTN Attribute
  55. );
  56. #define EFI_BLACK 0x00
  57. #define EFI_BLUE 0x01
  58. #define EFI_GREEN 0x02
  59. #define EFI_CYAN (EFI_BLUE | EFI_GREEN)
  60. #define EFI_RED 0x04
  61. #define EFI_MAGENTA (EFI_BLUE | EFI_RED)
  62. #define EFI_BROWN (EFI_GREEN | EFI_RED)
  63. #define EFI_LIGHTGRAY (EFI_BLUE | EFI_GREEN | EFI_RED)
  64. #define EFI_BRIGHT 0x08
  65. #define EFI_DARKGRAY (EFI_BRIGHT)
  66. #define EFI_LIGHTBLUE (EFI_BLUE | EFI_BRIGHT)
  67. #define EFI_LIGHTGREEN (EFI_GREEN | EFI_BRIGHT)
  68. #define EFI_LIGHTCYAN (EFI_CYAN | EFI_BRIGHT)
  69. #define EFI_LIGHTRED (EFI_RED | EFI_BRIGHT)
  70. #define EFI_LIGHTMAGENTA (EFI_MAGENTA | EFI_BRIGHT)
  71. #define EFI_YELLOW (EFI_BROWN | EFI_BRIGHT)
  72. #define EFI_WHITE (EFI_BLUE | EFI_GREEN | EFI_RED | EFI_BRIGHT)
  73. #define EFI_TEXT_ATTR(f,b) ((f) | ((b) << 4))
  74. #define EFI_BACKGROUND_BLACK 0x00
  75. #define EFI_BACKGROUND_BLUE 0x10
  76. #define EFI_BACKGROUND_GREEN 0x20
  77. #define EFI_BACKGROUND_CYAN (EFI_BACKGROUND_BLUE | EFI_BACKGROUND_GREEN)
  78. #define EFI_BACKGROUND_RED 0x40
  79. #define EFI_BACKGROUND_MAGENTA (EFI_BACKGROUND_BLUE | EFI_BACKGROUND_RED)
  80. #define EFI_BACKGROUND_BROWN (EFI_BACKGROUND_GREEN | EFI_BACKGROUND_RED)
  81. #define EFI_BACKGROUND_LIGHTGRAY (EFI_BACKGROUND_BLUE | EFI_BACKGROUND_GREEN | EFI_BACKGROUND_RED)
  82. typedef
  83. EFI_STATUS
  84. (EFIAPI *EFI_TEXT_CLEAR_SCREEN) (
  85. IN struct _SIMPLE_TEXT_OUTPUT_INTERFACE *This
  86. );
  87. typedef
  88. EFI_STATUS
  89. (EFIAPI *EFI_TEXT_SET_CURSOR_POSITION) (
  90. IN struct _SIMPLE_TEXT_OUTPUT_INTERFACE *This,
  91. IN UINTN Column,
  92. IN UINTN Row
  93. );
  94. typedef
  95. EFI_STATUS
  96. (EFIAPI *EFI_TEXT_ENABLE_CURSOR) (
  97. IN struct _SIMPLE_TEXT_OUTPUT_INTERFACE *This,
  98. IN BOOLEAN Enable
  99. );
  100. typedef struct {
  101. INT32 MaxMode;
  102. // current settings
  103. INT32 Mode;
  104. INT32 Attribute;
  105. INT32 CursorColumn;
  106. INT32 CursorRow;
  107. BOOLEAN CursorVisible;
  108. } SIMPLE_TEXT_OUTPUT_MODE;
  109. typedef struct _SIMPLE_TEXT_OUTPUT_INTERFACE {
  110. EFI_TEXT_RESET Reset;
  111. EFI_TEXT_OUTPUT_STRING OutputString;
  112. EFI_TEXT_TEST_STRING TestString;
  113. EFI_TEXT_QUERY_MODE QueryMode;
  114. EFI_TEXT_SET_MODE SetMode;
  115. EFI_TEXT_SET_ATTRIBUTE SetAttribute;
  116. EFI_TEXT_CLEAR_SCREEN ClearScreen;
  117. EFI_TEXT_SET_CURSOR_POSITION SetCursorPosition;
  118. EFI_TEXT_ENABLE_CURSOR EnableCursor;
  119. // Current mode
  120. SIMPLE_TEXT_OUTPUT_MODE *Mode;
  121. } SIMPLE_TEXT_OUTPUT_INTERFACE, EFI_SIMPLE_TEXT_OUT_PROTOCOL;
  122. //
  123. // Define's for required EFI Unicode Box Draw character
  124. //
  125. #define BOXDRAW_HORIZONTAL 0x2500
  126. #define BOXDRAW_VERTICAL 0x2502
  127. #define BOXDRAW_DOWN_RIGHT 0x250c
  128. #define BOXDRAW_DOWN_LEFT 0x2510
  129. #define BOXDRAW_UP_RIGHT 0x2514
  130. #define BOXDRAW_UP_LEFT 0x2518
  131. #define BOXDRAW_VERTICAL_RIGHT 0x251c
  132. #define BOXDRAW_VERTICAL_LEFT 0x2524
  133. #define BOXDRAW_DOWN_HORIZONTAL 0x252c
  134. #define BOXDRAW_UP_HORIZONTAL 0x2534
  135. #define BOXDRAW_VERTICAL_HORIZONTAL 0x253c
  136. #define BOXDRAW_DOUBLE_HORIZONTAL 0x2550
  137. #define BOXDRAW_DOUBLE_VERTICAL 0x2551
  138. #define BOXDRAW_DOWN_RIGHT_DOUBLE 0x2552
  139. #define BOXDRAW_DOWN_DOUBLE_RIGHT 0x2553
  140. #define BOXDRAW_DOUBLE_DOWN_RIGHT 0x2554
  141. #define BOXDRAW_DOWN_LEFT_DOUBLE 0x2555
  142. #define BOXDRAW_DOWN_DOUBLE_LEFT 0x2556
  143. #define BOXDRAW_DOUBLE_DOWN_LEFT 0x2557
  144. #define BOXDRAW_UP_RIGHT_DOUBLE 0x2558
  145. #define BOXDRAW_UP_DOUBLE_RIGHT 0x2559
  146. #define BOXDRAW_DOUBLE_UP_RIGHT 0x255a
  147. #define BOXDRAW_UP_LEFT_DOUBLE 0x255b
  148. #define BOXDRAW_UP_DOUBLE_LEFT 0x255c
  149. #define BOXDRAW_DOUBLE_UP_LEFT 0x255d
  150. #define BOXDRAW_VERTICAL_RIGHT_DOUBLE 0x255e
  151. #define BOXDRAW_VERTICAL_DOUBLE_RIGHT 0x255f
  152. #define BOXDRAW_DOUBLE_VERTICAL_RIGHT 0x2560
  153. #define BOXDRAW_VERTICAL_LEFT_DOUBLE 0x2561
  154. #define BOXDRAW_VERTICAL_DOUBLE_LEFT 0x2562
  155. #define BOXDRAW_DOUBLE_VERTICAL_LEFT 0x2563
  156. #define BOXDRAW_DOWN_HORIZONTAL_DOUBLE 0x2564
  157. #define BOXDRAW_DOWN_DOUBLE_HORIZONTAL 0x2565
  158. #define BOXDRAW_DOUBLE_DOWN_HORIZONTAL 0x2566
  159. #define BOXDRAW_UP_HORIZONTAL_DOUBLE 0x2567
  160. #define BOXDRAW_UP_DOUBLE_HORIZONTAL 0x2568
  161. #define BOXDRAW_DOUBLE_UP_HORIZONTAL 0x2569
  162. #define BOXDRAW_VERTICAL_HORIZONTAL_DOUBLE 0x256a
  163. #define BOXDRAW_VERTICAL_DOUBLE_HORIZONTAL 0x256b
  164. #define BOXDRAW_DOUBLE_VERTICAL_HORIZONTAL 0x256c
  165. //
  166. // EFI Required Block Elements Code Chart
  167. //
  168. #define BLOCKELEMENT_FULL_BLOCK 0x2588
  169. #define BLOCKELEMENT_LIGHT_SHADE 0x2591
  170. //
  171. // EFI Required Geometric Shapes Code Chart
  172. //
  173. #define GEOMETRICSHAPE_UP_TRIANGLE 0x25b2
  174. #define GEOMETRICSHAPE_RIGHT_TRIANGLE 0x25ba
  175. #define GEOMETRICSHAPE_DOWN_TRIANGLE 0x25bc
  176. #define GEOMETRICSHAPE_LEFT_TRIANGLE 0x25c4
  177. //
  178. // EFI Required Arrow shapes
  179. //
  180. #define ARROW_UP 0x2191
  181. #define ARROW_DOWN 0x2193
  182. //
  183. // Text input protocol
  184. //
  185. #define EFI_SIMPLE_TEXT_INPUT_PROTOCOL_GUID \
  186. { 0x387477c1, 0x69c7, 0x11d2, {0x8e, 0x39, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x3b} }
  187. #define SIMPLE_TEXT_INPUT_PROTOCOL EFI_SIMPLE_TEXT_INPUT_PROTOCOL_GUID
  188. INTERFACE_DECL(_SIMPLE_INPUT_INTERFACE);
  189. typedef struct {
  190. UINT16 ScanCode;
  191. CHAR16 UnicodeChar;
  192. } EFI_INPUT_KEY;
  193. //
  194. // Baseline unicode control chars
  195. //
  196. #define CHAR_NULL 0x0000
  197. #define CHAR_BACKSPACE 0x0008
  198. #define CHAR_TAB 0x0009
  199. #define CHAR_LINEFEED 0x000A
  200. #define CHAR_CARRIAGE_RETURN 0x000D
  201. //
  202. // Scan codes for base line keys
  203. //
  204. #define SCAN_NULL 0x0000
  205. #define SCAN_UP 0x0001
  206. #define SCAN_DOWN 0x0002
  207. #define SCAN_RIGHT 0x0003
  208. #define SCAN_LEFT 0x0004
  209. #define SCAN_HOME 0x0005
  210. #define SCAN_END 0x0006
  211. #define SCAN_INSERT 0x0007
  212. #define SCAN_DELETE 0x0008
  213. #define SCAN_PAGE_UP 0x0009
  214. #define SCAN_PAGE_DOWN 0x000A
  215. #define SCAN_F1 0x000B
  216. #define SCAN_F2 0x000C
  217. #define SCAN_F3 0x000D
  218. #define SCAN_F4 0x000E
  219. #define SCAN_F5 0x000F
  220. #define SCAN_F6 0x0010
  221. #define SCAN_F7 0x0011
  222. #define SCAN_F8 0x0012
  223. #define SCAN_F9 0x0013
  224. #define SCAN_F10 0x0014
  225. #define SCAN_F11 0x0015
  226. #define SCAN_F12 0x0016
  227. #define SCAN_ESC 0x0017
  228. typedef
  229. EFI_STATUS
  230. (EFIAPI *EFI_INPUT_RESET) (
  231. IN struct _SIMPLE_INPUT_INTERFACE *This,
  232. IN BOOLEAN ExtendedVerification
  233. );
  234. typedef
  235. EFI_STATUS
  236. (EFIAPI *EFI_INPUT_READ_KEY) (
  237. IN struct _SIMPLE_INPUT_INTERFACE *This,
  238. OUT EFI_INPUT_KEY *Key
  239. );
  240. typedef struct _SIMPLE_INPUT_INTERFACE {
  241. EFI_INPUT_RESET Reset;
  242. EFI_INPUT_READ_KEY ReadKeyStroke;
  243. EFI_EVENT WaitForKey;
  244. } SIMPLE_INPUT_INTERFACE, EFI_SIMPLE_TEXT_IN_PROTOCOL;
  245. #endif