Commit graph

134 commits

Author SHA1 Message Date
Daniel Eklöf
9f0b1f94c2
wayland: change all wayland callbacks to take a wayland pointer
Instead of passing the terminal to the wayland callbacks, pass a
'struct wayland' pointer.
2019-10-27 18:43:07 +01:00
Daniel Eklöf
c9455d5f21
kbd: move into wayland 2019-10-27 17:10:32 +01:00
Daniel Eklöf
061bbd7049
kbd: break out XKB kbd struct to a separate file 2019-10-27 16:21:19 +01:00
Daniel Eklöf
5ca1ee701b
wayland: move clipboard/primary structs into the wayland struct
These are application global and very wayland specific
2019-10-27 16:15:32 +01:00
Daniel Eklöf
9e6c28f5b6
wayland: implement wayl_win_destroy() 2019-10-27 16:01:44 +01:00
Daniel Eklöf
0120c57ed5
wayland: move wayland struct definitions to a separate file 2019-10-27 13:06:39 +01:00
Daniel Eklöf
a2b3cc6cfe
term: convert anonymous 'window' struct to named 'wl_window' struct 2019-10-27 13:04:26 +01:00
Daniel Eklöf
f63458ef33
term: move per-window wayland objects from wayland struct to terminal struct
Short term, we want to break out the wayland backend from the terminal
struct. Long term, we might want to support multiple windows.

One step towards both the above is separating global wayland objects
from per-window objects.
2019-10-27 12:57:37 +01:00
Daniel Eklöf
5fefb950b3
fdm: use the FDM's poll loop 2019-10-27 11:46:18 +01:00
Daniel Eklöf
a789230cf9
font: font_from_name() returns an allocated font struct 2019-10-16 21:52:12 +02:00
Daniel Eklöf
1a9ec997b3
main: track output refresh rate 2019-09-20 22:15:18 +02:00
Daniel Eklöf
556bf95b28
search: make search-direction configurable 2019-08-30 20:15:12 +02:00
Daniel Eklöf
47da5b4086
main: request server-side decorations 2019-08-30 17:55:45 +02:00
Daniel Eklöf
27da0d7f28
term: add a 'cursor' (position) to the search state 2019-08-29 21:02:35 +02:00
Daniel Eklöf
44a353a7f7
search: move wayland surface variables into the term struct 2019-08-29 20:15:33 +02:00
Daniel Eklöf
66912cbfb5
search: use a sub-surface to render the search buffer 2019-08-29 19:34:41 +02:00
Daniel Eklöf
777863ac3e
term: add term_reset_view() - make view follow end-of-output again 2019-08-28 17:27:42 +02:00
Daniel Eklöf
aee5045395
search: wip: initial search matching
* match search buffer against scrollback content
* adjust view to ensure matched content is visible
* create selection on a successful match
* finalize selection when user presses enter (to "commit" the search)
* ctrl+r searches for the next match. Needs more work though.
2019-08-27 19:33:19 +02:00
Daniel Eklöf
61cabdac13
search: wip: re-direct input while searching, and build a search buffer
This adds a new state, 'is_searching'. While active, input is
re-directed, and stored in a search buffer. In the future, we'll use
this buffer and search for its content in the scrollback buffer, and
move the view and create a selection on matches.

