xhb-ewmh 0.1.0.1 → 0.1.1.1
raw patch · 3 files changed
+172/−3 lines, 3 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
+ Graphics.XHB.Ewmh.Error: getActiveWindow :: EwmhErrorCtx m => Connection -> m WINDOW
+ Graphics.XHB.Ewmh.Error: getNetClientList :: EwmhErrorCtx m => Connection -> m [WINDOW]
+ Graphics.XHB.Ewmh.Error: getNetClientListStacking :: EwmhErrorCtx m => Connection -> m [WINDOW]
+ Graphics.XHB.Ewmh.Error: getNetCurrentDesktop :: EwmhErrorCtx m => Connection -> m Word32
+ Graphics.XHB.Ewmh.Error: getNetDesktopGeometry :: EwmhErrorCtx m => Connection -> m NetDesktopGeometry
+ Graphics.XHB.Ewmh.Error: getNetDesktopLayout :: EwmhErrorCtx m => Connection -> m NetDesktopLayout
+ Graphics.XHB.Ewmh.Error: getNetDesktopNames :: EwmhErrorCtx m => Connection -> m [String]
+ Graphics.XHB.Ewmh.Error: getNetDesktopViewport :: EwmhErrorCtx m => Connection -> m NetDesktopViewport
+ Graphics.XHB.Ewmh.Error: getNetFrameExtents :: EwmhErrorCtx m => Connection -> WINDOW -> m NetFrameExtents
+ Graphics.XHB.Ewmh.Error: getNetNumberOfDesktops :: EwmhErrorCtx m => Connection -> m Word32
+ Graphics.XHB.Ewmh.Error: getNetShowingDesktop :: EwmhErrorCtx m => Connection -> m Word32
+ Graphics.XHB.Ewmh.Error: getNetSupported :: EwmhErrorCtx m => Connection -> m NetSupported
+ Graphics.XHB.Ewmh.Error: getNetSupportingWmCheck :: EwmhErrorCtx m => Connection -> m WINDOW
+ Graphics.XHB.Ewmh.Error: getNetVirtualRoots :: EwmhErrorCtx m => Connection -> m [WINDOW]
+ Graphics.XHB.Ewmh.Error: getNetWmAllowedActions :: EwmhErrorCtx m => Connection -> WINDOW -> m [NET_WM_ALLOWED_ACTIONS]
+ Graphics.XHB.Ewmh.Error: getNetWmBypassCompositor :: EwmhErrorCtx m => Connection -> WINDOW -> m Word32
+ Graphics.XHB.Ewmh.Error: getNetWmDesktop :: EwmhErrorCtx m => Connection -> WINDOW -> m Word32
+ Graphics.XHB.Ewmh.Error: getNetWmHandledIcons :: EwmhErrorCtx m => Connection -> WINDOW -> m Word32
+ Graphics.XHB.Ewmh.Error: getNetWmIcon :: EwmhErrorCtx m => Connection -> WINDOW -> m NetWmIcon
+ Graphics.XHB.Ewmh.Error: getNetWmIconGeometry :: EwmhErrorCtx m => Connection -> WINDOW -> m NetWmIconGeometry
+ Graphics.XHB.Ewmh.Error: getNetWmIconName :: EwmhErrorCtx m => Connection -> WINDOW -> m [String]
+ Graphics.XHB.Ewmh.Error: getNetWmName :: EwmhErrorCtx m => Connection -> WINDOW -> m [String]
+ Graphics.XHB.Ewmh.Error: getNetWmOpaqueRegion :: EwmhErrorCtx m => Connection -> WINDOW -> m NetWmOpaqueRegion
+ Graphics.XHB.Ewmh.Error: getNetWmPID :: EwmhErrorCtx m => Connection -> WINDOW -> m Word32
+ Graphics.XHB.Ewmh.Error: getNetWmState :: EwmhErrorCtx m => Connection -> WINDOW -> m [NET_WM_STATE]
+ Graphics.XHB.Ewmh.Error: getNetWmStrut :: EwmhErrorCtx m => Connection -> WINDOW -> m NetWmStrut
+ Graphics.XHB.Ewmh.Error: getNetWmStrutPartial :: EwmhErrorCtx m => Connection -> WINDOW -> m NetWmStrutPartial
+ Graphics.XHB.Ewmh.Error: getNetWmUserTime :: EwmhErrorCtx m => Connection -> WINDOW -> m Word32
+ Graphics.XHB.Ewmh.Error: getNetWmUserTimeWindow :: EwmhErrorCtx m => Connection -> WINDOW -> m WINDOW
+ Graphics.XHB.Ewmh.Error: getNetWmVisibleIconName :: EwmhErrorCtx m => Connection -> WINDOW -> m [String]
+ Graphics.XHB.Ewmh.Error: getNetWmVisibleName :: EwmhErrorCtx m => Connection -> WINDOW -> m [String]
+ Graphics.XHB.Ewmh.Error: getNetWmWindowType :: EwmhErrorCtx m => Connection -> WINDOW -> m [NET_WM_WINDOW_TYPE]
+ Graphics.XHB.Ewmh.Error: getNetWorkarea :: EwmhErrorCtx m => Connection -> m NetWorkarea
+ Graphics.XHB.Ewmh.Error: runEwmhT :: (MonadError SomeError m, MonadIO m, Applicative m) => Connection -> EwmhT m a -> m a
+ Graphics.XHB.Ewmh.Error: type EwmhErrorCtx m = (MonadError SomeError m, EwmhCtx m)
Files
- src/Graphics/XHB/Ewmh.hs +2/−2
- src/Graphics/XHB/Ewmh/Error.hs +168/−0
- xhb-ewmh.cabal +2/−1
src/Graphics/XHB/Ewmh.hs view
@@ -315,7 +315,7 @@ where none = X.fromXid $ X.toXid (X.toValue WindowNone :: Word32) getNetDesktopNames :: EwmhCtx m => Connection -> m (Either SomeError [String])-getNetDesktopNames c = getProp c (X.getRoot c) NET_DESKTOP_NAMES UTF8_STRING+getNetDesktopNames c = getRootProp c NET_DESKTOP_NAMES UTF8_STRING setNetDesktopNames :: EwmhCtx m => Connection -> [String] -> m () setNetDesktopNames c = setRootProp c NET_DESKTOP_NAMES UTF8_STRING@@ -354,7 +354,7 @@ setNetVirtualRoots c = setRootProp c NET_VIRTUAL_ROOTS AtomWINDOW getNetDesktopLayout :: EwmhCtx m => Connection -> m (Either SomeError NetDesktopLayout)-getNetDesktopLayout conn = getRootProp conn NET_DESKTOP_LAYOUT AtomCARDINAL+getNetDesktopLayout c = getRootProp c NET_DESKTOP_LAYOUT AtomCARDINAL setNetDesktopLayout :: EwmhCtx m => Connection -> NetDesktopLayout -> m () setNetDesktopLayout c = setRootProp c NET_DESKTOP_LAYOUT AtomCARDINAL
+ src/Graphics/XHB/Ewmh/Error.hs view
@@ -0,0 +1,168 @@+{-# OPTIONS_GHC -fno-warn-orphans #-}++{-# LANGUAGE ConstraintKinds #-}+{-# LANGUAGE FlexibleContexts #-}++module Graphics.XHB.Ewmh.Error+ ( EwmhErrorCtx+ , runEwmhT+ , getNetSupported+ , getNetClientList+ , getNetClientListStacking+ , getNetNumberOfDesktops+ , getNetDesktopGeometry+ , getNetDesktopViewport+ , getNetCurrentDesktop+ , getNetDesktopNames+ , getActiveWindow+ , getNetWorkarea+ , getNetSupportingWmCheck+ , getNetVirtualRoots+ , getNetDesktopLayout+ , getNetShowingDesktop+ , getNetWmName+ , getNetWmVisibleName+ , getNetWmIconName+ , getNetWmVisibleIconName+ , getNetWmDesktop+ , getNetWmWindowType+ , getNetWmState+ , getNetWmAllowedActions+ , getNetWmStrut+ , getNetWmStrutPartial+ , getNetWmIconGeometry+ , getNetWmIcon+ , getNetWmPID+ , getNetWmHandledIcons+ , getNetWmUserTime+ , getNetWmUserTimeWindow+ , getNetFrameExtents+ , getNetWmOpaqueRegion+ , getNetWmBypassCompositor+ ) where++import Control.Applicative (Applicative)+import Control.Monad.Except (MonadError(..))+import Control.Monad.IO.Class (MonadIO(..))+import Data.Word (Word32)+import Graphics.XHB (Connection, SomeError, WINDOW)+import Graphics.XHB.Ewmh.Atoms+import Graphics.XHB.Ewmh.Types+import qualified Graphics.XHB.Ewmh as E++type EwmhErrorCtx m = (MonadError SomeError m, EwmhCtx m)++eitherToError :: MonadError e m => Either e a -> m a+eitherToError (Left e) = throwError e+eitherToError (Right a) = return a++runEwmhT :: (MonadError SomeError m, MonadIO m, Applicative m)+ => Connection -> EwmhT m a -> m a+runEwmhT c m = E.runEwmhT c m >>= eitherToError++----------------------------+-- Root Window Properties --+----------------------------++getNetSupported :: EwmhErrorCtx m => Connection -> m NetSupported+getNetSupported c = E.getNetSupported c >>= eitherToError++getNetClientList :: EwmhErrorCtx m => Connection -> m [WINDOW]+getNetClientList c = E.getNetClientList c >>= eitherToError++getNetClientListStacking :: EwmhErrorCtx m => Connection -> m [WINDOW]+getNetClientListStacking c = E.getNetClientListStacking c >>= eitherToError++getNetNumberOfDesktops :: EwmhErrorCtx m => Connection -> m Word32+getNetNumberOfDesktops c = E.getNetNumberOfDesktops c >>= eitherToError++getNetDesktopGeometry :: EwmhErrorCtx m => Connection -> m NetDesktopGeometry+getNetDesktopGeometry c = E.getNetDesktopGeometry c >>= eitherToError++getNetDesktopViewport :: EwmhErrorCtx m => Connection -> m NetDesktopViewport+getNetDesktopViewport c = E.getNetDesktopViewport c >>= eitherToError++getNetCurrentDesktop :: EwmhErrorCtx m => Connection -> m Word32+getNetCurrentDesktop c = E.getNetCurrentDesktop c >>= eitherToError++getNetDesktopNames :: EwmhErrorCtx m => Connection -> m [String]+getNetDesktopNames c = E.getNetDesktopNames c >>= eitherToError++getActiveWindow :: EwmhErrorCtx m => Connection -> m WINDOW+getActiveWindow c = E.getActiveWindow c >>= eitherToError++getNetWorkarea :: EwmhErrorCtx m => Connection -> m NetWorkarea+getNetWorkarea c = E.getNetWorkarea c >>= eitherToError++getNetSupportingWmCheck :: EwmhErrorCtx m => Connection -> m WINDOW+getNetSupportingWmCheck c = E.getNetSupportingWmCheck c >>= eitherToError++getNetVirtualRoots :: EwmhErrorCtx m => Connection -> m [WINDOW]+getNetVirtualRoots c = E.getNetVirtualRoots c >>= eitherToError++getNetDesktopLayout :: EwmhErrorCtx m => Connection -> m NetDesktopLayout+getNetDesktopLayout c = E.getNetDesktopLayout c >>= eitherToError++getNetShowingDesktop :: EwmhErrorCtx m => Connection -> m Word32+getNetShowingDesktop c = E.getNetShowingDesktop c >>= eitherToError++-----------------------------------+-- Application Window Properties --+-----------------------------------++getNetWmName :: EwmhErrorCtx m => Connection -> WINDOW -> m [String]+getNetWmName c w = E.getNetWmName c w >>= eitherToError++getNetWmVisibleName :: EwmhErrorCtx m => Connection -> WINDOW -> m [String]+getNetWmVisibleName c w = E.getNetWmVisibleName c w >>= eitherToError++getNetWmIconName :: EwmhErrorCtx m => Connection -> WINDOW -> m [String]+getNetWmIconName c w = E.getNetWmIconName c w >>= eitherToError++getNetWmVisibleIconName :: EwmhErrorCtx m => Connection -> WINDOW -> m [String]+getNetWmVisibleIconName c w = E.getNetWmVisibleIconName c w >>= eitherToError++getNetWmDesktop :: EwmhErrorCtx m => Connection -> WINDOW -> m Word32+getNetWmDesktop c w = E.getNetWmDesktop c w >>= eitherToError++getNetWmWindowType :: EwmhErrorCtx m => Connection -> WINDOW -> m [NET_WM_WINDOW_TYPE]+getNetWmWindowType c w = E.getNetWmWindowType c w >>= eitherToError++getNetWmState :: EwmhErrorCtx m => Connection -> WINDOW -> m [NET_WM_STATE]+getNetWmState c w = E.getNetWmState c w >>= eitherToError++getNetWmAllowedActions :: EwmhErrorCtx m => Connection -> WINDOW -> m [NET_WM_ALLOWED_ACTIONS]+getNetWmAllowedActions c w = E.getNetWmAllowedActions c w >>= eitherToError++getNetWmStrut :: EwmhErrorCtx m => Connection -> WINDOW -> m NetWmStrut+getNetWmStrut c w = E.getNetWmStrut c w >>= eitherToError++getNetWmStrutPartial :: EwmhErrorCtx m => Connection -> WINDOW -> m NetWmStrutPartial+getNetWmStrutPartial c w = E.getNetWmStrutPartial c w >>= eitherToError++getNetWmIconGeometry :: EwmhErrorCtx m => Connection -> WINDOW -> m NetWmIconGeometry+getNetWmIconGeometry c w = E.getNetWmIconGeometry c w >>= eitherToError++getNetWmIcon :: EwmhErrorCtx m => Connection -> WINDOW -> m NetWmIcon+getNetWmIcon c w = E.getNetWmIcon c w >>= eitherToError++getNetWmPID :: EwmhErrorCtx m => Connection -> WINDOW -> m Word32+getNetWmPID c w = E.getNetWmPID c w >>= eitherToError++getNetWmHandledIcons :: EwmhErrorCtx m => Connection -> WINDOW -> m Word32+getNetWmHandledIcons c w = E.getNetWmHandledIcons c w >>= eitherToError++getNetWmUserTime :: EwmhErrorCtx m => Connection -> WINDOW -> m Word32+getNetWmUserTime c w = E.getNetWmUserTime c w >>= eitherToError++getNetWmUserTimeWindow :: EwmhErrorCtx m => Connection -> WINDOW -> m WINDOW+getNetWmUserTimeWindow c w = E.getNetWmUserTimeWindow c w >>= eitherToError++getNetFrameExtents :: EwmhErrorCtx m => Connection -> WINDOW -> m NetFrameExtents+getNetFrameExtents c w = E.getNetFrameExtents c w >>= eitherToError++getNetWmOpaqueRegion :: EwmhErrorCtx m => Connection -> WINDOW -> m NetWmOpaqueRegion+getNetWmOpaqueRegion c w = E.getNetWmOpaqueRegion c w >>= eitherToError++getNetWmBypassCompositor :: EwmhErrorCtx m => Connection -> WINDOW -> m Word32+getNetWmBypassCompositor c w = E.getNetWmBypassCompositor c w >>= eitherToError
xhb-ewmh.cabal view
@@ -1,5 +1,5 @@ name: xhb-ewmh-version: 0.1.0.1+version: 0.1.1.1 synopsis: EWMH utilities for XHB description: EWMH utilities for XHB license: BSD2@@ -30,6 +30,7 @@ xhb-atom-cache exposed-modules: Graphics.XHB.Ewmh,+ Graphics.XHB.Ewmh.Error, Graphics.XHB.Ewmh.Atoms, Graphics.XHB.Ewmh.Types, Graphics.XHB.Ewmh.Values,