OpenCore  1.0.4
OpenCore Bootloader
Loading...
Searching...
No Matches
OcAppleEventLib.c File Reference
#include <AppleMacEfi.h>
#include <Library/BaseLib.h>
#include <Library/DebugLib.h>
#include <Library/MemoryAllocationLib.h>
#include <Library/OcMiscLib.h>
#include <Library/UefiBootServicesTableLib.h>
#include "AppleEventInternal.h"

Go to the source code of this file.

Data Structures

struct  APPLE_EVENT_HANDLE_PRIVATE
 

Macros

#define APPLE_EVENT_HANDLE_PRIVATE_SIGNATURE    SIGNATURE_32 ('A', 'L', 's', 't')
 
#define APPLE_EVENT_HANDLE_PRIVATE_FROM_LIST_ENTRY(Handle)
 

Functions

EFI_EVENT EventLibCreateTimerEvent (IN EFI_EVENT_NOTIFY NotifyFunction, IN VOID *NotifyContext, IN UINT64 TriggerTime, IN BOOLEAN SignalPeriodic, IN EFI_TPL NotifyTpl)
 
EFI_EVENT EventLibCreateNotifyTimerEvent (IN EFI_EVENT_NOTIFY NotifyFunction, IN VOID *NotifyContext, IN UINT64 TriggerTime, IN BOOLEAN SignalPeriodic)
 
VOID EventLibCancelEvent (IN EFI_EVENT Event)
 
VOID EventSignalEvents (IN APPLE_EVENT_INFORMATION *EventInformation)
 
VOID InternalFlagAllEventsReady (VOID)
 
VOID InternalSignalEvents (IN APPLE_EVENT_INFORMATION *Information)
 
VOID InternalRemoveUnregisteredEvents (VOID)
 
STATIC EFI_STATUS InternalCreatePollEvents (VOID)
 
VOID InternalCancelPollEvents (VOID)
 
EFI_STATUS EFIAPI EventRegisterHandler (IN APPLE_EVENT_TYPE Type, IN APPLE_EVENT_NOTIFY_FUNCTION NotifyFunction, OUT APPLE_EVENT_HANDLE *Handle, IN VOID *NotifyContext)
 
EFI_STATUS EFIAPI EventUnregisterHandler (IN APPLE_EVENT_HANDLE Handle)
 
EFI_STATUS EFIAPI EventSetCursorPosition (IN DIMENSION *Position)
 
EFI_STATUS EFIAPI EventSetEventName (IN OUT APPLE_EVENT_HANDLE Handle, IN CHAR8 *Name)
 
EFI_STATUS EFIAPI EventIsCapsLockOn (IN OUT BOOLEAN *CLockOn)
 
STATIC VOID InternalUnregisterHandlers (VOID)
 
EFI_STATUS EFIAPI AppleEventUnload (VOID)
 
APPLE_EVENT_PROTOCOLOcAppleEventInstallProtocol (IN BOOLEAN Install, IN BOOLEAN Reinstall, IN BOOLEAN CustomDelays, IN UINT16 KeyInitialDelay, IN UINT16 KeySubsequentDelay, IN BOOLEAN GraphicsInputMirroring, IN UINT32 PointerPollMin, IN UINT32 PointerPollMax, IN UINT32 PointerPollMask, IN UINT16 PointerSpeedDiv, IN UINT16 PointerSpeedMul, IN UINT16 PointerDwellClickTimeout, IN UINT16 PointerDwellDoubleClickTimeout, IN UINT16 PointerDwellRadius)
 

Variables

STATIC LIST_ENTRY mEventHandles = INITIALIZE_LIST_HEAD_VARIABLE (mEventHandles)
 
STATIC UINTN mNumberOfEventHandles = 0
 
STATIC APPLE_EVENT_PROTOCOL mAppleEventProtocol
 

Detailed Description

AppleEventDxe

Copyright (c) 2018, vit9696

All rights reserved.

This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at http://opensource.org/licenses/bsd-license.php

THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.

Definition in file OcAppleEventLib.c.

Macro Definition Documentation

◆ APPLE_EVENT_HANDLE_PRIVATE_FROM_LIST_ENTRY

