11EFI_GUID gCustomizedDisplayLibGuid = {
12 0x99fdc8fd, 0x849b, 0x4eba, { 0xad, 0x13, 0xfb, 0x96, 0x99, 0xc9, 0xa, 0x4d }
17BOOLEAN gLibIsFirstForm =
TRUE;
62 ASSERT (FormData !=
NULL && ScreenForStatement !=
NULL);
63 if ((FormData ==
NULL) || (ScreenForStatement ==
NULL)) {
64 return EFI_INVALID_PARAMETER;
68 if (EFI_ERROR (Status)) {
72 gClassOfVfr = FORMSET_CLASS_PLATFORM_SETUP;
79 ScreenForStatement->BottomRow = gScreenDimensions.BottomRow - STATUS_BAR_HEIGHT - gFooterHeight;
80 if (gClassOfVfr == FORMSET_CLASS_FRONT_PAGE) {
81 ScreenForStatement->TopRow = gScreenDimensions.TopRow + FRONT_PAGE_HEADER_HEIGHT;
83 ScreenForStatement->TopRow = gScreenDimensions.TopRow + NONE_FRONT_PAGE_HEADER_HEIGHT;
86 ScreenForStatement->LeftColumn = gScreenDimensions.LeftColumn;
87 ScreenForStatement->RightColumn = gScreenDimensions.RightColumn;
89 if ((gLibIsFirstForm) || ((FormData->Attribute & HII_DISPLAY_MODAL) != 0)) {
94 ClearLines (0, gScreenDimensions.RightColumn, 0, gScreenDimensions.BottomRow, KEYHELP_BACKGROUND);
95 gLibIsFirstForm =
FALSE;
101 if ((FormData->Attribute & HII_DISPLAY_MODAL) != 0) {
105 if (gClassOfVfr == FORMSET_CLASS_FRONT_PAGE) {
135 UINTN RightColumnOfHelp;
137 UINTN BottomRowOfHelp;
138 UINTN StartColumnOfHelp;
150 ASSERT (FormData !=
NULL);
151 if (FormData ==
NULL) {
157 if ((FormData->Attribute & HII_DISPLAY_MODAL) != 0) {
161 SecCol = gScreenDimensions.LeftColumn + (gScreenDimensions.RightColumn - gScreenDimensions.LeftColumn) / 3;
162 ThdCol = gScreenDimensions.LeftColumn + (gScreenDimensions.RightColumn - gScreenDimensions.LeftColumn) / 3 * 2;
167 StartColumnOfHelp = gScreenDimensions.LeftColumn + 2;
168 RightColumnOfHelp = gScreenDimensions.RightColumn - 1;
169 TopRowOfHelp = gScreenDimensions.BottomRow - STATUS_BAR_HEIGHT - gFooterHeight + 1;
170 BottomRowOfHelp = gScreenDimensions.BottomRow - STATUS_BAR_HEIGHT - 2;
172 ColumnWidth1 = SecCol - StartColumnOfHelp;
173 ColumnWidth2 = ThdCol - SecCol;
174 ColumnWidth3 = RightColumnOfHelp - ThdCol;
175 ColumnStr1 = gLibEmptyString;
176 ColumnStr2 = gLibEmptyString;
177 ColumnStr3 = gLibEmptyString;
185 if (Statement ==
NULL) {
193 if (gClassOfVfr == FORMSET_CLASS_PLATFORM_SETUP) {
194 ColumnStr3 = gEscapeString;
206 if (Statement->OpCode->OpCode == EFI_IFR_NUMERIC_OP) {
208 HexDisplay = (NumericOp->Flags & EFI_IFR_DISPLAY_UINT_HEX) == EFI_IFR_DISPLAY_UINT_HEX;
209 }
else if (Statement->OpCode->OpCode == EFI_IFR_DATE_OP) {
211 HexDisplay = (DateOp->Flags & EFI_IFR_DISPLAY_UINT_HEX) == EFI_IFR_DISPLAY_UINT_HEX;
212 }
else if (Statement->OpCode->OpCode == EFI_IFR_TIME_OP) {
214 HexDisplay = (TimeOp->Flags & EFI_IFR_DISPLAY_UINT_HEX) == EFI_IFR_DISPLAY_UINT_HEX;
217 switch (Statement->OpCode->OpCode) {
218 case EFI_IFR_ORDERED_LIST_OP:
219 case EFI_IFR_ONE_OF_OP:
220 case EFI_IFR_NUMERIC_OP:
221 case EFI_IFR_TIME_OP:
222 case EFI_IFR_DATE_OP:
226 if (gClassOfVfr == FORMSET_CLASS_PLATFORM_SETUP) {
227 ColumnStr3 = gEscapeString;
232 if ((Statement->OpCode->OpCode == EFI_IFR_DATE_OP) ||
233 (Statement->OpCode->OpCode == EFI_IFR_TIME_OP))
249 PrintAt (ColumnWidth1, StartColumnOfHelp, BottomRowOfHelp, L
"%c%c%s", ARROW_UP, ARROW_DOWN, gMoveHighlight);
250 if ((Statement->OpCode->OpCode == EFI_IFR_NUMERIC_OP) && (NumericOp !=
NULL) && (
LibGetFieldFromNum (Statement->OpCode) != 0)) {
251 ColumnStr1 = gAdjustNumber;
264 if ((Statement->OpCode->OpCode == EFI_IFR_NUMERIC_OP) ||
265 (Statement->OpCode->OpCode == EFI_IFR_DATE_OP) ||
266 (Statement->OpCode->OpCode == EFI_IFR_TIME_OP))
268 ColumnStr2 = HexDisplay ? gHexNumericInput : gDecNumericInput;
271 PrintAt (ColumnWidth1, StartColumnOfHelp, BottomRowOfHelp, L
"%c%c%s", ARROW_UP, ARROW_DOWN, gMoveHighlight);
274 if (Statement->OpCode->OpCode == EFI_IFR_ORDERED_LIST_OP) {
275 ColumnStr1 = gPlusString;
276 ColumnStr3 = gMinusString;
288 case EFI_IFR_CHECKBOX_OP:
291 if (gClassOfVfr == FORMSET_CLASS_PLATFORM_SETUP) {
292 ColumnStr3 = gEscapeString;
297 PrintAt (ColumnWidth1, StartColumnOfHelp, BottomRowOfHelp, L
"%c%c%s", ARROW_UP, ARROW_DOWN, gMoveHighlight);
303 case EFI_IFR_PASSWORD_OP:
304 case EFI_IFR_STRING_OP:
305 case EFI_IFR_TEXT_OP:
306 case EFI_IFR_ACTION_OP:
307 case EFI_IFR_RESET_BUTTON_OP:
308 case EFI_IFR_SUBTITLE_OP:
312 if (gClassOfVfr == FORMSET_CLASS_PLATFORM_SETUP) {
313 ColumnStr3 = gEscapeString;
318 PrintAt (ColumnWidth1, StartColumnOfHelp, BottomRowOfHelp, L
"%c%c%s", ARROW_UP, ARROW_DOWN, gMoveHighlight);
319 if ((Statement->OpCode->OpCode != EFI_IFR_TEXT_OP) && (Statement->OpCode->OpCode != EFI_IFR_SUBTITLE_OP)) {
320 ColumnStr2 = gEnterString;
327 if (Statement->OpCode->OpCode != EFI_IFR_REF_OP) {
328 ColumnStr2 = gEnterCommitString;
329 ColumnStr3 = gEnterEscapeString;
364 OptionWidth = (CHAR16)((gScreenDimensions.RightColumn - gScreenDimensions.LeftColumn) / 3);
366 switch (MessageType) {
371 gScreenDimensions.LeftColumn + OptionWidth,
372 gScreenDimensions.BottomRow - 1,
377 for (Index = 0; Index < (
LibGetStringWidth (gInputErrorMessage) - 2) / 2; Index++) {
378 PrintStringAt (gScreenDimensions.LeftColumn + OptionWidth + Index, gScreenDimensions.BottomRow - 1, L
" ");
384 case NV_UPDATE_REQUIRED:
391 gScreenDimensions.LeftColumn + OptionWidth * 2,
392 gScreenDimensions.BottomRow - 1,
397 for (Index = 0; Index < (
LibGetStringWidth (gNvUpdateMessage) - 2) / 2; Index++) {
399 (gScreenDimensions.LeftColumn + OptionWidth * 2 + Index),
400 gScreenDimensions.BottomRow - 1,
442 UINTN DimensionsWidth;
443 UINTN DimensionsHeight;
444 UINTN CurrentAttribute;
445 BOOLEAN CursorVisible;
450 if ((gScreenDimensions.RightColumn == 0) || (gScreenDimensions.BottomRow == 0)) {
455 &gScreenDimensions.RightColumn,
456 &gScreenDimensions.BottomRow
460 DimensionsWidth = gScreenDimensions.RightColumn - gScreenDimensions.LeftColumn;
461 DimensionsHeight = gScreenDimensions.BottomRow - gScreenDimensions.TopRow;
466 while ((String =
VA_ARG (Marker, CHAR16 *)) !=
NULL) {
476 if ((LargestString + 2) > DimensionsWidth) {
477 LargestString = DimensionsWidth - 2;
489 Start = (DimensionsWidth - LargestString - 2) / 2 + gScreenDimensions.LeftColumn + 1;
490 End = Start + LargestString + 1;
492 Top = ((DimensionsHeight - LineNum - 2) / 2) + gScreenDimensions.TopRow - 1;
493 Bottom = Top + LineNum + 2;
495 Character = BOXDRAW_DOWN_RIGHT;
497 Character = BOXDRAW_HORIZONTAL;
498 for (Index = Start; Index + 2 < End; Index++) {
502 Character = BOXDRAW_DOWN_LEFT;
504 Character = BOXDRAW_VERTICAL;
508 for (Index = Top; Index + 2 < Bottom; Index++, Count++) {
509 String =
VA_ARG (Marker, CHAR16 *);
511 if (String[0] == CHAR_NULL) {
516 }
else if (String[0] == L
' ') {
520 ClearLines (Start + 1, End - 1, Index + 1, Index + 1, POPUP_INVERSE_TEXT | POPUP_INVERSE_BACKGROUND);
522 ((DimensionsWidth -
LibGetStringWidth (String) / 2) / 2) + gScreenDimensions.LeftColumn + 1,
534 ((DimensionsWidth -
LibGetStringWidth (String) / 2) / 2) + gScreenDimensions.LeftColumn + 1,
547 Character = BOXDRAW_UP_RIGHT;
549 Character = BOXDRAW_HORIZONTAL;
550 for (Index = Start; Index + 2 < End; Index++) {
554 Character = BOXDRAW_UP_LEFT;
584 YesResponse = gYesResponse[0];
585 NoResponse = gNoResponse[0];
591 CreateDialog (&Key, gLibEmptyString, gSaveChanges, gAreYouSure, gLibEmptyString,
NULL);
594 (Key.ScanCode != SCAN_ESC) &&
595 ((Key.UnicodeChar | UPPER_LOWER_CASE_OFFSET) != (NoResponse | UPPER_LOWER_CASE_OFFSET)) &&
596 ((Key.UnicodeChar | UPPER_LOWER_CASE_OFFSET) != (YesResponse | UPPER_LOWER_CASE_OFFSET))
599 if (Key.ScanCode == SCAN_ESC) {
600 return BROWSER_ACTION_NONE;
601 }
else if ((Key.UnicodeChar | UPPER_LOWER_CASE_OFFSET) == (YesResponse | UPPER_LOWER_CASE_OFFSET)) {
602 return BROWSER_ACTION_SUBMIT;
604 return BROWSER_ACTION_DISCARD;
623 return gClassOfVfr == FORMSET_CLASS_FRONT_PAGE ?
FALSE :
TRUE;
669 return PrintAt (0, Column, Row, L
"%s", String);
693 return PrintAt (Width, Column, Row, L
"%s", String);
715 return PrintAt (0, Column, Row, L
"%c", Character);
745 ASSERT (Buffer !=
NULL);
760 for (Row = TopRow; Row <= BottomRow; Row++) {
784 return POPUP_TEXT | POPUP_BACKGROUND;
798 return POPUP_INVERSE_TEXT | POPUP_INVERSE_BACKGROUND;
812 return PICKLIST_HIGHLIGHT_TEXT | PICKLIST_HIGHLIGHT_BACKGROUND;
826 return ARROW_TEXT | ARROW_BACKGROUND;
840 return INFO_TEXT | FIELD_BACKGROUND;
854 return HELP_TEXT | FIELD_BACKGROUND;
868 return FIELD_TEXT_GRAYED | FIELD_BACKGROUND;
882 return PcdGet8 (PcdBrowserFieldTextHighlightColor) |
PcdGet8 (PcdBrowserFieldBackgroundHighlightColor);
896 return PcdGet8 (PcdBrowserFieldTextColor) | FIELD_BACKGROUND;
910 return PcdGet8 (PcdBrowserSubtitleTextColor) | FIELD_BACKGROUND;
924 gLibIsFirstForm =
TRUE;
943 mCDLStringPackHandle =
HiiAddPackages (&gCustomizedDisplayLibGuid, ImageHandle, CustomizedDisplayLibStrings,
NULL);
944 ASSERT (mCDLStringPackHandle !=
NULL);
VOID *EFIAPI CopyMem(OUT VOID *DestinationBuffer, IN CONST VOID *SourceBuffer, IN UINTN Length)
VOID *EFIAPI ZeroMem(OUT VOID *Buffer, IN UINTN Length)
UINTN EFIAPI ConfirmDataChange(VOID)
UINT64 EFIAPI FormExitTimeout(IN FORM_DISPLAY_ENGINE_FORM *FormData)
VOID EFIAPI CreateDialog(OUT EFI_INPUT_KEY *Key OPTIONAL,...)
VOID EFIAPI RefreshKeyHelp(IN FORM_DISPLAY_ENGINE_FORM *FormData, IN FORM_DISPLAY_ENGINE_STATEMENT *Statement, IN BOOLEAN Selected)
UINT8 EFIAPI GetGrayedTextColor(VOID)
EFI_STATUS EFIAPI CustomizedDisplayLibDestructor(IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable)
VOID EFIAPI ClearDisplayPage(VOID)
UINT8 EFIAPI GetPopupInverseColor(VOID)
UINT8 EFIAPI GetPopupColor(VOID)
UINTN EFIAPI PrintStringAtWithWidth(IN UINTN Column, IN UINTN Row, IN CHAR16 *String, IN UINTN Width)
VOID EFIAPI UpdateStatusBar(IN UINTN MessageType, IN BOOLEAN State)
UINT8 EFIAPI GetSubTitleTextColor(VOID)
UINTN EFIAPI PrintStringAt(IN UINTN Column, IN UINTN Row, IN CHAR16 *String)
UINT8 EFIAPI GetArrowColor(VOID)
UINTN EFIAPI PrintCharAt(IN UINTN Column, IN UINTN Row, CHAR16 Character)
UINT8 EFIAPI GetFieldTextColor(VOID)
VOID EFIAPI ClearLines(IN UINTN LeftColumn, IN UINTN RightColumn, IN UINTN TopRow, IN UINTN BottomRow, IN UINTN TextAttribute)
UINT8 EFIAPI GetHelpTextColor(VOID)
UINT8 EFIAPI GetHighlightTextColor(VOID)
UINT8 EFIAPI GetPickListColor(VOID)
UINT8 EFIAPI GetInfoTextColor(VOID)
EFI_STATUS EFIAPI DisplayPageFrame(IN FORM_DISPLAY_ENGINE_FORM *FormData, OUT EFI_SCREEN_DESCRIPTOR *ScreenForStatement)
BOOLEAN EFIAPI FormExitPolicy(VOID)
EFI_STATUS EFIAPI CustomizedDisplayLibConstructor(IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable)
VOID FreeLibStrings(VOID)
VOID PrintHotKeyHelpString(IN FORM_DISPLAY_ENGINE_FORM *FormData, IN BOOLEAN SetState)
VOID InitializeLibStrings(VOID)
EFI_STATUS WaitForKeyStroke(OUT EFI_INPUT_KEY *Key)
VOID PrintBannerInfo(IN FORM_DISPLAY_ENGINE_FORM *FormData)
VOID ProcessExternedOpcode(IN FORM_DISPLAY_ENGINE_FORM *FormData)
VOID LibSetUnicodeMem(IN VOID *Buffer, IN UINTN Size, IN CHAR16 Value)
EFI_STATUS ScreenDiemensionInfoValidate(IN FORM_DISPLAY_ENGINE_FORM *FormData)
VOID PrintFramework(IN FORM_DISPLAY_ENGINE_FORM *FormData)
UINTN LibGetStringWidth(IN CHAR16 *String)
UINTN EFIAPI PrintAt(IN UINTN Width, IN UINTN Column, IN UINTN Row, IN CHAR16 *Fmt,...)
UINT64 LibGetFieldFromNum(IN EFI_IFR_OP_HEADER *OpCode)
VOID *EFIAPI AllocateZeroPool(IN UINTN AllocationSize)
VOID EFIAPI FreePool(IN VOID *Buffer)
EFI_HII_HANDLE EFIAPI HiiAddPackages(IN CONST EFI_GUID *PackageListGuid, IN EFI_HANDLE DeviceHandle OPTIONAL,...)
VOID EFIAPI HiiRemovePackages(IN EFI_HII_HANDLE HiiHandle)
#define VA_ARG(Marker, TYPE)
#define VA_START(Marker, Parameter)
#define ASSERT_EFI_ERROR(StatusParameter)
#define PcdGet8(TokenName)
EFI_SIMPLE_TEXT_OUTPUT_MODE * Mode
EFI_SIMPLE_TEXT_INPUT_PROTOCOL * ConIn
EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL * ConOut