]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Application/UiApp/String.c
MdeModulePkg: Clean up source files
[mirror_edk2.git] / MdeModulePkg / Application / UiApp / String.c
index b93b8ac54f34f660fec456a741a22902737325af..b6f22889ce287bac098d2d16da6977661868da86 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   String support\r
 \r
-Copyright (c) 2015, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2004 - 2015, 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
@@ -13,7 +13,6 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 **/\r
 \r
 #include "Ui.h"\r
-#include "Language.h"\r
 #include "FrontPage.h"\r
 \r
 EFI_HII_HANDLE gStringPackHandle;\r
@@ -22,6 +21,241 @@ EFI_GUID mUiStringPackGuid = {
   0x136a3048, 0x752a, 0x4bf6, { 0xa7, 0x57, 0x9, 0x36, 0x11, 0x95, 0x38, 0xed }\r
 };\r
 \r
+EFI_GUID  mFontPackageGuid = {\r
+  0x78941450, 0x90ab, 0x4fb1, {0xb7, 0x5f, 0x58, 0x92, 0x14, 0xe2, 0x4a, 0xc}\r
+};\r
+\r
+#define NARROW_GLYPH_NUMBER 8\r
+#define WIDE_GLYPH_NUMBER   75\r
+\r
+typedef struct {\r
+  ///\r
+  /// This 4-bytes total array length is required by HiiAddPackages()\r
+  ///\r
+  UINT32                 Length;\r
+\r
+  //\r
+  // This is the Font package definition\r
+  //\r
+  EFI_HII_PACKAGE_HEADER Header;\r
+  UINT16                 NumberOfNarrowGlyphs;\r
+  UINT16                 NumberOfWideGlyphs;\r
+  EFI_NARROW_GLYPH       NarrowArray[NARROW_GLYPH_NUMBER];\r
+  EFI_WIDE_GLYPH         WideArray[WIDE_GLYPH_NUMBER];\r
+} FONT_PACK_BIN;\r
+\r
+FONT_PACK_BIN mFontBin = {\r
+  sizeof (FONT_PACK_BIN),\r
+  {\r
+    sizeof (FONT_PACK_BIN) - sizeof (UINT32),\r
+    EFI_HII_PACKAGE_SIMPLE_FONTS,\r
+  },\r
+  NARROW_GLYPH_NUMBER,\r
+  0,\r
+  {     // Narrow Glyphs\r
+    {\r
+      0x05d0,\r
+      0x00,\r
+      {\r
+        0x00,\r
+        0x00,\r
+        0x00,\r
+        0x4E,\r
+        0x6E,\r
+        0x62,\r
+        0x32,\r
+        0x32,\r
+        0x3C,\r
+        0x68,\r
+        0x4C,\r
+        0x4C,\r
+        0x46,\r
+        0x76,\r
+        0x72,\r
+        0x00,\r
+        0x00,\r
+        0x00,\r
+        0x00\r
+      }\r
+    },\r
+    {\r
+      0x05d1,\r
+      0x00,\r
+      {\r
+        0x00,\r
+        0x00,\r
+        0x00,\r
+        0x78,\r
+        0x7C,\r
+        0x0C,\r
+        0x0C,\r
+        0x0C,\r
+        0x0C,\r
+        0x0C,\r
+        0x0C,\r
+        0x0C,\r
+        0x0C,\r
+        0x7E,\r
+        0x7E,\r
+        0x00,\r
+        0x00,\r
+        0x00,\r
+        0x00\r
+      }\r
+    },\r
+    {\r
+      0x05d2,\r
+      0x00,\r
+      {\r
+        0x00,\r
+        0x00,\r
+        0x00,\r
+        0x78,\r
+        0x7C,\r
+        0x0C,\r
+        0x0C,\r
+        0x0C,\r
+        0x0C,\r
+        0x0C,\r
+        0x0C,\r
+        0x1C,\r
+        0x3E,\r
+        0x66,\r
+        0x66,\r
+        0x00,\r
+        0x00,\r
+        0x00,\r
+        0x00\r
+      }\r
+    },\r
+    {\r
+      0x05d3,\r
+      0x00,\r
+      {\r
+        0x00,\r
+        0x00,\r
+        0x00,\r
+        0x7E,\r
+        0x7E,\r
+        0x0C,\r
+        0x0C,\r
+        0x0C,\r
+        0x0C,\r
+        0x0C,\r
+        0x0C,\r
+        0x0C,\r
+        0x0C,\r
+        0x0C,\r
+        0x0C,\r
+        0x00,\r
+        0x00,\r
+        0x00,\r
+        0x00\r
+      }\r
+    },\r
+    {\r
+      0x05d4,\r
+      0x00,\r
+      {\r
+        0x00,\r
+        0x00,\r
+        0x00,\r
+        0x7C,\r
+        0x7E,\r
+        0x06,\r
+        0x06,\r
+        0x06,\r
+        0x06,\r
+        0x66,\r
+        0x66,\r
+        0x66,\r
+        0x66,\r
+        0x66,\r
+        0x66,\r
+        0x00,\r
+        0x00,\r
+        0x00,\r
+        0x00\r
+      }\r
+    },\r
+    {\r
+      0x05d5,\r
+      0x00,\r
+      {\r
+        0x00,\r
+        0x00,\r
+        0x00,\r
+        0x3C,\r
+        0x3C,\r
+        0x0C,\r
+        0x0C,\r
+        0x0C,\r
+        0x0C,\r
+        0x0C,\r
+        0x0C,\r
+        0x0C,\r
+        0x0C,\r
+        0x0C,\r
+        0x0C,\r
+        0x00,\r
+        0x00,\r
+        0x00,\r
+        0x00\r
+      }\r
+    },\r
+    {\r
+      0x05d6,\r
+      0x00,\r
+      {\r
+        0x00,\r
+        0x00,\r
+        0x00,\r
+        0x38,\r
+        0x38,\r
+        0x1E,\r
+        0x1E,\r
+        0x18,\r
+        0x18,\r
+        0x18,\r
+        0x18,\r
+        0x18,\r
+        0x18,\r
+        0x18,\r
+        0x18,\r
+        0x00,\r
+        0x00,\r
+        0x00,\r
+        0x00\r
+      }\r
+    },\r
+    {\r
+      0x0000,\r
+      0x00,\r
+      {\r
+        0x00,\r
+        0x00,\r
+        0x00,\r
+        0x00,\r
+        0x00,\r
+        0x00,\r
+        0x00,\r
+        0x00,\r
+        0x00,\r
+        0x00,\r
+        0x00,\r
+        0x00,\r
+        0x00,\r
+        0x00,\r
+        0x00,\r
+        0x00,\r
+        0x00,\r
+        0x00,\r
+        0x00\r
+      }\r
+    }\r
+  }\r
+};\r
+\r
 /**\r
   Initialize HII global accessor for string support.\r
 \r
@@ -69,3 +303,20 @@ GetStringById (
 {\r
   return HiiGetString (gStringPackHandle, Id, NULL);\r
 }\r
+\r
+/**\r
+  Routine to export glyphs to the HII database.  This is in addition to whatever is defined in the Graphics Console driver.\r
+\r
+**/\r
+EFI_HII_HANDLE\r
+ExportFonts (\r
+  VOID\r
+  )\r
+{\r
+  return HiiAddPackages (\r
+           &mFontPackageGuid,\r
+           gImageHandle,\r
+           &mFontBin,\r
+           NULL\r
+           );\r
+}\r