]> git.proxmox.com Git - mirror_edk2.git/blame - MdePkg/Include/Protocol/AbsolutePointer.h
Import Pal.h and Sal.h.
[mirror_edk2.git] / MdePkg / Include / Protocol / AbsolutePointer.h
CommitLineData
d1f95000 1/** @file\r
2 The file provides services that allow information about a\r
3 absolute pointer device to be retrieved.\r
4 \r
5 Copyright (c) 2006 - 2007, Intel Corporation\r
6 All rights reserved. This program and the accompanying materials \r
7 are licensed and made available under the terms and conditions of the BSD License \r
8 which accompanies this distribution. The full text of the license may be found at \r
9 http://opensource.org/licenses/bsd-license.php \r
10\r
11 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
12 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
13\r
14 Module Name: AbsolutePointer.h\r
15\r
16**/\r
17\r
18#ifndef __ABSOLUTE_POINTER_H__\r
19#define __ABSOLUTE_POINTER_H__\r
20\r
21\r
22#define EFI_ABSOLUTE_POINTER_PROTOCOL_GUID \\r
23 { 0x8D59D32B, 0xC655, 0x4AE9, { 0x9B, 0x15, 0xF2, 0x59, 0x04, 0x99, 0x2A, 0x43 } }\r
24\r
25\r
26typedef struct _EFI_ABSOLUTE_POINTER_PROTOCOL EFI_ABSOLUTE_POINTER_PROTOCOL;\r
27\r
28\r
29//*******************************************************\r
30// EFI_ABSOLUTE_POINTER_MODE\r
31//*******************************************************\r
32\r
33\r
34/**\r
35 The following data values in the EFI_ABSOLUTE_POINTER_MODE\r
36 interface are read-only and are changed by using the appropriate\r
37 interface functions:\r
38 Attributes The following bits are set as needed (or'd\r
39 together) to indicate the capabilities of the device\r
40 supported. The remaining bits are undefined and should be\r
41 returned as 0.\r
42\r
43 \r
44 @param AbsoluteMinX The Absolute Minimum of the device on the\r
45 x-axis.\r
46\r
47 @param AbsoluteMinY The Absolute Minimum of the device on the\r
48 y axis.\r
49\r
50 @param AbsoluteMinZ The Absolute Minimum of the device on the\r
51 z-axis.\r
52\r
53 @param AbsoluteMaxX The Absolute Maximum of the device on the\r
54 x-axis. If 0, and the AbsoluteMinX is 0,\r
55 then the pointer device does not support a\r
56 xaxis.\r
57\r
58 @param AbsoluteMaxY The Absolute Maximum of the device on the\r
59 y -axis. If 0,, and the AbsoluteMinX is 0,\r
60 then the pointer device does not support a\r
61 yaxis.\r
62\r
63 @param AbsoluteMaxZ The Absolute Maximum of the device on the\r
64 z-axis. If 0 , and the AbsoluteMinX is 0,\r
65 then the pointer device does not support a\r
66 zaxis. \r
67\r
68**/\r
69typedef struct {\r
70 UINT64 AbsoluteMinX;\r
71 UINT64 AbsoluteMinY;\r
72 UINT64 AbsoluteMinZ;\r
73 UINT64 AbsoluteMaxX;\r
74 UINT64 AbsoluteMaxY;\r
75 UINT64 AbsoluteMaxZ;\r
76 UINT32 Attributes;\r
77} EFI_ABSOLUTE_POINTER_MODE;\r
78\r
79//\r
80// If set, indicates this device supports an alternate button input. \r
81// \r
82#define EFI_ABSP_SupportsAltActive 0x00000001\r
83\r
84//\r
85// If set, indicates this device returns pressure data in parameter CurrentZ.\r
86// \r
87#define EFI_ABSP_SupportsPressureAsZ 0x00000002\r
88\r
89\r
90/**\r
91 This function resets the pointer device hardware. As part of\r
92 initialization process, the firmware/device will make a quick\r
93 but reasonable attempt to verify that the device is\r
94 functioning. If the ExtendedVerification flag is TRUE the\r
95 firmware may take an extended amount of time to verify the\r
96 device is operating on reset. Otherwise the reset operation is\r
97 to occur as quickly as possible. The hardware verification\r
98 process is not defined by this specification and is left up to\r
99 the platform firmware or driver to implement.\r
100\r
101 @param This A pointer to the EFI_ABSOLUTE_POINTER_PROTOCOL\r
102 instance.\r
103\r
104 @param ExtendedVerification Indicates that the driver may\r
105 perform a more exhaustive\r
106 verification operation of the\r
107 device during reset.\r
108\r
109 @retval EFI_SUCCESS The device was reset.\r
110 \r
111 @retval EFI_DEVICE_ERROR The device is not functioning\r
112 correctly and could not be reset.\r
113\r
114**/\r
115typedef\r
116EFI_STATUS\r
117(EFIAPI *EFI_ABSOLUTE_POINTER_RESET) (\r
118 IN CONST EFI_ABSOLUTE_POINTER_PROTOCOL *This,\r
119 IN CONST BOOLEAN ExtendedVerification\r
120);\r
121\r
122\r
123\r
124\r
125/**\r
126 Definitions of bits within ActiveButtons.\r
127 \r
128 @param EFI_ABSP_TouchActive This bit is set if the touch\r
129 sensor is active.\r
130 \r
131 @param EFI_ABS_AltActive This bit is set if the alt sensor,\r
132 such as pen-side button, is\r
133 active.\r
134**/\r
135#define EFI_ABSP_TouchActive 0x00000001\r
136#define EFI_ABS_AltActive 0x00000002\r
137\r
138\r
139/**\r
140 Definition of EFI_ABSOLUTE_POINTER_STATE.\r
141 \r
142 @param CurrentX The unsigned position of the activation on the\r
143 x axis If the AboluteMinX and the AboluteMaxX\r
144 fields of the EFI_ABSOLUTE_POINTER_MODE\r
145 structure are both 0, then this pointer device\r
146 does not support an x-axis, and this field\r
147 must be ignored.\r
148\r
149 @param CurrentY The unsigned position of the activation on the\r
150 x axis If the AboluteMinY and the AboluteMaxY\r
151 fields of the EFI_ABSOLUTE_POINTER_MODE\r
152 structure are both 0, then this pointer device\r
153 does not support an y-axis, and this field\r
154 must be ignored.\r
155\r
156 @param CurrentZ The unsigned position of the activation on the\r
157 x axis, or the pressure measurement. If the\r
158 AboluteMinZ and the AboluteMaxZ fields of the\r
159 EFI_ABSOLUTE_POINTER_MODE structure are\r
160 both 0, then this pointer device does not\r
161 support an z-axis, and this field must be\r
162 ignored.\r
163\r
164 @param ActiveButtons Bits are set to 1 in this structure item\r
165 to indicate that device buttons are\r
166 active.\r
167\r
168**/\r
169typedef struct {\r
170 UINT64 CurrentX;\r
171 UINT64 CurrentY;\r
172 UINT64 CurrentZ;\r
173 UINT32 ActiveButtons;\r
174} EFI_ABSOLUTE_POINTER_STATE;\r
175\r
176/**\r
177 The GetState() function retrieves the current state of a pointer\r
178 device. This includes information on the active state associated\r
179 with the pointer device and the current position of the axes\r
180 associated with the pointer device. If the state of the pointer\r
181 device has not changed since the last call to GetState(), then\r
182 EFI_NOT_READY is returned. If the state of the pointer device\r
183 has changed since the last call to GetState(), then the state\r
184 information is placed in State, and EFI_SUCCESS is returned. If\r
185 a device error occurs while attempting to retrieve the state\r
186 information, then EFI_DEVICE_ERROR is returned.\r
187\r
188\r
189 @param This A pointer to the EFI_ABSOLUTE_POINTER_PROTOCOL\r
190 instance.\r
191\r
192 @param State A pointer to the state information on the\r
193 pointer device.\r
194\r
195 @retval EFI_SUCCESS The state of the pointer device was\r
196 returned in State.\r
197\r
198 @retval EFI_NOT_READY The state of the pointer device has not\r
199 changed since the last call to GetState().\r
200\r
201 @retval EFI_DEVICE_ERROR A device error occurred while\r
202 attempting to retrieve the pointer\r
203 device's current state.\r
204\r
205**/\r
206typedef\r
207EFI_STATUS\r
208(EFIAPI *EFI_ABSOLUTE_POINTER_GET_STATE) (\r
209 IN CONST EFI_ABSOLUTE_POINTER_PROTOCOL *This,\r
210 IN OUT EFI_ABSOLUTE_POINTER_STATE *State\r
211);\r
212\r
213\r
214/**\r
215 The EFI_ABSOLUTE_POINTER_PROTOCOL provides a set of services\r
216 for a pointer device that can be used as an input device from an\r
217 application written to this specification. The services include\r
218 the ability to reset the pointer device, retrieve the state of\r
219 the pointer device, and retrieve the capabilities of the pointer\r
220 device. In addition certain data items describing the device are\r
221 provided.\r
222\r
223\r
224 @param Reset Resets the pointer device.\r
225\r
226 @param GetState Retrieves the current state of the pointer\r
227 device.\r
228\r
229 @param WaitForInput Event to use with WaitForEvent() to wait\r
230 for input from the pointer device.\r
231 @param Mode Pointer to EFI_ABSOLUTE_POINTER_MODE data.\r
232\r
233**/\r
234struct _EFI_ABSOLUTE_POINTER_PROTOCOL {\r
235 EFI_ABSOLUTE_POINTER_RESET Reset;\r
236 EFI_ABSOLUTE_POINTER_GET_STATE GetState;\r
237 EFI_EVENT WaitForInput;\r
238 EFI_ABSOLUTE_POINTER_MODE *Mode;\r
239};\r
240\r
241\r
242extern EFI_GUID gEfiAbsolutePointerProtocolGuid;\r
243\r
244\r
245#endif\r
246\r