OpenCore  1.0.4
OpenCore Bootloader
Loading...
Searching...
No Matches
GuiApp.c File Reference
#include <Uefi.h>
#include <IndustryStandard/AppleIcon.h>
#include <Protocol/OcInterface.h>
#include <Library/DebugLib.h>
#include <Library/MemoryAllocationLib.h>
#include <Library/OcBootManagementLib.h>
#include <Library/OcStorageLib.h>
#include <Library/UefiBootServicesTableLib.h>
#include <Library/UefiRuntimeServicesTableLib.h>
#include <Library/PrintLib.h>
#include <Library/BaseLib.h>
#include <Guid/AppleVariable.h>
#include <Protocol/UserInterfaceTheme.h>
#include "OpenCanopy.h"
#include "BmfLib.h"
#include "GuiApp.h"

Go to the source code of this file.

Functions

STATIC VOID InternalSafeFreePool (IN CONST VOID *Memory)
 
STATIC VOID InternalContextDestruct (IN OUT BOOT_PICKER_GUI_CONTEXT *Context)
 
STATIC EFI_STATUS LoadImageFileFromStorage (OUT GUI_IMAGE *Images, IN OC_STORAGE_CONTEXT *Storage, IN CONST CHAR8 *ImageFilePath, IN UINT8 Scale, IN UINT32 MatchWidth, IN UINT32 MatchHeight, IN BOOLEAN Icon, IN CONST CHAR8 *Prefix, IN BOOLEAN AllowLessSize)
 
STATIC EFI_STATUS LoadLabelFileFromStorageForScale (IN OC_STORAGE_CONTEXT *Storage, IN CONST CHAR8 *LabelFilePath, IN UINT8 Scale, OUT VOID **FileData, OUT UINT32 *FileSize)
 
EFI_STATUS LoadLabelFromStorage (IN OC_STORAGE_CONTEXT *Storage, IN CONST CHAR8 *ImageFilePath, IN UINT8 Scale, IN BOOLEAN Inverted, OUT GUI_IMAGE *Image)
 
EFI_STATUS InternalGetFlavourIcon (IN BOOT_PICKER_GUI_CONTEXT *GuiContext, IN OC_STORAGE_CONTEXT *Storage, IN CHAR8 *FlavourName, IN UINTN FlavourNameLen, IN UINT32 IconTypeIndex, IN BOOLEAN UseFlavourIcon, OUT GUI_IMAGE *EntryIcon, OUT BOOLEAN *CustomIcon)
 
EFI_STATUS InternalContextConstruct (OUT BOOT_PICKER_GUI_CONTEXT *Context, IN OC_STORAGE_CONTEXT *Storage, IN OC_PICKER_CONTEXT *Picker)
 
CONST GUI_IMAGEInternalGetCursorImage (IN BOOT_PICKER_GUI_CONTEXT *Context)
 

Variables

GLOBAL_REMOVE_IF_UNREFERENCED BOOT_PICKER_GUI_CONTEXT mGuiContext
 
STATIC EFI_GRAPHICS_OUTPUT_BLT_PIXEL mHighlightPixel = { 0xAF, 0xAF, 0xAF, 0x32 }
 
STATIC CONST CHAR8 * mLabelNames [LABEL_NUM_TOTAL]
 
STATIC CONST CHAR8 * mIconNames [ICON_NUM_TOTAL]
 

Detailed Description

This file is part of OpenCanopy, OpenCore GUI.

Copyright (c) 2018-2019, Download-Fritz. All rights reserved.
SPDX-License-Identifier: BSD-3-Clause

Definition in file GuiApp.c.

Function Documentation

◆ InternalContextConstruct()

EFI_STATUS InternalContextConstruct ( OUT BOOT_PICKER_GUI_CONTEXT * Context,
IN OC_STORAGE_CONTEXT * Storage,
IN OC_PICKER_CONTEXT * Picker )

Definition at line 389 of file GuiApp.c.

◆ InternalContextDestruct()

STATIC VOID InternalContextDestruct ( IN OUT BOOT_PICKER_GUI_CONTEXT * Context)

Definition at line 94 of file GuiApp.c.

◆ InternalGetCursorImage()

CONST GUI_IMAGE * InternalGetCursorImage ( IN BOOT_PICKER_GUI_CONTEXT * Context)

Definition at line 663 of file GuiApp.c.

◆ InternalGetFlavourIcon()

EFI_STATUS InternalGetFlavourIcon ( IN BOOT_PICKER_GUI_CONTEXT * GuiContext,
IN OC_STORAGE_CONTEXT * Storage,
IN CHAR8 * FlavourName,
IN UINTN FlavourNameLen,
IN UINT32 IconTypeIndex,
IN BOOLEAN UseFlavourIcon,
OUT GUI_IMAGE * EntryIcon,
OUT BOOLEAN * CustomIcon )

Definition at line 287 of file GuiApp.c.

◆ InternalSafeFreePool()

STATIC VOID InternalSafeFreePool ( IN CONST VOID * Memory)

Definition at line 83 of file GuiApp.c.

◆ LoadImageFileFromStorage()

STATIC EFI_STATUS LoadImageFileFromStorage ( OUT GUI_IMAGE * Images,
IN OC_STORAGE_CONTEXT * Storage,
IN CONST CHAR8 * ImageFilePath,
IN UINT8 Scale,
IN UINT32 MatchWidth,
IN UINT32 MatchHeight,
IN BOOLEAN Icon,
IN CONST CHAR8 * Prefix,
IN BOOLEAN AllowLessSize )

< Icons can be external.

Definition at line 125 of file GuiApp.c.

◆ LoadLabelFileFromStorageForScale()