#define APPLE_EVENT_HANDLE_PRIVATE_FROM_LIST_ENTRY ( Handle)
Value:
CR ( \
(Handle), \
Link, \
)
#define APPLE_EVENT_HANDLE_PRIVATE_SIGNATURE
APPLE_EVENT_HANDLE Handle
Definition OcTypingLib.h:45

Definition at line 34 of file OcAppleEventLib.c.

◆ APPLE_EVENT_HANDLE_PRIVATE_SIGNATURE

#define APPLE_EVENT_HANDLE_PRIVATE_SIGNATURE    SIGNATURE_32 ('A', 'L', 's', 't')

Definition at line 30 of file OcAppleEventLib.c.

Function Documentation

◆ AppleEventUnload()

EFI_STATUS EFIAPI AppleEventUnload ( VOID )

Definition at line 532 of file OcAppleEventLib.c.

◆ EventIsCapsLockOn()

EFI_STATUS EFIAPI EventIsCapsLockOn ( IN OUT BOOLEAN * CLockOn)

Retrieves the state of the CapsLock key.

Parameters
[in,out]CLockOnThis parameter indicates the state of the CapsLock key.
Return values
EFI_SUCCESSThe CapsLock state was successfully returned in CLockOn.
EFI_INVALID_PARAMETERCLockOn is NULL.

Definition at line 492 of file OcAppleEventLib.c.

◆ EventLibCancelEvent()

VOID EventLibCancelEvent ( IN EFI_EVENT Event)

Definition at line 129 of file OcAppleEventLib.c.

◆ EventLibCreateNotifyTimerEvent()

EFI_EVENT EventLibCreateNotifyTimerEvent ( IN EFI_EVENT_NOTIFY NotifyFunction,
IN VOID * NotifyContext,
IN UINT64 TriggerTime,
IN BOOLEAN SignalPeriodic )

Definition at line 109 of file OcAppleEventLib.c.

◆ EventLibCreateTimerEvent()

EFI_EVENT EventLibCreateTimerEvent ( IN EFI_EVENT_NOTIFY NotifyFunction,
IN VOID * NotifyContext,
IN UINT64 TriggerTime,
IN BOOLEAN SignalPeriodic,
IN EFI_TPL NotifyTpl )

Definition at line 63 of file OcAppleEventLib.c.

◆ EventRegisterHandler()

EFI_STATUS EFIAPI EventRegisterHandler ( IN APPLE_EVENT_TYPE Type,
IN APPLE_EVENT_NOTIFY_FUNCTION NotifyFunction,
OUT APPLE_EVENT_HANDLE * Handle,
IN VOID * NotifyContext )

Definition at line 312 of file OcAppleEventLib.c.

◆ EventSetCursorPosition()

EFI_STATUS EFIAPI EventSetCursorPosition ( IN DIMENSION * Position)

This function is used to change the position of the cursor on the screen.

Parameters
[in]PositionThe position where to position the cursor.
Return values
EFI_INVALID_PARAMETERPosition is invalid.

Definition at line 426 of file OcAppleEventLib.c.

◆ EventSetEventName()

EFI_STATUS EFIAPI EventSetEventName ( IN OUT APPLE_EVENT_HANDLE Handle,
IN CHAR8 * Name )

This function is used to assign a name to an event.

Parameters
[in,out]Handle
[in]Name
Return values
EFI_SUCCESSThe event name was assigned successfully.
EFI_INVALID_PARAMETEREventHandle or EventName is NULL.
EFI_OUT_OF_RESOURCESThere are not enough resources to allocate the event name.

Definition at line 449 of file OcAppleEventLib.c.

◆ EventSignalEvents()

VOID EventSignalEvents ( IN APPLE_EVENT_INFORMATION * EventInformation)

Definition at line 146 of file OcAppleEventLib.c.

◆ EventUnregisterHandler()

EFI_STATUS EFIAPI EventUnregisterHandler ( IN APPLE_EVENT_HANDLE Handle)

Definition at line 374 of file OcAppleEventLib.c.

◆ InternalCancelPollEvents()

VOID InternalCancelPollEvents ( VOID )

Definition at line 299 of file OcAppleEventLib.c.

◆ InternalCreatePollEvents()

STATIC EFI_STATUS InternalCreatePollEvents ( VOID )

Definition at line 276 of file OcAppleEventLib.c.

◆ InternalFlagAllEventsReady()

