Commit graph

47 commits

Author SHA1 Message Date
Daniel Eklöf
c853f01027
render: re-enable drawing cursor on erase 2019-07-01 19:19:32 +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
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
e2bdda8c61
render: don't try to render glyph for empty cell(s) 2019-06-29 20:50:40 +02:00
Daniel Eklöf
28f7ab5130
main: increase ptmx slave buffer size 2019-06-29 20:50:27 +02:00
Daniel Eklöf
23a133a64a
render: alignment 2019-06-29 20:50:21 +02:00
Daniel Eklöf
b59b03fd07
render: also check scroll damage list 2019-06-29 20:50:09 +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
54403738bb
render: use alpha from cell colors 2019-06-26 20:09:02 +02:00
Daniel Eklöf
3349c28fce
render: avoid division 2019-06-26 20:08:49 +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
97420f13d8
scroll: let the render erase the scrolled up region
The grid scroll operation no longer inserts a DAMAGE_ERASE operation,
but instead manually clears the region. The render does the
corresponding thing.
2019-06-26 19:33:39 +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
2b3f3711fc
TIOCSWINSZ: fix alignment and spelling 2019-06-24 19:39:31 +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
c0a9f9e6b2
resize: bug: we're not in alt screen mode at startup
When we start up, the cells pointer, *and* the alt screen pointer are
both NULL. Hence we incorrectly decided we were initially in alt
screen mode.
2019-06-23 17:14:46 +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
949847a35a
vt: add all (?) missing states, actions and transitions 2019-06-23 13:28:55 +02:00
Daniel Eklöf
5698d69890
render: implement 'reverse' attribute 2019-06-22 21:42:44 +02:00
Daniel Eklöf
7ec746e826
render: implement 'conceal' attribute 2019-06-22 21:39:11 +02:00
Daniel Eklöf
4b6ea810fc
main: implement bold+italic fonts 2019-06-22 21:32:51 +02:00
Daniel Eklöf
3338b816a3
render: re-render cursor after ERASE (if cursor is in the erase range) 2019-06-21 15:31:35 +02:00
Daniel Eklöf
a50be28b9d
grid: implement DAMAGE_SCROLL 2019-06-21 14:29:15 +02:00
Daniel Eklöf
0ddd96de0d
render: break up grid_render() 2019-06-19 14:37:42 +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
6d5f5b9f7a
wip: vt parsing 2019-06-17 18:57:12 +02:00
Daniel Eklöf
733223dd0c
TIOCSWINSZ: set ws_xpixel and ws_ypixel 2019-06-16 16:47:09 +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
Daniel Eklöf
0e6aa61d69
Track cell foreground and background colors 2019-06-13 21:55:32 +02:00
Daniel Eklöf
9f9949aeec
Initial handling of multi byte characters
Use mblen() to calculate the byte count for each character.
2019-06-13 21:23:52 +02:00
Daniel Eklöf
e062ff7b97
Set XDG toplevel title 2019-06-13 20:43:52 +02:00
Daniel Eklöf
46e3c9d4d4
Render cursor 2019-06-13 20:40:03 +02:00
Daniel Eklöf
71703e7dc6
Use frame callback to rate-limit surface updates 2019-06-13 17:14:14 +02:00
Daniel Eklöf
9ccc8433c3
initial grid implementation
This allows us to render *something*, even though it's inefficient,
stupid and far far away from the real thing.
2019-06-13 16:24:35 +02:00
Daniel Eklöf
acda4d2d31
Set up pseudo terminal and fork slave 2019-06-13 15:19:10 +02:00
Daniel Eklöf
4de6a8ad38
main: handle window resize 2019-06-12 20:17:48 +02:00
Daniel Eklöf
910c540ea9
initial commit: maps an XDG toplevel window 2019-06-12 20:08:54 +02:00