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