vty-6.4: A simple terminal UI library

Safe Haskell | Safe-Inferred
Language | Haskell2010

Graphics.Vty.DisplayAttributes

Synopsis

- data DisplayAttrDiff = DisplayAttrDiff {
  - styleDiffs :: [StyleStateChange]
  - foreColorDiff :: DisplayColorDiff
  - backColorDiff :: DisplayColorDiff
  - urlDiff :: URLDiff
  }
- data StyleStateChange
  - = ApplyStandout
  - | RemoveStandout
  - | ApplyItalic
  - | RemoveItalic
  - | ApplyStrikethrough
  - | RemoveStrikethrough
  - | ApplyUnderline
  - | RemoveUnderline
  - | ApplyReverseVideo
  - | RemoveReverseVideo
  - | ApplyBlink
  - | RemoveBlink
  - | ApplyDim
  - | RemoveDim
  - | ApplyBold
  - | RemoveBold
- data DisplayColorDiff
  - = ColorToDefault
  - | NoColorChange
  - | SetColor !Color
- data URLDiff
  - = LinkTo !ByteString
  - | NoLinkChange
  - | EndLink
- fixDisplayAttr :: FixedAttr -> Attr -> FixedAttr
- displayAttrDiffs :: FixedAttr -> FixedAttr -> DisplayAttrDiff

# Documentation

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
- urlDiff :: URLDiff

#### Instances

Instances details

Monoid DisplayAttrDiff Source # |
Instance details Defined in Graphics.Vty.DisplayAttributes Methods mempty :: DisplayAttrDiff Source # mappend :: DisplayAttrDiff -> DisplayAttrDiff -> DisplayAttrDiff Source # mconcat :: [DisplayAttrDiff] -> DisplayAttrDiff Source #
Semigroup DisplayAttrDiff Source # |
Instance details Defined in Graphics.Vty.DisplayAttributes Methods (<>) :: DisplayAttrDiff -> DisplayAttrDiff -> DisplayAttrDiff Source # sconcat :: NonEmpty DisplayAttrDiff -> DisplayAttrDiff Source # stimes :: Integral b => b -> DisplayAttrDiff -> DisplayAttrDiff Source #
Show DisplayAttrDiff Source # |
Instance details Defined in Graphics.Vty.DisplayAttributes Methods showsPrec :: Int -> DisplayAttrDiff -> ShowS Source # show :: DisplayAttrDiff -> String Source # showList :: [DisplayAttrDiff] -> ShowS Source #

data StyleStateChange Source #

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

Constructors

ApplyStandout |
RemoveStandout |
ApplyItalic |
RemoveItalic |
ApplyStrikethrough |
RemoveStrikethrough |
ApplyUnderline |
RemoveUnderline |
ApplyReverseVideo |
RemoveReverseVideo |
ApplyBlink |
RemoveBlink |
ApplyDim |
RemoveDim |
ApplyBold |
RemoveBold |

#### Instances

Instances details

Show StyleStateChange Source # |
Instance details Defined in Graphics.Vty.DisplayAttributes Methods showsPrec :: Int -> StyleStateChange -> ShowS Source # show :: StyleStateChange -> String Source # showList :: [StyleStateChange] -> ShowS Source #
Eq StyleStateChange Source # |
Instance details Defined in Graphics.Vty.DisplayAttributes Methods (==) :: StyleStateChange -> StyleStateChange -> Bool Source # (/=) :: StyleStateChange -> StyleStateChange -> Bool Source #

data DisplayColorDiff Source #

Difference between two display color attribute changes.

Constructors

ColorToDefault |
NoColorChange |
SetColor !Color |

#### Instances

Instances details

Show DisplayColorDiff Source # |
Instance details Defined in Graphics.Vty.DisplayAttributes Methods showsPrec :: Int -> DisplayColorDiff -> ShowS Source # show :: DisplayColorDiff -> String Source # showList :: [DisplayColorDiff] -> ShowS Source #
Eq DisplayColorDiff Source # |
Instance details Defined in Graphics.Vty.DisplayAttributes Methods (==) :: DisplayColorDiff -> DisplayColorDiff -> Bool Source # (/=) :: DisplayColorDiff -> DisplayColorDiff -> Bool Source #

data URLDiff Source #

Constructors

LinkTo !ByteString |
NoLinkChange |
EndLink |

#### Instances

Instances details

Show URLDiff Source # |
Instance details Defined in Graphics.Vty.DisplayAttributes Methods showsPrec :: Int -> URLDiff -> ShowS Source # show :: URLDiff -> String Source # showList :: [URLDiff] -> ShowS Source #
Eq URLDiff Source # |
Instance details Defined in Graphics.Vty.DisplayAttributes Methods (==) :: URLDiff -> URLDiff -> Bool Source # (/=) :: URLDiff -> URLDiff -> Bool Source #

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.

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.