aboutsummaryrefslogtreecommitdiff
path: root/terminal.h (follow)
Commit message (Collapse)AuthorAgeLines
...
* term: break out 'flash' to a separate 'term' functionDaniel Eklöf2019-07-30-0/+1
|
* render: last_cursor.cell must not be constDaniel Eklöf2019-07-30-1/+1
|
* font: add support for fallback fontsDaniel Eklöf2019-07-30-35/+1
| | | | | | | | | | | | | | | 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.
* render: add a 'clean' bit to each cell; only render cells that aren't cleanDaniel Eklöf2019-07-30-2/+5
| | | | | | | | | | | 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.
* wip: initial multithreaded rendererDaniel Eklöf2019-07-29-0/+18
|
* font: set FT load and render flags from FontConfig propertiesDaniel Eklöf2019-07-29-1/+4
|
* font: populate glyph cache (ASCII characters only) when instantiating fontDaniel Eklöf2019-07-28-0/+2
|
* font: add font_glyph_for_utf8()Daniel Eklöf2019-07-28-3/+5
| | | | | | 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).
* cairo-ft: remove all usages of cairo-ftDaniel Eklöf2019-07-28-3/+0
|
* main: calculate *all* font metrics from the FreeType faceDaniel Eklöf2019-07-28-1/+7
|
* font: load FreeType face, and set it's pixel sizesDaniel Eklöf2019-07-28-0/+4
|
* mouse: use discrete axis event if availableDaniel Eklöf2019-07-26-0/+3
| | | | This improves the scroll experience with certain devices
* render: move local static variables into the terminal structDaniel Eklöf2019-07-24-0/+10
|
* render: move frame_callback to term.renderDaniel Eklöf2019-07-24-1/+3
|
* conf: allow the user to configure a fixed cursor colorDaniel Eklöf2019-07-23-0/+8
| | | | | | | | | | | | | | | | | | | 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).
* term: make sure to update 'current row' when restoring saved cursorDaniel Eklöf2019-07-23-0/+2
|
* csi: let CSI 0 q mean "switch to user configured cursor style"Daniel Eklöf2019-07-22-0/+1
| | | | | | | | 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".
* conf: make cursor's default style configurableDaniel Eklöf2019-07-22-1/+3
|
* csi: prepare for alternative cursor stylesDaniel Eklöf2019-07-22-0/+2
|
* term: group 'blink' state together in a structDaniel Eklöf2019-07-22-3/+5
|
* term: group 'flash' state together in a structDaniel Eklöf2019-07-22-2/+4
|
* blink: implement 'blink'Daniel Eklöf2019-07-21-0/+4
|
* flash: implement 'flash'Daniel Eklöf2019-07-21-0/+3
| | | | | | | | | | 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.
* dcs: we have no parent terminal to pass through toDaniel Eklöf2019-07-21-5/+0
|
* csi: implement CSI 22t and CSI 23tDaniel Eklöf2019-07-21-0/+1
| | | | | | | | | | | 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
* term: track current window title in terminal structDaniel Eklöf2019-07-21-0/+3
|
* conf: config now provides the colors (though still only hardcoded colors)Daniel Eklöf2019-07-21-2/+2
|
* term: prepare for configurable colors; add color variables to terminalDaniel Eklöf2019-07-21-2/+11
|
* input: store last seen wayland input serialDaniel Eklöf2019-07-19-0/+1
| | | | We need this for clipboard data
* vt: handle up to two private charactersDaniel Eklöf2019-07-19-1/+1
|
* dcs: sort of implement DCS passthroughDaniel Eklöf2019-07-19-0/+5
| | | | | | | We now store the passthrough characters in a buffer, and call dcs_passthrough() on unhook. However, dcs_passthrough() doesn't do anything.
* osc: allocate data buffer dynamicallyDaniel Eklöf2019-07-19-1/+2
|
* render: cache generated glyphs for regular ASCII charactersDaniel Eklöf2019-07-18-0/+7
| | | | | | | | 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).
* selection: implement double-click-to-select-wordDaniel Eklöf2019-07-17-0/+3
|
* render: implement strikeoutDaniel Eklöf2019-07-16-0/+4
|
* render: implement 'underline'Daniel Eklöf2019-07-16-1/+9
|
* csi: move 'dim' attribute from 'vt' to cell attributesDaniel Eklöf2019-07-16-1/+1
|
* csi: add back 'blink' attributeDaniel Eklöf2019-07-16-1/+1
|
* terminal: foreground/background in cell attributes are now uint32_tDaniel Eklöf2019-07-16-7/+5
| | | | This reduces the cell size, and thus improves the cache behavour
* csi: implement FocusIn/Out eventsDaniel Eklöf2019-07-16-0/+3
|
* selection: add support for pasting *from* primaryDaniel Eklöf2019-07-11-1/+12
|
* selection: initial copy-to-clipboard functionalityDaniel Eklöf2019-07-11-0/+11
|
* selection: add a selection APIDaniel Eklöf2019-07-11-0/+4
|
* selection: selections can be made, and are renderedDaniel Eklöf2019-07-11-0/+5
| | | | | | | * Start selection on mouse button down * Update selection on motion * Button release cancels selection if there were no motion after start * Renderer detects cells inside the selection and inverts their colors
* terminal: use floats instead of double for colorsDaniel Eklöf2019-07-10-13/+6
| | | | | We don't need the full resolution a double gives us. Using floats reduces the size of cells greatly, which improves cache usage.
* cell: we only need 4 bytes for the longest utf8 sequenceDaniel Eklöf2019-07-10-1/+1
| | | | | | We don't *have* to NULL-terminate the utf8 string. So don't. This makes the cell glyph 4 bytes exactly, which is better for alignment and cache usage.
* terminal: remove 'blink' attribute from cell structDaniel Eklöf2019-07-10-1/+1
| | | | | This makes the other attribute bits fit in a single uint8_t, which makes each cell smaller which improves cache usage.
* grid: don't pre-allocate the entire grid (with all scrollback lines)Daniel Eklöf2019-07-10-1/+1
| | | | | | | | | | The row array may now contain NULL pointers. This means the corresponding row hasn't yet been allocated and initialized. On a resize, we explicitly allocate the visible rows. Uninitialized rows are then allocated the first time they are referenced.
* terminal: add term_linefeed() and term_reverse_index()Daniel Eklöf2019-07-10-0/+3
| | | | | | | | linefeed moves cursor down one row (columns stays the same), or, if the cursor is at the last row, scrolls up one row. reverse_index does the opposite; it moves the cursor *up* one row, or, if the cursor is at the top row, scrolls *down* one row.
* terminal: only support a single intermediate/private characterDaniel Eklöf2019-07-10-4/+1
|
* terminal: add term_damage_view()Daniel Eklöf2019-07-10-0/+1
| | | | | This ensures everything *visible* (i.e. maybe scrolled back content) is re-rendered.
* wip: initial scroll back supportDaniel Eklöf2019-07-09-0/+2
| | | | | | | | | | | | | | | | | | | | | | | Can scroll up and down, and stops when the beginning/end of history is reached. However, it probably breaks when the entire scrollback buffer has been filled - we need to detect when the view has wrapped around to the current terminal offset. The detection of when we've reached the bottom of the history is also flawed, and only works when we overshoot the bottom with at least a page. Resizing the windows while in a view most likely doesn't work. The view will not detect a wrapped around scrollback buffer. I.e. if the user has scrolled back, and is stationary at a view, but there is still output being produced. Then eventually the scrollback buffer will wrap around. In this case, the correct thing to do is make the view start following the beginning of the history. Right now it doesn't, meaning once the scrollback buffer wraps around, you'll start seeing command output...
* terminal: rename and redefine cursor keys mode and keypad keys modeDaniel Eklöf2019-07-09-4/+4
|
* input: add support for dead keys (composing)Daniel Eklöf2019-07-09-0/+2
|
* render: store frame callback pointer in terminal structDaniel Eklöf2019-07-09-1/+2
| | | | This allows us to free it when exiting
* cleanupDaniel Eklöf2019-07-09-21/+6
|
* main: verify compositor has WL_SHM_FORMAT_ARGB8888Daniel Eklöf2019-07-08-0/+1
|
* rgba: drop alpha channel supportDaniel Eklöf2019-07-08-5/+5
|
* wip: grid is now represented as a grid, not a linear arrayDaniel Eklöf2019-07-08-13/+21
| | | | | | | | | | | | The grid is now represented with an array of row *pointers*. Each row contains an array of cells (the row's columns). The main point of having row pointers is we can now move rows around almost for free. This is useful when scrolling with scroll margins for example, where we previously had to copy the lines in the margins. Now it's just a matter of swapping two pointers.
* cell: packing the cell struct seems to help performanceDaniel Eklöf2019-07-07-4/+16
|
* vt: add branch hinting to PRINT actionDaniel Eklöf2019-07-06-0/+3
|
* csi: implement reverse videoDaniel Eklöf2019-07-05-0/+1
|
* vt: add support for mouse motion reportsDaniel Eklöf2019-07-05-2/+14
|
* vt: add support for \E[?1000h - report mouse button eventsDaniel Eklöf2019-07-05-0/+24
|
* input: mouse eventsDaniel Eklöf2019-07-05-0/+5
|
* render: load cursor theme from XCURSOR_THEME and XCURSOR_SIZEDaniel Eklöf2019-07-05-0/+8
|
* render: break out rendering functions to render.{c,h}Daniel Eklöf2019-07-05-9/+27
|
* osc: implement change window title and iconDaniel Eklöf2019-07-05-6/+11
|
* vt: implement save/restore cursor+attributesDaniel Eklöf2019-07-04-0/+1
|
* vt: track charsets G0-G3 and support either ASCII or graphical modeDaniel Eklöf2019-07-04-0/+4
|
* vt: implement (untested!) insert modeDaniel Eklöf2019-07-03-1/+3
| | | | \E4l is not horizontal index, but disable INSERT mode
* csi: implement 'civis' (show/hide cursor)Daniel Eklöf2019-07-03-0/+1
|
* term: "cache" pointer to current lineDaniel Eklöf2019-07-02-0/+1
| | | | | | | | 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.
* wip: use a sliding window instead of memmove() to scrollDaniel Eklöf2019-07-01-8/+8
| | | | | Instead of memmoving a large amount of data on every scroll, use a sliding window. That is, each time we scroll, we offset origin.
* terminal: prepare for floating gridsDaniel Eklöf2019-06-29-3/+7
|
* terminal: move print_needs_wrap from grid to terminalDaniel Eklöf2019-06-29-2/+1
|
* terminal: move cursor from grid to terminalDaniel Eklöf2019-06-29-9/+10
|
* terminal: move fore/background colors from grid to terminalDaniel Eklöf2019-06-29-3/+2
|
* terminal: move col/row count, cell width/height and scroll region to terminalDaniel Eklöf2019-06-29-7/+8
|
* Rename grid_* functions to term_*Daniel Eklöf2019-06-29-0/+27
|
* colors: store as doubles, rather than uint32_tDaniel Eklöf2019-06-26-4/+6
| | | | | Since cairo uses doubles, we don't want to have to convert a uin32_t to double values every time we render a cell.
* grid: attributes now track whether we've set a foreground/background colorDaniel Eklöf2019-06-26-2/+4
| | | | | | | | | 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.
* scroll-region: don't clear damage queue when changing scroll regionDaniel Eklöf2019-06-25-10/+9
| | | | | | | | | | | | | | | | | | | | | | 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.
* scrolling region: wipDaniel Eklöf2019-06-23-1/+4
|
* vt: wip: implement scrolling regionDaniel Eklöf2019-06-23-2/+7
| | | | | | | | | | 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.
* vt: implement reverse scrolling (terminfo 'ri')Daniel Eklöf2019-06-23-2/+2
| | | | | This currently duplicates the code paths for DAMAGE_SCROLL; there are many similarities between the two, but also major differences...
* csi: save and restore cursor when switching to and from alt screenDaniel Eklöf2019-06-23-0/+4
|
* vt: initial implementation of alt screen + 256 colorsDaniel Eklöf2019-06-23-0/+2
|
* vt: implement DECCKM (cursor key sends either SS3 or CSI escapes)Daniel Eklöf2019-06-23-7/+16
|
* csi: wip: recognize the private CSIs for bracketed paste, smcup/rmxup, smkx/rmkxDaniel Eklöf2019-06-22-0/+1
|
* grid: implement DAMAGE_SCROLLDaniel Eklöf2019-06-21-2/+9
|
* Use a 'damage' list to communicate what needs to be updatedDaniel Eklöf2019-06-19-3/+15
| | | | | | | | | | 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).
* wip: initial input handlingDaniel Eklöf2019-06-19-0/+26
|
* grid: track both linear and row,col cursorDaniel Eklöf2019-06-17-1/+6
|
* vt: handle cursor-at-right-edgeDaniel Eklöf2019-06-17-0/+1
| | | | | | 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.
* wip: vt parsingDaniel Eklöf2019-06-17-0/+1
|
* vt: cell now tracks attributes (bold, italic, underline etc)Daniel Eklöf2019-06-16-11/+14
|
* wip: vt parsing: initial csi/osc dispatchingDaniel Eklöf2019-06-15-0/+70