summaryrefslogtreecommitdiff
path: root/lib/Wayland/Protocols/RiverLibinputConfigV1/Header.lean
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Wayland/Protocols/RiverLibinputConfigV1/Header.lean')
-rw-r--r--lib/Wayland/Protocols/RiverLibinputConfigV1/Header.lean691
1 files changed, 691 insertions, 0 deletions
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