summaryrefslogtreecommitdiffhomepage
path: root/src/Xmobar/Draw/Types.hs
blob: 75dd714751c929e1fab0e58bad8be41cde2ae488 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
------------------------------------------------------------------------------
-- |
-- Module: Xmobar.Draw.Types
-- Copyright: (c) 2022 jao
-- License: BSD3-style (see LICENSE)
--
-- Maintainer: mail@jao.io
-- Stability: unstable
-- Portability: portable
-- Created: Tue Sep 20, 2022 04:49
--
--
-- Type definitions for describing drawing operations
--
------------------------------------------------------------------------------


module Xmobar.Draw.Types where

import Xmobar.Config.Types (Config)
import Xmobar.Run.Actions (Action)
import Xmobar.Run.Parsers (Segment)

type Position = Double
type ActionPos = ([Action], Position, Position)
type Actions = [ActionPos]

type IconLookup = String -> (Double, Double)
type IconDrawer = Double -> Double -> String -> IO ()

data DrawContext = DC { dcIconDrawer :: IconDrawer
                      , dcIconLookup :: IconLookup
                      , dcConfig :: Config
                      , dcWidth :: Double
                      , dcHeight :: Double
                      , dcSegments :: [[Segment]]
                      }