STATIC EFI_STATUS LoadLabelFileFromStorageForScale ( IN OC_STORAGE_CONTEXT * Storage,
IN CONST CHAR8 * LabelFilePath,
IN UINT8 Scale,
OUT VOID ** FileData,
OUT UINT32 * FileSize )

Definition at line 214 of file GuiApp.c.

◆ LoadLabelFromStorage()

EFI_STATUS LoadLabelFromStorage ( IN OC_STORAGE_CONTEXT * Storage,
IN CONST CHAR8 * ImageFilePath,
IN UINT8 Scale,
IN BOOLEAN Inverted,
OUT GUI_IMAGE * Image )

Definition at line 256 of file GuiApp.c.

Variable Documentation

◆ mGuiContext

GLOBAL_REMOVE_IF_UNREFERENCED BOOT_PICKER_GUI_CONTEXT mGuiContext

Definition at line 29 of file GuiApp.c.

◆ mHighlightPixel

STATIC EFI_GRAPHICS_OUTPUT_BLT_PIXEL mHighlightPixel = { 0xAF, 0xAF, 0xAF, 0x32 }

Definition at line 34 of file GuiApp.c.

◆ mIconNames

STATIC CONST CHAR8* mIconNames[ICON_NUM_TOTAL]
Initial value:
= {
[ICON_CURSOR] = "Cursor",
[ICON_SELECTED] = "Selected",
[ICON_SELECTOR] = "Selector",
[ICON_SET_DEFAULT] = "SetDefault",
[ICON_LEFT] = "Left",
[ICON_RIGHT] = "Right",
[ICON_SHUT_DOWN] = "ShutDown",
[ICON_RESTART] = "Restart",
[ICON_BUTTON_FOCUS] = "BtnFocus",
[ICON_PASSWORD] = "Password",
[ICON_DOT] = "Dot",
[ICON_ENTER] = "Enter",
[ICON_LOCK] = "Lock",
[ICON_GENERIC_HDD] = "HardDrive",
[ICON_APPLE] = "Apple",
[ICON_APPLE_RECOVERY] = "AppleRecv",
[ICON_APPLE_TIME_MACHINE] = "AppleTM",
[ICON_WINDOWS] = "Windows",
[ICON_OTHER] = "Other",
[ICON_TOOL] = "Tool",
[ICON_RESET_NVRAM] = "ResetNVRAM",
[ICON_SHELL] = "Shell"
}
@ ICON_APPLE_RECOVERY
Definition GuiApp.h:92
@ ICON_ENTER
Definition GuiApp.h:86
@ ICON_SET_DEFAULT
Definition GuiApp.h:78
@ ICON_LOCK
Definition GuiApp.h:87
@ ICON_TOOL
Definition GuiApp.h:96
@ ICON_OTHER
Definition GuiApp.h:95
@ ICON_CURSOR
Definition GuiApp.h:75
@ ICON_APPLE
Definition GuiApp.h:91
@ ICON_DOT
Definition GuiApp.h:85
@ ICON_SELECTOR
Definition GuiApp.h:77
@ ICON_GENERIC_HDD
Definition GuiApp.h:89
@ ICON_LEFT
Definition GuiApp.h:79
@ ICON_BUTTON_FOCUS
Definition GuiApp.h:83
@ ICON_RESTART
Definition GuiApp.h:82
@ ICON_WINDOWS
Definition GuiApp.h:94
@ ICON_APPLE_TIME_MACHINE
Definition GuiApp.h:93
@ ICON_SHELL
Definition GuiApp.h:98
@ ICON_RESET_NVRAM
Definition GuiApp.h:97
@ ICON_RIGHT
Definition GuiApp.h:80
@ ICON_SELECTED
Definition GuiApp.h:76
@ ICON_SHUT_DOWN
Definition GuiApp.h:81
@ ICON_PASSWORD
Definition GuiApp.h:84

Definition at line 56 of file GuiApp.c.

◆ mLabelNames

STATIC CONST CHAR8* mLabelNames[LABEL_NUM_TOTAL]
Initial value:
= {
[LABEL_GENERIC_HDD] = "EFIBoot",
[LABEL_APPLE] = "Apple",
[LABEL_APPLE_RECOVERY] = "AppleRecv",
[LABEL_APPLE_TIME_MACHINE] = "AppleTM",
[LABEL_WINDOWS] = "Windows",
[LABEL_OTHER] = "Other",
[LABEL_TOOL] = "Tool",
[LABEL_RESET_NVRAM] = "ResetNVRAM",
[LABEL_SHELL] = "Shell",
[LABEL_SIP_IS_ENABLED] = "SIPEnabled",
[LABEL_SIP_IS_DISABLED] = "SIPDisabled",
[LABEL_FIRMWARE_SETTINGS] = "FirmwareSettings",
[LABEL_NETWORK_BOOT] = "NetworkBoot"
}
@ LABEL_RESET_NVRAM
Definition GuiApp.h:65
@ LABEL_SHELL
Definition GuiApp.h:66
@ LABEL_APPLE
Definition GuiApp.h:59
@ LABEL_TOOL
Definition GuiApp.h:64
@ LABEL_OTHER
Definition GuiApp.h:63
@ LABEL_FIRMWARE_SETTINGS
Definition GuiApp.h:69
@ LABEL_SIP_IS_DISABLED
Definition GuiApp.h:68
@ LABEL_NETWORK_BOOT
Definition GuiApp.h:70
@ LABEL_GENERIC_HDD
Definition GuiApp.h:58
@ LABEL_APPLE_RECOVERY
Definition GuiApp.h:60
@ LABEL_APPLE_TIME_MACHINE
Definition GuiApp.h:61
@ LABEL_WINDOWS
Definition GuiApp.h:62
@ LABEL_SIP_IS_ENABLED
Definition GuiApp.h:67

Definition at line 38 of file GuiApp.c.