That is, remove the 'regular' and 'bright' color arrays. This is
possible since the 256-color array is defined such that the first 16
colors map to the regular and bright colors.
Our surface may be on multiple outputs at the same time. In this case,
we use the largest scale factor, and let the compositor down scale on
the "other" output(s).
Instead of running a repeater thread that writes the key to repeat
over a pipe, use a simple timer fd.
No more locking or condition signalling. No need to track
start/stop/exist states.
We simply set up the initial timeout value to be the 'delay', and the
interval to be the repeat 'rate'.
The 'attributes' struct is now 8 bytes and naturally packed (used to
be 9 bytes, artificially packed).
'cell' struct is now 12 bytes, naturally packed (used to be 13 bytes,
artificially packed).
Furthermore, the glyph is stored as a wchar instead of a char*. This
makes it easier (faster) to do glyph lookup when rendering.
A top-level font now has a list of fallback fonts. When a glyph cannot
be found, we try each fallback font in turn, until we either find one
that has the glyph, or until we've exhausted the list.
To make this actually work in practise (read: to make performance
acceptable), the cache is re-worked and is now populated on demand.
It also supports non-ASCII characters, by using the 4-byte unicode
character as index instead.
Since having an array that can be indexed by a 4-byte value isn't
really viable, we now have a simple hash table instead of an array.
This patch takes a bit from the foreground color value in a
cell (todo: split up foreground/background into bitfields with a
separate field for 'foreground/background' has been set), and only
re-renders cells that aren't marked as clean.
Note: we use a 'clean' bit rather than a 'dirty' bit to make it easy
to erase cells - we can (keep doing) do that by simply memsetting a
cell range to 0.
The default is to reverse the foreground/background colors in the cell
with the cursor.
But, if the user configures a specific set of cursor colors, those
will always be used, regardless of other cell attributes (dim, reverse
etc).
The cursor color is specified as two color values, 'text' and
'cursor'.
The block cursor uses the 'cursor' color as background, and the 'text'
color for the glyph.
All other cursor styles uses the 'cursor' color for the cursor, but
uses the cell's foreground color for the glyph (meaning,
dim/reverse/etc applies).
According to the specs, \E[0 q means a blinking block cursor. However,
since it also states that \E[1 q *also* is a blinking block cursor,
and that it is the default, *and* given that fact that parameter-less
CSIs typically means "reset", let's make it mean "reset to the user
configured cursor style".
Use our own escape sequence for the 'flash' terminfo entry.
Implemented by arming a timer FD and setting a boolean that indicates
we're currently "flashing".
The renderer draws a semi-transparent yellowish layer over the entire
window when "flashing" is active.
22;0|1|2t pushes the current window title/icon to the stack, while 23
pops it.
The second parameter, 0|1|2 has the following meaning:
0 - push/pop icon+title
1 - push/pop icon
2 - push/pop title
To avoid having to re-generate glyphs, cache the glyphs.
For now, we only cache ASCII characters, as this allows us to lookup
the cache by simply indexing with the character (into a 256-entry
array).