summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Roundy <droundy@darcs.net>2007-09-20 18:12:08 +0200
committerDavid Roundy <droundy@darcs.net>2007-09-20 18:12:08 +0200
commit4b21bd7390a67251d5d4fe8a209171601706930c (patch)
tree298b2bc4a32097a7ed0185c317480b6827cbb2da
parent7fb3159ce65a49b2ec7666e663a90d1a5fc475e1 (diff)
downloadmetatile-4b21bd7390a67251d5d4fe8a209171601706930c.tar
metatile-4b21bd7390a67251d5d4fe8a209171601706930c.zip
add Show instance to Layout
darcs-hash:20070920161208-72aca-c7bbb3a9d7cd8f1445c89f1bf15d7302bd47896c
-rw-r--r--Operations.hs6
-rw-r--r--XMonad.hs4
2 files changed, 7 insertions, 3 deletions
diff --git a/Operations.hs b/Operations.hs
index 45a5c1d..1b642ed 100644
--- a/Operations.hs
+++ b/Operations.hs
@@ -351,14 +351,14 @@ instance Message IncMasterN
-- simple fullscreen mode, just render all windows fullscreen.
-- a plea for tuple sections: map . (,sc)
-data Full a = Full
+data Full a = Full deriving Show
instance Layout Full a where
doLayout Full sc (W.Stack f _ _) = return ([(f, sc)], Nothing)
modifyLayout Full _ = return Nothing -- no changes
--
-- The tiling mode of xmonad, and its operations.
--
-data Tall a = Tall Int Rational Rational
+data Tall a = Tall Int Rational Rational deriving Show
instance Layout Tall a where
doLayout (Tall nmaster _ frac) r =
return . (\x->(x,Nothing)) .
@@ -376,6 +376,8 @@ mirrorRect (Rectangle rx ry rw rh) = (Rectangle ry rx rh rw)
-- | Mirror a layout, compute its 90 degree rotated form.
data Mirror a = forall l. Layout l a => Mirror (l a)
+instance Show (Mirror a) where
+ show (Mirror l) = "Mirror "++show l
instance Layout Mirror a where
doLayout (Mirror l) r s = do (wrs, ml') <- doLayout l (mirrorRect r) s
return (map (second mirrorRect) wrs, Mirror `fmap` ml')
diff --git a/XMonad.hs b/XMonad.hs
index f46af7a..56d7a00 100644
--- a/XMonad.hs
+++ b/XMonad.hs
@@ -132,8 +132,10 @@ atom_WM_STATE = getAtom "WM_STATE"
-- returns an updated 'Layout' and the screen is refreshed.
--
data SomeLayout a = forall l. Layout l a => SomeLayout (l a)
+instance Show (SomeLayout a) where
+ show (SomeLayout l) = show l
-class Layout layout a where
+class Show (layout a) => Layout layout a where
doLayout :: layout a -> Rectangle -> Stack a -> X ([(a, Rectangle)], Maybe (layout a))
modifyLayout :: layout a -> SomeMessage -> X (Maybe (layout a))