xref: /freebsd/sys/contrib/edk2/Include/Protocol/SimplePointer.h (revision f439973d6726c3be929c8fb3b1545b8b1744abc3)
1*f439973dSWarner Losh /** @file
2*f439973dSWarner Losh   Simple Pointer protocol from the UEFI 2.0 specification.
3*f439973dSWarner Losh 
4*f439973dSWarner Losh   Abstraction of a very simple pointer device like a mouse or trackball.
5*f439973dSWarner Losh 
6*f439973dSWarner Losh   Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>
7*f439973dSWarner Losh   SPDX-License-Identifier: BSD-2-Clause-Patent
8*f439973dSWarner Losh 
9*f439973dSWarner Losh **/
10*f439973dSWarner Losh 
11*f439973dSWarner Losh #ifndef __SIMPLE_POINTER_H__
12*f439973dSWarner Losh #define __SIMPLE_POINTER_H__
13*f439973dSWarner Losh 
14*f439973dSWarner Losh #define EFI_SIMPLE_POINTER_PROTOCOL_GUID \
15*f439973dSWarner Losh   { \
16*f439973dSWarner Losh     0x31878c87, 0xb75, 0x11d5, {0x9a, 0x4f, 0x0, 0x90, 0x27, 0x3f, 0xc1, 0x4d } \
17*f439973dSWarner Losh   }
18*f439973dSWarner Losh 
19*f439973dSWarner Losh typedef struct _EFI_SIMPLE_POINTER_PROTOCOL EFI_SIMPLE_POINTER_PROTOCOL;
20*f439973dSWarner Losh 
21*f439973dSWarner Losh //
22*f439973dSWarner Losh // Data structures
23*f439973dSWarner Losh //
24*f439973dSWarner Losh typedef struct {
25*f439973dSWarner Losh   ///
26*f439973dSWarner Losh   /// The signed distance in counts that the pointer device has been moved along the x-axis.
27*f439973dSWarner Losh   ///
28*f439973dSWarner Losh   INT32      RelativeMovementX;
29*f439973dSWarner Losh   ///
30*f439973dSWarner Losh   /// The signed distance in counts that the pointer device has been moved along the y-axis.
31*f439973dSWarner Losh   ///
32*f439973dSWarner Losh   INT32      RelativeMovementY;
33*f439973dSWarner Losh   ///
34*f439973dSWarner Losh   /// The signed distance in counts that the pointer device has been moved along the z-axis.
35*f439973dSWarner Losh   ///
36*f439973dSWarner Losh   INT32      RelativeMovementZ;
37*f439973dSWarner Losh   ///
38*f439973dSWarner Losh   /// If TRUE, then the left button of the pointer device is being
39*f439973dSWarner Losh   /// pressed. If FALSE, then the left button of the pointer device is not being pressed.
40*f439973dSWarner Losh   ///
41*f439973dSWarner Losh   BOOLEAN    LeftButton;
42*f439973dSWarner Losh   ///
43*f439973dSWarner Losh   /// If TRUE, then the right button of the pointer device is being
44*f439973dSWarner Losh   /// pressed. If FALSE, then the right button of the pointer device is not being pressed.
45*f439973dSWarner Losh   ///
46*f439973dSWarner Losh   BOOLEAN    RightButton;
47*f439973dSWarner Losh } EFI_SIMPLE_POINTER_STATE;
48*f439973dSWarner Losh 
49*f439973dSWarner Losh typedef struct {
50*f439973dSWarner Losh   ///
51*f439973dSWarner Losh   /// The resolution of the pointer device on the x-axis in counts/mm.
52*f439973dSWarner Losh   /// If 0, then the pointer device does not support an x-axis.
53*f439973dSWarner Losh   ///
54*f439973dSWarner Losh   UINT64     ResolutionX;
55*f439973dSWarner Losh   ///
56*f439973dSWarner Losh   /// The resolution of the pointer device on the y-axis in counts/mm.
57*f439973dSWarner Losh   /// If 0, then the pointer device does not support an x-axis.
58*f439973dSWarner Losh   ///
59*f439973dSWarner Losh   UINT64     ResolutionY;
60*f439973dSWarner Losh   ///
61*f439973dSWarner Losh   /// The resolution of the pointer device on the z-axis in counts/mm.
62*f439973dSWarner Losh   /// If 0, then the pointer device does not support an x-axis.
63*f439973dSWarner Losh   ///
64*f439973dSWarner Losh   UINT64     ResolutionZ;
65*f439973dSWarner Losh   ///
66*f439973dSWarner Losh   /// TRUE if a left button is present on the pointer device. Otherwise FALSE.
67*f439973dSWarner Losh   ///
68*f439973dSWarner Losh   BOOLEAN    LeftButton;
69*f439973dSWarner Losh   ///
70*f439973dSWarner Losh   /// TRUE if a right button is present on the pointer device. Otherwise FALSE.
71*f439973dSWarner Losh   ///
72*f439973dSWarner Losh   BOOLEAN    RightButton;
73*f439973dSWarner Losh } EFI_SIMPLE_POINTER_MODE;
74*f439973dSWarner Losh 
75*f439973dSWarner Losh /**
76*f439973dSWarner Losh   Resets the pointer device hardware.
77*f439973dSWarner Losh 
78*f439973dSWarner Losh   @param  This                  A pointer to the EFI_SIMPLE_POINTER_PROTOCOL
79*f439973dSWarner Losh                                 instance.
80*f439973dSWarner Losh   @param  ExtendedVerification  Indicates that the driver may perform a more exhaustive
81*f439973dSWarner Losh                                 verification operation of the device during reset.
82*f439973dSWarner Losh 
83*f439973dSWarner Losh   @retval EFI_SUCCESS           The device was reset.
84*f439973dSWarner Losh   @retval EFI_DEVICE_ERROR      The device is not functioning correctly and could not be reset.
85*f439973dSWarner Losh 
86*f439973dSWarner Losh **/
87*f439973dSWarner Losh typedef
88*f439973dSWarner Losh EFI_STATUS
89*f439973dSWarner Losh (EFIAPI *EFI_SIMPLE_POINTER_RESET)(
90*f439973dSWarner Losh   IN EFI_SIMPLE_POINTER_PROTOCOL            *This,
91*f439973dSWarner Losh   IN BOOLEAN                                ExtendedVerification
92*f439973dSWarner Losh   );
93*f439973dSWarner Losh 
94*f439973dSWarner Losh /**
95*f439973dSWarner Losh   Retrieves the current state of a pointer device.
96*f439973dSWarner Losh 
97*f439973dSWarner Losh   @param  This                  A pointer to the EFI_SIMPLE_POINTER_PROTOCOL
98*f439973dSWarner Losh                                 instance.
99*f439973dSWarner Losh   @param  State                 A pointer to the state information on the pointer device.
100*f439973dSWarner Losh 
101*f439973dSWarner Losh   @retval EFI_SUCCESS           The state of the pointer device was returned in State.
102*f439973dSWarner Losh   @retval EFI_NOT_READY         The state of the pointer device has not changed since the last call to
103*f439973dSWarner Losh                                 GetState().
104*f439973dSWarner Losh   @retval EFI_DEVICE_ERROR      A device error occurred while attempting to retrieve the pointer device's
105*f439973dSWarner Losh                                 current state.
106*f439973dSWarner Losh 
107*f439973dSWarner Losh **/
108*f439973dSWarner Losh typedef
109*f439973dSWarner Losh EFI_STATUS
110*f439973dSWarner Losh (EFIAPI *EFI_SIMPLE_POINTER_GET_STATE)(
111*f439973dSWarner Losh   IN EFI_SIMPLE_POINTER_PROTOCOL          *This,
112*f439973dSWarner Losh   OUT EFI_SIMPLE_POINTER_STATE            *State
113*f439973dSWarner Losh   );
114*f439973dSWarner Losh 
115*f439973dSWarner Losh ///
116*f439973dSWarner Losh /// The EFI_SIMPLE_POINTER_PROTOCOL provides a set of services for a pointer
117*f439973dSWarner Losh /// device that can use used as an input device from an application written
118*f439973dSWarner Losh /// to this specification. The services include the ability to reset the
119*f439973dSWarner Losh /// pointer device, retrieve get the state of the pointer device, and
120*f439973dSWarner Losh /// retrieve the capabilities of the pointer device.
121*f439973dSWarner Losh ///
122*f439973dSWarner Losh struct _EFI_SIMPLE_POINTER_PROTOCOL {
123*f439973dSWarner Losh   EFI_SIMPLE_POINTER_RESET        Reset;
124*f439973dSWarner Losh   EFI_SIMPLE_POINTER_GET_STATE    GetState;
125*f439973dSWarner Losh   ///
126*f439973dSWarner Losh   /// Event to use with WaitForEvent() to wait for input from the pointer device.
127*f439973dSWarner Losh   ///
128*f439973dSWarner Losh   EFI_EVENT                       WaitForInput;
129*f439973dSWarner Losh   ///
130*f439973dSWarner Losh   /// Pointer to EFI_SIMPLE_POINTER_MODE data.
131*f439973dSWarner Losh   ///
132*f439973dSWarner Losh   EFI_SIMPLE_POINTER_MODE         *Mode;
133*f439973dSWarner Losh };
134*f439973dSWarner Losh 
135*f439973dSWarner Losh extern EFI_GUID  gEfiSimplePointerProtocolGuid;
136*f439973dSWarner Losh 
137*f439973dSWarner Losh #endif
138