TianoCore EDK2 master
Loading...
Searching...
No Matches
CustomizedDisplayLib.c
Go to the documentation of this file.
1
10
11EFI_GUID gCustomizedDisplayLibGuid = {
12 0x99fdc8fd, 0x849b, 0x4eba, { 0xad, 0x13, 0xfb, 0x96, 0x99, 0xc9, 0xa, 0x4d }
13};
14
15EFI_HII_HANDLE mCDLStringPackHandle;
16UINT16 gClassOfVfr; // Formset class information
17BOOLEAN gLibIsFirstForm = TRUE;
18BANNER_DATA *gBannerData;
19
20UINTN gFooterHeight;
21
54EFIAPI
57 OUT EFI_SCREEN_DESCRIPTOR *ScreenForStatement
58 )
59{
60 EFI_STATUS Status;
61
62 ASSERT (FormData != NULL && ScreenForStatement != NULL);
63 if ((FormData == NULL) || (ScreenForStatement == NULL)) {
64 return EFI_INVALID_PARAMETER;
65 }
66
67 Status = ScreenDiemensionInfoValidate (FormData);
68 if (EFI_ERROR (Status)) {
69 return Status;
70 }
71
72 gClassOfVfr = FORMSET_CLASS_PLATFORM_SETUP;
73
74 ProcessExternedOpcode (FormData);
75
76 //
77 // Calculate the ScreenForStatement.
78 //
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;
82 } else {
83 ScreenForStatement->TopRow = gScreenDimensions.TopRow + NONE_FRONT_PAGE_HEADER_HEIGHT;
84 }
85
86 ScreenForStatement->LeftColumn = gScreenDimensions.LeftColumn;
87 ScreenForStatement->RightColumn = gScreenDimensions.RightColumn;
88
89 if ((gLibIsFirstForm) || ((FormData->Attribute & HII_DISPLAY_MODAL) != 0)) {
90 //
91 // Ensure we are in Text mode
92 //
93 gST->ConOut->SetAttribute (gST->ConOut, EFI_TEXT_ATTR (EFI_LIGHTGRAY, EFI_BLACK));
94 ClearLines (0, gScreenDimensions.RightColumn, 0, gScreenDimensions.BottomRow, KEYHELP_BACKGROUND);
95 gLibIsFirstForm = FALSE;
96 }
97
98 //
99 // Don't print frame for modal form.
100 //
101 if ((FormData->Attribute & HII_DISPLAY_MODAL) != 0) {
102 return EFI_SUCCESS;
103 }
104
105 if (gClassOfVfr == FORMSET_CLASS_FRONT_PAGE) {
106 PrintBannerInfo (FormData);
107 }
108
109 PrintFramework (FormData);
110
111 UpdateStatusBar (NV_UPDATE_REQUIRED, FormData->SettingChangedFlag);
112
113 return EFI_SUCCESS;
114}
115
125VOID
126EFIAPI
130 IN BOOLEAN Selected
131 )
132{
133 UINTN SecCol;
134 UINTN ThdCol;
135 UINTN RightColumnOfHelp;
136 UINTN TopRowOfHelp;
137 UINTN BottomRowOfHelp;
138 UINTN StartColumnOfHelp;
139 EFI_IFR_NUMERIC *NumericOp;
140 EFI_IFR_DATE *DateOp;
141 EFI_IFR_TIME *TimeOp;
142 BOOLEAN HexDisplay;
143 UINTN ColumnWidth1;
144 UINTN ColumnWidth2;
145 UINTN ColumnWidth3;
146 CHAR16 *ColumnStr1;
147 CHAR16 *ColumnStr2;
148 CHAR16 *ColumnStr3;
149
150 ASSERT (FormData != NULL);
151 if (FormData == NULL) {
152 return;
153 }
154
155 gST->ConOut->SetAttribute (gST->ConOut, KEYHELP_TEXT | KEYHELP_BACKGROUND);
156
157 if ((FormData->Attribute & HII_DISPLAY_MODAL) != 0) {
158 return;
159 }
160
161 SecCol = gScreenDimensions.LeftColumn + (gScreenDimensions.RightColumn - gScreenDimensions.LeftColumn) / 3;
162 ThdCol = gScreenDimensions.LeftColumn + (gScreenDimensions.RightColumn - gScreenDimensions.LeftColumn) / 3 * 2;
163
164 //
165 // + 2 means leave 1 space before the first hotkey info.
166 //
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;
171
172 ColumnWidth1 = SecCol - StartColumnOfHelp;
173 ColumnWidth2 = ThdCol - SecCol;
174 ColumnWidth3 = RightColumnOfHelp - ThdCol;
175 ColumnStr1 = gLibEmptyString;
176 ColumnStr2 = gLibEmptyString;
177 ColumnStr3 = gLibEmptyString;
178
179 //
180 // Clean the space at gScreenDimensions.LeftColumn + 1.
181 //
182 PrintStringAtWithWidth (StartColumnOfHelp - 1, BottomRowOfHelp, gLibEmptyString, 1);
183 PrintStringAtWithWidth (StartColumnOfHelp - 1, TopRowOfHelp, gLibEmptyString, 1);
184
185 if (Statement == NULL) {
186 //
187 // Print Key for Form without showable statement.
188 //
189 PrintHotKeyHelpString (FormData, TRUE);
190 PrintStringAtWithWidth (StartColumnOfHelp, BottomRowOfHelp, gLibEmptyString, ColumnWidth1);
191 PrintStringAtWithWidth (SecCol, BottomRowOfHelp, gLibEmptyString, ColumnWidth2);
192 PrintStringAtWithWidth (StartColumnOfHelp, TopRowOfHelp, gLibEmptyString, ColumnWidth1);
193 if (gClassOfVfr == FORMSET_CLASS_PLATFORM_SETUP) {
194 ColumnStr3 = gEscapeString;
195 }
196
197 PrintStringAtWithWidth (ThdCol, BottomRowOfHelp, ColumnStr3, ColumnWidth3);
198
199 return;
200 }
201
202 HexDisplay = FALSE;
203 NumericOp = NULL;
204 DateOp = NULL;
205 TimeOp = NULL;
206 if (Statement->OpCode->OpCode == EFI_IFR_NUMERIC_OP) {
207 NumericOp = (EFI_IFR_NUMERIC *)Statement->OpCode;
208 HexDisplay = (NumericOp->Flags & EFI_IFR_DISPLAY_UINT_HEX) == EFI_IFR_DISPLAY_UINT_HEX;
209 } else if (Statement->OpCode->OpCode == EFI_IFR_DATE_OP) {
210 DateOp = (EFI_IFR_DATE *)Statement->OpCode;
211 HexDisplay = (DateOp->Flags & EFI_IFR_DISPLAY_UINT_HEX) == EFI_IFR_DISPLAY_UINT_HEX;
212 } else if (Statement->OpCode->OpCode == EFI_IFR_TIME_OP) {
213 TimeOp = (EFI_IFR_TIME *)Statement->OpCode;
214 HexDisplay = (TimeOp->Flags & EFI_IFR_DISPLAY_UINT_HEX) == EFI_IFR_DISPLAY_UINT_HEX;
215 }
216
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:
223 if (!Selected) {
224 PrintHotKeyHelpString (FormData, TRUE);
225
226 if (gClassOfVfr == FORMSET_CLASS_PLATFORM_SETUP) {
227 ColumnStr3 = gEscapeString;
228 }
229
230 PrintStringAtWithWidth (ThdCol, BottomRowOfHelp, ColumnStr3, ColumnWidth3);
231
232 if ((Statement->OpCode->OpCode == EFI_IFR_DATE_OP) ||
233 (Statement->OpCode->OpCode == EFI_IFR_TIME_OP))
234 {
235 PrintAt (
236 ColumnWidth1,
237 StartColumnOfHelp,
238 BottomRowOfHelp,
239 L"%c%c%c%c%s",
240 ARROW_UP,
241 ARROW_DOWN,
242 ARROW_RIGHT,
243 ARROW_LEFT,
244 gMoveHighlight
245 );
246 PrintStringAtWithWidth (SecCol, BottomRowOfHelp, gEnterString, ColumnWidth2);
247 PrintStringAtWithWidth (StartColumnOfHelp, TopRowOfHelp, gAdjustNumber, ColumnWidth1);
248 } else {
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;
252 }
253
254 PrintStringAtWithWidth (StartColumnOfHelp, TopRowOfHelp, ColumnStr1, ColumnWidth1);
255 PrintStringAtWithWidth (SecCol, BottomRowOfHelp, gEnterString, ColumnWidth2);
256 }
257 } else {
258 PrintHotKeyHelpString (FormData, FALSE);
259 PrintStringAtWithWidth (SecCol, BottomRowOfHelp, gEnterCommitString, ColumnWidth2);
260
261 //
262 // If it is a selected numeric with manual input, display different message
263 //
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))
267 {
268 ColumnStr2 = HexDisplay ? gHexNumericInput : gDecNumericInput;
269 PrintStringAtWithWidth (StartColumnOfHelp, BottomRowOfHelp, gLibEmptyString, ColumnWidth1);
270 } else {
271 PrintAt (ColumnWidth1, StartColumnOfHelp, BottomRowOfHelp, L"%c%c%s", ARROW_UP, ARROW_DOWN, gMoveHighlight);
272 }
273
274 if (Statement->OpCode->OpCode == EFI_IFR_ORDERED_LIST_OP) {
275 ColumnStr1 = gPlusString;
276 ColumnStr3 = gMinusString;
277 }
278
279 PrintStringAtWithWidth (StartColumnOfHelp, TopRowOfHelp, ColumnStr1, ColumnWidth1);
280 PrintStringAtWithWidth (ThdCol, TopRowOfHelp, ColumnStr3, ColumnWidth3);
281 PrintStringAtWithWidth (SecCol, TopRowOfHelp, ColumnStr2, ColumnWidth2);
282
283 PrintStringAtWithWidth (ThdCol, BottomRowOfHelp, gEnterEscapeString, ColumnWidth3);
284 }
285
286 break;
287
288 case EFI_IFR_CHECKBOX_OP:
289 PrintHotKeyHelpString (FormData, TRUE);
290
291 if (gClassOfVfr == FORMSET_CLASS_PLATFORM_SETUP) {
292 ColumnStr3 = gEscapeString;
293 }
294
295 PrintStringAtWithWidth (ThdCol, BottomRowOfHelp, ColumnStr3, ColumnWidth3);
296
297 PrintAt (ColumnWidth1, StartColumnOfHelp, BottomRowOfHelp, L"%c%c%s", ARROW_UP, ARROW_DOWN, gMoveHighlight);
298 PrintStringAtWithWidth (SecCol, BottomRowOfHelp, gToggleCheckBox, ColumnWidth2);
299 PrintStringAtWithWidth (StartColumnOfHelp, TopRowOfHelp, gLibEmptyString, ColumnWidth1);
300 break;
301
302 case EFI_IFR_REF_OP:
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:
309 if (!Selected) {
310 PrintHotKeyHelpString (FormData, TRUE);
311
312 if (gClassOfVfr == FORMSET_CLASS_PLATFORM_SETUP) {
313 ColumnStr3 = gEscapeString;
314 }
315
316 PrintStringAtWithWidth (ThdCol, BottomRowOfHelp, ColumnStr3, ColumnWidth3);
317
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;
321 }
322
323 PrintStringAtWithWidth (SecCol, BottomRowOfHelp, ColumnStr2, ColumnWidth2);
324 PrintStringAtWithWidth (StartColumnOfHelp, TopRowOfHelp, ColumnStr1, ColumnWidth1);
325 } else {
326 PrintHotKeyHelpString (FormData, FALSE);
327 if (Statement->OpCode->OpCode != EFI_IFR_REF_OP) {
328 ColumnStr2 = gEnterCommitString;
329 ColumnStr3 = gEnterEscapeString;
330 }
331
332 PrintStringAtWithWidth (StartColumnOfHelp, TopRowOfHelp, ColumnStr1, ColumnWidth1);
333 PrintStringAtWithWidth (StartColumnOfHelp, BottomRowOfHelp, ColumnStr1, ColumnWidth1);
334 PrintStringAtWithWidth (SecCol, BottomRowOfHelp, ColumnStr2, ColumnWidth2);
335 PrintStringAtWithWidth (ThdCol, BottomRowOfHelp, ColumnStr3, ColumnWidth3);
336 }
337
338 break;
339
340 default:
341 break;
342 }
343}
344
354VOID
355EFIAPI
357 IN UINTN MessageType,
358 IN BOOLEAN State
359 )
360{
361 UINTN Index;
362 CHAR16 OptionWidth;
363
364 OptionWidth = (CHAR16)((gScreenDimensions.RightColumn - gScreenDimensions.LeftColumn) / 3);
365
366 switch (MessageType) {
367 case INPUT_ERROR:
368 if (State) {
369 gST->ConOut->SetAttribute (gST->ConOut, ERROR_TEXT);
371 gScreenDimensions.LeftColumn + OptionWidth,
372 gScreenDimensions.BottomRow - 1,
373 gInputErrorMessage
374 );
375 } else {
376 gST->ConOut->SetAttribute (gST->ConOut, KEYHELP_BACKGROUND);
377 for (Index = 0; Index < (LibGetStringWidth (gInputErrorMessage) - 2) / 2; Index++) {
378 PrintStringAt (gScreenDimensions.LeftColumn + OptionWidth + Index, gScreenDimensions.BottomRow - 1, L" ");
379 }
380 }
381
382 break;
383
384 case NV_UPDATE_REQUIRED:
385 //
386 // Global setting support. Show configuration change on every form.
387 //
388 if (State) {
389 gST->ConOut->SetAttribute (gST->ConOut, INFO_TEXT);
391 gScreenDimensions.LeftColumn + OptionWidth * 2,
392 gScreenDimensions.BottomRow - 1,
393 gNvUpdateMessage
394 );
395 } else {
396 gST->ConOut->SetAttribute (gST->ConOut, KEYHELP_BACKGROUND);
397 for (Index = 0; Index < (LibGetStringWidth (gNvUpdateMessage) - 2) / 2; Index++) {
399 (gScreenDimensions.LeftColumn + OptionWidth * 2 + Index),
400 gScreenDimensions.BottomRow - 1,
401 L" "
402 );
403 }
404 }
405
406 break;
407
408 default:
409 break;
410 }
411}
412
422VOID
423EFIAPI
425 OUT EFI_INPUT_KEY *Key OPTIONAL,
426 ...
427 )
428{
429 VA_LIST Marker;
430 EFI_INPUT_KEY KeyValue;
431 EFI_STATUS Status;
432 UINTN LargestString;
433 UINTN LineNum;
434 UINTN Index;
435 UINTN Count;
436 CHAR16 Character;
437 UINTN Start;
438 UINTN End;
439 UINTN Top;
440 UINTN Bottom;
441 CHAR16 *String;
442 UINTN DimensionsWidth;
443 UINTN DimensionsHeight;
444 UINTN CurrentAttribute;
445 BOOLEAN CursorVisible;
446
447 //
448 // If screen dimension info is not ready, get it from console.
449 //
450 if ((gScreenDimensions.RightColumn == 0) || (gScreenDimensions.BottomRow == 0)) {
451 ZeroMem (&gScreenDimensions, sizeof (EFI_SCREEN_DESCRIPTOR));
452 gST->ConOut->QueryMode (
453 gST->ConOut,
454 gST->ConOut->Mode->Mode,
455 &gScreenDimensions.RightColumn,
456 &gScreenDimensions.BottomRow
457 );
458 }
459
460 DimensionsWidth = gScreenDimensions.RightColumn - gScreenDimensions.LeftColumn;
461 DimensionsHeight = gScreenDimensions.BottomRow - gScreenDimensions.TopRow;
462
463 LargestString = 0;
464 LineNum = 0;
465 VA_START (Marker, Key);
466 while ((String = VA_ARG (Marker, CHAR16 *)) != NULL) {
467 LineNum++;
468
469 if ((LibGetStringWidth (String) / 2) > LargestString) {
470 LargestString = (LibGetStringWidth (String) / 2);
471 }
472 }
473
474 VA_END (Marker);
475
476 if ((LargestString + 2) > DimensionsWidth) {
477 LargestString = DimensionsWidth - 2;
478 }
479
480 CurrentAttribute = gST->ConOut->Mode->Attribute;
481 CursorVisible = gST->ConOut->Mode->CursorVisible;
482 gST->ConOut->EnableCursor (gST->ConOut, FALSE);
483 gST->ConOut->SetAttribute (gST->ConOut, GetPopupColor ());
484
485 //
486 // Subtract the PopUp width from total Columns, allow for one space extra on
487 // each end plus a border.
488 //
489 Start = (DimensionsWidth - LargestString - 2) / 2 + gScreenDimensions.LeftColumn + 1;
490 End = Start + LargestString + 1;
491
492 Top = ((DimensionsHeight - LineNum - 2) / 2) + gScreenDimensions.TopRow - 1;
493 Bottom = Top + LineNum + 2;
494
495 Character = BOXDRAW_DOWN_RIGHT;
496 PrintCharAt (Start, Top, Character);
497 Character = BOXDRAW_HORIZONTAL;
498 for (Index = Start; Index + 2 < End; Index++) {
499 PrintCharAt ((UINTN)-1, (UINTN)-1, Character);
500 }
501
502 Character = BOXDRAW_DOWN_LEFT;
503 PrintCharAt ((UINTN)-1, (UINTN)-1, Character);
504 Character = BOXDRAW_VERTICAL;
505
506 Count = 0;
507 VA_START (Marker, Key);
508 for (Index = Top; Index + 2 < Bottom; Index++, Count++) {
509 String = VA_ARG (Marker, CHAR16 *);
510
511 if (String[0] == CHAR_NULL) {
512 //
513 // Passing in a NULL results in a blank space
514 //
515 ClearLines (Start, End, Index + 1, Index + 1, GetPopupColor ());
516 } else if (String[0] == L' ') {
517 //
518 // Passing in a space results in the assumption that this is where typing will occur
519 //
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,
523 Index + 1,
524 String + 1
525 );
526 } else {
527 //
528 // This will clear the background of the line - we never know who might have been
529 // here before us. This differs from the next clear in that it used the non-reverse
530 // video for normal printing.
531 //
532 ClearLines (Start, End, Index + 1, Index + 1, GetPopupColor ());
534 ((DimensionsWidth - LibGetStringWidth (String) / 2) / 2) + gScreenDimensions.LeftColumn + 1,
535 Index + 1,
536 String
537 );
538 }
539
540 gST->ConOut->SetAttribute (gST->ConOut, GetPopupColor ());
541 PrintCharAt (Start, Index + 1, Character);
542 PrintCharAt (End - 1, Index + 1, Character);
543 }
544
545 VA_END (Marker);
546
547 Character = BOXDRAW_UP_RIGHT;
548 PrintCharAt (Start, Bottom - 1, Character);
549 Character = BOXDRAW_HORIZONTAL;
550 for (Index = Start; Index + 2 < End; Index++) {
551 PrintCharAt ((UINTN)-1, (UINTN)-1, Character);
552 }
553
554 Character = BOXDRAW_UP_LEFT;
555 PrintCharAt ((UINTN)-1, (UINTN)-1, Character);
556
557 if (Key != NULL) {
558 Status = WaitForKeyStroke (&KeyValue);
559 ASSERT_EFI_ERROR (Status);
560 CopyMem (Key, &KeyValue, sizeof (EFI_INPUT_KEY));
561 }
562
563 gST->ConOut->SetAttribute (gST->ConOut, CurrentAttribute);
564 gST->ConOut->EnableCursor (gST->ConOut, CursorVisible);
565}
566
572UINTN
573EFIAPI
575 VOID
576 )
577{
578 CHAR16 YesResponse;
579 CHAR16 NoResponse;
580 EFI_INPUT_KEY Key;
581
582 gST->ConIn->ReadKeyStroke (gST->ConIn, &Key);
583
584 YesResponse = gYesResponse[0];
585 NoResponse = gNoResponse[0];
586
587 //
588 // If NV flag is up, prompt user
589 //
590 do {
591 CreateDialog (&Key, gLibEmptyString, gSaveChanges, gAreYouSure, gLibEmptyString, NULL);
592 } while
593 (
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))
597 );
598
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;
603 } else {
604 return BROWSER_ACTION_DISCARD;
605 }
606}
607
617BOOLEAN
618EFIAPI
620 VOID
621 )
622{
623 return gClassOfVfr == FORMSET_CLASS_FRONT_PAGE ? FALSE : TRUE;
624}
625
637UINT64
638EFIAPI
641 )
642{
643 return 0;
644}
645
646//
647// Print Functions
648//
649
661UINTN
662EFIAPI
664 IN UINTN Column,
665 IN UINTN Row,
666 IN CHAR16 *String
667 )
668{
669 return PrintAt (0, Column, Row, L"%s", String);
670}
671
684UINTN
685EFIAPI
687 IN UINTN Column,
688 IN UINTN Row,
689 IN CHAR16 *String,
690 IN UINTN Width
691 )
692{
693 return PrintAt (Width, Column, Row, L"%s", String);
694}
695
707UINTN
708EFIAPI
710 IN UINTN Column,
711 IN UINTN Row,
712 CHAR16 Character
713 )
714{
715 return PrintAt (0, Column, Row, L"%c", Character);
716}
717
728VOID
729EFIAPI
731 IN UINTN LeftColumn,
732 IN UINTN RightColumn,
733 IN UINTN TopRow,
734 IN UINTN BottomRow,
735 IN UINTN TextAttribute
736 )
737{
738 CHAR16 *Buffer;
739 UINTN Row;
740
741 //
742 // For now, allocate an arbitrarily long buffer
743 //
744 Buffer = AllocateZeroPool (0x10000);
745 ASSERT (Buffer != NULL);
746
747 //
748 // Set foreground and background as defined
749 //
750 gST->ConOut->SetAttribute (gST->ConOut, TextAttribute);
751
752 //
753 // Much faster to buffer the long string instead of print it a character at a time
754 //
755 LibSetUnicodeMem (Buffer, RightColumn - LeftColumn, L' ');
756
757 //
758 // Clear the desired area with the appropriate foreground/background
759 //
760 for (Row = TopRow; Row <= BottomRow; Row++) {
761 PrintStringAt (LeftColumn, Row, Buffer);
762 }
763
764 gST->ConOut->SetCursorPosition (gST->ConOut, LeftColumn, TopRow);
765
766 FreePool (Buffer);
767}
768
769//
770// Color Setting Functions
771//
772
778UINT8
779EFIAPI
781 VOID
782 )
783{
784 return POPUP_TEXT | POPUP_BACKGROUND;
785}
786
792UINT8
793EFIAPI
795 VOID
796 )
797{
798 return POPUP_INVERSE_TEXT | POPUP_INVERSE_BACKGROUND;
799}
800
806UINT8
807EFIAPI
809 VOID
810 )
811{
812 return PICKLIST_HIGHLIGHT_TEXT | PICKLIST_HIGHLIGHT_BACKGROUND;
813}
814
820UINT8
821EFIAPI
823 VOID
824 )
825{
826 return ARROW_TEXT | ARROW_BACKGROUND;
827}
828
834UINT8
835EFIAPI
837 VOID
838 )
839{
840 return INFO_TEXT | FIELD_BACKGROUND;
841}
842
848UINT8
849EFIAPI
851 VOID
852 )
853{
854 return HELP_TEXT | FIELD_BACKGROUND;
855}
856
862UINT8
863EFIAPI
865 VOID
866 )
867{
868 return FIELD_TEXT_GRAYED | FIELD_BACKGROUND;
869}
870
876UINT8
877EFIAPI
879 VOID
880 )
881{
882 return PcdGet8 (PcdBrowserFieldTextHighlightColor) | PcdGet8 (PcdBrowserFieldBackgroundHighlightColor);
883}
884
890UINT8
891EFIAPI
893 VOID
894 )
895{
896 return PcdGet8 (PcdBrowserFieldTextColor) | FIELD_BACKGROUND;
897}
898
904UINT8
905EFIAPI
907 VOID
908 )
909{
910 return PcdGet8 (PcdBrowserSubtitleTextColor) | FIELD_BACKGROUND;
911}
912
916VOID
917EFIAPI
919 VOID
920 )
921{
922 gST->ConOut->SetAttribute (gST->ConOut, EFI_TEXT_ATTR (EFI_LIGHTGRAY, EFI_BLACK));
923 gST->ConOut->ClearScreen (gST->ConOut);
924 gLibIsFirstForm = TRUE;
925}
926
937EFIAPI
939 IN EFI_HANDLE ImageHandle,
940 IN EFI_SYSTEM_TABLE *SystemTable
941 )
942{
943 mCDLStringPackHandle = HiiAddPackages (&gCustomizedDisplayLibGuid, ImageHandle, CustomizedDisplayLibStrings, NULL);
944 ASSERT (mCDLStringPackHandle != NULL);
945
947
948 return EFI_SUCCESS;
949}
950
962EFIAPI
964 IN EFI_HANDLE ImageHandle,
965 IN EFI_SYSTEM_TABLE *SystemTable
966 )
967{
968 HiiRemovePackages (mCDLStringPackHandle);
969
971
972 return EFI_SUCCESS;
973}
UINT64 UINTN
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,...)
Definition: HiiLib.c:141
VOID EFIAPI HiiRemovePackages(IN EFI_HII_HANDLE HiiHandle)
Definition: HiiLib.c:253
#define NULL
Definition: Base.h:319
#define VA_ARG(Marker, TYPE)
Definition: Base.h:679
#define VA_START(Marker, Parameter)
Definition: Base.h:661
#define TRUE
Definition: Base.h:301
#define FALSE
Definition: Base.h:307
CHAR8 * VA_LIST
Definition: Base.h:643
#define IN
Definition: Base.h:279
#define OUT
Definition: Base.h:284
#define VA_END(Marker)
Definition: Base.h:691
#define ASSERT_EFI_ERROR(StatusParameter)
Definition: DebugLib.h:462
#define PcdGet8(TokenName)
Definition: PcdLib.h:336
RETURN_STATUS EFI_STATUS
Definition: UefiBaseType.h:29
VOID * EFI_HANDLE
Definition: UefiBaseType.h:33
#define EFI_SUCCESS
Definition: UefiBaseType.h:112
EFI_SYSTEM_TABLE * gST
VOID * EFI_HII_HANDLE
EFI_SIMPLE_TEXT_OUTPUT_MODE * Mode
EFI_SIMPLE_TEXT_INPUT_PROTOCOL * ConIn
Definition: UefiSpec.h:2053
EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL * ConOut
Definition: UefiSpec.h:2064
Definition: Base.h:213