OpenCore  1.0.4
OpenCore Bootloader
Loading...
Searching...
No Matches
OcAppleUserInterfaceThemeLib.c
Go to the documentation of this file.
1
16#include <Guid/AppleVariable.h>
17#include <Library/DebugLib.h>
18#include <Library/OcMiscLib.h>
19#include <Library/UefiRuntimeServicesTableLib.h>
20#include <Library/UefiBootServicesTableLib.h>
23
24STATIC UINT32 mCurrentColor;
25
26STATIC
27EFI_STATUS
28EFIAPI
30 OUT UINT32 *Color
31 )
32{
33 if (Color == NULL) {
34 return EFI_INVALID_PARAMETER;
35 }
36
37 *Color = mCurrentColor;
38 return EFI_SUCCESS;
39}
40
45
48 IN BOOLEAN Reinstall
49 )
50{
51 EFI_STATUS Status;
52 UINT32 Color;
53 UINTN DataSize;
55 EFI_HANDLE NewHandle;
56
57 if (Reinstall) {
59 if (EFI_ERROR (Status)) {
60 DEBUG ((DEBUG_ERROR, "OCUT: Uninstall failed - %r\n", Status));
61 return NULL;
62 }
63 } else {
64 Status = gBS->LocateProtocol (
66 NULL,
67 (VOID **)&EfiUiInterface
68 );
69 if (!EFI_ERROR (Status)) {
70 return EfiUiInterface;
71 }
72 }
73
74 //
75 // Default color is black
76 //
78
79 DataSize = sizeof (Color);
80 Status = gRT->GetVariable (
83 0,
84 &DataSize,
85 &Color
86 );
87 if (!EFI_ERROR (Status)) {
88 mCurrentColor = Color;
89 }
90
91 NewHandle = NULL;
92 Status = gBS->InstallMultipleProtocolInterfaces (
93 &NewHandle,
96 NULL
97 );
98 if (EFI_ERROR (Status)) {
99 return NULL;
100 }
101
103}
EFI_GUID gAppleVendorVariableGuid
#define APPLE_DEFAULT_BACKGROUND_COLOR_VARIABLE_NAME
STATIC EFI_STATUS EFIAPI UserInterfaceThemeGetColor(OUT UINT32 *Color)
EFI_USER_INTERFACE_THEME_PROTOCOL * OcAppleUserInterfaceThemeInstallProtocol(IN BOOLEAN Reinstall)
STATIC EFI_USER_INTERFACE_THEME_PROTOCOL mAppleUserInterfaceThemeProtocol
STATIC UINT32 mCurrentColor
EFI_BOOT_SERVICES * gBS
EFI_STATUS OcUninstallAllProtocolInstances(EFI_GUID *Protocol)
EFI_RUNTIME_SERVICES * gRT
#define APPLE_COLOR_SYRAH_BLACK
#define USER_THEME_INTERFACE_PROTOCOL_REVISION
EFI_GUID gEfiUserInterfaceThemeProtocolGuid