]> git.proxmox.com Git - mirror_edk2.git/blobdiff - IntelFrameworkModulePkg/Library/GraphicsLib/Graphics.c
Add some function/header comments.
[mirror_edk2.git] / IntelFrameworkModulePkg / Library / GraphicsLib / Graphics.c
index ea8c7d5157fb883f13ae43929850495c41ea2d88..f75963e712351b17db623c3ada1ca99f747ba80f 100644 (file)
@@ -37,37 +37,30 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 #include <Library/DebugLib.h>\r
 #include <Library/PcdLib.h>\r
 \r
-EFI_STATUS\r
-GetGraphicsBitMapFromFV (\r
-  IN  EFI_GUID      *FileNameGuid,\r
-  OUT VOID          **Image,\r
-  OUT UINTN         *ImageSize\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
+/**\r
   Return the graphics image file named FileNameGuid into Image and return it's\r
   size in ImageSize. All Firmware Volumes (FV) in the system are searched for the\r
   file name.\r
 \r
-Arguments:\r
-\r
-  FileNameGuid  - File Name of graphics file in the FV(s).\r
+  @param FileNameGuid  - File Name of graphics file in the FV(s).\r
 \r
-  Image         - Pointer to pointer to return graphics image.  If NULL, a\r
-                  buffer will be allocated.\r
+  @param Image         - Pointer to pointer to return graphics image.  If NULL, a\r
+                         buffer will be allocated.\r
 \r
-  ImageSize     - Size of the graphics Image in bytes. Zero if no image found.\r
+  @param ImageSize     - Size of the graphics Image in bytes. Zero if no image found.\r
 \r
+  @retval EFI_SUCCESS          - Image and ImageSize are valid.\r
+  @retval EFI_BUFFER_TOO_SMALL - Image not big enough. ImageSize has required size\r
+  @retval EFI_NOT_FOUND        - FileNameGuid not found\r
 \r
-Returns:\r
-\r
-  EFI_SUCCESS          - Image and ImageSize are valid.\r
-  EFI_BUFFER_TOO_SMALL - Image not big enough. ImageSize has required size\r
-  EFI_NOT_FOUND        - FileNameGuid not found\r
+**/\r
 \r
---*/\r
+EFI_STATUS\r
+GetGraphicsBitMapFromFV (\r
+  IN  EFI_GUID      *FileNameGuid,\r
+  OUT VOID          **Image,\r
+  OUT UINTN         *ImageSize\r
+  )\r
 {\r
   EFI_STATUS                    Status;\r
   UINTN                         FvProtocolCount;\r
@@ -120,48 +113,42 @@ Returns:
   return EFI_NOT_FOUND;\r
 }\r
 \r
-STATIC\r
-EFI_STATUS\r
-ConvertBmpToGopBlt (\r
-  IN  VOID      *BmpImage,\r
-  IN  UINTN     BmpImageSize,\r
-  IN OUT VOID   **GopBlt,\r
-  IN OUT UINTN  *GopBltSize,\r
-  OUT UINTN     *PixelHeight,\r
-  OUT UINTN     *PixelWidth\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
+/**\r
   Convert a *.BMP graphics image to a GOP/UGA blt buffer. If a NULL Blt buffer\r
   is passed in a GopBlt buffer will be allocated by this routine. If a GopBlt\r
   buffer is passed in it will be used if it is big enough.\r
 \r
-Arguments:\r
+  @param BmpImage      - Pointer to BMP file\r
 \r
-  BmpImage      - Pointer to BMP file\r
+  @param BmpImageSize  - Number of bytes in BmpImage\r
 \r
-  BmpImageSize  - Number of bytes in BmpImage\r
+  @param GopBlt        - Buffer containing GOP version of BmpImage.\r
 \r
-  GopBlt        - Buffer containing GOP version of BmpImage.\r
+  @param GopBltSize    - Size of GopBlt in bytes.\r
 \r
-  GopBltSize    - Size of GopBlt in bytes.\r
+  @param PixelHeight   - Height of GopBlt/BmpImage in pixels\r
 \r
-  PixelHeight   - Height of GopBlt/BmpImage in pixels\r
+  @param PixelWidth    - Width of GopBlt/BmpImage in pixels\r
 \r
-  PixelWidth    - Width of GopBlt/BmpImage in pixels\r
 \r
+  @retval EFI_SUCCESS           - GopBlt and GopBltSize are returned.\r
+  @retval EFI_UNSUPPORTED       - BmpImage is not a valid *.BMP image\r
+  @retval EFI_BUFFER_TOO_SMALL  - The passed in GopBlt buffer is not big enough.\r
+                                  GopBltSize will contain the required size.\r
+  @retval EFI_OUT_OF_RESOURCES  - No enough buffer to allocate\r
 \r
-Returns:\r
-\r
-  EFI_SUCCESS           - GopBlt and GopBltSize are returned.\r
-  EFI_UNSUPPORTED       - BmpImage is not a valid *.BMP image\r
-  EFI_BUFFER_TOO_SMALL  - The passed in GopBlt buffer is not big enough.\r
-                          GopBltSize will contain the required size.\r
-  EFI_OUT_OF_RESOURCES  - No enough buffer to allocate\r
+**/\r
+STATIC\r
+EFI_STATUS\r
+ConvertBmpToGopBlt (\r
+  IN  VOID      *BmpImage,\r
+  IN  UINTN     BmpImageSize,\r
+  IN OUT VOID   **GopBlt,\r
+  IN OUT UINTN  *GopBltSize,\r
+  OUT UINTN     *PixelHeight,\r
+  OUT UINTN     *PixelWidth\r
+  )\r
 \r
---*/\r
 {\r
   UINT8             *Image;\r
   UINT8             *ImageHeader;\r
@@ -296,30 +283,23 @@ Returns:
   return EFI_SUCCESS;\r
 }\r
 \r
-\r
-EFI_STATUS\r
-LockKeyboards (\r
-  IN  CHAR16    *Password\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
+/**\r
   Use Console Control Protocol to lock the Console In Spliter virtual handle.\r
   This is the ConInHandle and ConIn handle in the EFI system table. All key\r
   presses will be ignored until the Password is typed in. The only way to\r
   disable the password is to type it in to a ConIn device.\r
 \r
-Arguments:\r
-  Password - Password used to lock ConIn device\r
-\r
+  @param  Password - Password used to lock ConIn device\r
 \r
-Returns:\r
-\r
-  EFI_SUCCESS     - ConsoleControl has been flipped to graphics and logo\r
+  @retval EFI_SUCCESS     - ConsoleControl has been flipped to graphics and logo\r
                           displayed.\r
-  EFI_UNSUPPORTED - Logo not found\r
+  @retval EFI_UNSUPPORTED - Logo not found\r
 \r
---*/\r
+**/\r
+EFI_STATUS\r
+LockKeyboards (\r
+  IN  CHAR16    *Password\r
+  )\r
 {\r
   EFI_STATUS                    Status;\r
   EFI_CONSOLE_CONTROL_PROTOCOL  *ConsoleControl;\r
@@ -333,30 +313,22 @@ Returns:
   return Status;\r
 }\r
 \r
-\r
-EFI_STATUS\r
-EnableQuietBoot (\r
-  IN  EFI_GUID  *LogoFile\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
+/**\r
   Use Console Control to turn off UGA based Simple Text Out consoles from going\r
   to the UGA device. Put up LogoFile on every UGA device that is a console\r
 \r
-Arguments:\r
-\r
-  LogoFile - File name of logo to display on the center of the screen.\r
+  @param LogoFile - File name of logo to display on the center of the screen.\r
 \r
+  @retval EFI_SUCCESS           - ConsoleControl has been flipped to graphics and logo\r
+                                  displayed.\r
+  @retval EFI_UNSUPPORTED       - Logo not found\r
 \r
-Returns:\r
-\r
-  EFI_SUCCESS           - ConsoleControl has been flipped to graphics and logo\r
-                          displayed.\r
-  EFI_UNSUPPORTED       - Logo not found\r
+**/\r
+EFI_STATUS\r
+EnableQuietBoot (\r
+  IN  EFI_GUID  *LogoFile\r
+  )\r
 \r
---*/\r
 {\r
   EFI_STATUS                    Status;\r
   EFI_CONSOLE_CONTROL_PROTOCOL  *ConsoleControl;\r
@@ -571,28 +543,18 @@ Returns:
   return Status;\r
 }\r
 \r
+/**\r
+  Use Console Control to turn on GOP/UGA based Simple Text Out consoles. The GOP/UGA\r
+  Simple Text Out screens will now be synced up with all non GOP/UGA output devices\r
 \r
+  @retval EFI_SUCCESS           - GOP/UGA devices are back in text mode and synced up.\r
+  @retval EFI_UNSUPPORTED       - Logo not found\r
+**/\r
 EFI_STATUS\r
 DisableQuietBoot (\r
   VOID\r
   )\r
-/*++\r
-\r
-Routine Description:\r
 \r
-  Use Console Control to turn on GOP/UGA based Simple Text Out consoles. The GOP/UGA\r
-  Simple Text Out screens will now be synced up with all non GOP/UGA output devices\r
-\r
-Arguments:\r
-\r
-  NONE\r
-\r
-Returns:\r
-\r
-  EFI_SUCCESS           - GOP/UGA devices are back in text mode and synced up.\r
-  EFI_UNSUPPORTED       - Logo not found\r
-\r
---*/\r
 {\r
   EFI_STATUS                    Status;\r
   EFI_CONSOLE_CONTROL_PROTOCOL  *ConsoleControl;\r
@@ -624,51 +586,46 @@ static EFI_GRAPHICS_OUTPUT_BLT_PIXEL mEfiColors[16] = {
   { 0xff, 0xff, 0xff, 0x00 }\r
 };\r
 \r
-STATIC\r
-UINTN\r
-_IPrint (\r
-  IN EFI_GRAPHICS_OUTPUT_PROTOCOL     *GraphicsOutput,\r
-  IN EFI_UGA_DRAW_PROTOCOL            *UgaDraw,\r
-  IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL  *Sto,\r
-  IN UINTN                            X,\r
-  IN UINTN                            Y,\r
-  IN EFI_GRAPHICS_OUTPUT_BLT_PIXEL    *Foreground,\r
-  IN EFI_GRAPHICS_OUTPUT_BLT_PIXEL    *Background,\r
-  IN CHAR16                           *fmt,\r
-  IN VA_LIST                          args\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
+/**\r
   Display string worker for: Print, PrintAt, IPrint, IPrintAt\r
 \r
-Arguments:\r
+  @param GraphicsOutput  - Graphics output protocol interface\r
 \r
-  GraphicsOutput  - Graphics output protocol interface\r
+  @param UgaDraw         - UGA draw protocol interface\r
 \r
-  UgaDraw         - UGA draw protocol interface\r
+  @param Sto             - Simple text out protocol interface\r
 \r
-  Sto             - Simple text out protocol interface\r
+  @param X               - X coordinate to start printing\r
 \r
-  X               - X coordinate to start printing\r
+  @param Y               - Y coordinate to start printing\r
 \r
-  Y               - Y coordinate to start printing\r
+  @param Foreground      - Foreground color\r
 \r
-  Foreground      - Foreground color\r
+  @param Background      - Background color\r
 \r
-  Background      - Background color\r
+  @param fmt             - Format string\r
 \r
-  fmt             - Format string\r
+  @param args            - Print arguments\r
 \r
-  args            - Print arguments\r
 \r
-Returns:\r
+  @retval EFI_SUCCESS             -  success\r
+  @retval EFI_OUT_OF_RESOURCES    -  out of resources\r
 \r
-  EFI_SUCCESS             -  success\r
-  EFI_OUT_OF_RESOURCES    -  out of resources\r
+**/\r
+STATIC\r
+UINTN\r
+_IPrint (\r
+  IN EFI_GRAPHICS_OUTPUT_PROTOCOL     *GraphicsOutput,\r
+  IN EFI_UGA_DRAW_PROTOCOL            *UgaDraw,\r
+  IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL  *Sto,\r
+  IN UINTN                            X,\r
+  IN UINTN                            Y,\r
+  IN EFI_GRAPHICS_OUTPUT_BLT_PIXEL    *Foreground,\r
+  IN EFI_GRAPHICS_OUTPUT_BLT_PIXEL    *Background,\r
+  IN CHAR16                           *fmt,\r
+  IN VA_LIST                          args\r
+  )\r
 \r
---*/\r
 {\r
   VOID                           *Buffer;\r
   EFI_STATUS                     Status;\r
@@ -812,7 +769,25 @@ Error:
   return Status;\r
 }\r
 \r
+/**\r
+  Prints a formatted unicode string to the default console\r
+\r
+  @param X           - X coordinate to start printing\r
+\r
+  @param Y           - Y coordinate to start printing\r
+\r
+  @param ForeGround  - Foreground color\r
+\r
+  @param BackGround  - Background color\r
+\r
+  @param Fmt         - Format string\r
+\r
+  @param ...         - Print arguments\r
 \r
+\r
+  @retval Length of string printed to the console\r
+\r
+**/\r
 UINTN\r
 PrintXY (\r
   IN UINTN                            X,\r
@@ -822,31 +797,6 @@ PrintXY (
   IN CHAR16                           *Fmt,\r
   ...\r
   )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-    Prints a formatted unicode string to the default console\r
-\r
-Arguments:\r
-\r
-    X           - X coordinate to start printing\r
-\r
-    Y           - Y coordinate to start printing\r
-\r
-    ForeGround  - Foreground color\r
-\r
-    BackGround  - Background color\r
-\r
-    Fmt         - Format string\r
-\r
-    ...         - Print arguments\r
-\r
-Returns:\r
-\r
-    Length of string printed to the console\r
-\r
---*/\r
 {\r
   EFI_HANDLE                    Handle;\r
 \r
@@ -894,3 +844,4 @@ Returns:
 \r
   return _IPrint (GraphicsOutput, UgaDraw, Sto, X, Y, ForeGround, BackGround, Fmt, Args);\r
 }\r
+\r