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