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/Header.lean | 691 ++++++++++++++++ .../Protocols/RiverLibinputConfigV1/Interface.lean | 868 +++++++++++++++++++++ .../Protocols/RiverLibinputConfigV1/Requests.lean | 244 ++++++ .../Protocols/RiverLibinputConfigV1/Resolved.lean | 39 + 4 files changed, 1842 insertions(+) create mode 100644 lib/Wayland/Protocols/RiverLibinputConfigV1/Header.lean create mode 100644 lib/Wayland/Protocols/RiverLibinputConfigV1/Interface.lean create mode 100644 lib/Wayland/Protocols/RiverLibinputConfigV1/Requests.lean create mode 100644 lib/Wayland/Protocols/RiverLibinputConfigV1/Resolved.lean (limited to 'lib/Wayland/Protocols/RiverLibinputConfigV1') diff --git a/lib/Wayland/Protocols/RiverLibinputConfigV1/Header.lean b/lib/Wayland/Protocols/RiverLibinputConfigV1/Header.lean new file mode 100644 index 0000000..3f62b69 --- /dev/null +++ b/lib/Wayland/Protocols/RiverLibinputConfigV1/Header.lean @@ -0,0 +1,691 @@ +import Wayland.Display + +namespace Wayland.Protocols + +abbrev RiverLibinputConfigV1.name : InterfaceName := "river_libinput_config_v1" +abbrev RiverLibinputDeviceV1.name : InterfaceName := "river_libinput_device_v1" +abbrev RiverLibinputAccelConfigV1.name : InterfaceName := "river_libinput_accel_config_v1" +abbrev RiverLibinputResultV1.name : InterfaceName := "river_libinput_result_v1" + +abbrev RiverLibinputConfigV1 : Type := Object RiverLibinputConfigV1.name +abbrev RiverLibinputDeviceV1 : Type := Object RiverLibinputDeviceV1.name +abbrev RiverLibinputAccelConfigV1 : Type := Object RiverLibinputAccelConfigV1.name +abbrev RiverLibinputResultV1 : Type := Object RiverLibinputResultV1.name + +inductive RiverLibinputConfigV1.Error where + | invalidArg + | invalidDestroy + +inductive RiverLibinputDeviceV1.Error where + | invalidArg + +structure RiverLibinputDeviceV1.SendEventsModes where + enabled : Bool + disabled : Bool + disabledOnExternalMouse : Bool + +inductive RiverLibinputDeviceV1.TapState where + | disabled + | enabled + +inductive RiverLibinputDeviceV1.TapButtonMap where + | lrm + | lmr + +inductive RiverLibinputDeviceV1.DragState where + | disabled + | enabled + +inductive RiverLibinputDeviceV1.DragLockState where + | disabled + | enabledTimeout + | enabledSticky + +inductive RiverLibinputDeviceV1.ThreeFingerDragState where + | disabled + | enabled3fg + | enabled4fg + +inductive RiverLibinputDeviceV1.AccelProfile where + | none + | flat + | adaptive + | custom + +structure RiverLibinputDeviceV1.AccelProfiles where + none : Bool + flat : Bool + adaptive : Bool + custom : Bool + +inductive RiverLibinputDeviceV1.NaturalScrollState where + | disabled + | enabled + +inductive RiverLibinputDeviceV1.LeftHandedState where + | disabled + | enabled + +inductive RiverLibinputDeviceV1.ClickMethod where + | none + | buttonAreas + | clickfinger + +structure RiverLibinputDeviceV1.ClickMethods where + none : Bool + buttonAreas : Bool + clickfinger : Bool + +inductive RiverLibinputDeviceV1.ClickfingerButtonMap where + | lrm + | lmr + +inductive RiverLibinputDeviceV1.MiddleEmulationState where + | disabled + | enabled + +inductive RiverLibinputDeviceV1.ScrollMethod where + | noScroll + | twoFinger + | edge + | onButtonDown + +structure RiverLibinputDeviceV1.ScrollMethods where + noScroll : Bool + twoFinger : Bool + edge : Bool + onButtonDown : Bool + +inductive RiverLibinputDeviceV1.ScrollButtonLockState where + | disabled + | enabled + +inductive RiverLibinputDeviceV1.DwtState where + | disabled + | enabled + +inductive RiverLibinputDeviceV1.DwtpState where + | disabled + | enabled + +inductive RiverLibinputAccelConfigV1.Error where + | invalidArg + +inductive RiverLibinputAccelConfigV1.AccelType where + | fallback + | motion + | scroll + +namespace RiverLibinputConfigV1.Error + +instance : Marshallable RiverLibinputConfigV1.Error where + marshal + | .int, .invalidArg => ArgumentMarshaller.marshalInt 0 + | .uint, .invalidArg => ArgumentMarshaller.marshalUInt 0 + | .int, .invalidDestroy => ArgumentMarshaller.marshalInt 1 + | .uint, .invalidDestroy => ArgumentMarshaller.marshalUInt 1 + | _, _ => throw "Marshalling unexpected type, expected int or uint." + demarshal + | .int => do + match (← ArgumentDemarshaller.demarshalInt) with + | 0 => pure .invalidArg + | 1 => pure .invalidDestroy + | _ => throw "Invalid enum value." + | .uint => do + match (← ArgumentDemarshaller.demarshalUInt) with + | 0 => pure .invalidArg + | 1 => pure .invalidDestroy + | _ => throw "Invalid enum value." + | _ => throw "Demarshalling unexpected type, expected int or uint." + +end RiverLibinputConfigV1.Error + +namespace RiverLibinputDeviceV1.Error + +instance : Marshallable RiverLibinputDeviceV1.Error where + marshal + | .int, .invalidArg => ArgumentMarshaller.marshalInt 0 + | .uint, .invalidArg => ArgumentMarshaller.marshalUInt 0 + | _, _ => throw "Marshalling unexpected type, expected int or uint." + demarshal + | .int => do + match (← ArgumentDemarshaller.demarshalInt) with + | 0 => pure .invalidArg + | _ => throw "Invalid enum value." + | .uint => do + match (← ArgumentDemarshaller.demarshalUInt) with + | 0 => pure .invalidArg + | _ => throw "Invalid enum value." + | _ => throw "Demarshalling unexpected type, expected int or uint." + +end RiverLibinputDeviceV1.Error + +namespace RiverLibinputDeviceV1.SendEventsModes + +instance : Marshallable RiverLibinputDeviceV1.SendEventsModes where + marshal + | .uint, μ => ArgumentMarshaller.marshalUInt <| + 0 + ||| (if μ.enabled then 0 else 0) + ||| (if μ.disabled then 1 else 0) + ||| (if μ.disabledOnExternalMouse then 2 else 0) + | _, _ => throw "Marshalling unexpected type, expected uint." + demarshal + | .uint => do + let μ ← ArgumentDemarshaller.demarshalUInt + return { + enabled := (μ &&& 0) == 0 + disabled := (μ &&& 1) == 1 + disabledOnExternalMouse := (μ &&& 2) == 2 + } + | _ => throw "Demarshalling unexpected type, expected uint." + +end RiverLibinputDeviceV1.SendEventsModes + +namespace RiverLibinputDeviceV1.TapState + +instance : Marshallable RiverLibinputDeviceV1.TapState where + marshal + | .int, .disabled => ArgumentMarshaller.marshalInt 0 + | .uint, .disabled => ArgumentMarshaller.marshalUInt 0 + | .int, .enabled => ArgumentMarshaller.marshalInt 1 + | .uint, .enabled => ArgumentMarshaller.marshalUInt 1 + | _, _ => throw "Marshalling unexpected type, expected int or uint." + demarshal + | .int => do + match (← ArgumentDemarshaller.demarshalInt) with + | 0 => pure .disabled + | 1 => pure .enabled + | _ => throw "Invalid enum value." + | .uint => do + match (← ArgumentDemarshaller.demarshalUInt) with + | 0 => pure .disabled + | 1 => pure .enabled + | _ => throw "Invalid enum value." + | _ => throw "Demarshalling unexpected type, expected int or uint." + +end RiverLibinputDeviceV1.TapState + +namespace RiverLibinputDeviceV1.TapButtonMap + +instance : Marshallable RiverLibinputDeviceV1.TapButtonMap where + marshal + | .int, .lrm => ArgumentMarshaller.marshalInt 0 + | .uint, .lrm => ArgumentMarshaller.marshalUInt 0 + | .int, .lmr => ArgumentMarshaller.marshalInt 1 + | .uint, .lmr => ArgumentMarshaller.marshalUInt 1 + | _, _ => throw "Marshalling unexpected type, expected int or uint." + demarshal + | .int => do + match (← ArgumentDemarshaller.demarshalInt) with + | 0 => pure .lrm + | 1 => pure .lmr + | _ => throw "Invalid enum value." + | .uint => do + match (← ArgumentDemarshaller.demarshalUInt) with + | 0 => pure .lrm + | 1 => pure .lmr + | _ => throw "Invalid enum value." + | _ => throw "Demarshalling unexpected type, expected int or uint." + +end RiverLibinputDeviceV1.TapButtonMap + +namespace RiverLibinputDeviceV1.DragState + +instance : Marshallable RiverLibinputDeviceV1.DragState where + marshal + | .int, .disabled => ArgumentMarshaller.marshalInt 0 + | .uint, .disabled => ArgumentMarshaller.marshalUInt 0 + | .int, .enabled => ArgumentMarshaller.marshalInt 1 + | .uint, .enabled => ArgumentMarshaller.marshalUInt 1 + | _, _ => throw "Marshalling unexpected type, expected int or uint." + demarshal + | .int => do + match (← ArgumentDemarshaller.demarshalInt) with + | 0 => pure .disabled + | 1 => pure .enabled + | _ => throw "Invalid enum value." + | .uint => do + match (← ArgumentDemarshaller.demarshalUInt) with + | 0 => pure .disabled + | 1 => pure .enabled + | _ => throw "Invalid enum value." + | _ => throw "Demarshalling unexpected type, expected int or uint." + +end RiverLibinputDeviceV1.DragState + +namespace RiverLibinputDeviceV1.DragLockState + +instance : Marshallable RiverLibinputDeviceV1.DragLockState where + marshal + | .int, .disabled => ArgumentMarshaller.marshalInt 0 + | .uint, .disabled => ArgumentMarshaller.marshalUInt 0 + | .int, .enabledTimeout => ArgumentMarshaller.marshalInt 1 + | .uint, .enabledTimeout => ArgumentMarshaller.marshalUInt 1 + | .int, .enabledSticky => ArgumentMarshaller.marshalInt 2 + | .uint, .enabledSticky => ArgumentMarshaller.marshalUInt 2 + | _, _ => throw "Marshalling unexpected type, expected int or uint." + demarshal + | .int => do + match (← ArgumentDemarshaller.demarshalInt) with + | 0 => pure .disabled + | 1 => pure .enabledTimeout + | 2 => pure .enabledSticky + | _ => throw "Invalid enum value." + | .uint => do + match (← ArgumentDemarshaller.demarshalUInt) with + | 0 => pure .disabled + | 1 => pure .enabledTimeout + | 2 => pure .enabledSticky + | _ => throw "Invalid enum value." + | _ => throw "Demarshalling unexpected type, expected int or uint." + +end RiverLibinputDeviceV1.DragLockState + +namespace RiverLibinputDeviceV1.ThreeFingerDragState + +instance : Marshallable RiverLibinputDeviceV1.ThreeFingerDragState where + marshal + | .int, .disabled => ArgumentMarshaller.marshalInt 0 + | .uint, .disabled => ArgumentMarshaller.marshalUInt 0 + | .int, .enabled3fg => ArgumentMarshaller.marshalInt 1 + | .uint, .enabled3fg => ArgumentMarshaller.marshalUInt 1 + | .int, .enabled4fg => ArgumentMarshaller.marshalInt 2 + | .uint, .enabled4fg => ArgumentMarshaller.marshalUInt 2 + | _, _ => throw "Marshalling unexpected type, expected int or uint." + demarshal + | .int => do + match (← ArgumentDemarshaller.demarshalInt) with + | 0 => pure .disabled + | 1 => pure .enabled3fg + | 2 => pure .enabled4fg + | _ => throw "Invalid enum value." + | .uint => do + match (← ArgumentDemarshaller.demarshalUInt) with + | 0 => pure .disabled + | 1 => pure .enabled3fg + | 2 => pure .enabled4fg + | _ => throw "Invalid enum value." + | _ => throw "Demarshalling unexpected type, expected int or uint." + +end RiverLibinputDeviceV1.ThreeFingerDragState + +namespace RiverLibinputDeviceV1.AccelProfile + +instance : Marshallable RiverLibinputDeviceV1.AccelProfile where + marshal + | .int, .none => ArgumentMarshaller.marshalInt 0 + | .uint, .none => ArgumentMarshaller.marshalUInt 0 + | .int, .flat => ArgumentMarshaller.marshalInt 1 + | .uint, .flat => ArgumentMarshaller.marshalUInt 1 + | .int, .adaptive => ArgumentMarshaller.marshalInt 2 + | .uint, .adaptive => ArgumentMarshaller.marshalUInt 2 + | .int, .custom => ArgumentMarshaller.marshalInt 4 + | .uint, .custom => ArgumentMarshaller.marshalUInt 4 + | _, _ => throw "Marshalling unexpected type, expected int or uint." + demarshal + | .int => do + match (← ArgumentDemarshaller.demarshalInt) with + | 0 => pure .none + | 1 => pure .flat + | 2 => pure .adaptive + | 4 => pure .custom + | _ => throw "Invalid enum value." + | .uint => do + match (← ArgumentDemarshaller.demarshalUInt) with + | 0 => pure .none + | 1 => pure .flat + | 2 => pure .adaptive + | 4 => pure .custom + | _ => throw "Invalid enum value." + | _ => throw "Demarshalling unexpected type, expected int or uint." + +end RiverLibinputDeviceV1.AccelProfile + +namespace RiverLibinputDeviceV1.AccelProfiles + +instance : Marshallable RiverLibinputDeviceV1.AccelProfiles where + marshal + | .uint, μ => ArgumentMarshaller.marshalUInt <| + 0 + ||| (if μ.none then 0 else 0) + ||| (if μ.flat then 1 else 0) + ||| (if μ.adaptive then 2 else 0) + ||| (if μ.custom then 4 else 0) + | _, _ => throw "Marshalling unexpected type, expected uint." + demarshal + | .uint => do + let μ ← ArgumentDemarshaller.demarshalUInt + return { + none := (μ &&& 0) == 0 + flat := (μ &&& 1) == 1 + adaptive := (μ &&& 2) == 2 + custom := (μ &&& 4) == 4 + } + | _ => throw "Demarshalling unexpected type, expected uint." + +end RiverLibinputDeviceV1.AccelProfiles + +namespace RiverLibinputDeviceV1.NaturalScrollState + +instance : Marshallable RiverLibinputDeviceV1.NaturalScrollState where + marshal + | .int, .disabled => ArgumentMarshaller.marshalInt 0 + | .uint, .disabled => ArgumentMarshaller.marshalUInt 0 + | .int, .enabled => ArgumentMarshaller.marshalInt 1 + | .uint, .enabled => ArgumentMarshaller.marshalUInt 1 + | _, _ => throw "Marshalling unexpected type, expected int or uint." + demarshal + | .int => do + match (← ArgumentDemarshaller.demarshalInt) with + | 0 => pure .disabled + | 1 => pure .enabled + | _ => throw "Invalid enum value." + | .uint => do + match (← ArgumentDemarshaller.demarshalUInt) with + | 0 => pure .disabled + | 1 => pure .enabled + | _ => throw "Invalid enum value." + | _ => throw "Demarshalling unexpected type, expected int or uint." + +end RiverLibinputDeviceV1.NaturalScrollState + +namespace RiverLibinputDeviceV1.LeftHandedState + +instance : Marshallable RiverLibinputDeviceV1.LeftHandedState where + marshal + | .int, .disabled => ArgumentMarshaller.marshalInt 0 + | .uint, .disabled => ArgumentMarshaller.marshalUInt 0 + | .int, .enabled => ArgumentMarshaller.marshalInt 1 + | .uint, .enabled => ArgumentMarshaller.marshalUInt 1 + | _, _ => throw "Marshalling unexpected type, expected int or uint." + demarshal + | .int => do + match (← ArgumentDemarshaller.demarshalInt) with + | 0 => pure .disabled + | 1 => pure .enabled + | _ => throw "Invalid enum value." + | .uint => do + match (← ArgumentDemarshaller.demarshalUInt) with + | 0 => pure .disabled + | 1 => pure .enabled + | _ => throw "Invalid enum value." + | _ => throw "Demarshalling unexpected type, expected int or uint." + +end RiverLibinputDeviceV1.LeftHandedState + +namespace RiverLibinputDeviceV1.ClickMethod + +instance : Marshallable RiverLibinputDeviceV1.ClickMethod where + marshal + | .int, .none => ArgumentMarshaller.marshalInt 0 + | .uint, .none => ArgumentMarshaller.marshalUInt 0 + | .int, .buttonAreas => ArgumentMarshaller.marshalInt 1 + | .uint, .buttonAreas => ArgumentMarshaller.marshalUInt 1 + | .int, .clickfinger => ArgumentMarshaller.marshalInt 2 + | .uint, .clickfinger => ArgumentMarshaller.marshalUInt 2 + | _, _ => throw "Marshalling unexpected type, expected int or uint." + demarshal + | .int => do + match (← ArgumentDemarshaller.demarshalInt) with + | 0 => pure .none + | 1 => pure .buttonAreas + | 2 => pure .clickfinger + | _ => throw "Invalid enum value." + | .uint => do + match (← ArgumentDemarshaller.demarshalUInt) with + | 0 => pure .none + | 1 => pure .buttonAreas + | 2 => pure .clickfinger + | _ => throw "Invalid enum value." + | _ => throw "Demarshalling unexpected type, expected int or uint." + +end RiverLibinputDeviceV1.ClickMethod + +namespace RiverLibinputDeviceV1.ClickMethods + +instance : Marshallable RiverLibinputDeviceV1.ClickMethods where + marshal + | .uint, μ => ArgumentMarshaller.marshalUInt <| + 0 + ||| (if μ.none then 0 else 0) + ||| (if μ.buttonAreas then 1 else 0) + ||| (if μ.clickfinger then 2 else 0) + | _, _ => throw "Marshalling unexpected type, expected uint." + demarshal + | .uint => do + let μ ← ArgumentDemarshaller.demarshalUInt + return { + none := (μ &&& 0) == 0 + buttonAreas := (μ &&& 1) == 1 + clickfinger := (μ &&& 2) == 2 + } + | _ => throw "Demarshalling unexpected type, expected uint." + +end RiverLibinputDeviceV1.ClickMethods + +namespace RiverLibinputDeviceV1.ClickfingerButtonMap + +instance : Marshallable RiverLibinputDeviceV1.ClickfingerButtonMap where + marshal + | .int, .lrm => ArgumentMarshaller.marshalInt 0 + | .uint, .lrm => ArgumentMarshaller.marshalUInt 0 + | .int, .lmr => ArgumentMarshaller.marshalInt 1 + | .uint, .lmr => ArgumentMarshaller.marshalUInt 1 + | _, _ => throw "Marshalling unexpected type, expected int or uint." + demarshal + | .int => do + match (← ArgumentDemarshaller.demarshalInt) with + | 0 => pure .lrm + | 1 => pure .lmr + | _ => throw "Invalid enum value." + | .uint => do + match (← ArgumentDemarshaller.demarshalUInt) with + | 0 => pure .lrm + | 1 => pure .lmr + | _ => throw "Invalid enum value." + | _ => throw "Demarshalling unexpected type, expected int or uint." + +end RiverLibinputDeviceV1.ClickfingerButtonMap + +namespace RiverLibinputDeviceV1.MiddleEmulationState + +instance : Marshallable RiverLibinputDeviceV1.MiddleEmulationState where + marshal + | .int, .disabled => ArgumentMarshaller.marshalInt 0 + | .uint, .disabled => ArgumentMarshaller.marshalUInt 0 + | .int, .enabled => ArgumentMarshaller.marshalInt 1 + | .uint, .enabled => ArgumentMarshaller.marshalUInt 1 + | _, _ => throw "Marshalling unexpected type, expected int or uint." + demarshal + | .int => do + match (← ArgumentDemarshaller.demarshalInt) with + | 0 => pure .disabled + | 1 => pure .enabled + | _ => throw "Invalid enum value." + | .uint => do + match (← ArgumentDemarshaller.demarshalUInt) with + | 0 => pure .disabled + | 1 => pure .enabled + | _ => throw "Invalid enum value." + | _ => throw "Demarshalling unexpected type, expected int or uint." + +end RiverLibinputDeviceV1.MiddleEmulationState + +namespace RiverLibinputDeviceV1.ScrollMethod + +instance : Marshallable RiverLibinputDeviceV1.ScrollMethod where + marshal + | .int, .noScroll => ArgumentMarshaller.marshalInt 0 + | .uint, .noScroll => ArgumentMarshaller.marshalUInt 0 + | .int, .twoFinger => ArgumentMarshaller.marshalInt 1 + | .uint, .twoFinger => ArgumentMarshaller.marshalUInt 1 + | .int, .edge => ArgumentMarshaller.marshalInt 2 + | .uint, .edge => ArgumentMarshaller.marshalUInt 2 + | .int, .onButtonDown => ArgumentMarshaller.marshalInt 4 + | .uint, .onButtonDown => ArgumentMarshaller.marshalUInt 4 + | _, _ => throw "Marshalling unexpected type, expected int or uint." + demarshal + | .int => do + match (← ArgumentDemarshaller.demarshalInt) with + | 0 => pure .noScroll + | 1 => pure .twoFinger + | 2 => pure .edge + | 4 => pure .onButtonDown + | _ => throw "Invalid enum value." + | .uint => do + match (← ArgumentDemarshaller.demarshalUInt) with + | 0 => pure .noScroll + | 1 => pure .twoFinger + | 2 => pure .edge + | 4 => pure .onButtonDown + | _ => throw "Invalid enum value." + | _ => throw "Demarshalling unexpected type, expected int or uint." + +end RiverLibinputDeviceV1.ScrollMethod + +namespace RiverLibinputDeviceV1.ScrollMethods + +instance : Marshallable RiverLibinputDeviceV1.ScrollMethods where + marshal + | .uint, μ => ArgumentMarshaller.marshalUInt <| + 0 + ||| (if μ.noScroll then 0 else 0) + ||| (if μ.twoFinger then 1 else 0) + ||| (if μ.edge then 2 else 0) + ||| (if μ.onButtonDown then 4 else 0) + | _, _ => throw "Marshalling unexpected type, expected uint." + demarshal + | .uint => do + let μ ← ArgumentDemarshaller.demarshalUInt + return { + noScroll := (μ &&& 0) == 0 + twoFinger := (μ &&& 1) == 1 + edge := (μ &&& 2) == 2 + onButtonDown := (μ &&& 4) == 4 + } + | _ => throw "Demarshalling unexpected type, expected uint." + +end RiverLibinputDeviceV1.ScrollMethods + +namespace RiverLibinputDeviceV1.ScrollButtonLockState + +instance : Marshallable RiverLibinputDeviceV1.ScrollButtonLockState where + marshal + | .int, .disabled => ArgumentMarshaller.marshalInt 0 + | .uint, .disabled => ArgumentMarshaller.marshalUInt 0 + | .int, .enabled => ArgumentMarshaller.marshalInt 1 + | .uint, .enabled => ArgumentMarshaller.marshalUInt 1 + | _, _ => throw "Marshalling unexpected type, expected int or uint." + demarshal + | .int => do + match (← ArgumentDemarshaller.demarshalInt) with + | 0 => pure .disabled + | 1 => pure .enabled + | _ => throw "Invalid enum value." + | .uint => do + match (← ArgumentDemarshaller.demarshalUInt) with + | 0 => pure .disabled + | 1 => pure .enabled + | _ => throw "Invalid enum value." + | _ => throw "Demarshalling unexpected type, expected int or uint." + +end RiverLibinputDeviceV1.ScrollButtonLockState + +namespace RiverLibinputDeviceV1.DwtState + +instance : Marshallable RiverLibinputDeviceV1.DwtState where + marshal + | .int, .disabled => ArgumentMarshaller.marshalInt 0 + | .uint, .disabled => ArgumentMarshaller.marshalUInt 0 + | .int, .enabled => ArgumentMarshaller.marshalInt 1 + | .uint, .enabled => ArgumentMarshaller.marshalUInt 1 + | _, _ => throw "Marshalling unexpected type, expected int or uint." + demarshal + | .int => do + match (← ArgumentDemarshaller.demarshalInt) with + | 0 => pure .disabled + | 1 => pure .enabled + | _ => throw "Invalid enum value." + | .uint => do + match (← ArgumentDemarshaller.demarshalUInt) with + | 0 => pure .disabled + | 1 => pure .enabled + | _ => throw "Invalid enum value." + | _ => throw "Demarshalling unexpected type, expected int or uint." + +end RiverLibinputDeviceV1.DwtState + +namespace RiverLibinputDeviceV1.DwtpState + +instance : Marshallable RiverLibinputDeviceV1.DwtpState where + marshal + | .int, .disabled => ArgumentMarshaller.marshalInt 0 + | .uint, .disabled => ArgumentMarshaller.marshalUInt 0 + | .int, .enabled => ArgumentMarshaller.marshalInt 1 + | .uint, .enabled => ArgumentMarshaller.marshalUInt 1 + | _, _ => throw "Marshalling unexpected type, expected int or uint." + demarshal + | .int => do + match (← ArgumentDemarshaller.demarshalInt) with + | 0 => pure .disabled + | 1 => pure .enabled + | _ => throw "Invalid enum value." + | .uint => do + match (← ArgumentDemarshaller.demarshalUInt) with + | 0 => pure .disabled + | 1 => pure .enabled + | _ => throw "Invalid enum value." + | _ => throw "Demarshalling unexpected type, expected int or uint." + +end RiverLibinputDeviceV1.DwtpState + +namespace RiverLibinputAccelConfigV1.Error + +instance : Marshallable RiverLibinputAccelConfigV1.Error where + marshal + | .int, .invalidArg => ArgumentMarshaller.marshalInt 0 + | .uint, .invalidArg => ArgumentMarshaller.marshalUInt 0 + | _, _ => throw "Marshalling unexpected type, expected int or uint." + demarshal + | .int => do + match (← ArgumentDemarshaller.demarshalInt) with + | 0 => pure .invalidArg + | _ => throw "Invalid enum value." + | .uint => do + match (← ArgumentDemarshaller.demarshalUInt) with + | 0 => pure .invalidArg + | _ => throw "Invalid enum value." + | _ => throw "Demarshalling unexpected type, expected int or uint." + +end RiverLibinputAccelConfigV1.Error + +namespace RiverLibinputAccelConfigV1.AccelType + +instance : Marshallable RiverLibinputAccelConfigV1.AccelType where + marshal + | .int, .fallback => ArgumentMarshaller.marshalInt 0 + | .uint, .fallback => ArgumentMarshaller.marshalUInt 0 + | .int, .motion => ArgumentMarshaller.marshalInt 1 + | .uint, .motion => ArgumentMarshaller.marshalUInt 1 + | .int, .scroll => ArgumentMarshaller.marshalInt 2 + | .uint, .scroll => ArgumentMarshaller.marshalUInt 2 + | _, _ => throw "Marshalling unexpected type, expected int or uint." + demarshal + | .int => do + match (← ArgumentDemarshaller.demarshalInt) with + | 0 => pure .fallback + | 1 => pure .motion + | 2 => pure .scroll + | _ => throw "Invalid enum value." + | .uint => do + match (← ArgumentDemarshaller.demarshalUInt) with + | 0 => pure .fallback + | 1 => pure .motion + | 2 => pure .scroll + | _ => throw "Invalid enum value." + | _ => throw "Demarshalling unexpected type, expected int or uint." + +end RiverLibinputAccelConfigV1.AccelType + +end Wayland.Protocols \ No newline at end of file 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 diff --git a/lib/Wayland/Protocols/RiverLibinputConfigV1/Requests.lean b/lib/Wayland/Protocols/RiverLibinputConfigV1/Requests.lean new file mode 100644 index 0000000..12fb676 --- /dev/null +++ b/lib/Wayland/Protocols/RiverLibinputConfigV1/Requests.lean @@ -0,0 +1,244 @@ +import Wayland.Display +import Wayland.Protocols.RiverLibinputConfigV1.Header +import Wayland.Protocols.RiverLibinputConfigV1.Resolved + +namespace Wayland.Protocols + +variable {σ : Type} {ι : InterfaceName} [iface : ResolvedInterface ι] + +def RiverLibinputConfigV1.stop + (ω : RiverLibinputConfigV1) + : DisplayM σ Unit := + ω.send do + return 0 + +def RiverLibinputConfigV1.destroy + (ω : RiverLibinputConfigV1) + : DisplayM σ Unit := + ω.send do + return 1 + +def RiverLibinputConfigV1.createAccelConfig + (ω : RiverLibinputConfigV1) + (profile : RiverLibinputDeviceV1.AccelProfile) + : DisplayM σ RiverLibinputAccelConfigV1 := + ω.sendConstructor do + ArgumentMarshaller.marshalAnyObject .none + Marshallable.marshal .uint profile + return 2 + +def RiverLibinputDeviceV1.destroy + (ω : RiverLibinputDeviceV1) + : DisplayM σ Unit := + ω.send do + return 0 + +def RiverLibinputDeviceV1.setSendEvents + (ω : RiverLibinputDeviceV1) + (mode : RiverLibinputDeviceV1.SendEventsModes) + : DisplayM σ RiverLibinputResultV1 := + ω.sendConstructor do + ArgumentMarshaller.marshalAnyObject .none + Marshallable.marshal .uint mode + return 1 + +def RiverLibinputDeviceV1.setTap + (ω : RiverLibinputDeviceV1) + (state : RiverLibinputDeviceV1.TapState) + : DisplayM σ RiverLibinputResultV1 := + ω.sendConstructor do + ArgumentMarshaller.marshalAnyObject .none + Marshallable.marshal .uint state + return 2 + +def RiverLibinputDeviceV1.setTapButtonMap + (ω : RiverLibinputDeviceV1) + (buttonMap : RiverLibinputDeviceV1.TapButtonMap) + : DisplayM σ RiverLibinputResultV1 := + ω.sendConstructor do + ArgumentMarshaller.marshalAnyObject .none + Marshallable.marshal .uint buttonMap + return 3 + +def RiverLibinputDeviceV1.setDrag + (ω : RiverLibinputDeviceV1) + (state : RiverLibinputDeviceV1.DragState) + : DisplayM σ RiverLibinputResultV1 := + ω.sendConstructor do + ArgumentMarshaller.marshalAnyObject .none + Marshallable.marshal .uint state + return 4 + +def RiverLibinputDeviceV1.setDragLock + (ω : RiverLibinputDeviceV1) + (state : RiverLibinputDeviceV1.DragLockState) + : DisplayM σ RiverLibinputResultV1 := + ω.sendConstructor do + ArgumentMarshaller.marshalAnyObject .none + Marshallable.marshal .uint state + return 5 + +def RiverLibinputDeviceV1.setThreeFingerDrag + (ω : RiverLibinputDeviceV1) + (state : RiverLibinputDeviceV1.ThreeFingerDragState) + : DisplayM σ RiverLibinputResultV1 := + ω.sendConstructor do + ArgumentMarshaller.marshalAnyObject .none + Marshallable.marshal .uint state + return 6 + +def RiverLibinputDeviceV1.setCalibrationMatrix + (ω : RiverLibinputDeviceV1) + (matrix : ByteArray) + : DisplayM σ RiverLibinputResultV1 := + ω.sendConstructor do + ArgumentMarshaller.marshalAnyObject .none + Marshallable.marshal .array matrix + return 7 + +def RiverLibinputDeviceV1.setAccelProfile + (ω : RiverLibinputDeviceV1) + (profile : RiverLibinputDeviceV1.AccelProfile) + : DisplayM σ RiverLibinputResultV1 := + ω.sendConstructor do + ArgumentMarshaller.marshalAnyObject .none + Marshallable.marshal .uint profile + return 8 + +def RiverLibinputDeviceV1.setAccelSpeed + (ω : RiverLibinputDeviceV1) + (speed : ByteArray) + : DisplayM σ RiverLibinputResultV1 := + ω.sendConstructor do + ArgumentMarshaller.marshalAnyObject .none + Marshallable.marshal .array speed + return 9 + +def RiverLibinputDeviceV1.applyAccelConfig + (ω : RiverLibinputDeviceV1) + (config : RiverLibinputAccelConfigV1) + : DisplayM σ RiverLibinputResultV1 := + ω.sendConstructor do + ArgumentMarshaller.marshalAnyObject .none + Marshallable.marshal .object config + return 10 + +def RiverLibinputDeviceV1.setNaturalScroll + (ω : RiverLibinputDeviceV1) + (state : RiverLibinputDeviceV1.NaturalScrollState) + : DisplayM σ RiverLibinputResultV1 := + ω.sendConstructor do + ArgumentMarshaller.marshalAnyObject .none + Marshallable.marshal .uint state + return 11 + +def RiverLibinputDeviceV1.setLeftHanded + (ω : RiverLibinputDeviceV1) + (state : RiverLibinputDeviceV1.LeftHandedState) + : DisplayM σ RiverLibinputResultV1 := + ω.sendConstructor do + ArgumentMarshaller.marshalAnyObject .none + Marshallable.marshal .uint state + return 12 + +def RiverLibinputDeviceV1.setClickMethod + (ω : RiverLibinputDeviceV1) + (method : RiverLibinputDeviceV1.ClickMethod) + : DisplayM σ RiverLibinputResultV1 := + ω.sendConstructor do + ArgumentMarshaller.marshalAnyObject .none + Marshallable.marshal .uint method + return 13 + +def RiverLibinputDeviceV1.setClickfingerButtonMap + (ω : RiverLibinputDeviceV1) + (buttonMap : RiverLibinputDeviceV1.ClickfingerButtonMap) + : DisplayM σ RiverLibinputResultV1 := + ω.sendConstructor do + ArgumentMarshaller.marshalAnyObject .none + Marshallable.marshal .uint buttonMap + return 14 + +def RiverLibinputDeviceV1.setMiddleEmulation + (ω : RiverLibinputDeviceV1) + (state : RiverLibinputDeviceV1.MiddleEmulationState) + : DisplayM σ RiverLibinputResultV1 := + ω.sendConstructor do + ArgumentMarshaller.marshalAnyObject .none + Marshallable.marshal .uint state + return 15 + +def RiverLibinputDeviceV1.setScrollMethod + (ω : RiverLibinputDeviceV1) + (method : RiverLibinputDeviceV1.ScrollMethod) + : DisplayM σ RiverLibinputResultV1 := + ω.sendConstructor do + ArgumentMarshaller.marshalAnyObject .none + Marshallable.marshal .uint method + return 16 + +def RiverLibinputDeviceV1.setScrollButton + (ω : RiverLibinputDeviceV1) + (button : UInt32) + : DisplayM σ RiverLibinputResultV1 := + ω.sendConstructor do + ArgumentMarshaller.marshalAnyObject .none + Marshallable.marshal .uint button + return 17 + +def RiverLibinputDeviceV1.setScrollButtonLock + (ω : RiverLibinputDeviceV1) + (state : RiverLibinputDeviceV1.ScrollButtonLockState) + : DisplayM σ RiverLibinputResultV1 := + ω.sendConstructor do + ArgumentMarshaller.marshalAnyObject .none + Marshallable.marshal .uint state + return 18 + +def RiverLibinputDeviceV1.setDwt + (ω : RiverLibinputDeviceV1) + (state : RiverLibinputDeviceV1.DwtState) + : DisplayM σ RiverLibinputResultV1 := + ω.sendConstructor do + ArgumentMarshaller.marshalAnyObject .none + Marshallable.marshal .uint state + return 19 + +def RiverLibinputDeviceV1.setDwtp + (ω : RiverLibinputDeviceV1) + (state : RiverLibinputDeviceV1.DwtpState) + : DisplayM σ RiverLibinputResultV1 := + ω.sendConstructor do + ArgumentMarshaller.marshalAnyObject .none + Marshallable.marshal .uint state + return 20 + +def RiverLibinputDeviceV1.setRotation + (ω : RiverLibinputDeviceV1) + (angle : UInt32) + : DisplayM σ RiverLibinputResultV1 := + ω.sendConstructor do + ArgumentMarshaller.marshalAnyObject .none + Marshallable.marshal .uint angle + return 21 + +def RiverLibinputAccelConfigV1.destroy + (ω : RiverLibinputAccelConfigV1) + : DisplayM σ Unit := + ω.send do + return 0 + +def RiverLibinputAccelConfigV1.setPoints + (ω : RiverLibinputAccelConfigV1) + (type : RiverLibinputAccelConfigV1.AccelType) + (step : ByteArray) + (points : ByteArray) + : DisplayM σ RiverLibinputResultV1 := + ω.sendConstructor do + ArgumentMarshaller.marshalAnyObject .none + Marshallable.marshal .uint type + Marshallable.marshal .array step + Marshallable.marshal .array points + return 1 + +end Wayland.Protocols \ No newline at end of file diff --git a/lib/Wayland/Protocols/RiverLibinputConfigV1/Resolved.lean b/lib/Wayland/Protocols/RiverLibinputConfigV1/Resolved.lean new file mode 100644 index 0000000..1e538bd --- /dev/null +++ b/lib/Wayland/Protocols/RiverLibinputConfigV1/Resolved.lean @@ -0,0 +1,39 @@ +import Wayland.Display +import Wayland.Protocols.RiverInputManagementV1.Interface +import Wayland.Protocols.RiverLibinputConfigV1.Interface +import Wayland.Protocols.Wayland.Interface + +namespace Wayland.Protocols + +instance instResolvedInterfaceRiverLibinputConfigV1 : ResolvedInterface RiverLibinputConfigV1.name where + referencedInterfaces := #[ + ⟨RiverInputDeviceV1.name, inferInstance⟩, + ⟨RiverLibinputAccelConfigV1.name, inferInstance⟩, + ⟨RiverLibinputConfigV1.name, inferInstance⟩, + ⟨RiverLibinputDeviceV1.name, inferInstance⟩, + ⟨RiverLibinputResultV1.name, inferInstance⟩, + ⟨WlOutput.name, inferInstance⟩, + ] + +instance instResolvedInterfaceRiverLibinputDeviceV1 : ResolvedInterface RiverLibinputDeviceV1.name where + referencedInterfaces := #[ + ⟨RiverInputDeviceV1.name, inferInstance⟩, + ⟨RiverLibinputAccelConfigV1.name, inferInstance⟩, + ⟨RiverLibinputDeviceV1.name, inferInstance⟩, + ⟨RiverLibinputResultV1.name, inferInstance⟩, + ⟨WlOutput.name, inferInstance⟩, + ] + +instance instResolvedInterfaceRiverLibinputAccelConfigV1 : ResolvedInterface RiverLibinputAccelConfigV1.name where + referencedInterfaces := #[ + ⟨RiverLibinputAccelConfigV1.name, inferInstance⟩, + ⟨RiverLibinputResultV1.name, inferInstance⟩, + ] + +instance instResolvedInterfaceRiverLibinputResultV1 : ResolvedInterface RiverLibinputResultV1.name where + referencedInterfaces := #[ + ⟨RiverLibinputResultV1.name, inferInstance⟩, + ] + + +end Wayland.Protocols \ No newline at end of file -- cgit v1.3.1