diff options
author | bptato <nincsnevem662@gmail.com> | 2021-08-06 20:17:11 +0200 |
---|---|---|
committer | bptato <nincsnevem662@gmail.com> | 2021-08-06 23:23:46 +0200 |
commit | 559d2ca622e15c5781303940bc0c87e9aed1e5d1 (patch) | |
tree | d16f48ff0187fcf485c445dad298ef0d39e9cb6d /src/types | |
parent | da1f249117ad2a6f02c1ac32208d6ece95508505 (diff) | |
download | chawan-559d2ca622e15c5781303940bc0c87e9aed1e5d1.tar.gz |
More efficient display algorithms
displayBuffer now only kills lines after a replacement has been outputted. An expermiental procedure displayBufferSwapOutput was also added, it isn't currently used as it's best for small changes like link highlighting.
Diffstat (limited to 'src/types')
-rw-r--r-- | src/types/color.nim | 11 | ||||
-rw-r--r-- | src/types/enums.nim | 3 |
2 files changed, 13 insertions, 1 deletions
diff --git a/src/types/color.nim b/src/types/color.nim index 2a956baa..45a3f31d 100644 --- a/src/types/color.nim +++ b/src/types/color.nim @@ -4,6 +4,15 @@ type CellColor* = object case rgb*: bool of true: - rgbcolor: RGBColor + rgbcolor*: RGBColor of false: color*: uint8 + +func `==`*(color1: CellColor, color2: CellColor): bool = + if color1.rgb != color2.rgb: + return false + if color1.rgb: + return color1.rgbcolor == color2.rgbcolor + return color1.color == color2.color + +const defaultColor* = CellColor(rgb: false, color: 0) diff --git a/src/types/enums.nim b/src/types/enums.nim index 6b2c7412..eac71dd5 100644 --- a/src/types/enums.nim +++ b/src/types/enums.nim @@ -78,6 +78,9 @@ type CSSGlobalValueType* = enum VALUE_INITIAL, VALUE_INHERIT, VALUE_REVERT, VALUE_UNSET + DrawInstructionType* = enum + DRAW_TEXT, DRAW_GOTO, DRAW_FGCOLOR, DRAW_BGCOLOR, DRAW_STYLE, DRAW_RESET + const SelfClosingTagTypes* = { TAG_LI, TAG_P } |