{-# LANGUAGE OverloadedStrings #-} module State where import Blessings.Text (Blessings) import Data.Default (Default,def) import Data.Map (Map) import Data.Text (Text) import Hack.Buffer (Buffer) import Pager.Types import qualified Data.Map as Map import qualified Hack.Buffer as Buffer data State = State { buffer :: Buffer , command :: Command , count :: Int , flashMessage :: Blessings Text , termWidth :: Int , termHeight :: Int , charHeight :: Int , charWidth :: Int , screenWidth :: Int , screenHeight :: Int , termHeightPixels :: Int , termWidthPixels :: Int , termBorder :: Int , workspaceViewportHeight :: Int , workspaceViewportOffset :: Int , foundWorkspaces :: [Text] , workspaces :: Map Text Workspace , workspaceCursor :: Int , ex_offsetY :: Int } instance Default State where def = State { buffer = Buffer.emptyBuffer , command = ViewWorkspace , count = 1 , flashMessage = "Welcome to pager; quit with ^C" , termWidth = 0 , termHeight = 0 , screenHeight = 0 , screenWidth = 0 , charWidth = 0 , charHeight = 0 , termWidthPixels = 0 , termHeightPixels = 0 , termBorder = 0 , workspaceViewportHeight = 0 , workspaceViewportOffset = 0 , foundWorkspaces = [] , workspaces = Map.empty , workspaceCursor = 0 , ex_offsetY = 0 }