\r
#include "HiiDatabase.h"\r
\r
-#ifndef DISABLE_UNUSED_HII_PROTOCOLS\r
+#ifndef _DISABLE_UNUSED_HII_PROTOCOLS_\r
\r
/**\r
Calculate the number of Unicode characters of the incoming Configuration string,\r
not including NULL terminator.\r
\r
+ This is a internal function.\r
+\r
@param String String in <MultiConfigRequest> or\r
<MultiConfigResp> format.\r
\r
@return The number of Unicode characters.\r
\r
**/\r
-STATIC\r
UINTN\r
CalculateConfigStringLen (\r
IN EFI_STRING String\r
Convert the hex UNICODE %02x encoding of a UEFI device path to binary\r
from <PathHdr> of <ConfigHdr>.\r
\r
+ This is a internal function.\r
+\r
@param String UEFI configuration string\r
@param DevicePath binary of a UEFI device path.\r
\r
binary format.\r
\r
**/\r
-STATIC\r
EFI_STATUS\r
GetDevicePath (\r
IN EFI_STRING String,\r
/**\r
Extract Storage from all Form Packages in current hii database.\r
\r
+ This is a internal function.\r
+\r
@param HiiDatabase EFI_HII_DATABASE_PROTOCOL instance.\r
@param StorageListHead Storage link List head.\r
\r
@retval EFI_SUCCESS All existing storage is exported.\r
\r
**/\r
-STATIC\r
EFI_STATUS\r
ExportAllStorage (\r
IN EFI_HII_DATABASE_PROTOCOL *HiiDatabase,\r
/**\r
Generate a sub string then output it.\r
\r
+ This is a internal function.\r
+\r
@param String A constant string which is the prefix of the to be\r
generated string, e.g. GUID=\r
@param BufferLen The length of the Buffer in bytes.\r
\r
\r
**/\r
-STATIC\r
VOID\r
GenerateSubStr (\r
IN CONST EFI_STRING String,\r
/**\r
Retrieve the <ConfigBody> from String then output it.\r
\r
+ This is a internal function.\r
+\r
@param String A sub string of a configuration string in\r
<MultiConfigAltResp> format.\r
@param ConfigBody Points to the output string. It's caller's\r
@retval EFI_SUCCESS All existing storage is exported.\r
\r
**/\r
-STATIC\r
EFI_STATUS\r
OutputConfigBody (\r
IN EFI_STRING String,\r
\r
#endif\r
\r
+/**\r
+ Adjusts the size of a previously allocated buffer.\r
+\r
+\r
+ @param OldPool A pointer to the buffer whose size is being adjusted.\r
+ @param OldSize The size of the current buffer.\r
+ @param NewSize The size of the new buffer.\r
+\r
+ @return The new buffer allocated.\r
+\r
+**/\r
VOID *\r
ReallocatePool (\r
IN VOID *OldPool,\r
IN UINTN OldSize,\r
IN UINTN NewSize\r
)\r
-/*++\r
-\r
-Routine Description:\r
- Adjusts the size of a previously allocated buffer.\r
-\r
-Arguments:\r
- OldPool - A pointer to the buffer whose size is being adjusted.\r
- OldSize - The size of the current buffer.\r
- NewSize - The size of the new buffer.\r
-\r
-Returns:\r
- Points to the new buffer\r
-\r
---*/\r
{\r
VOID *NewPool;\r
\r
NewPool = NULL;\r
- if (NewSize) {\r
+ if (NewSize != 0) {\r
NewPool = AllocateZeroPool (NewSize);\r
}\r
\r
- if (OldPool) {\r
- if (NewPool) {\r
+ if (OldPool != NULL) {\r
+ if (NewPool != NULL) {\r
CopyMem (NewPool, OldPool, OldSize < NewSize ? OldSize : NewSize);\r
}\r
\r
/**\r
Append a string to a multi-string format.\r
\r
+ This is a internal function.\r
+\r
@param MultiString String in <MultiConfigRequest>,\r
<MultiConfigAltResp>, or <MultiConfigResp>. On\r
input, the buffer length of this string is\r
@retval EFI_SUCCESS AppendString is append to the end of MultiString\r
\r
**/\r
-STATIC\r
EFI_STATUS\r
AppendToMultiString (\r
IN OUT EFI_STRING *MultiString,\r
or WIDTH or VALUE.\r
<BlockConfig> ::= 'OFFSET='<Number>&'WIDTH='<Number>&'VALUE'=<Number>\r
\r
+ This is a internal function.\r
+\r
@param StringPtr String in <BlockConfig> format and points to the\r
first character of <Number>.\r
@param Number The output value. Caller takes the responsibility\r
successfully.\r
\r
**/\r
-STATIC\r
EFI_STATUS\r
GetValueOfNumber (\r
IN EFI_STRING StringPtr,\r
OUT EFI_STRING *Results\r
)\r
{\r
-#ifndef DISABLE_UNUSED_HII_PROTOCOLS\r
+#ifndef _DISABLE_UNUSED_HII_PROTOCOLS_\r
\r
HII_DATABASE_PRIVATE_DATA *Private;\r
EFI_STRING StringPtr;\r
OUT EFI_STRING *Results\r
)\r
{\r
-#ifndef DISABLE_UNUSED_HII_PROTOCOLS\r
+#ifndef _DISABLE_UNUSED_HII_PROTOCOLS_\r
\r
EFI_STATUS Status;\r
HII_DATABASE_PRIVATE_DATA *Private;\r
OUT EFI_STRING *Progress\r
)\r
{\r
-#ifndef DISABLE_UNUSED_HII_PROTOCOLS\r
+#ifndef _DISABLE_UNUSED_HII_PROTOCOLS_\r
\r
HII_DATABASE_PRIVATE_DATA *Private;\r
EFI_STRING StringPtr;\r
OUT EFI_STRING *AltCfgResp\r
)\r
{\r
-#ifndef DISABLE_UNUSED_HII_PROTOCOLS\r
+#ifndef _DISABLE_UNUSED_HII_PROTOCOLS_\r
\r
EFI_STATUS Status;\r
EFI_STRING StringPtr;\r
- EFI_STRING HdrStart = NULL;\r
- EFI_STRING HdrEnd = NULL;\r
+ EFI_STRING HdrStart;\r
+ EFI_STRING HdrEnd;\r
EFI_STRING TmpPtr;\r
UINTN Length;\r
- EFI_STRING GuidStr = NULL;\r
- EFI_STRING NameStr = NULL;\r
- EFI_STRING PathStr = NULL;\r
- EFI_STRING AltIdStr = NULL;\r
- EFI_STRING Result = NULL;\r
- BOOLEAN GuidFlag = FALSE;\r
- BOOLEAN NameFlag = FALSE;\r
- BOOLEAN PathFlag = FALSE;\r
+ EFI_STRING GuidStr;\r
+ EFI_STRING NameStr;\r
+ EFI_STRING PathStr;\r
+ EFI_STRING AltIdStr;\r
+ EFI_STRING Result;\r
+ BOOLEAN GuidFlag;\r
+ BOOLEAN NameFlag;\r
+ BOOLEAN PathFlag;\r
+\r
+ HdrStart = NULL;\r
+ HdrEnd = NULL;\r
+ GuidStr = NULL;\r
+ NameStr = NULL;\r
+ PathStr = NULL;\r
+ AltIdStr = NULL;\r
+ Result = NULL;\r
+ GuidFlag = FALSE;\r
+ NameFlag = FALSE;\r
+ PathFlag = FALSE;\r
\r
if (This == NULL || Configuration == NULL || AltCfgResp == NULL) {\r
return EFI_INVALID_PARAMETER;\r
/** @file\r
+Implementation for EFI_HII_DATABASE_PROTOCOL.\r
+\r
\r
Copyright (c) 2007 - 2008, Intel Corporation\r
All rights reserved. This program and the accompanying materials\r
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
\r
-Module Name:\r
-\r
- Database.c\r
-\r
-Abstract:\r
-\r
- Implementation for EFI_HII_DATABASE_PROTOCOL.\r
-\r
-Revision History\r
-\r
-\r
**/\r
\r
\r
\r
/**\r
This function generates a HII_DATABASE_RECORD node and adds into hii database.\r
+ This is a internal function.\r
\r
@param Private hii database private structure\r
- @param DatabaseRecord HII_DATABASE_RECORD node which is used to store a\r
+ @param DatabaseNode HII_DATABASE_RECORD node which is used to store a\r
package list\r
\r
@retval EFI_SUCCESS A database record is generated successfully.\r
@retval EFI_INVALID_PARAMETER Private is NULL or DatabaseRecord is NULL.\r
\r
**/\r
-STATIC\r
EFI_STATUS\r
GenerateHiiDatabaseRecord (\r
IN HII_DATABASE_PRIVATE_DATA *Private,\r
\r
/**\r
This function checks whether a handle is a valid EFI_HII_HANDLE\r
+ This is a internal function.\r
\r
@param Handle Pointer to a EFI_HII_HANDLE\r
\r
\r
/**\r
This function invokes the matching registered function.\r
+ This is a internal function.\r
\r
@param Private HII Database driver private structure.\r
@param NotifyType The type of change concerning the database.\r
@retval EFI_INVALID_PARAMETER Any input parameter is not valid.\r
\r
**/\r
-STATIC\r
EFI_STATUS\r
InvokeRegisteredFunction (\r
IN HII_DATABASE_PRIVATE_DATA *Private,\r
\r
/**\r
This function insert a GUID package to a package list node.\r
+ This is a internal function.\r
\r
@param PackageHdr Pointer to a buffer stored with GUID package\r
information.\r
@retval EFI_INVALID_PARAMETER PackageHdr is NULL or PackageList is NULL.\r
\r
**/\r
-STATIC\r
EFI_STATUS\r
InsertGuidPackage (\r
IN VOID *PackageHdr,\r
\r
/**\r
This function exports GUID 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
@retval EFI_INVALID_PARAMETER Any input parameter is invalid.\r
\r
**/\r
-STATIC\r
EFI_STATUS\r
ExportGuidPackages (\r
IN HII_DATABASE_PRIVATE_DATA *Private,\r
\r
/**\r
This function deletes all GUID packages from a package list node.\r
+ This is a internal function.\r
\r
@param Private Hii database private data.\r
@param Handle Handle of the package list which contains the to\r
@retval EFI_INVALID_PARAMETER Any input parameter is not valid.\r
\r
**/\r
-STATIC\r
EFI_STATUS\r
RemoveGuidPackages (\r
IN HII_DATABASE_PRIVATE_DATA *Private,\r
\r
/**\r
This function insert a Form package to a package list node.\r
+ This is a internal function.\r
\r
@param PackageHdr Pointer to a buffer stored with Form package\r
information.\r
@retval EFI_INVALID_PARAMETER PackageHdr is NULL or PackageList is NULL.\r
\r
**/\r
-STATIC\r
EFI_STATUS\r
InsertFormPackage (\r
IN VOID *PackageHdr,\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
@retval EFI_INVALID_PARAMETER Any input parameter is invalid.\r
\r
**/\r
-STATIC\r
EFI_STATUS\r
ExportFormPackages (\r
IN HII_DATABASE_PRIVATE_DATA *Private,\r
\r
/**\r
This function deletes all Form packages from a package list node.\r
+ This is a internal function.\r
\r
@param Private Hii database private data.\r
@param Handle Handle of the package list which contains the to\r
@retval EFI_INVALID_PARAMETER Any input parameter is not valid.\r
\r
**/\r
-STATIC\r
EFI_STATUS\r
RemoveFormPackages (\r
IN HII_DATABASE_PRIVATE_DATA *Private,\r
\r
/**\r
This function insert a String package to a package list node.\r
+ This is a internal function.\r
\r
@param Private Hii database private structure.\r
@param PackageHdr Pointer to a buffer stored with String package\r
exists in current package list.\r
\r
**/\r
-STATIC\r
EFI_STATUS\r
InsertStringPackage (\r
IN HII_DATABASE_PRIVATE_DATA *Private,\r
\r
/**\r
This function exports String 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
@retval EFI_INVALID_PARAMETER Any input parameter is invalid.\r
\r
**/\r
-STATIC\r
EFI_STATUS\r
ExportStringPackages (\r
IN HII_DATABASE_PRIVATE_DATA *Private,\r
\r
/**\r
This function deletes all String packages from a package list node.\r
+ This is a internal function.\r
\r
@param Private Hii database private data.\r
@param Handle Handle of the package list which contains the to\r
@retval EFI_INVALID_PARAMETER Any input parameter is not valid.\r
\r
**/\r
-STATIC\r
EFI_STATUS\r
RemoveStringPackages (\r
IN HII_DATABASE_PRIVATE_DATA *Private,\r
\r
/**\r
This function insert a Font package to a package list node.\r
+ This is a internal function.\r
\r
@param Private Hii database private structure.\r
@param PackageHdr Pointer to a buffer stored with Font package\r
exists in current hii database.\r
\r
**/\r
-STATIC\r
EFI_STATUS\r
InsertFontPackage (\r
IN HII_DATABASE_PRIVATE_DATA *Private,\r
\r
/**\r
This function exports Font 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
@retval EFI_INVALID_PARAMETER Any input parameter is invalid.\r
\r
**/\r
-STATIC\r
EFI_STATUS\r
ExportFontPackages (\r
IN HII_DATABASE_PRIVATE_DATA *Private,\r
\r
/**\r
This function deletes all Font packages from a package list node.\r
+ This is a internal function.\r
\r
@param Private Hii database private data.\r
@param Handle Handle of the package list which contains the to\r
@retval EFI_INVALID_PARAMETER Any input parameter is not valid.\r
\r
**/\r
-STATIC\r
EFI_STATUS\r
RemoveFontPackages (\r
IN HII_DATABASE_PRIVATE_DATA *Private,\r
\r
/**\r
This function insert a Image package to a package list node.\r
+ This is a internal function.\r
\r
@param PackageHdr Pointer to a buffer stored with Image package\r
information.\r
@retval EFI_INVALID_PARAMETER PackageHdr is NULL or PackageList is NULL.\r
\r
**/\r
-STATIC\r
EFI_STATUS\r
InsertImagePackage (\r
IN VOID *PackageHdr,\r
\r
/**\r
This function exports Image 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
@retval EFI_INVALID_PARAMETER Any input parameter is invalid.\r
\r
**/\r
-STATIC\r
EFI_STATUS\r
ExportImagePackages (\r
IN HII_DATABASE_PRIVATE_DATA *Private,\r
\r
/**\r
This function deletes Image package from a package list node.\r
+ This is a internal function.\r
\r
@param Private Hii database private data.\r
@param Handle Handle of the package list which contains the to\r
@retval EFI_INVALID_PARAMETER Any input parameter is not valid.\r
\r
**/\r
-STATIC\r
EFI_STATUS\r
RemoveImagePackages (\r
IN HII_DATABASE_PRIVATE_DATA *Private,\r
\r
/**\r
This function insert a Simple Font package to a package list node.\r
+ This is a internal function.\r
\r
@param PackageHdr Pointer to a buffer stored with Simple Font\r
package information.\r
@retval EFI_INVALID_PARAMETER PackageHdr is NULL or PackageList is NULL.\r
\r
**/\r
-STATIC\r
EFI_STATUS\r
InsertSimpleFontPackage (\r
IN VOID *PackageHdr,\r
\r
/**\r
This function exports SimpleFont 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
@retval EFI_INVALID_PARAMETER Any input parameter is invalid.\r
\r
**/\r
-STATIC\r
EFI_STATUS\r
ExportSimpleFontPackages (\r
IN HII_DATABASE_PRIVATE_DATA *Private,\r
\r
/**\r
This function deletes all Simple Font packages from a package list node.\r
+ This is a internal function.\r
\r
@param Private Hii database private data.\r
@param Handle Handle of the package list which contains the to\r
@retval EFI_INVALID_PARAMETER Any input parameter is not valid.\r
\r
**/\r
-STATIC\r
EFI_STATUS\r
RemoveSimpleFontPackages (\r
IN HII_DATABASE_PRIVATE_DATA *Private,\r
\r
/**\r
This function insert a Device path package to a package list node.\r
+ This is a internal function.\r
\r
@param DevicePath Pointer to a EFI_DEVICE_PATH_PROTOCOL protocol\r
instance\r
@retval EFI_INVALID_PARAMETER DevicePath is NULL or PackageList is NULL.\r
\r
**/\r
-STATIC\r
EFI_STATUS\r
InsertDevicePathPackage (\r
IN EFI_DEVICE_PATH_PROTOCOL *DevicePath,\r
\r
/**\r
This function exports device path package 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
@retval EFI_INVALID_PARAMETER Any input parameter is invalid.\r
\r
**/\r
-STATIC\r
EFI_STATUS\r
ExportDevicePathPackage (\r
IN HII_DATABASE_PRIVATE_DATA *Private,\r
\r
/**\r
This function deletes Device Path package from a package list node.\r
+ This is a internal function.\r
\r
@param Private Hii database private data.\r
@param Handle Handle of the package list.\r
@retval EFI_INVALID_PARAMETER Any input parameter is not valid.\r
\r
**/\r
-STATIC\r
EFI_STATUS\r
RemoveDevicePathPackage (\r
IN HII_DATABASE_PRIVATE_DATA *Private,\r
/**\r
This function will insert a device path package to package list firstly then\r
invoke notification functions if any.\r
+ This is a internal function.\r
\r
@param Private Hii database private structure.\r
@param NotifyType The type of change concerning the database.\r
@retval EFI_INVALID_PARAMETER DevicePath is NULL or PackageList is NULL.\r
\r
**/\r
-STATIC\r
EFI_STATUS\r
AddDevicePathPackage (\r
IN HII_DATABASE_PRIVATE_DATA *Private,\r
\r
/**\r
This function insert a Keyboard Layout package to a package list node.\r
+ This is a internal function.\r
\r
@param PackageHdr Pointer to a buffer stored with Keyboard Layout\r
package information.\r
@retval EFI_INVALID_PARAMETER PackageHdr is NULL or PackageList is NULL.\r
\r
**/\r
-STATIC\r
EFI_STATUS\r
InsertKeyboardLayoutPackage (\r
IN VOID *PackageHdr,\r
\r
/**\r
This function exports Keyboard Layout 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
@retval EFI_INVALID_PARAMETER Any input parameter is invalid.\r
\r
**/\r
-STATIC\r
EFI_STATUS\r
ExportKeyboardLayoutPackages (\r
IN HII_DATABASE_PRIVATE_DATA *Private,\r
\r
/**\r
This function deletes all Keyboard Layout packages from a package list node.\r
+ This is a internal function.\r
\r
@param Private Hii database private data.\r
@param Handle Handle of the package list which contains the to\r
@retval EFI_INVALID_PARAMETER Any input parameter is not valid.\r
\r
**/\r
-STATIC\r
EFI_STATUS\r
RemoveKeyboardLayoutPackages (\r
IN HII_DATABASE_PRIVATE_DATA *Private,\r
invoke notification functions if any. It is the worker function of\r
HiiNewPackageList and HiiUpdatePackageList.\r
\r
+ This is a internal function.\r
+\r
@param Private Hii database private structure.\r
@param NotifyType The type of change concerning the database.\r
@param PackageList Pointer to a package list.\r
@retval EFI_INVALID_PARAMETER Any input parameter is invalid.\r
\r
**/\r
-STATIC\r
EFI_STATUS\r
AddPackages (\r
IN HII_DATABASE_PRIVATE_DATA *Private,\r
This function exports a package list to a buffer. It is the worker function\r
of HiiExportPackageList.\r
\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
@retval EFI_INVALID_PARAMETER Any input parameter is invalid.\r
\r
**/\r
-STATIC\r
EFI_STATUS\r
ExportPackageList (\r
IN HII_DATABASE_PRIVATE_DATA *Private,\r
\r
@param This A pointer to the EFI_HII_DATABASE_PROTOCOL\r
instance.\r
- @param NotifyHandle The handle of the notification function being\r
+ @param NotificationHandle The handle of the notification function being\r
unregistered.\r
\r
@retval EFI_SUCCESS Notification is unregistered successfully.\r
/** @file\r
+Implementation for EFI_HII_FONT_PROTOCOL.\r
+\r
\r
Copyright (c) 2007 - 2008, Intel Corporation\r
All rights reserved. This program and the accompanying materials\r
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
\r
-Module Name:\r
-\r
- Font.c\r
-\r
-Abstract:\r
-\r
- Implementation for EFI_HII_FONT_PROTOCOL.\r
-\r
-Revision History\r
-\r
-\r
**/\r
\r
\r
#include "HiiDatabase.h"\r
\r
-static EFI_GRAPHICS_OUTPUT_BLT_PIXEL mEfiColors[16] = {\r
+STATIC EFI_GRAPHICS_OUTPUT_BLT_PIXEL mEfiColors[16] = {\r
//\r
// B G R\r
//\r
/**\r
Insert a character cell information to the list specified by GlyphInfoList.\r
\r
+ This is a internal function.\r
+\r
@param CharValue Unicode character value, which identifies a glyph\r
block.\r
@param GlyphInfoList HII_GLYPH_INFO list head.\r
task.\r
\r
**/\r
-STATIC\r
EFI_STATUS\r
NewCell (\r
IN CHAR16 CharValue,\r
/**\r
Get a character cell information from the list specified by GlyphInfoList.\r
\r
+ This is a internal function.\r
+\r
@param CharValue Unicode character value, which identifies a glyph\r
block.\r
@param GlyphInfoList HII_GLYPH_INFO list head.\r
not exist.\r
\r
**/\r
-STATIC\r
EFI_STATUS\r
GetCell (\r
IN CHAR16 CharValue,\r
/**\r
Convert the glyph for a single character into a bitmap.\r
\r
+ This is a internal function.\r
+\r
@param Private HII database driver private data.\r
@param Char Character to retrieve.\r
@param StringInfo Points to the string font and color information\r
@retval EFI_INVALID_PARAMETER Any input parameter is invalid.\r
\r
**/\r
-STATIC\r
EFI_STATUS\r
GetGlyphBuffer (\r
IN HII_DATABASE_PRIVATE_DATA *Private,\r
return EFI_NOT_FOUND;\r
}\r
\r
-STATIC\r
+/**\r
+ Convert bitmap data of the glyph to blt structure.\r
+\r
+ This is a internal function.\r
+\r
+ @param GlyphBuffer Buffer points to bitmap data of glyph.\r
+ @param Foreground The color of the "on" pixels in the glyph in the\r
+ bitmap.\r
+ @param Background The color of the "off" pixels in the glyph in the\r
+ bitmap.\r
+ @param ImageWidth Width of the character or character cell, in\r
+ pixels.\r
+ @param ImageHeight Height of the character or character cell, in\r
+ pixels.\r
+ @param Transparent If TRUE, the Background color is ignored and all\r
+ "off" pixels in the character's drawn wil use the\r
+ pixel value from BltBuffer.\r
+ @param Origin On input, points to the origin of the to be\r
+ displayed character, on output, points to the\r
+ next glyph's origin.\r
+\r
+**/\r
VOID\r
NarrowGlyphToBlt (\r
IN UINT8 *GlyphBuffer,\r
IN OUT EFI_GRAPHICS_OUTPUT_BLT_PIXEL **Origin\r
)\r
{\r
- UINT8 X;\r
- UINT8 Y;\r
+ UINT8 Xpos;\r
+ UINT8 Ypos;\r
UINT8 Height;\r
UINT8 Width;\r
EFI_GRAPHICS_OUTPUT_BLT_PIXEL *Buffer;\r
\r
Buffer = *Origin;\r
\r
- for (Y = 0; Y < Height; Y++) {\r
- for (X = 0; X < Width; X++) {\r
- if ((GlyphBuffer[Y] & (1 << X)) != 0) {\r
- Buffer[Y * ImageWidth + (Width - X - 1)] = Foreground;\r
+ for (Ypos = 0; Ypos < Height; Ypos++) {\r
+ for (Xpos = 0; Xpos < Width; Xpos++) {\r
+ if ((GlyphBuffer[Ypos] & (1 << Xpos)) != 0) {\r
+ Buffer[Ypos * ImageWidth + (Width - Xpos - 1)] = Foreground;\r
} else {\r
if (!Transparent) {\r
- Buffer[Y * ImageWidth + (Width - X - 1)] = Background;\r
+ Buffer[Ypos * ImageWidth + (Width - Xpos - 1)] = Background;\r
}\r
}\r
}\r
/**\r
Convert bitmap data of the glyph to blt structure.\r
\r
+ This is a internal function.\r
+\r
@param GlyphBuffer Buffer points to bitmap data of glyph.\r
@param Foreground The color of the "on" pixels in the glyph in the\r
bitmap.\r
@param Background The color of the "off" pixels in the glyph in the\r
bitmap.\r
- @param Width Width of the character or character cell, in\r
+ @param ImageWidth Width of the character or character cell, in\r
pixels.\r
- @param Height Height of the character or character cell, in\r
+ @param ImageHeight Height of the character or character cell, in\r
pixels.\r
@param Transparent If TRUE, the Background color is ignored and all\r
"off" pixels in the character's drawn wil use the\r
pixel value from BltBuffer.\r
- @param BltBuffer Points to the blt buffer.\r
+ @param Cell Points to EFI_HII_GLYPH_INFO structure.\r
+ @param Attributes The attribute of incoming glyph in GlyphBuffer.\r
+ @param Origin On input, points to the origin of the to be\r
+ displayed character, on output, points to the\r
+ next glyph's origin.\r
\r
\r
**/\r
-STATIC\r
VOID\r
GlyphToBlt (\r
IN UINT8 *GlyphBuffer,\r
IN OUT EFI_GRAPHICS_OUTPUT_BLT_PIXEL **Origin\r
)\r
{\r
- UINT8 X;\r
- UINT8 Y;\r
+ UINT8 Xpos;\r
+ UINT8 Ypos;\r
UINT8 Data;\r
UINT8 Index;\r
UINTN OffsetY;\r
// The glyph's upper left hand corner pixel is the most significant bit of the\r
// first bitmap byte.\r
//\r
- for (Y = 0; Y < Cell->Height; Y++) {\r
- OffsetY = BITMAP_LEN_1_BIT (Cell->Width, Y);\r
+ for (Ypos = 0; Ypos < Cell->Height; Ypos++) {\r
+ OffsetY = BITMAP_LEN_1_BIT (Cell->Width, Ypos);\r
\r
//\r
// All bits in these bytes are meaningful.\r
//\r
- for (X = 0; X < Cell->Width / 8; X++) {\r
- Data = *(GlyphBuffer + OffsetY + X);\r
+ for (Xpos = 0; Xpos < Cell->Width / 8; Xpos++) {\r
+ Data = *(GlyphBuffer + OffsetY + Xpos);\r
for (Index = 0; Index < 8; Index++) {\r
if ((Data & (1 << Index)) != 0) {\r
- BltBuffer[Y * ImageWidth + X * 8 + (8 - Index - 1)] = Foreground;\r
+ BltBuffer[Ypos * ImageWidth + Xpos * 8 + (8 - Index - 1)] = Foreground;\r
} else {\r
if (!Transparent) {\r
- BltBuffer[Y * ImageWidth + X * 8 + (8 - Index - 1)] = Background;\r
+ BltBuffer[Ypos * ImageWidth + Xpos * 8 + (8 - Index - 1)] = Background;\r
}\r
}\r
}\r
//\r
// There are some padding bits in this byte. Ignore them.\r
//\r
- Data = *(GlyphBuffer + OffsetY + X);\r
+ Data = *(GlyphBuffer + OffsetY + Xpos);\r
for (Index = 0; Index < Cell->Width % 8; Index++) {\r
if ((Data & (1 << (8 - Index - 1))) != 0) {\r
- BltBuffer[Y * ImageWidth + X * 8 + Index] = Foreground;\r
+ BltBuffer[Ypos * ImageWidth + Xpos * 8 + Index] = Foreground;\r
} else {\r
if (!Transparent) {\r
- BltBuffer[Y * ImageWidth + X * 8 + Index] = Background;\r
+ BltBuffer[Ypos * ImageWidth + Xpos * 8 + Index] = Background;\r
}\r
}\r
}\r
} // end of if (Width % 8...)\r
\r
- } // end of for (Y=0...)\r
+ } // end of for (Ypos=0...)\r
\r
*Origin = BltBuffer + Cell->Width;\r
}\r
/**\r
Convert bitmap data of the glyph to blt structure.\r
\r
+ This is a internal function.\r
+\r
@param GlyphBuffer Buffer points to bitmap data of glyph.\r
@param Foreground The color of the "on" pixels in the glyph in the\r
bitmap.\r
@param Background The color of the "off" pixels in the glyph in the\r
bitmap.\r
- @param Width Width of the character or character cell, in\r
+ @param ImageWidth Width of the character or character cell, in\r
pixels.\r
- @param Height Height of the character or character cell, in\r
+ @param ImageHeight Height of the character or character cell, in\r
pixels.\r
@param Transparent If TRUE, the Background color is ignored and all\r
"off" pixels in the character's drawn wil use the\r
@return Points to the address of next origin node in BltBuffer.\r
\r
**/\r
-STATIC\r
VOID\r
GlyphToImage (\r
IN UINT8 *GlyphBuffer,\r
/**\r
Write the output parameters of FindGlyphBlock().\r
\r
+ This is a internal function.\r
+\r
@param BufferIn Buffer which stores the bitmap data of the found\r
block.\r
@param BufferLen Length of BufferIn.\r
task.\r
\r
**/\r
-STATIC\r
EFI_STATUS\r
WriteOutputParam (\r
IN UINT8 *BufferIn,\r
/**\r
Copy a Font Name to a new created EFI_FONT_INFO structure.\r
\r
+ This is a internal function.\r
+\r
@param FontName NULL-terminated string.\r
@param FontInfo a new EFI_FONT_INFO which stores the FontName.\r
It's caller's responsibility to free this buffer.\r
task.\r
\r
**/\r
-STATIC\r
EFI_STATUS\r
SaveFontName (\r
IN EFI_STRING FontName,\r
Check whether EFI_FONT_DISPLAY_INFO points to system default font and color or\r
returns the system default according to the optional inputs.\r
\r
+ This is a internal function.\r
+\r
@param Private HII database driver private data.\r
@param StringInfo Points to the string output information,\r
including the color and font.\r
@retval FALSE No.\r
\r
**/\r
-STATIC\r
BOOLEAN\r
IsSystemFontInfo (\r
IN HII_DATABASE_PRIVATE_DATA *Private,\r
/**\r
Check whether the unicode represents a line break or not.\r
\r
+ This is a internal function.\r
+\r
@param Char Unicode character\r
\r
@retval 0 Yes, it is a line break.\r
@retval -1 No, it is not a link break.\r
\r
**/\r
-STATIC\r
INT8\r
IsLineBreak (\r
IN CHAR16 Char\r
will be allocated to hold the generated image and\r
the pointer updated on exit. It is the caller's\r
responsibility to free this buffer.\r
- @param BltX,BLTY Specifies the offset from the left and top edge\r
+ @param BltX Specifies the offset from the left and top edge\r
+ of the image of the first character cell in the\r
+ image.\r
+ @param BltY Specifies the offset from the left and top edge\r
of the image of the first character cell in the\r
image.\r
@param RowInfoArray If this is non-NULL on entry, then on exit, this\r
will be allocated to hold the generated image and\r
the pointer updated on exit. It is the caller's\r
responsibility to free this buffer.\r
- @param BltX,BLTY Specifies the offset from the left and top edge\r
+ @param BltX Specifies the offset from the left and top edge\r
+ of the image of the first character cell in the\r
+ image.\r
+ @param BltY Specifies the offset from the left and top edge\r
of the image of the first character cell in the\r
image.\r
@param RowInfoArray If this is non-NULL on entry, then on exit, this\r
/** @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
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
\r
-Module Name:\r
-\r
- HiiDatabase.h\r
-\r
-Abstract:\r
-\r
- Private structures definitions in HiiDatabase.\r
-\r
-Revision History\r
-\r
-\r
**/\r
\r
#ifndef __HII_DATABASE_PRIVATE_H__\r
LIST_ENTRY DatabaseList;\r
LIST_ENTRY DatabaseNotifyList;\r
EFI_HII_FONT_PROTOCOL HiiFont;\r
-#ifndef DISABLE_UNUSED_HII_PROTOCOLS\r
+#ifndef _DISABLE_UNUSED_HII_PROTOCOLS_\r
EFI_HII_IMAGE_PROTOCOL HiiImage;\r
#endif\r
EFI_HII_STRING_PROTOCOL HiiString;\r
//\r
\r
/**\r
- This function checks whether a handle is a valid EFI_HII_HANDLE\r
+ This function checks whether a handle is a valid EFI_HII_HANDLE.\r
\r
@param Handle Pointer to a EFI_HII_HANDLE\r
\r
will be allocated to hold the generated image and\r
the pointer updated on exit. It is the caller's\r
responsibility to free this buffer.\r
- @param BltX,BLTY Specifies the offset from the left and top edge\r
+ @param BltX Together with BltX, Specifies the offset from the left and top edge\r
+ of the image of the first character cell in the\r
+ image.\r
+ @param BltY Together with BltY, Specifies the offset from the left and top edge\r
of the image of the first character cell in the\r
image.\r
@param RowInfoArray If this is non-NULL on entry, then on exit, this\r
will be allocated to hold the generated image and\r
the pointer updated on exit. It is the caller's\r
responsibility to free this buffer.\r
- @param BltX,BLTY Specifies the offset from the left and top edge\r
+ @param BltX Together with BltX, Specifies the offset from the left and top edge\r
+ of the image of the first character cell in the\r
+ image.\r
+ @param BltY Together with BltY, Specifies the offset from the left and top edge\r
of the image of the first character cell in the\r
image.\r
@param RowInfoArray If this is non-NULL on entry, then on exit, this\r
HiiGetGlyph (\r
IN CONST EFI_HII_FONT_PROTOCOL *This,\r
IN CHAR16 Char,\r
- IN CONST EFI_FONT_DISPLAY_INFO *StringInfo, OPTIONAL\r
+ IN CONST EFI_FONT_DISPLAY_INFO *StringInfo,\r
OUT EFI_IMAGE_OUTPUT **Blt,\r
OUT UINTN *Baseline OPTIONAL\r
)\r
HiiGetFontInfo (\r
IN CONST EFI_HII_FONT_PROTOCOL *This,\r
IN OUT EFI_FONT_HANDLE *FontHandle,\r
- IN CONST EFI_FONT_DISPLAY_INFO *StringInfoIn,\r
+ IN CONST EFI_FONT_DISPLAY_INFO *StringInfoIn, OPTIONAL\r
OUT EFI_FONT_DISPLAY_INFO **StringInfoOut,\r
IN CONST EFI_STRING String OPTIONAL\r
)\r
a buffer will be allocated to hold the generated\r
image and the pointer updated on exit. It is the\r
caller's responsibility to free this buffer.\r
+ @param BltX Specifies the offset from the left and top edge\r
+ of the output image of the first pixel in the\r
+ image.\r
@param BltY Specifies the offset from the left and top edge\r
of the output image of the first pixel in the\r
image.\r
allocated to hold the generated image and the\r
pointer updated on exit. It is the caller's\r
responsibility to free this buffer.\r
+ @param BltX Specifies the offset from the left and top edge\r
+ of the output image of the first pixel in the\r
+ image.\r
@param BltY Specifies the offset from the left and top edge\r
of the output image of the first pixel in the\r
image.\r
FirstLanguage. If there are no secondary\r
languages, the function returns successfully,\r
but this is set to NULL.\r
- @param SecondaryLanguageSize On entry, points to the size of the buffer\r
+ @param SecondaryLanguagesSize On entry, points to the size of the buffer\r
pointed to by SecondLanguages, in bytes. On\r
return, points to the length of SecondLanguages\r
in bytes.\r
IN CONST EFI_HII_STRING_PROTOCOL *This,\r
IN EFI_HII_HANDLE PackageList,\r
IN CONST CHAR8 *FirstLanguage,\r
- IN OUT CHAR8 *SecondLanguages,\r
- IN OUT UINTN *SecondLanguagesSize\r
+ IN OUT CHAR8 *SecondaryLanguages,\r
+ IN OUT UINTN *SecondaryLanguagesSize\r
)\r
;\r
\r
\r
@param This A pointer to the EFI_HII_DATABASE_PROTOCOL\r
instance.\r
- @param NotifyHandle The handle of the notification function being\r
+ @param NotificationHandle The handle of the notification function being\r
unregistered.\r
\r
@retval EFI_SUCCESS Notification is unregistered successfully.\r
HiiGetGlyph,\r
HiiGetFontInfo\r
},\r
-#ifndef DISABLE_UNUSED_HII_PROTOCOLS\r
+#ifndef _DISABLE_UNUSED_HII_PROTOCOLS_\r
{\r
HiiNewImage,\r
HiiGetImage,\r
NULL\r
};\r
\r
-STATIC\r
+/**\r
+ The default event handler for gHiiKeyboardLayoutChanged\r
+ event group.\r
+\r
+ This is internal function.\r
+\r
+ @param Event The event that triggered this notification function.\r
+ @param Context Pointer to the notification functions context.\r
+\r
+**/\r
VOID\r
EFIAPI\r
KeyboardLayoutChangeNullEvent (\r
return;\r
}\r
\r
+/**\r
+ Initialize HII Database.\r
+\r
+\r
+ @param ImageHandle The image handle.\r
+ @param SystemTable The system table.\r
+\r
+ @retval EFI_SUCCESS The Hii database is setup correctly.\r
+ @return Other value if failed to create the default event for\r
+ gHiiKeyboardLayoutChanged. Check gBS->CreateEventEx for\r
+ details. Or failed to insatll the protocols.\r
+ Check gBS->InstallMultipleProtocolInterfaces for details.\r
+\r
+**/\r
EFI_STATUS\r
EFIAPI\r
InitializeHiiDatabase (\r
IN EFI_HANDLE ImageHandle,\r
IN EFI_SYSTEM_TABLE *SystemTable\r
)\r
-/*++\r
-\r
-Routine Description:\r
- Initialize HII Database\r
-\r
-Arguments:\r
- (Standard EFI Image entry - EFI_IMAGE_ENTRY_POINT)\r
-\r
-Returns:\r
- EFI_SUCCESS -\r
- other -\r
-\r
---*/\r
{\r
EFI_STATUS Status;\r
EFI_HANDLE Handle;\r
- EFI_HANDLE *HandleBuffer;\r
- UINTN HandleCount;\r
\r
//\r
// There will be only one HII Database in the system\r
// If there is another out there, someone is trying to install us\r
// again. Fail that scenario.\r
//\r
- Status = gBS->LocateHandleBuffer (\r
- ByProtocol,\r
- &gEfiHiiDatabaseProtocolGuid,\r
- NULL,\r
- &HandleCount,\r
- &HandleBuffer\r
- );\r
-\r
- //\r
- // If there was no error, assume there is an installation and fail to load\r
- //\r
- if (!EFI_ERROR (Status)) {\r
- if (HandleBuffer != NULL) {\r
- gBS->FreePool (HandleBuffer);\r
- }\r
- return EFI_DEVICE_ERROR;\r
- }\r
-\r
+ ASSERT_PROTOCOL_ALREADY_INSTALLED (NULL, &gEfiHiiDatabaseProtocolGuid);\r
+ ASSERT_PROTOCOL_ALREADY_INSTALLED (NULL, &gEfiHiiFontProtocolGuid);\r
+ ASSERT_PROTOCOL_ALREADY_INSTALLED (NULL, &gEfiHiiImageProtocolGuid);\r
+ ASSERT_PROTOCOL_ALREADY_INSTALLED (NULL, &gEfiHiiStringProtocolGuid);\r
+ ASSERT_PROTOCOL_ALREADY_INSTALLED (NULL, &gEfiHiiConfigRoutingProtocolGuid);\r
+ \r
InitializeListHead (&mPrivate.DatabaseList);\r
InitializeListHead (&mPrivate.DatabaseNotifyList);\r
InitializeListHead (&mPrivate.HiiHandleList);\r
&Handle,\r
&gEfiHiiFontProtocolGuid,\r
&mPrivate.HiiFont,\r
-#ifndef DISABLE_UNUSED_HII_PROTOCOLS\r
+#ifndef _DISABLE_UNUSED_HII_PROTOCOLS_\r
&gEfiHiiImageProtocolGuid,\r
&mPrivate.HiiImage,\r
#endif\r
/** @file\r
+Implementation for EFI_HII_IMAGE_PROTOCOL.\r
+\r
\r
Copyright (c) 2007 - 2008, Intel Corporation\r
All rights reserved. This program and the accompanying materials\r
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
\r
-Module Name:\r
-\r
- Image.c\r
-\r
-Abstract:\r
+**/\r
\r
- Implementation for EFI_HII_IMAGE_PROTOCOL.\r
\r
-Revision History\r
+#include "HiiDatabase.h"\r
\r
+#ifndef _DISABLE_UNUSED_HII_PROTOCOLS_\r
\r
-**/\r
+/**\r
+ Get the imageid of last image block: EFI_HII_IIBT_END_BLOCK when input\r
+ ImageId is zero, otherwise return the address of the\r
+ corresponding image block with identifier specified by ImageId.\r
\r
+ This is a internal function.\r
\r
-#include "HiiDatabase.h"\r
+ @param ImageBlock Points to the beginning of a series of image blocks stored in order.\r
+ @param ImageId If input ImageId is 0, output the image id of the EFI_HII_IIBT_END_BLOCK;\r
+ else use this id to find its corresponding image block address.\r
\r
-#ifndef DISABLE_UNUSED_HII_PROTOCOLS\r
+ @return The image block address when input ImageId is not zero; otherwise return NULL.\r
\r
-STATIC\r
+**/\r
UINT8*\r
GetImageIdOrAddress (\r
IN UINT8 *ImageBlock,\r
IN OUT EFI_IMAGE_ID *ImageId\r
)\r
-/*++\r
-\r
- Routine Description:\r
- Get the imageid of last image block: EFI_HII_IIBT_END_BLOCK when input\r
- ImageId is zero, otherwise return the address of the\r
- corresponding image block with identifier specified by ImageId.\r
-\r
- Arguments:\r
- ImageBlock - Points to the beginning of a series of image blocks stored in order.\r
- ImageId - If input ImageId is 0, output the image id of the EFI_HII_IIBT_END_BLOCK;\r
- else use this id to find its corresponding image block address.\r
-\r
- Returns:\r
- The image block address when input ImageId is not zero; otherwise return NULL.\r
-\r
---*/\r
{\r
EFI_IMAGE_ID ImageIdCurrent;\r
UINT8 *ImageBlockHdr;\r
/**\r
Convert pixels from EFI_GRAPHICS_OUTPUT_BLT_PIXEL to EFI_HII_RGB_PIXEL style.\r
\r
+ This is a internal function.\r
+\r
+\r
@param BitMapOut Pixels in EFI_HII_RGB_PIXEL format.\r
@param BitMapIn Pixels in EFI_GRAPHICS_OUTPUT_BLT_PIXEL format.\r
@param PixelNum The number of pixels to be converted.\r
\r
\r
**/\r
-STATIC\r
VOID\r
CopyGopToRgbPixel (\r
OUT EFI_HII_RGB_PIXEL *BitMapOut,\r
/**\r
Convert pixels from EFI_HII_RGB_PIXEL to EFI_GRAPHICS_OUTPUT_BLT_PIXEL style.\r
\r
+ This is a internal function.\r
+\r
+\r
@param BitMapOut Pixels in EFI_GRAPHICS_OUTPUT_BLT_PIXEL format.\r
@param BitMapIn Pixels in EFI_HII_RGB_PIXEL format.\r
@param PixelNum The number of pixels to be converted.\r
\r
\r
**/\r
-STATIC\r
VOID\r
CopyRgbToGopPixel (\r
OUT EFI_GRAPHICS_OUTPUT_BLT_PIXEL *BitMapOut,\r
/**\r
Output pixels in "1 bit per pixel" format to an image.\r
\r
+ This is a internal function.\r
+\r
+\r
@param Image Points to the image which will store the pixels.\r
@param Data Stores the value of output pixels, 0 or 1.\r
@param PaletteInfo PaletteInfo which stores the color of the output\r
\r
\r
**/\r
-STATIC\r
VOID\r
Output1bitPixel (\r
IN OUT EFI_IMAGE_INPUT *Image,\r
IN EFI_HII_IMAGE_PALETTE_INFO *PaletteInfo\r
)\r
{\r
- UINT16 X;\r
- UINT16 Y;\r
+ UINT16 Xpos;\r
+ UINT16 Ypos;\r
UINTN OffsetY;\r
UINT8 Index;\r
EFI_GRAPHICS_OUTPUT_BLT_PIXEL *BitMapPtr;\r
//\r
// Convert the pixel from one bit to corresponding color.\r
//\r
- for (Y = 0; Y < Image->Height; Y++) {\r
- OffsetY = BITMAP_LEN_1_BIT (Image->Width, Y);\r
+ for (Ypos = 0; Ypos < Image->Height; Ypos++) {\r
+ OffsetY = BITMAP_LEN_1_BIT (Image->Width, Ypos);\r
//\r
// All bits in these bytes are meaningful\r
//\r
- for (X = 0; X < Image->Width / 8; X++) {\r
- Byte = *(Data + OffsetY + X);\r
+ for (Xpos = 0; Xpos < Image->Width / 8; Xpos++) {\r
+ Byte = *(Data + OffsetY + Xpos);\r
for (Index = 0; Index < 8; Index++) {\r
if ((Byte & (1 << Index)) != 0) {\r
- BitMapPtr[Y * Image->Width + X * 8 + (8 - Index - 1)] = PaletteValue[1];\r
+ BitMapPtr[Ypos * Image->Width + Xpos * 8 + (8 - Index - 1)] = PaletteValue[1];\r
} else {\r
- BitMapPtr[Y * Image->Width + X * 8 + (8 - Index - 1)] = PaletteValue[0];\r
+ BitMapPtr[Ypos * Image->Width + Xpos * 8 + (8 - Index - 1)] = PaletteValue[0];\r
}\r
}\r
}\r
//\r
// Padding bits in this byte should be ignored.\r
//\r
- Byte = *(Data + OffsetY + X);\r
+ Byte = *(Data + OffsetY + Xpos);\r
for (Index = 0; Index < Image->Width % 8; Index++) {\r
if ((Byte & (1 << (8 - Index - 1))) != 0) {\r
- BitMapPtr[Y * Image->Width + X * 8 + Index] = PaletteValue[1];\r
+ BitMapPtr[Ypos * Image->Width + Xpos * 8 + Index] = PaletteValue[1];\r
} else {\r
- BitMapPtr[Y * Image->Width + X * 8 + Index] = PaletteValue[0];\r
+ BitMapPtr[Ypos * Image->Width + Xpos * 8 + Index] = PaletteValue[0];\r
}\r
}\r
}\r
/**\r
Output pixels in "4 bit per pixel" format to an image.\r
\r
+ This is a internal function.\r
+\r
+\r
@param Image Points to the image which will store the pixels.\r
@param Data Stores the value of output pixels, 0 ~ 15.\r
- @param PaletteInfo PaletteInfo which stores the color of the output\r
+ @param[in] PaletteInfo PaletteInfo which stores the color of the output\r
pixels. Each entry corresponds to a color within\r
[0, 15].\r
\r
\r
**/\r
-STATIC\r
VOID\r
Output4bitPixel (\r
IN OUT EFI_IMAGE_INPUT *Image,\r
IN EFI_HII_IMAGE_PALETTE_INFO *PaletteInfo\r
)\r
{\r
- UINT16 X;\r
- UINT16 Y;\r
+ UINT16 Xpos;\r
+ UINT16 Ypos;\r
UINTN OffsetY;\r
EFI_GRAPHICS_OUTPUT_BLT_PIXEL *BitMapPtr;\r
EFI_GRAPHICS_OUTPUT_BLT_PIXEL PaletteValue[16];\r
//\r
// Convert the pixel from 4 bit to corresponding color.\r
//\r
- for (Y = 0; Y < Image->Height; Y++) {\r
- OffsetY = BITMAP_LEN_4_BIT (Image->Width, Y);\r
+ for (Ypos = 0; Ypos < Image->Height; Ypos++) {\r
+ OffsetY = BITMAP_LEN_4_BIT (Image->Width, Ypos);\r
//\r
// All bits in these bytes are meaningful\r
//\r
- for (X = 0; X < Image->Width / 2; X++) {\r
- Byte = *(Data + OffsetY + X);\r
- BitMapPtr[Y * Image->Width + X * 2] = PaletteValue[Byte >> 4];\r
- BitMapPtr[Y * Image->Width + X * 2 + 1] = PaletteValue[Byte & 0x0F];\r
+ for (Xpos = 0; Xpos < Image->Width / 2; Xpos++) {\r
+ Byte = *(Data + OffsetY + Xpos);\r
+ BitMapPtr[Ypos * Image->Width + Xpos * 2] = PaletteValue[Byte >> 4];\r
+ BitMapPtr[Ypos * Image->Width + Xpos * 2 + 1] = PaletteValue[Byte & 0x0F];\r
}\r
\r
if (Image->Width % 2 != 0) {\r
//\r
// Padding bits in this byte should be ignored.\r
//\r
- Byte = *(Data + OffsetY + X);\r
- BitMapPtr[Y * Image->Width + X * 2] = PaletteValue[Byte >> 4];\r
+ Byte = *(Data + OffsetY + Xpos);\r
+ BitMapPtr[Ypos * Image->Width + Xpos * 2] = PaletteValue[Byte >> 4];\r
}\r
}\r
}\r
/**\r
Output pixels in "8 bit per pixel" format to an image.\r
\r
+ This is a internal function.\r
+\r
+\r
@param Image Points to the image which will store the pixels.\r
@param Data Stores the value of output pixels, 0 ~ 255.\r
- @param PaletteInfo PaletteInfo which stores the color of the output\r
+ @param[in] PaletteInfo PaletteInfo which stores the color of the output\r
pixels. Each entry corresponds to a color within\r
[0, 255].\r
\r
\r
**/\r
-STATIC\r
VOID\r
Output8bitPixel (\r
IN OUT EFI_IMAGE_INPUT *Image,\r
IN EFI_HII_IMAGE_PALETTE_INFO *PaletteInfo\r
)\r
{\r
- UINT16 X;\r
- UINT16 Y;\r
+ UINT16 Xpos;\r
+ UINT16 Ypos;\r
UINTN OffsetY;\r
EFI_GRAPHICS_OUTPUT_BLT_PIXEL *BitMapPtr;\r
EFI_GRAPHICS_OUTPUT_BLT_PIXEL PaletteValue[256];\r
//\r
// Convert the pixel from 8 bits to corresponding color.\r
//\r
- for (Y = 0; Y < Image->Height; Y++) {\r
- OffsetY = BITMAP_LEN_8_BIT (Image->Width, Y);\r
+ for (Ypos = 0; Ypos < Image->Height; Ypos++) {\r
+ OffsetY = BITMAP_LEN_8_BIT (Image->Width, Ypos);\r
//\r
// All bits are meaningful since the bitmap is 8 bits per pixel.\r
//\r
- for (X = 0; X < Image->Width; X++) {\r
- Byte = *(Data + OffsetY + X);\r
- BitMapPtr[OffsetY + X] = PaletteValue[Byte];\r
+ for (Xpos = 0; Xpos < Image->Width; Xpos++) {\r
+ Byte = *(Data + OffsetY + Xpos);\r
+ BitMapPtr[OffsetY + Xpos] = PaletteValue[Byte];\r
}\r
}\r
\r
/**\r
Output pixels in "24 bit per pixel" format to an image.\r
\r
+ This is a internal function.\r
+\r
+\r
@param Image Points to the image which will store the pixels.\r
@param Data Stores the color of output pixels, allowing 16.8\r
millions colors.\r
\r
\r
**/\r
-STATIC\r
VOID\r
Output24bitPixel (\r
IN OUT EFI_IMAGE_INPUT *Image,\r
IN EFI_HII_RGB_PIXEL *Data\r
)\r
{\r
- UINT16 Y;\r
+ UINT16 Ypos;\r
UINTN OffsetY;\r
EFI_GRAPHICS_OUTPUT_BLT_PIXEL *BitMapPtr;\r
\r
\r
BitMapPtr = Image->Bitmap;\r
\r
- for (Y = 0; Y < Image->Height; Y++) {\r
- OffsetY = BITMAP_LEN_8_BIT (Image->Width, Y);\r
+ for (Ypos = 0; Ypos < Image->Height; Ypos++) {\r
+ OffsetY = BITMAP_LEN_8_BIT (Image->Width, Ypos);\r
CopyRgbToGopPixel (&BitMapPtr[OffsetY], &Data[OffsetY], Image->Width);\r
}\r
\r
/**\r
Convert the image from EFI_IMAGE_INPUT to EFI_IMAGE_OUTPUT format.\r
\r
+ This is a internal function.\r
+\r
+\r
@param BltBuffer Buffer points to bitmap data of incoming image.\r
+ @param BltX Specifies the offset from the left and top edge of\r
+ the output image of the first pixel in the image.\r
@param BltY Specifies the offset from the left and top edge of\r
the output image of the first pixel in the image.\r
@param Width Width of the incoming image, in pixels.\r
@retval EFI_INVALID_PARAMETER Any incoming parameter is invalid.\r
\r
**/\r
-STATIC\r
EFI_STATUS\r
ImageToBlt (\r
IN EFI_GRAPHICS_OUTPUT_BLT_PIXEL *BltBuffer,\r
)\r
{\r
EFI_IMAGE_OUTPUT *ImageOut;\r
- UINTN X;\r
- UINTN Y;\r
+ UINTN Xpos;\r
+ UINTN Ypos;\r
UINTN OffsetY1; // src buffer\r
UINTN OffsetY2; // dest buffer\r
EFI_GRAPHICS_OUTPUT_BLT_PIXEL SrcPixel;\r
\r
ZeroMem (&ZeroPixel, sizeof (EFI_GRAPHICS_OUTPUT_BLT_PIXEL));\r
\r
- for (Y = 0; Y < Height; Y++) {\r
- OffsetY1 = Width * Y;\r
- OffsetY2 = ImageOut->Width * (BltY + Y);\r
- for (X = 0; X < Width; X++) {\r
- SrcPixel = BltBuffer[OffsetY1 + X];\r
+ for (Ypos = 0; Ypos < Height; Ypos++) {\r
+ OffsetY1 = Width * Ypos;\r
+ OffsetY2 = ImageOut->Width * (BltY + Ypos);\r
+ for (Xpos = 0; Xpos < Width; Xpos++) {\r
+ SrcPixel = BltBuffer[OffsetY1 + Xpos];\r
if (Transparent) {\r
if (CompareMem (&SrcPixel, &ZeroPixel, 3) != 0) {\r
- ImageOut->Image.Bitmap[OffsetY2 + BltX + X] = SrcPixel;\r
+ ImageOut->Image.Bitmap[OffsetY2 + BltX + Xpos] = SrcPixel;\r
}\r
} else {\r
- ImageOut->Image.Bitmap[OffsetY2 + BltX + X] = SrcPixel;\r
+ ImageOut->Image.Bitmap[OffsetY2 + BltX + Xpos] = SrcPixel;\r
}\r
}\r
}\r
@param ImageId The image's id,, which is unique within\r
PackageList.\r
@param Image Points to the image.\r
- @param ImageSize On entry, points to the size of the buffer pointed\r
- to by Image, in bytes. On return, points to the\r
- length of the image, in bytes.\r
\r
@retval EFI_SUCCESS The new image was returned successfully.\r
@retval EFI_NOT_FOUND The image specified by ImageId is not in the\r
will be allocated to hold the generated image and\r
the pointer updated on exit. It is the caller's\r
responsibility to free this buffer.\r
+ @param BltX Specifies the offset from the left and top edge of\r
+ the output image of the first pixel in the image.\r
@param BltY Specifies the offset from the left and top edge of\r
the output image of the first pixel in the image.\r
\r
UINTN BufferLen;\r
UINTN Width;\r
UINTN Height;\r
- UINTN X;\r
- UINTN Y;\r
+ UINTN Xpos;\r
+ UINTN Ypos;\r
UINTN OffsetY1;\r
UINTN OffsetY2;\r
EFI_FONT_DISPLAY_INFO *FontInfo;\r
if (Width == ImageIn->Width && Height == ImageIn->Height) {\r
CopyMem (BltBuffer, ImageIn->Bitmap, BufferLen);\r
} else {\r
- for (Y = 0; Y < Height; Y++) {\r
- OffsetY1 = ImageIn->Width * Y;\r
- OffsetY2 = Width * Y;\r
- for (X = 0; X < Width; X++) {\r
- BltBuffer[OffsetY2 + X] = ImageIn->Bitmap[OffsetY1 + X];\r
+ for (Ypos = 0; Ypos < Height; Ypos++) {\r
+ OffsetY1 = ImageIn->Width * Ypos;\r
+ OffsetY2 = Width * Ypos;\r
+ for (Xpos = 0; Xpos < Width; Xpos++) {\r
+ BltBuffer[OffsetY2 + Xpos] = ImageIn->Bitmap[OffsetY1 + Xpos];\r
}\r
}\r
}\r
allocated to hold the generated image and the\r
pointer updated on exit. It is the caller's\r
responsibility to free this buffer.\r
+ @param BltX Specifies the offset from the left and top edge of\r
+ the output image of the first pixel in the image.\r
@param BltY Specifies the offset from the left and top edge of\r
the output image of the first pixel in the image.\r
\r
-/**@file\r
+/** @file\r
+Implement a utility function named R8_EfiLibCompareLanguage.\r
+\r
Copyright (c) 2007 - 2008, Intel Corporation\r
\r
All rights reserved. This program and the accompanying materials\r
-/**@file
+/** @file
+Implement a utility function named R8_EfiLibCompareLanguage.
+
Copyright (c) 2007 - 2008, Intel Corporation
All rights reserved. This program and the accompanying materials
/** @file\r
+Implementation for EFI_HII_STRING_PROTOCOL.\r
+\r
\r
Copyright (c) 2007, Intel Corporation\r
All rights reserved. This program and the accompanying materials\r
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
\r
-Module Name:\r
-\r
- String.c\r
-\r
-Abstract:\r
-\r
- Implementation for EFI_HII_STRING_PROTOCOL.\r
-\r
-Revision History\r
-\r
-\r
**/\r
\r
\r
font info list or not. (i.e. HII_FONT_INFO is generated.) If not, create\r
a HII_FONT_INFO to refer it locally.\r
\r
+ This is a internal function.\r
+\r
+\r
@param Private Hii database private structure.\r
@param StringPackage HII string package instance.\r
@param FontId Font identifer, which must be unique within the string package.\r
@retval FALSE Not referred before calling this function.\r
\r
**/\r
-STATIC\r
BOOLEAN\r
ReferFontInfoLocally (\r
IN HII_DATABASE_PRIVATE_DATA *Private,\r
/**\r
Convert Ascii string text to unicode string test.\r
\r
- @param StringSrc Points to current null-terminated Ascii string.\r
- @param StringDest Buffer to store the converted string text.\r
+ This is a internal function.\r
+\r
+\r
+ @param StringDest Buffer to store the string text. If it is NULL,\r
+ only the size will be returned.\r
+ @param StringSrc Points to current null-terminated string.\r
@param BufferSize Length of the buffer.\r
\r
@retval EFI_SUCCESS The string text was outputed successfully.\r
size.\r
\r
**/\r
-STATIC\r
EFI_STATUS\r
ConvertToUnicodeText (\r
OUT EFI_STRING StringDest,\r
Calculate the size of StringSrc and output it. If StringDest is not NULL,\r
copy string text from src to dest.\r
\r
+ This is a internal function.\r
+\r
+ @param StringDest Buffer to store the string text. If it is NULL,\r
+ only the size will be returned.\r
@param StringSrc Points to current null-terminated string.\r
- @param StringDest Buffer to store the string text.\r
@param BufferSize Length of the buffer.\r
\r
@retval EFI_SUCCESS The string text was outputed successfully.\r
size.\r
\r
**/\r
-STATIC\r
EFI_STATUS\r
GetUnicodeStringTextOrSize (\r
OUT EFI_STRING StringDest, OPTIONAL\r
/**\r
Copy string font info to a buffer.\r
\r
+ This is a internal function.\r
+\r
@param StringPackage Hii string package instance.\r
@param FontId Font identifier which is unique in a string\r
package.\r
@retval EFI_NOT_FOUND The specified font id does not exist.\r
\r
**/\r
-STATIC\r
EFI_STATUS\r
GetStringFontInfo (\r
IN HII_STRING_PACKAGE_INSTANCE *StringPackage,\r
/**\r
Parse all string blocks to get a string specified by StringId.\r
\r
+ This is a internal function.\r
+\r
@param Private Hii database private structure.\r
@param StringPackage Hii string package instance.\r
@param StringId The string's id, which is unique within\r
hold the string.\r
\r
**/\r
-STATIC\r
EFI_STATUS\r
GetStringWorker (\r
IN HII_DATABASE_PRIVATE_DATA *Private,\r
/**\r
Parse all string blocks to set a String specified by StringId.\r
\r
+ This is a internal function.\r
+\r
@param Private HII database driver private structure.\r
@param StringPackage HII string package instance.\r
@param StringId The string's id, which is unique within\r
task.\r
\r
**/\r
-STATIC\r
EFI_STATUS\r
SetStringWorker (\r
IN HII_DATABASE_PRIVATE_DATA *Private,\r
FirstLanguage. If there are no secondary\r
languages, the function returns successfully, but\r
this is set to NULL.\r
- @param SecondaryLanguageSize On entry, points to the size of the buffer pointed\r
- to by SecondLanguages, in bytes. On return,\r
- points to the length of SecondLanguages in bytes.\r
+ @param SecondaryLanguagesSize On entry, points to the size of the buffer pointed\r
+ to by SecondaryLanguages, in bytes. On return,\r
+ points to the length of SecondaryLanguages in bytes.\r
\r
@retval EFI_SUCCESS Secondary languages were correctly returned.\r
- @retval EFI_INVALID_PARAMETER FirstLanguage or SecondLanguages or\r
- SecondLanguagesSize was NULL.\r
- @retval EFI_BUFFER_TOO_SMALL The buffer specified by SecondLanguagesSize is\r
+ @retval EFI_INVALID_PARAMETER FirstLanguage or SecondaryLanguages or\r
+ SecondaryLanguagesSize was NULL.\r
+ @retval EFI_BUFFER_TOO_SMALL The buffer specified by SecondaryLanguagesSize is\r
too small to hold the returned information.\r
SecondLanguageSize is updated to hold the size of\r
the buffer required.\r
IN CONST EFI_HII_STRING_PROTOCOL *This,\r
IN EFI_HII_HANDLE PackageList,\r
IN CONST CHAR8 *FirstLanguage,\r
- IN OUT CHAR8 *SecondLanguages,\r
- IN OUT UINTN *SecondLanguagesSize\r
+ IN OUT CHAR8 *SecondaryLanguages,\r
+ IN OUT UINTN *SecondaryLanguagesSize\r
)\r
{\r
LIST_ENTRY *Link;\r
if (This == NULL || PackageList == NULL || FirstLanguage == NULL) {\r
return EFI_INVALID_PARAMETER;\r
}\r
- if (SecondLanguages == NULL || SecondLanguagesSize == NULL) {\r
+ if (SecondaryLanguages == NULL || SecondaryLanguagesSize == NULL) {\r
return EFI_INVALID_PARAMETER;\r
}\r
if (!IsHiiHandleValid (PackageList)) {\r
Languages++;\r
\r
ResultSize = AsciiStrSize (Languages);\r
- if (ResultSize <= *SecondLanguagesSize) {\r
- AsciiStrCpy (SecondLanguages, Languages);\r
+ if (ResultSize <= *SecondaryLanguagesSize) {\r
+ AsciiStrCpy (SecondaryLanguages, Languages);\r
} else {\r
- *SecondLanguagesSize = ResultSize;\r
+ *SecondaryLanguagesSize = ResultSize;\r
return EFI_BUFFER_TOO_SMALL;\r
}\r
\r