diff options
author | jao <jao@gnu.org> | 2022-09-19 02:26:50 +0100 |
---|---|---|
committer | jao <jao@gnu.org> | 2022-09-19 02:26:50 +0100 |
commit | c7681d79108f6e03f5adc33ebb96f14cf9b83f16 (patch) | |
tree | dab5b80419a2862e18f7df7ff3b6a31bdedfc1ad /src/Xmobar/X11/Types.hs | |
parent | 44e407836e1437bd1f78edc4980eeb9fe42399b6 (diff) | |
download | xmobar-c7681d79108f6e03f5adc33ebb96f14cf9b83f16.tar.gz xmobar-c7681d79108f6e03f5adc33ebb96f14cf9b83f16.tar.bz2 |
wee refactoring (more types in X11.Types)
Diffstat (limited to 'src/Xmobar/X11/Types.hs')
-rw-r--r-- | src/Xmobar/X11/Types.hs | 29 |
1 files changed, 21 insertions, 8 deletions
diff --git a/src/Xmobar/X11/Types.hs b/src/Xmobar/X11/Types.hs index ce5eec9..309b6bf 100644 --- a/src/Xmobar/X11/Types.hs +++ b/src/Xmobar/X11/Types.hs @@ -17,26 +17,39 @@ module Xmobar.X11.Types where -import Graphics.X11.Xlib -import Control.Monad.Reader +import qualified Graphics.X11.Xlib as X11 import qualified Data.List.NonEmpty as NE +import Control.Monad.Reader (ReaderT) + import Xmobar.Config.Types import Xmobar.Run.Actions (Action) -import Xmobar.X11.Bitmap -import Xmobar.X11.Text +import Xmobar.Run.Parsers (Segment) +import Xmobar.X11.Bitmap (Bitmap, BitmapCache) +import Xmobar.X11.Text (XFont) -- | The X type is a ReaderT type X = ReaderT XConf IO -- | The ReaderT inner component data XConf = - XConf { display :: Display - , rect :: Rectangle - , window :: Window + XConf { display :: X11.Display + , rect :: X11.Rectangle + , window :: X11.Window , fontList :: NE.NonEmpty XFont , iconCache :: BitmapCache , config :: Config } -type ActionPos = ([Action], Position, Position) +type ActionPos = ([Action], X11.Position, X11.Position) +type Actions = [ActionPos] + +type BitmapDrawer = Double -> Double -> String -> IO () + +data DrawContext = DC { dcBitmapDrawer :: BitmapDrawer + , dcBitmapLookup :: String -> Maybe Bitmap + , dcConfig :: Config + , dcWidth :: Double + , dcHeight :: Double + , dcSegments :: [[Segment]] + } |