X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;f=MdeModulePkg%2FUniversal%2FHiiDatabaseDxe%2FHiiDatabase.h;h=320754cf20bef7479f0def78359f1b2e198ef1dc;hb=37cd16ac57fcbe5f6ecd15f85ea51621d08cde59;hp=6e28df7f456a0a274c856d0b1413a8f38c463e10;hpb=91af324da0a2fad4d09ac4024570b0ef2dd77aaf;p=mirror_edk2.git diff --git a/MdeModulePkg/Universal/HiiDatabaseDxe/HiiDatabase.h b/MdeModulePkg/Universal/HiiDatabaseDxe/HiiDatabase.h index 6e28df7f45..320754cf20 100644 --- a/MdeModulePkg/Universal/HiiDatabaseDxe/HiiDatabase.h +++ b/MdeModulePkg/Universal/HiiDatabaseDxe/HiiDatabase.h @@ -1,7 +1,7 @@ /** @file Private structures definitions in HiiDatabase. -Copyright (c) 2007 - 2016, Intel Corporation. All rights reserved.
+Copyright (c) 2007 - 2017, 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 @@ -20,6 +20,8 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. #include #include #include +#include +#include #include #include #include @@ -29,6 +31,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. #include #include +#include #include @@ -75,11 +78,14 @@ typedef struct { LIST_ENTRY Entry; // Link to Block array UINT16 Offset; UINT16 Width; + UINT16 BitOffset; + UINT16 BitWidth; EFI_QUESTION_ID QuestionId; UINT8 OpCode; UINT8 Scope; LIST_ENTRY DefaultValueEntry; // Link to its default value array CHAR16 *Name; + BOOLEAN IsBitVar; } IFR_BLOCK_DATA; // @@ -87,7 +93,9 @@ typedef struct { // typedef enum { DefaultValueFromDefault = 0, // Get from the minimum or first one when not set default value. - DefaultValueFromFlag, // Get default value from the defalut flag. + DefaultValueFromOtherDefault, // Get default vale from other default when no default(When other + // defaults are more than one, use the default with smallest default id). + DefaultValueFromFlag, // Get default value from the default flag. DefaultValueFromOpcode // Get default value from default opcode, highest priority. } DEFAULT_VALUE_TYPE; @@ -221,12 +229,12 @@ typedef struct _HII_IMAGE_PACKAGE_INSTANCE { EFI_HII_IMAGE_PACKAGE_HDR ImagePkgHdr; UINT32 ImageBlockSize; UINT32 PaletteInfoSize; - UINT8 *ImageBlock; + EFI_HII_IMAGE_BLOCK *ImageBlock; UINT8 *PaletteBlock; } HII_IMAGE_PACKAGE_INSTANCE; // -// Keyboard Layout Pacakge definitions +// Keyboard Layout Package definitions // #define HII_KB_LAYOUT_PACKAGE_SIGNATURE SIGNATURE_32 ('h','k','l','p') typedef struct _HII_KEYBOARD_LAYOUT_PACKAGE_INSTANCE { @@ -299,6 +307,7 @@ typedef struct _HII_DATABASE_PRIVATE_DATA { LIST_ENTRY DatabaseNotifyList; EFI_HII_FONT_PROTOCOL HiiFont; EFI_HII_IMAGE_PROTOCOL HiiImage; + EFI_HII_IMAGE_EX_PROTOCOL HiiImageEx; EFI_HII_STRING_PROTOCOL HiiString; EFI_HII_DATABASE_PROTOCOL HiiDatabase; EFI_HII_CONFIG_ROUTING_PROTOCOL ConfigRouting; @@ -325,6 +334,13 @@ typedef struct _HII_DATABASE_PRIVATE_DATA { HII_DATABASE_PRIVATE_DATA_SIGNATURE \ ) +#define HII_IMAGE_EX_DATABASE_PRIVATE_DATA_FROM_THIS(a) \ + CR (a, \ + HII_DATABASE_PRIVATE_DATA, \ + HiiImageEx, \ + HII_DATABASE_PRIVATE_DATA_SIGNATURE \ + ) + #define HII_STRING_DATABASE_PRIVATE_DATA_FROM_THIS(a) \ CR (a, \ HII_DATABASE_PRIVATE_DATA, \ @@ -418,7 +434,7 @@ IsHiiHandleValid ( @param FontHandle On entry, Points to the font handle returned by a previous call to GetFontInfo() or NULL to start with the first font. - @param GlobalFontInfo If not NULL, output the corresponding globa font + @param GlobalFontInfo If not NULL, output the corresponding global font info. @retval TRUE Existed @@ -530,7 +546,7 @@ FindStringBlock ( @param CharValue Unicode character value, which identifies a glyph block. @param GlyphBuffer Output the corresponding bitmap data of the found - block. It is the caller's responsiblity to free + block. It is the caller's responsibility to free this buffer. @param Cell Output cell information of the encoded bitmap. @param GlyphBufferLen If not NULL, output the length of GlyphBuffer. @@ -811,6 +827,82 @@ HiiGetFontInfo ( // EFI_HII_IMAGE_PROTOCOL interfaces // +/** + Get the image id of last image block: EFI_HII_IIBT_END_BLOCK when input + ImageId is zero, otherwise return the address of the + corresponding image block with identifier specified by ImageId. + + This is a internal function. + + @param ImageBlocks Points to the beginning of a series of image blocks stored in order. + @param ImageId If input ImageId is 0, output the image id of the EFI_HII_IIBT_END_BLOCK; + else use this id to find its corresponding image block address. + + @return The image block address when input ImageId is not zero; otherwise return NULL. + +**/ +EFI_HII_IMAGE_BLOCK * +GetImageIdOrAddress ( + IN EFI_HII_IMAGE_BLOCK *ImageBlocks, + IN OUT EFI_IMAGE_ID *ImageId + ); + +/** + Return the HII package list identified by PackageList HII handle. + + @param Database Pointer to HII database list header. + @param PackageList HII handle of the package list to locate. + + @retval The HII package list instance. +**/ +HII_DATABASE_PACKAGE_LIST_INSTANCE * +LocatePackageList ( + IN LIST_ENTRY *Database, + IN EFI_HII_HANDLE PackageList + ); + +/** + This function retrieves the image specified by ImageId which is associated with + the specified PackageList and copies it into the buffer specified by Image. + + @param Database A pointer to the database list header. + @param PackageList Handle of the package list where this image will + be searched. + @param ImageId The image's id,, which is unique within + PackageList. + @param Image Points to the image. + @param BitmapOnly TRUE to only return the bitmap type image. + FALSE to locate image decoder instance to decode image. + + @retval EFI_SUCCESS The new image was returned successfully. + @retval EFI_NOT_FOUND The image specified by ImageId is not in the + database. The specified PackageList is not in the database. + @retval EFI_BUFFER_TOO_SMALL The buffer specified by ImageSize is too small to + hold the image. + @retval EFI_INVALID_PARAMETER The Image or ImageSize was NULL. + @retval EFI_OUT_OF_RESOURCES The bitmap could not be retrieved because there was not + enough memory. +**/ +EFI_STATUS +IGetImage ( + IN LIST_ENTRY *Database, + IN EFI_HII_HANDLE PackageList, + IN EFI_IMAGE_ID ImageId, + OUT EFI_IMAGE_INPUT *Image, + IN BOOLEAN BitmapOnly + ); + +/** + Return the first HII image decoder instance which supports the DecoderName. + + @param BlockType The image block type. + + @retval Pointer to the HII image decoder instance. +**/ +EFI_HII_IMAGE_DECODER_PROTOCOL * +LocateHiiImageDecoder ( + UINT8 BlockType + ); /** This function adds the image Image to the group of images owned by PackageList, and returns @@ -982,10 +1074,213 @@ HiiDrawImageId ( IN OUT EFI_IMAGE_OUTPUT **Blt, IN UINTN BltX, IN UINTN BltY - ) + ); -; +/** + The prototype of this extension function is the same with EFI_HII_IMAGE_PROTOCOL.NewImage(). + This protocol invokes EFI_HII_IMAGE_PROTOCOL.NewImage() implicitly. + + @param This A pointer to the EFI_HII_IMAGE_EX_PROTOCOL instance. + @param PackageList Handle of the package list where this image will + be added. + @param ImageId On return, contains the new image id, which is + unique within PackageList. + @param Image Points to the image. + + @retval EFI_SUCCESS The new image was added successfully. + @retval EFI_NOT_FOUND The PackageList could not be found. + @retval EFI_OUT_OF_RESOURCES Could not add the image due to lack of resources. + @retval EFI_INVALID_PARAMETER Image is NULL or ImageId is NULL. +**/ +EFI_STATUS +EFIAPI +HiiNewImageEx ( + IN CONST EFI_HII_IMAGE_EX_PROTOCOL *This, + IN EFI_HII_HANDLE PackageList, + OUT EFI_IMAGE_ID *ImageId, + IN CONST EFI_IMAGE_INPUT *Image + ); + +/** + Return the information about the image, associated with the package list. + The prototype of this extension function is the same with EFI_HII_IMAGE_PROTOCOL.GetImage(). + + This function is similar to EFI_HII_IMAGE_PROTOCOL.GetImage(). The difference is that + this function will locate all EFI_HII_IMAGE_DECODER_PROTOCOL instances installed in the + system if the decoder of the certain image type is not supported by the + EFI_HII_IMAGE_EX_PROTOCOL. The function will attempt to decode the image to the + EFI_IMAGE_INPUT using the first EFI_HII_IMAGE_DECODER_PROTOCOL instance that + supports the requested image type. + + @param This A pointer to the EFI_HII_IMAGE_EX_PROTOCOL instance. + @param PackageList The package list in the HII database to search for the + specified image. + @param ImageId The image's id, which is unique within PackageList. + @param Image Points to the image. + + @retval EFI_SUCCESS The new image was returned successfully. + @retval EFI_NOT_FOUND The image specified by ImageId is not available. The specified + PackageList is not in the Database. + @retval EFI_INVALID_PARAMETER Image was NULL or ImageId was 0. + @retval EFI_OUT_OF_RESOURCES The bitmap could not be retrieved because there + was not enough memory. + +**/ +EFI_STATUS +EFIAPI +HiiGetImageEx ( + IN CONST EFI_HII_IMAGE_EX_PROTOCOL *This, + IN EFI_HII_HANDLE PackageList, + IN EFI_IMAGE_ID ImageId, + OUT EFI_IMAGE_INPUT *Image + ); + +/** + Change the information about the image. + + Same with EFI_HII_IMAGE_PROTOCOL.SetImage(), this protocol invokes + EFI_HII_IMAGE_PROTOCOL.SetImage()implicitly. + + @param This A pointer to the EFI_HII_IMAGE_EX_PROTOCOL instance. + @param PackageList The package list containing the images. + @param ImageId The image's id, which is unique within PackageList. + @param Image Points to the image. + + @retval EFI_SUCCESS The new image was successfully updated. + @retval EFI_NOT_FOUND The image specified by ImageId is not in the + database. The specified PackageList is not in + the database. + @retval EFI_INVALID_PARAMETER The Image was NULL, the ImageId was 0 or + the Image->Bitmap was NULL. + +**/ +EFI_STATUS +EFIAPI +HiiSetImageEx ( + IN CONST EFI_HII_IMAGE_EX_PROTOCOL *This, + IN EFI_HII_HANDLE PackageList, + IN EFI_IMAGE_ID ImageId, + IN CONST EFI_IMAGE_INPUT *Image + ); + +/** + Renders an image to a bitmap or to the display. + + The prototype of this extension function is the same with + EFI_HII_IMAGE_PROTOCOL.DrawImage(). This protocol invokes + EFI_HII_IMAGE_PROTOCOL.DrawImage() implicitly. + + @param This A pointer to the EFI_HII_IMAGE_EX_PROTOCOL instance. + @param Flags Describes how the image is to be drawn. + @param Image Points to the image to be displayed. + @param Blt If this points to a non-NULL on entry, this points + to the image, which is Width pixels wide and + Height pixels high. The image will be drawn onto + this image and EFI_HII_DRAW_FLAG_CLIP is implied. + If this points to a NULL on entry, then a buffer + will be allocated to hold the generated image and + the pointer updated on exit. It is the caller's + responsibility to free this buffer. + @param BltX Specifies the offset from the left and top edge of + the output image of the first pixel in the image. + @param BltY Specifies the offset from the left and top edge of + the output image of the first pixel in the image. + + @retval EFI_SUCCESS The image was successfully drawn. + @retval EFI_OUT_OF_RESOURCES Unable to allocate an output buffer for Blt. + @retval EFI_INVALID_PARAMETER The Image or Blt was NULL. + +**/ +EFI_STATUS +EFIAPI +HiiDrawImageEx ( + IN CONST EFI_HII_IMAGE_EX_PROTOCOL *This, + IN EFI_HII_DRAW_FLAGS Flags, + IN CONST EFI_IMAGE_INPUT *Image, + IN OUT EFI_IMAGE_OUTPUT **Blt, + IN UINTN BltX, + IN UINTN BltY + ); +/** + Renders an image to a bitmap or the screen containing the contents of the specified + image. + + This function is similar to EFI_HII_IMAGE_PROTOCOL.DrawImageId(). The difference is that + this function will locate all EFI_HII_IMAGE_DECODER_PROTOCOL instances installed in the + system if the decoder of the certain image type is not supported by the + EFI_HII_IMAGE_EX_PROTOCOL. The function will attempt to decode the image to the + EFI_IMAGE_INPUT using the first EFI_HII_IMAGE_DECODER_PROTOCOL instance that + supports the requested image type. + + @param This A pointer to the EFI_HII_IMAGE_EX_PROTOCOL instance. + @param Flags Describes how the image is to be drawn. + @param PackageList The package list in the HII database to search for + the specified image. + @param ImageId The image's id, which is unique within PackageList. + @param Blt If this points to a non-NULL on entry, this points + to the image, which is Width pixels wide and + Height pixels high. The image will be drawn onto + this image and EFI_HII_DRAW_FLAG_CLIP is implied. + If this points to a NULL on entry, then a buffer + will be allocated to hold the generated image + and the pointer updated on exit. It is the caller's + responsibility to free this buffer. + @param BltX Specifies the offset from the left and top edge of + the output image of the first pixel in the image. + @param BltY Specifies the offset from the left and top edge of + the output image of the first pixel in the image. + + @retval EFI_SUCCESS The image was successfully drawn. + @retval EFI_OUT_OF_RESOURCES Unable to allocate an output buffer for Blt. + @retval EFI_INVALID_PARAMETER The Blt was NULL or ImageId was 0. + @retval EFI_NOT_FOUND The image specified by ImageId is not in the database. + The specified PackageList is not in the database. + +**/ +EFI_STATUS +EFIAPI +HiiDrawImageIdEx ( + IN CONST EFI_HII_IMAGE_EX_PROTOCOL *This, + IN EFI_HII_DRAW_FLAGS Flags, + IN EFI_HII_HANDLE PackageList, + IN EFI_IMAGE_ID ImageId, + IN OUT EFI_IMAGE_OUTPUT **Blt, + IN UINTN BltX, + IN UINTN BltY + ); + +/** + This function returns the image information to EFI_IMAGE_OUTPUT. Only the width + and height are returned to the EFI_IMAGE_OUTPUT instead of decoding the image + to the buffer. This function is used to get the geometry of the image. This function + will try to locate all of the EFI_HII_IMAGE_DECODER_PROTOCOL installed on the + system if the decoder of image type is not supported by the EFI_HII_IMAGE_EX_PROTOCOL. + + @param This A pointer to the EFI_HII_IMAGE_EX_PROTOCOL instance. + @param PackageList Handle of the package list where this image will + be searched. + @param ImageId The image's id, which is unique within PackageList. + @param Image Points to the image. + + @retval EFI_SUCCESS The new image was returned successfully. + @retval EFI_NOT_FOUND The image specified by ImageId is not in the + database. The specified PackageList is not in the database. + @retval EFI_BUFFER_TOO_SMALL The buffer specified by ImageSize is too small to + hold the image. + @retval EFI_INVALID_PARAMETER The Image was NULL or the ImageId was 0. + @retval EFI_OUT_OF_RESOURCES The bitmap could not be retrieved because there + was not enough memory. + +**/ +EFI_STATUS +EFIAPI +HiiGetImageInfo ( + IN CONST EFI_HII_IMAGE_EX_PROTOCOL *This, + IN EFI_HII_HANDLE PackageList, + IN EFI_IMAGE_ID ImageId, + OUT EFI_IMAGE_OUTPUT *Image + ); // // EFI_HII_STRING_PROTOCOL // @@ -1300,7 +1595,7 @@ HiiUpdatePackageList ( buffer that is required for the handles found. @param Handle An array of EFI_HII_HANDLE instances returned. - @retval EFI_SUCCESS The matching handles are outputed successfully. + @retval EFI_SUCCESS The matching handles are outputted successfully. HandleBufferLength is updated with the actual length. @retval EFI_BUFFER_TO_SMALL The HandleBufferLength parameter indicates that Handle is too small to support the number of @@ -1349,7 +1644,7 @@ HiiListPackageLists ( Handle is too small to support the number of handles. HandleBufferLength is updated with a value that will enable the data to fit. - @retval EFI_NOT_FOUND The specifiecd Handle could not be found in the + @retval EFI_NOT_FOUND The specified Handle could not be found in the current database. @retval EFI_INVALID_PARAMETER BufferSize was NULL. @retval EFI_INVALID_PARAMETER The value referenced by BufferSize was not zero @@ -1945,7 +2240,7 @@ EfiConfigKeywordHandlerSetData ( @retval EFI_SUCCESS The specified action was completed successfully. @retval EFI_INVALID_PARAMETER One or more of the following are TRUE: - 1.Progress, ProgressErr, or Resuts is NULL. + 1.Progress, ProgressErr, or Results is NULL. 2.Parsing of the KeywordString resulted in an error. See Progress and ProgressErr for more data. @@ -1995,7 +2290,7 @@ HiiCompareLanguage ( ; /** - Retrieves a pointer to the a Null-terminated ASCII string containing the list + Retrieves a pointer to a Null-terminated ASCII string containing the list of languages that an HII handle in the HII Database supports. The returned string is allocated using AllocatePool(). The caller is responsible for freeing the returned string using FreePool(). The format of the returned string follows @@ -2006,9 +2301,9 @@ HiiCompareLanguage ( @param[in] HiiHandle A handle that was previously registered in the HII Database. @retval NULL HiiHandle is not registered in the HII database - @retval NULL There are not enough resources available to retrieve the suported + @retval NULL There are not enough resources available to retrieve the supported languages. - @retval NULL The list of suported languages could not be retrieved. + @retval NULL The list of supported languages could not be retrieved. @retval Other A pointer to the Null-terminated ASCII string of supported languages. **/ @@ -2017,8 +2312,38 @@ GetSupportedLanguages ( IN EFI_HII_HANDLE HiiHandle ); +/** +This function mainly use to get HiiDatabase information. + +@param This A pointer to the EFI_HII_DATABASE_PROTOCOL instance. + +@retval EFI_SUCCESS Get the information successfully. +@retval EFI_OUT_OF_RESOURCES Not enough memory to store the Hiidatabase data. + +**/ +EFI_STATUS +HiiGetDatabaseInfo( + IN CONST EFI_HII_DATABASE_PROTOCOL *This + ); + +/** +This is an internal function,mainly use to get and update configuration settings information. + +@param This A pointer to the EFI_HII_DATABASE_PROTOCOL instance. + +@retval EFI_SUCCESS Get the information successfully. +@retval EFI_OUT_OF_RESOURCES Not enough memory to store the Configuration Setting data. + +**/ +EFI_STATUS +HiiGetConfigurationSetting( + IN CONST EFI_HII_DATABASE_PROTOCOL *This + ); + // // Global variables // extern EFI_EVENT gHiiKeyboardLayoutChanged; +extern BOOLEAN gExportAfterReadyToBoot; + #endif