VOID InternalFlagAllEventsReady ( VOID )

Definition at line 179 of file OcAppleEventLib.c.

◆ InternalRemoveUnregisteredEvents()

VOID InternalRemoveUnregisteredEvents ( VOID )

Definition at line 239 of file OcAppleEventLib.c.

◆ InternalSignalEvents()

VOID InternalSignalEvents ( IN APPLE_EVENT_INFORMATION * Information)

Definition at line 205 of file OcAppleEventLib.c.

◆ InternalUnregisterHandlers()

STATIC VOID InternalUnregisterHandlers ( VOID )

Definition at line 504 of file OcAppleEventLib.c.

◆ OcAppleEventInstallProtocol()

APPLE_EVENT_PROTOCOL * OcAppleEventInstallProtocol ( IN BOOLEAN Install,
IN BOOLEAN Reinstall,
IN BOOLEAN CustomDelays,
IN UINT16 KeyInitialDelay,
IN UINT16 KeySubsequentDelay,
IN BOOLEAN GraphicsInputMirroring,
IN UINT32 PointerPollMin,
IN UINT32 PointerPollMax,
IN UINT32 PointerPollMask,
IN UINT16 PointerSpeedDiv,
IN UINT16 PointerSpeedMul,
IN UINT16 PointerDwellClickTimeout,
IN UINT16 PointerDwellDoubleClickTimeout,
IN UINT16 PointerDwellRadius )

Install and initialise Apple Event protocol.

Parameters
[in]InstallIf false, do not install even when no suitable OEM version found.
[in]ReinstallIf true, force overwrite installed protocol. If false, use Apple OEM protocol where possible.
[in]CustomDelaysIf true, use key delays specified. If false, use Apple OEM default key delay values. OC builtin AppleEvent only.
[in]KeyInitialDelayKey repeat initial delay in 10ms units.
[in]KeySubsequentDelayKey repeat subsequent delay in 10ms units. If zero, warn and use 1.
[in]GraphicsInputMirroringIf true, disable Apple default behaviour which can prevent keyboard input reaching non-Apple GUI UEFI apps. OC builtin AppleEvent only.
[in]PointerPollMinPointer polling minimal period in ms.
[in]PointerPollMaxPointer polling maximum period in ms.
[in]PointerPollMaskPointer polling mask to choose polled handles.
[in]PointerSpeedDivPointer speed divisor. If zero, warn and use 1.
[in]PointerSpeedMulPointer speed multiplier.
[in]PointerDwellClickTimeoutPointer dwell-clicking single left click timeout.
[in]PointerDwellDoubleClickTimeoutPointer dwell-clicking single left double click timeout.
[in]PointerDwellRadiusPointer dwell-clicking tolerance radius in pixels.
Return values
installedor located protocol or NULL.

Definition at line 556 of file OcAppleEventLib.c.

Variable Documentation

◆ mAppleEventProtocol

STATIC APPLE_EVENT_PROTOCOL mAppleEventProtocol
Initial value:
= {
}
#define APPLE_EVENT_PROTOCOL_REVISION
Definition AppleEvent.h:100
EFI_STATUS EFIAPI EventRegisterHandler(IN APPLE_EVENT_TYPE Type, IN APPLE_EVENT_NOTIFY_FUNCTION NotifyFunction, OUT APPLE_EVENT_HANDLE *Handle, IN VOID *NotifyContext)
EFI_STATUS EFIAPI EventUnregisterHandler(IN APPLE_EVENT_HANDLE Handle)
EFI_STATUS EFIAPI EventIsCapsLockOn(IN OUT BOOLEAN *CLockOn)
EFI_STATUS EFIAPI EventSetCursorPosition(IN DIMENSION *Position)
EFI_STATUS EFIAPI EventSetEventName(IN OUT APPLE_EVENT_HANDLE Handle, IN CHAR8 *Name)

Definition at line 520 of file OcAppleEventLib.c.

◆ mEventHandles

STATIC LIST_ENTRY mEventHandles = INITIALIZE_LIST_HEAD_VARIABLE (mEventHandles)

Definition at line 56 of file OcAppleEventLib.c.

◆ mNumberOfEventHandles

STATIC UINTN mNumberOfEventHandles = 0

Definition at line 59 of file OcAppleEventLib.c.