diff options
Diffstat (limited to 'src/Xmobar')
-rw-r--r-- | src/Xmobar/X11/CairoDraw.hs | 4 | ||||
-rw-r--r-- | src/Xmobar/X11/Draw.hs | 8 | ||||
-rw-r--r-- | src/Xmobar/X11/Loop.hs | 2 | ||||
-rw-r--r-- | src/Xmobar/X11/Types.hs | 7 |
4 files changed, 12 insertions, 9 deletions
diff --git a/src/Xmobar/X11/CairoDraw.hs b/src/Xmobar/X11/CairoDraw.hs index 714041d..c258509 100644 --- a/src/Xmobar/X11/CairoDraw.hs +++ b/src/Xmobar/X11/CairoDraw.hs @@ -32,17 +32,15 @@ import qualified Data.Colour.Names as CNames import qualified Data.Colour.RGBSpace as RGBS import Xmobar.Run.Parsers (Segment, Widget(..), colorComponents, tColorsString) -import Xmobar.Run.Actions (Action) import Xmobar.Config.Types import Xmobar.Text.Pango (fixXft) import Xmobar.X11.Types import qualified Xmobar.X11.Bitmap as B import Xmobar.X11.CairoSurface -type ActionPos = ([Action], Position, Position) -type Actions = [ActionPos] type Renderinfo = (Segment, Surface -> Double -> IO (), Double) type BitmapDrawer = Double -> Double -> String -> IO () +type Actions = [ActionPos] data DrawContext = DC { dcBitmapDrawer :: BitmapDrawer , dcBitmapLookup :: String -> Maybe B.Bitmap diff --git a/src/Xmobar/X11/Draw.hs b/src/Xmobar/X11/Draw.hs index 7642afc..853ed03 100644 --- a/src/Xmobar/X11/Draw.hs +++ b/src/Xmobar/X11/Draw.hs @@ -24,11 +24,13 @@ import Control.Monad.Reader import Graphics.X11.Xlib hiding (Segment) -import Xmobar.Config.Types import Xmobar.Run.Parsers (Segment) -import Xmobar.Run.Actions (Action) import Xmobar.X11.Types + +#if defined(XFT) || defined(CAIRO) +import Xmobar.Config.Types import Xmobar.X11.XRender (drawBackground) +#endif #ifdef CAIRO import Xmobar.X11.CairoDraw @@ -37,7 +39,7 @@ import Xmobar.X11.XlibDraw #endif -- | Draws in and updates the window -drawInWin :: [[Segment]] -> X [([Action], Position, Position)] +drawInWin :: [[Segment]] -> X [ActionPos] drawInWin segments = do xconf <- ask let d = display xconf diff --git a/src/Xmobar/X11/Loop.hs b/src/Xmobar/X11/Loop.hs index 4cf4b8f..8b68944 100644 --- a/src/Xmobar/X11/Loop.hs +++ b/src/Xmobar/X11/Loop.hs @@ -181,7 +181,7 @@ updateConfigPosition disp cfg = else (cfg {position = OnScreen (n+1) o})) o -> return (cfg {position = OnScreen 1 o}) -runActions :: [([Action], Position, Position)] -> Button -> Position -> IO () +runActions :: [ActionPos] -> Button -> Position -> IO () runActions actions button pos = mapM_ runAction $ filter (\(Spawn b _) -> button `elem` b) $ diff --git a/src/Xmobar/X11/Types.hs b/src/Xmobar/X11/Types.hs index e94967b..918f4d2 100644 --- a/src/Xmobar/X11/Types.hs +++ b/src/Xmobar/X11/Types.hs @@ -15,15 +15,16 @@ ------------------------------------------------------------------------------ -module Xmobar.X11.Types (X, XConf (..), Bitmap (..), XFont (..)) where +module Xmobar.X11.Types where import Graphics.X11.Xlib import Control.Monad.Reader import qualified Data.List.NonEmpty as NE +import Xmobar.Config.Types +import Xmobar.Run.Actions (Action) import Xmobar.X11.Bitmap import Xmobar.X11.Text -import Xmobar.Config.Types -- | The X type is a ReaderT type X = ReaderT XConf IO @@ -38,3 +39,5 @@ data XConf = , iconCache :: BitmapCache , config :: Config } + +type ActionPos = ([Action], Position, Position) |