X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;f=MdeModulePkg%2FUniversal%2FHiiDatabaseDxe%2FHiiDatabase.h;h=783fc7ecc132e3b9d31172be9960628c12142798;hb=c8ad2d7a296c851c2a91519f80dab479df0fdf46;hp=62c5b2d7afcd87561dd6c126c7059336042e882c;hpb=f3f2e05db8c89628498ec4efdb16184747824c63;p=mirror_edk2.git diff --git a/MdeModulePkg/Universal/HiiDatabaseDxe/HiiDatabase.h b/MdeModulePkg/Universal/HiiDatabaseDxe/HiiDatabase.h index 62c5b2d7af..783fc7ecc1 100644 --- a/MdeModulePkg/Universal/HiiDatabaseDxe/HiiDatabase.h +++ b/MdeModulePkg/Universal/HiiDatabaseDxe/HiiDatabase.h @@ -1,8 +1,8 @@ /** @file Private structures definitions in HiiDatabase. -Copyright (c) 2007 - 2008, Intel Corporation -All rights reserved. This program and the accompanying materials +Copyright (c) 2007 - 2011, Intel Corporation. All rights reserved.
+This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at http://opensource.org/licenses/bsd-license.php @@ -17,7 +17,6 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. #include -#include #include #include #include @@ -28,6 +27,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. #include #include +#include #include @@ -37,16 +37,10 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. #include #include #include -#include #include #include #include - - -#define HII_DATABASE_NOTIFY_GUID \ - { \ - 0xc1c76, 0xd79e, 0x42fe, {0x86, 0xb, 0x8b, 0xe8, 0x7b, 0x3e, 0x7a, 0x78} \ - } +#include #define MAX_STRING_LENGTH 1024 #define MAX_FONT_NAME_LEN 256 @@ -62,6 +56,37 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. #define BITMAP_LEN_8_BIT(Width, Height) ((Width) * (Height)) #define BITMAP_LEN_24_BIT(Width, Height) ((Width) * (Height) * 3) +// +// IFR data structure +// +// BASE_CR (a, IFR_DEFAULT_VALUE_DATA, Entry) to get the whole structure. + +typedef struct { + LIST_ENTRY Entry; // Link to VarStorage + EFI_GUID Guid; + CHAR16 *Name; + EFI_VARSTORE_ID VarStoreId; + UINT16 Size; + LIST_ENTRY BlockEntry; // Link to its Block array +} IFR_VARSTORAGE_DATA; + +typedef struct { + LIST_ENTRY Entry; // Link to Block array + UINT16 Offset; + UINT16 Width; + EFI_QUESTION_ID QuestionId; + UINT8 OpCode; + UINT8 Scope; + LIST_ENTRY DefaultValueEntry; // Link to its default value array +} IFR_BLOCK_DATA; + +typedef struct { + LIST_ENTRY Entry; + UINT8 OpCode; + UINT16 DefaultId; + UINT64 Value; +} IFR_DEFAULT_DATA; + // // Storage types // @@ -83,8 +108,6 @@ typedef struct { UINT16 Size; } HII_FORMSET_STORAGE; -#define HII_FORMSET_STORAGE_FROM_LINK(a) CR (a, HII_FORMSET_STORAGE, Link, HII_FORMSET_STORAGE_SIGNATURE) - // // String Package definitions @@ -97,6 +120,7 @@ typedef struct _HII_STRING_PACKAGE_INSTANCE { LIST_ENTRY StringEntry; LIST_ENTRY FontInfoList; // local font info list UINT8 FontId; + EFI_STRING_ID MaxStringId; // record StringId } HII_STRING_PACKAGE_INSTANCE; // @@ -127,6 +151,8 @@ typedef struct _HII_SIMPLE_FONT_PACKAGE_INSTANCE { typedef struct _HII_FONT_PACKAGE_INSTANCE { UINTN Signature; EFI_HII_FONT_PACKAGE_HDR *FontPkgHdr; + UINT16 Height; + UINT16 BaseLine; UINT8 *GlyphBlock; LIST_ENTRY FontEntry; LIST_ENTRY GlyphInfoList; @@ -392,8 +418,9 @@ GetSystemFont ( /** Parse all string blocks to find a String block specified by StringId. If StringId = (EFI_STRING_ID) (-1), find out all EFI_HII_SIBT_FONT blocks - within this string package and backup its information. - If StringId = 0, output the string id of last string block (EFI_HII_SIBT_END). + within this string package and backup its information. If LastStringId is + specified, the string id of last string block will also be output. + If StringId = 0, output the string id of last string block (EFI_HII_SIBT_STRING). @param Private Hii database private structure. @param StringPackage Hii string package instance. @@ -403,7 +430,8 @@ GetSystemFont ( @param StringBlockAddr Output the block address of found string block. @param StringTextOffset Offset, relative to the found block address, of the string text information. - @param LastStringId Output the last string id when StringId = 0. + @param LastStringId Output the last string id when StringId = 0 or StringId = -1. + @param StartStringId The first id in the skip block which StringId in the block. @retval EFI_SUCCESS The string text and font is retrieved successfully. @@ -421,7 +449,8 @@ FindStringBlock ( OUT UINT8 *BlockType, OPTIONAL OUT UINT8 **StringBlockAddr, OPTIONAL OUT UINTN *StringTextOffset, OPTIONAL - OUT EFI_STRING_ID *LastStringId OPTIONAL + OUT EFI_STRING_ID *LastStringId, OPTIONAL + OUT EFI_STRING_ID *StartStringId OPTIONAL ); @@ -455,6 +484,34 @@ FindGlyphBlock ( OUT UINTN *GlyphBufferLen OPTIONAL ); +/** + This function exports Form packages to a buffer. + This is a internal function. + + @param Private Hii database private structure. + @param Handle Identification of a package list. + @param PackageList Pointer to a package list which will be exported. + @param UsedSize The length of buffer be used. + @param BufferSize Length of the Buffer. + @param Buffer Allocated space for storing exported data. + @param ResultSize The size of the already exported content of this + package list. + + @retval EFI_SUCCESS Form Packages are exported successfully. + @retval EFI_INVALID_PARAMETER Any input parameter is invalid. + +**/ +EFI_STATUS +ExportFormPackages ( + IN HII_DATABASE_PRIVATE_DATA *Private, + IN EFI_HII_HANDLE Handle, + IN HII_DATABASE_PACKAGE_LIST_INSTANCE *PackageList, + IN UINTN UsedSize, + IN UINTN BufferSize, + IN OUT VOID *Buffer, + IN OUT UINTN *ResultSize + ); + // // EFI_HII_FONT_PROTOCOL protocol interfaces // @@ -997,7 +1054,8 @@ HiiSetString ( @param This A pointer to the EFI_HII_STRING_PROTOCOL instance. @param PackageList The package list to examine. - @param Languages Points to the buffer to hold the returned string. + @param Languages Points to the buffer to hold the returned + null-terminated ASCII string. @param LanguagesSize On entry, points to the size of the buffer pointed to by Languages, in bytes. On return, points to the length of Languages, in bytes. @@ -1029,25 +1087,28 @@ HiiGetLanguages ( @param This A pointer to the EFI_HII_STRING_PROTOCOL instance. @param PackageList The package list to examine. - @param FirstLanguage Points to the primary language. - @param SecondaryLanguages Points to the buffer to hold the returned list of - secondary languages for the specified - FirstLanguage. If there are no secondary - languages, the function returns successfully, + @param PrimaryLanguage Points to the null-terminated ASCII string that specifies + the primary language. Languages are specified in the + format specified in Appendix M of the UEFI 2.0 specification. + @param SecondaryLanguages Points to the buffer to hold the returned null-terminated + ASCII string that describes the list of + secondary languages for the specified + PrimaryLanguage. If there are no secondary + languages, the function returns successfully, but this is set to NULL. @param SecondaryLanguagesSize On entry, points to the size of the buffer - pointed to by SecondLanguages, in bytes. On - return, points to the length of SecondLanguages + pointed to by SecondaryLanguages, in bytes. On + return, points to the length of SecondaryLanguages in bytes. @retval EFI_SUCCESS Secondary languages were correctly returned. - @retval EFI_INVALID_PARAMETER FirstLanguage or SecondLanguages or - SecondLanguagesSize was NULL. - @retval EFI_BUFFER_TOO_SMALL The buffer specified by SecondLanguagesSize is + @retval EFI_INVALID_PARAMETER PrimaryLanguage or SecondaryLanguages or + SecondaryLanguagesSize was NULL. + @retval EFI_BUFFER_TOO_SMALL The buffer specified by SecondaryLanguagesSize is too small to hold the returned information. - SecondLanguageSize is updated to hold the size of + SecondaryLanguageSize is updated to hold the size of the buffer required. - @retval EFI_INVALID_LANGUAGE The language specified by FirstLanguage is not + @retval EFI_INVALID_LANGUAGE The language specified by PrimaryLanguage is not present in the specified package list. @retval EFI_NOT_FOUND The specified PackageList is not in the Database. @@ -1057,7 +1118,7 @@ EFIAPI HiiGetSecondaryLanguages ( IN CONST EFI_HII_STRING_PROTOCOL *This, IN EFI_HII_HANDLE PackageList, - IN CONST CHAR8 *FirstLanguage, + IN CONST CHAR8 *PrimaryLanguage, IN OUT CHAR8 *SecondaryLanguages, IN OUT UINTN *SecondaryLanguagesSize ); @@ -1077,6 +1138,8 @@ HiiGetSecondaryLanguages ( @param PackageList A pointer to an EFI_HII_PACKAGE_LIST_HEADER structure. @param DriverHandle Associate the package list with this EFI handle. + If a NULL is specified, this data will not be associate + with any drivers and cannot have a callback induced. @param Handle A pointer to the EFI_HII_HANDLE instance. @retval EFI_SUCCESS The package list associated with the Handle was @@ -1091,7 +1154,7 @@ EFIAPI HiiNewPackageList ( IN CONST EFI_HII_DATABASE_PROTOCOL *This, IN CONST EFI_HII_PACKAGE_LIST_HEADER *PackageList, - IN CONST EFI_HANDLE DriverHandle, + IN CONST EFI_HANDLE DriverHandle, OPTIONAL OUT EFI_HII_HANDLE *Handle ); @@ -1688,11 +1751,25 @@ HiiGetAltCfg ( ); +/** + Compare whether two names of languages are identical. + + @param Language1 Name of language 1 from StringPackage + @param Language2 Name of language 2 to be compared with language 1. + + @retval TRUE same + @retval FALSE not same + +**/ +BOOLEAN +HiiCompareLanguage ( + IN CHAR8 *Language1, + IN CHAR8 *Language2 + ) +; + // // Global variables // extern EFI_EVENT gHiiKeyboardLayoutChanged; - -#include "R8Lib.h" - #endif