OpenCore  1.0.4
OpenCore Bootloader
Loading...
Searching...
No Matches
OpenCanopy.c File Reference
#include <Uefi.h>
#include <IndustryStandard/AppleIcon.h>
#include <IndustryStandard/AppleDiskLabel.h>
#include <Library/BaseLib.h>
#include <Library/BaseMemoryLib.h>
#include <Library/BaseOverflowLib.h>
#include <Library/BmpSupportLib.h>
#include <Library/DebugLib.h>
#include <Library/MemoryAllocationLib.h>
#include <Library/MtrrLib.h>
#include <Library/OcBootManagementLib.h>
#include <Library/OcCompressionLib.h>
#include <Library/OcCpuLib.h>
#include <Library/OcPngLib.h>
#include <Library/TimerLib.h>
#include <Library/UefiBootServicesTableLib.h>
#include "OpenCanopy.h"
#include "GuiIo.h"
#include "GuiApp.h"
#include "Views/BootPicker.h"
#include "Blending.h"

Go to the source code of this file.

Data Structures

struct  GUI_DRAW_REQUEST
 

Macros

#define PIXEL_TO_UINT32(Pixel)
 

Functions

BOOLEAN GuiClipChildBounds (IN INT64 ChildOffset, IN UINT32 ChildLength, IN OUT UINT32 *ReqOffset, IN OUT UINT32 *ReqLength)
 
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)
 
