]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdePkg/Include/Protocol/SimpleTextOut.h
MdePkg: Refine EFI_DARKGRAY definition and comments for EFI_TEXT_ATTR
[mirror_edk2.git] / MdePkg / Include / Protocol / SimpleTextOut.h
index 2ab3fc4645ba2b7320a21525e2280d482ca947a5..5f64b64c2f7d55866a4c920d7fd468df29a86864 100644 (file)
@@ -3,17 +3,17 @@
 \r
   Abstraction of a very simple text based output device like VGA text mode or\r
   a serial terminal. The Simple Text Out protocol instance can represent\r
-  a single hardware device or a virtual device that is an agregation\r
+  a single hardware device or a virtual device that is an aggregation\r
   of multiple physical devices.\r
 \r
-  Copyright (c) 2006 - 2008, Intel Corporation                                                         \r
-  All rights reserved. This program and the accompanying materials                          \r
-  are licensed and made available under the terms and conditions of the BSD License         \r
-  which accompanies this distribution.  The full text of the license may be found at        \r
-  http://opensource.org/licenses/bsd-license.php                                            \r
-\r
-  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
-  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             \r
+Copyright (c) 2006 - 2015, Intel Corporation. All rights reserved.<BR>\r
+This program and the accompanying materials are licensed and made available under \r
+the terms and conditions of the BSD License that accompanies this distribution.  \r
+The full text of the license may be found at\r
+http://opensource.org/licenses/bsd-license.php.                                          \r
+    \r
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             \r
 \r
 **/\r
 \r
@@ -115,7 +115,7 @@ typedef EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL   SIMPLE_TEXT_OUTPUT_INTERFACE;
 #define EFI_BROWN                 (EFI_GREEN | EFI_RED)\r
 #define EFI_LIGHTGRAY             (EFI_BLUE | EFI_GREEN | EFI_RED)\r
 #define EFI_BRIGHT                0x08\r
-#define EFI_DARKGRAY              (EFI_BRIGHT)\r
+#define EFI_DARKGRAY              (EFI_BLACK | EFI_BRIGHT)\r
 #define EFI_LIGHTBLUE             (EFI_BLUE | EFI_BRIGHT)\r
 #define EFI_LIGHTGREEN            (EFI_GREEN | EFI_BRIGHT)\r
 #define EFI_LIGHTCYAN             (EFI_CYAN | EFI_BRIGHT)\r
@@ -124,7 +124,18 @@ typedef EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL   SIMPLE_TEXT_OUTPUT_INTERFACE;
 #define EFI_YELLOW                (EFI_BROWN | EFI_BRIGHT)\r
 #define EFI_WHITE                 (EFI_BLUE | EFI_GREEN | EFI_RED | EFI_BRIGHT)\r
 \r
-#define EFI_TEXT_ATTR(f, b)       ((f) | ((b) << 4))\r
+//\r
+// Macro to accept color values in their raw form to create \r
+// a value that represents both a foreground and background \r
+// color in a single byte.\r
+// For Foreground, and EFI_* value is valid from EFI_BLACK(0x00) to\r
+// EFI_WHITE (0x0F).\r
+// For Background, only EFI_BLACK, EFI_BLUE, EFI_GREEN, EFI_CYAN,\r
+// EFI_RED, EFI_MAGENTA, EFI_BROWN, and EFI_LIGHTGRAY are acceptable\r
+//\r
+// Do not use EFI_BACKGROUND_xxx values with this macro.\r
+//\r
+#define EFI_TEXT_ATTR(Foreground,Background) ((Foreground) | ((Background) << 4))\r
 \r
 #define EFI_BACKGROUND_BLACK      0x00\r
 #define EFI_BACKGROUND_BLUE       0x10\r
@@ -137,18 +148,18 @@ typedef EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL   SIMPLE_TEXT_OUTPUT_INTERFACE;
 \r
 //\r
 // We currently define attributes from 0 - 7F for color manipulations\r
-// To internally handle the local display characteristics for a particular character, we are defining\r
-// Bit 7 to signify the local glyph representation for a character.  If turned on, glyphs will be\r
+// To internally handle the local display characteristics for a particular character, \r
+// Bit 7 signifies the local glyph representation for a character.  If turned on, glyphs will be\r
 // pulled from the wide glyph database and will display locally as a wide character (16 X 19 versus 8 X 19)\r
 // If bit 7 is off, the narrow glyph database will be used.  This does NOT affect information that is sent to\r
