From 9dea76265da2672eb200c2e7b1b5ab96ef7cb987 Mon Sep 17 00:00:00 2001 From: Spencer Janssen Date: Wed, 7 May 2008 03:31:22 +0200 Subject: Comments darcs-hash:20080507013122-a5988-e04061b89044fd2139ddfe0db3ba32b7739202b6 --- XMonad/Layout.hs | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'XMonad') diff --git a/XMonad/Layout.hs b/XMonad/Layout.hs index 3d9ce0a..8e5dc95 100644 --- a/XMonad/Layout.hs +++ b/XMonad/Layout.hs @@ -141,14 +141,20 @@ infixr 5 ||| -- | A layout that allows users to switch between various layout options. data Choose l r a = Choose LR (l a) (r a) deriving (Read, Show) +-- | Are we on the left or right sub-layout? data LR = L | R deriving (Read, Show, Eq) data NextNoWrap = NextNoWrap deriving (Eq, Show, Typeable) instance Message NextNoWrap +-- | A small wrapper around handleMessage, as it is tedious to write +-- SomeMessage repeatedly. handle :: (LayoutClass l a, Message m) => l a -> m -> X (Maybe (l a)) handle l m = handleMessage l (SomeMessage m) +-- | A smart constructor that takes some potential modifications, returns a +-- new structure if any fields have changed, and performs any necessary cleanup +-- on newly non-visible layouts. choose :: (LayoutClass l a, LayoutClass r a) => Choose l r a-> LR -> Maybe (l a) -> Maybe (r a) -> X (Maybe (Choose l r a)) choose (Choose d _ _) d' Nothing Nothing | d == d' = return Nothing -- cgit v1.2.3