zig

fork of https://codeberg.org/ziglang/zig
Log | Files | Refs | README | LICENSE

blob 2d1c7d45 (1447B) - Raw


      1 const uefi = @import("std").os.uefi;
      2 const Event = uefi.Event;
      3 const Guid = uefi.Guid;
      4 const Status = uefi.Status;
      5 
      6 /// Protocol for mice
      7 pub const SimplePointerProtocol = struct {
      8     _reset: extern fn (*const SimplePointerProtocol, bool) Status,
      9     _get_state: extern fn (*const SimplePointerProtocol, *SimplePointerState) Status,
     10     wait_for_input: Event,
     11     mode: *SimplePointerMode,
     12 
     13     /// Resets the pointer device hardware.
     14     pub fn reset(self: *const SimplePointerProtocol, verify: bool) Status {
     15         return self._reset(self, verify);
     16     }
     17 
     18     /// Retrieves the current state of a pointer device.
     19     pub fn getState(self: *const SimplePointerProtocol, state: *SimplePointerState) Status {
     20         return self._get_state(self, state);
     21     }
     22 
     23     pub const guid align(8) = Guid{
     24         .time_low = 0x31878c87,
     25         .time_mid = 0x0b75,
     26         .time_high_and_version = 0x11d5,
     27         .clock_seq_high_and_reserved = 0x9a,
     28         .clock_seq_low = 0x4f,
     29         .node = [_]u8{ 0x00, 0x90, 0x27, 0x3f, 0xc1, 0x4d },
     30     };
     31 };
     32 
     33 pub const SimplePointerMode = struct {
     34     resolution_x: u64,
     35     resolution_y: u64,
     36     resolution_z: u64,
     37     left_button: bool,
     38     right_button: bool,
     39 };
     40 
     41 pub const SimplePointerState = struct {
     42     relative_movement_x: i32 = undefined,
     43     relative_movement_y: i32 = undefined,
     44     relative_movement_z: i32 = undefined,
     45     left_button: bool = undefined,
     46     right_button: bool = undefined,
     47 };