OpenCore  1.0.4
OpenCore Bootloader
Loading...
Searching...
No Matches
Common.c File Reference
#include <Base.h>
#include <Protocol/OcAudio.h>
#include <Library/DebugLib.h>
#include "../OpenCanopy.h"
#include "../GuiApp.h"
#include <Library/BaseLib.h>
#include <Library/UefiRuntimeServicesTableLib.h>
#include <Library/ResetSystemLib.h>
#include "Common.h"

Go to the source code of this file.

Functions

VOID GuiDrawChildImage (IN CONST GUI_IMAGE *Image, IN UINT8 Opacity, IN OUT GUI_DRAWING_CONTEXT *DrawContext, IN INT64 ParentBaseX, IN INT64 ParentBaseY, IN INT64 ChildBaseX, IN INT64 ChildBaseY, IN UINT32 OffsetX, IN UINT32 OffsetY, IN UINT32 Width, IN UINT32 Height)
 
BOOLEAN GuiClickableIsHit (IN CONST GUI_IMAGE *Image, IN INT64 OffsetX, IN INT64 OffsetY)
 
GUI_OBJInternalFocusKeyHandler (IN OUT GUI_DRAWING_CONTEXT *DrawContext, IN BOOT_PICKER_GUI_CONTEXT *Context, IN CONST GUI_KEY_EVENT *KeyEvent)
 
VOID InternalResetFocus (IN OUT GUI_DRAWING_CONTEXT *DrawContext)
 
VOID InternalCommonViewDraw (IN OUT GUI_OBJ *This, IN OUT GUI_DRAWING_CONTEXT *DrawContext, IN BOOT_PICKER_GUI_CONTEXT *Context, IN INT64 BaseX, IN INT64 BaseY, IN UINT32 OffsetX, IN UINT32 OffsetY, IN UINT32 Width, IN UINT32 Height, IN UINT8 Opacity)
 
GUI_OBJInternalCommonViewPtrEvent (IN OUT GUI_OBJ *This, IN OUT GUI_DRAWING_CONTEXT *DrawContext, IN BOOT_PICKER_GUI_CONTEXT *Context, IN INT64 BaseX, IN INT64 BaseY, IN CONST GUI_PTR_EVENT *Event)
 
VOID InternalCommonSimpleButtonDraw (IN OUT GUI_OBJ *This, IN OUT GUI_DRAWING_CONTEXT *DrawContext, IN BOOT_PICKER_GUI_CONTEXT *Context, IN INT64 BaseX, IN INT64 BaseY, IN UINT32 OffsetX, IN UINT32 OffsetY, IN UINT32 Width, IN UINT32 Height, IN UINT8 Opacity)
 
UINT8 InternalCommonSimpleButtonPtrEvent (IN OUT GUI_OBJ *This, IN OUT GUI_DRAWING_CONTEXT *DrawContext, IN BOOT_PICKER_GUI_CONTEXT *Context, IN INT64 BaseX, IN INT64 BaseY, IN CONST GUI_PTR_EVENT *Event)
 
VOID InternalCommonSimpleButtonFocusDraw (IN OUT GUI_OBJ *This, IN OUT GUI_DRAWING_CONTEXT *DrawContext, IN BOOT_PICKER_GUI_CONTEXT *Context, IN INT64 BaseX, IN INT64 BaseY, IN UINT32 OffsetX, IN UINT32 OffsetY, IN UINT32 Width, IN UINT32 Height, IN UINT8 Opacity)
 
VOID InternalCommonShutDownKeyEvent (IN OUT GUI_OBJ *This, IN OUT GUI_DRAWING_CONTEXT *DrawContext, IN BOOT_PICKER_GUI_CONTEXT *Context, IN CONST GUI_KEY_EVENT *KeyEvent)
 
GUI_OBJInternalCommonShutDownPtrEvent (IN OUT GUI_OBJ *This, IN OUT GUI_DRAWING_CONTEXT *DrawContext, IN BOOT_PICKER_GUI_CONTEXT *Context, IN INT64 BaseX, IN INT64 BaseY, IN CONST GUI_PTR_EVENT *Event)
 
VOID InternalCommonRestartKeyEvent (IN OUT GUI_OBJ *This, IN OUT GUI_DRAWING_CONTEXT *DrawContext, IN BOOT_PICKER_GUI_CONTEXT *Context, IN CONST GUI_KEY_EVENT *KeyEvent)
 
GUI_OBJInternalCommonRestartPtrEvent (IN OUT GUI_OBJ *This, IN OUT GUI_DRAWING_CONTEXT *DrawContext, IN BOOT_PICKER_GUI_CONTEXT *Context, IN INT64 BaseX, IN INT64 BaseY, IN CONST GUI_PTR_EVENT *Event)
 
