11#include <Protocol/DevicePath.h>
12#include <Protocol/LoadedImage.h>
16#include <Library/UefiLib.h>
17#include <Library/BaseMemoryLib.h>
21#include <Library/DevicePathLib.h>
22#include <Library/MemoryAllocationLib.h>
25#include <Library/UefiBootServicesTableLib.h>
26#include <Library/UefiRuntimeServicesTableLib.h>
27#include <Library/UefiApplicationEntryPoint.h>
37#define DEFAULT_CURSOR_OFFSET_X BOOT_CURSOR_OFFSET
38#define DEFAULT_CURSOR_OFFSET_Y 112U
58 if (EFI_ERROR (Status)) {
103 *ChosenBootEntry = NULL;
123 if (EFI_ERROR (Status)) {
133 (UINT8)BootContext->BootEntryCount
135 if (EFI_ERROR (Status)) {
140 for (Index = 0; Index < BootContext->BootEntryCount; ++Index) {
142 BootContext->PickerContext,
147 if (EFI_ERROR (Status)) {
156 (UINT8)BootContext->DefaultEntry->EntryIndex - 1
161 if (BootContext->PickerContext->PickerAudioAssist) {
162 BootContext->PickerContext->PlayAudioFile (
163 BootContext->PickerContext,
168 for (Index = 0; Index < BootContext->BootEntryCount; ++Index) {
169 BootContext->PickerContext->PlayAudioEntry (
170 BootContext->PickerContext,
173 if ((BootContext->PickerContext->TimeoutSeconds > 0) && (BootContext->DefaultEntry->EntryIndex - 1 == Index)) {
174 BootContext->PickerContext->PlayAudioFile (
175 BootContext->PickerContext,
183 BootContext->PickerContext->PlayAudioBeep (
184 BootContext->PickerContext,
249 if (EFI_ERROR (Status)) {
262 if (EFI_ERROR (Status)) {
313 if (EFI_ERROR (Status)) {
331 IN EFI_HANDLE ImageHandle,
332 IN EFI_SYSTEM_TABLE *SystemTable
337 EFI_HANDLE NewHandle;
342 Status =
gBS->LocateProtocol (
348 if (!EFI_ERROR (Status)) {
349 DEBUG ((DEBUG_WARN,
"OCUI: Another GUI is already present\n"));
350 return EFI_ALREADY_STARTED;
357 Status =
gBS->InstallMultipleProtocolInterfaces (
364 if (!EFI_ERROR (Status)) {
365 DEBUG ((DEBUG_INFO,
"OCUI: Registered custom GUI protocol\n"));
367 DEBUG ((DEBUG_WARN,
"OCUI: Failed to install GUI protocol - %r\n", Status));
EFI_CONSOLE_CONTROL_SCREEN_MODE
@ EfiConsoleControlScreenGraphics
CONST GUI_IMAGE * InternalGetCursorImage(IN BOOT_PICKER_GUI_CONTEXT *Context)
VOID BootPickerViewLateInitialize(IN OUT GUI_DRAWING_CONTEXT *DrawContext, IN BOOT_PICKER_GUI_CONTEXT *GuiContext, IN UINT8 DefaultIndex)
EFI_STATUS BootPickerEntriesSet(IN OC_PICKER_CONTEXT *Context, IN BOOT_PICKER_GUI_CONTEXT *GuiContext, IN OC_BOOT_ENTRY *Entry, IN UINT8 EntryIndex)
EFI_STATUS PasswordViewInitialize(OUT GUI_DRAWING_CONTEXT *DrawContext, IN BOOT_PICKER_GUI_CONTEXT *GuiContext)
VOID BootPickerViewDeinitialize(IN OUT GUI_DRAWING_CONTEXT *DrawContext, IN OUT BOOT_PICKER_GUI_CONTEXT *GuiContext)
EFI_STATUS BootPickerViewInitialize(OUT GUI_DRAWING_CONTEXT *DrawContext, IN BOOT_PICKER_GUI_CONTEXT *GuiContext, IN GUI_CURSOR_GET_IMAGE GetCursorImage, IN UINT8 NumBootEntries)
VOID PasswordViewDeinitialize(IN OUT GUI_DRAWING_CONTEXT *DrawContext, IN OUT BOOT_PICKER_GUI_CONTEXT *GuiContext)
#define OC_VOICE_OVER_AUDIO_FILE_DEFAULT
#define OC_VOICE_OVER_AUDIO_FILE_CHOOSE_OS
#define OC_VOICE_OVER_AUDIO_BASE_TYPE_OPEN_CORE
#define OC_ATTR_REDUCE_MOTION
#define OC_VOICE_OVER_SILENCE_NORMAL_MS
From boot.efi, constant.
#define OC_VOICE_OVER_SIGNAL_NORMAL_MS
From boot.efi, constant.
#define OC_VOICE_OVER_SIGNALS_NORMAL
Username prompt or any input for boot.efi.
#define DEFAULT_CURSOR_OFFSET_X
EFI_STATUS EFIAPI OcShowMenuByOc(IN OC_BOOT_CONTEXT *BootContext, IN OC_BOOT_ENTRY **BootEntries, OUT OC_BOOT_ENTRY **ChosenBootEntry)
STATIC VOID OcSetInitialCursorOffset(VOID)
EFI_STATUS EFIAPI UefiMain(IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable)
STATIC EFI_CONSOLE_CONTROL_SCREEN_MODE mPreviousMode
STATIC EFI_STATUS OcShowMenuByOcEnter(IN BOOT_PICKER_GUI_CONTEXT *GuiContext)
STATIC VOID OcShowMenuByOcLeave(VOID)
STATIC EFI_STATUS EFIAPI GuiOcInterfacePopulate(IN OC_INTERFACE_PROTOCOL *This, IN OC_STORAGE_CONTEXT *Storage, IN OC_PICKER_CONTEXT *Context)
STATIC GUI_DRAWING_CONTEXT mDrawContext
EFI_STATUS EFIAPI OcShowPasswordByOc(IN OC_PICKER_CONTEXT *Context, IN OC_PRIVILEGE_LEVEL Level)
EFI_STATUS InternalContextConstruct(OUT BOOT_PICKER_GUI_CONTEXT *Context, IN OC_STORAGE_CONTEXT *Storage, IN OC_PICKER_CONTEXT *Picker)
#define DEFAULT_CURSOR_OFFSET_Y
STATIC OC_INTERFACE_PROTOCOL mOcInterface
BOOT_PICKER_GUI_CONTEXT mGuiContext
EFI_CONSOLE_CONTROL_SCREEN_MODE OcConsoleControlSetMode(IN EFI_CONSOLE_CONTROL_SCREEN_MODE Mode)
#define OC_INTERFACE_REVISION
EFI_GUID gOcInterfaceProtocolGuid
VOID GuiRedrawAndFlushScreen(IN OUT GUI_DRAWING_CONTEXT *DrawContext)
VOID GuiClearScreen(IN OUT GUI_DRAWING_CONTEXT *DrawContext, IN EFI_GRAPHICS_OUTPUT_BLT_PIXEL *Pixel)
EFI_STATUS GuiLibConstruct(IN BOOT_PICKER_GUI_CONTEXT *GuiContext, IN INT32 CursorOffsetX, IN INT32 CursorOffsetY)
VOID GuiDrawLoop(IN OUT GUI_DRAWING_CONTEXT *DrawContext)
VOID GuiLibDestruct(VOID)
OC_PICKER_CONTEXT * PickerContext
INT32 AudioPlaybackTimeout
BOOLEAN UsePasswordEaseIn
EFI_GRAPHICS_OUTPUT_BLT_PIXEL_UNION BackgroundColor