git-annex/Types/Messages.hs

45 lines
956 B
Haskell
Raw Normal View History

{- git-annex Messages data types
-
- Copyright 2012 Joey Hess <id@joeyh.name>
-
- Licensed under the GNU GPL version 3 or higher.
-}
{-# LANGUAGE CPP #-}
module Types.Messages where
2015-04-03 23:56:56 +00:00
import Data.Default
#ifdef WITH_CONCURRENTOUTPUT
import System.Console.Regions (ConsoleRegion)
#endif
data OutputType = NormalOutput | QuietOutput | ConcurrentOutput Int Bool | JSONOutput
deriving (Show)
data SideActionBlock = NoBlock | StartBlock | InBlock
deriving (Eq)
data MessageState = MessageState
{ outputType :: OutputType
, sideActionBlock :: SideActionBlock
, implicitMessages :: Bool
2015-11-06 16:51:25 +00:00
#ifdef WITH_CONCURRENTOUTPUT
, consoleRegion :: Maybe ConsoleRegion
, consoleRegionErrFlag :: Bool
2015-11-06 16:51:25 +00:00
#endif
}
2015-04-03 23:56:56 +00:00
instance Default MessageState
where
2015-11-06 16:51:25 +00:00
def = MessageState
{ outputType = NormalOutput
, sideActionBlock = NoBlock
, implicitMessages = True
2015-11-06 16:51:25 +00:00
#ifdef WITH_CONCURRENTOUTPUT
, consoleRegion = Nothing
, consoleRegionErrFlag = False
#endif
}