From 80317994ba8a8b7f72c0bf0d824e4ade59a4b6c8 Mon Sep 17 00:00:00 2001 From: Hannes Schulze Date: Thu, 9 Apr 2026 23:07:23 +0200 Subject: fix build on linux --- .../Protocols/RiverLibinputConfigV1/Interface.lean | 868 +++++++++++++++++++++ 1 file changed, 868 insertions(+) create mode 100644 lib/Wayland/Protocols/RiverLibinputConfigV1/Interface.lean (limited to 'lib/Wayland/Protocols/RiverLibinputConfigV1/Interface.lean') diff --git a/lib/Wayland/Protocols/RiverLibinputConfigV1/Interface.lean b/lib/Wayland/Protocols/RiverLibinputConfigV1/Interface.lean new file mode 100644 index 0000000..b98b0e9 --- /dev/null +++ b/lib/Wayland/Protocols/RiverLibinputConfigV1/Interface.lean @@ -0,0 +1,868 @@ +import Wayland.Display +import Wayland.Protocols.RiverInputManagementV1.Header +import Wayland.Protocols.RiverLibinputConfigV1.Header + +namespace Wayland.Protocols + +inductive RiverLibinputConfigV1.Event where + | finished + | libinputDevice + (id : RiverLibinputDeviceV1) + +inductive RiverLibinputDeviceV1.Event where + | removed + | inputDevice + (device : RiverInputDeviceV1) + | sendEventsSupport + (modes : RiverLibinputDeviceV1.SendEventsModes) + | sendEventsDefault + (mode : RiverLibinputDeviceV1.SendEventsModes) + | sendEventsCurrent + (mode : RiverLibinputDeviceV1.SendEventsModes) + | tapSupport + (fingerCount : Int32) + | tapDefault + (state : RiverLibinputDeviceV1.TapState) + | tapCurrent + (state : RiverLibinputDeviceV1.TapState) + | tapButtonMapDefault + (buttonMap : RiverLibinputDeviceV1.TapButtonMap) + | tapButtonMapCurrent + (buttonMap : RiverLibinputDeviceV1.TapButtonMap) + | dragDefault + (state : RiverLibinputDeviceV1.DragState) + | dragCurrent + (state : RiverLibinputDeviceV1.DragState) + | dragLockDefault + (state : RiverLibinputDeviceV1.DragLockState) + | dragLockCurrent + (state : RiverLibinputDeviceV1.DragLockState) + | threeFingerDragSupport + (fingerCount : Int32) + | threeFingerDragDefault + (state : RiverLibinputDeviceV1.ThreeFingerDragState) + | threeFingerDragCurrent + (state : RiverLibinputDeviceV1.ThreeFingerDragState) + | calibrationMatrixSupport + (supported : Int32) + | calibrationMatrixDefault + (matrix : ByteArray) + | calibrationMatrixCurrent + (matrix : ByteArray) + | accelProfilesSupport + (profiles : RiverLibinputDeviceV1.AccelProfiles) + | accelProfileDefault + (profile : RiverLibinputDeviceV1.AccelProfile) + | accelProfileCurrent + (profile : RiverLibinputDeviceV1.AccelProfile) + | accelSpeedDefault + (speed : ByteArray) + | accelSpeedCurrent + (speed : ByteArray) + | naturalScrollSupport + (supported : Int32) + | naturalScrollDefault + (state : RiverLibinputDeviceV1.NaturalScrollState) + | naturalScrollCurrent + (state : RiverLibinputDeviceV1.NaturalScrollState) + | leftHandedSupport + (supported : Int32) + | leftHandedDefault + (state : RiverLibinputDeviceV1.LeftHandedState) + | leftHandedCurrent + (state : RiverLibinputDeviceV1.LeftHandedState) + | clickMethodSupport + (methods : RiverLibinputDeviceV1.ClickMethods) + | clickMethodDefault + (method : RiverLibinputDeviceV1.ClickMethod) + | clickMethodCurrent + (method : RiverLibinputDeviceV1.ClickMethod) + | clickfingerButtonMapDefault + (buttonMap : RiverLibinputDeviceV1.ClickfingerButtonMap) + | clickfingerButtonMapCurrent + (buttonMap : RiverLibinputDeviceV1.ClickfingerButtonMap) + | middleEmulationSupport + (supported : Int32) + | middleEmulationDefault + (state : RiverLibinputDeviceV1.MiddleEmulationState) + | middleEmulationCurrent + (state : RiverLibinputDeviceV1.MiddleEmulationState) + | scrollMethodSupport + (methods : RiverLibinputDeviceV1.ScrollMethods) + | scrollMethodDefault + (method : RiverLibinputDeviceV1.ScrollMethod) + | scrollMethodCurrent + (method : RiverLibinputDeviceV1.ScrollMethod) + | scrollButtonDefault + (button : UInt32) + | scrollButtonCurrent + (button : UInt32) + | scrollButtonLockDefault + (state : RiverLibinputDeviceV1.ScrollButtonLockState) + | scrollButtonLockCurrent + (state : RiverLibinputDeviceV1.ScrollButtonLockState) + | dwtSupport + (supported : Int32) + | dwtDefault + (state : RiverLibinputDeviceV1.DwtState) + | dwtCurrent + (state : RiverLibinputDeviceV1.DwtState) + | dwtpSupport + (supported : Int32) + | dwtpDefault + (state : RiverLibinputDeviceV1.DwtpState) + | dwtpCurrent + (state : RiverLibinputDeviceV1.DwtpState) + | rotationSupport + (supported : Int32) + | rotationDefault + (angle : UInt32) + | rotationCurrent + (angle : UInt32) + +inductive RiverLibinputAccelConfigV1.Event where + +inductive RiverLibinputResultV1.Event where + | success + | unsupported + | invalid + + +instance instInterfaceRiverLibinputConfigV1 : Interface RiverLibinputConfigV1.name where + event := RiverLibinputConfigV1.Event + version := 1 + requests := #[ + { + name := "stop" + args := #[] + since := 1 + isDestructor := false + }, + { + name := "destroy" + args := #[] + since := 1 + isDestructor := true + }, + { + name := "create_accel_config" + args := #[.newID (.some "river_libinput_accel_config_v1"), .uint] + since := 1 + isDestructor := false + }, + ] + events := #[ + { + name := "finished" + args := #[] + since := 1 + isDestructor := false + }, + { + name := "libinput_device" + args := #[.newID (.some "river_libinput_device_v1")] + since := 1 + isDestructor := false + }, + ] + demarshalEvent + | 0 => do + return .finished + | 1 => do + return .libinputDevice + (← Marshallable.demarshal .object) + | _ => throw s!"Received invalid opcode" + +instance instInterfaceRiverLibinputDeviceV1 : Interface RiverLibinputDeviceV1.name where + event := RiverLibinputDeviceV1.Event + version := 1 + requests := #[ + { + name := "destroy" + args := #[] + since := 1 + isDestructor := true + }, + { + name := "set_send_events" + args := #[.newID (.some "river_libinput_result_v1"), .uint] + since := 1 + isDestructor := false + }, + { + name := "set_tap" + args := #[.newID (.some "river_libinput_result_v1"), .uint] + since := 1 + isDestructor := false + }, + { + name := "set_tap_button_map" + args := #[.newID (.some "river_libinput_result_v1"), .uint] + since := 1 + isDestructor := false + }, + { + name := "set_drag" + args := #[.newID (.some "river_libinput_result_v1"), .uint] + since := 1 + isDestructor := false + }, + { + name := "set_drag_lock" + args := #[.newID (.some "river_libinput_result_v1"), .uint] + since := 1 + isDestructor := false + }, + { + name := "set_three_finger_drag" + args := #[.newID (.some "river_libinput_result_v1"), .uint] + since := 1 + isDestructor := false + }, + { + name := "set_calibration_matrix" + args := #[.newID (.some "river_libinput_result_v1"), .array] + since := 1 + isDestructor := false + }, + { + name := "set_accel_profile" + args := #[.newID (.some "river_libinput_result_v1"), .uint] + since := 1 + isDestructor := false + }, + { + name := "set_accel_speed" + args := #[.newID (.some "river_libinput_result_v1"), .array] + since := 1 + isDestructor := false + }, + { + name := "apply_accel_config" + args := #[.newID (.some "river_libinput_result_v1"), .object .notNull (.some "river_libinput_accel_config_v1")] + since := 1 + isDestructor := false + }, + { + name := "set_natural_scroll" + args := #[.newID (.some "river_libinput_result_v1"), .uint] + since := 1 + isDestructor := false + }, + { + name := "set_left_handed" + args := #[.newID (.some "river_libinput_result_v1"), .uint] + since := 1 + isDestructor := false + }, + { + name := "set_click_method" + args := #[.newID (.some "river_libinput_result_v1"), .uint] + since := 1 + isDestructor := false + }, + { + name := "set_clickfinger_button_map" + args := #[.newID (.some "river_libinput_result_v1"), .uint] + since := 1 + isDestructor := false + }, + { + name := "set_middle_emulation" + args := #[.newID (.some "river_libinput_result_v1"), .uint] + since := 1 + isDestructor := false + }, + { + name := "set_scroll_method" + args := #[.newID (.some "river_libinput_result_v1"), .uint] + since := 1 + isDestructor := false + }, + { + name := "set_scroll_button" + args := #[.newID (.some "river_libinput_result_v1"), .uint] + since := 1 + isDestructor := false + }, + { + name := "set_scroll_button_lock" + args := #[.newID (.some "river_libinput_result_v1"), .uint] + since := 1 + isDestructor := false + }, + { + name := "set_dwt" + args := #[.newID (.some "river_libinput_result_v1"), .uint] + since := 1 + isDestructor := false + }, + { + name := "set_dwtp" + args := #[.newID (.some "river_libinput_result_v1"), .uint] + since := 1 + isDestructor := false + }, + { + name := "set_rotation" + args := #[.newID (.some "river_libinput_result_v1"), .uint] + since := 1 + isDestructor := false + }, + ] + events := #[ + { + name := "removed" + args := #[] + since := 1 + isDestructor := false + }, + { + name := "input_device" + args := #[.object .notNull (.some "river_input_device_v1")] + since := 1 + isDestructor := false + }, + { + name := "send_events_support" + args := #[.uint] + since := 1 + isDestructor := false + }, + { + name := "send_events_default" + args := #[.uint] + since := 1 + isDestructor := false + }, + { + name := "send_events_current" + args := #[.uint] + since := 1 + isDestructor := false + }, + { + name := "tap_support" + args := #[.int] + since := 1 + isDestructor := false + }, + { + name := "tap_default" + args := #[.uint] + since := 1 + isDestructor := false + }, + { + name := "tap_current" + args := #[.uint] + since := 1 + isDestructor := false + }, + { + name := "tap_button_map_default" + args := #[.uint] + since := 1 + isDestructor := false + }, + { + name := "tap_button_map_current" + args := #[.uint] + since := 1 + isDestructor := false + }, + { + name := "drag_default" + args := #[.uint] + since := 1 + isDestructor := false + }, + { + name := "drag_current" + args := #[.uint] + since := 1 + isDestructor := false + }, + { + name := "drag_lock_default" + args := #[.uint] + since := 1 + isDestructor := false + }, + { + name := "drag_lock_current" + args := #[.uint] + since := 1 + isDestructor := false + }, + { + name := "three_finger_drag_support" + args := #[.int] + since := 1 + isDestructor := false + }, + { + name := "three_finger_drag_default" + args := #[.uint] + since := 1 + isDestructor := false + }, + { + name := "three_finger_drag_current" + args := #[.uint] + since := 1 + isDestructor := false + }, + { + name := "calibration_matrix_support" + args := #[.int] + since := 1 + isDestructor := false + }, + { + name := "calibration_matrix_default" + args := #[.array] + since := 1 + isDestructor := false + }, + { + name := "calibration_matrix_current" + args := #[.array] + since := 1 + isDestructor := false + }, + { + name := "accel_profiles_support" + args := #[.uint] + since := 1 + isDestructor := false + }, + { + name := "accel_profile_default" + args := #[.uint] + since := 1 + isDestructor := false + }, + { + name := "accel_profile_current" + args := #[.uint] + since := 1 + isDestructor := false + }, + { + name := "accel_speed_default" + args := #[.array] + since := 1 + isDestructor := false + }, + { + name := "accel_speed_current" + args := #[.array] + since := 1 + isDestructor := false + }, + { + name := "natural_scroll_support" + args := #[.int] + since := 1 + isDestructor := false + }, + { + name := "natural_scroll_default" + args := #[.uint] + since := 1 + isDestructor := false + }, + { + name := "natural_scroll_current" + args := #[.uint] + since := 1 + isDestructor := false + }, + { + name := "left_handed_support" + args := #[.int] + since := 1 + isDestructor := false + }, + { + name := "left_handed_default" + args := #[.uint] + since := 1 + isDestructor := false + }, + { + name := "left_handed_current" + args := #[.uint] + since := 1 + isDestructor := false + }, + { + name := "click_method_support" + args := #[.uint] + since := 1 + isDestructor := false + }, + { + name := "click_method_default" + args := #[.uint] + since := 1 + isDestructor := false + }, + { + name := "click_method_current" + args := #[.uint] + since := 1 + isDestructor := false + }, + { + name := "clickfinger_button_map_default" + args := #[.uint] + since := 1 + isDestructor := false + }, + { + name := "clickfinger_button_map_current" + args := #[.uint] + since := 1 + isDestructor := false + }, + { + name := "middle_emulation_support" + args := #[.int] + since := 1 + isDestructor := false + }, + { + name := "middle_emulation_default" + args := #[.uint] + since := 1 + isDestructor := false + }, + { + name := "middle_emulation_current" + args := #[.uint] + since := 1 + isDestructor := false + }, + { + name := "scroll_method_support" + args := #[.uint] + since := 1 + isDestructor := false + }, + { + name := "scroll_method_default" + args := #[.uint] + since := 1 + isDestructor := false + }, + { + name := "scroll_method_current" + args := #[.uint] + since := 1 + isDestructor := false + }, + { + name := "scroll_button_default" + args := #[.uint] + since := 1 + isDestructor := false + }, + { + name := "scroll_button_current" + args := #[.uint] + since := 1 + isDestructor := false + }, + { + name := "scroll_button_lock_default" + args := #[.uint] + since := 1 + isDestructor := false + }, + { + name := "scroll_button_lock_current" + args := #[.uint] + since := 1 + isDestructor := false + }, + { + name := "dwt_support" + args := #[.int] + since := 1 + isDestructor := false + }, + { + name := "dwt_default" + args := #[.uint] + since := 1 + isDestructor := false + }, + { + name := "dwt_current" + args := #[.uint] + since := 1 + isDestructor := false + }, + { + name := "dwtp_support" + args := #[.int] + since := 1 + isDestructor := false + }, + { + name := "dwtp_default" + args := #[.uint] + since := 1 + isDestructor := false + }, + { + name := "dwtp_current" + args := #[.uint] + since := 1 + isDestructor := false + }, + { + name := "rotation_support" + args := #[.int] + since := 1 + isDestructor := false + }, + { + name := "rotation_default" + args := #[.uint] + since := 1 + isDestructor := false + }, + { + name := "rotation_current" + args := #[.uint] + since := 1 + isDestructor := false + }, + ] + demarshalEvent + | 0 => do + return .removed + | 1 => do + return .inputDevice + (← Marshallable.demarshal .object) + | 2 => do + return .sendEventsSupport + (← Marshallable.demarshal .uint) + | 3 => do + return .sendEventsDefault + (← Marshallable.demarshal .uint) + | 4 => do + return .sendEventsCurrent + (← Marshallable.demarshal .uint) + | 5 => do + return .tapSupport + (← Marshallable.demarshal .int) + | 6 => do + return .tapDefault + (← Marshallable.demarshal .uint) + | 7 => do + return .tapCurrent + (← Marshallable.demarshal .uint) + | 8 => do + return .tapButtonMapDefault + (← Marshallable.demarshal .uint) + | 9 => do + return .tapButtonMapCurrent + (← Marshallable.demarshal .uint) + | 10 => do + return .dragDefault + (← Marshallable.demarshal .uint) + | 11 => do + return .dragCurrent + (← Marshallable.demarshal .uint) + | 12 => do + return .dragLockDefault + (← Marshallable.demarshal .uint) + | 13 => do + return .dragLockCurrent + (← Marshallable.demarshal .uint) + | 14 => do + return .threeFingerDragSupport + (← Marshallable.demarshal .int) + | 15 => do + return .threeFingerDragDefault + (← Marshallable.demarshal .uint) + | 16 => do + return .threeFingerDragCurrent + (← Marshallable.demarshal .uint) + | 17 => do + return .calibrationMatrixSupport + (← Marshallable.demarshal .int) + | 18 => do + return .calibrationMatrixDefault + (← Marshallable.demarshal .array) + | 19 => do + return .calibrationMatrixCurrent + (← Marshallable.demarshal .array) + | 20 => do + return .accelProfilesSupport + (← Marshallable.demarshal .uint) + | 21 => do + return .accelProfileDefault + (← Marshallable.demarshal .uint) + | 22 => do + return .accelProfileCurrent + (← Marshallable.demarshal .uint) + | 23 => do + return .accelSpeedDefault + (← Marshallable.demarshal .array) + | 24 => do + return .accelSpeedCurrent + (← Marshallable.demarshal .array) + | 25 => do + return .naturalScrollSupport + (← Marshallable.demarshal .int) + | 26 => do + return .naturalScrollDefault + (← Marshallable.demarshal .uint) + | 27 => do + return .naturalScrollCurrent + (← Marshallable.demarshal .uint) + | 28 => do + return .leftHandedSupport + (← Marshallable.demarshal .int) + | 29 => do + return .leftHandedDefault + (← Marshallable.demarshal .uint) + | 30 => do + return .leftHandedCurrent + (← Marshallable.demarshal .uint) + | 31 => do + return .clickMethodSupport + (← Marshallable.demarshal .uint) + | 32 => do + return .clickMethodDefault + (← Marshallable.demarshal .uint) + | 33 => do + return .clickMethodCurrent + (← Marshallable.demarshal .uint) + | 34 => do + return .clickfingerButtonMapDefault + (← Marshallable.demarshal .uint) + | 35 => do + return .clickfingerButtonMapCurrent + (← Marshallable.demarshal .uint) + | 36 => do + return .middleEmulationSupport + (← Marshallable.demarshal .int) + | 37 => do + return .middleEmulationDefault + (← Marshallable.demarshal .uint) + | 38 => do + return .middleEmulationCurrent + (← Marshallable.demarshal .uint) + | 39 => do + return .scrollMethodSupport + (← Marshallable.demarshal .uint) + | 40 => do + return .scrollMethodDefault + (← Marshallable.demarshal .uint) + | 41 => do + return .scrollMethodCurrent + (← Marshallable.demarshal .uint) + | 42 => do + return .scrollButtonDefault + (← Marshallable.demarshal .uint) + | 43 => do + return .scrollButtonCurrent + (← Marshallable.demarshal .uint) + | 44 => do + return .scrollButtonLockDefault + (← Marshallable.demarshal .uint) + | 45 => do + return .scrollButtonLockCurrent + (← Marshallable.demarshal .uint) + | 46 => do + return .dwtSupport + (← Marshallable.demarshal .int) + | 47 => do + return .dwtDefault + (← Marshallable.demarshal .uint) + | 48 => do + return .dwtCurrent + (← Marshallable.demarshal .uint) + | 49 => do + return .dwtpSupport + (← Marshallable.demarshal .int) + | 50 => do + return .dwtpDefault + (← Marshallable.demarshal .uint) + | 51 => do + return .dwtpCurrent + (← Marshallable.demarshal .uint) + | 52 => do + return .rotationSupport + (← Marshallable.demarshal .int) + | 53 => do + return .rotationDefault + (← Marshallable.demarshal .uint) + | 54 => do + return .rotationCurrent + (← Marshallable.demarshal .uint) + | _ => throw s!"Received invalid opcode" + +instance instInterfaceRiverLibinputAccelConfigV1 : Interface RiverLibinputAccelConfigV1.name where + event := RiverLibinputAccelConfigV1.Event + version := 1 + requests := #[ + { + name := "destroy" + args := #[] + since := 1 + isDestructor := true + }, + { + name := "set_points" + args := #[.newID (.some "river_libinput_result_v1"), .uint, .array, .array] + since := 1 + isDestructor := false + }, + ] + events := #[ + ] + demarshalEvent + | _ => throw s!"Received invalid opcode" + +instance instInterfaceRiverLibinputResultV1 : Interface RiverLibinputResultV1.name where + event := RiverLibinputResultV1.Event + version := 1 + requests := #[ + ] + events := #[ + { + name := "success" + args := #[] + since := 1 + isDestructor := true + }, + { + name := "unsupported" + args := #[] + since := 1 + isDestructor := true + }, + { + name := "invalid" + args := #[] + since := 1 + isDestructor := true + }, + ] + demarshalEvent + | 0 => do + return .success + | 1 => do + return .unsupported + | 2 => do + return .invalid + | _ => throw s!"Received invalid opcode" + +end Wayland.Protocols \ No newline at end of file -- cgit v1.3.1