vty-5.16: A simple terminal UI library

Safe Haskell | Safe
Language | Haskell2010

Graphics.Vty.DisplayAttributes

Synopsis

- fixDisplayAttr :: FixedAttr -> Attr -> FixedAttr
- data DisplayAttrDiff = DisplayAttrDiff {
  - styleDiffs :: [StyleStateChange]
  - foreColorDiff :: DisplayColorDiff
  - backColorDiff :: DisplayColorDiff
  }
- simplifyStyleDiffs :: [StyleStateChange] -> [StyleStateChange] -> [StyleStateChange]
- simplifyColorDiffs :: DisplayColorDiff -> DisplayColorDiff -> DisplayColorDiff
- data DisplayColorDiff
  - = ColorToDefault
  - | NoColorChange
  - | SetColor !Color
- data StyleStateChange
  - = ApplyStandout
  - | RemoveStandout
  - | ApplyUnderline
  - | RemoveUnderline
  - | ApplyReverseVideo
  - | RemoveReverseVideo
  - | ApplyBlink
  - | RemoveBlink
  - | ApplyDim
  - | RemoveDim
  - | ApplyBold
  - | RemoveBold
- displayAttrDiffs :: FixedAttr -> FixedAttr -> DisplayAttrDiff
- diffColor :: Maybe Color -> Maybe Color -> DisplayColorDiff
- diffStyles :: Style -> Style -> [StyleStateChange]

# Documentation

fixDisplayAttr :: FixedAttr -> Attr -> FixedAttr Source #

Given the previously applied display attributes as a FixedAttr and the current display attributes as an Attr produces a FixedAttr that represents the current display attributes. This is done by using the previously applied display attributes to remove the KeepCurrent abstraction.

data DisplayAttrDiff Source #

difference between two display attributes. Used in the calculation of the operations required to go from one display attribute to the next.

Previously, vty would reset display attributes to default then apply the new display attributes. This turned out to be very expensive: A *lot* more data would be sent to the terminal than required.

Constructors

DisplayAttrDiff |

Fields

- styleDiffs :: [StyleStateChange]
- foreColorDiff :: DisplayColorDiff
- backColorDiff :: DisplayColorDiff

Instances

Show DisplayAttrDiff Source # |
Methods showsPrec :: Int -> DisplayAttrDiff -> ShowS # show :: DisplayAttrDiff -> String # showList :: [DisplayAttrDiff] -> ShowS #
Monoid DisplayAttrDiff Source # |
Methods mempty :: DisplayAttrDiff # mappend :: DisplayAttrDiff -> DisplayAttrDiff -> DisplayAttrDiff # mconcat :: [DisplayAttrDiff] -> DisplayAttrDiff #

simplifyStyleDiffs :: [StyleStateChange] -> [StyleStateChange] -> [StyleStateChange] Source #

Used in the computation of a final style attribute change.

simplifyColorDiffs :: DisplayColorDiff -> DisplayColorDiff -> DisplayColorDiff Source #

Consider two display color attributes diffs. What display color attribute diff are these equivalent to?

data DisplayColorDiff Source #

Difference between two display color attribute changes.

Constructors

ColorToDefault |
NoColorChange |
SetColor !Color |

Instances

Eq DisplayColorDiff Source # |
Methods (==) :: DisplayColorDiff -> DisplayColorDiff -> Bool # (/=) :: DisplayColorDiff -> DisplayColorDiff -> Bool #
Show DisplayColorDiff Source # |
Methods showsPrec :: Int -> DisplayColorDiff -> ShowS # show :: DisplayColorDiff -> String # showList :: [DisplayColorDiff] -> ShowS #

data StyleStateChange Source #

Style attribute changes are transformed into a sequence of apply/removes of the individual attributes.

Constructors

ApplyStandout |
RemoveStandout |
ApplyUnderline |
RemoveUnderline |
ApplyReverseVideo |
RemoveReverseVideo |
ApplyBlink |
RemoveBlink |
ApplyDim |
RemoveDim |
ApplyBold |
RemoveBold |

Instances

Eq StyleStateChange Source # |
Methods (==) :: StyleStateChange -> StyleStateChange -> Bool # (/=) :: StyleStateChange -> StyleStateChange -> Bool #
Show StyleStateChange Source # |
Methods showsPrec :: Int -> StyleStateChange -> ShowS # show :: StyleStateChange -> String # showList :: [StyleStateChange] -> ShowS #

displayAttrDiffs :: FixedAttr -> FixedAttr -> DisplayAttrDiff Source #

Determines the diff between two display&color attributes. This diff determines the operations that actually get output to the terminal.

diffColor :: Maybe Color -> Maybe Color -> DisplayColorDiff Source #

diffStyles :: Style -> Style -> [StyleStateChange] Source #