diff options
Diffstat (limited to 'MdeModulePkg/Library/CustomizedDisplayLib')
4 files changed, 570 insertions, 543 deletions
diff --git a/MdeModulePkg/Library/CustomizedDisplayLib/Colors.h b/MdeModulePkg/Library/CustomizedDisplayLib/Colors.h index f2cbb8940f..487c6d4f2d 100644 --- a/MdeModulePkg/Library/CustomizedDisplayLib/Colors.h +++ b/MdeModulePkg/Library/CustomizedDisplayLib/Colors.h @@ -14,25 +14,25 @@ SPDX-License-Identifier: BSD-2-Clause-Patent //
// 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
+#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
diff --git a/MdeModulePkg/Library/CustomizedDisplayLib/CustomizedDisplayLib.c b/MdeModulePkg/Library/CustomizedDisplayLib/CustomizedDisplayLib.c index 4dca484eb8..b3da13d0a3 100644 --- a/MdeModulePkg/Library/CustomizedDisplayLib/CustomizedDisplayLib.c +++ b/MdeModulePkg/Library/CustomizedDisplayLib/CustomizedDisplayLib.c @@ -8,14 +8,16 @@ SPDX-License-Identifier: BSD-2-Clause-Patent **/
#include "CustomizedDisplayLibInternal.h"
-EFI_GUID gCustomizedDisplayLibGuid = { 0x99fdc8fd, 0x849b, 0x4eba, { 0xad, 0x13, 0xfb, 0x96, 0x99, 0xc9, 0xa, 0x4d } };
+EFI_GUID gCustomizedDisplayLibGuid = {
+ 0x99fdc8fd, 0x849b, 0x4eba, { 0xad, 0x13, 0xfb, 0x96, 0x99, 0xc9, 0xa, 0x4d }
+};
-EFI_HII_HANDLE mCDLStringPackHandle;
-UINT16 gClassOfVfr; // Formset class information
-BOOLEAN gLibIsFirstForm = TRUE;
-BANNER_DATA *gBannerData;
+EFI_HII_HANDLE mCDLStringPackHandle;
+UINT16 gClassOfVfr; // Formset class information
+BOOLEAN gLibIsFirstForm = TRUE;
+BANNER_DATA *gBannerData;
-UINTN gFooterHeight;
+UINTN gFooterHeight;
/**
+------------------------------------------------------------------------------+
@@ -51,14 +53,14 @@ Statement EFI_STATUS
EFIAPI
DisplayPageFrame (
- IN FORM_DISPLAY_ENGINE_FORM *FormData,
- OUT EFI_SCREEN_DESCRIPTOR *ScreenForStatement
+ IN FORM_DISPLAY_ENGINE_FORM *FormData,
+ OUT EFI_SCREEN_DESCRIPTOR *ScreenForStatement
)
{
- EFI_STATUS Status;
+ EFI_STATUS Status;
ASSERT (FormData != NULL && ScreenForStatement != NULL);
- if (FormData == NULL || ScreenForStatement == NULL) {
+ if ((FormData == NULL) || (ScreenForStatement == NULL)) {
return EFI_INVALID_PARAMETER;
}
@@ -69,17 +71,18 @@ DisplayPageFrame ( gClassOfVfr = FORMSET_CLASS_PLATFORM_SETUP;
- ProcessExternedOpcode(FormData);
+ ProcessExternedOpcode (FormData);
//
// 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) {
- ScreenForStatement->TopRow = gScreenDimensions.TopRow + FRONT_PAGE_HEADER_HEIGHT;
+ ScreenForStatement->TopRow = gScreenDimensions.TopRow + FRONT_PAGE_HEADER_HEIGHT;
} else {
- ScreenForStatement->TopRow = gScreenDimensions.TopRow + NONE_FRONT_PAGE_HEADER_HEIGHT;
+ ScreenForStatement->TopRow = gScreenDimensions.TopRow + NONE_FRONT_PAGE_HEADER_HEIGHT;
}
+
ScreenForStatement->LeftColumn = gScreenDimensions.LeftColumn;
ScreenForStatement->RightColumn = gScreenDimensions.RightColumn;
@@ -105,7 +108,7 @@ DisplayPageFrame ( PrintFramework (FormData);
- UpdateStatusBar(NV_UPDATE_REQUIRED, FormData->SettingChangedFlag);
+ UpdateStatusBar (NV_UPDATE_REQUIRED, FormData->SettingChangedFlag);
return EFI_SUCCESS;
}
@@ -122,27 +125,27 @@ DisplayPageFrame ( VOID
EFIAPI
RefreshKeyHelp (
- IN FORM_DISPLAY_ENGINE_FORM *FormData,
- IN FORM_DISPLAY_ENGINE_STATEMENT *Statement,
- IN BOOLEAN Selected
+ IN FORM_DISPLAY_ENGINE_FORM *FormData,
+ IN FORM_DISPLAY_ENGINE_STATEMENT *Statement,
+ IN BOOLEAN Selected
)
{
- UINTN SecCol;
- UINTN ThdCol;
- UINTN RightColumnOfHelp;
- UINTN TopRowOfHelp;
- UINTN BottomRowOfHelp;
- UINTN StartColumnOfHelp;
- EFI_IFR_NUMERIC *NumericOp;
- EFI_IFR_DATE *DateOp;
- EFI_IFR_TIME *TimeOp;
- BOOLEAN HexDisplay;
- UINTN ColumnWidth1;
- UINTN ColumnWidth2;
- UINTN ColumnWidth3;
- CHAR16 *ColumnStr1;
- CHAR16 *ColumnStr2;
- CHAR16 *ColumnStr3;
+ UINTN SecCol;
+ UINTN ThdCol;
+ UINTN RightColumnOfHelp;
+ UINTN TopRowOfHelp;
+ UINTN BottomRowOfHelp;
+ UINTN StartColumnOfHelp;
+ EFI_IFR_NUMERIC *NumericOp;
+ EFI_IFR_DATE *DateOp;
+ EFI_IFR_TIME *TimeOp;
+ BOOLEAN HexDisplay;
+ UINTN ColumnWidth1;
+ UINTN ColumnWidth2;
+ UINTN ColumnWidth3;
+ CHAR16 *ColumnStr1;
+ CHAR16 *ColumnStr2;
+ CHAR16 *ColumnStr3;
ASSERT (FormData != NULL);
if (FormData == NULL) {
@@ -155,8 +158,8 @@ RefreshKeyHelp ( return;
}
- SecCol = gScreenDimensions.LeftColumn + (gScreenDimensions.RightColumn - gScreenDimensions.LeftColumn) / 3;
- ThdCol = gScreenDimensions.LeftColumn + (gScreenDimensions.RightColumn - gScreenDimensions.LeftColumn) / 3 * 2;
+ SecCol = gScreenDimensions.LeftColumn + (gScreenDimensions.RightColumn - gScreenDimensions.LeftColumn) / 3;
+ ThdCol = gScreenDimensions.LeftColumn + (gScreenDimensions.RightColumn - gScreenDimensions.LeftColumn) / 3 * 2;
//
// + 2 means leave 1 space before the first hotkey info.
@@ -166,12 +169,12 @@ RefreshKeyHelp ( TopRowOfHelp = gScreenDimensions.BottomRow - STATUS_BAR_HEIGHT - gFooterHeight + 1;
BottomRowOfHelp = gScreenDimensions.BottomRow - STATUS_BAR_HEIGHT - 2;
- ColumnWidth1 = SecCol - StartColumnOfHelp;
- ColumnWidth2 = ThdCol - SecCol;
- ColumnWidth3 = RightColumnOfHelp - ThdCol;
- ColumnStr1 = gLibEmptyString;
- ColumnStr2 = gLibEmptyString;
- ColumnStr3 = gLibEmptyString;
+ ColumnWidth1 = SecCol - StartColumnOfHelp;
+ ColumnWidth2 = ThdCol - SecCol;
+ ColumnWidth3 = RightColumnOfHelp - ThdCol;
+ ColumnStr1 = gLibEmptyString;
+ ColumnStr2 = gLibEmptyString;
+ ColumnStr3 = gLibEmptyString;
//
// Clean the space at gScreenDimensions.LeftColumn + 1.
@@ -190,139 +193,152 @@ RefreshKeyHelp ( if (gClassOfVfr == FORMSET_CLASS_PLATFORM_SETUP) {
ColumnStr3 = gEscapeString;
}
+
PrintStringAtWithWidth (ThdCol, BottomRowOfHelp, ColumnStr3, ColumnWidth3);
return;
}
HexDisplay = FALSE;
- NumericOp = NULL;
- DateOp = NULL;
- TimeOp = NULL;
+ NumericOp = NULL;
+ DateOp = NULL;
+ TimeOp = NULL;
if (Statement->OpCode->OpCode == EFI_IFR_NUMERIC_OP) {
- NumericOp = (EFI_IFR_NUMERIC *) Statement->OpCode;
+ NumericOp = (EFI_IFR_NUMERIC *)Statement->OpCode;
HexDisplay = (NumericOp->Flags & EFI_IFR_DISPLAY_UINT_HEX) == EFI_IFR_DISPLAY_UINT_HEX;
} else if (Statement->OpCode->OpCode == EFI_IFR_DATE_OP) {
- DateOp = (EFI_IFR_DATE *) Statement->OpCode;
+ DateOp = (EFI_IFR_DATE *)Statement->OpCode;
HexDisplay = (DateOp->Flags & EFI_IFR_DISPLAY_UINT_HEX) == EFI_IFR_DISPLAY_UINT_HEX;
} else if (Statement->OpCode->OpCode == EFI_IFR_TIME_OP) {
- TimeOp = (EFI_IFR_TIME *) Statement->OpCode;
+ TimeOp = (EFI_IFR_TIME *)Statement->OpCode;
HexDisplay = (TimeOp->Flags & EFI_IFR_DISPLAY_UINT_HEX) == EFI_IFR_DISPLAY_UINT_HEX;
}
- switch (Statement->OpCode->OpCode) {
- case EFI_IFR_ORDERED_LIST_OP:
- case EFI_IFR_ONE_OF_OP:
- case EFI_IFR_NUMERIC_OP:
- case EFI_IFR_TIME_OP:
- case EFI_IFR_DATE_OP:
- if (!Selected) {
- PrintHotKeyHelpString (FormData, TRUE);
-
- if (gClassOfVfr == FORMSET_CLASS_PLATFORM_SETUP) {
- ColumnStr3 = gEscapeString;
- }
- PrintStringAtWithWidth (ThdCol, BottomRowOfHelp, ColumnStr3, ColumnWidth3);
- if ((Statement->OpCode->OpCode == EFI_IFR_DATE_OP) ||
- (Statement->OpCode->OpCode == EFI_IFR_TIME_OP)) {
- PrintAt (
- ColumnWidth1,
- StartColumnOfHelp,
- BottomRowOfHelp,
- L"%c%c%c%c%s",
- ARROW_UP,
- ARROW_DOWN,
- ARROW_RIGHT,
- ARROW_LEFT,
- gMoveHighlight
- );
- PrintStringAtWithWidth (SecCol, BottomRowOfHelp, gEnterString, ColumnWidth2);
- PrintStringAtWithWidth (StartColumnOfHelp, TopRowOfHelp, gAdjustNumber, ColumnWidth1);
- } else {
- PrintAt (ColumnWidth1, StartColumnOfHelp, BottomRowOfHelp, L"%c%c%s", ARROW_UP, ARROW_DOWN, gMoveHighlight);
- if (Statement->OpCode->OpCode == EFI_IFR_NUMERIC_OP && NumericOp != NULL && LibGetFieldFromNum(Statement->OpCode) != 0) {
- ColumnStr1 = gAdjustNumber;
+ switch (Statement->OpCode->OpCode) {
+ case EFI_IFR_ORDERED_LIST_OP:
+ case EFI_IFR_ONE_OF_OP:
+ case EFI_IFR_NUMERIC_OP:
+ case EFI_IFR_TIME_OP:
+ case EFI_IFR_DATE_OP:
+ if (!Selected) {
+ PrintHotKeyHelpString (FormData, TRUE);
+
+ if (gClassOfVfr == FORMSET_CLASS_PLATFORM_SETUP) {
+ ColumnStr3 = gEscapeString;
}
- PrintStringAtWithWidth (StartColumnOfHelp, TopRowOfHelp, ColumnStr1, ColumnWidth1);
- PrintStringAtWithWidth (SecCol, BottomRowOfHelp, gEnterString, ColumnWidth2);
- }
- } else {
- PrintHotKeyHelpString (FormData, FALSE);
- PrintStringAtWithWidth (SecCol, BottomRowOfHelp, gEnterCommitString, ColumnWidth2);
- //
- // If it is a selected numeric with manual input, display different message
- //
- if ((Statement->OpCode->OpCode == EFI_IFR_NUMERIC_OP) ||
- (Statement->OpCode->OpCode == EFI_IFR_DATE_OP) ||
- (Statement->OpCode->OpCode == EFI_IFR_TIME_OP)) {
- ColumnStr2 = HexDisplay ? gHexNumericInput : gDecNumericInput;
- PrintStringAtWithWidth (StartColumnOfHelp, BottomRowOfHelp, gLibEmptyString, ColumnWidth1);
+ PrintStringAtWithWidth (ThdCol, BottomRowOfHelp, ColumnStr3, ColumnWidth3);
+
+ if ((Statement->OpCode->OpCode == EFI_IFR_DATE_OP) ||
+ (Statement->OpCode->OpCode == EFI_IFR_TIME_OP))
+ {
+ PrintAt (
+ ColumnWidth1,
+ StartColumnOfHelp,
+ BottomRowOfHelp,
+ L"%c%c%c%c%s",
+ ARROW_UP,
+ ARROW_DOWN,
+ ARROW_RIGHT,
+ ARROW_LEFT,
+ gMoveHighlight
+ );
+ PrintStringAtWithWidth (SecCol, BottomRowOfHelp, gEnterString, ColumnWidth2);
+ PrintStringAtWithWidth (StartColumnOfHelp, TopRowOfHelp, gAdjustNumber, ColumnWidth1);
+ } else {
+ PrintAt (ColumnWidth1, StartColumnOfHelp, BottomRowOfHelp, L"%c%c%s", ARROW_UP, ARROW_DOWN, gMoveHighlight);
+ if ((Statement->OpCode->OpCode == EFI_IFR_NUMERIC_OP) && (NumericOp != NULL) && (LibGetFieldFromNum (Statement->OpCode) != 0)) {
+ ColumnStr1 = gAdjustNumber;
+ }
+
+ PrintStringAtWithWidth (StartColumnOfHelp, TopRowOfHelp, ColumnStr1, ColumnWidth1);
+ PrintStringAtWithWidth (SecCol, BottomRowOfHelp, gEnterString, ColumnWidth2);
+ }
} else {
- PrintAt (ColumnWidth1, StartColumnOfHelp, BottomRowOfHelp, L"%c%c%s", ARROW_UP, ARROW_DOWN, gMoveHighlight);
- }
+ PrintHotKeyHelpString (FormData, FALSE);
+ PrintStringAtWithWidth (SecCol, BottomRowOfHelp, gEnterCommitString, ColumnWidth2);
+
+ //
+ // If it is a selected numeric with manual input, display different message
+ //
+ if ((Statement->OpCode->OpCode == EFI_IFR_NUMERIC_OP) ||
+ (Statement->OpCode->OpCode == EFI_IFR_DATE_OP) ||
+ (Statement->OpCode->OpCode == EFI_IFR_TIME_OP))
+ {
+ ColumnStr2 = HexDisplay ? gHexNumericInput : gDecNumericInput;
+ PrintStringAtWithWidth (StartColumnOfHelp, BottomRowOfHelp, gLibEmptyString, ColumnWidth1);
+ } else {
+ PrintAt (ColumnWidth1, StartColumnOfHelp, BottomRowOfHelp, L"%c%c%s", ARROW_UP, ARROW_DOWN, gMoveHighlight);
+ }
- if (Statement->OpCode->OpCode == EFI_IFR_ORDERED_LIST_OP) {
- ColumnStr1 = gPlusString;
- ColumnStr3 = gMinusString;
- }
- PrintStringAtWithWidth (StartColumnOfHelp, TopRowOfHelp, ColumnStr1, ColumnWidth1);
- PrintStringAtWithWidth (ThdCol, TopRowOfHelp, ColumnStr3, ColumnWidth3);
- PrintStringAtWithWidth (SecCol, TopRowOfHelp, ColumnStr2, ColumnWidth2);
+ if (Statement->OpCode->OpCode == EFI_IFR_ORDERED_LIST_OP) {
+ ColumnStr1 = gPlusString;
+ ColumnStr3 = gMinusString;
+ }
- PrintStringAtWithWidth (ThdCol, BottomRowOfHelp, gEnterEscapeString, ColumnWidth3);
- }
- break;
+ PrintStringAtWithWidth (StartColumnOfHelp, TopRowOfHelp, ColumnStr1, ColumnWidth1);
+ PrintStringAtWithWidth (ThdCol, TopRowOfHelp, ColumnStr3, ColumnWidth3);
+ PrintStringAtWithWidth (SecCol, TopRowOfHelp, ColumnStr2, ColumnWidth2);
- case EFI_IFR_CHECKBOX_OP:
- PrintHotKeyHelpString (FormData, TRUE);
+ PrintStringAtWithWidth (ThdCol, BottomRowOfHelp, gEnterEscapeString, ColumnWidth3);
+ }
- if (gClassOfVfr == FORMSET_CLASS_PLATFORM_SETUP) {
- ColumnStr3 = gEscapeString;
- }
- PrintStringAtWithWidth (ThdCol, BottomRowOfHelp, ColumnStr3, ColumnWidth3);
+ break;
- PrintAt (ColumnWidth1, StartColumnOfHelp, BottomRowOfHelp, L"%c%c%s", ARROW_UP, ARROW_DOWN, gMoveHighlight);
- PrintStringAtWithWidth (SecCol, BottomRowOfHelp, gToggleCheckBox, ColumnWidth2);
- PrintStringAtWithWidth (StartColumnOfHelp, TopRowOfHelp, gLibEmptyString, ColumnWidth1);
- break;
-
- case EFI_IFR_REF_OP:
- case EFI_IFR_PASSWORD_OP:
- case EFI_IFR_STRING_OP:
- case EFI_IFR_TEXT_OP:
- case EFI_IFR_ACTION_OP:
- case EFI_IFR_RESET_BUTTON_OP:
- case EFI_IFR_SUBTITLE_OP:
- if (!Selected) {
+ case EFI_IFR_CHECKBOX_OP:
PrintHotKeyHelpString (FormData, TRUE);
if (gClassOfVfr == FORMSET_CLASS_PLATFORM_SETUP) {
ColumnStr3 = gEscapeString;
}
+
PrintStringAtWithWidth (ThdCol, BottomRowOfHelp, ColumnStr3, ColumnWidth3);
PrintAt (ColumnWidth1, StartColumnOfHelp, BottomRowOfHelp, L"%c%c%s", ARROW_UP, ARROW_DOWN, gMoveHighlight);
- if (Statement->OpCode->OpCode != EFI_IFR_TEXT_OP && Statement->OpCode->OpCode != EFI_IFR_SUBTITLE_OP) {
- ColumnStr2 = gEnterString;
- }
- PrintStringAtWithWidth (SecCol, BottomRowOfHelp, ColumnStr2, ColumnWidth2);
- PrintStringAtWithWidth (StartColumnOfHelp, TopRowOfHelp, ColumnStr1, ColumnWidth1);
- } else {
- PrintHotKeyHelpString (FormData, FALSE);
- if (Statement->OpCode->OpCode != EFI_IFR_REF_OP) {
- ColumnStr2 = gEnterCommitString;
- ColumnStr3 = gEnterEscapeString;
+ PrintStringAtWithWidth (SecCol, BottomRowOfHelp, gToggleCheckBox, ColumnWidth2);
+ PrintStringAtWithWidth (StartColumnOfHelp, TopRowOfHelp, gLibEmptyString, ColumnWidth1);
+ break;
+
+ case EFI_IFR_REF_OP:
+ case EFI_IFR_PASSWORD_OP:
+ case EFI_IFR_STRING_OP:
+ case EFI_IFR_TEXT_OP:
+ case EFI_IFR_ACTION_OP:
+ case EFI_IFR_RESET_BUTTON_OP:
+ case EFI_IFR_SUBTITLE_OP:
+ if (!Selected) {
+ PrintHotKeyHelpString (FormData, TRUE);
+
+ if (gClassOfVfr == FORMSET_CLASS_PLATFORM_SETUP) {
+ ColumnStr3 = gEscapeString;
+ }
+
+ PrintStringAtWithWidth (ThdCol, BottomRowOfHelp, ColumnStr3, ColumnWidth3);
+
+ PrintAt (ColumnWidth1, StartColumnOfHelp, BottomRowOfHelp, L"%c%c%s", ARROW_UP, ARROW_DOWN, gMoveHighlight);
+ if ((Statement->OpCode->OpCode != EFI_IFR_TEXT_OP) && (Statement->OpCode->OpCode != EFI_IFR_SUBTITLE_OP)) {
+ ColumnStr2 = gEnterString;
+ }
+
+ PrintStringAtWithWidth (SecCol, BottomRowOfHelp, ColumnStr2, ColumnWidth2);
+ PrintStringAtWithWidth (StartColumnOfHelp, TopRowOfHelp, ColumnStr1, ColumnWidth1);
+ } else {
+ PrintHotKeyHelpString (FormData, FALSE);
+ if (Statement->OpCode->OpCode != EFI_IFR_REF_OP) {
+ ColumnStr2 = gEnterCommitString;
+ ColumnStr3 = gEnterEscapeString;
+ }
+
+ PrintStringAtWithWidth (StartColumnOfHelp, TopRowOfHelp, ColumnStr1, ColumnWidth1);
+ PrintStringAtWithWidth (StartColumnOfHelp, BottomRowOfHelp, ColumnStr1, ColumnWidth1);
+ PrintStringAtWithWidth (SecCol, BottomRowOfHelp, ColumnStr2, ColumnWidth2);
+ PrintStringAtWithWidth (ThdCol, BottomRowOfHelp, ColumnStr3, ColumnWidth3);
}
- PrintStringAtWithWidth (StartColumnOfHelp, TopRowOfHelp, ColumnStr1, ColumnWidth1);
- PrintStringAtWithWidth (StartColumnOfHelp, BottomRowOfHelp, ColumnStr1, ColumnWidth1);
- PrintStringAtWithWidth (SecCol, BottomRowOfHelp, ColumnStr2, ColumnWidth2);
- PrintStringAtWithWidth (ThdCol, BottomRowOfHelp, ColumnStr3, ColumnWidth3);
- }
- break;
- default:
- break;
+ break;
+
+ default:
+ break;
}
}
@@ -338,57 +354,59 @@ RefreshKeyHelp ( VOID
EFIAPI
UpdateStatusBar (
- IN UINTN MessageType,
- IN BOOLEAN State
+ IN UINTN MessageType,
+ IN BOOLEAN State
)
{
- UINTN Index;
- CHAR16 OptionWidth;
+ UINTN Index;
+ CHAR16 OptionWidth;
- OptionWidth = (CHAR16) ((gScreenDimensions.RightColumn - gScreenDimensions.LeftColumn) / 3);
+ OptionWidth = (CHAR16)((gScreenDimensions.RightColumn - gScreenDimensions.LeftColumn) / 3);
switch (MessageType) {
- case INPUT_ERROR:
- if (State) {
- gST->ConOut->SetAttribute (gST->ConOut, ERROR_TEXT);
- PrintStringAt (
- gScreenDimensions.LeftColumn + OptionWidth,
- gScreenDimensions.BottomRow - 1,
- gInputErrorMessage
- );
- } else {
- gST->ConOut->SetAttribute (gST->ConOut, KEYHELP_BACKGROUND);
- for (Index = 0; Index < (LibGetStringWidth (gInputErrorMessage) - 2) / 2; Index++) {
- PrintStringAt (gScreenDimensions.LeftColumn + OptionWidth + Index, gScreenDimensions.BottomRow - 1, L" ");
+ case INPUT_ERROR:
+ if (State) {
+ gST->ConOut->SetAttribute (gST->ConOut, ERROR_TEXT);
+ PrintStringAt (
+ gScreenDimensions.LeftColumn + OptionWidth,
+ gScreenDimensions.BottomRow - 1,
+ gInputErrorMessage
+ );
+ } else {
+ gST->ConOut->SetAttribute (gST->ConOut, KEYHELP_BACKGROUND);
+ for (Index = 0; Index < (LibGetStringWidth (gInputErrorMessage) - 2) / 2; Index++) {
+ PrintStringAt (gScreenDimensions.LeftColumn + OptionWidth + Index, gScreenDimensions.BottomRow - 1, L" ");
+ }
}
- }
- break;
- case NV_UPDATE_REQUIRED:
- //
- // Global setting support. Show configuration change on every form.
- //
- if (State) {
- gST->ConOut->SetAttribute (gST->ConOut, INFO_TEXT);
- PrintStringAt (
- gScreenDimensions.LeftColumn + OptionWidth * 2,
- gScreenDimensions.BottomRow - 1,
- gNvUpdateMessage
- );
- } else {
- gST->ConOut->SetAttribute (gST->ConOut, KEYHELP_BACKGROUND);
- for (Index = 0; Index < (LibGetStringWidth (gNvUpdateMessage) - 2) / 2; Index++) {
+ break;
+
+ case NV_UPDATE_REQUIRED:
+ //
+ // Global setting support. Show configuration change on every form.
+ //
+ if (State) {
+ gST->ConOut->SetAttribute (gST->ConOut, INFO_TEXT);
PrintStringAt (
- (gScreenDimensions.LeftColumn + OptionWidth * 2 + Index),
+ gScreenDimensions.LeftColumn + OptionWidth * 2,
gScreenDimensions.BottomRow - 1,
- L" "
+ gNvUpdateMessage
);
+ } else {
+ gST->ConOut->SetAttribute (gST->ConOut, KEYHELP_BACKGROUND);
+ for (Index = 0; Index < (LibGetStringWidth (gNvUpdateMessage) - 2) / 2; Index++) {
+ PrintStringAt (
+ (gScreenDimensions.LeftColumn + OptionWidth * 2 + Index),
+ gScreenDimensions.BottomRow - 1,
+ L" "
+ );
+ }
}
- }
- break;
- default:
- break;
+ break;
+
+ default:
+ break;
}
}
@@ -408,28 +426,28 @@ CreateDialog ( ...
)
{
- VA_LIST Marker;
- EFI_INPUT_KEY KeyValue;
- EFI_STATUS Status;
- UINTN LargestString;
- UINTN LineNum;
- UINTN Index;
- UINTN Count;
- CHAR16 Character;
- UINTN Start;
- UINTN End;
- UINTN Top;
- UINTN Bottom;
- CHAR16 *String;
- UINTN DimensionsWidth;
- UINTN DimensionsHeight;
- UINTN CurrentAttribute;
- BOOLEAN CursorVisible;
+ VA_LIST Marker;
+ EFI_INPUT_KEY KeyValue;
+ EFI_STATUS Status;
+ UINTN LargestString;
+ UINTN LineNum;
+ UINTN Index;
+ UINTN Count;
+ CHAR16 Character;
+ UINTN Start;
+ UINTN End;
+ UINTN Top;
+ UINTN Bottom;
+ CHAR16 *String;
+ UINTN DimensionsWidth;
+ UINTN DimensionsHeight;
+ UINTN CurrentAttribute;
+ BOOLEAN CursorVisible;
//
// If screen dimension info is not ready, get it from console.
//
- if (gScreenDimensions.RightColumn == 0 || gScreenDimensions.BottomRow == 0) {
+ if ((gScreenDimensions.RightColumn == 0) || (gScreenDimensions.BottomRow == 0)) {
ZeroMem (&gScreenDimensions, sizeof (EFI_SCREEN_DESCRIPTOR));
gST->ConOut->QueryMode (
gST->ConOut,
@@ -439,27 +457,28 @@ CreateDialog ( );
}
- DimensionsWidth = gScreenDimensions.RightColumn - gScreenDimensions.LeftColumn;
- DimensionsHeight = gScreenDimensions.BottomRow - gScreenDimensions.TopRow;
+ DimensionsWidth = gScreenDimensions.RightColumn - gScreenDimensions.LeftColumn;
+ DimensionsHeight = gScreenDimensions.BottomRow - gScreenDimensions.TopRow;
LargestString = 0;
LineNum = 0;
VA_START (Marker, Key);
- while ((String = VA_ARG (Marker, CHAR16 *)) != NULL) {
- LineNum ++;
+ while ((String = VA_ARG (Marker, CHAR16 *)) != NULL) {
+ LineNum++;
if ((LibGetStringWidth (String) / 2) > LargestString) {
LargestString = (LibGetStringWidth (String) / 2);
}
}
+
VA_END (Marker);
if ((LargestString + 2) > DimensionsWidth) {
LargestString = DimensionsWidth - 2;
}
- CurrentAttribute = gST->ConOut->Mode->Attribute;
- CursorVisible = gST->ConOut->Mode->CursorVisible;
+ CurrentAttribute = gST->ConOut->Mode->Attribute;
+ CursorVisible = gST->ConOut->Mode->CursorVisible;
gST->ConOut->EnableCursor (gST->ConOut, FALSE);
gST->ConOut->SetAttribute (gST->ConOut, GetPopupColor ());
@@ -467,11 +486,11 @@ CreateDialog ( // Subtract the PopUp width from total Columns, allow for one space extra on
// each end plus a border.
//
- Start = (DimensionsWidth - LargestString - 2) / 2 + gScreenDimensions.LeftColumn + 1;
- End = Start + LargestString + 1;
+ Start = (DimensionsWidth - LargestString - 2) / 2 + gScreenDimensions.LeftColumn + 1;
+ End = Start + LargestString + 1;
- Top = ((DimensionsHeight - LineNum - 2) / 2) + gScreenDimensions.TopRow - 1;
- Bottom = Top + LineNum + 2;
+ Top = ((DimensionsHeight - LineNum - 2) / 2) + gScreenDimensions.TopRow - 1;
+ Bottom = Top + LineNum + 2;
Character = BOXDRAW_DOWN_RIGHT;
PrintCharAt (Start, Top, Character);
@@ -487,7 +506,7 @@ CreateDialog ( Count = 0;
VA_START (Marker, Key);
for (Index = Top; Index + 2 < Bottom; Index++, Count++) {
- String = VA_ARG (Marker, CHAR16*);
+ String = VA_ARG (Marker, CHAR16 *);
if (String[0] == CHAR_NULL) {
//
@@ -522,17 +541,18 @@ CreateDialog ( PrintCharAt (Start, Index + 1, Character);
PrintCharAt (End - 1, Index + 1, Character);
}
+
VA_END (Marker);
Character = BOXDRAW_UP_RIGHT;
PrintCharAt (Start, Bottom - 1, Character);
Character = BOXDRAW_HORIZONTAL;
for (Index = Start; Index + 2 < End; Index++) {
- PrintCharAt ((UINTN)-1, (UINTN) -1, Character);
+ PrintCharAt ((UINTN)-1, (UINTN)-1, Character);
}
Character = BOXDRAW_UP_LEFT;
- PrintCharAt ((UINTN)-1, (UINTN) -1, Character);
+ PrintCharAt ((UINTN)-1, (UINTN)-1, Character);
if (Key != NULL) {
Status = WaitForKeyStroke (&KeyValue);
@@ -555,9 +575,9 @@ ConfirmDataChange ( VOID
)
{
- CHAR16 YesResponse;
- CHAR16 NoResponse;
- EFI_INPUT_KEY Key;
+ CHAR16 YesResponse;
+ CHAR16 NoResponse;
+ EFI_INPUT_KEY Key;
gST->ConIn->ReadKeyStroke (gST->ConIn, &Key);
@@ -571,9 +591,9 @@ ConfirmDataChange ( CreateDialog (&Key, gLibEmptyString, gSaveChanges, gAreYouSure, gLibEmptyString, NULL);
} while
(
- (Key.ScanCode != SCAN_ESC) &&
- ((Key.UnicodeChar | UPPER_LOWER_CASE_OFFSET) != (NoResponse | UPPER_LOWER_CASE_OFFSET)) &&
- ((Key.UnicodeChar | UPPER_LOWER_CASE_OFFSET) != (YesResponse | UPPER_LOWER_CASE_OFFSET))
+ (Key.ScanCode != SCAN_ESC) &&
+ ((Key.UnicodeChar | UPPER_LOWER_CASE_OFFSET) != (NoResponse | UPPER_LOWER_CASE_OFFSET)) &&
+ ((Key.UnicodeChar | UPPER_LOWER_CASE_OFFSET) != (YesResponse | UPPER_LOWER_CASE_OFFSET))
);
if (Key.ScanCode == SCAN_ESC) {
@@ -617,14 +637,16 @@ FormExitPolicy ( UINT64
EFIAPI
FormExitTimeout (
- IN FORM_DISPLAY_ENGINE_FORM *FormData
+ IN FORM_DISPLAY_ENGINE_FORM *FormData
)
{
return 0;
}
+
//
// Print Functions
//
+
/**
Prints a unicode string to the default console, at
the supplied cursor position, using L"%s" format.
@@ -639,9 +661,9 @@ FormExitTimeout ( UINTN
EFIAPI
PrintStringAt (
- IN UINTN Column,
- IN UINTN Row,
- IN CHAR16 *String
+ IN UINTN Column,
+ IN UINTN Row,
+ IN CHAR16 *String
)
{
return PrintAt (0, Column, Row, L"%s", String);
@@ -662,10 +684,10 @@ PrintStringAt ( UINTN
EFIAPI
PrintStringAtWithWidth (
- IN UINTN Column,
- IN UINTN Row,
- IN CHAR16 *String,
- IN UINTN Width
+ IN UINTN Column,
+ IN UINTN Row,
+ IN CHAR16 *String,
+ IN UINTN Width
)
{
return PrintAt (Width, Column, Row, L"%s", String);
@@ -685,9 +707,9 @@ PrintStringAtWithWidth ( UINTN
EFIAPI
PrintCharAt (
- IN UINTN Column,
- IN UINTN Row,
- CHAR16 Character
+ IN UINTN Column,
+ IN UINTN Row,
+ CHAR16 Character
)
{
return PrintAt (0, Column, Row, L"%c", Character);
@@ -706,11 +728,11 @@ PrintCharAt ( VOID
EFIAPI
ClearLines (
- IN UINTN LeftColumn,
- IN UINTN RightColumn,
- IN UINTN TopRow,
- IN UINTN BottomRow,
- IN UINTN TextAttribute
+ IN UINTN LeftColumn,
+ IN UINTN RightColumn,
+ IN UINTN TopRow,
+ IN UINTN BottomRow,
+ IN UINTN TextAttribute
)
{
CHAR16 *Buffer;
@@ -914,14 +936,14 @@ ClearDisplayPage ( EFI_STATUS
EFIAPI
CustomizedDisplayLibConstructor (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
+ IN EFI_HANDLE ImageHandle,
+ IN EFI_SYSTEM_TABLE *SystemTable
)
{
mCDLStringPackHandle = HiiAddPackages (&gCustomizedDisplayLibGuid, ImageHandle, CustomizedDisplayLibStrings, NULL);
ASSERT (mCDLStringPackHandle != NULL);
- InitializeLibStrings();
+ InitializeLibStrings ();
return EFI_SUCCESS;
}
@@ -943,7 +965,7 @@ CustomizedDisplayLibDestructor ( IN EFI_SYSTEM_TABLE *SystemTable
)
{
- HiiRemovePackages(mCDLStringPackHandle);
+ HiiRemovePackages (mCDLStringPackHandle);
FreeLibStrings ();
diff --git a/MdeModulePkg/Library/CustomizedDisplayLib/CustomizedDisplayLibInternal.c b/MdeModulePkg/Library/CustomizedDisplayLib/CustomizedDisplayLibInternal.c index d770a0f873..58130d9383 100644 --- a/MdeModulePkg/Library/CustomizedDisplayLib/CustomizedDisplayLibInternal.c +++ b/MdeModulePkg/Library/CustomizedDisplayLib/CustomizedDisplayLibInternal.c @@ -8,33 +8,33 @@ SPDX-License-Identifier: BSD-2-Clause-Patent **/
#include "CustomizedDisplayLibInternal.h"
-EFI_SCREEN_DESCRIPTOR gScreenDimensions;
-CHAR16 *mLibUnknownString;
-extern EFI_HII_HANDLE mCDLStringPackHandle;
-CHAR16 *mSpaceBuffer;
-#define SPACE_BUFFER_SIZE 1000
+EFI_SCREEN_DESCRIPTOR gScreenDimensions;
+CHAR16 *mLibUnknownString;
+extern EFI_HII_HANDLE mCDLStringPackHandle;
+CHAR16 *mSpaceBuffer;
+#define SPACE_BUFFER_SIZE 1000
//
// Browser Global Strings
//
-CHAR16 *gEnterString;
-CHAR16 *gEnterCommitString;
-CHAR16 *gEnterEscapeString;
-CHAR16 *gEscapeString;
-CHAR16 *gMoveHighlight;
-CHAR16 *gDecNumericInput;
-CHAR16 *gHexNumericInput;
-CHAR16 *gToggleCheckBox;
-CHAR16 *gLibEmptyString;
-CHAR16 *gAreYouSure;
-CHAR16 *gYesResponse;
-CHAR16 *gNoResponse;
-CHAR16 *gPlusString;
-CHAR16 *gMinusString;
-CHAR16 *gAdjustNumber;
-CHAR16 *gSaveChanges;
-CHAR16 *gNvUpdateMessage;
-CHAR16 *gInputErrorMessage;
+CHAR16 *gEnterString;
+CHAR16 *gEnterCommitString;
+CHAR16 *gEnterEscapeString;
+CHAR16 *gEscapeString;
+CHAR16 *gMoveHighlight;
+CHAR16 *gDecNumericInput;
+CHAR16 *gHexNumericInput;
+CHAR16 *gToggleCheckBox;
+CHAR16 *gLibEmptyString;
+CHAR16 *gAreYouSure;
+CHAR16 *gYesResponse;
+CHAR16 *gNoResponse;
+CHAR16 *gPlusString;
+CHAR16 *gMinusString;
+CHAR16 *gAdjustNumber;
+CHAR16 *gSaveChanges;
+CHAR16 *gNvUpdateMessage;
+CHAR16 *gInputErrorMessage;
/**
@@ -45,14 +45,14 @@ CHAR16 *gInputErrorMessage; **/
VOID
PrintBannerInfo (
- IN FORM_DISPLAY_ENGINE_FORM *FormData
+ IN FORM_DISPLAY_ENGINE_FORM *FormData
)
{
- UINT8 Line;
- UINT8 Alignment;
- CHAR16 *StrFrontPageBanner;
- UINT8 RowIdx;
- UINT8 ColumnIdx;
+ UINT8 Line;
+ UINT8 Alignment;
+ CHAR16 *StrFrontPageBanner;
+ UINT8 RowIdx;
+ UINT8 ColumnIdx;
//
// ClearLines(0, LocalScreen.RightColumn, 0, BANNER_HEIGHT-1, BANNER_TEXT | BANNER_BACKGROUND);
@@ -68,54 +68,55 @@ PrintBannerInfo ( //
// for (Line = 0; Line < BANNER_HEIGHT; Line++) {
//
- for (Line = (UINT8) gScreenDimensions.TopRow; Line < BANNER_HEIGHT + (UINT8) gScreenDimensions.TopRow; Line++) {
+ for (Line = (UINT8)gScreenDimensions.TopRow; Line < BANNER_HEIGHT + (UINT8)gScreenDimensions.TopRow; Line++) {
//
// for (Alignment = 0; Alignment < BANNER_COLUMNS; Alignment++) {
//
- for (Alignment = (UINT8) gScreenDimensions.LeftColumn;
- Alignment < BANNER_COLUMNS + (UINT8) gScreenDimensions.LeftColumn;
+ for (Alignment = (UINT8)gScreenDimensions.LeftColumn;
+ Alignment < BANNER_COLUMNS + (UINT8)gScreenDimensions.LeftColumn;
Alignment++
- ) {
- RowIdx = (UINT8) (Line - (UINT8) gScreenDimensions.TopRow);
- ColumnIdx = (UINT8) (Alignment - (UINT8) gScreenDimensions.LeftColumn);
+ )
+ {
+ RowIdx = (UINT8)(Line - (UINT8)gScreenDimensions.TopRow);
+ ColumnIdx = (UINT8)(Alignment - (UINT8)gScreenDimensions.LeftColumn);
ASSERT (RowIdx < BANNER_HEIGHT && ColumnIdx < BANNER_COLUMNS);
- if (gBannerData!= NULL && gBannerData->Banner[RowIdx][ColumnIdx] != 0x0000) {
+ if ((gBannerData != NULL) && (gBannerData->Banner[RowIdx][ColumnIdx] != 0x0000)) {
StrFrontPageBanner = LibGetToken (gBannerData->Banner[RowIdx][ColumnIdx], FormData->HiiHandle);
} else {
continue;
}
switch (Alignment - gScreenDimensions.LeftColumn) {
- case 0:
- //
- // Handle left column
- //
- PrintStringAt (gScreenDimensions.LeftColumn + BANNER_LEFT_COLUMN_INDENT, Line, StrFrontPageBanner);
- break;
+ case 0:
+ //
+ // Handle left column
+ //
+ PrintStringAt (gScreenDimensions.LeftColumn + BANNER_LEFT_COLUMN_INDENT, Line, StrFrontPageBanner);
+ break;
- case 1:
- //
- // Handle center column
- //
- PrintStringAt (
- gScreenDimensions.LeftColumn + (gScreenDimensions.RightColumn - gScreenDimensions.LeftColumn) / 3,
- Line,
- StrFrontPageBanner
- );
- break;
-
- case 2:
- //
- // Handle right column
- //
- PrintStringAt (
- gScreenDimensions.LeftColumn + (gScreenDimensions.RightColumn - gScreenDimensions.LeftColumn) * 2 / 3,
- Line,
- StrFrontPageBanner
- );
- break;
+ case 1:
+ //
+ // Handle center column
+ //
+ PrintStringAt (
+ gScreenDimensions.LeftColumn + (gScreenDimensions.RightColumn - gScreenDimensions.LeftColumn) / 3,
+ Line,
+ StrFrontPageBanner
+ );
+ break;
+
+ case 2:
+ //
+ // Handle right column
+ //
+ PrintStringAt (
+ gScreenDimensions.LeftColumn + (gScreenDimensions.RightColumn - gScreenDimensions.LeftColumn) * 2 / 3,
+ Line,
+ StrFrontPageBanner
+ );
+ break;
}
FreePool (StrFrontPageBanner);
@@ -130,15 +131,15 @@ PrintBannerInfo ( **/
VOID
PrintFramework (
- IN FORM_DISPLAY_ENGINE_FORM *FormData
+ IN FORM_DISPLAY_ENGINE_FORM *FormData
)
{
- UINTN Index;
- CHAR16 Character;
- CHAR16 *Buffer;
- UINTN Row;
- CHAR16 *TitleStr;
- UINTN TitleColumn;
+ UINTN Index;
+ CHAR16 Character;
+ CHAR16 *Buffer;
+ UINTN Row;
+ CHAR16 *TitleStr;
+ UINTN TitleColumn;
if (gClassOfVfr != FORMSET_CLASS_PLATFORM_SETUP) {
//
@@ -171,10 +172,10 @@ PrintFramework ( Character = BOXDRAW_DOWN_RIGHT;
PrintCharAt (gScreenDimensions.LeftColumn, gScreenDimensions.TopRow, Character);
- PrintStringAt ((UINTN) -1, (UINTN) -1, Buffer);
+ PrintStringAt ((UINTN)-1, (UINTN)-1, Buffer);
Character = BOXDRAW_DOWN_LEFT;
- PrintCharAt ((UINTN) -1, (UINTN) -1, Character);
+ PrintCharAt ((UINTN)-1, (UINTN)-1, Character);
Character = BOXDRAW_VERTICAL;
for (Row = gScreenDimensions.TopRow + 1; Row <= gScreenDimensions.TopRow + NONE_FRONT_PAGE_HEADER_HEIGHT - 2; Row++) {
@@ -199,10 +200,10 @@ PrintFramework ( Character = BOXDRAW_UP_RIGHT;
PrintCharAt (gScreenDimensions.LeftColumn, gScreenDimensions.TopRow + NONE_FRONT_PAGE_HEADER_HEIGHT - 1, Character);
- PrintStringAt ((UINTN) -1, (UINTN) -1, Buffer);
+ PrintStringAt ((UINTN)-1, (UINTN)-1, Buffer);
Character = BOXDRAW_UP_LEFT;
- PrintCharAt ((UINTN) -1, (UINTN) -1, Character);
+ PrintCharAt ((UINTN)-1, (UINTN)-1, Character);
//
// Print Bottom border line
@@ -213,15 +214,16 @@ PrintFramework ( Character = BOXDRAW_DOWN_RIGHT;
PrintCharAt (gScreenDimensions.LeftColumn, gScreenDimensions.BottomRow - STATUS_BAR_HEIGHT - gFooterHeight, Character);
- PrintStringAt ((UINTN) -1, (UINTN) -1, Buffer);
+ PrintStringAt ((UINTN)-1, (UINTN)-1, Buffer);
Character = BOXDRAW_DOWN_LEFT;
- PrintCharAt ((UINTN) -1, (UINTN) -1, Character);
+ 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);
}
@@ -229,10 +231,10 @@ PrintFramework ( Character = BOXDRAW_UP_RIGHT;
PrintCharAt (gScreenDimensions.LeftColumn, gScreenDimensions.BottomRow - STATUS_BAR_HEIGHT - 1, Character);
- PrintStringAt ((UINTN) -1, (UINTN) -1, Buffer);
+ PrintStringAt ((UINTN)-1, (UINTN)-1, Buffer);
Character = BOXDRAW_UP_LEFT;
- PrintCharAt ((UINTN) -1, (UINTN) -1, Character);
+ PrintCharAt ((UINTN)-1, (UINTN)-1, Character);
FreePool (Buffer);
}
@@ -246,12 +248,12 @@ PrintFramework ( **/
VOID
-ProcessUserOpcode(
- IN EFI_IFR_OP_HEADER *OpCodeData
+ProcessUserOpcode (
+ IN EFI_IFR_OP_HEADER *OpCodeData
)
{
- EFI_GUID * ClassGuid;
- UINT8 ClassGuidNum;
+ EFI_GUID *ClassGuid;
+ UINT8 ClassGuidNum;
ClassGuid = NULL;
ClassGuidNum = 0;
@@ -261,65 +263,70 @@ ProcessUserOpcode( //
// process the statement outside of form,if it is formset op, get its formsetguid or classguid and compared with gFrontPageFormSetGuid
//
- if (CompareMem (PcdGetPtr (PcdFrontPageFormSetGuid), &((EFI_IFR_FORM_SET *) OpCodeData)->Guid, sizeof (EFI_GUID)) == 0){
+ if (CompareMem (PcdGetPtr (PcdFrontPageFormSetGuid), &((EFI_IFR_FORM_SET *)OpCodeData)->Guid, sizeof (EFI_GUID)) == 0) {
gClassOfVfr = FORMSET_CLASS_FRONT_PAGE;
- } else{
+ } else {
ClassGuidNum = (UINT8)(((EFI_IFR_FORM_SET *)OpCodeData)->Flags & 0x3);
ClassGuid = (EFI_GUID *)(VOID *)((UINT8 *)OpCodeData + sizeof (EFI_IFR_FORM_SET));
- while (ClassGuidNum-- > 0){
- if (CompareGuid((EFI_GUID*)PcdGetPtr (PcdFrontPageFormSetGuid),ClassGuid)){
+ while (ClassGuidNum-- > 0) {
+ if (CompareGuid ((EFI_GUID *)PcdGetPtr (PcdFrontPageFormSetGuid), ClassGuid)) {
gClassOfVfr = FORMSET_CLASS_FRONT_PAGE;
break;
}
- ClassGuid ++;
+
+ ClassGuid++;
}
}
+
break;
case EFI_IFR_GUID_OP:
- if (CompareGuid (&gEfiIfrTianoGuid, (EFI_GUID *)((CHAR8*) OpCodeData + sizeof (EFI_IFR_OP_HEADER)))) {
+ if (CompareGuid (&gEfiIfrTianoGuid, (EFI_GUID *)((CHAR8 *)OpCodeData + sizeof (EFI_IFR_OP_HEADER)))) {
//
// Tiano specific GUIDed opcodes
//
- switch (((EFI_IFR_GUID_LABEL *) OpCodeData)->ExtendOpCode) {
- case EFI_IFR_EXTEND_OP_LABEL:
- //
- // just ignore label
- //
- break;
+ switch (((EFI_IFR_GUID_LABEL *)OpCodeData)->ExtendOpCode) {
+ case EFI_IFR_EXTEND_OP_LABEL:
+ //
+ // just ignore label
+ //
+ break;
- case EFI_IFR_EXTEND_OP_BANNER:
- //
- // Only in front page form set, we care about the banner data.
- //
- if (gClassOfVfr == FORMSET_CLASS_FRONT_PAGE) {
+ case EFI_IFR_EXTEND_OP_BANNER:
//
- // Initialize Driver private data
+ // Only in front page form set, we care about the banner data.
//
- if (gBannerData == NULL) {
- gBannerData = AllocateZeroPool (sizeof (BANNER_DATA));
- ASSERT (gBannerData != NULL);
+ if (gClassOfVfr == FORMSET_CLASS_FRONT_PAGE) {
+ //
+ // Initialize Driver private data
+ //
+ if (gBannerData == NULL) {
+ gBannerData = AllocateZeroPool (sizeof (BANNER_DATA));
+ ASSERT (gBannerData != NULL);
+ }
+
+ CopyMem (
+ &gBannerData->Banner[((EFI_IFR_GUID_BANNER *)OpCodeData)->LineNumber][
+ ((EFI_IFR_GUID_BANNER *)OpCodeData)->Alignment],
+ &((EFI_IFR_GUID_BANNER *)OpCodeData)->Title,
+ sizeof (EFI_STRING_ID)
+ );
}
- CopyMem (
- &gBannerData->Banner[((EFI_IFR_GUID_BANNER *) OpCodeData)->LineNumber][
- ((EFI_IFR_GUID_BANNER *) OpCodeData)->Alignment],
- &((EFI_IFR_GUID_BANNER *) OpCodeData)->Title,
- sizeof (EFI_STRING_ID)
- );
- }
- break;
+ break;
- case EFI_IFR_EXTEND_OP_SUBCLASS:
- if (((EFI_IFR_GUID_SUBCLASS *) OpCodeData)->SubClass == EFI_FRONT_PAGE_SUBCLASS) {
- gClassOfVfr = FORMSET_CLASS_FRONT_PAGE;
- }
- break;
+ case EFI_IFR_EXTEND_OP_SUBCLASS:
+ if (((EFI_IFR_GUID_SUBCLASS *)OpCodeData)->SubClass == EFI_FRONT_PAGE_SUBCLASS) {
+ gClassOfVfr = FORMSET_CLASS_FRONT_PAGE;
+ }
- default:
- break;
+ break;
+
+ default:
+ break;
}
}
+
break;
default:
@@ -337,37 +344,36 @@ ProcessUserOpcode( **/
VOID
ProcessExternedOpcode (
- IN FORM_DISPLAY_ENGINE_FORM *FormData
+ IN FORM_DISPLAY_ENGINE_FORM *FormData
)
{
- LIST_ENTRY *Link;
- LIST_ENTRY *NestLink;
- FORM_DISPLAY_ENGINE_STATEMENT *Statement;
- FORM_DISPLAY_ENGINE_STATEMENT *NestStatement;
+ LIST_ENTRY *Link;
+ LIST_ENTRY *NestLink;
+ FORM_DISPLAY_ENGINE_STATEMENT *Statement;
+ FORM_DISPLAY_ENGINE_STATEMENT *NestStatement;
Link = GetFirstNode (&FormData->StatementListOSF);
while (!IsNull (&FormData->StatementListOSF, Link)) {
Statement = FORM_DISPLAY_ENGINE_STATEMENT_FROM_LINK (Link);
- Link = GetNextNode (&FormData->StatementListOSF, Link);
+ Link = GetNextNode (&FormData->StatementListOSF, Link);
- ProcessUserOpcode(Statement->OpCode);
+ ProcessUserOpcode (Statement->OpCode);
}
Link = GetFirstNode (&FormData->StatementListHead);
while (!IsNull (&FormData->StatementListHead, Link)) {
Statement = FORM_DISPLAY_ENGINE_STATEMENT_FROM_LINK (Link);
- Link = GetNextNode (&FormData->StatementListHead, Link);
+ Link = GetNextNode (&FormData->StatementListHead, Link);
- ProcessUserOpcode(Statement->OpCode);
+ ProcessUserOpcode (Statement->OpCode);
NestLink = GetFirstNode (&Statement->NestStatementList);
while (!IsNull (&Statement->NestStatementList, NestLink)) {
NestStatement = FORM_DISPLAY_ENGINE_STATEMENT_FROM_LINK (NestLink);
- NestLink = GetNextNode (&Statement->NestStatementList, NestLink);
+ NestLink = GetNextNode (&Statement->NestStatementList, NestLink);
- ProcessUserOpcode(NestStatement->OpCode);
+ ProcessUserOpcode (NestStatement->OpCode);
}
-
}
}
@@ -382,21 +388,21 @@ ProcessExternedOpcode ( **/
EFI_STATUS
ScreenDiemensionInfoValidate (
- IN FORM_DISPLAY_ENGINE_FORM *FormData
+ IN FORM_DISPLAY_ENGINE_FORM *FormData
)
{
- LIST_ENTRY *Link;
- UINTN Index;
+ LIST_ENTRY *Link;
+ UINTN Index;
//
// Calculate total number of Register HotKeys.
//
Index = 0;
- if (!IsListEmpty (&FormData->HotKeyListHead)){
- Link = GetFirstNode (&FormData->HotKeyListHead);
+ if (!IsListEmpty (&FormData->HotKeyListHead)) {
+ Link = GetFirstNode (&FormData->HotKeyListHead);
while (!IsNull (&FormData->HotKeyListHead, Link)) {
Link = GetNextNode (&FormData->HotKeyListHead, Link);
- Index ++;
+ Index++;
}
}
@@ -405,7 +411,6 @@ ScreenDiemensionInfoValidate ( //
gFooterHeight = FOOTER_HEIGHT + (Index / 3);
-
ZeroMem (&gScreenDimensions, sizeof (EFI_SCREEN_DESCRIPTOR));
gST->ConOut->QueryMode (
gST->ConOut,
@@ -420,7 +425,8 @@ ScreenDiemensionInfoValidate ( if (FormData->ScreenDimensions != NULL) {
if ((gScreenDimensions.RightColumn < FormData->ScreenDimensions->RightColumn) ||
(gScreenDimensions.BottomRow < FormData->ScreenDimensions->BottomRow)
- ) {
+ )
+ {
return EFI_INVALID_PARAMETER;
} else {
//
@@ -430,8 +436,9 @@ ScreenDiemensionInfoValidate ( (FormData->ScreenDimensions->BottomRow > FormData->ScreenDimensions->TopRow) &&
((FormData->ScreenDimensions->RightColumn - FormData->ScreenDimensions->LeftColumn) > 2) &&
((FormData->ScreenDimensions->BottomRow - FormData->ScreenDimensions->TopRow) > STATUS_BAR_HEIGHT +
- FRONT_PAGE_HEADER_HEIGHT + gFooterHeight + 3)) {
- CopyMem (&gScreenDimensions, (VOID *) FormData->ScreenDimensions, sizeof (EFI_SCREEN_DESCRIPTOR));
+ FRONT_PAGE_HEADER_HEIGHT + gFooterHeight + 3))
+ {
+ CopyMem (&gScreenDimensions, (VOID *)FormData->ScreenDimensions, sizeof (EFI_SCREEN_DESCRIPTOR));
} else {
return EFI_INVALID_PARAMETER;
}
@@ -453,8 +460,8 @@ ScreenDiemensionInfoValidate ( **/
CHAR16 *
LibGetToken (
- IN EFI_STRING_ID Token,
- IN EFI_HII_HANDLE HiiHandle
+ IN EFI_STRING_ID Token,
+ IN EFI_HII_HANDLE HiiHandle
)
{
EFI_STRING String;
@@ -465,10 +472,9 @@ LibGetToken ( ASSERT (String != NULL);
}
- return (CHAR16 *) String;
+ return (CHAR16 *)String;
}
-
/**
Count the storage space of a Unicode string.
@@ -487,31 +493,32 @@ LibGetToken ( **/
UINTN
LibGetStringWidth (
- IN CHAR16 *String
+ IN CHAR16 *String
)
{
- UINTN Index;
- UINTN Count;
- UINTN IncrementValue;
+ UINTN Index;
+ UINTN Count;
+ UINTN IncrementValue;
ASSERT (String != NULL);
if (String == NULL) {
return 0;
}
- Index = 0;
- Count = 0;
- IncrementValue = 1;
+ Index = 0;
+ Count = 0;
+ IncrementValue = 1;
do {
//
// Advance to the null-terminator or to the first width directive
//
- for (;
- (String[Index] != NARROW_CHAR) && (String[Index] != WIDE_CHAR) && (String[Index] != 0);
- Index++, Count = Count + IncrementValue
- )
- ;
+ for ( ;
+ (String[Index] != NARROW_CHAR) && (String[Index] != WIDE_CHAR) && (String[Index] != 0);
+ Index++, Count = Count + IncrementValue
+ )
+ {
+ }
//
// We hit the null-terminator, we now have a count
@@ -519,6 +526,7 @@ LibGetStringWidth ( if (String[Index] == 0) {
break;
}
+
//
// We encountered a narrow directive - strip it from the size calculation since it doesn't get printed
// and also set the flag that determines what we increment by.(if narrow, increment by 1, if wide increment by 2)
@@ -555,8 +563,8 @@ LibGetStringWidth ( **/
VOID
PrintHotKeyHelpString (
- IN FORM_DISPLAY_ENGINE_FORM *FormData,
- IN BOOLEAN SetState
+ IN FORM_DISPLAY_ENGINE_FORM *FormData,
+ IN BOOLEAN SetState
)
{
UINTN CurrentCol;
@@ -573,9 +581,9 @@ PrintHotKeyHelpString ( CHAR16 *ColumnStr;
CopyMem (&LocalScreen, &gScreenDimensions, sizeof (EFI_SCREEN_DESCRIPTOR));
- ColumnWidth = (LocalScreen.RightColumn - LocalScreen.LeftColumn) / 3;
- BottomRowOfHotKeyHelp = LocalScreen.BottomRow - STATUS_BAR_HEIGHT - 3;
- ColumnStr = gLibEmptyString;
+ ColumnWidth = (LocalScreen.RightColumn - LocalScreen.LeftColumn) / 3;
+ BottomRowOfHotKeyHelp = LocalScreen.BottomRow - STATUS_BAR_HEIGHT - 3;
+ ColumnStr = gLibEmptyString;
//
// Calculate total number of Register HotKeys.
@@ -598,6 +606,7 @@ PrintHotKeyHelpString ( CurrentCol = LocalScreen.LeftColumn + 2;
ColumnIndexWidth = ColumnWidth - 2;
}
+
CurrentRow = BottomRowOfHotKeyHelp - Index / 3;
//
@@ -605,7 +614,7 @@ PrintHotKeyHelpString ( //
BakChar = L'\0';
if (StrLen (HotKey->HelpString) > ColumnIndexWidth) {
- BakChar = HotKey->HelpString[ColumnIndexWidth];
+ BakChar = HotKey->HelpString[ColumnIndexWidth];
HotKey->HelpString[ColumnIndexWidth] = L'\0';
}
@@ -615,16 +624,18 @@ PrintHotKeyHelpString ( if (SetState) {
ColumnStr = HotKey->HelpString;
}
+
PrintStringAtWithWidth (CurrentCol, CurrentRow, ColumnStr, ColumnIndexWidth);
if (BakChar != L'\0') {
HotKey->HelpString[ColumnIndexWidth] = BakChar;
}
+
//
// Get Next Hot Key.
//
Link = GetNextNode (&FormData->HotKeyListHead, Link);
- Index ++;
+ Index++;
}
if (SetState) {
@@ -636,9 +647,10 @@ PrintHotKeyHelpString ( if (ColumnIndex == 0) {
CurrentCol = LocalScreen.LeftColumn + 2 * ColumnWidth;
ColumnIndexWidth = ColumnWidth - 1;
- ColumnIndex ++;
+ ColumnIndex++;
PrintStringAtWithWidth (CurrentCol, CurrentRow, gLibEmptyString, ColumnIndexWidth);
}
+
if (ColumnIndex == 1) {
CurrentCol = LocalScreen.LeftColumn + ColumnWidth;
ColumnIndexWidth = ColumnWidth;
@@ -658,34 +670,34 @@ PrintHotKeyHelpString ( **/
UINT64
LibGetFieldFromNum (
- IN EFI_IFR_OP_HEADER *OpCode
+ IN EFI_IFR_OP_HEADER *OpCode
)
{
- EFI_IFR_NUMERIC *NumericOp;
- UINT64 Step;
+ EFI_IFR_NUMERIC *NumericOp;
+ UINT64 Step;
- NumericOp = (EFI_IFR_NUMERIC *) OpCode;
+ NumericOp = (EFI_IFR_NUMERIC *)OpCode;
switch (NumericOp->Flags & EFI_IFR_NUMERIC_SIZE) {
- case EFI_IFR_NUMERIC_SIZE_1:
- Step = NumericOp->data.u8.Step;
- break;
+ case EFI_IFR_NUMERIC_SIZE_1:
+ Step = NumericOp->data.u8.Step;
+ break;
- case EFI_IFR_NUMERIC_SIZE_2:
- Step = NumericOp->data.u16.Step;
- break;
+ case EFI_IFR_NUMERIC_SIZE_2:
+ Step = NumericOp->data.u16.Step;
+ break;
- case EFI_IFR_NUMERIC_SIZE_4:
- Step = NumericOp->data.u32.Step;
- break;
+ case EFI_IFR_NUMERIC_SIZE_4:
+ Step = NumericOp->data.u32.Step;
+ break;
- case EFI_IFR_NUMERIC_SIZE_8:
- Step = NumericOp->data.u64.Step;
- break;
+ case EFI_IFR_NUMERIC_SIZE_8:
+ Step = NumericOp->data.u64.Step;
+ break;
- default:
- Step = 0;
- break;
+ default:
+ Step = 0;
+ break;
}
return Step;
@@ -700,29 +712,29 @@ InitializeLibStrings ( VOID
)
{
- mLibUnknownString = L"!";
-
- gEnterString = LibGetToken (STRING_TOKEN (ENTER_STRING), mCDLStringPackHandle);
- gEnterCommitString = LibGetToken (STRING_TOKEN (ENTER_COMMIT_STRING), mCDLStringPackHandle);
- gEnterEscapeString = LibGetToken (STRING_TOKEN (ENTER_ESCAPE_STRING), mCDLStringPackHandle);
- gEscapeString = LibGetToken (STRING_TOKEN (ESCAPE_STRING), mCDLStringPackHandle);
- gMoveHighlight = LibGetToken (STRING_TOKEN (MOVE_HIGHLIGHT), mCDLStringPackHandle);
- gDecNumericInput = LibGetToken (STRING_TOKEN (DEC_NUMERIC_INPUT), mCDLStringPackHandle);
- gHexNumericInput = LibGetToken (STRING_TOKEN (HEX_NUMERIC_INPUT), mCDLStringPackHandle);
- gToggleCheckBox = LibGetToken (STRING_TOKEN (TOGGLE_CHECK_BOX), mCDLStringPackHandle);
-
- gAreYouSure = LibGetToken (STRING_TOKEN (ARE_YOU_SURE), mCDLStringPackHandle);
- gYesResponse = LibGetToken (STRING_TOKEN (ARE_YOU_SURE_YES), mCDLStringPackHandle);
- gNoResponse = LibGetToken (STRING_TOKEN (ARE_YOU_SURE_NO), mCDLStringPackHandle);
- gPlusString = LibGetToken (STRING_TOKEN (PLUS_STRING), mCDLStringPackHandle);
- gMinusString = LibGetToken (STRING_TOKEN (MINUS_STRING), mCDLStringPackHandle);
- gAdjustNumber = LibGetToken (STRING_TOKEN (ADJUST_NUMBER), mCDLStringPackHandle);
- gSaveChanges = LibGetToken (STRING_TOKEN (SAVE_CHANGES), mCDLStringPackHandle);
-
- gLibEmptyString = LibGetToken (STRING_TOKEN (EMPTY_STRING), mCDLStringPackHandle);
-
- gNvUpdateMessage = LibGetToken (STRING_TOKEN (NV_UPDATE_MESSAGE), mCDLStringPackHandle);
- gInputErrorMessage = LibGetToken (STRING_TOKEN (INPUT_ERROR_MESSAGE), mCDLStringPackHandle);
+ mLibUnknownString = L"!";
+
+ gEnterString = LibGetToken (STRING_TOKEN (ENTER_STRING), mCDLStringPackHandle);
+ gEnterCommitString = LibGetToken (STRING_TOKEN (ENTER_COMMIT_STRING), mCDLStringPackHandle);
+ gEnterEscapeString = LibGetToken (STRING_TOKEN (ENTER_ESCAPE_STRING), mCDLStringPackHandle);
+ gEscapeString = LibGetToken (STRING_TOKEN (ESCAPE_STRING), mCDLStringPackHandle);
+ gMoveHighlight = LibGetToken (STRING_TOKEN (MOVE_HIGHLIGHT), mCDLStringPackHandle);
+ gDecNumericInput = LibGetToken (STRING_TOKEN (DEC_NUMERIC_INPUT), mCDLStringPackHandle);
+ gHexNumericInput = LibGetToken (STRING_TOKEN (HEX_NUMERIC_INPUT), mCDLStringPackHandle);
+ gToggleCheckBox = LibGetToken (STRING_TOKEN (TOGGLE_CHECK_BOX), mCDLStringPackHandle);
+
+ gAreYouSure = LibGetToken (STRING_TOKEN (ARE_YOU_SURE), mCDLStringPackHandle);
+ gYesResponse = LibGetToken (STRING_TOKEN (ARE_YOU_SURE_YES), mCDLStringPackHandle);
+ gNoResponse = LibGetToken (STRING_TOKEN (ARE_YOU_SURE_NO), mCDLStringPackHandle);
+ gPlusString = LibGetToken (STRING_TOKEN (PLUS_STRING), mCDLStringPackHandle);
+ gMinusString = LibGetToken (STRING_TOKEN (MINUS_STRING), mCDLStringPackHandle);
+ gAdjustNumber = LibGetToken (STRING_TOKEN (ADJUST_NUMBER), mCDLStringPackHandle);
+ gSaveChanges = LibGetToken (STRING_TOKEN (SAVE_CHANGES), mCDLStringPackHandle);
+
+ gLibEmptyString = LibGetToken (STRING_TOKEN (EMPTY_STRING), mCDLStringPackHandle);
+
+ gNvUpdateMessage = LibGetToken (STRING_TOKEN (NV_UPDATE_MESSAGE), mCDLStringPackHandle);
+ gInputErrorMessage = LibGetToken (STRING_TOKEN (INPUT_ERROR_MESSAGE), mCDLStringPackHandle);
//
// SpaceBuffer;
@@ -733,7 +745,6 @@ InitializeLibStrings ( mSpaceBuffer[SPACE_BUFFER_SIZE] = L'\0';
}
-
/**
Free the HII String.
@@ -778,7 +789,7 @@ FreeLibStrings ( **/
EFI_STATUS
WaitForKeyStroke (
- OUT EFI_INPUT_KEY *Key
+ OUT EFI_INPUT_KEY *Key
)
{
EFI_STATUS Status;
@@ -796,10 +807,10 @@ WaitForKeyStroke ( gBS->WaitForEvent (1, &gST->ConIn->WaitForKey, &Index);
}
+
return Status;
}
-
/**
Set Buffer to Value for Size bytes.
@@ -810,9 +821,9 @@ WaitForKeyStroke ( **/
VOID
LibSetUnicodeMem (
- IN VOID *Buffer,
- IN UINTN Size,
- IN CHAR16 Value
+ IN VOID *Buffer,
+ IN UINTN Size,
+ IN CHAR16 Value
)
{
CHAR16 *Ptr;
@@ -859,12 +870,12 @@ PrintInternal ( //
// For now, allocate an arbitrarily long buffer
//
- Buffer = AllocateZeroPool (0x10000);
- BackupBuffer = AllocateZeroPool (0x10000);
+ Buffer = AllocateZeroPool (0x10000);
+ BackupBuffer = AllocateZeroPool (0x10000);
ASSERT (Buffer);
ASSERT (BackupBuffer);
- if (Column != (UINTN) -1) {
+ if (Column != (UINTN)-1) {
Out->SetCursorPosition (Out, Column, Row);
}
@@ -882,7 +893,7 @@ PrintInternal ( CharWidth = 1;
do {
- for (; (Buffer[Index] != NARROW_CHAR) && (Buffer[Index] != WIDE_CHAR) && (Buffer[Index] != 0); Index++) {
+ for ( ; (Buffer[Index] != NARROW_CHAR) && (Buffer[Index] != WIDE_CHAR) && (Buffer[Index] != 0); Index++) {
BackupBuffer[Index] = Buffer[Index];
}
@@ -894,7 +905,7 @@ PrintInternal ( // Print this out, we are about to switch widths
//
Out->OutputString (Out, &BackupBuffer[PreviousIndex]);
- Count = StrLen (&BackupBuffer[PreviousIndex]);
+ Count = StrLen (&BackupBuffer[PreviousIndex]);
PrintWidth += Count * CharWidth;
TotalCount += Count;
@@ -923,14 +934,13 @@ PrintInternal ( }
Index++;
-
} while (Buffer[Index] != 0);
//
// We hit the end of the string - print it
//
Out->OutputString (Out, &BackupBuffer[PreviousIndex]);
- Count = StrLen (&BackupBuffer[PreviousIndex]);
+ Count = StrLen (&BackupBuffer[PreviousIndex]);
PrintWidth += Count * CharWidth;
TotalCount += Count;
if (PrintWidth < Width) {
@@ -960,19 +970,18 @@ PrintInternal ( UINTN
EFIAPI
PrintAt (
- IN UINTN Width,
- IN UINTN Column,
- IN UINTN Row,
- IN CHAR16 *Fmt,
+ IN UINTN Width,
+ IN UINTN Column,
+ IN UINTN Row,
+ IN CHAR16 *Fmt,
...
)
{
- VA_LIST Args;
- UINTN LengthOfPrinted;
+ VA_LIST Args;
+ UINTN LengthOfPrinted;
VA_START (Args, Fmt);
LengthOfPrinted = PrintInternal (Width, Column, Row, gST->ConOut, Fmt, Args);
VA_END (Args);
return LengthOfPrinted;
}
-
diff --git a/MdeModulePkg/Library/CustomizedDisplayLib/CustomizedDisplayLibInternal.h b/MdeModulePkg/Library/CustomizedDisplayLib/CustomizedDisplayLibInternal.h index 08a330401b..01213cb059 100644 --- a/MdeModulePkg/Library/CustomizedDisplayLib/CustomizedDisplayLibInternal.h +++ b/MdeModulePkg/Library/CustomizedDisplayLib/CustomizedDisplayLibInternal.h @@ -10,8 +10,6 @@ SPDX-License-Identifier: BSD-2-Clause-Patent #ifndef __CUSTOMIZED_DISPLAY_LIB_INTERNAL_H__
#define __CUSTOMIZED_DISPLAY_LIB_INTERNAL_H__
-
-
#include <PiDxe.h>
#include <Protocol/SimpleTextOut.h>
@@ -47,33 +45,30 @@ SPDX-License-Identifier: BSD-2-Clause-Patent #include "Colors.h"
+#define FORMSET_CLASS_PLATFORM_SETUP 0x0001
+#define FORMSET_CLASS_FRONT_PAGE 0x0002
-
-#define FORMSET_CLASS_PLATFORM_SETUP 0x0001
-#define FORMSET_CLASS_FRONT_PAGE 0x0002
-
-
-#define FRONT_PAGE_HEADER_HEIGHT 6
-#define NONE_FRONT_PAGE_HEADER_HEIGHT 3
-#define FOOTER_HEIGHT 4
-#define STATUS_BAR_HEIGHT 1
+#define FRONT_PAGE_HEADER_HEIGHT 6
+#define NONE_FRONT_PAGE_HEADER_HEIGHT 3
+#define FOOTER_HEIGHT 4
+#define STATUS_BAR_HEIGHT 1
//
// Screen definitions
//
-#define BANNER_HEIGHT 6
-#define BANNER_COLUMNS 3
-#define BANNER_LEFT_COLUMN_INDENT 1
+#define BANNER_HEIGHT 6
+#define BANNER_COLUMNS 3
+#define BANNER_LEFT_COLUMN_INDENT 1
//
// Character definitions
//
-#define UPPER_LOWER_CASE_OFFSET 0x20
+#define UPPER_LOWER_CASE_OFFSET 0x20
//
// This is the Input Error Message
//
-#define INPUT_ERROR 1
+#define INPUT_ERROR 1
//
// This is the NV RAM update required Message
@@ -81,35 +76,36 @@ SPDX-License-Identifier: BSD-2-Clause-Patent #define NV_UPDATE_REQUIRED 2
typedef struct {
- EFI_STRING_ID Banner[BANNER_HEIGHT][BANNER_COLUMNS];
+ EFI_STRING_ID Banner[BANNER_HEIGHT][BANNER_COLUMNS];
} BANNER_DATA;
-extern UINT16 gClassOfVfr; // Formset class information
-extern BANNER_DATA *gBannerData;
-extern EFI_SCREEN_DESCRIPTOR gScreenDimensions;
-extern UINTN gFooterHeight;
+extern UINT16 gClassOfVfr; // Formset class information
+extern BANNER_DATA *gBannerData;
+extern EFI_SCREEN_DESCRIPTOR gScreenDimensions;
+extern UINTN gFooterHeight;
//
// Browser Global Strings
//
-extern CHAR16 *gEnterString;
-extern CHAR16 *gEnterCommitString;
-extern CHAR16 *gEnterEscapeString;
-extern CHAR16 *gEscapeString;
-extern CHAR16 *gMoveHighlight;
-extern CHAR16 *gDecNumericInput;
-extern CHAR16 *gHexNumericInput;
-extern CHAR16 *gToggleCheckBox;
-extern CHAR16 *gLibEmptyString;
-extern CHAR16 *gAreYouSure;
-extern CHAR16 *gYesResponse;
-extern CHAR16 *gNoResponse;
-extern CHAR16 *gPlusString;
-extern CHAR16 *gMinusString;
-extern CHAR16 *gAdjustNumber;
-extern CHAR16 *gSaveChanges;
-extern CHAR16 *gNvUpdateMessage;
-extern CHAR16 *gInputErrorMessage;
+extern CHAR16 *gEnterString;
+extern CHAR16 *gEnterCommitString;
+extern CHAR16 *gEnterEscapeString;
+extern CHAR16 *gEscapeString;
+extern CHAR16 *gMoveHighlight;
+extern CHAR16 *gDecNumericInput;
+extern CHAR16 *gHexNumericInput;
+extern CHAR16 *gToggleCheckBox;
+extern CHAR16 *gLibEmptyString;
+extern CHAR16 *gAreYouSure;
+extern CHAR16 *gYesResponse;
+extern CHAR16 *gNoResponse;
+extern CHAR16 *gPlusString;
+extern CHAR16 *gMinusString;
+extern CHAR16 *gAdjustNumber;
+extern CHAR16 *gSaveChanges;
+extern CHAR16 *gNvUpdateMessage;
+extern CHAR16 *gInputErrorMessage;
+
/**
Print banner info for front page.
@@ -119,7 +115,7 @@ extern CHAR16 *gInputErrorMessage; **/
VOID
PrintBannerInfo (
- IN FORM_DISPLAY_ENGINE_FORM *FormData
+ IN FORM_DISPLAY_ENGINE_FORM *FormData
);
/**
@@ -129,7 +125,7 @@ PrintBannerInfo ( **/
VOID
PrintFramework (
- IN FORM_DISPLAY_ENGINE_FORM *FormData
+ IN FORM_DISPLAY_ENGINE_FORM *FormData
);
/**
@@ -143,7 +139,7 @@ PrintFramework ( **/
EFI_STATUS
ScreenDiemensionInfoValidate (
- IN FORM_DISPLAY_ENGINE_FORM *FormData
+ IN FORM_DISPLAY_ENGINE_FORM *FormData
);
/**
@@ -158,8 +154,8 @@ ScreenDiemensionInfoValidate ( **/
CHAR16 *
LibGetToken (
- IN EFI_STRING_ID Token,
- IN EFI_HII_HANDLE HiiHandle
+ IN EFI_STRING_ID Token,
+ IN EFI_HII_HANDLE HiiHandle
);
/**
@@ -180,7 +176,7 @@ LibGetToken ( **/
UINTN
LibGetStringWidth (
- IN CHAR16 *String
+ IN CHAR16 *String
);
/**
@@ -192,8 +188,8 @@ LibGetStringWidth ( **/
VOID
PrintHotKeyHelpString (
- IN FORM_DISPLAY_ENGINE_FORM *FormData,
- IN BOOLEAN SetState
+ IN FORM_DISPLAY_ENGINE_FORM *FormData,
+ IN BOOLEAN SetState
);
/**
@@ -205,7 +201,7 @@ PrintHotKeyHelpString ( **/
UINT64
LibGetFieldFromNum (
- IN EFI_IFR_OP_HEADER *OpCode
+ IN EFI_IFR_OP_HEADER *OpCode
);
/**
@@ -236,7 +232,7 @@ FreeLibStrings ( **/
EFI_STATUS
WaitForKeyStroke (
- OUT EFI_INPUT_KEY *Key
+ OUT EFI_INPUT_KEY *Key
);
/**
@@ -249,9 +245,9 @@ WaitForKeyStroke ( **/
VOID
LibSetUnicodeMem (
- IN VOID *Buffer,
- IN UINTN Size,
- IN CHAR16 Value
+ IN VOID *Buffer,
+ IN UINTN Size,
+ IN CHAR16 Value
);
/**
@@ -270,10 +266,10 @@ LibSetUnicodeMem ( UINTN
EFIAPI
PrintAt (
- IN UINTN Width,
- IN UINTN Column,
- IN UINTN Row,
- IN CHAR16 *Fmt,
+ IN UINTN Width,
+ IN UINTN Column,
+ IN UINTN Row,
+ IN CHAR16 *Fmt,
...
);
@@ -285,7 +281,7 @@ PrintAt ( **/
VOID
ProcessExternedOpcode (
- IN FORM_DISPLAY_ENGINE_FORM *FormData
+ IN FORM_DISPLAY_ENGINE_FORM *FormData
);
#endif
|