VOID InternalCommonActionButtonFocus (IN CONST GUI_OBJ *This, IN OUT GUI_DRAWING_CONTEXT *DrawContext, IN BOOLEAN Focus)
 
VOID CommonViewInitialize (IN OUT GUI_DRAWING_CONTEXT *DrawContext, IN BOOT_PICKER_GUI_CONTEXT *GuiContext, IN CONST GUI_VIEW_CONTEXT *ViewContext)
 

Variables

GLOBAL_REMOVE_IF_UNREFERENCED INT64 mBackgroundImageOffsetX
 
GLOBAL_REMOVE_IF_UNREFERENCED INT64 mBackgroundImageOffsetY
 
GLOBAL_REMOVE_IF_UNREFERENCED GUI_INTERPOLATION mCommonIntroOpacityInterpol
 
STATIC UINT8 mCommonFocusState = 0
 
STATIC GUI_OBJ ** mCommonFocusList = NULL
 
STATIC UINT8 mNumCommonFocusList = 0
 
GUI_OBJ_CHILD mCommonFocus
 
STATIC GUI_OBJ_CHILDmCommonActionButtonsContainerChildren []
 
GLOBAL_REMOVE_IF_UNREFERENCED GUI_OBJ_CLICKABLE mCommonRestart
 
GLOBAL_REMOVE_IF_UNREFERENCED GUI_OBJ_CLICKABLE mCommonShutDown
 
GLOBAL_REMOVE_IF_UNREFERENCED GUI_OBJ_CHILD mCommonActionButtonsContainer
 

Function Documentation

◆ CommonViewInitialize()

VOID CommonViewInitialize ( IN OUT GUI_DRAWING_CONTEXT * DrawContext,
IN BOOT_PICKER_GUI_CONTEXT * GuiContext,
IN CONST GUI_VIEW_CONTEXT * ViewContext )

Definition at line 657 of file Common.c.

◆ GuiClickableIsHit()

BOOLEAN GuiClickableIsHit ( IN CONST GUI_IMAGE * Image,
IN INT64 OffsetX,
IN INT64 OffsetY )

Definition at line 90 of file Common.c.

◆ GuiDrawChildImage()

VOID GuiDrawChildImage ( IN CONST GUI_IMAGE * Image,
IN UINT8 Opacity,
IN OUT GUI_DRAWING_CONTEXT * DrawContext,
IN INT64 ParentBaseX,
IN INT64 ParentBaseY,
IN INT64 ChildBaseX,
IN INT64 ChildBaseY,
IN UINT32 OffsetX,
IN UINT32 OffsetY,
IN UINT32 Width,
IN UINT32 Height )

Definition at line 37 of file Common.c.

◆ InternalCommonActionButtonFocus()

VOID InternalCommonActionButtonFocus ( IN CONST GUI_OBJ * This,
IN OUT GUI_DRAWING_CONTEXT * DrawContext,
IN BOOLEAN Focus )

Definition at line 555 of file Common.c.

◆ InternalCommonRestartKeyEvent()

VOID InternalCommonRestartKeyEvent ( IN OUT GUI_OBJ * This,
IN OUT GUI_DRAWING_CONTEXT * DrawContext,
IN BOOT_PICKER_GUI_CONTEXT * Context,
IN CONST GUI_KEY_EVENT * KeyEvent )

Definition at line 480 of file Common.c.

◆ InternalCommonRestartPtrEvent()

GUI_OBJ * InternalCommonRestartPtrEvent ( IN OUT GUI_OBJ * This,
IN OUT GUI_DRAWING_CONTEXT * DrawContext,
IN BOOT_PICKER_GUI_CONTEXT * Context,
IN INT64 BaseX,
IN INT64 BaseY,
IN CONST GUI_PTR_EVENT * Event )

Definition at line 504 of file Common.c.

◆ InternalCommonShutDownKeyEvent()

VOID InternalCommonShutDownKeyEvent ( IN OUT GUI_OBJ * This,
IN OUT GUI_DRAWING_CONTEXT * DrawContext,
IN BOOT_PICKER_GUI_CONTEXT * Context,
IN CONST GUI_KEY_EVENT * KeyEvent )

Definition at line 413 of file Common.c.

◆ InternalCommonShutDownPtrEvent()

GUI_OBJ * InternalCommonShutDownPtrEvent ( IN OUT GUI_OBJ * This,
IN OUT GUI_DRAWING_CONTEXT * DrawContext,
IN BOOT_PICKER_GUI_CONTEXT * Context,
IN INT64 BaseX,
IN INT64 BaseY,
IN CONST GUI_PTR_EVENT * Event )

Definition at line 437 of file Common.c.

◆ InternalCommonSimpleButtonDraw()

