| 1 |
//! Human Interface Infrastructure (HII) Protocol |
| 2 |
//! |
| 3 |
//! Database manager for HII-related data structures. |
| 4 |
|
| 5 |
pub const PROTOCOL_GUID: crate::base::Guid = crate::base::Guid::from_fields( |
| 6 |
0xef9fc172, |
| 7 |
0xa1b2, |
| 8 |
0x4693, |
| 9 |
0xb3, |
| 10 |
0x27, |
| 11 |
&[0x6d, 0x32, 0xfc, 0x41, 0x60, 0x42], |
| 12 |
); |
| 13 |
|
| 14 |
pub const SET_KEYBOARD_LAYOUT_EVENT_GUID: crate::base::Guid = crate::base::Guid::from_fields( |
| 15 |
0x14982a4f, |
| 16 |
0xb0ed, |
| 17 |
0x45b8, |
| 18 |
0xa8, |
| 19 |
0x11, |
| 20 |
&[0x5a, 0x7a, 0x9b, 0xc2, 0x32, 0xdf], |
| 21 |
); |
| 22 |
|
| 23 |
pub type ProtocolNewPackageList = eficall! {fn( |
| 24 |
*const Protocol, |
| 25 |
*const crate::hii::PackageListHeader, |
| 26 |
crate::base::Handle, |
| 27 |
*mut crate::hii::Handle, |
| 28 |
) -> crate::base::Status}; |
| 29 |
|
| 30 |
pub type ProtocolRemovePackageList = eficall! {fn( |
| 31 |
*const Protocol, |
| 32 |
crate::hii::Handle, |
| 33 |
) -> crate::base::Status}; |
| 34 |
|
| 35 |
pub type ProtocolUpdatePackageList = eficall! {fn( |
| 36 |
*const Protocol, |
| 37 |
crate::hii::Handle, |
| 38 |
*const crate::hii::PackageListHeader, |
| 39 |
) -> crate::base::Status}; |
| 40 |
|
| 41 |
pub type ProtocolListPackageLists = eficall! {fn( |
| 42 |
*const Protocol, |
| 43 |
u8, |
| 44 |
*const crate::base::Guid, |
| 45 |
*mut usize, |
| 46 |
*mut crate::hii::Handle, |
| 47 |
) -> crate::base::Status}; |
| 48 |
|
| 49 |
pub type ProtocolExportPackageLists = eficall! {fn( |
| 50 |
*const Protocol, |
| 51 |
crate::hii::Handle, |
| 52 |
*mut usize, |
| 53 |
*mut crate::hii::PackageListHeader, |
| 54 |
) -> crate::base::Status}; |
| 55 |
|
| 56 |
pub type ProtocolRegisterPackageNotify = eficall! {fn( |
| 57 |
*const Protocol, |
| 58 |
u8, |
| 59 |
*const crate::base::Guid, |
| 60 |
Notify, |
| 61 |
NotifyType, |
| 62 |
*mut crate::base::Handle, |
| 63 |
) -> crate::base::Status}; |
| 64 |
|
| 65 |
pub type ProtocolUnregisterPackageNotify = eficall! {fn( |
| 66 |
*const Protocol, |
| 67 |
crate::base::Handle, |
| 68 |
) -> crate::base::Status}; |
| 69 |
|
| 70 |
pub type ProtocolFindKeyboardLayouts = eficall! {fn( |
| 71 |
*const Protocol, |
| 72 |
*mut u16, |
| 73 |
*mut crate::base::Guid, |
| 74 |
) -> crate::base::Status}; |
| 75 |
|
| 76 |
pub type ProtocolGetKeyboardLayout = eficall! {fn( |
| 77 |
*const Protocol, |
| 78 |
*const crate::base::Guid, |
| 79 |
*mut u16, |
| 80 |
*mut KeyboardLayout, |
| 81 |
) -> crate::base::Status}; |
| 82 |
|
| 83 |
pub type ProtocolSetKeyboardLayout = eficall! {fn( |
| 84 |
*const Protocol, |
| 85 |
*mut crate::base::Guid, |
| 86 |
) -> crate::base::Status}; |
| 87 |
|
| 88 |
pub type ProtocolGetPackageListHandle = eficall! {fn( |
| 89 |
*const Protocol, |
| 90 |
crate::hii::Handle, |
| 91 |
*mut crate::base::Handle, |
| 92 |
) -> crate::base::Status}; |
| 93 |
|
| 94 |
#[repr(C)] |
| 95 |
pub struct Protocol { |
| 96 |
pub new_package_list: ProtocolNewPackageList, |
| 97 |
pub remove_package_list: ProtocolRemovePackageList, |
| 98 |
pub update_package_list: ProtocolUpdatePackageList, |
| 99 |
pub list_package_lists: ProtocolListPackageLists, |
| 100 |
pub export_package_lists: ProtocolExportPackageLists, |
| 101 |
pub register_package_notify: ProtocolRegisterPackageNotify, |
| 102 |
pub unregister_package_notify: ProtocolUnregisterPackageNotify, |
| 103 |
pub find_keyboard_layouts: ProtocolFindKeyboardLayouts, |
| 104 |
pub get_keyboard_layout: ProtocolGetKeyboardLayout, |
| 105 |
pub set_keyboard_layout: ProtocolSetKeyboardLayout, |
| 106 |
pub get_package_list_handle: ProtocolGetPackageListHandle, |
| 107 |
} |
| 108 |
|
| 109 |
#[repr(C)] |
| 110 |
#[derive(Clone, Copy, Debug)] |
| 111 |
pub struct KeyboardLayout<const N: usize = 0> { |
| 112 |
pub layout_length: u16, |
| 113 |
pub guid: crate::base::Guid, |
| 114 |
pub layout_descriptor_string_offset: u32, |
| 115 |
pub descriptor_count: u8, |
| 116 |
pub descriptors: [KeyDescriptor; N], |
| 117 |
} |
| 118 |
|
| 119 |
#[repr(C)] |
| 120 |
#[derive(Clone, Copy, Debug)] |
| 121 |
pub struct KeyDescriptor { |
| 122 |
pub key: Key, |
| 123 |
pub unicode: crate::base::Char16, |
| 124 |
pub shifted_unicode: crate::base::Char16, |
| 125 |
pub alt_gr_unicode: crate::base::Char16, |
| 126 |
pub shifted_alt_gr_unicode: crate::base::Char16, |
| 127 |
pub modifier: u16, |
| 128 |
pub affected_attribute: u16, |
| 129 |
} |
| 130 |
|
| 131 |
pub const AFFECTED_BY_STANDARD_SHIFT: u16 = 0x0001; |
| 132 |
pub const AFFECTED_BY_CAPS_LOCK: u16 = 0x0002; |
| 133 |
pub const AFFECTED_BY_NUM_LOCK: u16 = 0x0004; |
| 134 |
|
| 135 |
pub type Key = u32; |
| 136 |
|
| 137 |
pub const EFI_KEY_LCTRL: Key = 0x00000000; |
| 138 |
pub const EFI_KEY_A0: Key = 0x00000001; |
| 139 |
pub const EFI_KEY_LALT: Key = 0x00000002; |
| 140 |
pub const EFI_KEY_SPACE_BAR: Key = 0x00000003; |
| 141 |
pub const EFI_KEY_A2: Key = 0x00000004; |
| 142 |
pub const EFI_KEY_A3: Key = 0x00000005; |
| 143 |
pub const EFI_KEY_A4: Key = 0x00000006; |
| 144 |
pub const EFI_KEY_RCTRL: Key = 0x00000007; |
| 145 |
pub const EFI_KEY_LEFT_ARROW: Key = 0x00000008; |
| 146 |
pub const EFI_KEY_DOWN_ARROW: Key = 0x00000009; |
| 147 |
pub const EFI_KEY_RIGHT_ARROW: Key = 0x0000000a; |
| 148 |
pub const EFI_KEY_ZERO: Key = 0x0000000b; |
| 149 |
pub const EFI_KEY_PERIOD: Key = 0x0000000c; |
| 150 |
pub const EFI_KEY_ENTER: Key = 0x0000000d; |
| 151 |
pub const EFI_KEY_LSHIFT: Key = 0x0000000e; |
| 152 |
pub const EFI_KEY_B0: Key = 0x0000000f; |
| 153 |
pub const EFI_KEY_B1: Key = 0x00000010; |
| 154 |
pub const EFI_KEY_B2: Key = 0x00000011; |
| 155 |
pub const EFI_KEY_B3: Key = 0x00000012; |
| 156 |
pub const EFI_KEY_B4: Key = 0x00000013; |
| 157 |
pub const EFI_KEY_B5: Key = 0x00000014; |
| 158 |
pub const EFI_KEY_B6: Key = 0x00000015; |
| 159 |
pub const EFI_KEY_B7: Key = 0x00000016; |
| 160 |
pub const EFI_KEY_B8: Key = 0x00000017; |
| 161 |
pub const EFI_KEY_B9: Key = 0x00000018; |
| 162 |
pub const EFI_KEY_B10: Key = 0x00000019; |
| 163 |
pub const EFI_KEY_RSHIFT: Key = 0x0000001a; |
| 164 |
pub const EFI_KEY_UP_ARROW: Key = 0x0000001b; |
| 165 |
pub const EFI_KEY_ONE: Key = 0x0000001c; |
| 166 |
pub const EFI_KEY_TWO: Key = 0x0000001d; |
| 167 |
pub const EFI_KEY_THREE: Key = 0x0000001e; |
| 168 |
pub const EFI_KEY_CAPS_LOCK: Key = 0x0000001f; |
| 169 |
pub const EFI_KEY_C1: Key = 0x00000020; |
| 170 |
pub const EFI_KEY_C2: Key = 0x00000021; |
| 171 |
pub const EFI_KEY_C3: Key = 0x00000022; |
| 172 |
pub const EFI_KEY_C4: Key = 0x00000023; |
| 173 |
pub const EFI_KEY_C5: Key = 0x00000024; |
| 174 |
pub const EFI_KEY_C6: Key = 0x00000025; |
| 175 |
pub const EFI_KEY_C7: Key = 0x00000026; |
| 176 |
pub const EFI_KEY_C8: Key = 0x00000027; |
| 177 |
pub const EFI_KEY_C9: Key = 0x00000028; |
| 178 |
pub const EFI_KEY_C10: Key = 0x00000029; |
| 179 |
pub const EFI_KEY_C11: Key = 0x0000002a; |
| 180 |
pub const EFI_KEY_C12: Key = 0x0000002b; |
| 181 |
pub const EFI_KEY_FOUR: Key = 0x0000002c; |
| 182 |
pub const EFI_KEY_FIVE: Key = 0x0000002d; |
| 183 |
pub const EFI_KEY_SIX: Key = 0x0000002e; |
| 184 |
pub const EFI_KEY_PLUS: Key = 0x0000002f; |
| 185 |
pub const EFI_KEY_TAB: Key = 0x00000030; |
| 186 |
pub const EFI_KEY_D1: Key = 0x00000031; |
| 187 |
pub const EFI_KEY_D2: Key = 0x00000032; |
| 188 |
pub const EFI_KEY_D3: Key = 0x00000033; |
| 189 |
pub const EFI_KEY_D4: Key = 0x00000034; |
| 190 |
pub const EFI_KEY_D5: Key = 0x00000035; |
| 191 |
pub const EFI_KEY_D6: Key = 0x00000036; |
| 192 |
pub const EFI_KEY_D7: Key = 0x00000037; |
| 193 |
pub const EFI_KEY_D8: Key = 0x00000038; |
| 194 |
pub const EFI_KEY_D9: Key = 0x00000039; |
| 195 |
pub const EFI_KEY_D10: Key = 0x0000003a; |
| 196 |
pub const EFI_KEY_D11: Key = 0x0000003b; |
| 197 |
pub const EFI_KEY_D12: Key = 0x0000003c; |
| 198 |
pub const EFI_KEY_D13: Key = 0x0000003d; |
| 199 |
pub const EFI_KEY_DEL: Key = 0x0000003e; |
| 200 |
pub const EFI_KEY_END: Key = 0x0000003f; |
| 201 |
pub const EFI_KEY_PGDN: Key = 0x00000040; |
| 202 |
pub const EFI_KEY_SEVEN: Key = 0x00000041; |
| 203 |
pub const EFI_KEY_EIGHT: Key = 0x00000042; |
| 204 |
pub const EFI_KEY_NINE: Key = 0x00000043; |
| 205 |
pub const EFI_KEY_E0: Key = 0x00000044; |
| 206 |
pub const EFI_KEY_E1: Key = 0x00000045; |
| 207 |
pub const EFI_KEY_E2: Key = 0x00000046; |
| 208 |
pub const EFI_KEY_E3: Key = 0x00000047; |
| 209 |
pub const EFI_KEY_E4: Key = 0x00000048; |
| 210 |
pub const EFI_KEY_E5: Key = 0x00000049; |
| 211 |
pub const EFI_KEY_E6: Key = 0x0000004a; |
| 212 |
pub const EFI_KEY_E7: Key = 0x0000004b; |
| 213 |
pub const EFI_KEY_E8: Key = 0x0000004c; |
| 214 |
pub const EFI_KEY_E9: Key = 0x0000004d; |
| 215 |
pub const EFI_KEY_E10: Key = 0x0000004e; |
| 216 |
pub const EFI_KEY_E11: Key = 0x0000004f; |
| 217 |
pub const EFI_KEY_E12: Key = 0x00000050; |
| 218 |
pub const EFI_KEY_BACK_SPACE: Key = 0x00000051; |
| 219 |
pub const EFI_KEY_INS: Key = 0x00000052; |
| 220 |
pub const EFI_KEY_HOME: Key = 0x00000053; |
| 221 |
pub const EFI_KEY_PGUP: Key = 0x00000054; |
| 222 |
pub const EFI_KEY_NLCK: Key = 0x00000055; |
| 223 |
pub const EFI_KEY_SLASH: Key = 0x00000056; |
| 224 |
pub const EFI_KEY_ASTERISK: Key = 0x00000057; |
| 225 |
pub const EFI_KEY_MINUS: Key = 0x00000058; |
| 226 |
pub const EFI_KEY_ESC: Key = 0x00000059; |
| 227 |
pub const EFI_KEY_F1: Key = 0x0000005a; |
| 228 |
pub const EFI_KEY_F2: Key = 0x0000005b; |
| 229 |
pub const EFI_KEY_F3: Key = 0x0000005c; |
| 230 |
pub const EFI_KEY_F4: Key = 0x0000005d; |
| 231 |
pub const EFI_KEY_F5: Key = 0x0000005e; |
| 232 |
pub const EFI_KEY_F6: Key = 0x0000005f; |
| 233 |
pub const EFI_KEY_F7: Key = 0x00000060; |
| 234 |
pub const EFI_KEY_F8: Key = 0x00000061; |
| 235 |
pub const EFI_KEY_F9: Key = 0x00000062; |
| 236 |
pub const EFI_KEY_F10: Key = 0x00000063; |
| 237 |
pub const EFI_KEY_F11: Key = 0x00000064; |
| 238 |
pub const EFI_KEY_F12: Key = 0x00000065; |
| 239 |
pub const EFI_KEY_PRINT: Key = 0x00000066; |
| 240 |
pub const EFI_KEY_SLCK: Key = 0x00000067; |
| 241 |
pub const EFI_KEY_PAUSE: Key = 0x00000068; |
| 242 |
|
| 243 |
pub const NULL_MODIFIER: u16 = 0x0000; |
| 244 |
pub const LEFT_CONTROL_MODIFIER: u16 = 0x0001; |
| 245 |
pub const RIGHT_CONTROL_MODIFIER: u16 = 0x0002; |
| 246 |
pub const LEFT_ALT_MODIFIER: u16 = 0x0003; |
| 247 |
pub const RIGHT_ALT_MODIFIER: u16 = 0x0004; |
| 248 |
pub const ALT_GR_MODIFIER: u16 = 0x0005; |
| 249 |
pub const INSERT_MODIFIER: u16 = 0x0006; |
| 250 |
pub const DELETE_MODIFIER: u16 = 0x0007; |
| 251 |
pub const PAGE_DOWN_MODIFIER: u16 = 0x0008; |
| 252 |
pub const PAGE_UP_MODIFIER: u16 = 0x0009; |
| 253 |
pub const HOME_MODIFIER: u16 = 0x000A; |
| 254 |
pub const END_MODIFIER: u16 = 0x000B; |
| 255 |
pub const LEFT_SHIFT_MODIFIER: u16 = 0x000C; |
| 256 |
pub const RIGHT_SHIFT_MODIFIER: u16 = 0x000D; |
| 257 |
pub const CAPS_LOCK_MODIFIER: u16 = 0x000E; |
| 258 |
pub const NUM_LOCK_MODIFIER: u16 = 0x000F; |
| 259 |
pub const LEFT_ARROW_MODIFIER: u16 = 0x0010; |
| 260 |
pub const RIGHT_ARROW_MODIFIER: u16 = 0x0011; |
| 261 |
pub const DOWN_ARROW_MODIFIER: u16 = 0x0012; |
| 262 |
pub const UP_ARROW_MODIFIER: u16 = 0x0013; |
| 263 |
pub const NS_KEY_MODIFIER: u16 = 0x0014; |
| 264 |
pub const NS_KEY_DEPENDENCY_MODIFIER: u16 = 0x0015; |
| 265 |
pub const FUNCTION_KEY_ONE_MODIFIER: u16 = 0x0016; |
| 266 |
pub const FUNCTION_KEY_TWO_MODIFIER: u16 = 0x0017; |
| 267 |
pub const FUNCTION_KEY_THREE_MODIFIER: u16 = 0x0018; |
| 268 |
pub const FUNCTION_KEY_FOUR_MODIFIER: u16 = 0x0019; |
| 269 |
pub const FUNCTION_KEY_FIVE_MODIFIER: u16 = 0x001A; |
| 270 |
pub const FUNCTION_KEY_SIX_MODIFIER: u16 = 0x001B; |
| 271 |
pub const FUNCTION_KEY_SEVEN_MODIFIER: u16 = 0x001C; |
| 272 |
pub const FUNCTION_KEY_EIGHT_MODIFIER: u16 = 0x001D; |
| 273 |
pub const FUNCTION_KEY_NINE_MODIFIER: u16 = 0x001E; |
| 274 |
pub const FUNCTION_KEY_TEN_MODIFIER: u16 = 0x001F; |
| 275 |
pub const FUNCTION_KEY_ELEVEN_MODIFIER: u16 = 0x0020; |
| 276 |
pub const FUNCTION_KEY_TWELVE_MODIFIER: u16 = 0x0021; |
| 277 |
pub const PRINT_MODIFIER: u16 = 0x0022; |
| 278 |
pub const SYS_REQUEST_MODIFIER: u16 = 0x0023; |
| 279 |
pub const SCROLL_LOCK_MODIFIER: u16 = 0x0024; |
| 280 |
pub const PAUSE_MODIFIER: u16 = 0x0025; |
| 281 |
pub const BREAK_MODIFIER: u16 = 0x0026; |
| 282 |
pub const LEFT_LOGO_MODIFIER: u16 = 0x0027; |
| 283 |
pub const RIGHT_LOGO_MODIFIER: u16 = 0x0028; |
| 284 |
pub const MENU_MODIFIER: u16 = 0x0029; |
| 285 |
|
| 286 |
pub type Notify = eficall! {fn( |
| 287 |
u8, |
| 288 |
*const crate::base::Guid, |
| 289 |
*const crate::hii::PackageHeader, |
| 290 |
crate::hii::Handle, |
| 291 |
NotifyType, |
| 292 |
) -> crate::base::Status}; |
| 293 |
|
| 294 |
pub type NotifyType = usize; |
| 295 |
|
| 296 |
pub const NOTIFY_NEW_PACK: NotifyType = 0x00000001; |
| 297 |
pub const NOTIFY_REMOVE_PACK: NotifyType = 0x00000002; |
| 298 |
pub const NOTIFY_EXPORT_PACK: NotifyType = 0x00000004; |
| 299 |
pub const NOTIFY_ADD_PACK: NotifyType = 0x00000008; |