]> git.proxmox.com Git - mirror_edk2.git/blame - EdkCompatibilityPkg/Foundation/Efi/Protocol/SimpleTextInputEx/SimpleTextInputEx.h
Removed extra typedefs on structures to remove error with gcc compiler.
[mirror_edk2.git] / EdkCompatibilityPkg / Foundation / Efi / Protocol / SimpleTextInputEx / SimpleTextInputEx.h
CommitLineData
2c40a813 1/*++\r
2\r
3Copyright (c) 2007, Intel Corporation \r
4All rights reserved. This program and the accompanying materials \r
5are licensed and made available under the terms and conditions of the BSD License \r
6which accompanies this distribution. The full text of the license may be found at \r
7http://opensource.org/licenses/bsd-license.php \r
8 \r
9THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
10WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
11\r
12Module Name:\r
13\r
14 SimpleTextInputEx.h\r
15\r
16Abstract:\r
17\r
18 EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL from the UEFI 2.1 specification.\r
19\r
20 This protocol defines an extension to the EFI_SIMPLE_TEXT_INPUT_PROTOCOL\r
21 which exposes much more state and modifier information from the input device,\r
22 also allows one to register a notification for a particular keystroke.\r
23\r
24--*/\r
25\r
26#ifndef __SIMPLE_TEXT_INPUT_EX_H__\r
27#define __SIMPLE_TEXT_INPUT_EX_H__\r
28\r
29#include EFI_PROTOCOL_DEFINITION (SimpleTextIn)\r
30\r
31#define EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL_GUID \\r
32 { \\r
33 0xdd9e7534, 0x7762, 0x4698, 0x8c, 0x14, 0xf5, 0x85, 0x17, 0xa6, 0x25, 0xaa\\r
34 }\r
35\r
36EFI_FORWARD_DECLARATION (EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL);\r
37\r
38//\r
39// Data structures\r
40//\r
41\r
42typedef UINT8 EFI_KEY_TOGGLE_STATE;\r
43// \r
44// Any Shift or Toggle State that is valid should have \r
45// high order bit set.\r
46//\r
47typedef struct EFI_KEY_STATE {\r
48 UINT32 KeyShiftState;\r
49 EFI_KEY_TOGGLE_STATE KeyToggleState;\r
50} EFI_KEY_STATE;\r
51\r
52typedef struct {\r
53 EFI_INPUT_KEY Key; \r
54 EFI_KEY_STATE KeyState; \r
55} EFI_KEY_DATA;\r
56\r
57//\r
58// Shift state\r
59//\r
60#define EFI_SHIFT_STATE_VALID 0x80000000\r
61#define EFI_RIGHT_SHIFT_PRESSED 0x00000001\r
62#define EFI_LEFT_SHIFT_PRESSED 0x00000002\r
63#define EFI_RIGHT_CONTROL_PRESSED 0x00000004\r
64#define EFI_LEFT_CONTROL_PRESSED 0x00000008\r
65#define EFI_RIGHT_ALT_PRESSED 0x00000010\r
66#define EFI_LEFT_ALT_PRESSED 0x00000020\r
67#define EFI_RIGHT_LOGO_PRESSED 0x00000040\r
68#define EFI_LEFT_LOGO_PRESSED 0x00000080\r
69#define EFI_MENU_KEY_PRESSED 0x00000100\r
70#define EFI_SYS_REQ_PRESSED 0x00000200\r
71 \r
72// \r
73// Toggle state \r
74// \r
75#define EFI_TOGGLE_STATE_VALID 0x80\r
76#define EFI_SCROLL_LOCK_ACTIVE 0x01\r
77#define EFI_NUM_LOCK_ACTIVE 0x02\r
78#define EFI_CAPS_LOCK_ACTIVE 0x04\r
79 \r
80// \r
81// EFI Scan codes \r
82// \r
83#define SCAN_F13 0x0068\r
84#define SCAN_F14 0x0069\r
85#define SCAN_F15 0x006A\r
86#define SCAN_F16 0x006B\r
87#define SCAN_F17 0x006C\r
88#define SCAN_F18 0x006D\r
89#define SCAN_F19 0x006E\r
90#define SCAN_F20 0x006F\r
91#define SCAN_F21 0x0070\r
92#define SCAN_F22 0x0071\r
93#define SCAN_F23 0x0072\r
94#define SCAN_F24 0x0073\r
95#define SCAN_MUTE 0x007F\r
96#define SCAN_VOLUME_UP 0x0080\r
97#define SCAN_VOLUME_DOWN 0x0081\r
98#define SCAN_BRIGHTNESS_UP 0x0100\r
99#define SCAN_BRIGHTNESS_DOWN 0x0101\r
100#define SCAN_SUSPEND 0x0102\r
101#define SCAN_HIBERNATE 0x0103\r
102#define SCAN_TOGGLE_DISPLAY 0x0104\r
103#define SCAN_RECOVERY 0x0105\r
104#define SCAN_EJECT 0x0106\r
105\r
106\r
107//\r
108// EFI Key Notfication Function\r
109//\r
110typedef \r
111EFI_STATUS\r
112(EFIAPI *EFI_KEY_NOTIFY_FUNCTION) (\r
113 IN EFI_KEY_DATA *KeyData\r
114 )\r
115;\r
116\r
117typedef\r
118EFI_STATUS\r
119(EFIAPI *EFI_INPUT_RESET_EX) (\r
120 IN EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL *This,\r
121 IN BOOLEAN ExtendedVerification\r
122 )\r
123/*++\r
124\r
125 Routine Description:\r
126 Reset the input device and optionaly run diagnostics\r
127\r
128 Arguments:\r
129 This - Protocol instance pointer.\r
130 ExtendedVerification - Driver may perform diagnostics on reset.\r
131\r
132 Returns:\r
133 EFI_SUCCESS - The device was reset.\r
134 EFI_DEVICE_ERROR - The device is not functioning properly and could \r
135 not be reset.\r
136\r
137--*/\r
138;\r
139\r
140typedef\r
141EFI_STATUS\r
142(EFIAPI *EFI_INPUT_READ_KEY_EX) (\r
143 IN EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL *This,\r
144 OUT EFI_KEY_DATA *KeyData\r
145 )\r
146/*++\r
147\r
148 Routine Description:\r
149 Reads the next keystroke from the input device. The WaitForKey Event can \r
150 be used to test for existance of a keystroke via WaitForEvent () call.\r
151\r
152 Arguments:\r
153 This - Protocol instance pointer.\r
154 KeyData - A pointer to a buffer that is filled in with the keystroke \r
155 state data for the key that was pressed.\r
156\r
157 Returns:\r
158 EFI_SUCCESS - The keystroke information was returned.\r
159 EFI_NOT_READY - There was no keystroke data availiable.\r
160 EFI_DEVICE_ERROR - The keystroke information was not returned due to \r
161 hardware errors.\r
162 EFI_INVALID_PARAMETER - KeyData is NULL. \r
163--*/\r
164;\r
165\r
166typedef\r
167EFI_STATUS\r
168(EFIAPI *EFI_SET_STATE) (\r
169 IN EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL *This,\r
170 IN EFI_KEY_TOGGLE_STATE *KeyToggleState\r
171 )\r
172/*++\r
173\r
174 Routine Description:\r
175 Set certain state for the input device.\r
176\r
177 Arguments:\r
178 This - Protocol instance pointer.\r
179 KeyToggleState - A pointer to the EFI_KEY_TOGGLE_STATE to set the \r
180 state for the input device.\r
181\r
182 Returns:\r
183 EFI_SUCCESS - The device state was set successfully.\r
184 EFI_DEVICE_ERROR - The device is not functioning correctly and could \r
185 not have the setting adjusted.\r
186 EFI_UNSUPPORTED - The device does not have the ability to set its state.\r
187 EFI_INVALID_PARAMETER - KeyToggleState is NULL. \r
188\r
189--*/ \r
190;\r
191\r
192typedef\r
193EFI_STATUS\r
194(EFIAPI *EFI_REGISTER_KEYSTROKE_NOTIFY) (\r
195 IN EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL *This,\r
196 IN EFI_KEY_DATA *KeyData,\r
197 IN EFI_KEY_NOTIFY_FUNCTION KeyNotificationFunction,\r
198 OUT EFI_HANDLE *NotifyHandle\r
199 )\r
200/*++\r
201\r
202 Routine Description:\r
203 Register a notification function for a particular keystroke for the input device.\r
204\r
205 Arguments:\r
206 This - Protocol instance pointer.\r
207 KeyData - A pointer to a buffer that is filled in with the keystroke \r
208 information data for the key that was pressed.\r
209 KeyNotificationFunction - Points to the function to be called when the key \r
210 sequence is typed specified by KeyData. \r
211 NotifyHandle - Points to the unique handle assigned to the registered notification. \r
212\r
213 Returns:\r
214 EFI_SUCCESS - The notification function was registered successfully.\r
215 EFI_OUT_OF_RESOURCES - Unable to allocate resources for necesssary data structures.\r
216 EFI_INVALID_PARAMETER - KeyData or NotifyHandle is NULL. \r
217 \r
218--*/ \r
219;\r
220\r
221typedef\r
222EFI_STATUS\r
223(EFIAPI *EFI_UNREGISTER_KEYSTROKE_NOTIFY) (\r
224 IN EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL *This,\r
225 IN EFI_HANDLE NotificationHandle\r
226 )\r
227/*++\r
228\r
229 Routine Description:\r
230 Remove a registered notification function from a particular keystroke.\r
231\r
232 Arguments:\r
233 This - Protocol instance pointer. \r
234 NotificationHandle - The handle of the notification function being unregistered.\r
235\r
236 Returns:\r
237 EFI_SUCCESS - The notification function was unregistered successfully.\r
238 EFI_INVALID_PARAMETER - The NotificationHandle is invalid.\r
239 EFI_NOT_FOUND - Can not find the matching entry in database. \r
240 \r
241--*/ \r
242;\r
243\r
e5bce275 244struct _EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL {\r
2c40a813 245 EFI_INPUT_RESET_EX Reset;\r
246 EFI_INPUT_READ_KEY_EX ReadKeyStrokeEx;\r
247 EFI_EVENT WaitForKeyEx;\r
248 EFI_SET_STATE SetState;\r
249 EFI_REGISTER_KEYSTROKE_NOTIFY RegisterKeyNotify;\r
250 EFI_UNREGISTER_KEYSTROKE_NOTIFY UnregisterKeyNotify;\r
e5bce275 251};\r
2c40a813 252\r
253extern EFI_GUID gEfiSimpleTextInputExProtocolGuid;\r
254\r
255#endif\r