GUI_OBJGuiObjDelegatePtrEvent (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 GuiDrawToBufferFill (IN CONST EFI_GRAPHICS_OUTPUT_BLT_PIXEL *Colour, IN OUT GUI_DRAWING_CONTEXT *DrawContext, IN UINT32 PosX, IN UINT32 PosY, IN UINT32 Width, IN UINT32 Height)
 
VOID GuiDrawToBuffer (IN CONST GUI_IMAGE *Image, IN UINT8 Opacity, IN OUT GUI_DRAWING_CONTEXT *DrawContext, IN INT64 BaseX, IN INT64 BaseY, IN UINT32 OffsetX, IN UINT32 OffsetY, IN UINT32 Width, IN UINT32 Height)
 
VOID GuiRequestDraw (IN UINT32 PosX, IN UINT32 PosY, IN UINT32 Width, IN UINT32 Height)
 
VOID GuiRequestDrawCrop (IN OUT GUI_DRAWING_CONTEXT *DrawContext, IN INT64 X, IN INT64 Y, IN UINT32 Width, IN UINT32 Height)
 
VOID GuiOverlayPointer (IN OUT GUI_DRAWING_CONTEXT *DrawContext)
 
STATIC UINT64 InternalCpuDelayTsc (IN UINT64 Delay)
 
VOID GuiFlushScreen (IN OUT GUI_DRAWING_CONTEXT *DrawContext)
 
VOID GuiRedrawAndFlushScreen (IN OUT GUI_DRAWING_CONTEXT *DrawContext)
 
EFI_STATUS GuiLibConstruct (IN BOOT_PICKER_GUI_CONTEXT *GuiContext, IN INT32 CursorOffsetX, IN INT32 CursorOffsetY)
 
VOID GuiLibDestruct (VOID)
 
VOID GuiViewInitialize (OUT GUI_DRAWING_CONTEXT *DrawContext, IN BOOT_PICKER_GUI_CONTEXT *GuiContext, IN CONST GUI_VIEW_CONTEXT *ViewContext)
 
VOID GuiViewDeinitialize (IN OUT GUI_DRAWING_CONTEXT *DrawContext, OUT BOOT_PICKER_GUI_CONTEXT *GuiContext)
 
VOID GuiGetBaseCoords (IN GUI_OBJ *This, IN GUI_DRAWING_CONTEXT *DrawContext, OUT INT64 *BaseX, OUT INT64 *BaseY)
 
VOID GuiDrawLoop (IN OUT GUI_DRAWING_CONTEXT *DrawContext)
 
VOID GuiClearScreen (IN OUT GUI_DRAWING_CONTEXT *DrawContext, IN EFI_GRAPHICS_OUTPUT_BLT_PIXEL *Pixel)
 
STATIC INT32 isin_S3 (IN INT32 x)
 
UINT32 GuiGetInterpolatedValue (IN CONST GUI_INTERPOLATION *Interpol, IN UINT64 CurrentTime)
 

Variables

STATIC GUI_OUTPUT_CONTEXTmOutputContext = NULL
 
GLOBAL_REMOVE_IF_UNREFERENCED GUI_POINTER_CONTEXTmPointerContext = NULL
 
GLOBAL_REMOVE_IF_UNREFERENCED GUI_KEY_CONTEXTmKeyContext = NULL
 
STATIC EFI_GRAPHICS_OUTPUT_BLT_PIXEL * mScreenBuffer = NULL
 
STATIC UINT32 mScreenBufferDelta = 0
 
STATIC UINT64 mDeltaTscTarget = 0
 
STATIC UINT64 mStartTsc = 0
 
STATIC UINT8 mNumValidDrawReqs = 0
 
STATIC GUI_DRAW_REQUEST mDrawRequests [6]
 
STATIC UINT32 mPointerOldDrawBaseX = 0
 
STATIC UINT32 mPointerOldDrawBaseY = 0
 
STATIC UINT32 mPointerOldDrawWidth = 0
 
STATIC UINT32 mPointerOldDrawHeight = 0
 

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 OpenCanopy.c.

Macro Definition Documentation

◆ PIXEL_TO_UINT32

#define PIXEL_TO_UINT32 ( Pixel)
Value:
((UINT32) SIGNATURE_32 ((Pixel)->Blue, (Pixel)->Green, (Pixel)->Red, (Pixel)->Reserved))
UINT8 Reserved[430]
Definition Apm.h:39

Definition at line 69 of file OpenCanopy.c.

Function Documentation

◆ GuiClearScreen()

VOID GuiClearScreen ( IN OUT GUI_DRAWING_CONTEXT * DrawContext,
IN EFI_GRAPHICS_OUTPUT_BLT_PIXEL * Pixel )

Definition at line 1363 of file OpenCanopy.c.

◆ GuiClipChildBounds()

BOOLEAN GuiClipChildBounds ( IN INT64 ChildOffset,
IN UINT32 ChildLength,
IN OUT UINT32 * ReqOffset,
IN OUT UINT32 * ReqLength )

Definition at line 73 of file OpenCanopy.c.

◆ GuiDrawLoop()

VOID GuiDrawLoop ( IN OUT GUI_DRAWING_CONTEXT * DrawContext)

Definition at line 1055 of file OpenCanopy.c.

◆ GuiDrawToBuffer()

VOID GuiDrawToBuffer ( IN CONST GUI_IMAGE * Image,
IN UINT8 Opacity,
IN OUT GUI_DRAWING_CONTEXT * DrawContext,
IN INT64 BaseX,
IN INT64 BaseY,
IN UINT32 OffsetX,
IN UINT32 OffsetY,
IN UINT32 Width,
IN UINT32 Height )

Definition at line 354 of file OpenCanopy.c.

◆ GuiDrawToBufferFill()

VOID GuiDrawToBufferFill ( IN CONST EFI_GRAPHICS_OUTPUT_BLT_PIXEL * Colour,
IN OUT GUI_DRAWING_CONTEXT * DrawContext,
IN UINT32 PosX,
IN UINT32 PosY,
IN UINT32 Width,
IN UINT32 Height )

Definition at line 276 of file OpenCanopy.c.

◆ GuiFlushScreen()

VOID GuiFlushScreen ( IN OUT GUI_DRAWING_CONTEXT * DrawContext)

Definition at line 750 of file OpenCanopy.c.

◆ GuiGetBaseCoords()

VOID GuiGetBaseCoords ( IN GUI_OBJ * This,
IN GUI_DRAWING_CONTEXT * DrawContext,
OUT INT64 * BaseX,
OUT INT64 * BaseY )

Definition at line 996 of file OpenCanopy.c.

◆ GuiGetInterpolatedValue()

UINT32 GuiGetInterpolatedValue ( IN CONST GUI_INTERPOLATION * Interpol,
IN UINT64 CurrentTime )

Definition at line 1417 of file OpenCanopy.c.

◆ GuiLibConstruct()

EFI_STATUS GuiLibConstruct ( IN BOOT_PICKER_GUI_CONTEXT * GuiContext,
IN INT32 CursorOffsetX,
IN INT32 CursorOffsetY )

Definition at line 846 of file OpenCanopy.c.

◆ GuiLibDestruct()

VOID GuiLibDestruct ( VOID )

Definition at line 922 of file OpenCanopy.c.

◆ GuiObjDelegatePtrEvent()

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 at line 226 of file OpenCanopy.c.

◆ GuiObjDrawDelegate()

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 at line 137 of file OpenCanopy.c.

◆ GuiOverlayPointer()

VOID GuiOverlayPointer ( IN OUT GUI_DRAWING_CONTEXT * DrawContext)

Definition at line 615 of file OpenCanopy.c.

◆ GuiRedrawAndFlushScreen()

VOID GuiRedrawAndFlushScreen ( IN OUT GUI_DRAWING_CONTEXT * DrawContext)

Definition at line 833 of file OpenCanopy.c.

◆ GuiRequestDraw()

VOID GuiRequestDraw ( IN UINT32 PosX,
IN UINT32 PosY,
IN UINT32 Width,
IN UINT32 Height )

Definition at line 475 of file OpenCanopy.c.

◆ GuiRequestDrawCrop()

VOID GuiRequestDrawCrop ( IN OUT GUI_DRAWING_CONTEXT * DrawContext,
IN INT64 X,
IN INT64 Y,
IN UINT32 Width,
IN UINT32 Height )

Definition at line 570 of file OpenCanopy.c.

◆ GuiViewDeinitialize()

VOID GuiViewDeinitialize ( IN OUT GUI_DRAWING_CONTEXT * DrawContext,
OUT BOOT_PICKER_GUI_CONTEXT * GuiContext )

Definition at line 977 of file OpenCanopy.c.

◆ GuiViewInitialize()

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

Definition at line 943 of file OpenCanopy.c.

◆ InternalCpuDelayTsc()

STATIC UINT64 InternalCpuDelayTsc ( IN UINT64 Delay)

Stalls the CPU for at least the given number of ticks.

Stalls the CPU for at least the given number of ticks. It's invoked by MicroSecondDelay() and NanoSecondDelay().

Parameters
DelayA period of time to delay in ticks.

Definition at line 724 of file OpenCanopy.c.

◆ isin_S3()

STATIC INT32 isin_S3 ( IN INT32 x)

A sine approximation via a third-order approx.

Parameters
xAngle (with 2^15 units/circle)
Returns
Sine value (Q12)

Definition at line 1387 of file OpenCanopy.c.

Variable Documentation

◆ mDeltaTscTarget

STATIC UINT64 mDeltaTscTarget = 0

Definition at line 54 of file OpenCanopy.c.

◆ mDrawRequests

STATIC GUI_DRAW_REQUEST mDrawRequests[6]
Initial value:
= {
{ 0 }
}

Definition at line 60 of file OpenCanopy.c.

◆ mKeyContext

GLOBAL_REMOVE_IF_UNREFERENCED GUI_KEY_CONTEXT* mKeyContext = NULL

Definition at line 45 of file OpenCanopy.c.

◆ mNumValidDrawReqs

STATIC UINT8 mNumValidDrawReqs = 0

Definition at line 59 of file OpenCanopy.c.

◆ mOutputContext

STATIC GUI_OUTPUT_CONTEXT* mOutputContext = NULL

Definition at line 43 of file OpenCanopy.c.

◆ mPointerContext

GLOBAL_REMOVE_IF_UNREFERENCED GUI_POINTER_CONTEXT* mPointerContext = NULL

Definition at line 44 of file OpenCanopy.c.

◆ mPointerOldDrawBaseX

STATIC UINT32 mPointerOldDrawBaseX = 0

Definition at line 64 of file OpenCanopy.c.

◆ mPointerOldDrawBaseY

STATIC UINT32 mPointerOldDrawBaseY = 0

Definition at line 65 of file OpenCanopy.c.

◆ mPointerOldDrawHeight

STATIC UINT32 mPointerOldDrawHeight = 0

Definition at line 67 of file OpenCanopy.c.

◆ mPointerOldDrawWidth

STATIC UINT32 mPointerOldDrawWidth = 0

Definition at line 66 of file OpenCanopy.c.

◆ mScreenBuffer

STATIC EFI_GRAPHICS_OUTPUT_BLT_PIXEL* mScreenBuffer = NULL

Definition at line 49 of file OpenCanopy.c.

◆ mScreenBufferDelta

STATIC UINT32 mScreenBufferDelta = 0

Definition at line 50 of file OpenCanopy.c.

◆ mStartTsc

STATIC UINT64 mStartTsc = 0

Definition at line 55 of file OpenCanopy.c.