VOID InternalCommonSimpleButtonDraw ( IN OUT GUI_OBJ * This,
IN OUT GUI_DRAWING_CONTEXT * DrawContext,
IN BOOT_PICKER_GUI_CONTEXT * Context,
IN INT64 BaseX,
IN INT64 BaseY,
IN UINT32 OffsetX,
IN UINT32 OffsetY,
IN UINT32 Width,
IN UINT32 Height,
IN UINT8 Opacity )

Definition at line 263 of file Common.c.

◆ InternalCommonSimpleButtonFocusDraw()

VOID InternalCommonSimpleButtonFocusDraw ( IN OUT GUI_OBJ * This,
IN OUT GUI_DRAWING_CONTEXT * DrawContext,
IN BOOT_PICKER_GUI_CONTEXT * Context,
IN INT64 BaseX,
IN INT64 BaseY,
IN UINT32 OffsetX,
IN UINT32 OffsetY,
IN UINT32 Width,
IN UINT32 Height,
IN UINT8 Opacity )

Definition at line 376 of file Common.c.

◆ InternalCommonSimpleButtonPtrEvent()

UINT8 InternalCommonSimpleButtonPtrEvent ( IN OUT GUI_OBJ * This,
IN OUT GUI_DRAWING_CONTEXT * DrawContext,
IN BOOT_PICKER_GUI_CONTEXT * Context,
IN INT64 BaseX,
IN INT64 BaseY,
IN CONST GUI_PTR_EVENT * Event )

Definition at line 309 of file Common.c.

◆ InternalCommonViewDraw()

VOID InternalCommonViewDraw ( IN OUT GUI_OBJ * This,
IN OUT GUI_DRAWING_CONTEXT * DrawContext,
IN BOOT_PICKER_GUI_CONTEXT * Context,
IN INT64 BaseX,
IN INT64 BaseY,
IN UINT32 OffsetX,
IN UINT32 OffsetY,
IN UINT32 Width,
IN UINT32 Height,
IN UINT8 Opacity )

Definition at line 189 of file Common.c.

◆ InternalCommonViewPtrEvent()

GUI_OBJ * InternalCommonViewPtrEvent ( IN OUT GUI_OBJ * This,
IN OUT GUI_DRAWING_CONTEXT * DrawContext,
IN BOOT_PICKER_GUI_CONTEXT * Context,
IN INT64 BaseX,
IN INT64 BaseY,
IN CONST GUI_PTR_EVENT * Event )

Definition at line 249 of file Common.c.

◆ InternalFocusKeyHandler()

GUI_OBJ * InternalFocusKeyHandler ( IN OUT GUI_DRAWING_CONTEXT * DrawContext,
IN BOOT_PICKER_GUI_CONTEXT * Context,
IN CONST GUI_KEY_EVENT * KeyEvent )

Definition at line 109 of file Common.c.

◆ InternalResetFocus()

VOID InternalResetFocus ( IN OUT GUI_DRAWING_CONTEXT * DrawContext)

Definition at line 165 of file Common.c.

Variable Documentation

◆ mBackgroundImageOffsetX

GLOBAL_REMOVE_IF_UNREFERENCED INT64 mBackgroundImageOffsetX

Definition at line 19 of file Common.c.

◆ mBackgroundImageOffsetY

GLOBAL_REMOVE_IF_UNREFERENCED INT64 mBackgroundImageOffsetY

Definition at line 20 of file Common.c.

◆ mCommonActionButtonsContainer

GLOBAL_REMOVE_IF_UNREFERENCED GUI_OBJ_CHILD mCommonActionButtonsContainer
Initial value:
= {
{
0, 0, 0, 0, 0,
NULL,
NULL,
},
NULL
}
#define ARRAY_SIZE(Array)
Definition AppleMacEfi.h:34
STATIC GUI_OBJ_CHILD * mCommonActionButtonsContainerChildren[]
Definition Common.c:548
GUI_OBJ * GuiObjDelegatePtrEvent(IN OUT GUI_OBJ *This, IN OUT GUI_DRAWING_CONTEXT *DrawContext, IN BOOT_PICKER_GUI_CONTEXT *Context, IN INT64 BaseX, IN INT64 BaseY, IN CONST GUI_PTR_EVENT *Event)
Definition OpenCanopy.c:226
VOID GuiObjDrawDelegate(IN OUT GUI_OBJ *This, IN OUT GUI_DRAWING_CONTEXT *DrawContext, IN BOOT_PICKER_GUI_CONTEXT *Context, IN INT64 BaseX, IN INT64 BaseY, IN UINT32 OffsetX, IN UINT32 OffsetY, IN UINT32 Width, IN UINT32 Height, IN UINT8 Opacity)
Definition OpenCanopy.c:137

Definition at line 643 of file Common.c.

◆ mCommonActionButtonsContainerChildren

