aboutsummaryrefslogtreecommitdiffstats
path: root/XMonad.hs
diff options
context:
space:
mode:
authorDavid Roundy <droundy@darcs.net>2007-05-03 16:47:50 +0200
committerDavid Roundy <droundy@darcs.net>2007-05-03 16:47:50 +0200
commit3a7af24ccb821b88613736f2f3d5ff049cfac02b (patch)
tree1d0b462b8304b685d3ceda3fbf06f92c56c9d509 /XMonad.hs
parenta10af6690d8f819156749314da49d481007ee616 (diff)
downloadxmonad-3a7af24ccb821b88613736f2f3d5ff049cfac02b.tar.gz
xmonad-3a7af24ccb821b88613736f2f3d5ff049cfac02b.tar.xz
xmonad-3a7af24ccb821b88613736f2f3d5ff049cfac02b.zip
add support for extensible layouts.
darcs-hash:20070503144750-72aca-f44bca4573837e12fc1f89333b55e04abd52787c.gz
Diffstat (limited to 'XMonad.hs')
-rw-r--r--XMonad.hs16
1 files changed, 5 insertions, 11 deletions
diff --git a/XMonad.hs b/XMonad.hs
index beddaef..9f1a0ca 100644
--- a/XMonad.hs
+++ b/XMonad.hs
@@ -17,7 +17,7 @@
module XMonad (
X, WindowSet, WorkspaceId(..), ScreenId(..), XState(..), XConf(..), Layout(..),
- LayoutDesc(..), runX, io, withDisplay, isRoot, spawn, trace, whenJust, rotateLayout
+ runX, io, withDisplay, isRoot, spawn, trace, whenJust
) where
import StackSet (StackSet)
@@ -28,6 +28,7 @@ import System.IO
import System.Posix.Process (executeFile, forkProcess, getProcessStatus)
import System.Exit
import Graphics.X11.Xlib
+import Data.Dynamic ( Dynamic )
import qualified Data.Map as M
@@ -35,7 +36,7 @@ import qualified Data.Map as M
-- Just the display, width, height and a window list
data XState = XState
{ workspace :: !WindowSet -- ^ workspace list
- , layoutDescs :: !(M.Map WorkspaceId LayoutDesc) -- ^ mapping of workspaces
+ , layouts :: !(M.Map WorkspaceId [Layout]) -- ^ mapping of workspaces
-- to descriptions of their layouts
}
@@ -93,15 +94,8 @@ isRoot w = liftM (w==) (asks theRoot)
-- Layout handling
-- | The different layout modes
-data Layout = Full | Tall | Wide deriving (Enum, Bounded, Eq)
-
--- | 'rot' for Layout.
-rotateLayout :: Layout -> Layout
-rotateLayout x = if x == maxBound then minBound else succ x
-
--- | A full description of a particular workspace's layout parameters.
-data LayoutDesc = LayoutDesc { layoutType :: !Layout
- , tileFraction :: !Rational }
+data Layout = Layout { doLayout :: Rectangle -> [Window] -> [(Window, Rectangle)]
+ , modifyLayout :: Dynamic -> Maybe Layout }
-- ---------------------------------------------------------------------
-- Utilities