xref: /freebsd/stand/efi/include/efipoint.h (revision 84943d6f38e936ac3b7a3947ca26eeb27a39f938)
1 /* Copyright (C) 2014 by John Cronin
2  *
3  * Permission is hereby granted, free of charge, to any person obtaining a copy
4  * of this software and associated documentation files (the "Software"), to deal
5  * in the Software without restriction, including without limitation the rights
6  * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7  * copies of the Software, and to permit persons to whom the Software is
8  * furnished to do so, subject to the following conditions:
9 
10  * The above copyright notice and this permission notice shall be included in
11  * all copies or substantial portions of the Software.
12 
13  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19  * THE SOFTWARE.
20  */
21 
22 #ifndef _EFI_POINT_H
23 #define _EFI_POINT_H
24 
25 #define EFI_SIMPLE_POINTER_PROTOCOL_GUID \
26 	{ 0x31878c87, 0xb75, 0x11d5, { 0x9a, 0x4f, 0x0, 0x90, 0x27, 0x3f, 0xc1, 0x4d } }
27 
28 INTERFACE_DECL(_EFI_SIMPLE_POINTER);
29 
30 typedef struct {
31 	INT32 RelativeMovementX;
32 	INT32 RelativeMovementY;
33 	INT32 RelativeMovementZ;
34 	BOOLEAN LeftButton;
35 	BOOLEAN RightButton;
36 } EFI_SIMPLE_POINTER_STATE;
37 
38 typedef struct {
39 	UINT64 ResolutionX;
40 	UINT64 ResolutionY;
41 	UINT64 ResolutionZ;
42 	BOOLEAN LeftButton;
43 	BOOLEAN RightButton;
44 } EFI_SIMPLE_POINTER_MODE;
45 
46 typedef
47 EFI_STATUS
48 (EFIAPI *EFI_SIMPLE_POINTER_RESET) (
49 	IN struct _EFI_SIMPLE_POINTER *This,
50 	IN BOOLEAN ExtendedVerification
51 );
52 
53 typedef
54 EFI_STATUS
55 (EFIAPI *EFI_SIMPLE_POINTER_GET_STATE) (
56 	IN struct _EFI_SIMPLE_POINTER *This,
57 	IN OUT EFI_SIMPLE_POINTER_STATE *State
58 );
59 
60 typedef struct _EFI_SIMPLE_POINTER {
61 	EFI_SIMPLE_POINTER_RESET Reset;
62 	EFI_SIMPLE_POINTER_GET_STATE GetState;
63 	EFI_EVENT WaitForInput;
64 	EFI_SIMPLE_POINTER_MODE *Mode;
65 } EFI_SIMPLE_POINTER_PROTOCOL;
66 
67 #define EFI_ABSOLUTE_POINTER_PROTOCOL_GUID \
68 	{ 0x8D59D32B, 0xC655, 0x4AE9, { 0x9B, 0x15, 0xF2, 0x59, 0x04, 0x99, 0x2A, 0x43 } }
69 
70 INTERFACE_DECL(_EFI_ABSOLUTE_POINTER_PROTOCOL);
71 
72 typedef struct {
73 	UINT64 AbsoluteMinX;
74 	UINT64 AbsoluteMinY;
75 	UINT64 AbsoluteMinZ;
76 	UINT64 AbsoluteMaxX;
77 	UINT64 AbsoluteMaxY;
78 	UINT64 AbsoluteMaxZ;
79 	UINT32 Attributes;
80 } EFI_ABSOLUTE_POINTER_MODE;
81 
82 typedef struct {
83 	UINT64 CurrentX;
84 	UINT64 CurrentY;
85 	UINT64 CurrentZ;
86 	UINT32 ActiveButtons;
87 } EFI_ABSOLUTE_POINTER_STATE;
88 
89 #define EFI_ABSP_SupportsAltActive 0x00000001
90 #define EFI_ABSP_SupportsPressureAsZ 0x00000002
91 #define EFI_ABSP_TouchActive 0x00000001
92 #define EFI_ABS_AltActive 0x00000002
93 
94 typedef
95 EFI_STATUS
96 (EFIAPI *EFI_ABSOLUTE_POINTER_RESET) (
97 	IN struct _EFI_ABSOLUTE_POINTER_PROTOCOL *This,
98 	IN BOOLEAN ExtendedVerification
99 );
100 
101 typedef
102 EFI_STATUS
103 (EFIAPI *EFI_ABSOLUTE_POINTER_GET_STATE) (
104 	IN struct _EFI_ABSOLUTE_POINTER_PROTOCOL *This,
105 	IN OUT EFI_ABSOLUTE_POINTER_STATE *State
106 );
107 
108 typedef struct _EFI_ABSOLUTE_POINTER_PROTOCOL {
109 	EFI_ABSOLUTE_POINTER_RESET Reset;
110 	EFI_ABSOLUTE_POINTER_GET_STATE GetState;
111 	EFI_EVENT WaitForInput;
112 	EFI_ABSOLUTE_POINTER_MODE *Mode;
113 } EFI_ABSOLUTE_POINTER_PROTOCOL;
114 
115 #endif
116