diff options
author | Joursoir <chat@joursoir.net> | 2022-04-28 02:33:51 +0300 |
---|---|---|
committer | Joursoir <chat@joursoir.net> | 2022-04-28 02:33:51 +0300 |
commit | e6c6a64b8375a6de18e0c52fdf7343fdad957fff (patch) | |
tree | c286f2f708bc9c2ae20c7d8114a1707f4e2b8104 /UefiMonitorTest | |
parent | 0275f6563689be0bc0b2935c0977424809bfeded (diff) | |
download | umt-e6c6a64b8375a6de18e0c52fdf7343fdad957fff.tar.gz umt-e6c6a64b8375a6de18e0c52fdf7343fdad957fff.tar.bz2 umt-e6c6a64b8375a6de18e0c52fdf7343fdad957fff.zip |
graphics: add the hii string drawing routine
Diffstat (limited to 'UefiMonitorTest')
-rw-r--r-- | UefiMonitorTest/Graphics.c | 29 | ||||
-rw-r--r-- | UefiMonitorTest/Graphics.h | 12 |
2 files changed, 41 insertions, 0 deletions
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 <Library/BaseLib.h> #include <Library/DebugLib.h> +#include <Library/HiiLib.h> #include <Library/MemoryAllocationLib.h> #include <Library/BaseMemoryLib.h> #include <Library/PrintLib.h> @@ -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; +} diff --git a/UefiMonitorTest/Graphics.h b/UefiMonitorTest/Graphics.h index c516576..d822e0e 100644 --- a/UefiMonitorTest/Graphics.h +++ b/UefiMonitorTest/Graphics.h @@ -218,4 +218,16 @@ DrawStringF ( ... ); +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, + ... + ); + #endif /* UMT_GRAPHICS_H */ |