When rendering in 'is_searching', everything is dimmed. In the future,
we'll render the current search buffer on-top of the dimmed "regular"
terminal output.
2019-08-27 17:23:28 +02:00
Daniel Eklöf
2d7ca416f0
render: center grid in window
Instead of placing the upper left corner of the grid at 0,0 in the
window, center it.
2019-08-27 15:25:35 +02:00
Daniel Eklöf
d8fb80ea32
term: rename colors256 -> table 2019-08-21 18:50:24 +02:00
Daniel Eklöf
631e0c0870
term: use colors256 array for *all* colors
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.
2019-08-21 18:47:48 +02:00
Daniel Eklöf
d7aaeaedee
csi: move 256-color table into the terminal struct 2019-08-21 17:56:21 +02:00
Daniel Eklöf
d5bc46f333
render: reload cursor theme when scale (may) have changed 2019-08-21 17:53:52 +02:00
Daniel Eklöf
4168f91d40
csi: implement CSI ? 1007 h/l - alternateScroll
When enabled, mouse scrolls in the alternate screen are converted to
up/down key presses.
2019-08-19 21:16:47 +02:00
Daniel Eklöf
f45e5c6aef
Remove all references to cairo; we now use pixman only 2019-08-16 22:11:22 +02:00
Daniel Eklöf
9ca01436ee
input: track meta modifier 2019-08-15 19:38:28 +02:00
Daniel Eklöf
9fe6e8cc48
Add background alpha support 2019-08-15 18:15:43 +02:00
Daniel Eklöf
c2451e2a80
output: track output we're mapped on, and use maximum scale
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).
2019-08-12 21:49:17 +02:00
Daniel Eklöf
05e91fa9df
output: resize on scale changes 2019-08-12 21:33:24 +02:00
Daniel Eklöf
74f723e0cf
output: initial support for output scaling
* Not updated run-time; only scale at start up used
* Multiple monitors (outputs) not supported, as we can't track which
  output we're on (yet).
2019-08-12 21:33:24 +02:00
Daniel Eklöf
481a1cd678
selection/input: triple click selects an entire row 2019-08-06 19:32:06 +02:00
Daniel Eklöf
a82f12dd2b
input: use a timer fd to handle keyboard key repeat
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'.
2019-08-05 19:33:01 +02:00
Daniel Eklöf
4d7993b36f
cell: pack more efficiently and store glyph as a wchar
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.
2019-08-02 18:19:07 +02:00
Daniel Eklöf
ab92abbd21
term: implement reset 2019-08-01 20:51:11 +02:00
Daniel Eklöf
4801e39eae
conf: make number of scrollback lines configurable 2019-08-01 20:08:39 +02:00
Daniel Eklöf
e3dc184882
term: break out 'flash' to a separate 'term' function 2019-07-30 22:06:02 +02:00
Daniel Eklöf
3b36fb9d74
render: last_cursor.cell must not be const 2019-07-30 20:18:20 +02:00
Daniel Eklöf
73b4d5d05a
font: add support for fallback fonts
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.
2019-07-30 18:04:28 +02:00
Daniel Eklöf
85ef9df586
render: add a 'clean' bit to each cell; only render cells that aren't clean
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.
2019-07-30 18:03:03 +02:00
Daniel Eklöf
c531795b83
wip: initial multithreaded renderer 2019-07-29 20:13:26 +02:00
Daniel Eklöf
4302d3eb68
font: set FT load and render flags from FontConfig properties 2019-07-29 20:10:55 +02:00
Daniel Eklöf
fe882bddba
font: populate glyph cache (ASCII characters only) when instantiating font 2019-07-28 21:03:38 +02:00
Daniel Eklöf
9e57ba2108
font: add font_glyph_for_utf8()
This function fills in a struct glyph with glyph bitmap data for the
provided utf-8 character (essentially a FT_Bitmap wrapped in a cairo
surface).
2019-07-28 20:37:59 +02:00
Daniel Eklöf
175dc9cf94
cairo-ft: remove all usages of cairo-ft 2019-07-28 12:45:01 +02:00
Daniel Eklöf
c399c329b6
main: calculate *all* font metrics from the FreeType face 2019-07-28 12:39:56 +02:00
Daniel Eklöf
cb02c9cf41
font: load FreeType face, and set it's pixel sizes 2019-07-28 12:09:22 +02:00
Daniel Eklöf
e88cf4c8c8
mouse: use discrete axis event if available
This improves the scroll experience with certain devices
2019-07-26 18:48:59 +02:00
Daniel Eklöf
f93384b9c9
render: move local static variables into the terminal struct 2019-07-24 20:21:41 +02:00
Daniel Eklöf
4838763d18
render: move frame_callback to term.render 2019-07-24 20:11:49 +02:00