Safe Haskell | None |
---|---|
Language | Haskell2010 |
- data Output = Output {
- terminalID :: String
- releaseTerminal :: MonadIO m => m ()
- reserveDisplay :: MonadIO m => m ()
- releaseDisplay :: MonadIO m => m ()
- displayBounds :: MonadIO m => m DisplayRegion
- outputByteBuffer :: ByteString -> IO ()
- contextColorCount :: Int
- supportsCursorVisibility :: Bool
- assumedStateRef :: IORef AssumedState
- mkDisplayContext :: MonadIO m => Output -> DisplayRegion -> m DisplayContext
- displayContext :: MonadIO m => Output -> DisplayRegion -> m DisplayContext
- data AssumedState = AssumedState {}
- initialAssumedState :: AssumedState
- data DisplayContext = DisplayContext {
- contextDevice :: Output
- contextRegion :: DisplayRegion
- writeMoveCursor :: Int -> Int -> Write
- writeShowCursor :: Write
- writeHideCursor :: Write
- writeSetAttr :: FixedAttr -> Attr -> DisplayAttrDiff -> Write
- writeDefaultAttr :: Write
- writeRowEnd :: Write
- inlineHack :: IO ()
- writeUtf8Text :: ByteString -> Write
- outputPicture :: MonadIO m => DisplayContext -> Picture -> m ()
- writeOutputOps :: DisplayContext -> FixedAttr -> [Bool] -> DisplayOps -> Write
- writeSpanOps :: DisplayContext -> Int -> FixedAttr -> SpanOps -> (Write, FixedAttr)
- writeSpanOp :: DisplayContext -> SpanOp -> FixedAttr -> (Write, FixedAttr)
- data CursorOutputMap = CursorOutputMap {
- charToOutputPos :: (Int, Int) -> (Int, Int)
- cursorOutputMap :: DisplayOps -> Cursor -> CursorOutputMap
- cursorColumnOffset :: DisplayOps -> Int -> Int -> Int
- limitAttrForDisplay :: Output -> Attr -> Attr
Documentation
Output | |
|
displayContext :: MonadIO m => Output -> DisplayRegion -> m DisplayContext Source
data DisplayContext Source
DisplayContext | |
|
writeUtf8Text :: ByteString -> Write Source
All terminals serialize UTF8 text to the terminal device exactly as serialized in memory.
outputPicture :: MonadIO m => DisplayContext -> Picture -> m () Source
Displays the given Picture
.
The image is cropped to the display size.
- Converted into a sequence of attribute changes and text spans.
- The cursor is hidden.
- Serialized to the display.
- The cursor is then shown and positioned or kept hidden.
todo: specify possible IO exceptions. abstract from IO monad to a MonadIO instance.
writeOutputOps :: DisplayContext -> FixedAttr -> [Bool] -> DisplayOps -> Write Source
writeSpanOps :: DisplayContext -> Int -> FixedAttr -> SpanOps -> (Write, FixedAttr) Source
writeSpanOp :: DisplayContext -> SpanOp -> FixedAttr -> (Write, FixedAttr) Source
data CursorOutputMap Source
The cursor position is given in X,Y character offsets. Due to multi-column characters this needs to be translated to column, row positions.
CursorOutputMap | |
|
cursorOutputMap :: DisplayOps -> Cursor -> CursorOutputMap Source
cursorColumnOffset :: DisplayOps -> Int -> Int -> Int Source
limitAttrForDisplay :: Output -> Attr -> Attr Source
Not all terminals support all display attributes. This filters a display attribute to what the given terminal can display.