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