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