]>
Commit | Line | Data |
---|---|---|
d1f95000 | 1 | /** @file\r |
8a7d75b0 | 2 | Simple Text Out protocol from the UEFI 2.0 specification.\r |
d1f95000 | 3 | \r |
4 | Abstraction of a very simple text based output device like VGA text mode or\r | |
5 | a serial terminal. The Simple Text Out protocol instance can represent\r | |
6 | a single hardware device or a virtual device that is an agregation\r | |
7 | of multiple physical devices.\r | |
8 | \r | |
4ca9b6c4 | 9 | Copyright (c) 2006 - 2008, Intel Corporation \r |
d1f95000 | 10 | All rights reserved. This program and the accompanying materials \r |
11 | are licensed and made available under the terms and conditions of the BSD License \r | |
12 | which accompanies this distribution. The full text of the license may be found at \r | |
13 | http://opensource.org/licenses/bsd-license.php \r | |
14 | \r | |
15 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r | |
16 | WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r | |
17 | \r | |
d1f95000 | 18 | **/\r |
19 | \r | |
20 | #ifndef __SIMPLE_TEXT_OUT_H__\r | |
21 | #define __SIMPLE_TEXT_OUT_H__\r | |
22 | \r | |
a6508c05 | 23 | #define EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL_GUID \\r |
d1f95000 | 24 | { \\r |
25 | 0x387477c2, 0x69c7, 0x11d2, {0x8e, 0x39, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x3b } \\r | |
26 | }\r | |
27 | \r | |
99e8ed21 | 28 | ///\r |
29 | /// Protocol GUID defined in EFI1.1.\r | |
30 | /// \r | |
a6508c05 | 31 | #define SIMPLE_TEXT_OUTPUT_PROTOCOL EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL_GUID\r |
32 | \r | |
33 | typedef struct _EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL;\r | |
d1f95000 | 34 | \r |
99e8ed21 | 35 | ///\r |
36 | /// Backward-compatible with EFI1.1.\r | |
37 | /// \r | |
a6508c05 | 38 | typedef EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL SIMPLE_TEXT_OUTPUT_INTERFACE;\r |
d1f95000 | 39 | \r |
40 | //\r | |
41 | // Define's for required EFI Unicode Box Draw characters\r | |
42 | //\r | |
43 | #define BOXDRAW_HORIZONTAL 0x2500\r | |
44 | #define BOXDRAW_VERTICAL 0x2502\r | |
45 | #define BOXDRAW_DOWN_RIGHT 0x250c\r | |
46 | #define BOXDRAW_DOWN_LEFT 0x2510\r | |
47 | #define BOXDRAW_UP_RIGHT 0x2514\r | |
48 | #define BOXDRAW_UP_LEFT 0x2518\r | |
49 | #define BOXDRAW_VERTICAL_RIGHT 0x251c\r | |
50 | #define BOXDRAW_VERTICAL_LEFT 0x2524\r | |
51 | #define BOXDRAW_DOWN_HORIZONTAL 0x252c\r | |
52 | #define BOXDRAW_UP_HORIZONTAL 0x2534\r | |
53 | #define BOXDRAW_VERTICAL_HORIZONTAL 0x253c\r | |
54 | #define BOXDRAW_DOUBLE_HORIZONTAL 0x2550\r | |
55 | #define BOXDRAW_DOUBLE_VERTICAL 0x2551\r | |
56 | #define BOXDRAW_DOWN_RIGHT_DOUBLE 0x2552\r | |
57 | #define BOXDRAW_DOWN_DOUBLE_RIGHT 0x2553\r | |
58 | #define BOXDRAW_DOUBLE_DOWN_RIGHT 0x2554\r | |
59 | #define BOXDRAW_DOWN_LEFT_DOUBLE 0x2555\r | |
60 | #define BOXDRAW_DOWN_DOUBLE_LEFT 0x2556\r | |
61 | #define BOXDRAW_DOUBLE_DOWN_LEFT 0x2557\r | |
62 | #define BOXDRAW_UP_RIGHT_DOUBLE 0x2558\r | |
63 | #define BOXDRAW_UP_DOUBLE_RIGHT 0x2559\r | |
64 | #define BOXDRAW_DOUBLE_UP_RIGHT 0x255a\r | |
65 | #define BOXDRAW_UP_LEFT_DOUBLE 0x255b\r | |
66 | #define BOXDRAW_UP_DOUBLE_LEFT 0x255c\r | |
67 | #define BOXDRAW_DOUBLE_UP_LEFT 0x255d\r | |
68 | #define BOXDRAW_VERTICAL_RIGHT_DOUBLE 0x255e\r | |
69 | #define BOXDRAW_VERTICAL_DOUBLE_RIGHT 0x255f\r | |
70 | #define BOXDRAW_DOUBLE_VERTICAL_RIGHT 0x2560\r | |
71 | #define BOXDRAW_VERTICAL_LEFT_DOUBLE 0x2561\r | |
72 | #define BOXDRAW_VERTICAL_DOUBLE_LEFT 0x2562\r | |
73 | #define BOXDRAW_DOUBLE_VERTICAL_LEFT 0x2563\r | |
74 | #define BOXDRAW_DOWN_HORIZONTAL_DOUBLE 0x2564\r | |
75 | #define BOXDRAW_DOWN_DOUBLE_HORIZONTAL 0x2565\r | |
76 | #define BOXDRAW_DOUBLE_DOWN_HORIZONTAL 0x2566\r | |
77 | #define BOXDRAW_UP_HORIZONTAL_DOUBLE 0x2567\r | |
78 | #define BOXDRAW_UP_DOUBLE_HORIZONTAL 0x2568\r | |
79 | #define BOXDRAW_DOUBLE_UP_HORIZONTAL 0x2569\r | |
80 | #define BOXDRAW_VERTICAL_HORIZONTAL_DOUBLE 0x256a\r | |
81 | #define BOXDRAW_VERTICAL_DOUBLE_HORIZONTAL 0x256b\r | |
82 | #define BOXDRAW_DOUBLE_VERTICAL_HORIZONTAL 0x256c\r | |
83 | \r | |
84 | //\r | |
85 | // EFI Required Block Elements Code Chart\r | |
86 | //\r | |
87 | #define BLOCKELEMENT_FULL_BLOCK 0x2588\r | |
88 | #define BLOCKELEMENT_LIGHT_SHADE 0x2591\r | |
89 | \r | |
90 | //\r | |
91 | // EFI Required Geometric Shapes Code Chart\r | |
92 | //\r | |
93 | #define GEOMETRICSHAPE_UP_TRIANGLE 0x25b2\r | |
94 | #define GEOMETRICSHAPE_RIGHT_TRIANGLE 0x25ba\r | |
95 | #define GEOMETRICSHAPE_DOWN_TRIANGLE 0x25bc\r | |
96 | #define GEOMETRICSHAPE_LEFT_TRIANGLE 0x25c4\r | |
97 | \r | |
98 | //\r | |
99 | // EFI Required Arrow shapes\r | |
100 | //\r | |
101 | #define ARROW_LEFT 0x2190\r | |
102 | #define ARROW_UP 0x2191\r | |
103 | #define ARROW_RIGHT 0x2192\r | |
104 | #define ARROW_DOWN 0x2193\r | |
105 | \r | |
106 | //\r | |
107 | // EFI Console Colours\r | |
108 | //\r | |
109 | #define EFI_BLACK 0x00\r | |
110 | #define EFI_BLUE 0x01\r | |
111 | #define EFI_GREEN 0x02\r | |
112 | #define EFI_CYAN (EFI_BLUE | EFI_GREEN)\r | |
113 | #define EFI_RED 0x04\r | |
114 | #define EFI_MAGENTA (EFI_BLUE | EFI_RED)\r | |
115 | #define EFI_BROWN (EFI_GREEN | EFI_RED)\r | |
116 | #define EFI_LIGHTGRAY (EFI_BLUE | EFI_GREEN | EFI_RED)\r | |
117 | #define EFI_BRIGHT 0x08\r | |
118 | #define EFI_DARKGRAY (EFI_BRIGHT)\r | |
119 | #define EFI_LIGHTBLUE (EFI_BLUE | EFI_BRIGHT)\r | |
120 | #define EFI_LIGHTGREEN (EFI_GREEN | EFI_BRIGHT)\r | |
121 | #define EFI_LIGHTCYAN (EFI_CYAN | EFI_BRIGHT)\r | |
122 | #define EFI_LIGHTRED (EFI_RED | EFI_BRIGHT)\r | |
123 | #define EFI_LIGHTMAGENTA (EFI_MAGENTA | EFI_BRIGHT)\r | |
124 | #define EFI_YELLOW (EFI_BROWN | EFI_BRIGHT)\r | |
125 | #define EFI_WHITE (EFI_BLUE | EFI_GREEN | EFI_RED | EFI_BRIGHT)\r | |
126 | \r | |
127 | #define EFI_TEXT_ATTR(f, b) ((f) | ((b) << 4))\r | |
128 | \r | |
129 | #define EFI_BACKGROUND_BLACK 0x00\r | |
130 | #define EFI_BACKGROUND_BLUE 0x10\r | |
131 | #define EFI_BACKGROUND_GREEN 0x20\r | |
132 | #define EFI_BACKGROUND_CYAN (EFI_BACKGROUND_BLUE | EFI_BACKGROUND_GREEN)\r | |
133 | #define EFI_BACKGROUND_RED 0x40\r | |
134 | #define EFI_BACKGROUND_MAGENTA (EFI_BACKGROUND_BLUE | EFI_BACKGROUND_RED)\r | |
135 | #define EFI_BACKGROUND_BROWN (EFI_BACKGROUND_GREEN | EFI_BACKGROUND_RED)\r | |
136 | #define EFI_BACKGROUND_LIGHTGRAY (EFI_BACKGROUND_BLUE | EFI_BACKGROUND_GREEN | EFI_BACKGROUND_RED)\r | |
137 | \r | |
138 | //\r | |
139 | // We currently define attributes from 0 - 7F for color manipulations\r | |
140 | // To internally handle the local display characteristics for a particular character, we are defining\r | |
141 | // Bit 7 to signify the local glyph representation for a character. If turned on, glyphs will be\r | |
142 | // pulled from the wide glyph database and will display locally as a wide character (16 X 19 versus 8 X 19)\r | |
143 | // If bit 7 is off, the narrow glyph database will be used. This does NOT affect information that is sent to\r | |
144 | // non-local displays (e.g. serial or LAN consoles).\r | |
145 | //\r | |
146 | #define EFI_WIDE_ATTRIBUTE 0x80\r | |
147 | \r | |
148 | /**\r | |
149 | Reset the text output device hardware and optionaly run diagnostics\r | |
150 | \r | |
151 | @param This Protocol instance pointer.\r | |
152 | @param ExtendedVerification Driver may perform more exhaustive verfication\r | |
153 | operation of the device during reset.\r | |
154 | \r | |
155 | @retval EFI_SUCCESS The text output device was reset.\r | |
156 | @retval EFI_DEVICE_ERROR The text output device is not functioning correctly and\r | |
157 | could not be reset.\r | |
158 | \r | |
159 | **/\r | |
160 | typedef\r | |
161 | EFI_STATUS\r | |
8b13229b | 162 | (EFIAPI *EFI_TEXT_RESET)(\r |
4ca9b6c4 | 163 | IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This,\r |
d1f95000 | 164 | IN BOOLEAN ExtendedVerification\r |
ed66e1bc | 165 | );\r |
d1f95000 | 166 | \r |
167 | /**\r | |
168 | Write a Unicode string to the output device.\r | |
169 | \r | |
170 | @param This Protocol instance pointer.\r | |
171 | @param String The NULL-terminated Unicode string to be displayed on the output\r | |
172 | device(s). All output devices must also support the Unicode\r | |
173 | drawing defined in this file.\r | |
174 | \r | |
175 | @retval EFI_SUCCESS The string was output to the device.\r | |
176 | @retval EFI_DEVICE_ERROR The device reported an error while attempting to output\r | |
177 | the text.\r | |
178 | @retval EFI_UNSUPPORTED The output device's mode is not currently in a\r | |
179 | defined text mode.\r | |
180 | @retval EFI_WARN_UNKNOWN_GLYPH This warning code indicates that some of the\r | |
181 | characters in the Unicode string could not be\r | |
182 | rendered and were skipped.\r | |
183 | \r | |
184 | **/\r | |
185 | typedef\r | |
186 | EFI_STATUS\r | |
8b13229b | 187 | (EFIAPI *EFI_TEXT_STRING)(\r |
a6508c05 | 188 | IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This,\r |
d1f95000 | 189 | IN CHAR16 *String\r |
ed66e1bc | 190 | );\r |
d1f95000 | 191 | \r |
192 | /**\r | |
193 | Verifies that all characters in a Unicode string can be output to the \r | |
194 | target device.\r | |
195 | \r | |
196 | @param This Protocol instance pointer.\r | |
197 | @param String The NULL-terminated Unicode string to be examined for the output\r | |
198 | device(s).\r | |
199 | \r | |
200 | @retval EFI_SUCCESS The device(s) are capable of rendering the output string.\r | |
201 | @retval EFI_UNSUPPORTED Some of the characters in the Unicode string cannot be\r | |
202 | rendered by one or more of the output devices mapped\r | |
203 | by the EFI handle.\r | |
204 | \r | |
205 | **/\r | |
206 | typedef\r | |
207 | EFI_STATUS\r | |
8b13229b | 208 | (EFIAPI *EFI_TEXT_TEST_STRING)(\r |
a6508c05 | 209 | IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This,\r |
d1f95000 | 210 | IN CHAR16 *String\r |
ed66e1bc | 211 | );\r |
d1f95000 | 212 | \r |
213 | /**\r | |
214 | Returns information for an available text mode that the output device(s)\r | |
215 | supports.\r | |
216 | \r | |
217 | @param This Protocol instance pointer.\r | |
218 | @param ModeNumber The mode number to return information on.\r | |
219 | @param Columns Returns the geometry of the text output device for the\r | |
220 | requested ModeNumber.\r | |
221 | @param Rows Returns the geometry of the text output device for the\r | |
222 | requested ModeNumber.\r | |
223 | \r | |
224 | @retval EFI_SUCCESS The requested mode information was returned.\r | |
225 | @retval EFI_DEVICE_ERROR The device had an error and could not complete the request.\r | |
226 | @retval EFI_UNSUPPORTED The mode number was not valid.\r | |
227 | \r | |
228 | **/\r | |
229 | typedef\r | |
230 | EFI_STATUS\r | |
8b13229b | 231 | (EFIAPI *EFI_TEXT_QUERY_MODE)(\r |
a6508c05 | 232 | IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This,\r |
d1f95000 | 233 | IN UINTN ModeNumber,\r |
234 | OUT UINTN *Columns,\r | |
235 | OUT UINTN *Rows\r | |
ed66e1bc | 236 | );\r |
d1f95000 | 237 | \r |
238 | /**\r | |
239 | Sets the output device(s) to a specified mode.\r | |
240 | \r | |
241 | @param This Protocol instance pointer.\r | |
242 | @param ModeNumber The mode number to set.\r | |
243 | \r | |
244 | @retval EFI_SUCCESS The requested text mode was set.\r | |
245 | @retval EFI_DEVICE_ERROR The device had an error and could not complete the request.\r | |
246 | @retval EFI_UNSUPPORTED The mode number was not valid.\r | |
247 | \r | |
248 | **/\r | |
249 | typedef\r | |
250 | EFI_STATUS\r | |
8b13229b | 251 | (EFIAPI *EFI_TEXT_SET_MODE)(\r |
a6508c05 | 252 | IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This,\r |
d1f95000 | 253 | IN UINTN ModeNumber\r |
ed66e1bc | 254 | );\r |
d1f95000 | 255 | \r |
256 | /**\r | |
257 | Sets the background and foreground colors for the OutputString () and\r | |
258 | ClearScreen () functions.\r | |
259 | \r | |
260 | @param This Protocol instance pointer.\r | |
261 | @param Attribute The attribute to set. Bits 0..3 are the foreground color, and\r | |
262 | bits 4..6 are the background color. All other bits are undefined\r | |
263 | and must be zero. The valid Attributes are defined in this file.\r | |
264 | \r | |
265 | @retval EFI_SUCCESS The attribute was set.\r | |
266 | @retval EFI_DEVICE_ ERROR The device had an error and could not complete the request.\r | |
267 | @retval EFI_UNSUPPORTED The attribute requested is not defined.\r | |
268 | \r | |
269 | **/\r | |
270 | typedef\r | |
271 | EFI_STATUS\r | |
8b13229b | 272 | (EFIAPI *EFI_TEXT_SET_ATTRIBUTE)(\r |
a6508c05 | 273 | IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This,\r |
d1f95000 | 274 | IN UINTN Attribute\r |
ed66e1bc | 275 | );\r |
d1f95000 | 276 | \r |
277 | /**\r | |
278 | Clears the output device(s) display to the currently selected background \r | |
279 | color.\r | |
280 | \r | |
281 | @param This Protocol instance pointer.\r | |
282 | \r | |
283 | @retval EFI_SUCCESS The operation completed successfully.\r | |
284 | @retval EFI_DEVICE_ERROR The device had an error and could not complete the request.\r | |
285 | @retval EFI_UNSUPPORTED The output device is not in a valid text mode.\r | |
286 | \r | |
287 | **/\r | |
288 | typedef\r | |
289 | EFI_STATUS\r | |
8b13229b | 290 | (EFIAPI *EFI_TEXT_CLEAR_SCREEN)(\r |
a6508c05 | 291 | IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This\r |
ed66e1bc | 292 | );\r |
d1f95000 | 293 | \r |
294 | /**\r | |
295 | Sets the current coordinates of the cursor position\r | |
296 | \r | |
297 | @param This Protocol instance pointer.\r | |
298 | @param Column The position to set the cursor to. Must be greater than or\r | |
299 | equal to zero and less than the number of columns and rows\r | |
300 | by QueryMode ().\r | |
301 | @param Row The position to set the cursor to. Must be greater than or\r | |
302 | equal to zero and less than the number of columns and rows\r | |
303 | by QueryMode ().\r | |
304 | \r | |
305 | @retval EFI_SUCCESS The operation completed successfully.\r | |
306 | @retval EFI_DEVICE_ERROR The device had an error and could not complete the request.\r | |
307 | @retval EFI_UNSUPPORTED The output device is not in a valid text mode, or the\r | |
308 | cursor position is invalid for the current mode.\r | |
309 | \r | |
310 | **/\r | |
311 | typedef\r | |
312 | EFI_STATUS\r | |
8b13229b | 313 | (EFIAPI *EFI_TEXT_SET_CURSOR_POSITION)(\r |
a6508c05 | 314 | IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This,\r |
d1f95000 | 315 | IN UINTN Column,\r |
316 | IN UINTN Row\r | |
ed66e1bc | 317 | );\r |
d1f95000 | 318 | \r |
319 | /**\r | |
320 | Makes the cursor visible or invisible\r | |
321 | \r | |
322 | @param This Protocol instance pointer.\r | |
323 | @param Visible If TRUE, the cursor is set to be visible. If FALSE, the cursor is\r | |
324 | set to be invisible.\r | |
325 | \r | |
326 | @retval EFI_SUCCESS The operation completed successfully.\r | |
327 | @retval EFI_DEVICE_ERROR The device had an error and could not complete the\r | |
328 | request, or the device does not support changing\r | |
329 | the cursor mode.\r | |
330 | @retval EFI_UNSUPPORTED The output device is not in a valid text mode.\r | |
331 | \r | |
332 | **/\r | |
333 | typedef\r | |
334 | EFI_STATUS\r | |
8b13229b | 335 | (EFIAPI *EFI_TEXT_ENABLE_CURSOR)(\r |
a6508c05 | 336 | IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *This,\r |
d1f95000 | 337 | IN BOOLEAN Visible\r |
ed66e1bc | 338 | );\r |
d1f95000 | 339 | \r |
340 | /**\r | |
4ca9b6c4 | 341 | @par Data Structure Description:\r |
d1f95000 | 342 | Mode Structure pointed to by Simple Text Out protocol.\r |
343 | \r | |
4ca9b6c4 LG |
344 | @param MaxMode\r |
345 | The number of modes supported by QueryMode () and SetMode ().\r | |
346 | \r | |
347 | @param Mode\r | |
348 | The text mode of the output device(s).\r | |
349 | \r | |
350 | @param Attribute\r | |
351 | The current character output attribute\r | |
352 | \r | |
353 | @param CursorColumn\r | |
354 | The cursor's column.\r | |
355 | \r | |
356 | @param CursorRow\r | |
357 | The cursor's row.\r | |
358 | \r | |
359 | @param CursorVisible\r | |
360 | The cursor is currently visbile or not.\r | |
d1f95000 | 361 | \r |
362 | **/\r | |
363 | typedef struct {\r | |
364 | INT32 MaxMode;\r | |
365 | \r | |
366 | //\r | |
367 | // current settings\r | |
368 | //\r | |
369 | INT32 Mode;\r | |
370 | INT32 Attribute;\r | |
371 | INT32 CursorColumn;\r | |
372 | INT32 CursorRow;\r | |
373 | BOOLEAN CursorVisible;\r | |
374 | } EFI_SIMPLE_TEXT_OUTPUT_MODE;\r | |
375 | \r | |
44717a39 | 376 | ///\r |
377 | /// The SIMPLE_TEXT_OUTPUT protocol is used to control text-based output devices. \r | |
378 | /// It is the minimum required protocol for any handle supplied as the ConsoleOut \r | |
379 | /// or StandardError device. In addition, the minimum supported text mode of such \r | |
380 | /// devices is at least 80 x 25 characters.\r | |
381 | ///\r | |
a6508c05 | 382 | struct _EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL {\r |
d1f95000 | 383 | EFI_TEXT_RESET Reset;\r |
384 | \r | |
385 | EFI_TEXT_STRING OutputString;\r | |
386 | EFI_TEXT_TEST_STRING TestString;\r | |
387 | \r | |
388 | EFI_TEXT_QUERY_MODE QueryMode;\r | |
389 | EFI_TEXT_SET_MODE SetMode;\r | |
390 | EFI_TEXT_SET_ATTRIBUTE SetAttribute;\r | |
391 | \r | |
392 | EFI_TEXT_CLEAR_SCREEN ClearScreen;\r | |
393 | EFI_TEXT_SET_CURSOR_POSITION SetCursorPosition;\r | |
394 | EFI_TEXT_ENABLE_CURSOR EnableCursor;\r | |
395 | \r | |
44717a39 | 396 | ///\r |
397 | /// Pointer to SIMPLE_TEXT_OUTPUT_MODE data.\r | |
398 | ///\r | |
d1f95000 | 399 | EFI_SIMPLE_TEXT_OUTPUT_MODE *Mode;\r |
400 | };\r | |
401 | \r | |
09f0ddd0 | 402 | extern EFI_GUID gEfiSimpleTextOutProtocolGuid;\r |
d1f95000 | 403 | \r |
404 | #endif\r |