-// non-local displays (e.g. serial or LAN consoles).\r
+// non-local displays, such as serial or LAN consoles.\r
 //\r
 #define EFI_WIDE_ATTRIBUTE  0x80\r
 \r
 /**\r
   Reset the text output device hardware and optionaly run diagnostics\r
 \r
-  @param  This                 Protocol instance pointer.\r
+  @param  This                 The protocol instance pointer.\r
   @param  ExtendedVerification Driver may perform more exhaustive verfication\r
                                operation of the device during reset.\r
 \r
@@ -165,12 +176,12 @@ EFI_STATUS
   );\r
 \r
 /**\r
-  Write a Unicode string to the output device.\r
+  Write a string to the output device.\r
 \r
-  @param  This   Protocol instance pointer.\r
-  @param  String The NULL-terminated Unicode string to be displayed on the output\r
+  @param  This   The protocol instance pointer.\r
+  @param  String The NULL-terminated string to be displayed on the output\r
                  device(s). All output devices must also support the Unicode\r
-                 drawing defined in this file.\r
+                 drawing character codes defined in this file.\r
 \r
   @retval EFI_SUCCESS             The string was output to the device.\r
   @retval EFI_DEVICE_ERROR        The device reported an error while attempting to output\r
@@ -178,7 +189,7 @@ EFI_STATUS
   @retval EFI_UNSUPPORTED         The output device's mode is not currently in a\r
                                   defined text mode.\r
   @retval EFI_WARN_UNKNOWN_GLYPH  This warning code indicates that some of the\r
-                                  characters in the Unicode string could not be\r
+                                  characters in the string could not be\r
                                   rendered and were skipped.\r
 \r
 **/\r
@@ -190,15 +201,15 @@ EFI_STATUS
   );\r
 \r
 /**\r
-  Verifies that all characters in a Unicode string can be output to the \r
+  Verifies that all characters in a string can be output to the \r
   target device.\r
 \r
-  @param  This   Protocol instance pointer.\r
-  @param  String The NULL-terminated Unicode string to be examined for the output\r
+  @param  This   The protocol instance pointer.\r
+  @param  String The NULL-terminated string to be examined for the output\r
                  device(s).\r
 \r
   @retval EFI_SUCCESS      The device(s) are capable of rendering the output string.\r
-  @retval EFI_UNSUPPORTED  Some of the characters in the Unicode string cannot be\r
+  @retval EFI_UNSUPPORTED  Some of the characters in the string cannot be\r
                            rendered by one or more of the output devices mapped\r
                            by the EFI handle.\r
 \r
@@ -214,7 +225,7 @@ EFI_STATUS
   Returns information for an available text mode that the output device(s)\r
   supports.\r
 \r
-  @param  This       Protocol instance pointer.\r
+  @param  This       The protocol instance pointer.\r
   @param  ModeNumber The mode number to return information on.\r
   @param  Columns    Returns the geometry of the text output device for the\r
                      requested ModeNumber.\r
@@ -238,7 +249,7 @@ EFI_STATUS
 /**\r
   Sets the output device(s) to a specified mode.\r
 \r
-  @param  This       Protocol instance pointer.\r
+  @param  This       The protocol instance pointer.\r
   @param  ModeNumber The mode number to set.\r
 \r
   @retval EFI_SUCCESS      The requested text mode was set.\r
@@ -257,14 +268,14 @@ EFI_STATUS
   Sets the background and foreground colors for the OutputString () and\r
   ClearScreen () functions.\r
 \r
-  @param  This      Protocol instance pointer.\r
+  @param  This      The protocol instance pointer.\r
   @param  Attribute The attribute to set. Bits 0..3 are the foreground color, and\r
                     bits 4..6 are the background color. All other bits are undefined\r
                     and must be zero. The valid Attributes are defined in this file.\r
 \r
-  @retval EFI_SUCCESS     The attribute was set.\r
-  @retval EFI_DEVICE_     ERROR The device had an error and could not complete the request.\r
-  @retval EFI_UNSUPPORTED The attribute requested is not defined.\r
+  @retval EFI_SUCCESS       The attribute was set.\r
+  @retval EFI_DEVICE_ERROR  The device had an error and could not complete the request.\r
+  @retval EFI_UNSUPPORTED   The attribute requested is not defined.\r
 \r
 **/\r
 typedef\r
@@ -278,7 +289,7 @@ EFI_STATUS
   Clears the output device(s) display to the currently selected background \r
   color.\r
 \r
-  @param  This              Protocol instance pointer.\r
+  @param  This              The protocol instance pointer.\r
                            \r
   @retval  EFI_SUCCESS      The operation completed successfully.\r
   @retval  EFI_DEVICE_ERROR The device had an error and could not complete the request.\r
