]> git.proxmox.com Git - mirror_edk2.git/blobdiff - IntelFrameworkModulePkg/Library/GraphicsLib/Graphics.c
Module clean up.
[mirror_edk2.git] / IntelFrameworkModulePkg / Library / GraphicsLib / Graphics.c
index 605a240bf2b57fe166e4cabe1790eb1253173145..6e1c3f82a81eddeb44e460bc56577dee136a4d7e 100644 (file)
@@ -5,21 +5,36 @@
           when Tiano graphics format is supported.\r
 \r
 \r
-Copyright (c) 2006, 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, 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
 \r
 **/\r
 \r
-//\r
-// Include common header file for this module.\r
-//\r
-#include "CommonHeader.h"\r
+\r
+#include <PiDxe.h>\r
+\r
+#include <Protocol/SimpleTextOut.h>\r
+#include <Protocol/OEMBadging.h>\r
+#include <Protocol/ConsoleControl.h>\r
+#include <Protocol/GraphicsOutput.h>\r
+#include <Protocol/FirmwareVolume2.h>\r
+#include <Protocol/UgaDraw.h>\r
+#include <Protocol/HiiFramework.h>\r
+\r
+#include <Guid/Bmp.h>\r
+\r
+#include <Library/GraphicsLib.h>\r
+#include <Library/PrintLib.h>\r
+#include <Library/BaseLib.h>\r
+#include <Library/MemoryAllocationLib.h>\r
+#include <Library/UefiBootServicesTableLib.h>\r
+\r
 \r
 EFI_STATUS\r
 GetGraphicsBitMapFromFV (\r
@@ -39,15 +54,15 @@ Arguments:
 \r
   FileNameGuid  - File Name of graphics file in the FV(s).\r
 \r
-  Image         - Pointer to pointer to return graphics image.  If NULL, a \r
+  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
 \r
 \r
-Returns: \r
+Returns:\r
 \r
-  EFI_SUCCESS          - Image and ImageSize are valid. \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
@@ -137,9 +152,9 @@ Arguments:
   PixelWidth    - Width of UgaBlt/BmpImage in pixels\r
 \r
 \r
-Returns: \r
+Returns:\r
 \r
-  EFI_SUCCESS           - UgaBlt and UgaBltSize are returned. \r
+  EFI_SUCCESS           - UgaBlt and UgaBltSize are returned.\r
   EFI_UNSUPPORTED       - BmpImage is not a valid *.BMP image\r
   EFI_BUFFER_TOO_SMALL  - The passed in UgaBlt buffer is not big enough.\r
                           UgaBltSize will contain the required size.\r
@@ -159,7 +174,7 @@ Returns:
   UINTN             Width;\r
   UINTN             ImageIndex;\r
   BOOLEAN           IsAllocated;\r
-  \r
+\r
   BmpHeader = (BMP_IMAGE_HEADER *) BmpImage;\r
   if (BmpHeader->CharB != 'B' || BmpHeader->CharM != 'M') {\r
     return EFI_UNSUPPORTED;\r
@@ -223,7 +238,7 @@ Returns:
         Blt --;\r
         Width --;\r
         break;\r
-      \r
+\r
       case 4:\r
         //\r
         // Convert BMP Palette to 24-bit color\r
@@ -288,7 +303,7 @@ LockKeyboards (
 /*++\r
 \r
 Routine Description:\r
-  Use Console Control Protocol to lock the Console In Spliter virtual handle. \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
@@ -297,7 +312,7 @@ Arguments:
   Password - Password used to lock ConIn device\r
 \r
 \r
-Returns: \r
+Returns:\r
 \r
   EFI_SUCCESS     - ConsoleControl has been flipped to graphics and logo\r
                           displayed.\r
@@ -334,7 +349,7 @@ Arguments:
   LogoFile - File name of logo to display on the center of the screen.\r
 \r
 \r
-Returns: \r
+Returns:\r
 \r
   EFI_SUCCESS           - ConsoleControl has been flipped to graphics and logo\r
                           displayed.\r
@@ -374,7 +389,7 @@ Returns:
   //\r
   // Try to open GOP first\r
   //\r
-  Status = gBS->HandleProtocol (gST->ConsoleOutHandle, &gEfiGraphicsOutputProtocolGuid, (VOID **) &GraphicsOutput); \r
+  Status = gBS->HandleProtocol (gST->ConsoleOutHandle, &gEfiGraphicsOutputProtocolGuid, (VOID **) &GraphicsOutput);\r
   if (EFI_ERROR(Status)) {\r
     GraphicsOutput = NULL;\r
     //\r
@@ -560,14 +575,14 @@ DisableQuietBoot (
 \r
 Routine Description:\r
 \r
-  Use Console Control to turn on UGA based Simple Text Out consoles. The UGA \r
+  Use Console Control to turn on UGA based Simple Text Out consoles. The UGA\r
   Simple Text Out screens will now be synced up with all non UGA output devices\r
 \r
 Arguments:\r
 \r
   NONE\r
 \r
-Returns: \r
+Returns:\r
 \r
   EFI_SUCCESS           - UGA devices are back in text mode and synced up.\r
   EFI_UNSUPPORTED       - Logo not found\r
@@ -626,24 +641,24 @@ Routine Description:
 Arguments:\r
 \r
   GraphicsOutput  - Graphics output protocol interface\r
-  \r
+\r
   UgaDraw         - UGA draw protocol interface\r
-  \r
+\r
   Sto             - Simple text out protocol interface\r
-  \r
+\r
   X               - X coordinate to start printing\r
-  \r
+\r
   Y               - Y coordinate to start printing\r
-  \r
+\r
   Foreground      - Foreground color\r
-  \r
+\r
   Background      - Background color\r
-  \r
+\r
   fmt             - Format string\r
-  \r
+\r
   args            - Print arguments\r
 \r
-Returns: \r
+Returns:\r
 \r
   EFI_SUCCESS             -  success\r
   EFI_OUT_OF_RESOURCES    -  out of resources\r
@@ -675,7 +690,7 @@ Returns:
   if (Buffer == NULL) {\r
     return EFI_OUT_OF_RESOURCES;\r
   }\r
-  \r
+\r
   if (GraphicsOutput != NULL) {\r
     HorizontalResolution = GraphicsOutput->Mode->Info->HorizontalResolution;\r
     VerticalResolution   = GraphicsOutput->Mode->Info->VerticalResolution;\r
@@ -798,11 +813,11 @@ Routine Description:
 Arguments:\r
 \r
     X           - X coordinate to start printing\r
-    \r
+\r
     Y           - Y coordinate to start printing\r
-    \r
+\r
     ForeGround  - Foreground color\r
-    \r
+\r
     BackGround  - Background color\r
 \r
     Fmt         - Format string\r