Skip to content

uefi-raw: Add SimplePointerProtocol #884

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 26, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 38 additions & 0 deletions uefi-raw/src/protocol/console.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,3 +52,41 @@ pub struct SimpleTextOutputProtocol {
impl SimpleTextOutputProtocol {
pub const GUID: Guid = guid!("387477c2-69c7-11d2-8e39-00a0c969723b");
}

#[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
#[repr(C)]
pub struct SimplePointerMode {
pub resolution_x: u64,
pub resolution_y: u64,
pub resolution_z: u64,
pub left_button: u8,
pub right_button: u8,
}

#[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
#[repr(C)]
pub struct SimplePointerState {
pub relative_movement_x: i32,
pub relative_movement_y: i32,
pub relative_movement_z: i32,
pub left_button: u8,
pub right_button: u8,
}

#[repr(C)]
pub struct SimplePointerProtocol {
pub reset: unsafe extern "efiapi" fn(
this: *mut SimplePointerProtocol,
extended_verification: bool,
) -> Status,
pub get_state: unsafe extern "efiapi" fn(
this: *mut SimplePointerProtocol,
state: *mut SimplePointerState,
) -> Status,
pub wait_for_input: Event,
pub mode: *const SimplePointerMode,
}

impl SimplePointerProtocol {
pub const GUID: Guid = guid!("31878c87-0b75-11d5-9a4f-0090273fc14d");
}