From 3c4a8246317d44e48f82dfd6d9ecff6b2e65c787 Mon Sep 17 00:00:00 2001 From: Don Stewart Date: Wed, 7 Mar 2007 04:33:07 +0100 Subject: Wm -> W, all good monads have single capital letter names. comment the W.hs file darcs-hash:20070307033307-9c5c1-2e7136f75725d311a8d19838b46e7fa89c3e4dc9.gz --- Main.hs | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'Main.hs') diff --git a/Main.hs b/Main.hs index 0c455f8..66afef8 100644 --- a/Main.hs +++ b/Main.hs @@ -25,7 +25,7 @@ import Graphics.X11.Xlib.Extras import System.Process (runCommand) import System.Exit -import Wm +import W ------------------------------------------------------------------------ @@ -35,7 +35,7 @@ import Wm main :: IO () main = do dpy <- openDisplay "" - runWm realMain $ WmState + runW realMain $ WState { display = dpy , screenWidth = displayWidth dpy (defaultScreen dpy) , screenHeight = displayHeight dpy (defaultScreen dpy) @@ -46,7 +46,7 @@ main = do -- -- Grab the display and input, and jump into the input loop -- -realMain :: Wm () +realMain :: W () realMain = do dpy <- getDisplay let screen = defaultScreen dpy @@ -59,7 +59,7 @@ realMain = do -- -- The main event handling loop -- -loop :: Wm () +loop :: W () loop = do dpy <- getDisplay forever $ do @@ -71,7 +71,7 @@ loop = do -- -- The event handler -- -handler :: Event -> Wm () +handler :: Event -> W () handler (MapRequestEvent {window = w}) = manage w handler (DestroyWindowEvent {window = w}) = do @@ -90,7 +90,7 @@ handler _ = return () -- -- switch focus (?) -- -switch :: Wm () +switch :: W () switch = do ws' <- getWindows case viewl ws' of @@ -102,13 +102,13 @@ switch = do -- -- | spawn. Launch an external application -- -spawn :: String -> Wm () +spawn :: String -> W () spawn = io_ . runCommand -- -- | Keys we understand. -- -keys :: [(KeyMask, KeySym, Wm ())] +keys :: [(KeyMask, KeySym, W ())] keys = [ (mod1Mask .|. shiftMask, xK_Return, spawn "xterm") , (controlMask, xK_space, spawn "gmrun") @@ -119,7 +119,7 @@ keys = -- -- | grabkeys. Register key commands -- -grabkeys :: Wm () +grabkeys :: W () grabkeys = do dpy <- getDisplay root <- io $ rootWindow dpy (defaultScreen dpy) @@ -130,7 +130,7 @@ grabkeys = do -- -- -- -manage :: Window -> Wm () +manage :: Window -> W () manage w = do trace "manage" d <- getDisplay @@ -144,7 +144,7 @@ manage w = do -- -- refresh the windows -- -refresh :: Wm () +refresh :: W () refresh = do v <- getWindows case viewl v of -- cgit v1.2.3