summaryrefslogtreecommitdiff
path: root/protocols/Wayland/Protocols
diff options
context:
space:
mode:
authorHannes Schulze <haschu0103@outlook.de>2024-08-04 11:16:47 +0200
committerHannes Schulze <haschu0103@outlook.de>2024-08-04 11:16:47 +0200
commitf677b43111622459853e3906c6cc028d94313e69 (patch)
tree95e8ed7735e98e338d2cb4aa61573eadadb6b0de /protocols/Wayland/Protocols
parenta630864b9bad65b10fd6dab0a2769c1c18f150fd (diff)
temporarily add protocols
Diffstat (limited to 'protocols/Wayland/Protocols')
-rw-r--r--protocols/Wayland/Protocols/Core/WLOutput.hs68
-rw-r--r--protocols/Wayland/Protocols/XdgShell.hs1
2 files changed, 69 insertions, 0 deletions
diff --git a/protocols/Wayland/Protocols/Core/WLOutput.hs b/protocols/Wayland/Protocols/Core/WLOutput.hs
new file mode 100644
index 0000000..f943169
--- /dev/null
+++ b/protocols/Wayland/Protocols/Core/WLOutput.hs
@@ -0,0 +1,68 @@
+{-# LANGUAGE DuplicateRecordFields #-}
+{-# LANGUAGE TypeFamilies #-}
+
+module Wayland.Protocols.Core.WLOutput
+ ( Subpixel(..)
+ , Transform(..)
+ , Mode(..)
+ , Geometry(..)
+ , Request(..)
+ , Event(..)
+ , Handle(..)
+ ) where
+
+import Data.Data (Typeable)
+import Wayland.Server (ResourceClass(..), ObjectID)
+
+newtype Handle = Handle ObjectID
+ deriving (Show, Eq, Ord)
+
+instance ResourceClass Handle where
+ type ResourceEvent Handle = Event
+ type ResourceRequest Handle = Request
+ objectID (Handle h) = h
+ interface _ = undefined
+
+data Subpixel
+ = SubpixelUnknown
+ | SubpixelNone
+ | SubpixelHorizontalRgb
+ | SubpixelHorizontalBgr
+ | SubpixelVerticalRgb
+ | SubpixelVerticalBgr
+
+data Transform
+ = TransformNormal
+ | TransformNormal90
+ | TransformNormal180
+ | TransformNormal270
+ | TransformFlipped
+ | TransformFlipped90
+ | TransformFlipped180
+ | TransformFlipped270
+
+data Mode
+ = Mode { current :: Bool
+ , preferred :: Bool }
+
+data Geometry
+ = Geometry { x :: Int
+ , y :: Int
+ , physicalWidth :: Int
+ , physicalHeight :: Int
+ , subpixel :: Subpixel
+ , make :: String
+ , model :: String
+ , transform :: Transform }
+
+data Request
+ = ReqRelease Handle
+ deriving (Typeable, Show)
+
+data Event
+ = EvGeometry Geometry
+ | EvMode Mode
+ | EvScale Int
+ | EvName String
+ | EvDescription String
+ | EvDone
diff --git a/protocols/Wayland/Protocols/XdgShell.hs b/protocols/Wayland/Protocols/XdgShell.hs
new file mode 100644
index 0000000..fcaf8f7
--- /dev/null
+++ b/protocols/Wayland/Protocols/XdgShell.hs
@@ -0,0 +1 @@
+module Wayland.Protocols.XdgShell () where