Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

301 lines
8.9 KiB

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