summaryrefslogtreecommitdiffhomepage
path: root/src/Xmobar/Draw/Types.hs
diff options
context:
space:
mode:
authorjao <jao@gnu.org>2022-09-20 05:41:27 +0100
committerjao <jao@gnu.org>2022-09-20 05:41:27 +0100
commit4b4c9fe0a8849fad124a2f75e815e648dafd4969 (patch)
tree69fe7d3f6a5a939c8120c0ff5cd9d71a61da648e /src/Xmobar/Draw/Types.hs
parentc7681d79108f6e03f5adc33ebb96f14cf9b83f16 (diff)
downloadxmobar-4b4c9fe0a8849fad124a2f75e815e648dafd4969.tar.gz
xmobar-4b4c9fe0a8849fad124a2f75e815e648dafd4969.tar.bz2
new namespace: Xmobar.Draw
Diffstat (limited to 'src/Xmobar/Draw/Types.hs')
-rw-r--r--src/Xmobar/Draw/Types.hs52
1 files changed, 52 insertions, 0 deletions
diff --git a/src/Xmobar/Draw/Types.hs b/src/Xmobar/Draw/Types.hs
new file mode 100644
index 0000000..219a64b
--- /dev/null
+++ b/src/Xmobar/Draw/Types.hs
@@ -0,0 +1,52 @@
+------------------------------------------------------------------------------
+-- |
+-- 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 GHC.Word (Word32, Word64)
+
+import Data.Map (Map)
+
+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 BitmapDrawer = Double -> Double -> String -> IO ()
+
+data BitmapType = Mono Word64 | Poly
+
+data Bitmap = Bitmap { bWidth :: Word32
+ , bHeight :: Word32
+ , bPixmap :: Word64
+ , bShapepixmap :: Maybe Word64
+ , bBitmaptype :: BitmapType
+ }
+
+type BitmapCache = Map FilePath Bitmap
+
+
+data DrawContext = DC { dcBitmapDrawer :: BitmapDrawer
+ , dcBitmapLookup :: String -> Maybe Bitmap
+ , dcConfig :: Config
+ , dcWidth :: Double
+ , dcHeight :: Double
+ , dcSegments :: [[Segment]]
+ }