12CHAR16 *mLibUnknownString;
15#define SPACE_BUFFER_SIZE 1000
21CHAR16 *gEnterCommitString;
22CHAR16 *gEnterEscapeString;
24CHAR16 *gMoveHighlight;
25CHAR16 *gDecNumericInput;
26CHAR16 *gHexNumericInput;
27CHAR16 *gToggleCheckBox;
28CHAR16 *gLibEmptyString;
36CHAR16 *gNvUpdateMessage;
37CHAR16 *gInputErrorMessage;
53 CHAR16 *StrFrontPageBanner;
61 gScreenDimensions.LeftColumn,
62 gScreenDimensions.RightColumn,
63 gScreenDimensions.TopRow,
64 FRONT_PAGE_HEADER_HEIGHT - 1 + gScreenDimensions.TopRow,
65 BANNER_TEXT | BANNER_BACKGROUND
71 for (Line = (UINT8)gScreenDimensions.TopRow; Line < BANNER_HEIGHT + (UINT8)gScreenDimensions.TopRow; Line++) {
75 for (Alignment = (UINT8)gScreenDimensions.LeftColumn;
76 Alignment < BANNER_COLUMNS + (UINT8)gScreenDimensions.LeftColumn;
80 RowIdx = (UINT8)(Line - (UINT8)gScreenDimensions.TopRow);
81 ColumnIdx = (UINT8)(Alignment - (UINT8)gScreenDimensions.LeftColumn);
83 ASSERT (RowIdx < BANNER_HEIGHT && ColumnIdx < BANNER_COLUMNS);
85 if ((gBannerData !=
NULL) && (gBannerData->Banner[RowIdx][ColumnIdx] != 0x0000)) {
86 StrFrontPageBanner =
LibGetToken (gBannerData->Banner[RowIdx][ColumnIdx], FormData->HiiHandle);
91 switch (Alignment - gScreenDimensions.LeftColumn) {
96 PrintStringAt (gScreenDimensions.LeftColumn + BANNER_LEFT_COLUMN_INDENT, Line, StrFrontPageBanner);
104 gScreenDimensions.LeftColumn + (gScreenDimensions.RightColumn - gScreenDimensions.LeftColumn) / 3,
115 gScreenDimensions.LeftColumn + (gScreenDimensions.RightColumn - gScreenDimensions.LeftColumn) * 2 / 3,
144 if (gClassOfVfr != FORMSET_CLASS_PLATFORM_SETUP) {
149 gScreenDimensions.LeftColumn,
150 gScreenDimensions.RightColumn,
151 gScreenDimensions.BottomRow - STATUS_BAR_HEIGHT - gFooterHeight,
152 gScreenDimensions.BottomRow - STATUS_BAR_HEIGHT - 1,
153 KEYHELP_TEXT | KEYHELP_BACKGROUND
159 ASSERT (Buffer !=
NULL);
160 Character = BOXDRAW_HORIZONTAL;
161 for (Index = 0; Index + 2 < (gScreenDimensions.RightColumn - gScreenDimensions.LeftColumn); Index++) {
162 Buffer[Index] = Character;
172 Character = BOXDRAW_DOWN_RIGHT;
174 PrintCharAt (gScreenDimensions.LeftColumn, gScreenDimensions.TopRow, Character);
177 Character = BOXDRAW_DOWN_LEFT;
180 Character = BOXDRAW_VERTICAL;
181 for (Row = gScreenDimensions.TopRow + 1; Row <= gScreenDimensions.TopRow + NONE_FRONT_PAGE_HEADER_HEIGHT - 2; Row++) {
182 PrintCharAt (gScreenDimensions.LeftColumn, Row, Character);
183 PrintCharAt (gScreenDimensions.RightColumn - 1, Row, Character);
189 TitleStr =
LibGetToken (FormData->FormTitle, FormData->HiiHandle);
190 ASSERT (TitleStr !=
NULL);
191 TitleColumn = (gScreenDimensions.RightColumn + gScreenDimensions.LeftColumn -
LibGetStringWidth (TitleStr) / 2) / 2;
192 PrintStringAtWithWidth (gScreenDimensions.LeftColumn + 1, gScreenDimensions.TopRow + 1, gLibEmptyString, TitleColumn - gScreenDimensions.LeftColumn - 1);
195 gScreenDimensions.TopRow + 1,
197 gScreenDimensions.RightColumn - 1 - TitleColumn
201 Character = BOXDRAW_UP_RIGHT;
202 PrintCharAt (gScreenDimensions.LeftColumn, gScreenDimensions.TopRow + NONE_FRONT_PAGE_HEADER_HEIGHT - 1, Character);
205 Character = BOXDRAW_UP_LEFT;
214 Character = BOXDRAW_DOWN_RIGHT;
215 PrintCharAt (gScreenDimensions.LeftColumn, gScreenDimensions.BottomRow - STATUS_BAR_HEIGHT - gFooterHeight, Character);
219 Character = BOXDRAW_DOWN_LEFT;
221 Character = BOXDRAW_VERTICAL;
222 for (Row = gScreenDimensions.BottomRow - STATUS_BAR_HEIGHT - gFooterHeight + 1;
223 Row <= gScreenDimensions.BottomRow - STATUS_BAR_HEIGHT - 2;
227 PrintCharAt (gScreenDimensions.LeftColumn, Row, Character);
228 PrintCharAt (gScreenDimensions.RightColumn - 1, Row, Character);
231 Character = BOXDRAW_UP_RIGHT;
232 PrintCharAt (gScreenDimensions.LeftColumn, gScreenDimensions.BottomRow - STATUS_BAR_HEIGHT - 1, Character);
236 Character = BOXDRAW_UP_LEFT;
261 switch (OpCodeData->OpCode) {
262 case EFI_IFR_FORM_SET_OP:
267 gClassOfVfr = FORMSET_CLASS_FRONT_PAGE;
271 while (ClassGuidNum-- > 0) {
273 gClassOfVfr = FORMSET_CLASS_FRONT_PAGE;
283 case EFI_IFR_GUID_OP:
295 case EFI_IFR_EXTEND_OP_BANNER:
299 if (gClassOfVfr == FORMSET_CLASS_FRONT_PAGE) {
303 if (gBannerData ==
NULL) {
305 ASSERT (gBannerData !=
NULL);
312 sizeof (EFI_STRING_ID)
318 case EFI_IFR_EXTEND_OP_SUBCLASS:
320 gClassOfVfr = FORMSET_CLASS_FRONT_PAGE;
356 while (!
IsNull (&FormData->StatementListOSF, Link)) {
357 Statement = FORM_DISPLAY_ENGINE_STATEMENT_FROM_LINK (Link);
358 Link =
GetNextNode (&FormData->StatementListOSF, Link);
364 while (!
IsNull (&FormData->StatementListHead, Link)) {
365 Statement = FORM_DISPLAY_ENGINE_STATEMENT_FROM_LINK (Link);
366 Link =
GetNextNode (&FormData->StatementListHead, Link);
370 NestLink =
GetFirstNode (&Statement->NestStatementList);
371 while (!
IsNull (&Statement->NestStatementList, NestLink)) {
372 NestStatement = FORM_DISPLAY_ENGINE_STATEMENT_FROM_LINK (NestLink);
373 NestLink =
GetNextNode (&Statement->NestStatementList, NestLink);
403 while (!
IsNull (&FormData->HotKeyListHead, Link)) {
404 Link =
GetNextNode (&FormData->HotKeyListHead, Link);
412 gFooterHeight = FOOTER_HEIGHT + (Index / 3);
418 &gScreenDimensions.RightColumn,
419 &gScreenDimensions.BottomRow
425 if (FormData->ScreenDimensions !=
NULL) {
426 if ((gScreenDimensions.RightColumn < FormData->ScreenDimensions->RightColumn) ||
427 (gScreenDimensions.BottomRow < FormData->ScreenDimensions->BottomRow)
430 return EFI_INVALID_PARAMETER;
435 if ((FormData->ScreenDimensions->RightColumn > FormData->ScreenDimensions->LeftColumn) &&
436 (FormData->ScreenDimensions->BottomRow > FormData->ScreenDimensions->TopRow) &&
437 ((FormData->ScreenDimensions->RightColumn - FormData->ScreenDimensions->LeftColumn) > 2) &&
438 ((FormData->ScreenDimensions->BottomRow - FormData->ScreenDimensions->TopRow) > STATUS_BAR_HEIGHT +
439 FRONT_PAGE_HEADER_HEIGHT + gFooterHeight + 3))
443 return EFI_INVALID_PARAMETER;
463 IN EFI_STRING_ID Token,
470 if (String ==
NULL) {
472 ASSERT (String !=
NULL);
475 return (CHAR16 *)String;
501 UINTN IncrementValue;
503 ASSERT (String !=
NULL);
504 if (String ==
NULL) {
517 (String[Index] != NARROW_CHAR) && (String[Index] != WIDE_CHAR) && (String[Index] != 0);
518 Index++, Count = Count + IncrementValue
526 if (String[Index] == 0) {
534 if (String[Index] == NARROW_CHAR) {
547 }
while (String[Index] != 0);
554 return Count *
sizeof (CHAR16);
572 UINTN BottomRowOfHotKeyHelp;
573 UINTN ColumnIndexWidth;
584 ColumnWidth = (LocalScreen.RightColumn - LocalScreen.LeftColumn) / 3;
585 BottomRowOfHotKeyHelp = LocalScreen.BottomRow - STATUS_BAR_HEIGHT - 3;
586 ColumnStr = gLibEmptyString;
593 while (!
IsNull (&FormData->HotKeyListHead, Link)) {
594 HotKey = BROWSER_HOT_KEY_FROM_LINK (Link);
598 ColumnIndex = Index % 3;
599 if (ColumnIndex == 0) {
600 CurrentCol = LocalScreen.LeftColumn + 2 * ColumnWidth;
601 ColumnIndexWidth = ColumnWidth - 1;
602 }
else if (ColumnIndex == 1) {
603 CurrentCol = LocalScreen.LeftColumn + ColumnWidth;
604 ColumnIndexWidth = ColumnWidth;
606 CurrentCol = LocalScreen.LeftColumn + 2;
607 ColumnIndexWidth = ColumnWidth - 2;
610 CurrentRow = BottomRowOfHotKeyHelp - Index / 3;
616 if (
StrLen (HotKey->HelpString) > ColumnIndexWidth) {
617 BakChar = HotKey->HelpString[ColumnIndexWidth];
618 HotKey->HelpString[ColumnIndexWidth] = L
'\0';
625 ColumnStr = HotKey->HelpString;
630 if (BakChar != L
'\0') {
631 HotKey->HelpString[ColumnIndexWidth] = BakChar;
637 Link =
GetNextNode (&FormData->HotKeyListHead, Link);
645 CurrentRow = BottomRowOfHotKeyHelp - Index / 3;
646 ColumnIndex = Index % 3;
647 if (ColumnIndex == 0) {
648 CurrentCol = LocalScreen.LeftColumn + 2 * ColumnWidth;
649 ColumnIndexWidth = ColumnWidth - 1;
654 if (ColumnIndex == 1) {
655 CurrentCol = LocalScreen.LeftColumn + ColumnWidth;
656 ColumnIndexWidth = ColumnWidth;
681 switch (NumericOp->Flags & EFI_IFR_NUMERIC_SIZE) {
682 case EFI_IFR_NUMERIC_SIZE_1:
683 Step = NumericOp->data.u8.Step;
686 case EFI_IFR_NUMERIC_SIZE_2:
687 Step = NumericOp->data.u16.Step;
690 case EFI_IFR_NUMERIC_SIZE_4:
691 Step = NumericOp->data.u32.Step;
694 case EFI_IFR_NUMERIC_SIZE_8:
695 Step = NumericOp->data.u64.Step;
715 mLibUnknownString = L
"!";
742 mSpaceBuffer =
AllocatePool ((SPACE_BUFFER_SIZE + 1) *
sizeof (CHAR16));
743 ASSERT (mSpaceBuffer !=
NULL);
745 mSpaceBuffer[SPACE_BUFFER_SIZE] = L
'\0';
800 if (!EFI_ERROR (Status)) {
804 if (Status != EFI_NOT_READY) {
832 while ((Size--) != 0) {
862 CHAR16 *BackupBuffer;
876 ASSERT (BackupBuffer);
878 if (Column != (
UINTN)-1) {
879 Out->SetCursorPosition (Out, Column, Row);
884 Out->Mode->Attribute = Out->Mode->Attribute & 0x7f;
886 Out->SetAttribute (Out, Out->Mode->Attribute);
896 for ( ; (Buffer[Index] != NARROW_CHAR) && (Buffer[Index] != WIDE_CHAR) && (Buffer[Index] != 0); Index++) {
897 BackupBuffer[Index] = Buffer[Index];
900 if (Buffer[Index] == 0) {
907 Out->OutputString (Out, &BackupBuffer[PreviousIndex]);
908 Count =
StrLen (&BackupBuffer[PreviousIndex]);
909 PrintWidth += Count * CharWidth;
915 PreviousIndex = Index + 1;
920 if (Buffer[Index] == NARROW_CHAR) {
924 Out->Mode->Attribute = Out->Mode->Attribute & 0x7f;
925 Out->SetAttribute (Out, Out->Mode->Attribute);
931 Out->Mode->Attribute = Out->Mode->Attribute | EFI_WIDE_ATTRIBUTE;
932 Out->SetAttribute (Out, Out->Mode->Attribute);
937 }
while (Buffer[Index] != 0);
942 Out->OutputString (Out, &BackupBuffer[PreviousIndex]);
943 Count =
StrLen (&BackupBuffer[PreviousIndex]);
944 PrintWidth += Count * CharWidth;
946 if (PrintWidth < Width) {
947 Out->Mode->Attribute = Out->Mode->Attribute & 0x7f;
948 Out->SetAttribute (Out, Out->Mode->Attribute);
949 Out->OutputString (Out, &mSpaceBuffer[SPACE_BUFFER_SIZE - Width + PrintWidth]);
981 UINTN LengthOfPrinted;
986 return LengthOfPrinted;
BOOLEAN EFIAPI IsNull(IN CONST LIST_ENTRY *List, IN CONST LIST_ENTRY *Node)
UINTN EFIAPI StrSize(IN CONST CHAR16 *String)
BOOLEAN EFIAPI IsListEmpty(IN CONST LIST_ENTRY *ListHead)
LIST_ENTRY *EFIAPI GetNextNode(IN CONST LIST_ENTRY *List, IN CONST LIST_ENTRY *Node)
LIST_ENTRY *EFIAPI GetFirstNode(IN CONST LIST_ENTRY *List)
UINTN EFIAPI StrLen(IN CONST CHAR16 *String)
INTN EFIAPI CompareMem(IN CONST VOID *DestinationBuffer, IN CONST VOID *SourceBuffer, IN UINTN Length)
VOID *EFIAPI CopyMem(OUT VOID *DestinationBuffer, IN CONST VOID *SourceBuffer, IN UINTN Length)
BOOLEAN EFIAPI CompareGuid(IN CONST GUID *Guid1, IN CONST GUID *Guid2)
VOID *EFIAPI ZeroMem(OUT VOID *Buffer, IN UINTN Length)
UINTN EFIAPI PrintStringAtWithWidth(IN UINTN Column, IN UINTN Row, IN CHAR16 *String, IN UINTN Width)
VOID EFIAPI ClearLines(IN UINTN LeftColumn, IN UINTN RightColumn, IN UINTN TopRow, IN UINTN BottomRow, IN UINTN TextAttribute)
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)
CHAR16 * LibGetToken(IN EFI_STRING_ID Token, IN EFI_HII_HANDLE HiiHandle)
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)
VOID ProcessUserOpcode(IN EFI_IFR_OP_HEADER *OpCodeData)
UINTN LibGetStringWidth(IN CHAR16 *String)
UINTN PrintInternal(IN UINTN Width, IN UINTN Column, IN UINTN Row, IN EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL *Out, IN CHAR16 *Fmt, IN VA_LIST Args)
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)
VOID *EFIAPI AllocateCopyPool(IN UINTN AllocationSize, IN CONST VOID *Buffer)
EFI_STRING EFIAPI HiiGetString(IN EFI_HII_HANDLE HiiHandle, IN EFI_STRING_ID StringId, IN CONST CHAR8 *Language OPTIONAL)
#define EFI_IFR_EXTEND_OP_LABEL
UINTN EFIAPI UnicodeVSPrint(OUT CHAR16 *StartOfBuffer, IN UINTN BufferSize, IN CONST CHAR16 *FormatString, IN VA_LIST Marker)
#define VA_START(Marker, Parameter)
#define PcdGetPtr(TokenName)
VOID *EFIAPI AllocatePool(IN UINTN AllocationSize)
EFI_SIMPLE_TEXT_OUTPUT_MODE * Mode
EFI_SIMPLE_TEXT_INPUT_PROTOCOL * ConIn
EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL * ConOut