@@ -294,7 +305,7 @@ EFI_STATUS
 /**\r
   Sets the current coordinates of the cursor position\r
 \r
-  @param  This        Protocol instance pointer.\r
+  @param  This        The protocol instance pointer.\r
   @param  Column      The position to set the cursor to. Must be greater than or\r
                       equal to zero and less than the number of columns and rows\r
                       by QueryMode ().\r
@@ -319,7 +330,7 @@ EFI_STATUS
 /**\r
   Makes the cursor visible or invisible\r
 \r
-  @param  This    Protocol instance pointer.\r
+  @param  This    The protocol instance pointer.\r
   @param  Visible If TRUE, the cursor is set to be visible. If FALSE, the cursor is\r
                   set to be invisible.\r
 \r
@@ -340,76 +351,45 @@ EFI_STATUS
 /**\r
   @par Data Structure Description:\r
   Mode Structure pointed to by Simple Text Out protocol.\r
-\r
-  @param MaxMode\r
-  The number of modes supported by QueryMode () and SetMode ().\r
-  \r
-  @param Mode\r
-  The text mode of the output device(s).\r
-  \r
-  @param Attribute\r
-  The current character output attribute\r
-  \r
-  @param CursorColumn\r
-  The cursor's column.\r
-  \r
-  @param CursorRow\r
-  The cursor's row.\r
-  \r
-  @param CursorVisible\r
-  The cursor is currently visbile or not.\r
-\r
 **/\r
 typedef struct {\r
+  ///\r
+  /// The number of modes supported by QueryMode () and SetMode ().\r
+  ///\r
   INT32   MaxMode;\r
 \r
   //\r
   // current settings\r
   //\r
+\r
+  ///\r
+  /// The text mode of the output device(s).\r
+  ///\r
   INT32   Mode;\r
+  ///\r
+  /// The current character output attribute.\r
+  ///\r
   INT32   Attribute;\r
+  ///\r
+  /// The cursor's column.\r
+  ///\r
   INT32   CursorColumn;\r
+  ///\r
+  /// The cursor's row.\r
+  ///\r
   INT32   CursorRow;\r
+  ///\r
+  /// The cursor is currently visbile or not.\r
+  ///\r
   BOOLEAN CursorVisible;\r
 } EFI_SIMPLE_TEXT_OUTPUT_MODE;\r
 \r
-/**  \r
-  @par Protocol Description:\r
-  The SIMPLE_TEXT_OUTPUT protocol is used to control text-based output devices. \r
-  It is the minimum required protocol for any handle supplied as the ConsoleOut \r
-  or StandardError device. In addition, the minimum supported text mode of such \r
-  devices is at least 80 x 25 characters.\r
-\r
-  @param Reset\r
-  Reset the ConsoleOut device. \r
-\r
-  @param OutputString\r
-  Displays the Unicode string on the device at the current cursor location. \r
-\r
-  @param TestString\r
-  Tests to see if the ConsoleOut device supports this Unicode string.\r
-\r
-  @param QueryMode\r
-  Queries information concerning the output device's supported text mode. \r
-\r
-  @param SetMode\r
-  Sets the current mode of the output device. \r
-\r
-  @param SetAttribute\r
-  Sets the foreground and background color of the text that is output. \r
-\r
-  @param ClearScreen\r
-  Clears the screen with the currently set background color. \r
-\r
-  @param SetCursorPosition\r
-  Sets the current cursor position. \r
-\r
-  @param EnableCursor\r
-  Turns the visibility of the cursor on/off. \r
-\r
-  @param Mode\r
-  Pointer to SIMPLE_TEXT_OUTPUT_MODE data. \r
-**/\r
+///\r
+/// The SIMPLE_TEXT_OUTPUT protocol is used to control text-based output devices. \r
+/// It is the minimum required protocol for any handle supplied as the ConsoleOut \r
+/// or StandardError device. In addition, the minimum supported text mode of such \r
+/// devices is at least 80 x 25 characters.\r
+///\r
 struct _EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL {\r
   EFI_TEXT_RESET                Reset;\r
 \r
@@ -424,9 +404,9 @@ struct _EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL {
   EFI_TEXT_SET_CURSOR_POSITION  SetCursorPosition;\r
   EFI_TEXT_ENABLE_CURSOR        EnableCursor;\r
 \r
-  //\r
-  // Current mode\r
-  //\r
+  ///\r
+  /// Pointer to SIMPLE_TEXT_OUTPUT_MODE data.\r
+  ///\r
   EFI_SIMPLE_TEXT_OUTPUT_MODE   *Mode;\r
 };\r
 \r