| Safe Haskell | Safe |
|---|---|
| Language | Haskell2010 |
Graphics.Vty.DisplayAttributes
Synopsis
- fixDisplayAttr :: FixedAttr -> Attr -> FixedAttr
- data DisplayAttrDiff = DisplayAttrDiff {}
- simplifyStyleDiffs :: [StyleStateChange] -> [StyleStateChange] -> [StyleStateChange]
- simplifyColorDiffs :: DisplayColorDiff -> DisplayColorDiff -> DisplayColorDiff
- simplifyUrlDiffs :: URLDiff -> URLDiff -> URLDiff
- data DisplayColorDiff
- data StyleStateChange
- data URLDiff
- displayAttrDiffs :: FixedAttr -> FixedAttr -> DisplayAttrDiff
- diffURL :: Maybe Text -> Maybe Text -> URLDiff
- diffColor :: Maybe Color -> Maybe Color -> DisplayColorDiff
- diffStyles :: Style -> Style -> [StyleStateChange]
Documentation
fixDisplayAttr :: FixedAttr -> Attr -> FixedAttr #
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 #
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 | |
Instances
| Show DisplayAttrDiff # | |
Defined in Graphics.Vty.DisplayAttributes Methods showsPrec :: Int -> DisplayAttrDiff -> ShowS # show :: DisplayAttrDiff -> String # showList :: [DisplayAttrDiff] -> ShowS # | |
| Semigroup DisplayAttrDiff # | |
Defined in Graphics.Vty.DisplayAttributes Methods (<>) :: DisplayAttrDiff -> DisplayAttrDiff -> DisplayAttrDiff # sconcat :: NonEmpty DisplayAttrDiff -> DisplayAttrDiff # stimes :: Integral b => b -> DisplayAttrDiff -> DisplayAttrDiff # | |
| Monoid DisplayAttrDiff # | |
Defined in Graphics.Vty.DisplayAttributes Methods mappend :: DisplayAttrDiff -> DisplayAttrDiff -> DisplayAttrDiff # mconcat :: [DisplayAttrDiff] -> DisplayAttrDiff # | |
simplifyStyleDiffs :: [StyleStateChange] -> [StyleStateChange] -> [StyleStateChange] #
Used in the computation of a final style attribute change.
simplifyColorDiffs :: DisplayColorDiff -> DisplayColorDiff -> DisplayColorDiff #
Consider two display color attributes diffs. What display color attribute diff are these equivalent to?
simplifyUrlDiffs :: URLDiff -> URLDiff -> URLDiff #
Consider two URL changes, which are mostly going to be the latter unless the latter specifies no change.
data DisplayColorDiff #
Difference between two display color attribute changes.
Constructors
| ColorToDefault | |
| NoColorChange | |
| SetColor !Color |
Instances
| Eq DisplayColorDiff # | |
Defined in Graphics.Vty.DisplayAttributes Methods (==) :: DisplayColorDiff -> DisplayColorDiff -> Bool # (/=) :: DisplayColorDiff -> DisplayColorDiff -> Bool # | |
| Show DisplayColorDiff # | |
Defined in Graphics.Vty.DisplayAttributes Methods showsPrec :: Int -> DisplayColorDiff -> ShowS # show :: DisplayColorDiff -> String # showList :: [DisplayColorDiff] -> ShowS # | |
data StyleStateChange #
Style attribute changes are transformed into a sequence of apply/removes of the individual attributes.
Constructors
| ApplyStandout | |
| RemoveStandout | |
| ApplyItalic | |
| RemoveItalic | |
| ApplyUnderline | |
| RemoveUnderline | |
| ApplyReverseVideo | |
| RemoveReverseVideo | |
| ApplyBlink | |
| RemoveBlink | |
| ApplyDim | |
| RemoveDim | |
| ApplyBold | |
| RemoveBold |
Instances
| Eq StyleStateChange # | |
Defined in Graphics.Vty.DisplayAttributes Methods (==) :: StyleStateChange -> StyleStateChange -> Bool # (/=) :: StyleStateChange -> StyleStateChange -> Bool # | |
| Show StyleStateChange # | |
Defined in Graphics.Vty.DisplayAttributes Methods showsPrec :: Int -> StyleStateChange -> ShowS # show :: StyleStateChange -> String # showList :: [StyleStateChange] -> ShowS # | |
Constructors
| LinkTo !ByteString | |
| NoLinkChange | |
| EndLink |
displayAttrDiffs :: FixedAttr -> FixedAttr -> DisplayAttrDiff #
Determines the diff between two display&color attributes. This diff determines the operations that actually get output to the terminal.
diffStyles :: Style -> Style -> [StyleStateChange] #