annotate src/libvterm/src/vterm_internal.h @ 20496:747a270eb1db v8.2.0802

patch 8.2.0802: libvterm code lags behind the upstream version Commit: https://github.com/vim/vim/commit/d863728913801c8fa6d633f6580edfcada533fd0 Author: Bram Moolenaar <Bram@vim.org> Date: Wed May 20 18:41:41 2020 +0200 patch 8.2.0802: libvterm code lags behind the upstream version Problem: Libvterm code lags behind the upstream version. Solution: Include revisions 759 - 762.
author Bram Moolenaar <Bram@vim.org>
date Wed, 20 May 2020 18:45:04 +0200
parents 1d595fada804
children 55a373a243c0
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
11621
b8299e742f41 patch 8.0.0693: no terminal emulator support
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
1 #ifndef __VTERM_INTERNAL_H__
b8299e742f41 patch 8.0.0693: no terminal emulator support
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
2 #define __VTERM_INTERNAL_H__
b8299e742f41 patch 8.0.0693: no terminal emulator support
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
3
b8299e742f41 patch 8.0.0693: no terminal emulator support
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
4 #include "vterm.h"
b8299e742f41 patch 8.0.0693: no terminal emulator support
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
5
b8299e742f41 patch 8.0.0693: no terminal emulator support
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
6 #include <stdarg.h>
b8299e742f41 patch 8.0.0693: no terminal emulator support
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
7
13507
8bdcc8faeb32 patch 8.0.1627: compiler warning for visibility attribute not supported
Christian Brabandt <cb@256bit.org>
parents: 13448
diff changeset
8 #if defined(__GNUC__) && !defined(__MINGW32__)
11621
b8299e742f41 patch 8.0.0693: no terminal emulator support
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
9 # define INTERNAL __attribute__((visibility("internal")))
b8299e742f41 patch 8.0.0693: no terminal emulator support
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
10 # define UNUSED __attribute__((unused))
b8299e742f41 patch 8.0.0693: no terminal emulator support
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
11 #else
b8299e742f41 patch 8.0.0693: no terminal emulator support
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
12 # define INTERNAL
b8299e742f41 patch 8.0.0693: no terminal emulator support
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
13 # define UNUSED
b8299e742f41 patch 8.0.0693: no terminal emulator support
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
14 #endif
b8299e742f41 patch 8.0.0693: no terminal emulator support
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
15
b8299e742f41 patch 8.0.0693: no terminal emulator support
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
16 #ifdef DEBUG
b8299e742f41 patch 8.0.0693: no terminal emulator support
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
17 # define DEBUG_LOG(s) fprintf(stderr, s)
b8299e742f41 patch 8.0.0693: no terminal emulator support
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
18 # define DEBUG_LOG1(s, a) fprintf(stderr, s, a)
b8299e742f41 patch 8.0.0693: no terminal emulator support
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
19 # define DEBUG_LOG2(s, a, b) fprintf(stderr, s, a, b)
b8299e742f41 patch 8.0.0693: no terminal emulator support
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
20 # define DEBUG_LOG3(s, a, b, c) fprintf(stderr, s, a, b, c)
b8299e742f41 patch 8.0.0693: no terminal emulator support
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
21 #else
b8299e742f41 patch 8.0.0693: no terminal emulator support
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
22 # define DEBUG_LOG(s)
b8299e742f41 patch 8.0.0693: no terminal emulator support
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
23 # define DEBUG_LOG1(s, a)
b8299e742f41 patch 8.0.0693: no terminal emulator support
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
24 # define DEBUG_LOG2(s, a, b)
b8299e742f41 patch 8.0.0693: no terminal emulator support
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
25 # define DEBUG_LOG3(s, a, b, c)
b8299e742f41 patch 8.0.0693: no terminal emulator support
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
26 #endif
b8299e742f41 patch 8.0.0693: no terminal emulator support
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
27
b8299e742f41 patch 8.0.0693: no terminal emulator support
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
28 #define ESC_S "\x1b"
b8299e742f41 patch 8.0.0693: no terminal emulator support
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
29
13531
9f857e6310b6 patch 8.0.1639: libvterm code lags behind master
Christian Brabandt <cb@256bit.org>
parents: 13507
diff changeset
30 #define INTERMED_MAX 16
9f857e6310b6 patch 8.0.1639: libvterm code lags behind master
Christian Brabandt <cb@256bit.org>
parents: 13507
diff changeset
31
9f857e6310b6 patch 8.0.1639: libvterm code lags behind master
Christian Brabandt <cb@256bit.org>
parents: 13507
diff changeset
32 #define CSI_ARGS_MAX 16
9f857e6310b6 patch 8.0.1639: libvterm code lags behind master
Christian Brabandt <cb@256bit.org>
parents: 13507
diff changeset
33 #define CSI_LEADER_MAX 16
9f857e6310b6 patch 8.0.1639: libvterm code lags behind master
Christian Brabandt <cb@256bit.org>
parents: 13507
diff changeset
34
20480
d0bf39eb2b07 patch 8.2.0794: libvterm code lags behind the upstream version
Bram Moolenaar <Bram@vim.org>
parents: 20460
diff changeset
35 #define BUFIDX_PRIMARY 0
d0bf39eb2b07 patch 8.2.0794: libvterm code lags behind the upstream version
Bram Moolenaar <Bram@vim.org>
parents: 20460
diff changeset
36 #define BUFIDX_ALTSCREEN 1
d0bf39eb2b07 patch 8.2.0794: libvterm code lags behind the upstream version
Bram Moolenaar <Bram@vim.org>
parents: 20460
diff changeset
37
11621
b8299e742f41 patch 8.0.0693: no terminal emulator support
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
38 typedef struct VTermEncoding VTermEncoding;
b8299e742f41 patch 8.0.0693: no terminal emulator support
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
39
b8299e742f41 patch 8.0.0693: no terminal emulator support
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
40 typedef struct {
b8299e742f41 patch 8.0.0693: no terminal emulator support
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
41 VTermEncoding *enc;
b8299e742f41 patch 8.0.0693: no terminal emulator support
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
42
13770
2449b6ce1456 patch 8.0.1757: unnecessary changes in libvterm
Christian Brabandt <cb@256bit.org>
parents: 13531
diff changeset
43 // This size should be increased if required by other stateful encodings
11621
b8299e742f41 patch 8.0.0693: no terminal emulator support
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
44 char data[4*sizeof(uint32_t)];
b8299e742f41 patch 8.0.0693: no terminal emulator support
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
45 } VTermEncodingInstance;
b8299e742f41 patch 8.0.0693: no terminal emulator support
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
46
b8299e742f41 patch 8.0.0693: no terminal emulator support
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
47 struct VTermPen
b8299e742f41 patch 8.0.0693: no terminal emulator support
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
48 {
b8299e742f41 patch 8.0.0693: no terminal emulator support
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
49 VTermColor fg;
b8299e742f41 patch 8.0.0693: no terminal emulator support
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
50 VTermColor bg;
b8299e742f41 patch 8.0.0693: no terminal emulator support
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
51 unsigned int bold:1;
b8299e742f41 patch 8.0.0693: no terminal emulator support
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
52 unsigned int underline:2;
b8299e742f41 patch 8.0.0693: no terminal emulator support
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
53 unsigned int italic:1;
b8299e742f41 patch 8.0.0693: no terminal emulator support
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
54 unsigned int blink:1;
b8299e742f41 patch 8.0.0693: no terminal emulator support
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
55 unsigned int reverse:1;
20496
747a270eb1db patch 8.2.0802: libvterm code lags behind the upstream version
Bram Moolenaar <Bram@vim.org>
parents: 20488
diff changeset
56 unsigned int conceal:1;
11621
b8299e742f41 patch 8.0.0693: no terminal emulator support
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
57 unsigned int strike:1;
17777
811a12a78164 patch 8.1.1885: comments in libvterm are inconsistent
Bram Moolenaar <Bram@vim.org>
parents: 13770
diff changeset
58 unsigned int font:4; // To store 0-9
11621
b8299e742f41 patch 8.0.0693: no terminal emulator support
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
59 };
b8299e742f41 patch 8.0.0693: no terminal emulator support
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
60
b8299e742f41 patch 8.0.0693: no terminal emulator support
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
61 int vterm_color_equal(VTermColor a, VTermColor b);
b8299e742f41 patch 8.0.0693: no terminal emulator support
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
62
b8299e742f41 patch 8.0.0693: no terminal emulator support
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
63 #if defined(DEFINE_INLINES) || USE_INLINE
b8299e742f41 patch 8.0.0693: no terminal emulator support
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
64 INLINE int vterm_color_equal(VTermColor a, VTermColor b)
b8299e742f41 patch 8.0.0693: no terminal emulator support
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
65 {
b8299e742f41 patch 8.0.0693: no terminal emulator support
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
66 return a.red == b.red && a.green == b.green && a.blue == b.blue;
b8299e742f41 patch 8.0.0693: no terminal emulator support
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
67 }
b8299e742f41 patch 8.0.0693: no terminal emulator support
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
68 #endif
b8299e742f41 patch 8.0.0693: no terminal emulator support
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
69
b8299e742f41 patch 8.0.0693: no terminal emulator support
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
70 struct VTermState
b8299e742f41 patch 8.0.0693: no terminal emulator support
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
71 {
b8299e742f41 patch 8.0.0693: no terminal emulator support
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
72 VTerm *vt;
b8299e742f41 patch 8.0.0693: no terminal emulator support
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
73
b8299e742f41 patch 8.0.0693: no terminal emulator support
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
74 const VTermStateCallbacks *callbacks;
b8299e742f41 patch 8.0.0693: no terminal emulator support
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
75 void *cbdata;
b8299e742f41 patch 8.0.0693: no terminal emulator support
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
76
20496
747a270eb1db patch 8.2.0802: libvterm code lags behind the upstream version
Bram Moolenaar <Bram@vim.org>
parents: 20488
diff changeset
77 const VTermStateFallbacks *fallbacks;
11621
b8299e742f41 patch 8.0.0693: no terminal emulator support
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
78 void *fbdata;
b8299e742f41 patch 8.0.0693: no terminal emulator support
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
79
b8299e742f41 patch 8.0.0693: no terminal emulator support
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
80 int rows;
b8299e742f41 patch 8.0.0693: no terminal emulator support
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
81 int cols;
b8299e742f41 patch 8.0.0693: no terminal emulator support
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
82
17777
811a12a78164 patch 8.1.1885: comments in libvterm are inconsistent
Bram Moolenaar <Bram@vim.org>
parents: 13770
diff changeset
83 // Current cursor position
11621
b8299e742f41 patch 8.0.0693: no terminal emulator support
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
84 VTermPos pos;
b8299e742f41 patch 8.0.0693: no terminal emulator support
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
85
17777
811a12a78164 patch 8.1.1885: comments in libvterm are inconsistent
Bram Moolenaar <Bram@vim.org>
parents: 13770
diff changeset
86 int at_phantom; // True if we're on the "81st" phantom column to defer a wraparound
11621
b8299e742f41 patch 8.0.0693: no terminal emulator support
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
87
b8299e742f41 patch 8.0.0693: no terminal emulator support
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
88 int scrollregion_top;
17777
811a12a78164 patch 8.1.1885: comments in libvterm are inconsistent
Bram Moolenaar <Bram@vim.org>
parents: 13770
diff changeset
89 int scrollregion_bottom; // -1 means unbounded
11621
b8299e742f41 patch 8.0.0693: no terminal emulator support
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
90 #define SCROLLREGION_BOTTOM(state) ((state)->scrollregion_bottom > -1 ? (state)->scrollregion_bottom : (state)->rows)
b8299e742f41 patch 8.0.0693: no terminal emulator support
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
91 int scrollregion_left;
b8299e742f41 patch 8.0.0693: no terminal emulator support
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
92 #define SCROLLREGION_LEFT(state) ((state)->mode.leftrightmargin ? (state)->scrollregion_left : 0)
17777
811a12a78164 patch 8.1.1885: comments in libvterm are inconsistent
Bram Moolenaar <Bram@vim.org>
parents: 13770
diff changeset
93 int scrollregion_right; // -1 means unbounded
11621
b8299e742f41 patch 8.0.0693: no terminal emulator support
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
94 #define SCROLLREGION_RIGHT(state) ((state)->mode.leftrightmargin && (state)->scrollregion_right > -1 ? (state)->scrollregion_right : (state)->cols)
b8299e742f41 patch 8.0.0693: no terminal emulator support
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
95
17777
811a12a78164 patch 8.1.1885: comments in libvterm are inconsistent
Bram Moolenaar <Bram@vim.org>
parents: 13770
diff changeset
96 // Bitvector of tab stops
11621
b8299e742f41 patch 8.0.0693: no terminal emulator support
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
97 unsigned char *tabstops;
b8299e742f41 patch 8.0.0693: no terminal emulator support
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
98
20480
d0bf39eb2b07 patch 8.2.0794: libvterm code lags behind the upstream version
Bram Moolenaar <Bram@vim.org>
parents: 20460
diff changeset
99 /* Primary and Altscreen; lineinfos[1] is lazily allocated as needed */
d0bf39eb2b07 patch 8.2.0794: libvterm code lags behind the upstream version
Bram Moolenaar <Bram@vim.org>
parents: 20460
diff changeset
100 VTermLineInfo *lineinfos[2];
d0bf39eb2b07 patch 8.2.0794: libvterm code lags behind the upstream version
Bram Moolenaar <Bram@vim.org>
parents: 20460
diff changeset
101
d0bf39eb2b07 patch 8.2.0794: libvterm code lags behind the upstream version
Bram Moolenaar <Bram@vim.org>
parents: 20460
diff changeset
102 /* lineinfo will == lineinfos[0] or lineinfos[1], depending on altscreen */
11621
b8299e742f41 patch 8.0.0693: no terminal emulator support
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
103 VTermLineInfo *lineinfo;
b8299e742f41 patch 8.0.0693: no terminal emulator support
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
104 #define ROWWIDTH(state,row) ((state)->lineinfo[(row)].doublewidth ? ((state)->cols / 2) : (state)->cols)
b8299e742f41 patch 8.0.0693: no terminal emulator support
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
105 #define THISROWWIDTH(state) ROWWIDTH(state, (state)->pos.row)
b8299e742f41 patch 8.0.0693: no terminal emulator support
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
106
17777
811a12a78164 patch 8.1.1885: comments in libvterm are inconsistent
Bram Moolenaar <Bram@vim.org>
parents: 13770
diff changeset
107 // Mouse state
11621
b8299e742f41 patch 8.0.0693: no terminal emulator support
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
108 int mouse_col, mouse_row;
b8299e742f41 patch 8.0.0693: no terminal emulator support
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
109 int mouse_buttons;
b8299e742f41 patch 8.0.0693: no terminal emulator support
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
110 int mouse_flags;
b8299e742f41 patch 8.0.0693: no terminal emulator support
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
111
b8299e742f41 patch 8.0.0693: no terminal emulator support
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
112 enum { MOUSE_X10, MOUSE_UTF8, MOUSE_SGR, MOUSE_RXVT } mouse_protocol;
b8299e742f41 patch 8.0.0693: no terminal emulator support
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
113
17777
811a12a78164 patch 8.1.1885: comments in libvterm are inconsistent
Bram Moolenaar <Bram@vim.org>
parents: 13770
diff changeset
114 // Last glyph output, for Unicode recombining purposes
11621
b8299e742f41 patch 8.0.0693: no terminal emulator support
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
115 uint32_t *combine_chars;
13770
2449b6ce1456 patch 8.0.1757: unnecessary changes in libvterm
Christian Brabandt <cb@256bit.org>
parents: 13531
diff changeset
116 size_t combine_chars_size; // Number of ELEMENTS in the above
2449b6ce1456 patch 8.0.1757: unnecessary changes in libvterm
Christian Brabandt <cb@256bit.org>
parents: 13531
diff changeset
117 int combine_width; // The width of the glyph above
2449b6ce1456 patch 8.0.1757: unnecessary changes in libvterm
Christian Brabandt <cb@256bit.org>
parents: 13531
diff changeset
118 VTermPos combine_pos; // Position before movement
11621
b8299e742f41 patch 8.0.0693: no terminal emulator support
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
119
b8299e742f41 patch 8.0.0693: no terminal emulator support
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
120 struct {
b8299e742f41 patch 8.0.0693: no terminal emulator support
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
121 unsigned int keypad:1;
b8299e742f41 patch 8.0.0693: no terminal emulator support
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
122 unsigned int cursor:1;
b8299e742f41 patch 8.0.0693: no terminal emulator support
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
123 unsigned int autowrap:1;
b8299e742f41 patch 8.0.0693: no terminal emulator support
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
124 unsigned int insert:1;
b8299e742f41 patch 8.0.0693: no terminal emulator support
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
125 unsigned int newline:1;
b8299e742f41 patch 8.0.0693: no terminal emulator support
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
126 unsigned int cursor_visible:1;
b8299e742f41 patch 8.0.0693: no terminal emulator support
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
127 unsigned int cursor_blink:1;
b8299e742f41 patch 8.0.0693: no terminal emulator support
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
128 unsigned int cursor_shape:2;
b8299e742f41 patch 8.0.0693: no terminal emulator support
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
129 unsigned int alt_screen:1;
b8299e742f41 patch 8.0.0693: no terminal emulator support
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
130 unsigned int origin:1;
b8299e742f41 patch 8.0.0693: no terminal emulator support
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
131 unsigned int screen:1;
b8299e742f41 patch 8.0.0693: no terminal emulator support
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
132 unsigned int leftrightmargin:1;
b8299e742f41 patch 8.0.0693: no terminal emulator support
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
133 unsigned int bracketpaste:1;
13531
9f857e6310b6 patch 8.0.1639: libvterm code lags behind master
Christian Brabandt <cb@256bit.org>
parents: 13507
diff changeset
134 unsigned int report_focus:1;
18279
e8d1f3209dcd patch 8.1.2134: modifier keys are not always recognized
Bram Moolenaar <Bram@vim.org>
parents: 18064
diff changeset
135 unsigned int modify_other_keys:1;
11621
b8299e742f41 patch 8.0.0693: no terminal emulator support
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
136 } mode;
b8299e742f41 patch 8.0.0693: no terminal emulator support
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
137
b8299e742f41 patch 8.0.0693: no terminal emulator support
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
138 VTermEncodingInstance encoding[4], encoding_utf8;
b8299e742f41 patch 8.0.0693: no terminal emulator support
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
139 int gl_set, gr_set, gsingle_set;
b8299e742f41 patch 8.0.0693: no terminal emulator support
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
140
b8299e742f41 patch 8.0.0693: no terminal emulator support
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
141 struct VTermPen pen;
b8299e742f41 patch 8.0.0693: no terminal emulator support
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
142
b8299e742f41 patch 8.0.0693: no terminal emulator support
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
143 VTermColor default_fg;
b8299e742f41 patch 8.0.0693: no terminal emulator support
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
144 VTermColor default_bg;
13770
2449b6ce1456 patch 8.0.1757: unnecessary changes in libvterm
Christian Brabandt <cb@256bit.org>
parents: 13531
diff changeset
145 VTermColor colors[16]; // Store the 8 ANSI and the 8 ANSI high-brights only
11621
b8299e742f41 patch 8.0.0693: no terminal emulator support
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
146
b8299e742f41 patch 8.0.0693: no terminal emulator support
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
147 int fg_index;
b8299e742f41 patch 8.0.0693: no terminal emulator support
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
148 int bg_index;
b8299e742f41 patch 8.0.0693: no terminal emulator support
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
149 int bold_is_highbright;
b8299e742f41 patch 8.0.0693: no terminal emulator support
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
150
b8299e742f41 patch 8.0.0693: no terminal emulator support
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
151 unsigned int protected_cell : 1;
b8299e742f41 patch 8.0.0693: no terminal emulator support
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
152
17777
811a12a78164 patch 8.1.1885: comments in libvterm are inconsistent
Bram Moolenaar <Bram@vim.org>
parents: 13770
diff changeset
153 // Saved state under DEC mode 1048/1049
11621
b8299e742f41 patch 8.0.0693: no terminal emulator support
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
154 struct {
b8299e742f41 patch 8.0.0693: no terminal emulator support
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
155 VTermPos pos;
b8299e742f41 patch 8.0.0693: no terminal emulator support
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
156 struct VTermPen pen;
b8299e742f41 patch 8.0.0693: no terminal emulator support
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
157
b8299e742f41 patch 8.0.0693: no terminal emulator support
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
158 struct {
12080
93024e778745 patch 8.0.0920: cursor wrong after switching altscreen in terminal
Christian Brabandt <cb@256bit.org>
parents: 11621
diff changeset
159 unsigned int cursor_visible:1;
93024e778745 patch 8.0.0920: cursor wrong after switching altscreen in terminal
Christian Brabandt <cb@256bit.org>
parents: 11621
diff changeset
160 unsigned int cursor_blink:1;
11621
b8299e742f41 patch 8.0.0693: no terminal emulator support
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
161 unsigned int cursor_shape:2;
b8299e742f41 patch 8.0.0693: no terminal emulator support
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
162 } mode;
b8299e742f41 patch 8.0.0693: no terminal emulator support
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
163 } saved;
20488
1d595fada804 patch 8.2.0798: libvterm code lags behind the upstream version
Bram Moolenaar <Bram@vim.org>
parents: 20480
diff changeset
164
1d595fada804 patch 8.2.0798: libvterm code lags behind the upstream version
Bram Moolenaar <Bram@vim.org>
parents: 20480
diff changeset
165 /* Temporary state for DECRQSS parsing */
1d595fada804 patch 8.2.0798: libvterm code lags behind the upstream version
Bram Moolenaar <Bram@vim.org>
parents: 20480
diff changeset
166 union {
1d595fada804 patch 8.2.0798: libvterm code lags behind the upstream version
Bram Moolenaar <Bram@vim.org>
parents: 20480
diff changeset
167 char decrqss[4];
1d595fada804 patch 8.2.0798: libvterm code lags behind the upstream version
Bram Moolenaar <Bram@vim.org>
parents: 20480
diff changeset
168 } tmp;
11621
b8299e742f41 patch 8.0.0693: no terminal emulator support
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
169 };
b8299e742f41 patch 8.0.0693: no terminal emulator support
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
170
b8299e742f41 patch 8.0.0693: no terminal emulator support
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
171 struct VTerm
b8299e742f41 patch 8.0.0693: no terminal emulator support
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
172 {
b8299e742f41 patch 8.0.0693: no terminal emulator support
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
173 VTermAllocatorFunctions *allocator;
b8299e742f41 patch 8.0.0693: no terminal emulator support
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
174 void *allocdata;
b8299e742f41 patch 8.0.0693: no terminal emulator support
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
175
b8299e742f41 patch 8.0.0693: no terminal emulator support
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
176 int rows;
b8299e742f41 patch 8.0.0693: no terminal emulator support
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
177 int cols;
b8299e742f41 patch 8.0.0693: no terminal emulator support
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
178
b8299e742f41 patch 8.0.0693: no terminal emulator support
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
179 struct {
b8299e742f41 patch 8.0.0693: no terminal emulator support
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
180 unsigned int utf8:1;
b8299e742f41 patch 8.0.0693: no terminal emulator support
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
181 unsigned int ctrl8bit:1;
b8299e742f41 patch 8.0.0693: no terminal emulator support
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
182 } mode;
b8299e742f41 patch 8.0.0693: no terminal emulator support
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
183
13531
9f857e6310b6 patch 8.0.1639: libvterm code lags behind master
Christian Brabandt <cb@256bit.org>
parents: 13507
diff changeset
184 struct {
9f857e6310b6 patch 8.0.1639: libvterm code lags behind master
Christian Brabandt <cb@256bit.org>
parents: 13507
diff changeset
185 enum VTermParserState {
9f857e6310b6 patch 8.0.1639: libvterm code lags behind master
Christian Brabandt <cb@256bit.org>
parents: 13507
diff changeset
186 NORMAL,
9f857e6310b6 patch 8.0.1639: libvterm code lags behind master
Christian Brabandt <cb@256bit.org>
parents: 13507
diff changeset
187 CSI_LEADER,
9f857e6310b6 patch 8.0.1639: libvterm code lags behind master
Christian Brabandt <cb@256bit.org>
parents: 13507
diff changeset
188 CSI_ARGS,
9f857e6310b6 patch 8.0.1639: libvterm code lags behind master
Christian Brabandt <cb@256bit.org>
parents: 13507
diff changeset
189 CSI_INTERMED,
20488
1d595fada804 patch 8.2.0798: libvterm code lags behind the upstream version
Bram Moolenaar <Bram@vim.org>
parents: 20480
diff changeset
190 OSC_COMMAND,
1d595fada804 patch 8.2.0798: libvterm code lags behind the upstream version
Bram Moolenaar <Bram@vim.org>
parents: 20480
diff changeset
191 DCS_COMMAND,
17777
811a12a78164 patch 8.1.1885: comments in libvterm are inconsistent
Bram Moolenaar <Bram@vim.org>
parents: 13770
diff changeset
192 // below here are the "string states"
20488
1d595fada804 patch 8.2.0798: libvterm code lags behind the upstream version
Bram Moolenaar <Bram@vim.org>
parents: 20480
diff changeset
193 OSC,
1d595fada804 patch 8.2.0798: libvterm code lags behind the upstream version
Bram Moolenaar <Bram@vim.org>
parents: 20480
diff changeset
194 DCS,
13531
9f857e6310b6 patch 8.0.1639: libvterm code lags behind master
Christian Brabandt <cb@256bit.org>
parents: 13507
diff changeset
195 } state;
9f857e6310b6 patch 8.0.1639: libvterm code lags behind master
Christian Brabandt <cb@256bit.org>
parents: 13507
diff changeset
196
20488
1d595fada804 patch 8.2.0798: libvterm code lags behind the upstream version
Bram Moolenaar <Bram@vim.org>
parents: 20480
diff changeset
197 unsigned int in_esc : 1;
1d595fada804 patch 8.2.0798: libvterm code lags behind the upstream version
Bram Moolenaar <Bram@vim.org>
parents: 20480
diff changeset
198
13531
9f857e6310b6 patch 8.0.1639: libvterm code lags behind master
Christian Brabandt <cb@256bit.org>
parents: 13507
diff changeset
199 int intermedlen;
9f857e6310b6 patch 8.0.1639: libvterm code lags behind master
Christian Brabandt <cb@256bit.org>
parents: 13507
diff changeset
200 char intermed[INTERMED_MAX];
9f857e6310b6 patch 8.0.1639: libvterm code lags behind master
Christian Brabandt <cb@256bit.org>
parents: 13507
diff changeset
201
20488
1d595fada804 patch 8.2.0798: libvterm code lags behind the upstream version
Bram Moolenaar <Bram@vim.org>
parents: 20480
diff changeset
202 union {
1d595fada804 patch 8.2.0798: libvterm code lags behind the upstream version
Bram Moolenaar <Bram@vim.org>
parents: 20480
diff changeset
203 struct {
1d595fada804 patch 8.2.0798: libvterm code lags behind the upstream version
Bram Moolenaar <Bram@vim.org>
parents: 20480
diff changeset
204 int leaderlen;
1d595fada804 patch 8.2.0798: libvterm code lags behind the upstream version
Bram Moolenaar <Bram@vim.org>
parents: 20480
diff changeset
205 char leader[CSI_LEADER_MAX];
13531
9f857e6310b6 patch 8.0.1639: libvterm code lags behind master
Christian Brabandt <cb@256bit.org>
parents: 13507
diff changeset
206
20488
1d595fada804 patch 8.2.0798: libvterm code lags behind the upstream version
Bram Moolenaar <Bram@vim.org>
parents: 20480
diff changeset
207 int argi;
1d595fada804 patch 8.2.0798: libvterm code lags behind the upstream version
Bram Moolenaar <Bram@vim.org>
parents: 20480
diff changeset
208 long args[CSI_ARGS_MAX];
1d595fada804 patch 8.2.0798: libvterm code lags behind the upstream version
Bram Moolenaar <Bram@vim.org>
parents: 20480
diff changeset
209 } csi;
1d595fada804 patch 8.2.0798: libvterm code lags behind the upstream version
Bram Moolenaar <Bram@vim.org>
parents: 20480
diff changeset
210 struct {
1d595fada804 patch 8.2.0798: libvterm code lags behind the upstream version
Bram Moolenaar <Bram@vim.org>
parents: 20480
diff changeset
211 int command;
1d595fada804 patch 8.2.0798: libvterm code lags behind the upstream version
Bram Moolenaar <Bram@vim.org>
parents: 20480
diff changeset
212 } osc;
1d595fada804 patch 8.2.0798: libvterm code lags behind the upstream version
Bram Moolenaar <Bram@vim.org>
parents: 20480
diff changeset
213 struct {
1d595fada804 patch 8.2.0798: libvterm code lags behind the upstream version
Bram Moolenaar <Bram@vim.org>
parents: 20480
diff changeset
214 int commandlen;
1d595fada804 patch 8.2.0798: libvterm code lags behind the upstream version
Bram Moolenaar <Bram@vim.org>
parents: 20480
diff changeset
215 char command[CSI_LEADER_MAX];
1d595fada804 patch 8.2.0798: libvterm code lags behind the upstream version
Bram Moolenaar <Bram@vim.org>
parents: 20480
diff changeset
216 } dcs;
1d595fada804 patch 8.2.0798: libvterm code lags behind the upstream version
Bram Moolenaar <Bram@vim.org>
parents: 20480
diff changeset
217 } v;
13531
9f857e6310b6 patch 8.0.1639: libvterm code lags behind master
Christian Brabandt <cb@256bit.org>
parents: 13507
diff changeset
218
9f857e6310b6 patch 8.0.1639: libvterm code lags behind master
Christian Brabandt <cb@256bit.org>
parents: 13507
diff changeset
219 const VTermParserCallbacks *callbacks;
9f857e6310b6 patch 8.0.1639: libvterm code lags behind master
Christian Brabandt <cb@256bit.org>
parents: 13507
diff changeset
220 void *cbdata;
9f857e6310b6 patch 8.0.1639: libvterm code lags behind master
Christian Brabandt <cb@256bit.org>
parents: 13507
diff changeset
221
20488
1d595fada804 patch 8.2.0798: libvterm code lags behind the upstream version
Bram Moolenaar <Bram@vim.org>
parents: 20480
diff changeset
222 int string_initial;
13531
9f857e6310b6 patch 8.0.1639: libvterm code lags behind master
Christian Brabandt <cb@256bit.org>
parents: 13507
diff changeset
223 } parser;
11621
b8299e742f41 patch 8.0.0693: no terminal emulator support
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
224
17777
811a12a78164 patch 8.1.1885: comments in libvterm are inconsistent
Bram Moolenaar <Bram@vim.org>
parents: 13770
diff changeset
225 // len == malloc()ed size; cur == number of valid bytes
11621
b8299e742f41 patch 8.0.0693: no terminal emulator support
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
226
20460
c15dd3da4f47 patch 8.2.0784: libvterm code lags behind the upstream version
Bram Moolenaar <Bram@vim.org>
parents: 20458
diff changeset
227 VTermOutputCallback *outfunc;
c15dd3da4f47 patch 8.2.0784: libvterm code lags behind the upstream version
Bram Moolenaar <Bram@vim.org>
parents: 20458
diff changeset
228 void *outdata;
c15dd3da4f47 patch 8.2.0784: libvterm code lags behind the upstream version
Bram Moolenaar <Bram@vim.org>
parents: 20458
diff changeset
229
11621
b8299e742f41 patch 8.0.0693: no terminal emulator support
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
230 char *outbuffer;
b8299e742f41 patch 8.0.0693: no terminal emulator support
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
231 size_t outbuffer_len;
b8299e742f41 patch 8.0.0693: no terminal emulator support
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
232 size_t outbuffer_cur;
b8299e742f41 patch 8.0.0693: no terminal emulator support
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
233
20458
ffadba5f898c patch 8.2.0783: libvterm code lags behind the upstream version
Bram Moolenaar <Bram@vim.org>
parents: 18279
diff changeset
234 char *tmpbuffer;
ffadba5f898c patch 8.2.0783: libvterm code lags behind the upstream version
Bram Moolenaar <Bram@vim.org>
parents: 18279
diff changeset
235 size_t tmpbuffer_len;
ffadba5f898c patch 8.2.0783: libvterm code lags behind the upstream version
Bram Moolenaar <Bram@vim.org>
parents: 18279
diff changeset
236
11621
b8299e742f41 patch 8.0.0693: no terminal emulator support
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
237 VTermState *state;
b8299e742f41 patch 8.0.0693: no terminal emulator support
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
238 VTermScreen *screen;
18064
8b4f9be5db73 patch 8.1.2027: MS-Windows: problem with ambiwidth characters
Bram Moolenaar <Bram@vim.org>
parents: 17777
diff changeset
239
8b4f9be5db73 patch 8.1.2027: MS-Windows: problem with ambiwidth characters
Bram Moolenaar <Bram@vim.org>
parents: 17777
diff changeset
240 int in_backspace;
11621
b8299e742f41 patch 8.0.0693: no terminal emulator support
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
241 };
b8299e742f41 patch 8.0.0693: no terminal emulator support
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
242
b8299e742f41 patch 8.0.0693: no terminal emulator support
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
243 struct VTermEncoding {
b8299e742f41 patch 8.0.0693: no terminal emulator support
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
244 void (*init) (VTermEncoding *enc, void *data);
b8299e742f41 patch 8.0.0693: no terminal emulator support
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
245 void (*decode)(VTermEncoding *enc, void *data,
b8299e742f41 patch 8.0.0693: no terminal emulator support
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
246 uint32_t cp[], int *cpi, int cplen,
b8299e742f41 patch 8.0.0693: no terminal emulator support
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
247 const char bytes[], size_t *pos, size_t len);
b8299e742f41 patch 8.0.0693: no terminal emulator support
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
248 };
b8299e742f41 patch 8.0.0693: no terminal emulator support
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
249
b8299e742f41 patch 8.0.0693: no terminal emulator support
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
250 typedef enum {
b8299e742f41 patch 8.0.0693: no terminal emulator support
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
251 ENC_UTF8,
b8299e742f41 patch 8.0.0693: no terminal emulator support
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
252 ENC_SINGLE_94
b8299e742f41 patch 8.0.0693: no terminal emulator support
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
253 } VTermEncodingType;
b8299e742f41 patch 8.0.0693: no terminal emulator support
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
254
b8299e742f41 patch 8.0.0693: no terminal emulator support
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
255 void *vterm_allocator_malloc(VTerm *vt, size_t size);
b8299e742f41 patch 8.0.0693: no terminal emulator support
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
256 void vterm_allocator_free(VTerm *vt, void *ptr);
b8299e742f41 patch 8.0.0693: no terminal emulator support
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
257
b8299e742f41 patch 8.0.0693: no terminal emulator support
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
258 void vterm_push_output_bytes(VTerm *vt, const char *bytes, size_t len);
b8299e742f41 patch 8.0.0693: no terminal emulator support
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
259 void vterm_push_output_vsprintf(VTerm *vt, const char *format, va_list args);
b8299e742f41 patch 8.0.0693: no terminal emulator support
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
260 void vterm_push_output_sprintf(VTerm *vt, const char *format, ...);
b8299e742f41 patch 8.0.0693: no terminal emulator support
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
261 void vterm_push_output_sprintf_ctrl(VTerm *vt, unsigned char ctrl, const char *fmt, ...);
b8299e742f41 patch 8.0.0693: no terminal emulator support
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
262 void vterm_push_output_sprintf_dcs(VTerm *vt, const char *fmt, ...);
b8299e742f41 patch 8.0.0693: no terminal emulator support
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
263
b8299e742f41 patch 8.0.0693: no terminal emulator support
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
264 void vterm_state_free(VTermState *state);
b8299e742f41 patch 8.0.0693: no terminal emulator support
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
265
b8299e742f41 patch 8.0.0693: no terminal emulator support
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
266 void vterm_state_newpen(VTermState *state);
b8299e742f41 patch 8.0.0693: no terminal emulator support
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
267 void vterm_state_resetpen(VTermState *state);
b8299e742f41 patch 8.0.0693: no terminal emulator support
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
268 void vterm_state_setpen(VTermState *state, const long args[], int argcount);
b8299e742f41 patch 8.0.0693: no terminal emulator support
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
269 int vterm_state_getpen(VTermState *state, long args[], int argcount);
b8299e742f41 patch 8.0.0693: no terminal emulator support
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
270 void vterm_state_savepen(VTermState *state, int save);
b8299e742f41 patch 8.0.0693: no terminal emulator support
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
271
b8299e742f41 patch 8.0.0693: no terminal emulator support
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
272 enum {
b8299e742f41 patch 8.0.0693: no terminal emulator support
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
273 C1_SS3 = 0x8f,
b8299e742f41 patch 8.0.0693: no terminal emulator support
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
274 C1_DCS = 0x90,
b8299e742f41 patch 8.0.0693: no terminal emulator support
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
275 C1_CSI = 0x9b,
13318
5e47c4bdf3a6 patch 8.0.1533: libterm doesn't support requesting fg and bg color
Christian Brabandt <cb@256bit.org>
parents: 12080
diff changeset
276 C1_ST = 0x9c,
13770
2449b6ce1456 patch 8.0.1757: unnecessary changes in libvterm
Christian Brabandt <cb@256bit.org>
parents: 13531
diff changeset
277 C1_OSC = 0x9d,
11621
b8299e742f41 patch 8.0.0693: no terminal emulator support
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
278 };
b8299e742f41 patch 8.0.0693: no terminal emulator support
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
279
b8299e742f41 patch 8.0.0693: no terminal emulator support
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
280 void vterm_state_push_output_sprintf_CSI(VTermState *vts, const char *format, ...);
b8299e742f41 patch 8.0.0693: no terminal emulator support
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
281
b8299e742f41 patch 8.0.0693: no terminal emulator support
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
282 void vterm_screen_free(VTermScreen *screen);
b8299e742f41 patch 8.0.0693: no terminal emulator support
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
283
b8299e742f41 patch 8.0.0693: no terminal emulator support
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
284 VTermEncoding *vterm_lookup_encoding(VTermEncodingType type, char designation);
b8299e742f41 patch 8.0.0693: no terminal emulator support
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
285
b8299e742f41 patch 8.0.0693: no terminal emulator support
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
286 int vterm_unicode_width(uint32_t codepoint);
b8299e742f41 patch 8.0.0693: no terminal emulator support
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
287 int vterm_unicode_is_combining(uint32_t codepoint);
18064
8b4f9be5db73 patch 8.1.2027: MS-Windows: problem with ambiwidth characters
Bram Moolenaar <Bram@vim.org>
parents: 17777
diff changeset
288 int vterm_unicode_is_ambiguous(uint32_t codepoint);
8b4f9be5db73 patch 8.1.2027: MS-Windows: problem with ambiwidth characters
Bram Moolenaar <Bram@vim.org>
parents: 17777
diff changeset
289 int vterm_get_special_pty_type(void);
11621
b8299e742f41 patch 8.0.0693: no terminal emulator support
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
290
20460
c15dd3da4f47 patch 8.2.0784: libvterm code lags behind the upstream version
Bram Moolenaar <Bram@vim.org>
parents: 20458
diff changeset
291 #if (defined(_XOPEN_SOURCE) && _XOPEN_SOURCE >= 500) \
c15dd3da4f47 patch 8.2.0784: libvterm code lags behind the upstream version
Bram Moolenaar <Bram@vim.org>
parents: 20458
diff changeset
292 || defined(_ISOC99_SOURCE) || defined(_BSD_SOURCE)
c15dd3da4f47 patch 8.2.0784: libvterm code lags behind the upstream version
Bram Moolenaar <Bram@vim.org>
parents: 20458
diff changeset
293 # undef VSNPRINTF
c15dd3da4f47 patch 8.2.0784: libvterm code lags behind the upstream version
Bram Moolenaar <Bram@vim.org>
parents: 20458
diff changeset
294 # define VSNPRINTF vsnprintf
c15dd3da4f47 patch 8.2.0784: libvterm code lags behind the upstream version
Bram Moolenaar <Bram@vim.org>
parents: 20458
diff changeset
295 # undef SNPRINTF
c15dd3da4f47 patch 8.2.0784: libvterm code lags behind the upstream version
Bram Moolenaar <Bram@vim.org>
parents: 20458
diff changeset
296 #else
c15dd3da4f47 patch 8.2.0784: libvterm code lags behind the upstream version
Bram Moolenaar <Bram@vim.org>
parents: 20458
diff changeset
297 # ifdef VSNPRINTF
c15dd3da4f47 patch 8.2.0784: libvterm code lags behind the upstream version
Bram Moolenaar <Bram@vim.org>
parents: 20458
diff changeset
298 // Use a provided vsnprintf() function.
c15dd3da4f47 patch 8.2.0784: libvterm code lags behind the upstream version
Bram Moolenaar <Bram@vim.org>
parents: 20458
diff changeset
299 int VSNPRINTF(char *str, size_t str_m, const char *fmt, va_list ap);
c15dd3da4f47 patch 8.2.0784: libvterm code lags behind the upstream version
Bram Moolenaar <Bram@vim.org>
parents: 20458
diff changeset
300 # endif
c15dd3da4f47 patch 8.2.0784: libvterm code lags behind the upstream version
Bram Moolenaar <Bram@vim.org>
parents: 20458
diff changeset
301 # ifdef SNPRINTF
c15dd3da4f47 patch 8.2.0784: libvterm code lags behind the upstream version
Bram Moolenaar <Bram@vim.org>
parents: 20458
diff changeset
302 // Use a provided snprintf() function.
c15dd3da4f47 patch 8.2.0784: libvterm code lags behind the upstream version
Bram Moolenaar <Bram@vim.org>
parents: 20458
diff changeset
303 int SNPRINTF(char *str, size_t str_m, const char *fmt, ...);
c15dd3da4f47 patch 8.2.0784: libvterm code lags behind the upstream version
Bram Moolenaar <Bram@vim.org>
parents: 20458
diff changeset
304 # endif
11621
b8299e742f41 patch 8.0.0693: no terminal emulator support
Christian Brabandt <cb@256bit.org>
parents:
diff changeset
305 #endif
20460
c15dd3da4f47 patch 8.2.0784: libvterm code lags behind the upstream version
Bram Moolenaar <Bram@vim.org>
parents: 20458
diff changeset
306 #ifndef SNPRINTF
c15dd3da4f47 patch 8.2.0784: libvterm code lags behind the upstream version
Bram Moolenaar <Bram@vim.org>
parents: 20458
diff changeset
307 # define SNPRINTF snprintf
c15dd3da4f47 patch 8.2.0784: libvterm code lags behind the upstream version
Bram Moolenaar <Bram@vim.org>
parents: 20458
diff changeset
308 #endif
c15dd3da4f47 patch 8.2.0784: libvterm code lags behind the upstream version
Bram Moolenaar <Bram@vim.org>
parents: 20458
diff changeset
309
c15dd3da4f47 patch 8.2.0784: libvterm code lags behind the upstream version
Bram Moolenaar <Bram@vim.org>
parents: 20458
diff changeset
310
c15dd3da4f47 patch 8.2.0784: libvterm code lags behind the upstream version
Bram Moolenaar <Bram@vim.org>
parents: 20458
diff changeset
311 #endif