mirror of https://github.com/acidanthera/audk.git
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:
parent
6b1ac44423
commit
5a9f73bf06
|
@ -19,7 +19,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
|||
|
||||
/**
|
||||
+------------------------------------------------------------------------------+
|
||||
? Setup Page ?
|
||||
| Setup Page |
|
||||
+------------------------------------------------------------------------------+
|
||||
|
||||
Statement
|
||||
|
@ -31,8 +31,8 @@ Statement
|
|||
|
||||
|
||||
+------------------------------------------------------------------------------+
|
||||
?F1=Scroll Help F9=Reset to Defaults F10=Save and Exit ?
|
||||
| ^"=Move Highlight <Spacebar> Toggles Checkbox Esc=Discard Changes |
|
||||
| F9=Reset to Defaults F10=Save |
|
||||
| ^"=Move Highlight <Spacebar> Toggles Checkbox Esc=Exit |
|
||||
+------------------------------------------------------------------------------+
|
||||
StatusBar
|
||||
**/
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
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.
|
||||
|
||||
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
|
||||
the terms and conditions of the BSD License that accompanies this distribution.
|
||||
The full text of the license may be found at
|
||||
|
@ -62,8 +62,8 @@ typedef struct {
|
|||
|
||||
EFI_HII_HANDLE HiiHandle;
|
||||
EFI_GUID FormSetGuid;
|
||||
UINT16 FormId;
|
||||
UINT16 QuestionId;
|
||||
EFI_FORM_ID FormId;
|
||||
EFI_QUESTION_ID QuestionId;
|
||||
} FORM_ENTRY_INFO;
|
||||
|
||||
#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;
|
||||
UINT16 gClassOfVfr; // Formset class information
|
||||
UINT16 gLastClassOfVfr = 0;
|
||||
BOOLEAN gLibIsFirstForm = TRUE;
|
||||
BANNER_DATA *gBannerData;
|
||||
|
||||
UINTN gFooterHeight;
|
||||
|
@ -37,8 +37,8 @@ Statement
|
|||
|
||||
|
||||
+------------------------------------------------------------------------------+
|
||||
| F1=Scroll Help F9=Reset to Defaults F10=Save and Exit |
|
||||
| ^"=Move Highlight <Spacebar> Toggles Checkbox Esc=Discard Changes |
|
||||
| F9=Reset to Defaults F10=Save |
|
||||
| ^"=Move Highlight <Spacebar> Toggles Checkbox Esc=Exit |
|
||||
+------------------------------------------------------------------------------+
|
||||
StatusBar
|
||||
**/
|
||||
|
@ -74,9 +74,6 @@ DisplayPageFrame (
|
|||
}
|
||||
|
||||
gClassOfVfr = FORMSET_CLASS_PLATFORM_SETUP;
|
||||
if ((FormData->Attribute & HII_DISPLAY_MODAL) != 0) {
|
||||
gClassOfVfr = FORMSET_CLASS_MODEL_PAGE;
|
||||
}
|
||||
|
||||
ProcessExternedOpcode(FormData);
|
||||
|
||||
|
@ -84,7 +81,7 @@ DisplayPageFrame (
|
|||
// Calculate the ScreenForStatement.
|
||||
//
|
||||
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;
|
||||
} else {
|
||||
ScreenForStatement->TopRow = gScreenDimensions.TopRow + NONE_FRONT_PAGE_HEADER_HEIGHT;
|
||||
|
@ -92,42 +89,30 @@ DisplayPageFrame (
|
|||
ScreenForStatement->LeftColumn = gScreenDimensions.LeftColumn;
|
||||
ScreenForStatement->RightColumn = gScreenDimensions.RightColumn;
|
||||
|
||||
//
|
||||
// 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.
|
||||
//
|
||||
if (gLastClassOfVfr == gClassOfVfr) {
|
||||
UpdateStatusBar(NV_UPDATE_REQUIRED, FormData->SettingChangedFlag);
|
||||
PrintFormTitle(FormData);
|
||||
return EFI_SUCCESS;
|
||||
}
|
||||
|
||||
//
|
||||
// Record last ClassOfVfr and Streen Information.
|
||||
//
|
||||
gLastClassOfVfr = gClassOfVfr;
|
||||
|
||||
if ((gLibIsFirstForm) || ((FormData->Attribute & HII_DISPLAY_MODAL) != 0)) {
|
||||
//
|
||||
// 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);
|
||||
gLibIsFirstForm = FALSE;
|
||||
}
|
||||
|
||||
//
|
||||
// Don't print frame for modal form.
|
||||
//
|
||||
if ((FormData->Attribute & HII_DISPLAY_MODAL) != 0) {
|
||||
return EFI_SUCCESS;
|
||||
}
|
||||
|
||||
if ((gClassOfVfr & FORMSET_CLASS_FRONT_PAGE) == FORMSET_CLASS_FRONT_PAGE) {
|
||||
if (gClassOfVfr == FORMSET_CLASS_FRONT_PAGE) {
|
||||
PrintBannerInfo (FormData);
|
||||
}
|
||||
|
||||
PrintFramework ();
|
||||
PrintFramework (FormData);
|
||||
|
||||
UpdateStatusBar(NV_UPDATE_REQUIRED, FormData->SettingChangedFlag);
|
||||
|
||||
PrintFormTitle(FormData);
|
||||
|
||||
return EFI_SUCCESS;
|
||||
}
|
||||
|
||||
|
@ -213,7 +198,7 @@ RefreshKeyHelp (
|
|||
if (!Selected) {
|
||||
PrintHotKeyHelpString (FormData);
|
||||
|
||||
if ((gClassOfVfr & FORMSET_CLASS_PLATFORM_SETUP) == FORMSET_CLASS_PLATFORM_SETUP) {
|
||||
if (gClassOfVfr == FORMSET_CLASS_PLATFORM_SETUP) {
|
||||
PrintStringAt (ThdCol, BottomRowOfHelp, gEscapeString);
|
||||
}
|
||||
|
||||
|
@ -269,7 +254,7 @@ RefreshKeyHelp (
|
|||
case EFI_IFR_CHECKBOX_OP:
|
||||
PrintHotKeyHelpString (FormData);
|
||||
|
||||
if ((gClassOfVfr & FORMSET_CLASS_PLATFORM_SETUP) == FORMSET_CLASS_PLATFORM_SETUP) {
|
||||
if (gClassOfVfr == FORMSET_CLASS_PLATFORM_SETUP) {
|
||||
PrintStringAt (ThdCol, BottomRowOfHelp, gEscapeString);
|
||||
}
|
||||
|
||||
|
@ -287,7 +272,7 @@ RefreshKeyHelp (
|
|||
if (!Selected) {
|
||||
PrintHotKeyHelpString (FormData);
|
||||
|
||||
if ((gClassOfVfr & FORMSET_CLASS_PLATFORM_SETUP) == FORMSET_CLASS_PLATFORM_SETUP) {
|
||||
if (gClassOfVfr == FORMSET_CLASS_PLATFORM_SETUP) {
|
||||
PrintStringAt (ThdCol, BottomRowOfHelp, gEscapeString);
|
||||
}
|
||||
|
||||
|
@ -584,7 +569,7 @@ FormExitPolicy (
|
|||
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->ClearScreen (gST->ConOut);
|
||||
gLastClassOfVfr = 0;
|
||||
gLibIsFirstForm = TRUE;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -130,19 +130,34 @@ 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
|
||||
PrintFramework (
|
||||
VOID
|
||||
IN FORM_DISPLAY_ENGINE_FORM *FormData
|
||||
)
|
||||
{
|
||||
UINTN Index;
|
||||
CHAR16 Character;
|
||||
CHAR16 *Buffer;
|
||||
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);
|
||||
ASSERT (Buffer != NULL);
|
||||
|
@ -151,31 +166,16 @@ PrintFramework (
|
|||
Buffer[Index] = Character;
|
||||
}
|
||||
|
||||
ClearLines (
|
||||
gScreenDimensions.LeftColumn,
|
||||
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
|
||||
// +------------------------------------------------------------------------------+
|
||||
// ? ?
|
||||
// +------------------------------------------------------------------------------+
|
||||
//
|
||||
gST->ConOut->SetAttribute (gST->ConOut, TITLE_TEXT | TITLE_BACKGROUND);
|
||||
Character = BOXDRAW_DOWN_RIGHT;
|
||||
|
||||
PrintCharAt ((UINTN) -1, (UINTN) -1, Character);
|
||||
PrintCharAt (gScreenDimensions.LeftColumn, gScreenDimensions.TopRow, Character);
|
||||
PrintStringAt ((UINTN) -1, (UINTN) -1, Buffer);
|
||||
|
||||
Character = BOXDRAW_DOWN_LEFT;
|
||||
|
@ -187,6 +187,26 @@ PrintFramework (
|
|||
PrintCharAt (gScreenDimensions.RightColumn - 1, Row, Character);
|
||||
}
|
||||
|
||||
//
|
||||
// Print Form Title
|
||||
//
|
||||
ClearLines (
|
||||
gScreenDimensions.LeftColumn + 1,
|
||||
gScreenDimensions.RightColumn - 1,
|
||||
gScreenDimensions.TopRow + 1,
|
||||
gScreenDimensions.TopRow + 1,
|
||||
TITLE_TEXT | TITLE_BACKGROUND
|
||||
);
|
||||
|
||||
TitleStr = LibGetToken (FormData->FormTitle, FormData->HiiHandle);
|
||||
ASSERT (TitleStr != NULL);
|
||||
PrintStringAt (
|
||||
(gScreenDimensions.RightColumn + gScreenDimensions.LeftColumn - LibGetStringWidth (TitleStr) / 2) / 2,
|
||||
gScreenDimensions.TopRow + 1,
|
||||
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);
|
||||
|
@ -223,53 +243,10 @@ PrintFramework (
|
|||
|
||||
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);
|
||||
|
||||
ClearLines (
|
||||
gScreenDimensions.LeftColumn + 1,
|
||||
gScreenDimensions.RightColumn - 1,
|
||||
gScreenDimensions.TopRow + 1,
|
||||
gScreenDimensions.TopRow + 1,
|
||||
TITLE_TEXT | TITLE_BACKGROUND
|
||||
);
|
||||
|
||||
PrintStringAt (
|
||||
(gScreenDimensions.RightColumn + gScreenDimensions.LeftColumn - LibGetStringWidth (TitleStr) / 2) / 2,
|
||||
gScreenDimensions.TopRow + 1,
|
||||
TitleStr
|
||||
);
|
||||
|
||||
FreePool (TitleStr);
|
||||
}
|
||||
|
||||
/**
|
||||
Process some op code which is not recognized by browser core.
|
||||
|
||||
|
@ -300,7 +277,7 @@ ProcessUserOpcode(
|
|||
//
|
||||
// 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
|
||||
//
|
||||
|
|
|
@ -57,7 +57,6 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
|||
|
||||
#define FORMSET_CLASS_PLATFORM_SETUP 0x0001
|
||||
#define FORMSET_CLASS_FRONT_PAGE 0x0002
|
||||
#define FORMSET_CLASS_MODEL_PAGE 0x0004
|
||||
|
||||
|
||||
#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
|
||||
PrintFramework (
|
||||
VOID
|
||||
);
|
||||
|
||||
/**
|
||||
Print the form title.
|
||||
|
||||
@param[in] FormData Form Data to be shown in Page
|
||||
|
||||
**/
|
||||
VOID
|
||||
PrintFormTitle (
|
||||
IN FORM_DISPLAY_ENGINE_FORM *FormData
|
||||
);
|
||||
|
||||
|
|
|
@ -32,7 +32,6 @@
|
|||
FormDisplayStr.uni
|
||||
FormDisplay.c
|
||||
FormDisplay.h
|
||||
Print.c
|
||||
ProcessOptions.c
|
||||
InputHandler.c
|
||||
|
||||
|
@ -65,6 +64,3 @@
|
|||
gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserGrayOutTextStatement ## 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}
|
||||
};
|
||||
|
||||
FORM_ENTRY_INFO gFormEntryInfo;
|
||||
UINTN gSequence;
|
||||
EFI_SCREEN_DESCRIPTOR gStatementDimensions;
|
||||
EFI_SCREEN_DESCRIPTOR gOldStatementDimensions = {0};
|
||||
BOOLEAN mStatementLayoutIsChanged = TRUE;
|
||||
USER_INPUT *gUserInput;
|
||||
FORM_DISPLAY_ENGINE_FORM *gFormData;
|
||||
|
@ -107,6 +107,8 @@ EFI_HII_HANDLE gHiiHandle;
|
|||
UINT16 gDirection;
|
||||
LIST_ENTRY gMenuOption;
|
||||
DISPLAY_HIGHLIGHT_MENU_INFO gHighligthMenuInfo = {0};
|
||||
BOOLEAN mIsFirstForm = TRUE;
|
||||
FORM_ENTRY_INFO gOldFormEntry = {0};
|
||||
|
||||
//
|
||||
// Browser Global Strings
|
||||
|
@ -138,7 +140,7 @@ FORM_DISPLAY_DRIVER_PRIVATE_DATA mPrivateData = {
|
|||
NULL,
|
||||
{
|
||||
FormDisplay,
|
||||
ClearDisplayPage,
|
||||
DriverClearDisplayPage,
|
||||
ConfirmDataChange
|
||||
}
|
||||
};
|
||||
|
@ -2978,6 +2980,7 @@ UiDisplayMenu (
|
|||
break;
|
||||
|
||||
case CfExit:
|
||||
gST->ConOut->SetAttribute (gST->ConOut, EFI_TEXT_ATTR (EFI_LIGHTGRAY, EFI_BLACK));
|
||||
if (HelpString != NULL) {
|
||||
FreePool (HelpString);
|
||||
}
|
||||
|
@ -3096,18 +3099,67 @@ FormDisplay (
|
|||
return Status;
|
||||
}
|
||||
|
||||
if (CompareMem (&gOldStatementDimensions, &gStatementDimensions, sizeof (gStatementDimensions)) == 0) {
|
||||
mStatementLayoutIsChanged = FALSE;
|
||||
} else {
|
||||
//
|
||||
// Check whether layout is changed.
|
||||
//
|
||||
if (mIsFirstForm
|
||||
|| (gOldFormEntry.HiiHandle != FormData->HiiHandle)
|
||||
|| (!CompareGuid (&gOldFormEntry.FormSetGuid, &FormData->FormSetGuid))
|
||||
|| (gOldFormEntry.FormId != FormData->FormId)) {
|
||||
mStatementLayoutIsChanged = TRUE;
|
||||
CopyMem (&gOldStatementDimensions, &gStatementDimensions, sizeof (gStatementDimensions));
|
||||
} else {
|
||||
mStatementLayoutIsChanged = FALSE;
|
||||
}
|
||||
|
||||
Status = UiDisplayMenu(FormData);
|
||||
|
||||
//
|
||||
// Backup last form info.
|
||||
//
|
||||
mIsFirstForm = FALSE;
|
||||
gOldFormEntry.HiiHandle = FormData->HiiHandle;
|
||||
CopyGuid (&gOldFormEntry.FormSetGuid, &FormData->FormSetGuid);
|
||||
gOldFormEntry.FormId = FormData->FormId;
|
||||
|
||||
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.
|
||||
|
||||
|
@ -3154,6 +3206,9 @@ InitializeDisplayEngine (
|
|||
|
||||
InitializeDisplayStrings();
|
||||
|
||||
ZeroMem (&gHighligthMenuInfo, sizeof (gHighligthMenuInfo));
|
||||
ZeroMem (&gOldFormEntry, sizeof (gOldFormEntry));
|
||||
|
||||
//
|
||||
// Use BrowserEx2 protocol to register HotKey.
|
||||
//
|
||||
|
|
|
@ -553,6 +553,15 @@ FormDisplay (
|
|||
OUT USER_INPUT *UserInputData
|
||||
);
|
||||
|
||||
/**
|
||||
Clear Screen to the initial state.
|
||||
**/
|
||||
VOID
|
||||
EFIAPI
|
||||
DriverClearDisplayPage (
|
||||
VOID
|
||||
);
|
||||
|
||||
/**
|
||||
Exit Display and Clear Screen to the original state.
|
||||
|
||||
|
|
|
@ -1045,16 +1045,16 @@ IsValuesEqual (
|
|||
switch (Type) {
|
||||
case EFI_IFR_TYPE_BOOLEAN:
|
||||
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:
|
||||
return Value1->u16 == Value2->u16;
|
||||
return (BOOLEAN) (Value1->u16 == Value2->u16);
|
||||
|
||||
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:
|
||||
return Value1->u64 == Value2->u64;
|
||||
return (BOOLEAN) (Value1->u64 == Value2->u64);
|
||||
|
||||
default:
|
||||
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
|
@ -58,17 +58,15 @@ EXIT_HANDLER ExitHandlerFunction = NULL;
|
|||
// Browser Global Strings
|
||||
//
|
||||
CHAR16 *gEmptyString;
|
||||
|
||||
CHAR16 *mUnknownString = L"!";
|
||||
|
||||
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 CHAR16 *gErrorInfo;
|
||||
extern EFI_GUID mCurrentFormSetGuid;
|
||||
extern EFI_HII_HANDLE mCurrentHiiHandle;
|
||||
extern UINT16 mCurrentFormId;
|
||||
extern FORM_DISPLAY_ENGINE_FORM gDisplayFormData;
|
||||
|
||||
/**
|
||||
|
@ -4612,11 +4610,6 @@ SaveBrowserContext (
|
|||
return;
|
||||
}
|
||||
|
||||
//
|
||||
// Not support SendForm nest in another SendForm, assert here.
|
||||
//
|
||||
ASSERT (FALSE);
|
||||
|
||||
Context = AllocatePool (sizeof (BROWSER_CONTEXT));
|
||||
ASSERT (Context != NULL);
|
||||
|
||||
|
@ -4625,9 +4618,12 @@ SaveBrowserContext (
|
|||
//
|
||||
// Save FormBrowser context
|
||||
//
|
||||
Context->Selection = gCurrentSelection;
|
||||
Context->ResetRequired = gResetRequired;
|
||||
Context->ExitRequired = gExitRequired;
|
||||
Context->HiiHandle = mCurrentHiiHandle;
|
||||
Context->FormId = mCurrentFormId;
|
||||
CopyGuid (&Context->FormSetGuid, &mCurrentFormSetGuid);
|
||||
|
||||
//
|
||||
// Save the menu history data.
|
||||
|
@ -4677,9 +4673,12 @@ RestoreBrowserContext (
|
|||
//
|
||||
// Restore FormBrowser context
|
||||
//
|
||||
gCurrentSelection = Context->Selection;
|
||||
gResetRequired = Context->ResetRequired;
|
||||
gExitRequired = Context->ExitRequired;
|
||||
mCurrentHiiHandle = Context->HiiHandle;
|
||||
mCurrentFormId = Context->FormId;
|
||||
CopyGuid (&mCurrentFormSetGuid, &Context->FormSetGuid);
|
||||
|
||||
//
|
||||
// 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 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 {
|
||||
EFI_HII_HANDLE Handle;
|
||||
|
@ -507,6 +490,27 @@ typedef struct {
|
|||
FORM_ENTRY_INFO *CurrentMenu;
|
||||
} 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.
|
||||
//
|
||||
|
@ -535,7 +539,6 @@ extern EDKII_FORM_DISPLAY_ENGINE_PROTOCOL *mFormDisplay;
|
|||
extern BOOLEAN gResetRequired;
|
||||
extern BOOLEAN gExitRequired;
|
||||
|
||||
extern FORM_BROWSER_FORMSET *gOldFormSet;
|
||||
extern LIST_ENTRY gBrowserFormSetList;
|
||||
extern LIST_ENTRY gBrowserHotKeyList;
|
||||
extern BROWSER_SETTING_SCOPE gBrowserSettingScope;
|
||||
|
|
|
@ -77,6 +77,4 @@
|
|||
[Depex]
|
||||
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
Loading…
Reference in New Issue