From 85dc84516e3848ca9d9a268c121220de164d0e9e Mon Sep 17 00:00:00 2001 From: David Roundy Date: Fri, 21 Sep 2007 23:21:59 +0200 Subject: add layout selection back into core xmonad using LayoutSelection. This is just a reimplementation of LayoutChoice. darcs-hash:20070921212159-72aca-870bb8d3e596fcb9edc48f51bec538054b4165e6 --- XMonad.hs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'XMonad.hs') diff --git a/XMonad.hs b/XMonad.hs index f288469..3a6f298 100644 --- a/XMonad.hs +++ b/XMonad.hs @@ -15,7 +15,7 @@ ----------------------------------------------------------------------------- module XMonad ( - X, WindowSet, WindowSpace, WorkspaceId, ScreenId(..), ScreenDetail(..), XState(..), XConf(..), Layout(..), SomeLayout(..), readLayout, + X, WindowSet, WindowSpace, WorkspaceId, ScreenId(..), ScreenDetail(..), XState(..), XConf(..), Layout(..), SomeLayout(..), ReadableSomeLayout(..), Typeable, Message, SomeMessage(..), fromMessage, runLayout, runX, catchX, io, catchIO, withDisplay, withWindowSet, isRoot, getAtom, spawn, restart, trace, whenJust, whenX, atom_WM_STATE, atom_WM_PROTOCOLS, atom_WM_DELETE_WINDOW @@ -132,6 +132,14 @@ atom_WM_STATE = getAtom "WM_STATE" -- data SomeLayout a = forall l. Layout l a => SomeLayout (l a) +class ReadableSomeLayout a where + defaults :: [SomeLayout a] +instance ReadableSomeLayout a => Read (SomeLayout a) where + readsPrec _ = readLayout defaults +instance ReadableSomeLayout a => Layout SomeLayout a where + doLayout (SomeLayout l) r s = fmap (fmap $ fmap SomeLayout) $ doLayout l r s + modifyLayout (SomeLayout l) = fmap (fmap SomeLayout) . modifyLayout l + instance Show (SomeLayout a) where show (SomeLayout l) = show l -- cgit v1.2.3