|
| 1 | +use crate::{guid, Char16, Event, Guid, Status}; |
| 2 | + |
| 3 | +#[derive(Clone, Copy, Debug, Default, Eq, PartialEq)] |
| 4 | +#[repr(C)] |
| 5 | +pub struct InputKey { |
| 6 | + pub scan_code: u16, |
| 7 | + pub unicode_char: Char16, |
| 8 | +} |
| 9 | + |
| 10 | +#[repr(C)] |
| 11 | +pub struct SimpleTextInputProtocol { |
| 12 | + pub reset: unsafe extern "efiapi" fn(this: *mut Self, extended_verification: bool) -> Status, |
| 13 | + pub read_key_stroke: unsafe extern "efiapi" fn(this: *mut Self, key: *mut InputKey) -> Status, |
| 14 | + pub wait_for_key: Event, |
| 15 | +} |
| 16 | + |
| 17 | +impl SimpleTextInputProtocol { |
| 18 | + pub const GUID: Guid = guid!("387477c1-69c7-11d2-8e39-00a0c969723b"); |
| 19 | +} |
| 20 | + |
| 21 | +#[derive(Clone, Copy, Debug, Default, Eq, PartialEq)] |
| 22 | +#[repr(C)] |
| 23 | +pub struct SimpleTextOutputMode { |
| 24 | + pub max_mode: i32, |
| 25 | + pub mode: i32, |
| 26 | + pub attribute: i32, |
| 27 | + pub cursor_column: i32, |
| 28 | + pub cursor_row: i32, |
| 29 | + pub cursor_visible: bool, |
| 30 | +} |
| 31 | + |
| 32 | +#[repr(C)] |
| 33 | +pub struct SimpleTextOutputProtocol { |
| 34 | + pub reset: unsafe extern "efiapi" fn(this: *mut Self, extended: bool) -> Status, |
| 35 | + pub output_string: unsafe extern "efiapi" fn(this: *mut Self, string: *const Char16) -> Status, |
| 36 | + pub test_string: unsafe extern "efiapi" fn(this: *mut Self, string: *const Char16) -> Status, |
| 37 | + pub query_mode: unsafe extern "efiapi" fn( |
| 38 | + this: *mut Self, |
| 39 | + mode: usize, |
| 40 | + columns: *mut usize, |
| 41 | + rows: *mut usize, |
| 42 | + ) -> Status, |
| 43 | + pub set_mode: unsafe extern "efiapi" fn(this: *mut Self, mode: usize) -> Status, |
| 44 | + pub set_attribute: unsafe extern "efiapi" fn(this: *mut Self, attribute: usize) -> Status, |
| 45 | + pub clear_screen: unsafe extern "efiapi" fn(this: *mut Self) -> Status, |
| 46 | + pub set_cursor_position: |
| 47 | + unsafe extern "efiapi" fn(this: *mut Self, column: usize, row: usize) -> Status, |
| 48 | + pub enable_cursor: unsafe extern "efiapi" fn(this: *mut Self, visible: bool) -> Status, |
| 49 | + pub mode: *mut SimpleTextOutputMode, |
| 50 | +} |
| 51 | + |
| 52 | +impl SimpleTextOutputProtocol { |
| 53 | + pub const GUID: Guid = guid!("387477c2-69c7-11d2-8e39-00a0c969723b"); |
| 54 | +} |
0 commit comments