diff options
Diffstat (limited to 'protocols')
| -rw-r--r-- | protocols/.gitignore | 2 | ||||
| -rw-r--r-- | protocols/Wayland/Protocols/Core/WLOutput.hs | 68 | ||||
| -rw-r--r-- | protocols/Wayland/Protocols/XdgShell.hs | 1 | ||||
| -rw-r--r-- | protocols/protocols.cabal | 16 |
4 files changed, 85 insertions, 2 deletions
diff --git a/protocols/.gitignore b/protocols/.gitignore index d6ca1ed..b6c0df1 100644 --- a/protocols/.gitignore +++ b/protocols/.gitignore @@ -1,3 +1 @@ # generated code -protocols.cabal -Wayland 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 diff --git a/protocols/protocols.cabal b/protocols/protocols.cabal new file mode 100644 index 0000000..d90f42e --- /dev/null +++ b/protocols/protocols.cabal @@ -0,0 +1,16 @@ +cabal-version: 3.0 +name: highway-protocols +version: 1.0.0 +synopsis: Generated bindings for some Wayland protocols. +build-type: Simple + +common warnings + ghc-options: -Wall + +library + import: warnings + build-depends: base ^>=4.18.2.1, + highway-wayland + default-language: Haskell2010 + exposed-modules: Wayland.Protocols.Core.WLOutput, + Wayland.Protocols.XdgShell |
