SimpleTextOut.h

Go to the documentation of this file.
00001 /** @file
00002   Simple Text Out protocol from the UEFI 2.0 specification.
00003 
00004   Abstraction of a very simple text based output device like VGA text mode or
00005   a serial terminal. The Simple Text Out protocol instance can represent
00006   a single hardware device or a virtual device that is an agregation
00007   of multiple physical devices.
00008 
00009   Copyright (c) 2006 - 2008, Intel Corporation
00010   All rights reserved. This program and the accompanying materials
00011   are licensed and made available under the terms and conditions of the BSD License
00012   which accompanies this distribution.  The full text of the license may be found at
00013   http://opensource.org/licenses/bsd-license.php
00014 
00015   THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
00016   WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
00017 
00018 **/
00019 
00020 #ifndef __SIMPLE_TEXT_OUT_H__
00021 #define __SIMPLE_TEXT_OUT_H__
00022 
00023 #define EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL_GUID \
00024   { \
00025     0x387477c2, 0x69c7, 0x11d2, {0x8e, 0x39, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x3b } \
00026   }
00027 
00028 ///
00029 /// Protocol GUID defined in EFI1.1.
00030 ///
00031 #define SIMPLE_TEXT_OUTPUT_PROTOCOL   EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL_GUID
00032 
00033 typedef struct _EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL;
00034 
00035 ///
00036 /// Backward-compatible with EFI1.1.
00037 ///
00038 typedef EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL   SIMPLE_TEXT_OUTPUT_INTERFACE;
00039 
00040 //
00041 // Define's for required EFI Unicode Box Draw characters
00042 //
00043 #define BOXDRAW_HORIZONTAL                  0x2500
00044 #define BOXDRAW_VERTICAL                    0x2502
00045 #define BOXDRAW_DOWN_RIGHT                  0x250c
00046 #define BOXDRAW_DOWN_LEFT                   0x2510
00047 #define BOXDRAW_UP_RIGHT                    0x2514
00048 #define BOXDRAW_UP_LEFT                     0x2518
00049 #define BOXDRAW_VERTICAL_RIGHT              0x251c
00050 #define BOXDRAW_VERTICAL_LEFT               0x2524
00051 #define BOXDRAW_DOWN_HORIZONTAL             0x252c
00052 #define BOXDRAW_UP_HORIZONTAL               0x2534
00053 #define BOXDRAW_VERTICAL_HORIZONTAL         0x253c
00054 #define BOXDRAW_DOUBLE_HORIZONTAL           0x2550
00055 #define BOXDRAW_DOUBLE_VERTICAL             0x2551
00056 #define BOXDRAW_DOWN_RIGHT_DOUBLE           0x2552
00057 #define BOXDRAW_DOWN_DOUBLE_RIGHT           0x2553
00058 #define BOXDRAW_DOUBLE_DOWN_RIGHT           0x2554
00059 #define BOXDRAW_DOWN_LEFT_DOUBLE            0x2555
00060 #define BOXDRAW_DOWN_DOUBLE_LEFT            0x2556
00061 #define BOXDRAW_DOUBLE_DOWN_LEFT            0x2557
00062 #define BOXDRAW_UP_RIGHT_DOUBLE             0x2558
00063 #define BOXDRAW_UP_DOUBLE_RIGHT             0x2559
00064 #define BOXDRAW_DOUBLE_UP_RIGHT             0x255a
00065 #define BOXDRAW_UP_LEFT_DOUBLE              0x255b
00066 #define BOXDRAW_UP_DOUBLE_LEFT              0x255c
00067 #define BOXDRAW_DOUBLE_UP_LEFT              0x255d
00068 #define BOXDRAW_VERTICAL_RIGHT_DOUBLE       0x255e
00069 #define BOXDRAW_VERTICAL_DOUBLE_RIGHT       0x255f
00070 #define BOXDRAW_DOUBLE_VERTICAL_RIGHT       0x2560
00071 #define BOXDRAW_VERTICAL_LEFT_DOUBLE        0x2561
00072 #define BOXDRAW_VERTICAL_DOUBLE_LEFT        0x2562
00073 #define BOXDRAW_DOUBLE_VERTICAL_LEFT        0x2563
00074 #define BOXDRAW_DOWN_HORIZONTAL_DOUBLE      0x2564
00075 #define BOXDRAW_DOWN_DOUBLE_HORIZONTAL      0x2565
00076 #define BOXDRAW_DOUBLE_DOWN_HORIZONTAL      0x2566
00077 #define BOXDRAW_UP_HORIZONTAL_DOUBLE        0x2567
00078 #define BOXDRAW_UP_DOUBLE_HORIZONTAL        0x2568
00079 #define BOXDRAW_DOUBLE_UP_HORIZONTAL        0x2569
00080 #define BOXDRAW_VERTICAL_HORIZONTAL_DOUBLE  0x256a
00081 #define BOXDRAW_VERTICAL_DOUBLE_HORIZONTAL  0x256b
00082 #define BOXDRAW_DOUBLE_VERTICAL_HORIZONTAL  0x256c
00083 
00084 //
00085 // EFI Required Block Elements Code Chart
00086 //
00087 #define BLOCKELEMENT_FULL_BLOCK   0x2588
00088 #define BLOCKELEMENT_LIGHT_SHADE  0x2591
00089 
00090 //
00091 // EFI Required Geometric Shapes Code Chart
00092 //
00093 #define GEOMETRICSHAPE_UP_TRIANGLE    0x25b2
00094 #define GEOMETRICSHAPE_RIGHT_TRIANGLE 0x25ba
00095 #define GEOMETRICSHAPE_DOWN_TRIANGLE  0x25bc
00096 #define GEOMETRICSHAPE_LEFT_TRIANGLE  0x25c4
00097 
00098 //
00099 // EFI Required Arrow shapes
00100 //
00101 #define ARROW_LEFT  0x2190
00102 #define ARROW_UP    0x2191
00103 #define ARROW_RIGHT 0x2192
00104 #define ARROW_DOWN  0x2193
00105 
00106 //
00107 // EFI Console Colours
00108 //
00109 #define EFI_BLACK                 0x00
00110 #define EFI_BLUE                  0x01
00111 #define EFI_GREEN                 0x02
00112 #define EFI_CYAN                  (EFI_BLUE | EFI_GREEN)
00113 #define EFI_RED                   0x04
00114 #define EFI_MAGENTA               (EFI_BLUE | EFI_RED)
00115 #define EFI_BROWN                 (EFI_GREEN | EFI_RED)
00116 #define EFI_LIGHTGRAY             (EFI_BLUE | EFI_GREEN | EFI_RED)
00117 #define EFI_BRIGHT                0x08
00118 #define EFI_DARKGRAY              (EFI_BRIGHT)
00119 #define EFI_LIGHTBLUE             (EFI_BLUE | EFI_BRIGHT)
00120 #define EFI_LIGHTGREEN            (EFI_GREEN | EFI_BRIGHT)
00121 #define EFI_LIGHTCYAN             (EFI_CYAN | EFI_BRIGHT)
00122 #define EFI_LIGHTRED              (EFI_RED | EFI_BRIGHT)
00123 #define EFI_LIGHTMAGENTA          (EFI_MAGENTA | EFI_BRIGHT)
00124 #define EFI_YELLOW                (EFI_BROWN | EFI_BRIGHT)
00125 #define EFI_WHITE                 (EFI_BLUE | EFI_GREEN | EFI_RED | EFI_BRIGHT)
00126 
00127 #define EFI_TEXT_ATTR(f, b)       ((f) | ((b) << 4))
00128 
00129 #define EFI_BACKGROUND_BLACK      0x00
00130 #define EFI_BACKGROUND_BLUE       0x10
00131 #define EFI_BACKGROUND_GREEN      0x20
00132 #define EFI_BACKGROUND_CYAN       (EFI_BACKGROUND_BLUE | EFI_BACKGROUND_GREEN)
00133 #define EFI_BACKGROUND_RED        0x40
00134 #define EFI_BACKGROUND_MAGENTA    (EFI_BACKGROUND_BLUE | EFI_BACKGROUND_RED)
00135 #define EFI_BACKGROUND_BROWN      (EFI_BACKGROUND_GREEN | EFI_BACKGROUND_RED)
00136 #define EFI_BACKGROUND_LIGHTGRAY  (EFI_BACKGROUND_BLUE | EFI_BACKGROUND_GREEN | EFI_BACKGROUND_RED)
00137 
00138 //
00139 // We currently define attributes from 0 - 7F for color manipulations
00140 // To internally handle the local display characteristics for a particular character, we are defining
00141 // Bit 7 to signify the local glyph representation for a character.  If turned on, glyphs will be
00142 // pulled from the wide glyph database and will display locally as a wide character (16 X 19 versus 8 X 19)
00143 // If bit 7 is off, the narrow glyph database will be used.  This does NOT affect information that is sent to
00144 // non-local displays (e.g. serial or LAN consoles).
00145 //
00146 #define EFI_WIDE_ATTRIBUTE  0x80
00147 
00148 /**
00149   Reset the text output device hardware and optionaly run diagnostics
00150 
00151   @param  This                 Protocol instance pointer.
00152   @param  ExtendedVerification Driver may perform more exhaustive verfication
00153                                operation of the device during reset.
00154 
00155   @retval EFI_SUCCESS          The text output device was reset.
00156   @retval EFI_DEVICE_ERROR     The text output device is not functioning correctly and
00157                                could not be reset.
00158 
00159 **/
00160 typedef
00161 EFI_STATUS
00162 (EFIAPI *EFI_TEXT_RESET)(
00163   IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL        *This,
00164   IN BOOLEAN                                ExtendedVerification
00165   );
00166 
00167 /**
00168   Write a Unicode string to the output device.
00169 
00170   @param  This   Protocol instance pointer.
00171   @param  String The NULL-terminated Unicode string to be displayed on the output
00172                  device(s). All output devices must also support the Unicode
00173                  drawing defined in this file.
00174 
00175   @retval EFI_SUCCESS             The string was output to the device.
00176   @retval EFI_DEVICE_ERROR        The device reported an error while attempting to output
00177                                   the text.
00178   @retval EFI_UNSUPPORTED         The output device's mode is not currently in a
00179                                   defined text mode.
00180   @retval EFI_WARN_UNKNOWN_GLYPH  This warning code indicates that some of the
00181                                   characters in the Unicode string could not be
00182                                   rendered and were skipped.
00183 
00184 **/
00185 typedef
00186 EFI_STATUS
00187 (EFIAPI *EFI_TEXT_STRING)(
00188   IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL        *This,
00189   IN CHAR16                                 *String
00190   );
00191 
00192 /**
00193   Verifies that all characters in a Unicode string can be output to the
00194   target device.
00195 
00196   @param  This   Protocol instance pointer.
00197   @param  String The NULL-terminated Unicode string to be examined for the output
00198                  device(s).
00199 
00200   @retval EFI_SUCCESS      The device(s) are capable of rendering the output string.
00201   @retval EFI_UNSUPPORTED  Some of the characters in the Unicode string cannot be
00202                            rendered by one or more of the output devices mapped
00203                            by the EFI handle.
00204 
00205 **/
00206 typedef
00207 EFI_STATUS
00208 (EFIAPI *EFI_TEXT_TEST_STRING)(
00209   IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL        *This,
00210   IN CHAR16                                 *String
00211   );
00212 
00213 /**
00214   Returns information for an available text mode that the output device(s)
00215   supports.
00216 
00217   @param  This       Protocol instance pointer.
00218   @param  ModeNumber The mode number to return information on.
00219   @param  Columns    Returns the geometry of the text output device for the
00220                      requested ModeNumber.
00221   @param  Rows       Returns the geometry of the text output device for the
00222                      requested ModeNumber.
00223 
00224   @retval EFI_SUCCESS      The requested mode information was returned.
00225   @retval EFI_DEVICE_ERROR The device had an error and could not complete the request.
00226   @retval EFI_UNSUPPORTED  The mode number was not valid.
00227 
00228 **/
00229 typedef
00230 EFI_STATUS
00231 (EFIAPI *EFI_TEXT_QUERY_MODE)(
00232   IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL        *This,
00233   IN UINTN                                  ModeNumber,
00234   OUT UINTN                                 *Columns,
00235   OUT UINTN                                 *Rows
00236   );
00237 
00238 /**
00239   Sets the output device(s) to a specified mode.
00240 
00241   @param  This       Protocol instance pointer.
00242   @param  ModeNumber The mode number to set.
00243 
00244   @retval EFI_SUCCESS      The requested text mode was set.
00245   @retval EFI_DEVICE_ERROR The device had an error and could not complete the request.
00246   @retval EFI_UNSUPPORTED  The mode number was not valid.
00247 
00248 **/
00249 typedef
00250 EFI_STATUS
00251 (EFIAPI *EFI_TEXT_SET_MODE)(
00252   IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL        *This,
00253   IN UINTN                                  ModeNumber
00254   );
00255 
00256 /**
00257   Sets the background and foreground colors for the OutputString () and
00258   ClearScreen () functions.
00259 
00260   @param  This      Protocol instance pointer.
00261   @param  Attribute The attribute to set. Bits 0..3 are the foreground color, and
00262                     bits 4..6 are the background color. All other bits are undefined
00263                     and must be zero. The valid Attributes are defined in this file.
00264 
00265   @retval EFI_SUCCESS     The attribute was set.
00266   @retval EFI_DEVICE_     ERROR The device had an error and could not complete the request.
00267   @retval EFI_UNSUPPORTED The attribute requested is not defined.
00268 
00269 **/
00270 typedef
00271 EFI_STATUS
00272 (EFIAPI *EFI_TEXT_SET_ATTRIBUTE)(
00273   IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL        *This,
00274   IN UINTN                                  Attribute
00275   );
00276 
00277 /**
00278   Clears the output device(s) display to the currently selected background
00279   color.
00280 
00281   @param  This              Protocol instance pointer.
00282 
00283   @retval  EFI_SUCCESS      The operation completed successfully.
00284   @retval  EFI_DEVICE_ERROR The device had an error and could not complete the request.
00285   @retval  EFI_UNSUPPORTED  The output device is not in a valid text mode.
00286 
00287 **/
00288 typedef
00289 EFI_STATUS
00290 (EFIAPI *EFI_TEXT_CLEAR_SCREEN)(
00291   IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL   *This
00292   );
00293 
00294 /**
00295   Sets the current coordinates of the cursor position
00296 
00297   @param  This        Protocol instance pointer.
00298   @param  Column      The position to set the cursor to. Must be greater than or
00299                       equal to zero and less than the number of columns and rows
00300                       by QueryMode ().
00301   @param  Row         The position to set the cursor to. Must be greater than or
00302                       equal to zero and less than the number of columns and rows
00303                       by QueryMode ().
00304 
00305   @retval EFI_SUCCESS      The operation completed successfully.
00306   @retval EFI_DEVICE_ERROR The device had an error and could not complete the request.
00307   @retval EFI_UNSUPPORTED  The output device is not in a valid text mode, or the
00308                            cursor position is invalid for the current mode.
00309 
00310 **/
00311 typedef
00312 EFI_STATUS
00313 (EFIAPI *EFI_TEXT_SET_CURSOR_POSITION)(
00314   IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL        *This,
00315   IN UINTN                                  Column,
00316   IN UINTN                                  Row
00317   );
00318 
00319 /**
00320   Makes the cursor visible or invisible
00321 
00322   @param  This    Protocol instance pointer.
00323   @param  Visible If TRUE, the cursor is set to be visible. If FALSE, the cursor is
00324                   set to be invisible.
00325 
00326   @retval EFI_SUCCESS      The operation completed successfully.
00327   @retval EFI_DEVICE_ERROR The device had an error and could not complete the
00328                            request, or the device does not support changing
00329                            the cursor mode.
00330   @retval EFI_UNSUPPORTED  The output device is not in a valid text mode.
00331 
00332 **/
00333 typedef
00334 EFI_STATUS
00335 (EFIAPI *EFI_TEXT_ENABLE_CURSOR)(
00336   IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL        *This,
00337   IN BOOLEAN                                Visible
00338   );
00339 
00340 /**
00341   @par Data Structure Description:
00342   Mode Structure pointed to by Simple Text Out protocol.
00343 
00344   @param MaxMode
00345   The number of modes supported by QueryMode () and SetMode ().
00346 
00347   @param Mode
00348   The text mode of the output device(s).
00349 
00350   @param Attribute
00351   The current character output attribute
00352 
00353   @param CursorColumn
00354   The cursor's column.
00355 
00356   @param CursorRow
00357   The cursor's row.
00358 
00359   @param CursorVisible
00360   The cursor is currently visbile or not.
00361 
00362 **/
00363 typedef struct {
00364   INT32   MaxMode;
00365 
00366   //
00367   // current settings
00368   //
00369   INT32   Mode;
00370   INT32   Attribute;
00371   INT32   CursorColumn;
00372   INT32   CursorRow;
00373   BOOLEAN CursorVisible;
00374 } EFI_SIMPLE_TEXT_OUTPUT_MODE;
00375 
00376 ///
00377 /// The SIMPLE_TEXT_OUTPUT protocol is used to control text-based output devices.
00378 /// It is the minimum required protocol for any handle supplied as the ConsoleOut
00379 /// or StandardError device. In addition, the minimum supported text mode of such
00380 /// devices is at least 80 x 25 characters.
00381 ///
00382 struct _EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL {
00383   EFI_TEXT_RESET                Reset;
00384 
00385   EFI_TEXT_STRING               OutputString;
00386   EFI_TEXT_TEST_STRING          TestString;
00387 
00388   EFI_TEXT_QUERY_MODE           QueryMode;
00389   EFI_TEXT_SET_MODE             SetMode;
00390   EFI_TEXT_SET_ATTRIBUTE        SetAttribute;
00391 
00392   EFI_TEXT_CLEAR_SCREEN         ClearScreen;
00393   EFI_TEXT_SET_CURSOR_POSITION  SetCursorPosition;
00394   EFI_TEXT_ENABLE_CURSOR        EnableCursor;
00395 
00396   ///
00397   /// Pointer to SIMPLE_TEXT_OUTPUT_MODE data.
00398   ///
00399   EFI_SIMPLE_TEXT_OUTPUT_MODE   *Mode;
00400 };
00401 
00402 extern EFI_GUID gEfiSimpleTextOutProtocolGuid;
00403 
00404 #endif

Generated on Tue Apr 6 20:01:07 2010 for gPXE by  doxygen 1.5.7.1