/** @file\r
Private structures definitions in HiiDatabase.\r
\r
-Copyright (c) 2007 - 2008, Intel Corporation\r
-All rights reserved. This program and the accompanying materials\r
+Copyright (c) 2007 - 2011, 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
http://opensource.org/licenses/bsd-license.php\r
\r
#include <Uefi.h>\r
\r
-#include <Protocol/ConsoleControl.h>\r
#include <Protocol/DevicePath.h>\r
#include <Protocol/HiiFont.h>\r
#include <Protocol/HiiImage.h>\r
#include <Protocol/SimpleTextOut.h>\r
\r
#include <Guid/HiiKeyBoardLayout.h>\r
+#include <Guid/GlobalVariable.h>\r
\r
\r
#include <Library/DebugLib.h>\r
#include <Library/BaseLib.h>\r
#include <Library/DevicePathLib.h>\r
#include <Library/MemoryAllocationLib.h>\r
-#include <Library/IfrSupportLib.h>\r
#include <Library/UefiLib.h>\r
#include <Library/PcdLib.h>\r
#include <Library/UefiRuntimeServicesTableLib.h>\r
+#include <Library/PrintLib.h>\r
\r
\r
#define HII_DATABASE_NOTIFY_GUID \\r
#define BITMAP_LEN_8_BIT(Width, Height) ((Width) * (Height))\r
#define BITMAP_LEN_24_BIT(Width, Height) ((Width) * (Height) * 3)\r
\r
+//\r
+// IFR data structure\r
+//\r
+// BASE_CR (a, IFR_DEFAULT_VALUE_DATA, Entry) to get the whole structure.\r
+\r
+typedef struct {\r
+ LIST_ENTRY Entry; // Link to VarStorage\r
+ EFI_GUID Guid;\r
+ CHAR16 *Name;\r
+ EFI_VARSTORE_ID VarStoreId;\r
+ UINT16 Size;\r
+ LIST_ENTRY BlockEntry; // Link to its Block array\r
+} IFR_VARSTORAGE_DATA;\r
+\r
+typedef struct {\r
+ LIST_ENTRY Entry; // Link to Block array\r
+ UINT16 Offset;\r
+ UINT16 Width;\r
+ EFI_QUESTION_ID QuestionId;\r
+ UINT8 OpCode;\r
+ UINT8 Scope;\r
+ LIST_ENTRY DefaultValueEntry; // Link to its default value array\r
+} IFR_BLOCK_DATA;\r
+\r
+typedef struct {\r
+ LIST_ENTRY Entry;\r
+ UINT8 OpCode;\r
+ EFI_STRING_ID DefaultName;\r
+ UINT16 DefaultId;\r
+ UINT64 Value;\r
+} IFR_DEFAULT_DATA;\r
+\r
//\r
// Storage types\r
//\r
#define EFI_HII_VARSTORE_NAME_VALUE 1\r
#define EFI_HII_VARSTORE_EFI_VARIABLE 2\r
\r
-#define HII_FORMSET_STORAGE_SIGNATURE EFI_SIGNATURE_32 ('H', 'S', 'T', 'G')\r
+#define HII_FORMSET_STORAGE_SIGNATURE SIGNATURE_32 ('H', 'S', 'T', 'G')\r
typedef struct {\r
UINTN Signature;\r
LIST_ENTRY Entry;\r
UINT16 Size;\r
} HII_FORMSET_STORAGE;\r
\r
-#define HII_FORMSET_STORAGE_FROM_LINK(a) CR (a, HII_FORMSET_STORAGE, Link, HII_FORMSET_STORAGE_SIGNATURE)\r
-\r
\r
//\r
// String Package definitions\r
//\r
-#define HII_STRING_PACKAGE_SIGNATURE EFI_SIGNATURE_32 ('h','i','s','p')\r
+#define HII_STRING_PACKAGE_SIGNATURE SIGNATURE_32 ('h','i','s','p')\r
typedef struct _HII_STRING_PACKAGE_INSTANCE {\r
UINTN Signature;\r
EFI_HII_STRING_PACKAGE_HDR *StringPkgHdr;\r
LIST_ENTRY StringEntry;\r
LIST_ENTRY FontInfoList; // local font info list\r
UINT8 FontId;\r
+ EFI_STRING_ID MaxStringId; // record StringId\r
} HII_STRING_PACKAGE_INSTANCE;\r
\r
//\r
// Form Package definitions\r
//\r
-#define HII_IFR_PACKAGE_SIGNATURE EFI_SIGNATURE_32 ('h','f','r','p')\r
+#define HII_IFR_PACKAGE_SIGNATURE SIGNATURE_32 ('h','f','r','p')\r
typedef struct _HII_IFR_PACKAGE_INSTANCE {\r
UINTN Signature;\r
EFI_HII_PACKAGE_HEADER FormPkgHdr;\r
//\r
// Simple Font Package definitions\r
//\r
-#define HII_S_FONT_PACKAGE_SIGNATURE EFI_SIGNATURE_32 ('h','s','f','p')\r
+#define HII_S_FONT_PACKAGE_SIGNATURE SIGNATURE_32 ('h','s','f','p')\r
typedef struct _HII_SIMPLE_FONT_PACKAGE_INSTANCE {\r
UINTN Signature;\r
EFI_HII_SIMPLE_FONT_PACKAGE_HDR *SimpleFontPkgHdr;\r
//\r
// Font Package definitions\r
//\r
-#define HII_FONT_PACKAGE_SIGNATURE EFI_SIGNATURE_32 ('h','i','f','p')\r
+#define HII_FONT_PACKAGE_SIGNATURE SIGNATURE_32 ('h','i','f','p')\r
typedef struct _HII_FONT_PACKAGE_INSTANCE {\r
UINTN Signature;\r
EFI_HII_FONT_PACKAGE_HDR *FontPkgHdr;\r
+ UINT16 Height;\r
+ UINT16 BaseLine;\r
UINT8 *GlyphBlock;\r
LIST_ENTRY FontEntry;\r
LIST_ENTRY GlyphInfoList;\r
} HII_FONT_PACKAGE_INSTANCE;\r
\r
-#define HII_GLYPH_INFO_SIGNATURE EFI_SIGNATURE_32 ('h','g','i','s')\r
+#define HII_GLYPH_INFO_SIGNATURE SIGNATURE_32 ('h','g','i','s')\r
typedef struct _HII_GLYPH_INFO {\r
UINTN Signature;\r
LIST_ENTRY Entry;\r
EFI_HII_GLYPH_INFO Cell;\r
} HII_GLYPH_INFO;\r
\r
-#define HII_FONT_INFO_SIGNATURE EFI_SIGNATURE_32 ('h','l','f','i')\r
+#define HII_FONT_INFO_SIGNATURE SIGNATURE_32 ('h','l','f','i')\r
typedef struct _HII_FONT_INFO {\r
UINTN Signature;\r
LIST_ENTRY Entry;\r
UINT8 FontId;\r
} HII_FONT_INFO;\r
\r
-#define HII_GLOBAL_FONT_INFO_SIGNATURE EFI_SIGNATURE_32 ('h','g','f','i')\r
+#define HII_GLOBAL_FONT_INFO_SIGNATURE SIGNATURE_32 ('h','g','f','i')\r
typedef struct _HII_GLOBAL_FONT_INFO {\r
UINTN Signature;\r
LIST_ENTRY Entry;\r
//\r
// Keyboard Layout Pacakge definitions\r
//\r
-#define HII_KB_LAYOUT_PACKAGE_SIGNATURE EFI_SIGNATURE_32 ('h','k','l','p')\r
+#define HII_KB_LAYOUT_PACKAGE_SIGNATURE SIGNATURE_32 ('h','k','l','p')\r
typedef struct _HII_KEYBOARD_LAYOUT_PACKAGE_INSTANCE {\r
UINTN Signature;\r
UINT8 *KeyboardPkg;\r
//\r
// Guid Package definitions\r
//\r
-#define HII_GUID_PACKAGE_SIGNATURE EFI_SIGNATURE_32 ('h','i','g','p')\r
+#define HII_GUID_PACKAGE_SIGNATURE SIGNATURE_32 ('h','i','g','p')\r
typedef struct _HII_GUID_PACKAGE_INSTANCE {\r
UINTN Signature;\r
UINT8 *GuidPkg;\r
UINT8 *DevicePathPkg;\r
} HII_DATABASE_PACKAGE_LIST_INSTANCE;\r
\r
-#define HII_HANDLE_SIGNATURE EFI_SIGNATURE_32 ('h','i','h','l')\r
+#define HII_HANDLE_SIGNATURE SIGNATURE_32 ('h','i','h','l')\r
\r
typedef struct {\r
UINTN Signature;\r
UINTN Key;\r
} HII_HANDLE;\r
\r
-#define HII_DATABASE_RECORD_SIGNATURE EFI_SIGNATURE_32 ('h','i','d','r')\r
+#define HII_DATABASE_RECORD_SIGNATURE SIGNATURE_32 ('h','i','d','r')\r
\r
typedef struct _HII_DATABASE_RECORD {\r
UINTN Signature;\r
LIST_ENTRY DatabaseEntry;\r
} HII_DATABASE_RECORD;\r
\r
-#define HII_DATABASE_NOTIFY_SIGNATURE EFI_SIGNATURE_32 ('h','i','d','n')\r
+#define HII_DATABASE_NOTIFY_SIGNATURE SIGNATURE_32 ('h','i','d','n')\r
\r
typedef struct _HII_DATABASE_NOTIFY {\r
UINTN Signature;\r
LIST_ENTRY DatabaseNotifyEntry;\r
} HII_DATABASE_NOTIFY;\r
\r
-#define HII_DATABASE_PRIVATE_DATA_SIGNATURE EFI_SIGNATURE_32 ('H', 'i', 'D', 'p')\r
+#define HII_DATABASE_PRIVATE_DATA_SIGNATURE SIGNATURE_32 ('H', 'i', 'D', 'p')\r
\r
typedef struct _HII_DATABASE_PRIVATE_DATA {\r
UINTN Signature;\r
/**\r
Parse all string blocks to find a String block specified by StringId.\r
If StringId = (EFI_STRING_ID) (-1), find out all EFI_HII_SIBT_FONT blocks\r
- within this string package and backup its information.\r
- If StringId = 0, output the string id of last string block (EFI_HII_SIBT_END).\r
+ within this string package and backup its information. If LastStringId is \r
+ specified, the string id of last string block will also be output.\r
+ If StringId = 0, output the string id of last string block (EFI_HII_SIBT_STRING).\r
\r
@param Private Hii database private structure.\r
@param StringPackage Hii string package instance.\r
@param StringBlockAddr Output the block address of found string block.\r
@param StringTextOffset Offset, relative to the found block address, of\r
the string text information.\r
- @param LastStringId Output the last string id when StringId = 0.\r
+ @param LastStringId Output the last string id when StringId = 0 or StringId = -1.\r
+ @param StartStringId The first id in the skip block which StringId in the block.\r
\r
@retval EFI_SUCCESS The string text and font is retrieved\r
successfully.\r
OUT UINT8 *BlockType, OPTIONAL\r
OUT UINT8 **StringBlockAddr, OPTIONAL\r
OUT UINTN *StringTextOffset, OPTIONAL\r
- OUT EFI_STRING_ID *LastStringId OPTIONAL\r
+ OUT EFI_STRING_ID *LastStringId, OPTIONAL\r
+ OUT EFI_STRING_ID *StartStringId OPTIONAL\r
);\r
\r
\r
OUT UINTN *GlyphBufferLen OPTIONAL\r
);\r
\r
+/**\r
+ This function exports Form packages to a buffer.\r
+ This is a internal function.\r
+\r
+ @param Private Hii database private structure.\r
+ @param Handle Identification of a package list.\r
+ @param PackageList Pointer to a package list which will be exported.\r
+ @param UsedSize The length of buffer be used.\r
+ @param BufferSize Length of the Buffer.\r
+ @param Buffer Allocated space for storing exported data.\r
+ @param ResultSize The size of the already exported content of this\r
+ package list.\r
+\r
+ @retval EFI_SUCCESS Form Packages are exported successfully.\r
+ @retval EFI_INVALID_PARAMETER Any input parameter is invalid.\r
+\r
+**/\r
+EFI_STATUS\r
+ExportFormPackages (\r
+ IN HII_DATABASE_PRIVATE_DATA *Private,\r
+ IN EFI_HII_HANDLE Handle,\r
+ IN HII_DATABASE_PACKAGE_LIST_INSTANCE *PackageList,\r
+ IN UINTN UsedSize,\r
+ IN UINTN BufferSize,\r
+ IN OUT VOID *Buffer,\r
+ IN OUT UINTN *ResultSize\r
+ );\r
+\r
//\r
// EFI_HII_FONT_PROTOCOL protocol interfaces\r
//\r
@param PackageList A pointer to an EFI_HII_PACKAGE_LIST_HEADER\r
structure.\r
@param DriverHandle Associate the package list with this EFI handle.\r
+ If a NULL is specified, this data will not be associate\r
+ with any drivers and cannot have a callback induced.\r
@param Handle A pointer to the EFI_HII_HANDLE instance.\r
\r
@retval EFI_SUCCESS The package list associated with the Handle was\r
HiiNewPackageList (\r
IN CONST EFI_HII_DATABASE_PROTOCOL *This,\r
IN CONST EFI_HII_PACKAGE_LIST_HEADER *PackageList,\r
- IN CONST EFI_HANDLE DriverHandle,\r
+ IN CONST EFI_HANDLE DriverHandle, OPTIONAL\r
OUT EFI_HII_HANDLE *Handle\r
);\r
\r
);\r
\r
\r
+/**\r
+ Compare whether two names of languages are identical.\r
+\r
+ @param Language1 Name of language 1\r
+ @param Language2 Name of language 2\r
+\r
+ @retval TRUE same\r
+ @retval FALSE not same\r
+\r
+**/\r
+BOOLEAN\r
+HiiCompareLanguage (\r
+ IN CHAR8 *Language1,\r
+ IN CHAR8 *Language2\r
+ )\r
+;\r
+\r
//\r
// Global variables\r
//\r
extern EFI_EVENT gHiiKeyboardLayoutChanged;\r
-\r
-#include "R8Lib.h"\r
-\r
#endif\r