mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-04-05 07:15:30 -04:00
term: runtime switch between a ‘fast’ and a ‘generic’ ASCII print function
term_print() is called whenever the client application “prints” something to the grid. It is called for both ASCII and UTF-8 characters, and needs to handle sixels, insert mode and ASCII vs. graphical charsets. Since it’s on the hot path, this becomes unnecessarily slow. This patch adds a “fast” version of term_print(), tailored for the common case: ASCII characters in non-insert mode, without any sixels and non-graphical charsets. A new function, term_update_ascii_printer(), has been added, and must be called whenever: * The currently selected charset *index* changes * The currently selected charset changes (from ASCII to graphical, or vice verse) * Sixels are added to the grid * Sixels are removed from the grid * Insert mode is enabled/disabled
This commit is contained in:
parent
d8f0e701b5
commit
60b3ccc641
5 changed files with 84 additions and 16 deletions
|
|
@ -266,6 +266,8 @@ struct terminal {
|
|||
struct reaper *reaper;
|
||||
const struct config *conf;
|
||||
|
||||
void (*ascii_printer)(struct terminal *term, wchar_t c);
|
||||
|
||||
pid_t slave;
|
||||
int ptmx;
|
||||
|
||||
|
|
@ -607,6 +609,8 @@ struct terminal *term_init(
|
|||
bool term_shutdown(struct terminal *term);
|
||||
int term_destroy(struct terminal *term);
|
||||
|
||||
void term_update_ascii_printer(struct terminal *term);
|
||||
|
||||
void term_reset(struct terminal *term, bool hard);
|
||||
bool term_to_slave(struct terminal *term, const void *data, size_t len);
|
||||
bool term_paste_data_to_slave(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue