From e6c6a64b8375a6de18e0c52fdf7343fdad957fff Mon Sep 17 00:00:00 2001 From: Joursoir Date: Thu, 28 Apr 2022 02:33:51 +0300 Subject: graphics: add the hii string drawing routine --- UefiMonitorTest/Graphics.c | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) (limited to 'UefiMonitorTest/Graphics.c') diff --git a/UefiMonitorTest/Graphics.c b/UefiMonitorTest/Graphics.c index 2efbbdd..e6dd6b6 100644 --- a/UefiMonitorTest/Graphics.c +++ b/UefiMonitorTest/Graphics.c @@ -1,5 +1,6 @@ #include #include +#include #include #include #include @@ -547,3 +548,31 @@ DrawStringF ( VA_END (Marker); return NumberOfPrinted; } + +UINTN +EFIAPI +DrawHiiStringF ( + IN GRAPHICS_CONTEXT *Graphics, + IN UINTN X, + IN UINTN Y, + IN CONST GRAPHICS_PIXEL_COLOR *Color, + IN CONST EFI_STRING_ID HiiFormatStringId, + IN CONST EFI_HII_HANDLE HiiFormatHandle, + ... + ) +{ + VA_LIST Marker; + CHAR16 *HiiFormatString; + UINTN NumberOfPrinted; + + NumberOfPrinted = 0; + + VA_START (Marker, HiiFormatHandle); + HiiFormatString = HiiGetString (HiiFormatHandle, HiiFormatStringId, NULL); + if (HiiFormatString != NULL) { + NumberOfPrinted = DrawStringVF(Graphics, X, Y, Color, HiiFormatString, Marker); + FreePool (HiiFormatString); + } + VA_END (Marker); + return NumberOfPrinted; +} -- cgit v1.2.3-18-g5258