Commit graph

432 commits

Author SHA1 Message Date
Daniel Eklöf
1947d33868
render: break out rendering functions to render.{c,h} 2019-07-05 10:16:56 +02:00
Daniel Eklöf
3ba1721c0f
osc: implement change window title and icon 2019-07-05 09:50:35 +02:00
Daniel Eklöf
cb10d10fd8
vt: implement save/restore cursor+attributes 2019-07-04 19:23:25 +02:00
Daniel Eklöf
ea6e06d689
vt: track charsets G0-G3 and support either ASCII or graphical mode 2019-07-04 19:17:18 +02:00
Daniel Eklöf
90dadfcc22
vt: implement (untested!) insert mode
\E4l is not horizontal index, but disable INSERT mode
2019-07-03 21:16:41 +02:00
Daniel Eklöf
5e8c75aa38
csi: implement 'civis' (show/hide cursor) 2019-07-03 14:14:46 +02:00
Daniel Eklöf
9682e15deb
term: "cache" pointer to current line
This adds a pointer to the first cell on the current line. This
pointer must be updated every time the row changes.

The advantage is mainly that PRINT doesn't have to call
grid_get_range(), which is fairly expensive.
2019-07-02 22:18:25 +02:00
Daniel Eklöf
d70956da08
wip: use a sliding window instead of memmove() to scroll
Instead of memmoving a large amount of data on every scroll, use a
sliding window. That is, each time we scroll, we offset origin.
2019-07-01 12:23:38 +02:00
Daniel Eklöf
0f48b4f8f7
terminal: prepare for floating grids 2019-06-29 21:30:54 +02:00
Daniel Eklöf
8cff861f38
terminal: move print_needs_wrap from grid to terminal 2019-06-29 21:16:06 +02:00
Daniel Eklöf
a8f4cb55af
terminal: move cursor from grid to terminal 2019-06-29 21:15:32 +02:00
Daniel Eklöf
8723098cda
terminal: move fore/background colors from grid to terminal 2019-06-29 21:09:58 +02:00
Daniel Eklöf
3d2ab03f62
terminal: move col/row count, cell width/height and scroll region to terminal 2019-06-29 21:08:08 +02:00
Daniel Eklöf
1ecd4a6ae1
Rename grid_* functions to term_* 2019-06-29 21:03:28 +02:00
Daniel Eklöf
1dbddd7155
colors: store as doubles, rather than uint32_t
Since cairo uses doubles, we don't want to have to convert a uin32_t
to double values every time we render a cell.
2019-06-26 20:33:32 +02:00
Daniel Eklöf
3a97fce6d0
grid: attributes now track whether we've set a foreground/background color
This means we don't have to explicitly set the foreground/background
to the grid's default colors whenever we reset/clear a cell, and we
can instead simply memset() the entire cell to 0.

This also means the renderer has to get the default color when
rendering a cell without a foreground/background color set.
2019-06-26 19:44:31 +02:00
Daniel Eklöf
a35738d96f
scroll-region: don't clear damage queue when changing scroll region
Vim, for example, changes the scroll region every time you scroll a
single line. Thus, resetting the damage queue is slow.

This reworks the damage handling of scroll updates:

* Split damage queue into two: one for scroll operations and one for
  update/erase operations.
* Don't separate update/erase operations inside/outside the scroll
  region
* Store the current scroll region in the scroll damage operation. This
  allows us to stack multiple scroll operations with different scroll
  regions.
* When updating update/erase operations after a scroll operation,
  split the update/erase operations if necessary (the current scroll
  operation may have a scroll region different from before, thus
  forcing us to split existing update/erase operations.
* The renderer no longer erases after a scroll. The scroll operation
  also adds an erase operation. This also means that erase operation
  are subject to adjustments by later scroll operations.
2019-06-25 20:11:08 +02:00
Daniel Eklöf
2fe7145aff
scrolling region: wip 2019-06-23 21:12:32 +02:00
Daniel Eklöf
b0a2c54fe8
vt: wip: implement scrolling region
This is largely untested, but existing scrolling code has been
converted to using a terminal-global scrolling region that is defined
as start-end of the scrollable region.

This is compared to the old code where the scrolling region where
defined in terms of marginals, counted in lines from top and from
bottom.
2019-06-23 18:02:49 +02:00
Daniel Eklöf
fbf0db621c
vt: implement reverse scrolling (terminfo 'ri')
This currently duplicates the code paths for DAMAGE_SCROLL; there are
many similarities between the two, but also major differences...
2019-06-23 17:16:52 +02:00
Daniel Eklöf
de7dcf1a5c
csi: save and restore cursor when switching to and from alt screen 2019-06-23 15:03:22 +02:00
Daniel Eklöf
199e4aa044
vt: initial implementation of alt screen + 256 colors 2019-06-23 15:00:27 +02:00
Daniel Eklöf
35e5fa1f76
vt: implement DECCKM (cursor key sends either SS3 or CSI escapes) 2019-06-23 14:12:20 +02:00
Daniel Eklöf
6aba78a145
csi: wip: recognize the private CSIs for bracketed paste, smcup/rmxup, smkx/rmkx 2019-06-22 22:25:50 +02:00
Daniel Eklöf
a50be28b9d
grid: implement DAMAGE_SCROLL 2019-06-21 14:29:15 +02:00
Daniel Eklöf
304f15d696
Use a 'damage' list to communicate what needs to be updated
Instead of having each cell in the grid track it's own dirtiness, grid
operations now append "damage" to a list.

This list is consumed every time we render the grid.

This allows us to special case some operations, like erase (and in the
future, scroll).
2019-06-19 14:17:43 +02:00
Daniel Eklöf
71dde121e6
wip: initial input handling 2019-06-19 10:04:47 +02:00
Daniel Eklöf
50c43be0d9
grid: track both linear and row,col cursor 2019-06-17 21:15:20 +02:00
Daniel Eklöf
963b266cce
vt: handle cursor-at-right-edge
When printing to the right-most-cell, don't advance the
cursor. Instead, set a flag that indicates that the *next* print
should line-wrap.
2019-06-17 20:53:05 +02:00
Daniel Eklöf
6d5f5b9f7a
wip: vt parsing 2019-06-17 18:57:12 +02:00
Daniel Eklöf
c5b60253a7
vt: cell now tracks attributes (bold, italic, underline etc) 2019-06-16 16:44:42 +02:00
Daniel Eklöf
2a4c08b941
wip: vt parsing: initial csi/osc dispatching 2019-06-15 22:22:44 +02:00