Safe Haskell | None |
---|---|
Language | Haskell2010 |
Screen overlays.
Synopsis
- type AttrString = [AttrCharW32]
- blankAttrString :: Int -> AttrString
- textToAS :: Text -> AttrString
- textFgToAS :: Color -> Text -> AttrString
- stringToAS :: String -> AttrString
- (<+:>) :: AttrString -> AttrString -> AttrString
- (<\:>) :: AttrString -> AttrString -> AttrString
- data AttrLine
- attrLine :: AttrLine -> AttrString
- emptyAttrLine :: AttrLine
- attrStringToAL :: AttrString -> AttrLine
- firstParagraph :: AttrString -> AttrLine
- linesAttr :: AttrString -> [AttrLine]
- textToAL :: Text -> AttrLine
- textFgToAL :: Color -> Text -> AttrLine
- stringToAL :: String -> AttrLine
- splitAttrString :: Int -> Int -> AttrString -> [AttrLine]
- indentSplitAttrString :: Int -> AttrString -> [AttrLine]
- indentSplitAttrString2 :: Bool -> Int -> AttrString -> [AttrLine]
- type Overlay = [(PointUI, AttrLine)]
- offsetOverlay :: [AttrLine] -> Overlay
- offsetOverlayX :: [(Int, AttrLine)] -> Overlay
- updateLine :: Int -> (Int -> AttrString -> AttrString) -> Overlay -> Overlay
- splitAttrPhrase :: Int -> Int -> AttrLine -> [AttrLine]
AttrString
type AttrString = [AttrCharW32] Source #
String of colourful text. End of line characters permitted.
blankAttrString :: Int -> AttrString Source #
textToAS :: Text -> AttrString Source #
textFgToAS :: Color -> Text -> AttrString Source #
stringToAS :: String -> AttrString Source #
(<+:>) :: AttrString -> AttrString -> AttrString infixr 6 Source #
(<\:>) :: AttrString -> AttrString -> AttrString infixr 6 Source #
AttrLine
Line of colourful text. End of line characters forbidden.
attrLine :: AttrLine -> AttrString Source #
attrStringToAL :: AttrString -> AttrLine Source #
firstParagraph :: AttrString -> AttrLine Source #
linesAttr :: AttrString -> [AttrLine] Source #
stringToAL :: String -> AttrLine Source #
splitAttrString :: Int -> Int -> AttrString -> [AttrLine] Source #
Split a string into lines. Avoids breaking the line at a character other than space. Remove space characters from the starts and ends of created lines. Newlines are respected.
Note that we only split wrt White
space, nothing else,
and the width, in the first argument, is calculated in characters,
not in UI (mono font) coordinates, so that taking and dropping characters
is performed correctly.
indentSplitAttrString :: Int -> AttrString -> [AttrLine] Source #
indentSplitAttrString2 :: Bool -> Int -> AttrString -> [AttrLine] Source #
Overlay
type Overlay = [(PointUI, AttrLine)] Source #
A series of screen lines with start positions at which they should
be overlayed over the base frame or a blank screen, depending on context.
The position point is represented as in integer that is an index into the
frame character array.
The lines either fit the width of the screen or are intended
for truncation when displayed. The start positions of lines may fall outside
the length of the screen, too, unlike in SingleFrame
. Then they are
simply not shown.
offsetOverlay :: [AttrLine] -> Overlay Source #
updateLine :: Int -> (Int -> AttrString -> AttrString) -> Overlay -> Overlay Source #