Refine the code logic for browser and display engine.
Signed-off-by: Eric Dong <eric.dong@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@14543 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
@ -19,7 +19,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
+------------------------------------------------------------------------------+
|
+------------------------------------------------------------------------------+
|
||||||
? Setup Page ?
|
| Setup Page |
|
||||||
+------------------------------------------------------------------------------+
|
+------------------------------------------------------------------------------+
|
||||||
|
|
||||||
Statement
|
Statement
|
||||||
@ -31,8 +31,8 @@ Statement
|
|||||||
|
|
||||||
|
|
||||||
+------------------------------------------------------------------------------+
|
+------------------------------------------------------------------------------+
|
||||||
?F1=Scroll Help F9=Reset to Defaults F10=Save and Exit ?
|
| F9=Reset to Defaults F10=Save |
|
||||||
| ^"=Move Highlight <Spacebar> Toggles Checkbox Esc=Discard Changes |
|
| ^"=Move Highlight <Spacebar> Toggles Checkbox Esc=Exit |
|
||||||
+------------------------------------------------------------------------------+
|
+------------------------------------------------------------------------------+
|
||||||
StatusBar
|
StatusBar
|
||||||
**/
|
**/
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
Extension Form Browser Protocol provides the services that can be used to
|
Extension Form Browser Protocol provides the services that can be used to
|
||||||
register the different hot keys for the standard Browser actions described in UEFI specification.
|
register the different hot keys for the standard Browser actions described in UEFI specification.
|
||||||
|
|
||||||
Copyright (c) 2011, Intel Corporation. All rights reserved.<BR>
|
Copyright (c) 2013, Intel Corporation. All rights reserved.<BR>
|
||||||
This program and the accompanying materials are licensed and made available under
|
This program and the accompanying materials are licensed and made available under
|
||||||
the terms and conditions of the BSD License that accompanies this distribution.
|
the terms and conditions of the BSD License that accompanies this distribution.
|
||||||
The full text of the license may be found at
|
The full text of the license may be found at
|
||||||
@ -62,8 +62,8 @@ typedef struct {
|
|||||||
|
|
||||||
EFI_HII_HANDLE HiiHandle;
|
EFI_HII_HANDLE HiiHandle;
|
||||||
EFI_GUID FormSetGuid;
|
EFI_GUID FormSetGuid;
|
||||||
UINT16 FormId;
|
EFI_FORM_ID FormId;
|
||||||
UINT16 QuestionId;
|
EFI_QUESTION_ID QuestionId;
|
||||||
} FORM_ENTRY_INFO;
|
} FORM_ENTRY_INFO;
|
||||||
|
|
||||||
#define FORM_ENTRY_INFO_FROM_LINK(a) CR (a, FORM_ENTRY_INFO, Link, FORM_ENTRY_INFO_SIGNATURE)
|
#define FORM_ENTRY_INFO_FROM_LINK(a) CR (a, FORM_ENTRY_INFO, Link, FORM_ENTRY_INFO_SIGNATURE)
|
||||||
|
@ -18,7 +18,7 @@ EFI_GUID gCustomizedDisplayLibGuid = { 0x99fdc8fd, 0x849b, 0x4eba, { 0x
|
|||||||
|
|
||||||
EFI_HII_HANDLE mCDLStringPackHandle;
|
EFI_HII_HANDLE mCDLStringPackHandle;
|
||||||
UINT16 gClassOfVfr; // Formset class information
|
UINT16 gClassOfVfr; // Formset class information
|
||||||
UINT16 gLastClassOfVfr = 0;
|
BOOLEAN gLibIsFirstForm = TRUE;
|
||||||
BANNER_DATA *gBannerData;
|
BANNER_DATA *gBannerData;
|
||||||
|
|
||||||
UINTN gFooterHeight;
|
UINTN gFooterHeight;
|
||||||
@ -37,8 +37,8 @@ Statement
|
|||||||
|
|
||||||
|
|
||||||
+------------------------------------------------------------------------------+
|
+------------------------------------------------------------------------------+
|
||||||
| F1=Scroll Help F9=Reset to Defaults F10=Save and Exit |
|
| F9=Reset to Defaults F10=Save |
|
||||||
| ^"=Move Highlight <Spacebar> Toggles Checkbox Esc=Discard Changes |
|
| ^"=Move Highlight <Spacebar> Toggles Checkbox Esc=Exit |
|
||||||
+------------------------------------------------------------------------------+
|
+------------------------------------------------------------------------------+
|
||||||
StatusBar
|
StatusBar
|
||||||
**/
|
**/
|
||||||
@ -74,9 +74,6 @@ DisplayPageFrame (
|
|||||||
}
|
}
|
||||||
|
|
||||||
gClassOfVfr = FORMSET_CLASS_PLATFORM_SETUP;
|
gClassOfVfr = FORMSET_CLASS_PLATFORM_SETUP;
|
||||||
if ((FormData->Attribute & HII_DISPLAY_MODAL) != 0) {
|
|
||||||
gClassOfVfr = FORMSET_CLASS_MODEL_PAGE;
|
|
||||||
}
|
|
||||||
|
|
||||||
ProcessExternedOpcode(FormData);
|
ProcessExternedOpcode(FormData);
|
||||||
|
|
||||||
@ -84,7 +81,7 @@ DisplayPageFrame (
|
|||||||
// Calculate the ScreenForStatement.
|
// Calculate the ScreenForStatement.
|
||||||
//
|
//
|
||||||
ScreenForStatement->BottomRow = gScreenDimensions.BottomRow - STATUS_BAR_HEIGHT - gFooterHeight;
|
ScreenForStatement->BottomRow = gScreenDimensions.BottomRow - STATUS_BAR_HEIGHT - gFooterHeight;
|
||||||
if ((gClassOfVfr & FORMSET_CLASS_FRONT_PAGE) == FORMSET_CLASS_FRONT_PAGE) {
|
if (gClassOfVfr == FORMSET_CLASS_FRONT_PAGE) {
|
||||||
ScreenForStatement->TopRow = gScreenDimensions.TopRow + FRONT_PAGE_HEADER_HEIGHT;
|
ScreenForStatement->TopRow = gScreenDimensions.TopRow + FRONT_PAGE_HEADER_HEIGHT;
|
||||||
} else {
|
} else {
|
||||||
ScreenForStatement->TopRow = gScreenDimensions.TopRow + NONE_FRONT_PAGE_HEADER_HEIGHT;
|
ScreenForStatement->TopRow = gScreenDimensions.TopRow + NONE_FRONT_PAGE_HEADER_HEIGHT;
|
||||||
@ -92,42 +89,30 @@ DisplayPageFrame (
|
|||||||
ScreenForStatement->LeftColumn = gScreenDimensions.LeftColumn;
|
ScreenForStatement->LeftColumn = gScreenDimensions.LeftColumn;
|
||||||
ScreenForStatement->RightColumn = gScreenDimensions.RightColumn;
|
ScreenForStatement->RightColumn = gScreenDimensions.RightColumn;
|
||||||
|
|
||||||
//
|
if ((gLibIsFirstForm) || ((FormData->Attribute & HII_DISPLAY_MODAL) != 0)) {
|
||||||
// If Last Vfr Class is same to current Vfr Class,
|
//
|
||||||
// they will have the same page frame. So, Page Frame is not required to be repainted.
|
// Ensure we are in Text mode
|
||||||
//
|
//
|
||||||
if (gLastClassOfVfr == gClassOfVfr) {
|
gST->ConOut->SetAttribute (gST->ConOut, EFI_TEXT_ATTR (EFI_LIGHTGRAY, EFI_BLACK));
|
||||||
UpdateStatusBar(NV_UPDATE_REQUIRED, FormData->SettingChangedFlag);
|
ClearLines (0, gScreenDimensions.RightColumn, 0, gScreenDimensions.BottomRow, KEYHELP_BACKGROUND);
|
||||||
PrintFormTitle(FormData);
|
gLibIsFirstForm = FALSE;
|
||||||
return EFI_SUCCESS;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// Record last ClassOfVfr and Streen Information.
|
// Don't print frame for modal form.
|
||||||
//
|
//
|
||||||
gLastClassOfVfr = gClassOfVfr;
|
|
||||||
|
|
||||||
//
|
|
||||||
// Ensure we are in Text mode
|
|
||||||
//
|
|
||||||
gST->ConOut->SetAttribute (gST->ConOut, EFI_TEXT_ATTR (EFI_LIGHTGRAY, EFI_BLACK));
|
|
||||||
|
|
||||||
ClearLines (0, gScreenDimensions.RightColumn, 0, gScreenDimensions.BottomRow, KEYHELP_BACKGROUND);
|
|
||||||
|
|
||||||
if ((FormData->Attribute & HII_DISPLAY_MODAL) != 0) {
|
if ((FormData->Attribute & HII_DISPLAY_MODAL) != 0) {
|
||||||
return EFI_SUCCESS;
|
return EFI_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((gClassOfVfr & FORMSET_CLASS_FRONT_PAGE) == FORMSET_CLASS_FRONT_PAGE) {
|
if (gClassOfVfr == FORMSET_CLASS_FRONT_PAGE) {
|
||||||
PrintBannerInfo (FormData);
|
PrintBannerInfo (FormData);
|
||||||
}
|
}
|
||||||
|
|
||||||
PrintFramework ();
|
PrintFramework (FormData);
|
||||||
|
|
||||||
UpdateStatusBar(NV_UPDATE_REQUIRED, FormData->SettingChangedFlag);
|
UpdateStatusBar(NV_UPDATE_REQUIRED, FormData->SettingChangedFlag);
|
||||||
|
|
||||||
PrintFormTitle(FormData);
|
|
||||||
|
|
||||||
return EFI_SUCCESS;
|
return EFI_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -213,7 +198,7 @@ RefreshKeyHelp (
|
|||||||
if (!Selected) {
|
if (!Selected) {
|
||||||
PrintHotKeyHelpString (FormData);
|
PrintHotKeyHelpString (FormData);
|
||||||
|
|
||||||
if ((gClassOfVfr & FORMSET_CLASS_PLATFORM_SETUP) == FORMSET_CLASS_PLATFORM_SETUP) {
|
if (gClassOfVfr == FORMSET_CLASS_PLATFORM_SETUP) {
|
||||||
PrintStringAt (ThdCol, BottomRowOfHelp, gEscapeString);
|
PrintStringAt (ThdCol, BottomRowOfHelp, gEscapeString);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -269,7 +254,7 @@ RefreshKeyHelp (
|
|||||||
case EFI_IFR_CHECKBOX_OP:
|
case EFI_IFR_CHECKBOX_OP:
|
||||||
PrintHotKeyHelpString (FormData);
|
PrintHotKeyHelpString (FormData);
|
||||||
|
|
||||||
if ((gClassOfVfr & FORMSET_CLASS_PLATFORM_SETUP) == FORMSET_CLASS_PLATFORM_SETUP) {
|
if (gClassOfVfr == FORMSET_CLASS_PLATFORM_SETUP) {
|
||||||
PrintStringAt (ThdCol, BottomRowOfHelp, gEscapeString);
|
PrintStringAt (ThdCol, BottomRowOfHelp, gEscapeString);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -287,7 +272,7 @@ RefreshKeyHelp (
|
|||||||
if (!Selected) {
|
if (!Selected) {
|
||||||
PrintHotKeyHelpString (FormData);
|
PrintHotKeyHelpString (FormData);
|
||||||
|
|
||||||
if ((gClassOfVfr & FORMSET_CLASS_PLATFORM_SETUP) == FORMSET_CLASS_PLATFORM_SETUP) {
|
if (gClassOfVfr == FORMSET_CLASS_PLATFORM_SETUP) {
|
||||||
PrintStringAt (ThdCol, BottomRowOfHelp, gEscapeString);
|
PrintStringAt (ThdCol, BottomRowOfHelp, gEscapeString);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -584,7 +569,7 @@ FormExitPolicy (
|
|||||||
VOID
|
VOID
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
return (gClassOfVfr & FORMSET_CLASS_FRONT_PAGE) == FORMSET_CLASS_FRONT_PAGE ? FALSE : TRUE;
|
return gClassOfVfr == FORMSET_CLASS_FRONT_PAGE ? FALSE : TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -883,7 +868,7 @@ ClearDisplayPage (
|
|||||||
{
|
{
|
||||||
gST->ConOut->SetAttribute (gST->ConOut, EFI_TEXT_ATTR (EFI_LIGHTGRAY, EFI_BLACK));
|
gST->ConOut->SetAttribute (gST->ConOut, EFI_TEXT_ATTR (EFI_LIGHTGRAY, EFI_BLACK));
|
||||||
gST->ConOut->ClearScreen (gST->ConOut);
|
gST->ConOut->ClearScreen (gST->ConOut);
|
||||||
gLastClassOfVfr = 0;
|
gLibIsFirstForm = TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -130,20 +130,35 @@ PrintBannerInfo (
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Print framework and form title for a page.
|
||||||
|
|
||||||
Print framework for a page.
|
@param[in] FormData Form Data to be shown in Page
|
||||||
|
|
||||||
**/
|
**/
|
||||||
VOID
|
VOID
|
||||||
PrintFramework (
|
PrintFramework (
|
||||||
VOID
|
IN FORM_DISPLAY_ENGINE_FORM *FormData
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
UINTN Index;
|
UINTN Index;
|
||||||
CHAR16 Character;
|
CHAR16 Character;
|
||||||
CHAR16 *Buffer;
|
CHAR16 *Buffer;
|
||||||
UINTN Row;
|
UINTN Row;
|
||||||
|
CHAR16 *TitleStr;
|
||||||
|
|
||||||
|
if (gClassOfVfr != FORMSET_CLASS_PLATFORM_SETUP) {
|
||||||
|
//
|
||||||
|
// Only Setup page needs Framework
|
||||||
|
//
|
||||||
|
ClearLines (
|
||||||
|
gScreenDimensions.LeftColumn,
|
||||||
|
gScreenDimensions.RightColumn,
|
||||||
|
gScreenDimensions.BottomRow - STATUS_BAR_HEIGHT - gFooterHeight,
|
||||||
|
gScreenDimensions.BottomRow - STATUS_BAR_HEIGHT - 1,
|
||||||
|
KEYHELP_TEXT | KEYHELP_BACKGROUND
|
||||||
|
);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
Buffer = AllocateZeroPool (0x10000);
|
Buffer = AllocateZeroPool (0x10000);
|
||||||
ASSERT (Buffer != NULL);
|
ASSERT (Buffer != NULL);
|
||||||
Character = BOXDRAW_HORIZONTAL;
|
Character = BOXDRAW_HORIZONTAL;
|
||||||
@ -151,108 +166,30 @@ PrintFramework (
|
|||||||
Buffer[Index] = Character;
|
Buffer[Index] = Character;
|
||||||
}
|
}
|
||||||
|
|
||||||
ClearLines (
|
//
|
||||||
gScreenDimensions.LeftColumn,
|
// Print Top border line
|
||||||
gScreenDimensions.RightColumn,
|
// +------------------------------------------------------------------------------+
|
||||||
gScreenDimensions.BottomRow - STATUS_BAR_HEIGHT - gFooterHeight,
|
// ? ?
|
||||||
gScreenDimensions.BottomRow - STATUS_BAR_HEIGHT - 1,
|
// +------------------------------------------------------------------------------+
|
||||||
KEYHELP_TEXT | KEYHELP_BACKGROUND
|
//
|
||||||
);
|
|
||||||
|
|
||||||
if ((gClassOfVfr & FORMSET_CLASS_PLATFORM_SETUP) == FORMSET_CLASS_PLATFORM_SETUP) {
|
|
||||||
ClearLines (
|
|
||||||
gScreenDimensions.LeftColumn,
|
|
||||||
gScreenDimensions.RightColumn,
|
|
||||||
gScreenDimensions.TopRow,
|
|
||||||
gScreenDimensions.TopRow + NONE_FRONT_PAGE_HEADER_HEIGHT - 1,
|
|
||||||
TITLE_TEXT | TITLE_BACKGROUND
|
|
||||||
);
|
|
||||||
//
|
|
||||||
// Print Top border line
|
|
||||||
// +------------------------------------------------------------------------------+
|
|
||||||
// ? ?
|
|
||||||
// +------------------------------------------------------------------------------+
|
|
||||||
//
|
|
||||||
Character = BOXDRAW_DOWN_RIGHT;
|
|
||||||
|
|
||||||
PrintCharAt ((UINTN) -1, (UINTN) -1, Character);
|
|
||||||
PrintStringAt ((UINTN) -1, (UINTN) -1, Buffer);
|
|
||||||
|
|
||||||
Character = BOXDRAW_DOWN_LEFT;
|
|
||||||
PrintCharAt ((UINTN) -1, (UINTN) -1, Character);
|
|
||||||
|
|
||||||
Character = BOXDRAW_VERTICAL;
|
|
||||||
for (Row = gScreenDimensions.TopRow + 1; Row <= gScreenDimensions.TopRow + NONE_FRONT_PAGE_HEADER_HEIGHT - 2; Row++) {
|
|
||||||
PrintCharAt (gScreenDimensions.LeftColumn, Row, Character);
|
|
||||||
PrintCharAt (gScreenDimensions.RightColumn - 1, Row, Character);
|
|
||||||
}
|
|
||||||
|
|
||||||
Character = BOXDRAW_UP_RIGHT;
|
|
||||||
PrintCharAt (gScreenDimensions.LeftColumn, gScreenDimensions.TopRow + NONE_FRONT_PAGE_HEADER_HEIGHT - 1, Character);
|
|
||||||
PrintStringAt ((UINTN) -1, (UINTN) -1, Buffer);
|
|
||||||
|
|
||||||
Character = BOXDRAW_UP_LEFT;
|
|
||||||
PrintCharAt ((UINTN) -1, (UINTN) -1, Character);
|
|
||||||
|
|
||||||
//
|
|
||||||
// Print Bottom border line
|
|
||||||
// +------------------------------------------------------------------------------+
|
|
||||||
// ? ?
|
|
||||||
// +------------------------------------------------------------------------------+
|
|
||||||
//
|
|
||||||
Character = BOXDRAW_DOWN_RIGHT;
|
|
||||||
PrintCharAt (gScreenDimensions.LeftColumn, gScreenDimensions.BottomRow - STATUS_BAR_HEIGHT - gFooterHeight, Character);
|
|
||||||
|
|
||||||
PrintStringAt ((UINTN) -1, (UINTN) -1, Buffer);
|
|
||||||
|
|
||||||
Character = BOXDRAW_DOWN_LEFT;
|
|
||||||
PrintCharAt ((UINTN) -1, (UINTN) -1, Character);
|
|
||||||
Character = BOXDRAW_VERTICAL;
|
|
||||||
for (Row = gScreenDimensions.BottomRow - STATUS_BAR_HEIGHT - gFooterHeight + 1;
|
|
||||||
Row <= gScreenDimensions.BottomRow - STATUS_BAR_HEIGHT - 2;
|
|
||||||
Row++
|
|
||||||
) {
|
|
||||||
PrintCharAt (gScreenDimensions.LeftColumn, Row, Character);
|
|
||||||
PrintCharAt (gScreenDimensions.RightColumn - 1, Row, Character);
|
|
||||||
}
|
|
||||||
|
|
||||||
Character = BOXDRAW_UP_RIGHT;
|
|
||||||
PrintCharAt (gScreenDimensions.LeftColumn, gScreenDimensions.BottomRow - STATUS_BAR_HEIGHT - 1, Character);
|
|
||||||
|
|
||||||
PrintStringAt ((UINTN) -1, (UINTN) -1, Buffer);
|
|
||||||
|
|
||||||
Character = BOXDRAW_UP_LEFT;
|
|
||||||
PrintCharAt ((UINTN) -1, (UINTN) -1, Character);
|
|
||||||
}
|
|
||||||
|
|
||||||
FreePool (Buffer);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
Print the form title.
|
|
||||||
|
|
||||||
@param[in] FormData Form Data to be shown in Page
|
|
||||||
|
|
||||||
**/
|
|
||||||
VOID
|
|
||||||
PrintFormTitle (
|
|
||||||
IN FORM_DISPLAY_ENGINE_FORM *FormData
|
|
||||||
)
|
|
||||||
{
|
|
||||||
CHAR16 *TitleStr;
|
|
||||||
|
|
||||||
if ((gClassOfVfr & FORMSET_CLASS_PLATFORM_SETUP) != FORMSET_CLASS_PLATFORM_SETUP) {
|
|
||||||
//
|
|
||||||
// Only Setup Page need Title.
|
|
||||||
//
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
TitleStr = LibGetToken (FormData->FormTitle, FormData->HiiHandle);
|
|
||||||
ASSERT (TitleStr != NULL);
|
|
||||||
|
|
||||||
gST->ConOut->SetAttribute (gST->ConOut, TITLE_TEXT | TITLE_BACKGROUND);
|
gST->ConOut->SetAttribute (gST->ConOut, TITLE_TEXT | TITLE_BACKGROUND);
|
||||||
|
Character = BOXDRAW_DOWN_RIGHT;
|
||||||
|
|
||||||
|
PrintCharAt (gScreenDimensions.LeftColumn, gScreenDimensions.TopRow, Character);
|
||||||
|
PrintStringAt ((UINTN) -1, (UINTN) -1, Buffer);
|
||||||
|
|
||||||
|
Character = BOXDRAW_DOWN_LEFT;
|
||||||
|
PrintCharAt ((UINTN) -1, (UINTN) -1, Character);
|
||||||
|
|
||||||
|
Character = BOXDRAW_VERTICAL;
|
||||||
|
for (Row = gScreenDimensions.TopRow + 1; Row <= gScreenDimensions.TopRow + NONE_FRONT_PAGE_HEADER_HEIGHT - 2; Row++) {
|
||||||
|
PrintCharAt (gScreenDimensions.LeftColumn, Row, Character);
|
||||||
|
PrintCharAt (gScreenDimensions.RightColumn - 1, Row, Character);
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// Print Form Title
|
||||||
|
//
|
||||||
ClearLines (
|
ClearLines (
|
||||||
gScreenDimensions.LeftColumn + 1,
|
gScreenDimensions.LeftColumn + 1,
|
||||||
gScreenDimensions.RightColumn - 1,
|
gScreenDimensions.RightColumn - 1,
|
||||||
@ -261,13 +198,53 @@ PrintFormTitle (
|
|||||||
TITLE_TEXT | TITLE_BACKGROUND
|
TITLE_TEXT | TITLE_BACKGROUND
|
||||||
);
|
);
|
||||||
|
|
||||||
|
TitleStr = LibGetToken (FormData->FormTitle, FormData->HiiHandle);
|
||||||
|
ASSERT (TitleStr != NULL);
|
||||||
PrintStringAt (
|
PrintStringAt (
|
||||||
(gScreenDimensions.RightColumn + gScreenDimensions.LeftColumn - LibGetStringWidth (TitleStr) / 2) / 2,
|
(gScreenDimensions.RightColumn + gScreenDimensions.LeftColumn - LibGetStringWidth (TitleStr) / 2) / 2,
|
||||||
gScreenDimensions.TopRow + 1,
|
gScreenDimensions.TopRow + 1,
|
||||||
TitleStr
|
TitleStr
|
||||||
);
|
);
|
||||||
|
|
||||||
FreePool (TitleStr);
|
FreePool (TitleStr);
|
||||||
|
|
||||||
|
Character = BOXDRAW_UP_RIGHT;
|
||||||
|
PrintCharAt (gScreenDimensions.LeftColumn, gScreenDimensions.TopRow + NONE_FRONT_PAGE_HEADER_HEIGHT - 1, Character);
|
||||||
|
PrintStringAt ((UINTN) -1, (UINTN) -1, Buffer);
|
||||||
|
|
||||||
|
Character = BOXDRAW_UP_LEFT;
|
||||||
|
PrintCharAt ((UINTN) -1, (UINTN) -1, Character);
|
||||||
|
|
||||||
|
//
|
||||||
|
// Print Bottom border line
|
||||||
|
// +------------------------------------------------------------------------------+
|
||||||
|
// ? ?
|
||||||
|
// +------------------------------------------------------------------------------+
|
||||||
|
//
|
||||||
|
Character = BOXDRAW_DOWN_RIGHT;
|
||||||
|
PrintCharAt (gScreenDimensions.LeftColumn, gScreenDimensions.BottomRow - STATUS_BAR_HEIGHT - gFooterHeight, Character);
|
||||||
|
|
||||||
|
PrintStringAt ((UINTN) -1, (UINTN) -1, Buffer);
|
||||||
|
|
||||||
|
Character = BOXDRAW_DOWN_LEFT;
|
||||||
|
PrintCharAt ((UINTN) -1, (UINTN) -1, Character);
|
||||||
|
Character = BOXDRAW_VERTICAL;
|
||||||
|
for (Row = gScreenDimensions.BottomRow - STATUS_BAR_HEIGHT - gFooterHeight + 1;
|
||||||
|
Row <= gScreenDimensions.BottomRow - STATUS_BAR_HEIGHT - 2;
|
||||||
|
Row++
|
||||||
|
) {
|
||||||
|
PrintCharAt (gScreenDimensions.LeftColumn, Row, Character);
|
||||||
|
PrintCharAt (gScreenDimensions.RightColumn - 1, Row, Character);
|
||||||
|
}
|
||||||
|
|
||||||
|
Character = BOXDRAW_UP_RIGHT;
|
||||||
|
PrintCharAt (gScreenDimensions.LeftColumn, gScreenDimensions.BottomRow - STATUS_BAR_HEIGHT - 1, Character);
|
||||||
|
|
||||||
|
PrintStringAt ((UINTN) -1, (UINTN) -1, Buffer);
|
||||||
|
|
||||||
|
Character = BOXDRAW_UP_LEFT;
|
||||||
|
PrintCharAt ((UINTN) -1, (UINTN) -1, Character);
|
||||||
|
|
||||||
|
FreePool (Buffer);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -300,7 +277,7 @@ ProcessUserOpcode(
|
|||||||
//
|
//
|
||||||
// Only in front page form set, we care about the banner data.
|
// Only in front page form set, we care about the banner data.
|
||||||
//
|
//
|
||||||
if ((gClassOfVfr & FORMSET_CLASS_FRONT_PAGE) == FORMSET_CLASS_FRONT_PAGE) {
|
if (gClassOfVfr == FORMSET_CLASS_FRONT_PAGE) {
|
||||||
//
|
//
|
||||||
// Initialize Driver private data
|
// Initialize Driver private data
|
||||||
//
|
//
|
||||||
|
@ -57,7 +57,6 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
|||||||
|
|
||||||
#define FORMSET_CLASS_PLATFORM_SETUP 0x0001
|
#define FORMSET_CLASS_PLATFORM_SETUP 0x0001
|
||||||
#define FORMSET_CLASS_FRONT_PAGE 0x0002
|
#define FORMSET_CLASS_FRONT_PAGE 0x0002
|
||||||
#define FORMSET_CLASS_MODEL_PAGE 0x0004
|
|
||||||
|
|
||||||
|
|
||||||
#define FRONT_PAGE_HEADER_HEIGHT 6
|
#define FRONT_PAGE_HEADER_HEIGHT 6
|
||||||
@ -130,23 +129,12 @@ PrintBannerInfo (
|
|||||||
);
|
);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Print framework and form title for a page.
|
||||||
|
|
||||||
Print framework for a page.
|
@param[in] FormData Form Data to be shown in Page
|
||||||
|
|
||||||
**/
|
**/
|
||||||
VOID
|
VOID
|
||||||
PrintFramework (
|
PrintFramework (
|
||||||
VOID
|
|
||||||
);
|
|
||||||
|
|
||||||
/**
|
|
||||||
Print the form title.
|
|
||||||
|
|
||||||
@param[in] FormData Form Data to be shown in Page
|
|
||||||
|
|
||||||
**/
|
|
||||||
VOID
|
|
||||||
PrintFormTitle (
|
|
||||||
IN FORM_DISPLAY_ENGINE_FORM *FormData
|
IN FORM_DISPLAY_ENGINE_FORM *FormData
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -32,7 +32,6 @@
|
|||||||
FormDisplayStr.uni
|
FormDisplayStr.uni
|
||||||
FormDisplay.c
|
FormDisplay.c
|
||||||
FormDisplay.h
|
FormDisplay.h
|
||||||
Print.c
|
|
||||||
ProcessOptions.c
|
ProcessOptions.c
|
||||||
InputHandler.c
|
InputHandler.c
|
||||||
|
|
||||||
@ -65,6 +64,3 @@
|
|||||||
gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserGrayOutTextStatement ## CONSUMES
|
gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserGrayOutTextStatement ## CONSUMES
|
||||||
gEfiMdeModulePkgTokenSpaceGuid.PcdBrowerGrayOutReadOnlyMenu ## CONSUMES
|
gEfiMdeModulePkgTokenSpaceGuid.PcdBrowerGrayOutReadOnlyMenu ## CONSUMES
|
||||||
|
|
||||||
[BuildOptions]
|
|
||||||
MSFT:*_*_*_CC_FLAGS = /Od
|
|
||||||
|
|
||||||
|
@ -97,9 +97,9 @@ EFI_GUID gDisplayEngineGuid = {
|
|||||||
0xE38C1029, 0xE38F, 0x45b9, {0x8F, 0x0D, 0xE2, 0xE6, 0x0B, 0xC9, 0xB2, 0x62}
|
0xE38C1029, 0xE38F, 0x45b9, {0x8F, 0x0D, 0xE2, 0xE6, 0x0B, 0xC9, 0xB2, 0x62}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
FORM_ENTRY_INFO gFormEntryInfo;
|
||||||
UINTN gSequence;
|
UINTN gSequence;
|
||||||
EFI_SCREEN_DESCRIPTOR gStatementDimensions;
|
EFI_SCREEN_DESCRIPTOR gStatementDimensions;
|
||||||
EFI_SCREEN_DESCRIPTOR gOldStatementDimensions = {0};
|
|
||||||
BOOLEAN mStatementLayoutIsChanged = TRUE;
|
BOOLEAN mStatementLayoutIsChanged = TRUE;
|
||||||
USER_INPUT *gUserInput;
|
USER_INPUT *gUserInput;
|
||||||
FORM_DISPLAY_ENGINE_FORM *gFormData;
|
FORM_DISPLAY_ENGINE_FORM *gFormData;
|
||||||
@ -107,6 +107,8 @@ EFI_HII_HANDLE gHiiHandle;
|
|||||||
UINT16 gDirection;
|
UINT16 gDirection;
|
||||||
LIST_ENTRY gMenuOption;
|
LIST_ENTRY gMenuOption;
|
||||||
DISPLAY_HIGHLIGHT_MENU_INFO gHighligthMenuInfo = {0};
|
DISPLAY_HIGHLIGHT_MENU_INFO gHighligthMenuInfo = {0};
|
||||||
|
BOOLEAN mIsFirstForm = TRUE;
|
||||||
|
FORM_ENTRY_INFO gOldFormEntry = {0};
|
||||||
|
|
||||||
//
|
//
|
||||||
// Browser Global Strings
|
// Browser Global Strings
|
||||||
@ -138,7 +140,7 @@ FORM_DISPLAY_DRIVER_PRIVATE_DATA mPrivateData = {
|
|||||||
NULL,
|
NULL,
|
||||||
{
|
{
|
||||||
FormDisplay,
|
FormDisplay,
|
||||||
ClearDisplayPage,
|
DriverClearDisplayPage,
|
||||||
ConfirmDataChange
|
ConfirmDataChange
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@ -2978,6 +2980,7 @@ UiDisplayMenu (
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case CfExit:
|
case CfExit:
|
||||||
|
gST->ConOut->SetAttribute (gST->ConOut, EFI_TEXT_ATTR (EFI_LIGHTGRAY, EFI_BLACK));
|
||||||
if (HelpString != NULL) {
|
if (HelpString != NULL) {
|
||||||
FreePool (HelpString);
|
FreePool (HelpString);
|
||||||
}
|
}
|
||||||
@ -3096,18 +3099,67 @@ FormDisplay (
|
|||||||
return Status;
|
return Status;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (CompareMem (&gOldStatementDimensions, &gStatementDimensions, sizeof (gStatementDimensions)) == 0) {
|
//
|
||||||
mStatementLayoutIsChanged = FALSE;
|
// Check whether layout is changed.
|
||||||
} else {
|
//
|
||||||
|
if (mIsFirstForm
|
||||||
|
|| (gOldFormEntry.HiiHandle != FormData->HiiHandle)
|
||||||
|
|| (!CompareGuid (&gOldFormEntry.FormSetGuid, &FormData->FormSetGuid))
|
||||||
|
|| (gOldFormEntry.FormId != FormData->FormId)) {
|
||||||
mStatementLayoutIsChanged = TRUE;
|
mStatementLayoutIsChanged = TRUE;
|
||||||
CopyMem (&gOldStatementDimensions, &gStatementDimensions, sizeof (gStatementDimensions));
|
} else {
|
||||||
|
mStatementLayoutIsChanged = FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
Status = UiDisplayMenu(FormData);
|
Status = UiDisplayMenu(FormData);
|
||||||
|
|
||||||
|
//
|
||||||
|
// Backup last form info.
|
||||||
|
//
|
||||||
|
mIsFirstForm = FALSE;
|
||||||
|
gOldFormEntry.HiiHandle = FormData->HiiHandle;
|
||||||
|
CopyGuid (&gOldFormEntry.FormSetGuid, &FormData->FormSetGuid);
|
||||||
|
gOldFormEntry.FormId = FormData->FormId;
|
||||||
|
|
||||||
return Status;
|
return Status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
Clear Screen to the initial state.
|
||||||
|
**/
|
||||||
|
VOID
|
||||||
|
EFIAPI
|
||||||
|
DriverClearDisplayPage (
|
||||||
|
VOID
|
||||||
|
)
|
||||||
|
{
|
||||||
|
ClearDisplayPage ();
|
||||||
|
mIsFirstForm = TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
Set Buffer to Value for Size bytes.
|
||||||
|
|
||||||
|
@param Buffer Memory to set.
|
||||||
|
@param Size Number of bytes to set
|
||||||
|
@param Value Value of the set operation.
|
||||||
|
|
||||||
|
**/
|
||||||
|
VOID
|
||||||
|
SetUnicodeMem (
|
||||||
|
IN VOID *Buffer,
|
||||||
|
IN UINTN Size,
|
||||||
|
IN CHAR16 Value
|
||||||
|
)
|
||||||
|
{
|
||||||
|
CHAR16 *Ptr;
|
||||||
|
|
||||||
|
Ptr = Buffer;
|
||||||
|
while ((Size--) != 0) {
|
||||||
|
*(Ptr++) = Value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Initialize Setup Browser driver.
|
Initialize Setup Browser driver.
|
||||||
|
|
||||||
@ -3153,6 +3205,9 @@ InitializeDisplayEngine (
|
|||||||
ASSERT_EFI_ERROR (Status);
|
ASSERT_EFI_ERROR (Status);
|
||||||
|
|
||||||
InitializeDisplayStrings();
|
InitializeDisplayStrings();
|
||||||
|
|
||||||
|
ZeroMem (&gHighligthMenuInfo, sizeof (gHighligthMenuInfo));
|
||||||
|
ZeroMem (&gOldFormEntry, sizeof (gOldFormEntry));
|
||||||
|
|
||||||
//
|
//
|
||||||
// Use BrowserEx2 protocol to register HotKey.
|
// Use BrowserEx2 protocol to register HotKey.
|
||||||
|
@ -553,6 +553,15 @@ FormDisplay (
|
|||||||
OUT USER_INPUT *UserInputData
|
OUT USER_INPUT *UserInputData
|
||||||
);
|
);
|
||||||
|
|
||||||
|
/**
|
||||||
|
Clear Screen to the initial state.
|
||||||
|
**/
|
||||||
|
VOID
|
||||||
|
EFIAPI
|
||||||
|
DriverClearDisplayPage (
|
||||||
|
VOID
|
||||||
|
);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Exit Display and Clear Screen to the original state.
|
Exit Display and Clear Screen to the original state.
|
||||||
|
|
||||||
|
@ -1045,16 +1045,16 @@ IsValuesEqual (
|
|||||||
switch (Type) {
|
switch (Type) {
|
||||||
case EFI_IFR_TYPE_BOOLEAN:
|
case EFI_IFR_TYPE_BOOLEAN:
|
||||||
case EFI_IFR_TYPE_NUM_SIZE_8:
|
case EFI_IFR_TYPE_NUM_SIZE_8:
|
||||||
return Value1->u8 == Value2->u8;
|
return (BOOLEAN) (Value1->u8 == Value2->u8);
|
||||||
|
|
||||||
case EFI_IFR_TYPE_NUM_SIZE_16:
|
case EFI_IFR_TYPE_NUM_SIZE_16:
|
||||||
return Value1->u16 == Value2->u16;
|
return (BOOLEAN) (Value1->u16 == Value2->u16);
|
||||||
|
|
||||||
case EFI_IFR_TYPE_NUM_SIZE_32:
|
case EFI_IFR_TYPE_NUM_SIZE_32:
|
||||||
return Value1->u32 == Value2->u32;
|
return (BOOLEAN) (Value1->u32 == Value2->u32);
|
||||||
|
|
||||||
case EFI_IFR_TYPE_NUM_SIZE_64:
|
case EFI_IFR_TYPE_NUM_SIZE_64:
|
||||||
return Value1->u64 == Value2->u64;
|
return (BOOLEAN) (Value1->u64 == Value2->u64);
|
||||||
|
|
||||||
default:
|
default:
|
||||||
ASSERT (FALSE);
|
ASSERT (FALSE);
|
||||||
|
@ -1,54 +0,0 @@
|
|||||||
/** @file
|
|
||||||
Basic Ascii AvSPrintf() function named VSPrint(). VSPrint() enables very
|
|
||||||
simple implemenation of SPrint() and Print() to support debug.
|
|
||||||
|
|
||||||
You can not Print more than EFI_DRIVER_LIB_MAX_PRINT_BUFFER characters at a
|
|
||||||
time. This makes the implementation very simple.
|
|
||||||
|
|
||||||
VSPrint, Print, SPrint format specification has the follwoing form
|
|
||||||
|
|
||||||
%type
|
|
||||||
|
|
||||||
type:
|
|
||||||
'S','s' - argument is an Unicode string
|
|
||||||
'c' - argument is an ascii character
|
|
||||||
'%' - Print a %
|
|
||||||
|
|
||||||
|
|
||||||
Copyright (c) 2004 - 2012, Intel Corporation. All rights reserved.<BR>
|
|
||||||
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
|
|
||||||
|
|
||||||
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
|
||||||
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
|
||||||
|
|
||||||
**/
|
|
||||||
|
|
||||||
#include "FormDisplay.h"
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
Set Buffer to Value for Size bytes.
|
|
||||||
|
|
||||||
@param Buffer Memory to set.
|
|
||||||
@param Size Number of bytes to set
|
|
||||||
@param Value Value of the set operation.
|
|
||||||
|
|
||||||
**/
|
|
||||||
VOID
|
|
||||||
SetUnicodeMem (
|
|
||||||
IN VOID *Buffer,
|
|
||||||
IN UINTN Size,
|
|
||||||
IN CHAR16 Value
|
|
||||||
)
|
|
||||||
{
|
|
||||||
CHAR16 *Ptr;
|
|
||||||
|
|
||||||
Ptr = Buffer;
|
|
||||||
while ((Size--) != 0) {
|
|
||||||
*(Ptr++) = Value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -1,44 +0,0 @@
|
|||||||
/** @file
|
|
||||||
MACRO definitions for color used in Setup Browser.
|
|
||||||
|
|
||||||
Copyright (c) 2004 - 2011, Intel Corporation. All rights reserved.<BR>
|
|
||||||
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
|
|
||||||
|
|
||||||
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
|
||||||
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
|
||||||
|
|
||||||
**/
|
|
||||||
//
|
|
||||||
// Unicode collation protocol in
|
|
||||||
|
|
||||||
#ifndef _COLORS_H_
|
|
||||||
#define _COLORS_H_
|
|
||||||
|
|
||||||
//
|
|
||||||
// Screen Color Settings
|
|
||||||
//
|
|
||||||
#define PICKLIST_HIGHLIGHT_TEXT EFI_WHITE
|
|
||||||
#define PICKLIST_HIGHLIGHT_BACKGROUND EFI_BACKGROUND_CYAN
|
|
||||||
#define TITLE_TEXT EFI_WHITE
|
|
||||||
#define TITLE_BACKGROUND EFI_BACKGROUND_BLUE
|
|
||||||
#define KEYHELP_TEXT EFI_LIGHTGRAY
|
|
||||||
#define KEYHELP_BACKGROUND EFI_BACKGROUND_BLACK
|
|
||||||
#define SUBTITLE_BACKGROUND EFI_BACKGROUND_LIGHTGRAY
|
|
||||||
#define BANNER_TEXT EFI_BLUE
|
|
||||||
#define BANNER_BACKGROUND EFI_BACKGROUND_LIGHTGRAY
|
|
||||||
#define FIELD_TEXT_GRAYED EFI_DARKGRAY
|
|
||||||
#define FIELD_BACKGROUND EFI_BACKGROUND_LIGHTGRAY
|
|
||||||
#define POPUP_TEXT EFI_LIGHTGRAY
|
|
||||||
#define POPUP_BACKGROUND EFI_BACKGROUND_BLUE
|
|
||||||
#define POPUP_INVERSE_TEXT EFI_LIGHTGRAY
|
|
||||||
#define POPUP_INVERSE_BACKGROUND EFI_BACKGROUND_BLACK
|
|
||||||
#define HELP_TEXT EFI_BLUE
|
|
||||||
#define ERROR_TEXT EFI_RED | EFI_BRIGHT
|
|
||||||
#define INFO_TEXT EFI_YELLOW | EFI_BRIGHT
|
|
||||||
#define ARROW_TEXT EFI_RED | EFI_BRIGHT
|
|
||||||
#define ARROW_BACKGROUND EFI_BACKGROUND_LIGHTGRAY
|
|
||||||
|
|
||||||
#endif
|
|
File diff suppressed because it is too large
Load Diff
@ -1,272 +0,0 @@
|
|||||||
/** @file
|
|
||||||
Basic Ascii AvSPrintf() function named VSPrint(). VSPrint() enables very
|
|
||||||
simple implemenation of SPrint() and Print() to support debug.
|
|
||||||
|
|
||||||
You can not Print more than EFI_DRIVER_LIB_MAX_PRINT_BUFFER characters at a
|
|
||||||
time. This makes the implementation very simple.
|
|
||||||
|
|
||||||
VSPrint, Print, SPrint format specification has the follwoing form
|
|
||||||
|
|
||||||
%type
|
|
||||||
|
|
||||||
type:
|
|
||||||
'S','s' - argument is an Unicode string
|
|
||||||
'c' - argument is an ascii character
|
|
||||||
'%' - Print a %
|
|
||||||
|
|
||||||
|
|
||||||
Copyright (c) 2004 - 2012, Intel Corporation. All rights reserved.<BR>
|
|
||||||
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
|
|
||||||
|
|
||||||
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
|
||||||
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
|
||||||
|
|
||||||
**/
|
|
||||||
|
|
||||||
#include "Setup.h"
|
|
||||||
|
|
||||||
/**
|
|
||||||
The internal function prints to the EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL
|
|
||||||
protocol instance.
|
|
||||||
|
|
||||||
@param Column The position of the output string.
|
|
||||||
@param Row The position of the output string.
|
|
||||||
@param Out The EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL instance.
|
|
||||||
@param Fmt The format string.
|
|
||||||
@param Args The additional argument for the variables in the format string.
|
|
||||||
|
|
||||||
@return Number of Unicode character printed.
|
|
||||||
|
|
||||||
**/
|
|
||||||
UINTN
|
|
||||||
PrintInternal (
|
|
||||||
IN UINTN Column,
|
|
||||||
IN UINTN Row,
|
|
||||||
IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *Out,
|
|
||||||
IN CHAR16 *Fmt,
|
|
||||||
IN VA_LIST Args
|
|
||||||
)
|
|
||||||
{
|
|
||||||
CHAR16 *Buffer;
|
|
||||||
CHAR16 *BackupBuffer;
|
|
||||||
UINTN Index;
|
|
||||||
UINTN PreviousIndex;
|
|
||||||
UINTN Count;
|
|
||||||
|
|
||||||
//
|
|
||||||
// For now, allocate an arbitrarily long buffer
|
|
||||||
//
|
|
||||||
Buffer = AllocateZeroPool (0x10000);
|
|
||||||
BackupBuffer = AllocateZeroPool (0x10000);
|
|
||||||
ASSERT (Buffer);
|
|
||||||
ASSERT (BackupBuffer);
|
|
||||||
|
|
||||||
if (Column != (UINTN) -1) {
|
|
||||||
Out->SetCursorPosition (Out, Column, Row);
|
|
||||||
}
|
|
||||||
|
|
||||||
UnicodeVSPrint (Buffer, 0x10000, Fmt, Args);
|
|
||||||
|
|
||||||
Out->Mode->Attribute = Out->Mode->Attribute & 0x7f;
|
|
||||||
|
|
||||||
Out->SetAttribute (Out, Out->Mode->Attribute);
|
|
||||||
|
|
||||||
Index = 0;
|
|
||||||
PreviousIndex = 0;
|
|
||||||
Count = 0;
|
|
||||||
|
|
||||||
do {
|
|
||||||
for (; (Buffer[Index] != NARROW_CHAR) && (Buffer[Index] != WIDE_CHAR) && (Buffer[Index] != 0); Index++) {
|
|
||||||
BackupBuffer[Index] = Buffer[Index];
|
|
||||||
}
|
|
||||||
|
|
||||||
if (Buffer[Index] == 0) {
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
//
|
|
||||||
// Null-terminate the temporary string
|
|
||||||
//
|
|
||||||
BackupBuffer[Index] = 0;
|
|
||||||
|
|
||||||
//
|
|
||||||
// Print this out, we are about to switch widths
|
|
||||||
//
|
|
||||||
Out->OutputString (Out, &BackupBuffer[PreviousIndex]);
|
|
||||||
Count += StrLen (&BackupBuffer[PreviousIndex]);
|
|
||||||
|
|
||||||
//
|
|
||||||
// Preserve the current index + 1, since this is where we will start printing from next
|
|
||||||
//
|
|
||||||
PreviousIndex = Index + 1;
|
|
||||||
|
|
||||||
//
|
|
||||||
// We are at a narrow or wide character directive. Set attributes and strip it and print it
|
|
||||||
//
|
|
||||||
if (Buffer[Index] == NARROW_CHAR) {
|
|
||||||
//
|
|
||||||
// Preserve bits 0 - 6 and zero out the rest
|
|
||||||
//
|
|
||||||
Out->Mode->Attribute = Out->Mode->Attribute & 0x7f;
|
|
||||||
Out->SetAttribute (Out, Out->Mode->Attribute);
|
|
||||||
} else {
|
|
||||||
//
|
|
||||||
// Must be wide, set bit 7 ON
|
|
||||||
//
|
|
||||||
Out->Mode->Attribute = Out->Mode->Attribute | EFI_WIDE_ATTRIBUTE;
|
|
||||||
Out->SetAttribute (Out, Out->Mode->Attribute);
|
|
||||||
}
|
|
||||||
|
|
||||||
Index++;
|
|
||||||
|
|
||||||
} while (Buffer[Index] != 0);
|
|
||||||
|
|
||||||
//
|
|
||||||
// We hit the end of the string - print it
|
|
||||||
//
|
|
||||||
Out->OutputString (Out, &BackupBuffer[PreviousIndex]);
|
|
||||||
Count += StrLen (&BackupBuffer[PreviousIndex]);
|
|
||||||
|
|
||||||
FreePool (Buffer);
|
|
||||||
FreePool (BackupBuffer);
|
|
||||||
return Count;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
Prints a formatted unicode string to the default console.
|
|
||||||
|
|
||||||
@param Fmt Format string
|
|
||||||
@param ... Variable argument list for format string.
|
|
||||||
|
|
||||||
@return Length of string printed to the console.
|
|
||||||
|
|
||||||
**/
|
|
||||||
UINTN
|
|
||||||
EFIAPI
|
|
||||||
ConsolePrint (
|
|
||||||
IN CHAR16 *Fmt,
|
|
||||||
...
|
|
||||||
)
|
|
||||||
{
|
|
||||||
VA_LIST Args;
|
|
||||||
UINTN LengthOfPrinted;
|
|
||||||
|
|
||||||
VA_START (Args, Fmt);
|
|
||||||
LengthOfPrinted = PrintInternal ((UINTN) -1, (UINTN) -1, gST->ConOut, Fmt, Args);
|
|
||||||
VA_END (Args);
|
|
||||||
return LengthOfPrinted;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
Prints a unicode string to the default console,
|
|
||||||
using L"%s" format.
|
|
||||||
|
|
||||||
@param String String pointer.
|
|
||||||
|
|
||||||
@return Length of string printed to the console
|
|
||||||
|
|
||||||
**/
|
|
||||||
UINTN
|
|
||||||
PrintString (
|
|
||||||
IN CHAR16 *String
|
|
||||||
)
|
|
||||||
{
|
|
||||||
return ConsolePrint (L"%s", String);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
Prints a chracter to the default console,
|
|
||||||
using L"%c" format.
|
|
||||||
|
|
||||||
@param Character Character to print.
|
|
||||||
|
|
||||||
@return Length of string printed to the console.
|
|
||||||
|
|
||||||
**/
|
|
||||||
UINTN
|
|
||||||
PrintChar (
|
|
||||||
CHAR16 Character
|
|
||||||
)
|
|
||||||
{
|
|
||||||
return ConsolePrint (L"%c", Character);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
Prints a formatted unicode string to the default console, at
|
|
||||||
the supplied cursor position.
|
|
||||||
|
|
||||||
@param Column The cursor position to print the string at.
|
|
||||||
@param Row The cursor position to print the string at.
|
|
||||||
@param Fmt Format string.
|
|
||||||
@param ... Variable argument list for format string.
|
|
||||||
|
|
||||||
@return Length of string printed to the console
|
|
||||||
|
|
||||||
**/
|
|
||||||
UINTN
|
|
||||||
EFIAPI
|
|
||||||
PrintAt (
|
|
||||||
IN UINTN Column,
|
|
||||||
IN UINTN Row,
|
|
||||||
IN CHAR16 *Fmt,
|
|
||||||
...
|
|
||||||
)
|
|
||||||
{
|
|
||||||
VA_LIST Args;
|
|
||||||
UINTN LengthOfPrinted;
|
|
||||||
|
|
||||||
VA_START (Args, Fmt);
|
|
||||||
LengthOfPrinted = PrintInternal (Column, Row, gST->ConOut, Fmt, Args);
|
|
||||||
VA_END (Args);
|
|
||||||
return LengthOfPrinted;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
Prints a unicode string to the default console, at
|
|
||||||
the supplied cursor position, using L"%s" format.
|
|
||||||
|
|
||||||
@param Column The cursor position to print the string at.
|
|
||||||
@param Row The cursor position to print the string at
|
|
||||||
@param String String pointer.
|
|
||||||
|
|
||||||
@return Length of string printed to the console
|
|
||||||
|
|
||||||
**/
|
|
||||||
UINTN
|
|
||||||
PrintStringAt (
|
|
||||||
IN UINTN Column,
|
|
||||||
IN UINTN Row,
|
|
||||||
IN CHAR16 *String
|
|
||||||
)
|
|
||||||
{
|
|
||||||
return PrintAt (Column, Row, L"%s", String);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
Prints a chracter to the default console, at
|
|
||||||
the supplied cursor position, using L"%c" format.
|
|
||||||
|
|
||||||
@param Column The cursor position to print the string at.
|
|
||||||
@param Row The cursor position to print the string at.
|
|
||||||
@param Character Character to print.
|
|
||||||
|
|
||||||
@return Length of string printed to the console.
|
|
||||||
|
|
||||||
**/
|
|
||||||
UINTN
|
|
||||||
PrintCharAt (
|
|
||||||
IN UINTN Column,
|
|
||||||
IN UINTN Row,
|
|
||||||
CHAR16 Character
|
|
||||||
)
|
|
||||||
{
|
|
||||||
return PrintAt (Column, Row, L"%c", Character);
|
|
||||||
}
|
|
File diff suppressed because it is too large
Load Diff
@ -46,7 +46,7 @@ UINTN gBrowserContextCount = 0;
|
|||||||
LIST_ENTRY gBrowserContextList = INITIALIZE_LIST_HEAD_VARIABLE (gBrowserContextList);
|
LIST_ENTRY gBrowserContextList = INITIALIZE_LIST_HEAD_VARIABLE (gBrowserContextList);
|
||||||
LIST_ENTRY gBrowserFormSetList = INITIALIZE_LIST_HEAD_VARIABLE (gBrowserFormSetList);
|
LIST_ENTRY gBrowserFormSetList = INITIALIZE_LIST_HEAD_VARIABLE (gBrowserFormSetList);
|
||||||
LIST_ENTRY gBrowserHotKeyList = INITIALIZE_LIST_HEAD_VARIABLE (gBrowserHotKeyList);
|
LIST_ENTRY gBrowserHotKeyList = INITIALIZE_LIST_HEAD_VARIABLE (gBrowserHotKeyList);
|
||||||
LIST_ENTRY gBrowserStorageList = INITIALIZE_LIST_HEAD_VARIABLE (gBrowserStorageList);
|
LIST_ENTRY gBrowserStorageList = INITIALIZE_LIST_HEAD_VARIABLE (gBrowserStorageList);
|
||||||
|
|
||||||
BOOLEAN gResetRequired;
|
BOOLEAN gResetRequired;
|
||||||
BOOLEAN gExitRequired;
|
BOOLEAN gExitRequired;
|
||||||
@ -58,17 +58,15 @@ EXIT_HANDLER ExitHandlerFunction = NULL;
|
|||||||
// Browser Global Strings
|
// Browser Global Strings
|
||||||
//
|
//
|
||||||
CHAR16 *gEmptyString;
|
CHAR16 *gEmptyString;
|
||||||
|
|
||||||
CHAR16 *mUnknownString = L"!";
|
CHAR16 *mUnknownString = L"!";
|
||||||
|
|
||||||
EFI_GUID gZeroGuid = {0, 0, 0, {0, 0, 0, 0, 0, 0, 0, 0}};
|
EFI_GUID gZeroGuid = {0, 0, 0, {0, 0, 0, 0, 0, 0, 0, 0}};
|
||||||
EFI_GUID gSetupBrowserGuid = {
|
|
||||||
0xab368524, 0xb60c, 0x495b, {0xa0, 0x9, 0x12, 0xe8, 0x5b, 0x1a, 0xea, 0x32}
|
|
||||||
};
|
|
||||||
|
|
||||||
FORM_BROWSER_FORMSET *gOldFormSet = NULL;
|
extern UINT32 gBrowserStatus;
|
||||||
extern UINT32 gBrowserStatus;
|
extern CHAR16 *gErrorInfo;
|
||||||
extern CHAR16 *gErrorInfo;
|
extern EFI_GUID mCurrentFormSetGuid;
|
||||||
|
extern EFI_HII_HANDLE mCurrentHiiHandle;
|
||||||
|
extern UINT16 mCurrentFormId;
|
||||||
extern FORM_DISPLAY_ENGINE_FORM gDisplayFormData;
|
extern FORM_DISPLAY_ENGINE_FORM gDisplayFormData;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -4612,11 +4610,6 @@ SaveBrowserContext (
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
|
||||||
// Not support SendForm nest in another SendForm, assert here.
|
|
||||||
//
|
|
||||||
ASSERT (FALSE);
|
|
||||||
|
|
||||||
Context = AllocatePool (sizeof (BROWSER_CONTEXT));
|
Context = AllocatePool (sizeof (BROWSER_CONTEXT));
|
||||||
ASSERT (Context != NULL);
|
ASSERT (Context != NULL);
|
||||||
|
|
||||||
@ -4625,9 +4618,12 @@ SaveBrowserContext (
|
|||||||
//
|
//
|
||||||
// Save FormBrowser context
|
// Save FormBrowser context
|
||||||
//
|
//
|
||||||
|
Context->Selection = gCurrentSelection;
|
||||||
Context->ResetRequired = gResetRequired;
|
Context->ResetRequired = gResetRequired;
|
||||||
Context->ExitRequired = gExitRequired;
|
Context->ExitRequired = gExitRequired;
|
||||||
Context->HiiHandle = mCurrentHiiHandle;
|
Context->HiiHandle = mCurrentHiiHandle;
|
||||||
|
Context->FormId = mCurrentFormId;
|
||||||
|
CopyGuid (&Context->FormSetGuid, &mCurrentFormSetGuid);
|
||||||
|
|
||||||
//
|
//
|
||||||
// Save the menu history data.
|
// Save the menu history data.
|
||||||
@ -4677,9 +4673,12 @@ RestoreBrowserContext (
|
|||||||
//
|
//
|
||||||
// Restore FormBrowser context
|
// Restore FormBrowser context
|
||||||
//
|
//
|
||||||
|
gCurrentSelection = Context->Selection;
|
||||||
gResetRequired = Context->ResetRequired;
|
gResetRequired = Context->ResetRequired;
|
||||||
gExitRequired = Context->ExitRequired;
|
gExitRequired = Context->ExitRequired;
|
||||||
mCurrentHiiHandle = Context->HiiHandle;
|
mCurrentHiiHandle = Context->HiiHandle;
|
||||||
|
mCurrentFormId = Context->FormId;
|
||||||
|
CopyGuid (&mCurrentFormSetGuid, &Context->FormSetGuid);
|
||||||
|
|
||||||
//
|
//
|
||||||
// Restore the menu history data.
|
// Restore the menu history data.
|
||||||
|
@ -449,23 +449,6 @@ typedef struct {
|
|||||||
|
|
||||||
#define FORM_BROWSER_REFRESH_EVENT_FROM_LINK(a) BASE_CR (a, FORM_BROWSER_REFRESH_EVENT_NODE, Link)
|
#define FORM_BROWSER_REFRESH_EVENT_FROM_LINK(a) BASE_CR (a, FORM_BROWSER_REFRESH_EVENT_NODE, Link)
|
||||||
|
|
||||||
#define BROWSER_CONTEXT_SIGNATURE SIGNATURE_32 ('B', 'C', 'T', 'X')
|
|
||||||
|
|
||||||
typedef struct {
|
|
||||||
UINTN Signature;
|
|
||||||
LIST_ENTRY Link;
|
|
||||||
|
|
||||||
//
|
|
||||||
// Globals defined in Setup.c
|
|
||||||
//
|
|
||||||
BOOLEAN ResetRequired;
|
|
||||||
BOOLEAN ExitRequired;
|
|
||||||
EFI_HII_HANDLE HiiHandle;
|
|
||||||
|
|
||||||
LIST_ENTRY FormHistoryList;
|
|
||||||
} BROWSER_CONTEXT;
|
|
||||||
|
|
||||||
#define BROWSER_CONTEXT_FROM_LINK(a) CR (a, BROWSER_CONTEXT, Link, BROWSER_CONTEXT_SIGNATURE)
|
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
EFI_HII_HANDLE Handle;
|
EFI_HII_HANDLE Handle;
|
||||||
@ -507,6 +490,27 @@ typedef struct {
|
|||||||
FORM_ENTRY_INFO *CurrentMenu;
|
FORM_ENTRY_INFO *CurrentMenu;
|
||||||
} UI_MENU_SELECTION;
|
} UI_MENU_SELECTION;
|
||||||
|
|
||||||
|
#define BROWSER_CONTEXT_SIGNATURE SIGNATURE_32 ('B', 'C', 'T', 'X')
|
||||||
|
|
||||||
|
typedef struct {
|
||||||
|
UINTN Signature;
|
||||||
|
LIST_ENTRY Link;
|
||||||
|
|
||||||
|
//
|
||||||
|
// Globals defined in Setup.c
|
||||||
|
//
|
||||||
|
BOOLEAN ResetRequired;
|
||||||
|
BOOLEAN ExitRequired;
|
||||||
|
EFI_HII_HANDLE HiiHandle;
|
||||||
|
EFI_GUID FormSetGuid;
|
||||||
|
EFI_FORM_ID FormId;
|
||||||
|
UI_MENU_SELECTION *Selection;
|
||||||
|
|
||||||
|
LIST_ENTRY FormHistoryList;
|
||||||
|
} BROWSER_CONTEXT;
|
||||||
|
|
||||||
|
#define BROWSER_CONTEXT_FROM_LINK(a) CR (a, BROWSER_CONTEXT, Link, BROWSER_CONTEXT_SIGNATURE)
|
||||||
|
|
||||||
//
|
//
|
||||||
// Scope for get defaut value. It may be GetDefaultForNoStorage, GetDefaultForStorage or GetDefaultForAll.
|
// Scope for get defaut value. It may be GetDefaultForNoStorage, GetDefaultForStorage or GetDefaultForAll.
|
||||||
//
|
//
|
||||||
@ -535,7 +539,6 @@ extern EDKII_FORM_DISPLAY_ENGINE_PROTOCOL *mFormDisplay;
|
|||||||
extern BOOLEAN gResetRequired;
|
extern BOOLEAN gResetRequired;
|
||||||
extern BOOLEAN gExitRequired;
|
extern BOOLEAN gExitRequired;
|
||||||
|
|
||||||
extern FORM_BROWSER_FORMSET *gOldFormSet;
|
|
||||||
extern LIST_ENTRY gBrowserFormSetList;
|
extern LIST_ENTRY gBrowserFormSetList;
|
||||||
extern LIST_ENTRY gBrowserHotKeyList;
|
extern LIST_ENTRY gBrowserHotKeyList;
|
||||||
extern BROWSER_SETTING_SCOPE gBrowserSettingScope;
|
extern BROWSER_SETTING_SCOPE gBrowserSettingScope;
|
||||||
|
@ -77,6 +77,4 @@
|
|||||||
[Depex]
|
[Depex]
|
||||||
gEfiHiiDatabaseProtocolGuid AND gEfiHiiConfigRoutingProtocolGuid
|
gEfiHiiDatabaseProtocolGuid AND gEfiHiiConfigRoutingProtocolGuid
|
||||||
|
|
||||||
[BuildOptions]
|
|
||||||
MSFT:*_*_*_CC_FLAGS = /Od
|
|
||||||
|
|
||||||
|
Binary file not shown.
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user