STATIC GUI_OBJ_CHILD* mCommonActionButtonsContainerChildren[]
Initial value:
= {
}
GLOBAL_REMOVE_IF_UNREFERENCED GUI_OBJ_CLICKABLE mCommonShutDown
Definition Common.c:626
GLOBAL_REMOVE_IF_UNREFERENCED GUI_OBJ_CLICKABLE mCommonRestart
Definition Common.c:609
GUI_OBJ_CHILD mCommonFocus
Definition Common.c:596
GUI_OBJ_CHILD Hdr
Definition Common.h:7

Definition at line 548 of file Common.c.

◆ mCommonFocus

GLOBAL_REMOVE_IF_UNREFERENCED GUI_OBJ_CHILD mCommonFocus
Initial value:
= {
{
0, 0, 0, 0, 0xFF,
NULL,
NULL,
0,
NULL
},
}
VOID InternalCommonSimpleButtonFocusDraw(IN OUT GUI_OBJ *This, IN OUT GUI_DRAWING_CONTEXT *DrawContext, IN BOOT_PICKER_GUI_CONTEXT *Context, IN INT64 BaseX, IN INT64 BaseY, IN UINT32 OffsetX, IN UINT32 OffsetY, IN UINT32 Width, IN UINT32 Height, IN UINT8 Opacity)
Definition Common.c:376
GLOBAL_REMOVE_IF_UNREFERENCED GUI_OBJ_CHILD mCommonActionButtonsContainer
Definition Common.c:643

Definition at line 596 of file Common.c.

◆ mCommonFocusList

STATIC GUI_OBJ** mCommonFocusList = NULL

Definition at line 33 of file Common.c.

◆ mCommonFocusState

STATIC UINT8 mCommonFocusState = 0

Definition at line 31 of file Common.c.

◆ mCommonIntroOpacityInterpol

GLOBAL_REMOVE_IF_UNREFERENCED GUI_INTERPOLATION mCommonIntroOpacityInterpol
Initial value:
= {
0,
25,
0,
0xFF,
0
}
@ GuiInterpolTypeSmooth
Definition OpenCanopy.h:349

Definition at line 22 of file Common.c.

◆ mCommonRestart

GLOBAL_REMOVE_IF_UNREFERENCED GUI_OBJ_CLICKABLE mCommonRestart
Initial value:
= {
{
{
0, 0, 0, 0, 0xFF,
0,
NULL
},
},
0,
0
}
VOID InternalCommonSimpleButtonDraw(IN OUT GUI_OBJ *This, IN OUT GUI_DRAWING_CONTEXT *DrawContext, IN BOOT_PICKER_GUI_CONTEXT *Context, IN INT64 BaseX, IN INT64 BaseY, IN UINT32 OffsetX, IN UINT32 OffsetY, IN UINT32 Width, IN UINT32 Height, IN UINT8 Opacity)
Definition Common.c:263
VOID InternalCommonRestartKeyEvent(IN OUT GUI_OBJ *This, IN OUT GUI_DRAWING_CONTEXT *DrawContext, IN BOOT_PICKER_GUI_CONTEXT *Context, IN CONST GUI_KEY_EVENT *KeyEvent)
Definition Common.c:480
GUI_OBJ * InternalCommonRestartPtrEvent(IN OUT GUI_OBJ *This, IN OUT GUI_DRAWING_CONTEXT *DrawContext, IN BOOT_PICKER_GUI_CONTEXT *Context, IN INT64 BaseX, IN INT64 BaseY, IN CONST GUI_PTR_EVENT *Event)
Definition Common.c:504
VOID InternalCommonActionButtonFocus(IN CONST GUI_OBJ *This, IN OUT GUI_DRAWING_CONTEXT *DrawContext, IN BOOLEAN Focus)
Definition Common.c:555

Definition at line 609 of file Common.c.

◆ mCommonShutDown

GLOBAL_REMOVE_IF_UNREFERENCED GUI_OBJ_CLICKABLE mCommonShutDown
Initial value:
= {
{
{
0, 0, 0, 0, 0xFF,
0,
NULL
},
},
0,
0
}
GUI_OBJ * InternalCommonShutDownPtrEvent(IN OUT GUI_OBJ *This, IN OUT GUI_DRAWING_CONTEXT *DrawContext, IN BOOT_PICKER_GUI_CONTEXT *Context, IN INT64 BaseX, IN INT64 BaseY, IN CONST GUI_PTR_EVENT *Event)
Definition Common.c:437
VOID InternalCommonShutDownKeyEvent(IN OUT GUI_OBJ *This, IN OUT GUI_DRAWING_CONTEXT *DrawContext, IN BOOT_PICKER_GUI_CONTEXT *Context, IN CONST GUI_KEY_EVENT *KeyEvent)
Definition Common.c:413

Definition at line 626 of file Common.c.

◆ mNumCommonFocusList

STATIC UINT8 mNumCommonFocusList = 0

Definition at line 34 of file Common.c.