MCPcopy Create free account
hub / github.com/CloverHackyColor/CloverBootloader / DrawScreenHeader

Function DrawScreenHeader

rEFIt_UEFI/refit/screen.cpp:226–271  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

224}
225
226static VOID DrawScreenHeader(IN CONST CHAR16 *Title)
227{
228 UINTN i;
229 CHAR16* BannerLine = (__typeof__(BannerLine))AllocatePool((ConWidth + 1) * sizeof(CHAR16));
230 BannerLine[ConWidth] = 0;
231
232 // clear to black background
233 //gST->ConOut->SetAttribute(gST->ConOut, ATTR_BASIC);
234 //gST->ConOut->ClearScreen (gST->ConOut);
235
236 // paint header background
237 gST->ConOut->SetAttribute(gST->ConOut, ATTR_BANNER);
238
239 for (i = 1; i < ConWidth-1; i++) {
240 BannerLine[i] = BOXDRAW_HORIZONTAL;
241 }
242
243 BannerLine[0] = BOXDRAW_DOWN_RIGHT;
244 BannerLine[ConWidth-1] = BOXDRAW_DOWN_LEFT;
245 gST->ConOut->SetCursorPosition (gST->ConOut, 0, 0);
246 printf("%ls", BannerLine);
247
248 for (i = 1; i < ConWidth-1; i++)
249 BannerLine[i] = ' ';
250 BannerLine[0] = BOXDRAW_VERTICAL;
251 BannerLine[ConWidth-1] = BOXDRAW_VERTICAL;
252 gST->ConOut->SetCursorPosition (gST->ConOut, 0, 1);
253 printf("%ls", BannerLine);
254
255 for (i = 1; i < ConWidth-1; i++)
256 BannerLine[i] = BOXDRAW_HORIZONTAL;
257 BannerLine[0] = BOXDRAW_UP_RIGHT;
258 BannerLine[ConWidth-1] = BOXDRAW_UP_LEFT;
259 gST->ConOut->SetCursorPosition (gST->ConOut, 0, 2);
260 printf("%ls", BannerLine);
261
262 FreePool(BannerLine);
263
264 // print header text
265 gST->ConOut->SetCursorPosition (gST->ConOut, 3, 1);
266 printf("Clover rev %ls - %ls", gFirmwareRevision, Title);
267
268 // reposition cursor
269 gST->ConOut->SetAttribute (gST->ConOut, ATTR_BASIC);
270 gST->ConOut->SetCursorPosition (gST->ConOut, 0, 4);
271}
272
273
274//

Callers 1

BeginTextScreenFunction · 0.85

Calls 3

printfFunction · 0.85
AllocatePoolFunction · 0.50
FreePoolFunction · 0.50

Tested by

no test coverage detected