]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Universal/HiiDatabaseDxe/Font.c
MdeModulePkg: Clean up source files
[mirror_edk2.git] / MdeModulePkg / Universal / HiiDatabaseDxe / Font.c
index b85cf88f54e53a8386ad1ed7005f8c09f52df9cb..4840933f291894ec3ba0d5e24ecb7b0249a63b10 100644 (file)
@@ -2,7 +2,7 @@
 Implementation for EFI_HII_FONT_PROTOCOL.\r
 \r
 \r
-Copyright (c) 2007 - 2017, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.<BR>\r
 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
@@ -304,14 +304,14 @@ NarrowGlyphToBlt (
 \r
   Height = EFI_GLYPH_HEIGHT;\r
   Width  = EFI_GLYPH_WIDTH;\r
-  \r
+\r
   //\r
   // Move position to the left-top corner of char.\r
   //\r
   Buffer = *Origin - EFI_GLYPH_HEIGHT * ImageWidth;\r
 \r
   //\r
-  // Char may be partially displayed when CLIP_X or CLIP_Y is not set. \r
+  // Char may be partially displayed when CLIP_X or CLIP_Y is not set.\r
   //\r
   if (RowHeight < Height) {\r
     Height = (UINT8) RowHeight;\r
@@ -685,7 +685,7 @@ FindGlyphBlock (
   ASSERT (FontPackage->Signature == HII_FONT_PACKAGE_SIGNATURE);\r
   BaseLine  = 0;\r
   MinOffsetY = 0;\r
-  \r
+\r
   if (CharValue == (CHAR16) (-1)) {\r
     //\r
     // Collect the cell information specified in font package fixed header.\r
@@ -1099,8 +1099,8 @@ IsSystemFontInfo (
   }\r
   if ((StringInfo->FontInfoMask & EFI_FONT_INFO_SYS_FORE_COLOR) == 0) {\r
     if (CompareMem (\r
-          &StringInfo->ForegroundColor, \r
-          &SystemDefault->ForegroundColor, \r
+          &StringInfo->ForegroundColor,\r
+          &SystemDefault->ForegroundColor,\r
           sizeof (EFI_GRAPHICS_OUTPUT_BLT_PIXEL)\r
           ) != 0) {\r
       goto Exit;\r
@@ -1108,8 +1108,8 @@ IsSystemFontInfo (
   }\r
   if ((StringInfo->FontInfoMask & EFI_FONT_INFO_SYS_BACK_COLOR) == 0) {\r
     if (CompareMem (\r
-          &StringInfo->BackgroundColor, \r
-          &SystemDefault->BackgroundColor, \r
+          &StringInfo->BackgroundColor,\r
+          &SystemDefault->BackgroundColor,\r
           sizeof (EFI_GRAPHICS_OUTPUT_BLT_PIXEL)\r
           ) != 0) {\r
       goto Exit;\r
@@ -1745,7 +1745,7 @@ HiiStringToImage (
       goto Exit;\r
     }\r
   }\r
-  \r
+\r
   //\r
   // Use the maximum height of font as the base line.\r
   // And, use the maximum height as line height.\r
@@ -1753,7 +1753,7 @@ HiiStringToImage (
   LineHeight     = Height;\r
   LastLineHeight = Height;\r
   BaseLineOffset = Height - BaseLine;\r
-  \r
+\r
   //\r
   // Parse the string to be displayed to drop some ignored characters.\r
   //\r
@@ -1799,7 +1799,7 @@ HiiStringToImage (
       Index++;\r
       continue;\r
     }\r
-    \r
+\r
     Status = GetGlyphBuffer (Private, *StringPtr, FontInfo, &GlyphBuf[Index], &Cell[Index], &Attributes[Index]);\r
     if (Status == EFI_NOT_FOUND) {\r
       if ((Flags & EFI_HII_IGNORE_IF_NO_GLYPH) == EFI_HII_IGNORE_IF_NO_GLYPH) {\r
@@ -1971,8 +1971,8 @@ HiiStringToImage (
     // opportunity prior to a character whose right-most extent would exceed Width.\r
     // Search the right-most line-break opportunity here.\r
     //\r
-    if ((Flags & EFI_HII_OUT_FLAG_WRAP) == EFI_HII_OUT_FLAG_WRAP && \r
-        (RowInfo[RowIndex].LineWidth + BltX > Image->Width || StringPtr[NextIndex] != 0) && \r
+    if ((Flags & EFI_HII_OUT_FLAG_WRAP) == EFI_HII_OUT_FLAG_WRAP &&\r
+        (RowInfo[RowIndex].LineWidth + BltX > Image->Width || StringPtr[NextIndex] != 0) &&\r
         !LineBreak) {\r
       if ((Flags & EFI_HII_IGNORE_LINE_BREAK) == 0) {\r
         LineWidth = RowInfo[RowIndex].LineWidth;\r
@@ -2040,7 +2040,7 @@ HiiStringToImage (
         }\r
       }\r
     }\r
-    \r
+\r
     //\r
     // LineWidth can't exceed Image width.\r
     //\r
@@ -2091,7 +2091,7 @@ HiiStringToImage (
           );\r
         }\r
         if (ColumnInfoArray != NULL) {\r
-          if ((GlyphBuf[Index1] == NULL && Cell[Index1].AdvanceX == 0) \r
+          if ((GlyphBuf[Index1] == NULL && Cell[Index1].AdvanceX == 0)\r
               || RowInfo[RowIndex].LineWidth == 0) {\r
             *ColumnInfoArray = (UINTN) ~0;\r
           } else {\r
@@ -2119,7 +2119,7 @@ HiiStringToImage (
           FreePool (BltBuffer);\r
           goto Exit;\r
         }\r
-  \r
+\r
         FreePool (BltBuffer);\r
       }\r
     } else {\r
@@ -2151,7 +2151,7 @@ HiiStringToImage (
           );\r
         }\r
         if (ColumnInfoArray != NULL) {\r
-          if ((GlyphBuf[Index1] == NULL && Cell[Index1].AdvanceX == 0) \r
+          if ((GlyphBuf[Index1] == NULL && Cell[Index1].AdvanceX == 0)\r
               || RowInfo[RowIndex].LineWidth == 0) {\r
             *ColumnInfoArray = (UINTN) ~0;\r
           } else {\r
@@ -2392,7 +2392,7 @@ HiiStringIdToImage (
   if (EFI_ERROR (Status)) {\r
     goto Exit;\r
   }\r
\r
+\r
   if (Language == NULL) {\r
     Language = "";\r
   }\r
@@ -2409,7 +2409,7 @@ HiiStringIdToImage (
     Status = EFI_NOT_FOUND;\r
     goto Exit;\r
   }\r
-    \r
+\r
   StringSize = MAX_STRING_LENGTH;\r
   String = (EFI_STRING) AllocateZeroPool (StringSize);\r
   if (String == NULL) {\r
@@ -2447,33 +2447,33 @@ HiiStringIdToImage (
   if (EFI_ERROR (Status)) {\r
     goto Exit;\r
   }\r
-    \r
+\r
   //\r
   // When StringInfo specifies that string will be output in the system default font and color,\r
-  // use particular stringfontinfo described in string package instead if exists. \r
+  // use particular stringfontinfo described in string package instead if exists.\r
   // StringFontInfo equals NULL means system default font attaches with the string block.\r
   //\r
   if (StringFontInfo != NULL && IsSystemFontInfo (Private, (EFI_FONT_DISPLAY_INFO *) StringInfo, NULL, NULL)) {\r
     NameSize = StrSize (StringFontInfo->FontName);\r
     FontLen = sizeof (EFI_FONT_DISPLAY_INFO) - sizeof (CHAR16) + NameSize;\r
     NewStringInfo = AllocateZeroPool (FontLen);\r
-    if (NewStringInfo == NULL) {      \r
+    if (NewStringInfo == NULL) {\r
       Status = EFI_OUT_OF_RESOURCES;\r
       goto Exit;\r
     }\r
     NewStringInfo->FontInfoMask       = EFI_FONT_INFO_SYS_FORE_COLOR | EFI_FONT_INFO_SYS_BACK_COLOR;\r
     NewStringInfo->FontInfo.FontStyle = StringFontInfo->FontStyle;\r
-    NewStringInfo->FontInfo.FontSize  = StringFontInfo->FontSize;    \r
+    NewStringInfo->FontInfo.FontSize  = StringFontInfo->FontSize;\r
     StrCpyS (NewStringInfo->FontInfo.FontName, NameSize / sizeof (CHAR16), StringFontInfo->FontName);\r
-  \r
+\r
     Status = HiiStringToImage (\r
-               This, \r
-               Flags, \r
-               String, \r
-               NewStringInfo, \r
-               Blt, \r
-               BltX, \r
-               BltY, \r
+               This,\r
+               Flags,\r
+               String,\r
+               NewStringInfo,\r
+               Blt,\r
+               BltX,\r
+               BltY,\r
                RowInfoArray,\r
                RowInfoArraySize,\r
                ColumnInfoArray\r
@@ -2640,7 +2640,7 @@ HiiGetGlyph (
     //\r
     BaseLine  = (UINT16) (Cell.Height + Cell.OffsetY);\r
     //\r
-    // Set BltBuffer to the position of Origin. \r
+    // Set BltBuffer to the position of Origin.\r
     //\r
     BltBuffer = Image->Image.Bitmap + (Cell.Height + Cell.OffsetY) * Image->Width - Cell.OffsetX;\r
     GlyphToImage (\r
@@ -2715,7 +2715,7 @@ Exit:
   @param  StringInfoOut           Upon return, contains the matching font's information.\r
                                   If NULL, then no information is returned. This buffer\r
                                   is allocated with a call to the Boot Service AllocatePool().\r
-                                  It is the caller's responsibility to call the Boot \r
+                                  It is the caller's responsibility to call the Boot\r
                                   Service FreePool() when the caller no longer requires\r
                                   the contents of StringInfoOut.\r
   @param  String                  Points to the string which will be tested to\r
@@ -2800,7 +2800,7 @@ HiiGetFontInfo (
       goto Exit;\r
     }\r
   }\r
-  \r
+\r
   //\r
   // StringInfoIn must not be NULL if it is not system default font info.\r
   //\r
@@ -2808,15 +2808,15 @@ HiiGetFontInfo (
   //\r
   // Check the font information mask to make sure it is valid.\r
   //\r
-  if (((StringInfoIn->FontInfoMask & (EFI_FONT_INFO_SYS_FONT  | EFI_FONT_INFO_ANY_FONT))  == \r
+  if (((StringInfoIn->FontInfoMask & (EFI_FONT_INFO_SYS_FONT  | EFI_FONT_INFO_ANY_FONT))  ==\r
        (EFI_FONT_INFO_SYS_FONT | EFI_FONT_INFO_ANY_FONT))   ||\r
-      ((StringInfoIn->FontInfoMask & (EFI_FONT_INFO_SYS_SIZE  | EFI_FONT_INFO_ANY_SIZE))  == \r
+      ((StringInfoIn->FontInfoMask & (EFI_FONT_INFO_SYS_SIZE  | EFI_FONT_INFO_ANY_SIZE))  ==\r
        (EFI_FONT_INFO_SYS_SIZE | EFI_FONT_INFO_ANY_SIZE))   ||\r
-      ((StringInfoIn->FontInfoMask & (EFI_FONT_INFO_SYS_STYLE | EFI_FONT_INFO_ANY_STYLE)) == \r
+      ((StringInfoIn->FontInfoMask & (EFI_FONT_INFO_SYS_STYLE | EFI_FONT_INFO_ANY_STYLE)) ==\r
        (EFI_FONT_INFO_SYS_STYLE | EFI_FONT_INFO_ANY_STYLE)) ||\r
-      ((StringInfoIn->FontInfoMask & (EFI_FONT_INFO_RESIZE    | EFI_FONT_INFO_ANY_SIZE))  == \r
-       (EFI_FONT_INFO_RESIZE | EFI_FONT_INFO_ANY_SIZE))     ||           \r
-      ((StringInfoIn->FontInfoMask & (EFI_FONT_INFO_RESTYLE   | EFI_FONT_INFO_ANY_STYLE)) == \r
+      ((StringInfoIn->FontInfoMask & (EFI_FONT_INFO_RESIZE    | EFI_FONT_INFO_ANY_SIZE))  ==\r
+       (EFI_FONT_INFO_RESIZE | EFI_FONT_INFO_ANY_SIZE))     ||\r
+      ((StringInfoIn->FontInfoMask & (EFI_FONT_INFO_RESTYLE   | EFI_FONT_INFO_ANY_STYLE)) ==\r
        (EFI_FONT_INFO_RESTYLE | EFI_FONT_INFO_ANY_STYLE))) {\r
     return EFI_INVALID_PARAMETER;\r
   }\r
@@ -2838,7 +2838,7 @@ HiiGetFontInfo (
 \r
   if ((StringInfoIn->FontInfoMask & EFI_FONT_INFO_SYS_SIZE) == EFI_FONT_INFO_SYS_SIZE) {\r
     InfoOut.FontInfo.FontSize = SystemDefault->FontInfo.FontSize;\r
-  } \r
+  }\r
   if ((StringInfoIn->FontInfoMask & EFI_FONT_INFO_SYS_STYLE) == EFI_FONT_INFO_SYS_STYLE) {\r
     InfoOut.FontInfo.FontStyle = SystemDefault->FontInfo.FontStyle;\r
   }\r
@@ -2848,7 +2848,7 @@ HiiGetFontInfo (
   if ((StringInfoIn->FontInfoMask & EFI_FONT_INFO_SYS_BACK_COLOR) == EFI_FONT_INFO_SYS_BACK_COLOR) {\r
     InfoOut.BackgroundColor = SystemDefault->BackgroundColor;\r
   }\r
-  \r
+\r
   ASSERT (FontInfo != NULL);\r
   FontInfo->FontSize  = InfoOut.FontInfo.FontSize;\r
   FontInfo->FontStyle = InfoOut.FontInfo.FontStyle;\r
@@ -2856,7 +2856,7 @@ HiiGetFontInfo (
   if (IsFontInfoExisted (Private, FontInfo, &InfoOut.FontInfoMask, LocalFontHandle, &GlobalFont)) {\r
     //\r
     // Test to guarantee all characters are available in the found font.\r
-    //    \r
+    //\r
     if (String != NULL) {\r
       StringIn = String;\r
       while (*StringIn != 0) {\r
@@ -2873,21 +2873,21 @@ HiiGetFontInfo (
     //\r
     if (StringInfoOut != NULL) {\r
       StringInfoOutLen = sizeof (EFI_FONT_DISPLAY_INFO) - sizeof (EFI_FONT_INFO) + GlobalFont->FontInfoSize;\r
-      *StringInfoOut   = (EFI_FONT_DISPLAY_INFO *) AllocateZeroPool (StringInfoOutLen);      \r
+      *StringInfoOut   = (EFI_FONT_DISPLAY_INFO *) AllocateZeroPool (StringInfoOutLen);\r
       if (*StringInfoOut == NULL) {\r
         Status = EFI_OUT_OF_RESOURCES;\r
         LocalFontHandle = NULL;\r
         goto Exit;\r
       }\r
-      \r
+\r
       CopyMem (*StringInfoOut, &InfoOut, sizeof (EFI_FONT_DISPLAY_INFO));\r
       CopyMem (&(*StringInfoOut)->FontInfo, GlobalFont->FontInfo, GlobalFont->FontInfoSize);\r
     }\r
-    \r
-    LocalFontHandle = GlobalFont->Entry.ForwardLink;    \r
+\r
+    LocalFontHandle = GlobalFont->Entry.ForwardLink;\r
     Status = EFI_SUCCESS;\r
     goto Exit;\r
-  }  \r
+  }\r
 \r
   Status = EFI_NOT_FOUND;\r
 \r