aboutsummaryrefslogtreecommitdiff
path: root/terminal.h (follow)
Commit message (Collapse)AuthorAgeLines
* fcft: include <fcft/fcft.h>, and use fcft/stride.h instead of local copyDaniel Eklöf2019-12-01-1/+1
|
* fcft: use fcft instead of local copy of font.c/font.hDaniel Eklöf2019-12-01-2/+3
|
* term: mouse reporting functions no longer take modifier stateDaniel Eklöf2019-11-30-6/+3
| | | | | | | | | | | | | | | | The mouse reporting functions are called from input when we receive Wayland mouse events. We used to pass the current keyboard modifier (shift, alt, ctrl, etc) to the terminal functions. This however is wrong, since we may receive Wayland mouse events without having keyboard focus. When we don't have keyboard focus, the modifier state doesn't apply to us. Remove the modifier arguments from the terminal mouse reporting functions. These functions now read this state directly instead, but only when the terminal instance in question has keyboard focus.
* term: add term_mouse_grabbed()Daniel Eklöf2019-11-30-0/+1
| | | | | | When this returns true, it means we have keyboard focus and are grabbing the mouse (for e.g. selections), regardless of whether the client has enabled mouse tracking or not.
* term: xcursor: use 'hand2' instead of 'left_ptr' when mouse trackingDaniel Eklöf2019-11-29-2/+2
| | | | | Mouse tracking always reports clicks, so using a cursor that suggests you can click makes sense I think.
* terminal: use the 'text' xcursor pointer whenever selection is possibleDaniel Eklöf2019-11-28-0/+2
|
* font: move metrics from terminal struct to font structDaniel Eklöf2019-11-26-6/+0
|
* term: try to improve on a performance regressionDaniel Eklöf2019-11-17-1/+1
| | | | | | | | When support was added for DECOM (absolute/relative row addressing), a small but noticeable (~3.5%) performance regression was introduced. Try to improve the situation by simplifying the relative-to-absolute conversion; only the row needs to be transformed.
* Revert "term: new function: term_autowrap()"Daniel Eklöf2019-11-17-1/+0
| | | | This reverts commit 686405b7031736445eeb35206e4a797a8dd78d91.
* term: new function: term_autowrap()Daniel Eklöf2019-11-17-0/+1
| | | | | | | Adds a linebreak (+ scroll if necessary) if we're in a deferred wrap and auto-margins are enabled. Return true when we wrapped, false otherwise.
* term: save/restore charsets on save/restore cursor+attributesDaniel Eklöf2019-11-17-0/+1
|
* term: convert anonymous 'charsets' struct to a named structDaniel Eklöf2019-11-17-4/+6
|
* term: move charset variables into an anonymous structDaniel Eklöf2019-11-17-2/+5
|
* term: move lcf flag into 'cursor' structDaniel Eklöf2019-11-17-1/+1
|
* term: add struct cursorDaniel Eklöf2019-11-17-3/+7
|
* term: rename: print_needs_wrap -> lcf (Last Column Flag)Daniel Eklöf2019-11-17-1/+1
|
* term: add tab-stop list to terminal structDaniel Eklöf2019-11-16-0/+2
| | | | This list is intended to store tab stop columns
* csi: implement DECOM - switch cursor origin between absolute and relativeDaniel Eklöf2019-11-05-1/+5
| | | | | | | | | | | The default is absolute mode, where 0,0 is the upper left corner of the screen. In relative mode, the origin is relative the top scroll margin. Internally, we always track the current cursor position in absolute mode. Every time we the client *sets* or *queries* the cursor position in relative mode, we translate it to absolute.
* term: asynchronous writes to slaveDaniel Eklöf2019-11-03-0/+8
| | | | | | | | | | Make ptmx non-blocking. Then, when writing data to the slave would have blocked, use the FDM to asynchronously write the remaining data. This is done by enabling EPOLLOUT on ptmx, and enqueueing all outgoing data. The FDM handler will go through the enqueued data, and once all of it has been written, we turn off EPOLLOUT again (thus switching back to synchronous writes)
* Rename: vt_to_slave() -> term_to_slave()Daniel Eklöf2019-11-02-0/+1
|
* Revert "render: last_buf may point to a free:d buffer"Daniel Eklöf2019-11-02-5/+1
| | | | This reverts commit 4d3251a93b4ba309d573aca6ff397df44c4ff760.
* render: last_buf may point to a free:d bufferDaniel Eklöf2019-11-01-1/+5
| | | | So, store last buf's width/height separately
* term_init(): initialize slave TERM from term_init() argumentDaniel Eklöf2019-11-01-1/+1
|
* terminal: call user-defined callback when destroying terminalDaniel Eklöf2019-11-01-1/+7
| | | | main uses this to get the exit code of the terminal.
* term: add term_shutdown()Daniel Eklöf2019-10-30-0/+1
| | | | | | | | | | | | | | | | This function unmaps the terminal window, removes itself from the wayland list of terminals and then finally destroys itself. We ensure we don't get any callbacks/events referring to a free:d terminal struct, we close all terminal related FDs and unmap the wayland window. Then, to be really really sure there aren't any (by the FDM) queued up events, we delay the self-destruction to the next FDM poll iteration, by opening an event FD and adding it to the FDM. The callback for the event FD removes the FD from the FDM again, and closes it. And then proceeds to destroy the terminal.
* Merge branch 'fdm'Daniel Eklöf2019-10-30-131/+21
|\
| * terminal: implement term_init() and term_destroy()Daniel Eklöf2019-10-28-0/+10
| |
| * wayland: implement wayl_init()Daniel Eklöf2019-10-27-1/+1
| | | | | | | | Wayland instantiation is now done by the wayland backend, not in main.
| * term: wayland struct is now not a part of the terminal structDaniel Eklöf2019-10-27-1/+1
| | | | | | | | | | | | We do however need access to it, so provide a pointer. The difference is that now we can have a *single* wayland instance, but multiple terminal instances.
| * wayland: change all wayland callbacks to take a wayland pointerDaniel Eklöf2019-10-27-14/+0
| | | | | | | | | | Instead of passing the terminal to the wayland callbacks, pass a 'struct wayland' pointer.
| * kbd: move into waylandDaniel Eklöf2019-10-27-2/+0
| |
| * kbd: break out XKB kbd struct to a separate fileDaniel Eklöf2019-10-27-32/+1
| |
| * wayland: move clipboard/primary structs into the wayland structDaniel Eklöf2019-10-27-16/+0
| | | | | | | | These are application global and very wayland specific
| * wayland: implement wayl_win_destroy()Daniel Eklöf2019-10-27-1/+0
| |
| * wayland: move wayland struct definitions to a separate fileDaniel Eklöf2019-10-27-68/+1
| |
| * term: convert anonymous 'window' struct to named 'wl_window' structDaniel Eklöf2019-10-27-15/+17
| |
| * term: move per-window wayland objects from wayland struct to terminal structDaniel Eklöf2019-10-27-14/+16
| | | | | | | | | | | | | | | | 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.
| * fdm: use the FDM's poll loopDaniel Eklöf2019-10-27-0/+7
| |
* | scrollback: regression: fix rendering of scrollback diffs less than a screenDaniel Eklöf2019-10-29-1/+3
|/ | | | | | | | | | | | | | When doing "small" scrolls (typically done via mouse wheel or similar), we render the scrolling by emitting a "scroll damage". A recent commit changed how scroll damage is rendered; only when the view is at the bottom ("following" the screen output) do we render the damage. To fix this, add a new type of scroll damage, SCROLL_DAMAGE_IN_VIEW and SCROLL_DAMAGE_REVERSE_IN_VIEW. These signal to the renderer that it should always render the damage.
* font: font_from_name() returns an allocated font structDaniel Eklöf2019-10-16-1/+1
|
* main: track output refresh rateDaniel Eklöf2019-09-20-0/+1
|
* search: make search-direction configurableDaniel Eklöf2019-08-30-0/+1
|
* main: request server-side decorationsDaniel Eklöf2019-08-30-0/+3
|
* term: add a 'cursor' (position) to the search stateDaniel Eklöf2019-08-29-0/+1
|
* search: move wayland surface variables into the term structDaniel Eklöf2019-08-29-2/+14
|
* search: use a sub-surface to render the search bufferDaniel Eklöf2019-08-29-0/+1
|
* term: add term_reset_view() - make view follow end-of-output againDaniel Eklöf2019-08-28-0/+2
|
* search: wip: initial search matchingDaniel Eklöf2019-08-27-0/+5
| | | | | | | | * 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.
* search: wip: re-direct input while searching, and build a search bufferDaniel Eklöf2019-08-27-0/+8
| | | | | | | | | | | 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.
* render: center grid in windowDaniel Eklöf2019-08-27-0/+2
| | | | | Instead of placing the upper left corner of the grid at 0,0 in the window, center it.
* term: rename colors256 -> tableDaniel Eklöf2019-08-21-2/+2
|
* term: use colors256 array for *all* colorsDaniel Eklöf2019-08-21-4/+0
| | | | | | 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.
* csi: move 256-color table into the terminal structDaniel Eklöf2019-08-21-0/+2
|
* render: reload cursor theme when scale (may) have changedDaniel Eklöf2019-08-21-0/+2
|
* csi: implement CSI ? 1007 h/l - alternateScrollDaniel Eklöf2019-08-19-0/+1
| | | | | When enabled, mouse scrolls in the alternate screen are converted to up/down key presses.
* Remove all references to cairo; we now use pixman onlyDaniel Eklöf2019-08-16-1/+0
|
* input: track meta modifierDaniel Eklöf2019-08-15-0/+2
|
* Add background alpha supportDaniel Eklöf2019-08-15-0/+1
|
* output: track output we're mapped on, and use maximum scaleDaniel Eklöf2019-08-12-1/+2
| | | | | | 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).
* output: resize on scale changesDaniel Eklöf2019-08-12-0/+1
|
* output: initial support for output scalingDaniel Eklöf2019-08-12-0/+20
| | | | | | * 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).
* selection/input: triple click selects an entire rowDaniel Eklöf2019-08-06-0/+1
|
* input: use a timer fd to handle keyboard key repeatDaniel Eklöf2019-08-05-6/+1
| | | | | | | | | | | 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'.
* cell: pack more efficiently and store glyph as a wcharDaniel Eklöf2019-08-02-16/+23
| | | | | | | | | | | 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.
* term: implement resetDaniel Eklöf2019-08-01-0/+2
|
* conf: make number of scrollback lines configurableDaniel Eklöf2019-08-01-0/+1
|
* 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
|