libghostty-py 0.1.0__py3-none-win_amd64.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- ghostty/__init__.py +8 -0
- ghostty/_cdef.py +3487 -0
- ghostty/_ffi.py +44 -0
- ghostty/_lib/libghostty-vt.dll +0 -0
- ghostty/_serialize.py +133 -0
- ghostty/core.py +203 -0
- libghostty_py-0.1.0.dist-info/METADATA +107 -0
- libghostty_py-0.1.0.dist-info/RECORD +12 -0
- libghostty_py-0.1.0.dist-info/WHEEL +5 -0
- libghostty_py-0.1.0.dist-info/licenses/LICENSE +202 -0
- libghostty_py-0.1.0.dist-info/licenses/LICENSE.ghostty +21 -0
- libghostty_py-0.1.0.dist-info/top_level.txt +1 -0
ghostty/_cdef.py
ADDED
|
@@ -0,0 +1,3487 @@
|
|
|
1
|
+
"Generated by gen_cdef.py from ghostty 6467b1dab. Do not edit."
|
|
2
|
+
|
|
3
|
+
CDEF = r'''
|
|
4
|
+
/* --- types.h --- */
|
|
5
|
+
|
|
6
|
+
typedef enum {
|
|
7
|
+
|
|
8
|
+
GHOSTTY_SUCCESS = 0,
|
|
9
|
+
|
|
10
|
+
GHOSTTY_OUT_OF_MEMORY = -1,
|
|
11
|
+
|
|
12
|
+
GHOSTTY_INVALID_VALUE = -2,
|
|
13
|
+
|
|
14
|
+
GHOSTTY_OUT_OF_SPACE = -3,
|
|
15
|
+
|
|
16
|
+
GHOSTTY_NO_VALUE = -4,
|
|
17
|
+
|
|
18
|
+
GHOSTTY_IO_ERROR = -5,
|
|
19
|
+
|
|
20
|
+
GHOSTTY_LIMIT_EXCEEDED = -6,
|
|
21
|
+
|
|
22
|
+
GHOSTTY_REJECTED = -7,
|
|
23
|
+
GHOSTTY_RESULT_MAX_VALUE = 0x7FFFFFFF,
|
|
24
|
+
} GhosttyResult;
|
|
25
|
+
|
|
26
|
+
typedef struct GhosttyTerminalImpl* GhosttyTerminal;
|
|
27
|
+
|
|
28
|
+
typedef struct GhosttySnapshotDecoderImpl* GhosttySnapshotDecoder;
|
|
29
|
+
|
|
30
|
+
typedef struct GhosttyTrackedGridRefImpl* GhosttyTrackedGridRef;
|
|
31
|
+
|
|
32
|
+
typedef struct GhosttyKittyGraphicsImpl* GhosttyKittyGraphics;
|
|
33
|
+
|
|
34
|
+
typedef const struct GhosttyKittyGraphicsImageImpl* GhosttyKittyGraphicsImage;
|
|
35
|
+
|
|
36
|
+
typedef struct GhosttyKittyGraphicsPlacementIteratorImpl* GhosttyKittyGraphicsPlacementIterator;
|
|
37
|
+
|
|
38
|
+
typedef struct GhosttyRenderStateImpl* GhosttyRenderState;
|
|
39
|
+
|
|
40
|
+
typedef struct GhosttyRenderStateRowIteratorImpl* GhosttyRenderStateRowIterator;
|
|
41
|
+
|
|
42
|
+
typedef struct GhosttyRenderStateRowCellsImpl* GhosttyRenderStateRowCells;
|
|
43
|
+
|
|
44
|
+
typedef struct GhosttySearchImpl* GhosttySearch;
|
|
45
|
+
|
|
46
|
+
typedef struct GhosttySgrParserImpl* GhosttySgrParser;
|
|
47
|
+
|
|
48
|
+
typedef struct GhosttyFormatterImpl* GhosttyFormatter;
|
|
49
|
+
|
|
50
|
+
typedef struct GhosttyOscParserImpl* GhosttyOscParser;
|
|
51
|
+
|
|
52
|
+
typedef struct GhosttyOscCommandImpl* GhosttyOscCommand;
|
|
53
|
+
|
|
54
|
+
typedef enum {
|
|
55
|
+
|
|
56
|
+
GHOSTTY_FORMATTER_FORMAT_PLAIN,
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
GHOSTTY_FORMATTER_FORMAT_VT,
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
GHOSTTY_FORMATTER_FORMAT_HTML,
|
|
63
|
+
GHOSTTY_FORMATTER_FORMAT_MAX_VALUE = 0x7FFFFFFF,
|
|
64
|
+
} GhosttyFormatterFormat;
|
|
65
|
+
|
|
66
|
+
typedef struct {
|
|
67
|
+
|
|
68
|
+
const uint8_t* ptr;
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
size_t len;
|
|
72
|
+
} GhosttyString;
|
|
73
|
+
|
|
74
|
+
typedef struct {
|
|
75
|
+
|
|
76
|
+
uint8_t* ptr;
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
size_t cap;
|
|
80
|
+
|
|
81
|
+
|
|
82
|
+
size_t len;
|
|
83
|
+
} GhosttyBuffer;
|
|
84
|
+
|
|
85
|
+
typedef struct {
|
|
86
|
+
|
|
87
|
+
double x;
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
double y;
|
|
91
|
+
} GhosttySurfacePosition;
|
|
92
|
+
|
|
93
|
+
typedef struct {
|
|
94
|
+
|
|
95
|
+
const uint32_t* ptr;
|
|
96
|
+
|
|
97
|
+
|
|
98
|
+
size_t len;
|
|
99
|
+
} GhosttyCodepoints;
|
|
100
|
+
|
|
101
|
+
const char *ghostty_type_json(void);
|
|
102
|
+
|
|
103
|
+
/* --- allocator.h --- */
|
|
104
|
+
|
|
105
|
+
typedef struct {
|
|
106
|
+
|
|
107
|
+
void* (*alloc)(void *ctx, size_t len, uint8_t alignment, uintptr_t ret_addr);
|
|
108
|
+
|
|
109
|
+
|
|
110
|
+
bool (*resize)(void *ctx, void *memory, size_t memory_len, uint8_t alignment, size_t new_len, uintptr_t ret_addr);
|
|
111
|
+
|
|
112
|
+
|
|
113
|
+
void* (*remap)(void *ctx, void *memory, size_t memory_len, uint8_t alignment, size_t new_len, uintptr_t ret_addr);
|
|
114
|
+
|
|
115
|
+
|
|
116
|
+
void (*free)(void *ctx, void *memory, size_t memory_len, uint8_t alignment, uintptr_t ret_addr);
|
|
117
|
+
} GhosttyAllocatorVtable;
|
|
118
|
+
|
|
119
|
+
typedef struct GhosttyAllocator {
|
|
120
|
+
|
|
121
|
+
void *ctx;
|
|
122
|
+
|
|
123
|
+
|
|
124
|
+
const GhosttyAllocatorVtable *vtable;
|
|
125
|
+
} GhosttyAllocator;
|
|
126
|
+
|
|
127
|
+
uint8_t* ghostty_alloc(const GhosttyAllocator* allocator, size_t len);
|
|
128
|
+
|
|
129
|
+
void ghostty_free(const GhosttyAllocator* allocator, uint8_t* ptr, size_t len);
|
|
130
|
+
|
|
131
|
+
/* --- build_info.h --- */
|
|
132
|
+
|
|
133
|
+
typedef enum {
|
|
134
|
+
GHOSTTY_OPTIMIZE_DEBUG = 0,
|
|
135
|
+
GHOSTTY_OPTIMIZE_RELEASE_SAFE = 1,
|
|
136
|
+
GHOSTTY_OPTIMIZE_RELEASE_SMALL = 2,
|
|
137
|
+
GHOSTTY_OPTIMIZE_RELEASE_FAST = 3,
|
|
138
|
+
GHOSTTY_OPTIMIZE_MODE_MAX_VALUE = 0x7FFFFFFF,
|
|
139
|
+
} GhosttyOptimizeMode;
|
|
140
|
+
|
|
141
|
+
typedef enum {
|
|
142
|
+
|
|
143
|
+
GHOSTTY_BUILD_INFO_INVALID = 0,
|
|
144
|
+
|
|
145
|
+
|
|
146
|
+
GHOSTTY_BUILD_INFO_SIMD = 1,
|
|
147
|
+
|
|
148
|
+
|
|
149
|
+
GHOSTTY_BUILD_INFO_KITTY_GRAPHICS = 2,
|
|
150
|
+
|
|
151
|
+
|
|
152
|
+
GHOSTTY_BUILD_INFO_TMUX_CONTROL_MODE = 3,
|
|
153
|
+
|
|
154
|
+
|
|
155
|
+
GHOSTTY_BUILD_INFO_OPTIMIZE = 4,
|
|
156
|
+
|
|
157
|
+
|
|
158
|
+
GHOSTTY_BUILD_INFO_VERSION_STRING = 5,
|
|
159
|
+
|
|
160
|
+
|
|
161
|
+
GHOSTTY_BUILD_INFO_VERSION_MAJOR = 6,
|
|
162
|
+
|
|
163
|
+
|
|
164
|
+
GHOSTTY_BUILD_INFO_VERSION_MINOR = 7,
|
|
165
|
+
|
|
166
|
+
|
|
167
|
+
GHOSTTY_BUILD_INFO_VERSION_PATCH = 8,
|
|
168
|
+
|
|
169
|
+
|
|
170
|
+
GHOSTTY_BUILD_INFO_VERSION_PRE = 9,
|
|
171
|
+
|
|
172
|
+
|
|
173
|
+
GHOSTTY_BUILD_INFO_VERSION_BUILD = 10,
|
|
174
|
+
GHOSTTY_BUILD_INFO_MAX_VALUE = 0x7FFFFFFF,
|
|
175
|
+
} GhosttyBuildInfo;
|
|
176
|
+
|
|
177
|
+
GhosttyResult ghostty_build_info(GhosttyBuildInfo data, void *out);
|
|
178
|
+
|
|
179
|
+
/* --- color.h --- */
|
|
180
|
+
|
|
181
|
+
typedef struct {
|
|
182
|
+
uint8_t r;
|
|
183
|
+
uint8_t g;
|
|
184
|
+
uint8_t b;
|
|
185
|
+
} GhosttyColorRgb;
|
|
186
|
+
|
|
187
|
+
typedef uint8_t GhosttyColorPaletteIndex;
|
|
188
|
+
|
|
189
|
+
typedef struct {
|
|
190
|
+
uint64_t bits[4];
|
|
191
|
+
} GhosttyColorPaletteMask;
|
|
192
|
+
|
|
193
|
+
typedef struct {
|
|
194
|
+
|
|
195
|
+
const char* name;
|
|
196
|
+
|
|
197
|
+
GhosttyColorRgb color;
|
|
198
|
+
} GhosttyColorX11Entry;
|
|
199
|
+
|
|
200
|
+
void ghostty_color_rgb_get(const GhosttyColorRgb* color,
|
|
201
|
+
uint8_t* r,
|
|
202
|
+
uint8_t* g,
|
|
203
|
+
uint8_t* b);
|
|
204
|
+
|
|
205
|
+
GhosttyResult ghostty_color_parse_x11(
|
|
206
|
+
const char* name,
|
|
207
|
+
size_t len,
|
|
208
|
+
GhosttyColorRgb* out);
|
|
209
|
+
|
|
210
|
+
GhosttyResult ghostty_color_parse(
|
|
211
|
+
const char* value,
|
|
212
|
+
size_t len,
|
|
213
|
+
GhosttyColorRgb* out);
|
|
214
|
+
|
|
215
|
+
GhosttyResult ghostty_color_parse_palette_entry(
|
|
216
|
+
const char* value,
|
|
217
|
+
size_t len,
|
|
218
|
+
uint8_t* out_index,
|
|
219
|
+
GhosttyColorRgb* out_rgb);
|
|
220
|
+
|
|
221
|
+
void ghostty_color_palette_default(GhosttyColorRgb* out);
|
|
222
|
+
|
|
223
|
+
void ghostty_color_palette_generate(
|
|
224
|
+
const GhosttyColorRgb* base,
|
|
225
|
+
const GhosttyColorPaletteMask* skip,
|
|
226
|
+
const GhosttyColorRgb* bg,
|
|
227
|
+
const GhosttyColorRgb* fg,
|
|
228
|
+
bool harmonious,
|
|
229
|
+
GhosttyColorRgb* out);
|
|
230
|
+
|
|
231
|
+
double ghostty_color_luminance(const GhosttyColorRgb* color);
|
|
232
|
+
|
|
233
|
+
double ghostty_color_perceived_luminance(const GhosttyColorRgb* color);
|
|
234
|
+
|
|
235
|
+
double ghostty_color_contrast(const GhosttyColorRgb* a,
|
|
236
|
+
const GhosttyColorRgb* b);
|
|
237
|
+
|
|
238
|
+
const GhosttyColorX11Entry* ghostty_color_x11_names(void);
|
|
239
|
+
|
|
240
|
+
size_t ghostty_color_x11_name_count(void);
|
|
241
|
+
|
|
242
|
+
/* --- device.h --- */
|
|
243
|
+
|
|
244
|
+
typedef enum {
|
|
245
|
+
GHOSTTY_COLOR_SCHEME_LIGHT = 0,
|
|
246
|
+
GHOSTTY_COLOR_SCHEME_DARK = 1,
|
|
247
|
+
GHOSTTY_COLOR_SCHEME_MAX_VALUE = 0x7FFFFFFF,
|
|
248
|
+
} GhosttyColorScheme;
|
|
249
|
+
|
|
250
|
+
typedef struct {
|
|
251
|
+
|
|
252
|
+
uint16_t conformance_level;
|
|
253
|
+
|
|
254
|
+
|
|
255
|
+
uint16_t features[64];
|
|
256
|
+
|
|
257
|
+
|
|
258
|
+
size_t num_features;
|
|
259
|
+
} GhosttyDeviceAttributesPrimary;
|
|
260
|
+
|
|
261
|
+
typedef struct {
|
|
262
|
+
|
|
263
|
+
uint16_t device_type;
|
|
264
|
+
|
|
265
|
+
|
|
266
|
+
uint16_t firmware_version;
|
|
267
|
+
|
|
268
|
+
|
|
269
|
+
uint16_t rom_cartridge;
|
|
270
|
+
} GhosttyDeviceAttributesSecondary;
|
|
271
|
+
|
|
272
|
+
typedef struct {
|
|
273
|
+
|
|
274
|
+
uint32_t unit_id;
|
|
275
|
+
} GhosttyDeviceAttributesTertiary;
|
|
276
|
+
|
|
277
|
+
typedef struct {
|
|
278
|
+
GhosttyDeviceAttributesPrimary primary;
|
|
279
|
+
GhosttyDeviceAttributesSecondary secondary;
|
|
280
|
+
GhosttyDeviceAttributesTertiary tertiary;
|
|
281
|
+
} GhosttyDeviceAttributes;
|
|
282
|
+
|
|
283
|
+
/* --- color_scheme.h --- */
|
|
284
|
+
|
|
285
|
+
GhosttyResult ghostty_color_scheme_report_encode(
|
|
286
|
+
GhosttyColorScheme scheme,
|
|
287
|
+
char* buf,
|
|
288
|
+
size_t buf_len,
|
|
289
|
+
size_t* out_written);
|
|
290
|
+
|
|
291
|
+
/* --- focus.h --- */
|
|
292
|
+
|
|
293
|
+
typedef enum {
|
|
294
|
+
|
|
295
|
+
GHOSTTY_FOCUS_GAINED = 0,
|
|
296
|
+
|
|
297
|
+
GHOSTTY_FOCUS_LOST = 1,
|
|
298
|
+
GHOSTTY_FOCUS_MAX_VALUE = 0x7FFFFFFF,
|
|
299
|
+
} GhosttyFocusEvent;
|
|
300
|
+
|
|
301
|
+
GhosttyResult ghostty_focus_encode(
|
|
302
|
+
GhosttyFocusEvent event,
|
|
303
|
+
char* buf,
|
|
304
|
+
size_t buf_len,
|
|
305
|
+
size_t* out_written);
|
|
306
|
+
|
|
307
|
+
/* --- io.h --- */
|
|
308
|
+
|
|
309
|
+
typedef bool (*GhosttyReaderFn)(
|
|
310
|
+
void* userdata,
|
|
311
|
+
uint8_t* buffer,
|
|
312
|
+
size_t capacity,
|
|
313
|
+
size_t* out_read);
|
|
314
|
+
|
|
315
|
+
typedef bool (*GhosttyWriterFn)(
|
|
316
|
+
void* userdata,
|
|
317
|
+
const uint8_t* data,
|
|
318
|
+
size_t len);
|
|
319
|
+
|
|
320
|
+
typedef struct {
|
|
321
|
+
GhosttyReaderFn read;
|
|
322
|
+
void* userdata;
|
|
323
|
+
} GhosttyReader;
|
|
324
|
+
|
|
325
|
+
typedef struct {
|
|
326
|
+
GhosttyWriterFn write;
|
|
327
|
+
void* userdata;
|
|
328
|
+
} GhosttyWriter;
|
|
329
|
+
|
|
330
|
+
typedef bool (*GhosttyMimeReaderFn)(
|
|
331
|
+
void* userdata,
|
|
332
|
+
GhosttyString mime,
|
|
333
|
+
GhosttyWriter writer);
|
|
334
|
+
|
|
335
|
+
typedef struct {
|
|
336
|
+
GhosttyMimeReaderFn read;
|
|
337
|
+
void* userdata;
|
|
338
|
+
} GhosttyMimeReader;
|
|
339
|
+
|
|
340
|
+
/* --- screen.h --- */
|
|
341
|
+
|
|
342
|
+
typedef uint64_t GhosttyCell;
|
|
343
|
+
|
|
344
|
+
typedef uint64_t GhosttyRow;
|
|
345
|
+
|
|
346
|
+
typedef struct {
|
|
347
|
+
|
|
348
|
+
const GhosttyCell* ptr;
|
|
349
|
+
|
|
350
|
+
|
|
351
|
+
size_t len;
|
|
352
|
+
} GhosttyCellsView;
|
|
353
|
+
|
|
354
|
+
typedef enum {
|
|
355
|
+
|
|
356
|
+
GHOSTTY_CELL_CONTENT_CODEPOINT = 0,
|
|
357
|
+
|
|
358
|
+
|
|
359
|
+
GHOSTTY_CELL_CONTENT_CODEPOINT_GRAPHEME = 1,
|
|
360
|
+
|
|
361
|
+
|
|
362
|
+
GHOSTTY_CELL_CONTENT_BG_COLOR_PALETTE = 2,
|
|
363
|
+
|
|
364
|
+
|
|
365
|
+
GHOSTTY_CELL_CONTENT_BG_COLOR_RGB = 3,
|
|
366
|
+
GHOSTTY_CELL_CONTENT_TAG_MAX_VALUE = 0x7FFFFFFF,
|
|
367
|
+
} GhosttyCellContentTag;
|
|
368
|
+
|
|
369
|
+
typedef enum {
|
|
370
|
+
|
|
371
|
+
GHOSTTY_CELL_WIDE_NARROW = 0,
|
|
372
|
+
|
|
373
|
+
|
|
374
|
+
GHOSTTY_CELL_WIDE_WIDE = 1,
|
|
375
|
+
|
|
376
|
+
|
|
377
|
+
GHOSTTY_CELL_WIDE_SPACER_TAIL = 2,
|
|
378
|
+
|
|
379
|
+
|
|
380
|
+
GHOSTTY_CELL_WIDE_SPACER_HEAD = 3,
|
|
381
|
+
GHOSTTY_CELL_WIDE_MAX_VALUE = 0x7FFFFFFF,
|
|
382
|
+
} GhosttyCellWide;
|
|
383
|
+
|
|
384
|
+
typedef enum {
|
|
385
|
+
|
|
386
|
+
GHOSTTY_CELL_SEMANTIC_OUTPUT = 0,
|
|
387
|
+
|
|
388
|
+
|
|
389
|
+
GHOSTTY_CELL_SEMANTIC_INPUT = 1,
|
|
390
|
+
|
|
391
|
+
|
|
392
|
+
GHOSTTY_CELL_SEMANTIC_PROMPT = 2,
|
|
393
|
+
GHOSTTY_CELL_SEMANTIC_MAX_VALUE = 0x7FFFFFFF,
|
|
394
|
+
} GhosttyCellSemanticContent;
|
|
395
|
+
|
|
396
|
+
typedef enum {
|
|
397
|
+
|
|
398
|
+
GHOSTTY_CELL_DATA_INVALID = 0,
|
|
399
|
+
|
|
400
|
+
|
|
401
|
+
GHOSTTY_CELL_DATA_CODEPOINT = 1,
|
|
402
|
+
|
|
403
|
+
|
|
404
|
+
GHOSTTY_CELL_DATA_CONTENT_TAG = 2,
|
|
405
|
+
|
|
406
|
+
|
|
407
|
+
GHOSTTY_CELL_DATA_WIDE = 3,
|
|
408
|
+
|
|
409
|
+
|
|
410
|
+
GHOSTTY_CELL_DATA_HAS_TEXT = 4,
|
|
411
|
+
|
|
412
|
+
|
|
413
|
+
GHOSTTY_CELL_DATA_HAS_STYLING = 5,
|
|
414
|
+
|
|
415
|
+
|
|
416
|
+
GHOSTTY_CELL_DATA_STYLE_ID = 6,
|
|
417
|
+
|
|
418
|
+
|
|
419
|
+
GHOSTTY_CELL_DATA_HAS_HYPERLINK = 7,
|
|
420
|
+
|
|
421
|
+
|
|
422
|
+
GHOSTTY_CELL_DATA_PROTECTED = 8,
|
|
423
|
+
|
|
424
|
+
|
|
425
|
+
GHOSTTY_CELL_DATA_SEMANTIC_CONTENT = 9,
|
|
426
|
+
|
|
427
|
+
|
|
428
|
+
GHOSTTY_CELL_DATA_COLOR_PALETTE = 10,
|
|
429
|
+
|
|
430
|
+
|
|
431
|
+
GHOSTTY_CELL_DATA_COLOR_RGB = 11,
|
|
432
|
+
GHOSTTY_CELL_DATA_MAX_VALUE = 0x7FFFFFFF,
|
|
433
|
+
} GhosttyCellData;
|
|
434
|
+
|
|
435
|
+
typedef enum {
|
|
436
|
+
|
|
437
|
+
GHOSTTY_ROW_SEMANTIC_NONE = 0,
|
|
438
|
+
|
|
439
|
+
|
|
440
|
+
GHOSTTY_ROW_SEMANTIC_PROMPT = 1,
|
|
441
|
+
|
|
442
|
+
|
|
443
|
+
GHOSTTY_ROW_SEMANTIC_PROMPT_CONTINUATION = 2,
|
|
444
|
+
GHOSTTY_ROW_SEMANTIC_MAX_VALUE = 0x7FFFFFFF,
|
|
445
|
+
} GhosttyRowSemanticPrompt;
|
|
446
|
+
|
|
447
|
+
typedef enum {
|
|
448
|
+
|
|
449
|
+
GHOSTTY_ROW_DATA_INVALID = 0,
|
|
450
|
+
|
|
451
|
+
|
|
452
|
+
GHOSTTY_ROW_DATA_WRAP = 1,
|
|
453
|
+
|
|
454
|
+
|
|
455
|
+
GHOSTTY_ROW_DATA_WRAP_CONTINUATION = 2,
|
|
456
|
+
|
|
457
|
+
|
|
458
|
+
GHOSTTY_ROW_DATA_GRAPHEME = 3,
|
|
459
|
+
|
|
460
|
+
|
|
461
|
+
GHOSTTY_ROW_DATA_STYLED = 4,
|
|
462
|
+
|
|
463
|
+
|
|
464
|
+
GHOSTTY_ROW_DATA_HYPERLINK = 5,
|
|
465
|
+
|
|
466
|
+
|
|
467
|
+
GHOSTTY_ROW_DATA_SEMANTIC_PROMPT = 6,
|
|
468
|
+
|
|
469
|
+
|
|
470
|
+
GHOSTTY_ROW_DATA_KITTY_VIRTUAL_PLACEHOLDER = 7,
|
|
471
|
+
|
|
472
|
+
|
|
473
|
+
GHOSTTY_ROW_DATA_DIRTY = 8,
|
|
474
|
+
GHOSTTY_ROW_DATA_MAX_VALUE = 0x7FFFFFFF,
|
|
475
|
+
} GhosttyRowData;
|
|
476
|
+
|
|
477
|
+
GhosttyResult ghostty_cell_get(GhosttyCell cell,
|
|
478
|
+
GhosttyCellData data,
|
|
479
|
+
void *out);
|
|
480
|
+
|
|
481
|
+
GhosttyResult ghostty_cell_get_multi(GhosttyCell cell,
|
|
482
|
+
size_t count,
|
|
483
|
+
const GhosttyCellData* keys,
|
|
484
|
+
void** values,
|
|
485
|
+
size_t* out_written);
|
|
486
|
+
|
|
487
|
+
GhosttyResult ghostty_row_get(GhosttyRow row,
|
|
488
|
+
GhosttyRowData data,
|
|
489
|
+
void *out);
|
|
490
|
+
|
|
491
|
+
GhosttyResult ghostty_row_get_multi(GhosttyRow row,
|
|
492
|
+
size_t count,
|
|
493
|
+
const GhosttyRowData* keys,
|
|
494
|
+
void** values,
|
|
495
|
+
size_t* out_written);
|
|
496
|
+
|
|
497
|
+
/* --- style.h --- */
|
|
498
|
+
|
|
499
|
+
typedef uint16_t GhosttyStyleId;
|
|
500
|
+
|
|
501
|
+
typedef enum {
|
|
502
|
+
GHOSTTY_STYLE_COLOR_NONE = 0,
|
|
503
|
+
GHOSTTY_STYLE_COLOR_PALETTE = 1,
|
|
504
|
+
GHOSTTY_STYLE_COLOR_RGB = 2,
|
|
505
|
+
GHOSTTY_STYLE_COLOR_TAG_MAX_VALUE = 0x7FFFFFFF,
|
|
506
|
+
} GhosttyStyleColorTag;
|
|
507
|
+
|
|
508
|
+
typedef union {
|
|
509
|
+
GhosttyColorPaletteIndex palette;
|
|
510
|
+
GhosttyColorRgb rgb;
|
|
511
|
+
uint64_t _padding;
|
|
512
|
+
} GhosttyStyleColorValue;
|
|
513
|
+
|
|
514
|
+
typedef struct {
|
|
515
|
+
GhosttyStyleColorTag tag;
|
|
516
|
+
GhosttyStyleColorValue value;
|
|
517
|
+
} GhosttyStyleColor;
|
|
518
|
+
|
|
519
|
+
typedef struct {
|
|
520
|
+
size_t size;
|
|
521
|
+
GhosttyStyleColor fg_color;
|
|
522
|
+
GhosttyStyleColor bg_color;
|
|
523
|
+
GhosttyStyleColor underline_color;
|
|
524
|
+
bool bold;
|
|
525
|
+
bool italic;
|
|
526
|
+
bool faint;
|
|
527
|
+
bool blink;
|
|
528
|
+
bool inverse;
|
|
529
|
+
bool invisible;
|
|
530
|
+
bool strikethrough;
|
|
531
|
+
bool overline;
|
|
532
|
+
int underline;
|
|
533
|
+
} GhosttyStyle;
|
|
534
|
+
|
|
535
|
+
void ghostty_style_default(GhosttyStyle* style);
|
|
536
|
+
|
|
537
|
+
bool ghostty_style_is_default(const GhosttyStyle* style);
|
|
538
|
+
|
|
539
|
+
/* --- grid_ref.h --- */
|
|
540
|
+
|
|
541
|
+
typedef struct {
|
|
542
|
+
size_t size;
|
|
543
|
+
void *node;
|
|
544
|
+
uint16_t x;
|
|
545
|
+
uint16_t y;
|
|
546
|
+
} GhosttyGridRef;
|
|
547
|
+
|
|
548
|
+
GhosttyResult ghostty_grid_ref_cell(const GhosttyGridRef *ref,
|
|
549
|
+
GhosttyCell *out_cell);
|
|
550
|
+
|
|
551
|
+
GhosttyResult ghostty_grid_ref_row(const GhosttyGridRef *ref,
|
|
552
|
+
GhosttyRow *out_row);
|
|
553
|
+
|
|
554
|
+
GhosttyResult ghostty_grid_ref_graphemes(const GhosttyGridRef *ref,
|
|
555
|
+
uint32_t *buf,
|
|
556
|
+
size_t buf_len,
|
|
557
|
+
size_t *out_len);
|
|
558
|
+
|
|
559
|
+
GhosttyResult ghostty_grid_ref_hyperlink_uri(
|
|
560
|
+
const GhosttyGridRef *ref,
|
|
561
|
+
uint8_t *buf,
|
|
562
|
+
size_t buf_len,
|
|
563
|
+
size_t *out_len);
|
|
564
|
+
|
|
565
|
+
GhosttyResult ghostty_grid_ref_style(const GhosttyGridRef *ref,
|
|
566
|
+
GhosttyStyle *out_style);
|
|
567
|
+
|
|
568
|
+
/* --- point.h --- */
|
|
569
|
+
|
|
570
|
+
typedef struct {
|
|
571
|
+
|
|
572
|
+
uint16_t x;
|
|
573
|
+
|
|
574
|
+
|
|
575
|
+
uint32_t y;
|
|
576
|
+
} GhosttyPointCoordinate;
|
|
577
|
+
|
|
578
|
+
typedef enum {
|
|
579
|
+
|
|
580
|
+
GHOSTTY_POINT_TAG_ACTIVE = 0,
|
|
581
|
+
|
|
582
|
+
|
|
583
|
+
GHOSTTY_POINT_TAG_VIEWPORT = 1,
|
|
584
|
+
|
|
585
|
+
|
|
586
|
+
GHOSTTY_POINT_TAG_SCREEN = 2,
|
|
587
|
+
|
|
588
|
+
|
|
589
|
+
GHOSTTY_POINT_TAG_HISTORY = 3,
|
|
590
|
+
GHOSTTY_POINT_TAG_MAX_VALUE = 0x7FFFFFFF,
|
|
591
|
+
} GhosttyPointTag;
|
|
592
|
+
|
|
593
|
+
typedef union {
|
|
594
|
+
|
|
595
|
+
GhosttyPointCoordinate coordinate;
|
|
596
|
+
|
|
597
|
+
|
|
598
|
+
uint64_t _padding[2];
|
|
599
|
+
} GhosttyPointValue;
|
|
600
|
+
|
|
601
|
+
typedef struct {
|
|
602
|
+
GhosttyPointTag tag;
|
|
603
|
+
GhosttyPointValue value;
|
|
604
|
+
} GhosttyPoint;
|
|
605
|
+
|
|
606
|
+
/* --- selection.h --- */
|
|
607
|
+
|
|
608
|
+
typedef struct GhosttySelectionGestureImpl* GhosttySelectionGesture;
|
|
609
|
+
|
|
610
|
+
typedef struct GhosttySelectionGestureEventImpl* GhosttySelectionGestureEvent;
|
|
611
|
+
|
|
612
|
+
typedef struct {
|
|
613
|
+
|
|
614
|
+
size_t size;
|
|
615
|
+
|
|
616
|
+
|
|
617
|
+
GhosttyGridRef start;
|
|
618
|
+
|
|
619
|
+
|
|
620
|
+
GhosttyGridRef end;
|
|
621
|
+
|
|
622
|
+
|
|
623
|
+
bool rectangle;
|
|
624
|
+
} GhosttySelection;
|
|
625
|
+
|
|
626
|
+
typedef struct {
|
|
627
|
+
|
|
628
|
+
GhosttySelection* ptr;
|
|
629
|
+
|
|
630
|
+
|
|
631
|
+
size_t cap;
|
|
632
|
+
|
|
633
|
+
|
|
634
|
+
size_t len;
|
|
635
|
+
} GhosttySelectionBuffer;
|
|
636
|
+
|
|
637
|
+
typedef struct {
|
|
638
|
+
|
|
639
|
+
size_t size;
|
|
640
|
+
|
|
641
|
+
|
|
642
|
+
GhosttyGridRef ref;
|
|
643
|
+
|
|
644
|
+
|
|
645
|
+
const uint32_t* boundary_codepoints;
|
|
646
|
+
|
|
647
|
+
|
|
648
|
+
size_t boundary_codepoints_len;
|
|
649
|
+
} GhosttyTerminalSelectWordOptions;
|
|
650
|
+
|
|
651
|
+
typedef struct {
|
|
652
|
+
|
|
653
|
+
size_t size;
|
|
654
|
+
|
|
655
|
+
|
|
656
|
+
GhosttyGridRef start;
|
|
657
|
+
|
|
658
|
+
|
|
659
|
+
GhosttyGridRef end;
|
|
660
|
+
|
|
661
|
+
|
|
662
|
+
const uint32_t* boundary_codepoints;
|
|
663
|
+
|
|
664
|
+
|
|
665
|
+
size_t boundary_codepoints_len;
|
|
666
|
+
} GhosttyTerminalSelectWordBetweenOptions;
|
|
667
|
+
|
|
668
|
+
typedef struct {
|
|
669
|
+
|
|
670
|
+
size_t size;
|
|
671
|
+
|
|
672
|
+
|
|
673
|
+
GhosttyGridRef ref;
|
|
674
|
+
|
|
675
|
+
|
|
676
|
+
const uint32_t* whitespace;
|
|
677
|
+
|
|
678
|
+
|
|
679
|
+
size_t whitespace_len;
|
|
680
|
+
|
|
681
|
+
|
|
682
|
+
bool semantic_prompt_boundary;
|
|
683
|
+
} GhosttyTerminalSelectLineOptions;
|
|
684
|
+
|
|
685
|
+
typedef struct {
|
|
686
|
+
|
|
687
|
+
size_t size;
|
|
688
|
+
|
|
689
|
+
|
|
690
|
+
GhosttyFormatterFormat emit;
|
|
691
|
+
|
|
692
|
+
|
|
693
|
+
bool unwrap;
|
|
694
|
+
|
|
695
|
+
|
|
696
|
+
bool trim;
|
|
697
|
+
|
|
698
|
+
|
|
699
|
+
const GhosttySelection *selection;
|
|
700
|
+
} GhosttyTerminalSelectionFormatOptions;
|
|
701
|
+
|
|
702
|
+
typedef enum {
|
|
703
|
+
|
|
704
|
+
GHOSTTY_SELECTION_ORDER_FORWARD = 0,
|
|
705
|
+
|
|
706
|
+
|
|
707
|
+
GHOSTTY_SELECTION_ORDER_REVERSE = 1,
|
|
708
|
+
|
|
709
|
+
|
|
710
|
+
GHOSTTY_SELECTION_ORDER_MIRRORED_FORWARD = 2,
|
|
711
|
+
|
|
712
|
+
|
|
713
|
+
GHOSTTY_SELECTION_ORDER_MIRRORED_REVERSE = 3,
|
|
714
|
+
|
|
715
|
+
GHOSTTY_SELECTION_ORDER_MAX_VALUE = 0x7FFFFFFF,
|
|
716
|
+
} GhosttySelectionOrder;
|
|
717
|
+
|
|
718
|
+
typedef enum {
|
|
719
|
+
|
|
720
|
+
GHOSTTY_SELECTION_ADJUST_LEFT = 0,
|
|
721
|
+
|
|
722
|
+
|
|
723
|
+
GHOSTTY_SELECTION_ADJUST_RIGHT = 1,
|
|
724
|
+
|
|
725
|
+
|
|
726
|
+
GHOSTTY_SELECTION_ADJUST_UP = 2,
|
|
727
|
+
|
|
728
|
+
|
|
729
|
+
GHOSTTY_SELECTION_ADJUST_DOWN = 3,
|
|
730
|
+
|
|
731
|
+
|
|
732
|
+
GHOSTTY_SELECTION_ADJUST_HOME = 4,
|
|
733
|
+
|
|
734
|
+
|
|
735
|
+
GHOSTTY_SELECTION_ADJUST_END = 5,
|
|
736
|
+
|
|
737
|
+
|
|
738
|
+
GHOSTTY_SELECTION_ADJUST_PAGE_UP = 6,
|
|
739
|
+
|
|
740
|
+
|
|
741
|
+
GHOSTTY_SELECTION_ADJUST_PAGE_DOWN = 7,
|
|
742
|
+
|
|
743
|
+
|
|
744
|
+
GHOSTTY_SELECTION_ADJUST_BEGINNING_OF_LINE = 8,
|
|
745
|
+
|
|
746
|
+
|
|
747
|
+
GHOSTTY_SELECTION_ADJUST_END_OF_LINE = 9,
|
|
748
|
+
|
|
749
|
+
GHOSTTY_SELECTION_ADJUST_MAX_VALUE = 0x7FFFFFFF,
|
|
750
|
+
} GhosttySelectionAdjust;
|
|
751
|
+
|
|
752
|
+
typedef enum {
|
|
753
|
+
|
|
754
|
+
GHOSTTY_SELECTION_GESTURE_BEHAVIOR_CELL = 0,
|
|
755
|
+
|
|
756
|
+
|
|
757
|
+
GHOSTTY_SELECTION_GESTURE_BEHAVIOR_WORD = 1,
|
|
758
|
+
|
|
759
|
+
|
|
760
|
+
GHOSTTY_SELECTION_GESTURE_BEHAVIOR_LINE = 2,
|
|
761
|
+
|
|
762
|
+
|
|
763
|
+
GHOSTTY_SELECTION_GESTURE_BEHAVIOR_OUTPUT = 3,
|
|
764
|
+
|
|
765
|
+
GHOSTTY_SELECTION_GESTURE_BEHAVIOR_MAX_VALUE = 0x7FFFFFFF,
|
|
766
|
+
} GhosttySelectionGestureBehavior;
|
|
767
|
+
|
|
768
|
+
typedef struct {
|
|
769
|
+
|
|
770
|
+
GhosttySelectionGestureBehavior single_click;
|
|
771
|
+
|
|
772
|
+
|
|
773
|
+
GhosttySelectionGestureBehavior double_click;
|
|
774
|
+
|
|
775
|
+
|
|
776
|
+
GhosttySelectionGestureBehavior triple_click;
|
|
777
|
+
} GhosttySelectionGestureBehaviors;
|
|
778
|
+
|
|
779
|
+
typedef struct {
|
|
780
|
+
|
|
781
|
+
uint32_t columns;
|
|
782
|
+
|
|
783
|
+
|
|
784
|
+
uint32_t cell_width;
|
|
785
|
+
|
|
786
|
+
|
|
787
|
+
uint32_t padding_left;
|
|
788
|
+
|
|
789
|
+
|
|
790
|
+
uint32_t screen_height;
|
|
791
|
+
} GhosttySelectionGestureGeometry;
|
|
792
|
+
|
|
793
|
+
typedef enum {
|
|
794
|
+
|
|
795
|
+
GHOSTTY_SELECTION_GESTURE_AUTOSCROLL_NONE = 0,
|
|
796
|
+
|
|
797
|
+
|
|
798
|
+
GHOSTTY_SELECTION_GESTURE_AUTOSCROLL_UP = 1,
|
|
799
|
+
|
|
800
|
+
|
|
801
|
+
GHOSTTY_SELECTION_GESTURE_AUTOSCROLL_DOWN = 2,
|
|
802
|
+
|
|
803
|
+
GHOSTTY_SELECTION_GESTURE_AUTOSCROLL_MAX_VALUE = 0x7FFFFFFF,
|
|
804
|
+
} GhosttySelectionGestureAutoscroll;
|
|
805
|
+
|
|
806
|
+
typedef enum {
|
|
807
|
+
|
|
808
|
+
GHOSTTY_SELECTION_GESTURE_DATA_CLICK_COUNT = 0,
|
|
809
|
+
|
|
810
|
+
|
|
811
|
+
GHOSTTY_SELECTION_GESTURE_DATA_DRAGGED = 1,
|
|
812
|
+
|
|
813
|
+
|
|
814
|
+
GHOSTTY_SELECTION_GESTURE_DATA_AUTOSCROLL = 2,
|
|
815
|
+
|
|
816
|
+
|
|
817
|
+
GHOSTTY_SELECTION_GESTURE_DATA_BEHAVIOR = 3,
|
|
818
|
+
|
|
819
|
+
|
|
820
|
+
GHOSTTY_SELECTION_GESTURE_DATA_ANCHOR = 4,
|
|
821
|
+
|
|
822
|
+
GHOSTTY_SELECTION_GESTURE_DATA_MAX_VALUE = 0x7FFFFFFF,
|
|
823
|
+
} GhosttySelectionGestureData;
|
|
824
|
+
|
|
825
|
+
typedef enum {
|
|
826
|
+
|
|
827
|
+
GHOSTTY_SELECTION_GESTURE_EVENT_TYPE_PRESS = 0,
|
|
828
|
+
|
|
829
|
+
|
|
830
|
+
GHOSTTY_SELECTION_GESTURE_EVENT_TYPE_RELEASE = 1,
|
|
831
|
+
|
|
832
|
+
|
|
833
|
+
GHOSTTY_SELECTION_GESTURE_EVENT_TYPE_DRAG = 2,
|
|
834
|
+
|
|
835
|
+
|
|
836
|
+
GHOSTTY_SELECTION_GESTURE_EVENT_TYPE_AUTOSCROLL_TICK = 3,
|
|
837
|
+
|
|
838
|
+
|
|
839
|
+
GHOSTTY_SELECTION_GESTURE_EVENT_TYPE_DEEP_PRESS = 4,
|
|
840
|
+
|
|
841
|
+
GHOSTTY_SELECTION_GESTURE_EVENT_TYPE_MAX_VALUE = 0x7FFFFFFF,
|
|
842
|
+
} GhosttySelectionGestureEventType;
|
|
843
|
+
|
|
844
|
+
typedef enum {
|
|
845
|
+
|
|
846
|
+
GHOSTTY_SELECTION_GESTURE_EVENT_OPT_REF = 0,
|
|
847
|
+
|
|
848
|
+
|
|
849
|
+
GHOSTTY_SELECTION_GESTURE_EVENT_OPT_POSITION = 1,
|
|
850
|
+
|
|
851
|
+
|
|
852
|
+
GHOSTTY_SELECTION_GESTURE_EVENT_OPT_REPEAT_DISTANCE = 2,
|
|
853
|
+
|
|
854
|
+
|
|
855
|
+
GHOSTTY_SELECTION_GESTURE_EVENT_OPT_TIME_NS = 3,
|
|
856
|
+
|
|
857
|
+
|
|
858
|
+
GHOSTTY_SELECTION_GESTURE_EVENT_OPT_REPEAT_INTERVAL_NS = 4,
|
|
859
|
+
|
|
860
|
+
|
|
861
|
+
GHOSTTY_SELECTION_GESTURE_EVENT_OPT_WORD_BOUNDARY_CODEPOINTS = 5,
|
|
862
|
+
|
|
863
|
+
|
|
864
|
+
GHOSTTY_SELECTION_GESTURE_EVENT_OPT_BEHAVIORS = 6,
|
|
865
|
+
|
|
866
|
+
|
|
867
|
+
GHOSTTY_SELECTION_GESTURE_EVENT_OPT_RECTANGLE = 7,
|
|
868
|
+
|
|
869
|
+
|
|
870
|
+
GHOSTTY_SELECTION_GESTURE_EVENT_OPT_GEOMETRY = 8,
|
|
871
|
+
|
|
872
|
+
|
|
873
|
+
GHOSTTY_SELECTION_GESTURE_EVENT_OPT_VIEWPORT = 9,
|
|
874
|
+
|
|
875
|
+
GHOSTTY_SELECTION_GESTURE_EVENT_OPT_MAX_VALUE = 0x7FFFFFFF,
|
|
876
|
+
} GhosttySelectionGestureEventOption;
|
|
877
|
+
|
|
878
|
+
GhosttyResult ghostty_selection_gesture_event_new(
|
|
879
|
+
const GhosttyAllocator* allocator,
|
|
880
|
+
GhosttySelectionGestureEvent* out_event,
|
|
881
|
+
GhosttySelectionGestureEventType type);
|
|
882
|
+
|
|
883
|
+
void ghostty_selection_gesture_event_free(
|
|
884
|
+
GhosttySelectionGestureEvent event);
|
|
885
|
+
|
|
886
|
+
GhosttyResult ghostty_selection_gesture_event_set(
|
|
887
|
+
GhosttySelectionGestureEvent event,
|
|
888
|
+
GhosttySelectionGestureEventOption option,
|
|
889
|
+
const void* value);
|
|
890
|
+
|
|
891
|
+
GhosttyResult ghostty_selection_gesture_event(
|
|
892
|
+
GhosttySelectionGesture gesture,
|
|
893
|
+
GhosttyTerminal terminal,
|
|
894
|
+
GhosttySelectionGestureEvent event,
|
|
895
|
+
GhosttySelection* out_selection);
|
|
896
|
+
|
|
897
|
+
GhosttyResult ghostty_selection_gesture_new(
|
|
898
|
+
const GhosttyAllocator* allocator,
|
|
899
|
+
GhosttySelectionGesture* out_gesture);
|
|
900
|
+
|
|
901
|
+
void ghostty_selection_gesture_free(
|
|
902
|
+
GhosttySelectionGesture gesture,
|
|
903
|
+
GhosttyTerminal terminal);
|
|
904
|
+
|
|
905
|
+
void ghostty_selection_gesture_reset(
|
|
906
|
+
GhosttySelectionGesture gesture,
|
|
907
|
+
GhosttyTerminal terminal);
|
|
908
|
+
|
|
909
|
+
GhosttyResult ghostty_selection_gesture_get(
|
|
910
|
+
GhosttySelectionGesture gesture,
|
|
911
|
+
GhosttyTerminal terminal,
|
|
912
|
+
GhosttySelectionGestureData data,
|
|
913
|
+
void* value);
|
|
914
|
+
|
|
915
|
+
GhosttyResult ghostty_selection_gesture_get_multi(
|
|
916
|
+
GhosttySelectionGesture gesture,
|
|
917
|
+
GhosttyTerminal terminal,
|
|
918
|
+
size_t count,
|
|
919
|
+
const GhosttySelectionGestureData* keys,
|
|
920
|
+
void** values,
|
|
921
|
+
size_t* out_written);
|
|
922
|
+
|
|
923
|
+
GhosttyResult ghostty_terminal_select_word(
|
|
924
|
+
GhosttyTerminal terminal,
|
|
925
|
+
const GhosttyTerminalSelectWordOptions* options,
|
|
926
|
+
GhosttySelection* out_selection);
|
|
927
|
+
|
|
928
|
+
GhosttyResult ghostty_terminal_select_word_between(
|
|
929
|
+
GhosttyTerminal terminal,
|
|
930
|
+
const GhosttyTerminalSelectWordBetweenOptions* options,
|
|
931
|
+
GhosttySelection* out_selection);
|
|
932
|
+
|
|
933
|
+
GhosttyResult ghostty_terminal_select_line(
|
|
934
|
+
GhosttyTerminal terminal,
|
|
935
|
+
const GhosttyTerminalSelectLineOptions* options,
|
|
936
|
+
GhosttySelection* out_selection);
|
|
937
|
+
|
|
938
|
+
GhosttyResult ghostty_terminal_select_all(
|
|
939
|
+
GhosttyTerminal terminal,
|
|
940
|
+
GhosttySelection* out_selection);
|
|
941
|
+
|
|
942
|
+
GhosttyResult ghostty_terminal_select_output(
|
|
943
|
+
GhosttyTerminal terminal,
|
|
944
|
+
GhosttyGridRef ref,
|
|
945
|
+
GhosttySelection* out_selection);
|
|
946
|
+
|
|
947
|
+
GhosttyResult ghostty_terminal_selection_format_buf(
|
|
948
|
+
GhosttyTerminal terminal,
|
|
949
|
+
GhosttyTerminalSelectionFormatOptions options,
|
|
950
|
+
uint8_t* buf,
|
|
951
|
+
size_t buf_len,
|
|
952
|
+
size_t* out_written);
|
|
953
|
+
|
|
954
|
+
GhosttyResult ghostty_terminal_selection_format_alloc(
|
|
955
|
+
GhosttyTerminal terminal,
|
|
956
|
+
const GhosttyAllocator* allocator,
|
|
957
|
+
GhosttyTerminalSelectionFormatOptions options,
|
|
958
|
+
uint8_t** out_ptr,
|
|
959
|
+
size_t* out_len);
|
|
960
|
+
|
|
961
|
+
GhosttyResult ghostty_terminal_selection_adjust(
|
|
962
|
+
GhosttyTerminal terminal,
|
|
963
|
+
GhosttySelection* selection,
|
|
964
|
+
GhosttySelectionAdjust adjustment);
|
|
965
|
+
|
|
966
|
+
GhosttyResult ghostty_terminal_selection_order(
|
|
967
|
+
GhosttyTerminal terminal,
|
|
968
|
+
const GhosttySelection* selection,
|
|
969
|
+
GhosttySelectionOrder* out_order);
|
|
970
|
+
|
|
971
|
+
GhosttyResult ghostty_terminal_selection_ordered(
|
|
972
|
+
GhosttyTerminal terminal,
|
|
973
|
+
const GhosttySelection* selection,
|
|
974
|
+
GhosttySelectionOrder desired,
|
|
975
|
+
GhosttySelection* out_selection);
|
|
976
|
+
|
|
977
|
+
GhosttyResult ghostty_terminal_selection_contains(
|
|
978
|
+
GhosttyTerminal terminal,
|
|
979
|
+
const GhosttySelection* selection,
|
|
980
|
+
GhosttyPoint point,
|
|
981
|
+
bool* out_contains);
|
|
982
|
+
|
|
983
|
+
GhosttyResult ghostty_terminal_selection_equal(
|
|
984
|
+
GhosttyTerminal terminal,
|
|
985
|
+
const GhosttySelection* a,
|
|
986
|
+
const GhosttySelection* b,
|
|
987
|
+
bool* out_equal);
|
|
988
|
+
|
|
989
|
+
/* --- modes.h --- */
|
|
990
|
+
|
|
991
|
+
typedef uint16_t GhosttyMode;
|
|
992
|
+
|
|
993
|
+
typedef enum {
|
|
994
|
+
|
|
995
|
+
GHOSTTY_MODE_REPORT_NOT_RECOGNIZED = 0,
|
|
996
|
+
|
|
997
|
+
GHOSTTY_MODE_REPORT_SET = 1,
|
|
998
|
+
|
|
999
|
+
GHOSTTY_MODE_REPORT_RESET = 2,
|
|
1000
|
+
|
|
1001
|
+
GHOSTTY_MODE_REPORT_PERMANENTLY_SET = 3,
|
|
1002
|
+
|
|
1003
|
+
GHOSTTY_MODE_REPORT_PERMANENTLY_RESET = 4,
|
|
1004
|
+
GHOSTTY_MODE_REPORT_MAX_VALUE = 0x7FFFFFFF,
|
|
1005
|
+
} GhosttyModeReportState;
|
|
1006
|
+
|
|
1007
|
+
GhosttyResult ghostty_mode_report_encode(
|
|
1008
|
+
GhosttyMode mode,
|
|
1009
|
+
GhosttyModeReportState state,
|
|
1010
|
+
char* buf,
|
|
1011
|
+
size_t buf_len,
|
|
1012
|
+
size_t* out_written);
|
|
1013
|
+
|
|
1014
|
+
/* --- osc.h --- */
|
|
1015
|
+
|
|
1016
|
+
typedef enum {
|
|
1017
|
+
GHOSTTY_OSC_COMMAND_INVALID = 0,
|
|
1018
|
+
GHOSTTY_OSC_COMMAND_CHANGE_WINDOW_TITLE = 1,
|
|
1019
|
+
GHOSTTY_OSC_COMMAND_CHANGE_WINDOW_ICON = 2,
|
|
1020
|
+
GHOSTTY_OSC_COMMAND_SEMANTIC_PROMPT = 3,
|
|
1021
|
+
GHOSTTY_OSC_COMMAND_CLIPBOARD_CONTENTS = 4,
|
|
1022
|
+
GHOSTTY_OSC_COMMAND_REPORT_PWD = 5,
|
|
1023
|
+
GHOSTTY_OSC_COMMAND_MOUSE_SHAPE = 6,
|
|
1024
|
+
GHOSTTY_OSC_COMMAND_COLOR_OPERATION = 7,
|
|
1025
|
+
GHOSTTY_OSC_COMMAND_KITTY_COLOR_PROTOCOL = 8,
|
|
1026
|
+
GHOSTTY_OSC_COMMAND_SHOW_DESKTOP_NOTIFICATION = 9,
|
|
1027
|
+
GHOSTTY_OSC_COMMAND_HYPERLINK_START = 10,
|
|
1028
|
+
GHOSTTY_OSC_COMMAND_HYPERLINK_END = 11,
|
|
1029
|
+
GHOSTTY_OSC_COMMAND_CONEMU_SLEEP = 12,
|
|
1030
|
+
GHOSTTY_OSC_COMMAND_CONEMU_SHOW_MESSAGE_BOX = 13,
|
|
1031
|
+
GHOSTTY_OSC_COMMAND_CONEMU_CHANGE_TAB_TITLE = 14,
|
|
1032
|
+
GHOSTTY_OSC_COMMAND_CONEMU_PROGRESS_REPORT = 15,
|
|
1033
|
+
GHOSTTY_OSC_COMMAND_CONEMU_WAIT_INPUT = 16,
|
|
1034
|
+
GHOSTTY_OSC_COMMAND_CONEMU_GUIMACRO = 17,
|
|
1035
|
+
GHOSTTY_OSC_COMMAND_CONEMU_RUN_PROCESS = 18,
|
|
1036
|
+
GHOSTTY_OSC_COMMAND_CONEMU_OUTPUT_ENVIRONMENT_VARIABLE = 19,
|
|
1037
|
+
GHOSTTY_OSC_COMMAND_CONEMU_XTERM_EMULATION = 20,
|
|
1038
|
+
GHOSTTY_OSC_COMMAND_CONEMU_COMMENT = 21,
|
|
1039
|
+
GHOSTTY_OSC_COMMAND_KITTY_TEXT_SIZING = 22,
|
|
1040
|
+
GHOSTTY_OSC_COMMAND_KITTY_CLIPBOARD_PROTOCOL = 23,
|
|
1041
|
+
GHOSTTY_OSC_COMMAND_KITTY_DND_PROTOCOL = 24,
|
|
1042
|
+
GHOSTTY_OSC_COMMAND_CONTEXT_SIGNAL = 25,
|
|
1043
|
+
GHOSTTY_OSC_COMMAND_KITTY_DESKTOP_NOTIFICATION = 26,
|
|
1044
|
+
|
|
1045
|
+
|
|
1046
|
+
GHOSTTY_OSC_COMMAND_UNKNOWN = 27,
|
|
1047
|
+
GHOSTTY_OSC_COMMAND_TYPE_MAX_VALUE = 0x7FFFFFFF,
|
|
1048
|
+
} GhosttyOscCommandType;
|
|
1049
|
+
|
|
1050
|
+
typedef enum {
|
|
1051
|
+
|
|
1052
|
+
GHOSTTY_OSC_TERMINATOR_ST = 0,
|
|
1053
|
+
|
|
1054
|
+
|
|
1055
|
+
GHOSTTY_OSC_TERMINATOR_BEL = 1,
|
|
1056
|
+
GHOSTTY_OSC_TERMINATOR_MAX_VALUE = 0x7FFFFFFF,
|
|
1057
|
+
} GhosttyOscTerminator;
|
|
1058
|
+
|
|
1059
|
+
typedef enum {
|
|
1060
|
+
|
|
1061
|
+
GHOSTTY_OSC_OPT_UNKNOWN_MAX_BYTES = 0,
|
|
1062
|
+
GHOSTTY_OSC_OPT_MAX_VALUE = 0x7FFFFFFF,
|
|
1063
|
+
} GhosttyOscOption;
|
|
1064
|
+
|
|
1065
|
+
typedef enum {
|
|
1066
|
+
|
|
1067
|
+
GHOSTTY_OSC_DATA_INVALID = 0,
|
|
1068
|
+
|
|
1069
|
+
|
|
1070
|
+
GHOSTTY_OSC_DATA_CHANGE_WINDOW_TITLE_STR = 1,
|
|
1071
|
+
|
|
1072
|
+
|
|
1073
|
+
GHOSTTY_OSC_DATA_UNKNOWN_CONTENT = 2,
|
|
1074
|
+
|
|
1075
|
+
|
|
1076
|
+
GHOSTTY_OSC_DATA_UNKNOWN_TRUNCATED = 3,
|
|
1077
|
+
|
|
1078
|
+
|
|
1079
|
+
GHOSTTY_OSC_DATA_UNKNOWN_TERMINATOR = 4,
|
|
1080
|
+
GHOSTTY_OSC_DATA_MAX_VALUE = 0x7FFFFFFF,
|
|
1081
|
+
} GhosttyOscCommandData;
|
|
1082
|
+
|
|
1083
|
+
GhosttyResult ghostty_osc_new(const GhosttyAllocator *allocator, GhosttyOscParser *parser);
|
|
1084
|
+
|
|
1085
|
+
void ghostty_osc_free(GhosttyOscParser parser);
|
|
1086
|
+
|
|
1087
|
+
void ghostty_osc_reset(GhosttyOscParser parser);
|
|
1088
|
+
|
|
1089
|
+
GhosttyResult ghostty_osc_set(GhosttyOscParser parser,
|
|
1090
|
+
GhosttyOscOption option,
|
|
1091
|
+
const void* value);
|
|
1092
|
+
|
|
1093
|
+
void ghostty_osc_next(GhosttyOscParser parser, uint8_t byte);
|
|
1094
|
+
|
|
1095
|
+
GhosttyOscCommand ghostty_osc_end(GhosttyOscParser parser, uint8_t terminator);
|
|
1096
|
+
|
|
1097
|
+
GhosttyOscCommandType ghostty_osc_command_type(GhosttyOscCommand command);
|
|
1098
|
+
|
|
1099
|
+
bool ghostty_osc_command_data(GhosttyOscCommand command, GhosttyOscCommandData data, void *out);
|
|
1100
|
+
|
|
1101
|
+
/* --- size_report.h --- */
|
|
1102
|
+
|
|
1103
|
+
typedef enum {
|
|
1104
|
+
|
|
1105
|
+
GHOSTTY_SIZE_REPORT_MODE_2048 = 0,
|
|
1106
|
+
|
|
1107
|
+
GHOSTTY_SIZE_REPORT_CSI_14_T = 1,
|
|
1108
|
+
|
|
1109
|
+
GHOSTTY_SIZE_REPORT_CSI_16_T = 2,
|
|
1110
|
+
|
|
1111
|
+
GHOSTTY_SIZE_REPORT_CSI_18_T = 3,
|
|
1112
|
+
GHOSTTY_SIZE_REPORT_STYLE_MAX_VALUE = 0x7FFFFFFF,
|
|
1113
|
+
} GhosttySizeReportStyle;
|
|
1114
|
+
|
|
1115
|
+
typedef struct {
|
|
1116
|
+
|
|
1117
|
+
uint16_t rows;
|
|
1118
|
+
|
|
1119
|
+
uint16_t columns;
|
|
1120
|
+
|
|
1121
|
+
uint32_t cell_width;
|
|
1122
|
+
|
|
1123
|
+
uint32_t cell_height;
|
|
1124
|
+
} GhosttySizeReportSize;
|
|
1125
|
+
|
|
1126
|
+
GhosttyResult ghostty_size_report_encode(
|
|
1127
|
+
GhosttySizeReportStyle style,
|
|
1128
|
+
GhosttySizeReportSize size,
|
|
1129
|
+
char* buf,
|
|
1130
|
+
size_t buf_len,
|
|
1131
|
+
size_t* out_written);
|
|
1132
|
+
|
|
1133
|
+
/* --- kitty_graphics.h --- */
|
|
1134
|
+
|
|
1135
|
+
typedef enum {
|
|
1136
|
+
|
|
1137
|
+
GHOSTTY_KITTY_GRAPHICS_DATA_INVALID = 0,
|
|
1138
|
+
|
|
1139
|
+
|
|
1140
|
+
GHOSTTY_KITTY_GRAPHICS_DATA_PLACEMENT_ITERATOR = 1,
|
|
1141
|
+
|
|
1142
|
+
|
|
1143
|
+
GHOSTTY_KITTY_GRAPHICS_DATA_GENERATION = 2,
|
|
1144
|
+
GHOSTTY_KITTY_GRAPHICS_DATA_MAX_VALUE = 0x7FFFFFFF,
|
|
1145
|
+
} GhosttyKittyGraphicsData;
|
|
1146
|
+
|
|
1147
|
+
typedef enum {
|
|
1148
|
+
|
|
1149
|
+
GHOSTTY_KITTY_GRAPHICS_PLACEMENT_DATA_INVALID = 0,
|
|
1150
|
+
|
|
1151
|
+
|
|
1152
|
+
GHOSTTY_KITTY_GRAPHICS_PLACEMENT_DATA_IMAGE_ID = 1,
|
|
1153
|
+
|
|
1154
|
+
|
|
1155
|
+
GHOSTTY_KITTY_GRAPHICS_PLACEMENT_DATA_PLACEMENT_ID = 2,
|
|
1156
|
+
|
|
1157
|
+
|
|
1158
|
+
GHOSTTY_KITTY_GRAPHICS_PLACEMENT_DATA_IS_VIRTUAL = 3,
|
|
1159
|
+
|
|
1160
|
+
|
|
1161
|
+
GHOSTTY_KITTY_GRAPHICS_PLACEMENT_DATA_X_OFFSET = 4,
|
|
1162
|
+
|
|
1163
|
+
|
|
1164
|
+
GHOSTTY_KITTY_GRAPHICS_PLACEMENT_DATA_Y_OFFSET = 5,
|
|
1165
|
+
|
|
1166
|
+
|
|
1167
|
+
GHOSTTY_KITTY_GRAPHICS_PLACEMENT_DATA_SOURCE_X = 6,
|
|
1168
|
+
|
|
1169
|
+
|
|
1170
|
+
GHOSTTY_KITTY_GRAPHICS_PLACEMENT_DATA_SOURCE_Y = 7,
|
|
1171
|
+
|
|
1172
|
+
|
|
1173
|
+
GHOSTTY_KITTY_GRAPHICS_PLACEMENT_DATA_SOURCE_WIDTH = 8,
|
|
1174
|
+
|
|
1175
|
+
|
|
1176
|
+
GHOSTTY_KITTY_GRAPHICS_PLACEMENT_DATA_SOURCE_HEIGHT = 9,
|
|
1177
|
+
|
|
1178
|
+
|
|
1179
|
+
GHOSTTY_KITTY_GRAPHICS_PLACEMENT_DATA_COLUMNS = 10,
|
|
1180
|
+
|
|
1181
|
+
|
|
1182
|
+
GHOSTTY_KITTY_GRAPHICS_PLACEMENT_DATA_ROWS = 11,
|
|
1183
|
+
|
|
1184
|
+
|
|
1185
|
+
GHOSTTY_KITTY_GRAPHICS_PLACEMENT_DATA_Z = 12,
|
|
1186
|
+
|
|
1187
|
+
GHOSTTY_KITTY_GRAPHICS_PLACEMENT_DATA_MAX_VALUE = 0x7FFFFFFF,
|
|
1188
|
+
} GhosttyKittyGraphicsPlacementData;
|
|
1189
|
+
|
|
1190
|
+
typedef enum {
|
|
1191
|
+
GHOSTTY_KITTY_PLACEMENT_LAYER_ALL = 0,
|
|
1192
|
+
GHOSTTY_KITTY_PLACEMENT_LAYER_BELOW_BG = 1,
|
|
1193
|
+
GHOSTTY_KITTY_PLACEMENT_LAYER_BELOW_TEXT = 2,
|
|
1194
|
+
GHOSTTY_KITTY_PLACEMENT_LAYER_ABOVE_TEXT = 3,
|
|
1195
|
+
GHOSTTY_KITTY_PLACEMENT_LAYER_MAX_VALUE = 0x7FFFFFFF,
|
|
1196
|
+
} GhosttyKittyPlacementLayer;
|
|
1197
|
+
|
|
1198
|
+
typedef enum {
|
|
1199
|
+
|
|
1200
|
+
GHOSTTY_KITTY_GRAPHICS_PLACEMENT_ITERATOR_OPTION_LAYER = 0,
|
|
1201
|
+
GHOSTTY_KITTY_GRAPHICS_PLACEMENT_ITERATOR_OPTION_MAX_VALUE = 0x7FFFFFFF,
|
|
1202
|
+
} GhosttyKittyGraphicsPlacementIteratorOption;
|
|
1203
|
+
|
|
1204
|
+
typedef enum {
|
|
1205
|
+
GHOSTTY_KITTY_IMAGE_FORMAT_RGB = 0,
|
|
1206
|
+
GHOSTTY_KITTY_IMAGE_FORMAT_RGBA = 1,
|
|
1207
|
+
GHOSTTY_KITTY_IMAGE_FORMAT_PNG = 2,
|
|
1208
|
+
GHOSTTY_KITTY_IMAGE_FORMAT_GRAY_ALPHA = 3,
|
|
1209
|
+
GHOSTTY_KITTY_IMAGE_FORMAT_GRAY = 4,
|
|
1210
|
+
GHOSTTY_KITTY_IMAGE_FORMAT_MAX_VALUE = 0x7FFFFFFF,
|
|
1211
|
+
} GhosttyKittyImageFormat;
|
|
1212
|
+
|
|
1213
|
+
typedef enum {
|
|
1214
|
+
GHOSTTY_KITTY_IMAGE_COMPRESSION_NONE = 0,
|
|
1215
|
+
GHOSTTY_KITTY_IMAGE_COMPRESSION_ZLIB_DEFLATE = 1,
|
|
1216
|
+
GHOSTTY_KITTY_IMAGE_COMPRESSION_MAX_VALUE = 0x7FFFFFFF,
|
|
1217
|
+
} GhosttyKittyImageCompression;
|
|
1218
|
+
|
|
1219
|
+
typedef enum {
|
|
1220
|
+
|
|
1221
|
+
GHOSTTY_KITTY_IMAGE_DATA_INVALID = 0,
|
|
1222
|
+
|
|
1223
|
+
|
|
1224
|
+
GHOSTTY_KITTY_IMAGE_DATA_ID = 1,
|
|
1225
|
+
|
|
1226
|
+
|
|
1227
|
+
GHOSTTY_KITTY_IMAGE_DATA_NUMBER = 2,
|
|
1228
|
+
|
|
1229
|
+
|
|
1230
|
+
GHOSTTY_KITTY_IMAGE_DATA_WIDTH = 3,
|
|
1231
|
+
|
|
1232
|
+
|
|
1233
|
+
GHOSTTY_KITTY_IMAGE_DATA_HEIGHT = 4,
|
|
1234
|
+
|
|
1235
|
+
|
|
1236
|
+
GHOSTTY_KITTY_IMAGE_DATA_FORMAT = 5,
|
|
1237
|
+
|
|
1238
|
+
|
|
1239
|
+
GHOSTTY_KITTY_IMAGE_DATA_COMPRESSION = 6,
|
|
1240
|
+
|
|
1241
|
+
|
|
1242
|
+
GHOSTTY_KITTY_IMAGE_DATA_DATA_PTR = 7,
|
|
1243
|
+
|
|
1244
|
+
|
|
1245
|
+
GHOSTTY_KITTY_IMAGE_DATA_DATA_LEN = 8,
|
|
1246
|
+
|
|
1247
|
+
|
|
1248
|
+
GHOSTTY_KITTY_IMAGE_DATA_GENERATION = 9,
|
|
1249
|
+
|
|
1250
|
+
GHOSTTY_KITTY_IMAGE_DATA_MAX_VALUE = 0x7FFFFFFF,
|
|
1251
|
+
} GhosttyKittyGraphicsImageData;
|
|
1252
|
+
|
|
1253
|
+
typedef struct {
|
|
1254
|
+
|
|
1255
|
+
size_t size;
|
|
1256
|
+
|
|
1257
|
+
uint32_t pixel_width;
|
|
1258
|
+
|
|
1259
|
+
uint32_t pixel_height;
|
|
1260
|
+
|
|
1261
|
+
uint32_t grid_cols;
|
|
1262
|
+
|
|
1263
|
+
uint32_t grid_rows;
|
|
1264
|
+
|
|
1265
|
+
int32_t viewport_col;
|
|
1266
|
+
|
|
1267
|
+
int32_t viewport_row;
|
|
1268
|
+
|
|
1269
|
+
bool viewport_visible;
|
|
1270
|
+
|
|
1271
|
+
uint32_t source_x;
|
|
1272
|
+
|
|
1273
|
+
uint32_t source_y;
|
|
1274
|
+
|
|
1275
|
+
uint32_t source_width;
|
|
1276
|
+
|
|
1277
|
+
uint32_t source_height;
|
|
1278
|
+
} GhosttyKittyGraphicsPlacementRenderInfo;
|
|
1279
|
+
|
|
1280
|
+
GhosttyResult ghostty_kitty_graphics_get(
|
|
1281
|
+
GhosttyKittyGraphics graphics,
|
|
1282
|
+
GhosttyKittyGraphicsData data,
|
|
1283
|
+
void* out);
|
|
1284
|
+
|
|
1285
|
+
GhosttyKittyGraphicsImage ghostty_kitty_graphics_image(
|
|
1286
|
+
GhosttyKittyGraphics graphics,
|
|
1287
|
+
uint32_t image_id);
|
|
1288
|
+
|
|
1289
|
+
GhosttyResult ghostty_kitty_graphics_image_get(
|
|
1290
|
+
GhosttyKittyGraphicsImage image,
|
|
1291
|
+
GhosttyKittyGraphicsImageData data,
|
|
1292
|
+
void* out);
|
|
1293
|
+
|
|
1294
|
+
GhosttyResult ghostty_kitty_graphics_image_get_multi(
|
|
1295
|
+
GhosttyKittyGraphicsImage image,
|
|
1296
|
+
size_t count,
|
|
1297
|
+
const GhosttyKittyGraphicsImageData* keys,
|
|
1298
|
+
void** values,
|
|
1299
|
+
size_t* out_written);
|
|
1300
|
+
|
|
1301
|
+
GhosttyResult ghostty_kitty_graphics_placement_iterator_new(
|
|
1302
|
+
const GhosttyAllocator* allocator,
|
|
1303
|
+
GhosttyKittyGraphicsPlacementIterator* out_iterator);
|
|
1304
|
+
|
|
1305
|
+
void ghostty_kitty_graphics_placement_iterator_free(
|
|
1306
|
+
GhosttyKittyGraphicsPlacementIterator iterator);
|
|
1307
|
+
|
|
1308
|
+
GhosttyResult ghostty_kitty_graphics_placement_iterator_set(
|
|
1309
|
+
GhosttyKittyGraphicsPlacementIterator iterator,
|
|
1310
|
+
GhosttyKittyGraphicsPlacementIteratorOption option,
|
|
1311
|
+
const void* value);
|
|
1312
|
+
|
|
1313
|
+
bool ghostty_kitty_graphics_placement_next(
|
|
1314
|
+
GhosttyKittyGraphicsPlacementIterator iterator);
|
|
1315
|
+
|
|
1316
|
+
GhosttyResult ghostty_kitty_graphics_placement_get(
|
|
1317
|
+
GhosttyKittyGraphicsPlacementIterator iterator,
|
|
1318
|
+
GhosttyKittyGraphicsPlacementData data,
|
|
1319
|
+
void* out);
|
|
1320
|
+
|
|
1321
|
+
GhosttyResult ghostty_kitty_graphics_placement_get_multi(
|
|
1322
|
+
GhosttyKittyGraphicsPlacementIterator iterator,
|
|
1323
|
+
size_t count,
|
|
1324
|
+
const GhosttyKittyGraphicsPlacementData* keys,
|
|
1325
|
+
void** values,
|
|
1326
|
+
size_t* out_written);
|
|
1327
|
+
|
|
1328
|
+
GhosttyResult ghostty_kitty_graphics_placement_rect(
|
|
1329
|
+
GhosttyKittyGraphicsPlacementIterator iterator,
|
|
1330
|
+
GhosttyKittyGraphicsImage image,
|
|
1331
|
+
GhosttyTerminal terminal,
|
|
1332
|
+
GhosttySelection* out_selection);
|
|
1333
|
+
|
|
1334
|
+
GhosttyResult ghostty_kitty_graphics_placement_pixel_size(
|
|
1335
|
+
GhosttyKittyGraphicsPlacementIterator iterator,
|
|
1336
|
+
GhosttyKittyGraphicsImage image,
|
|
1337
|
+
GhosttyTerminal terminal,
|
|
1338
|
+
uint32_t* out_width,
|
|
1339
|
+
uint32_t* out_height);
|
|
1340
|
+
|
|
1341
|
+
GhosttyResult ghostty_kitty_graphics_placement_grid_size(
|
|
1342
|
+
GhosttyKittyGraphicsPlacementIterator iterator,
|
|
1343
|
+
GhosttyKittyGraphicsImage image,
|
|
1344
|
+
GhosttyTerminal terminal,
|
|
1345
|
+
uint32_t* out_cols,
|
|
1346
|
+
uint32_t* out_rows);
|
|
1347
|
+
|
|
1348
|
+
GhosttyResult ghostty_kitty_graphics_placement_viewport_pos(
|
|
1349
|
+
GhosttyKittyGraphicsPlacementIterator iterator,
|
|
1350
|
+
GhosttyKittyGraphicsImage image,
|
|
1351
|
+
GhosttyTerminal terminal,
|
|
1352
|
+
int32_t* out_col,
|
|
1353
|
+
int32_t* out_row);
|
|
1354
|
+
|
|
1355
|
+
GhosttyResult ghostty_kitty_graphics_placement_source_rect(
|
|
1356
|
+
GhosttyKittyGraphicsPlacementIterator iterator,
|
|
1357
|
+
GhosttyKittyGraphicsImage image,
|
|
1358
|
+
uint32_t* out_x,
|
|
1359
|
+
uint32_t* out_y,
|
|
1360
|
+
uint32_t* out_width,
|
|
1361
|
+
uint32_t* out_height);
|
|
1362
|
+
|
|
1363
|
+
GhosttyResult ghostty_kitty_graphics_placement_render_info(
|
|
1364
|
+
GhosttyKittyGraphicsPlacementIterator iterator,
|
|
1365
|
+
GhosttyKittyGraphicsImage image,
|
|
1366
|
+
GhosttyTerminal terminal,
|
|
1367
|
+
GhosttyKittyGraphicsPlacementRenderInfo* out_info);
|
|
1368
|
+
|
|
1369
|
+
/* --- terminal.h --- */
|
|
1370
|
+
|
|
1371
|
+
typedef enum {
|
|
1372
|
+
|
|
1373
|
+
GHOSTTY_TERMINAL_COMPRESSION_MODE_INCREMENTAL = 0,
|
|
1374
|
+
|
|
1375
|
+
|
|
1376
|
+
GHOSTTY_TERMINAL_COMPRESSION_MODE_FULL = 1,
|
|
1377
|
+
GHOSTTY_TERMINAL_COMPRESSION_MODE_MAX_VALUE = 0x7FFFFFFF,
|
|
1378
|
+
} GhosttyTerminalCompressionMode;
|
|
1379
|
+
|
|
1380
|
+
typedef enum {
|
|
1381
|
+
|
|
1382
|
+
GHOSTTY_TERMINAL_COMPRESSION_RESULT_UNSUPPORTED = 0,
|
|
1383
|
+
|
|
1384
|
+
|
|
1385
|
+
GHOSTTY_TERMINAL_COMPRESSION_RESULT_PENDING = 1,
|
|
1386
|
+
|
|
1387
|
+
|
|
1388
|
+
GHOSTTY_TERMINAL_COMPRESSION_RESULT_COMPLETE = 2,
|
|
1389
|
+
GHOSTTY_TERMINAL_COMPRESSION_RESULT_MAX_VALUE = 0x7FFFFFFF,
|
|
1390
|
+
} GhosttyTerminalCompressionResult;
|
|
1391
|
+
|
|
1392
|
+
typedef enum {
|
|
1393
|
+
|
|
1394
|
+
GHOSTTY_SCROLL_VIEWPORT_TOP,
|
|
1395
|
+
|
|
1396
|
+
|
|
1397
|
+
GHOSTTY_SCROLL_VIEWPORT_BOTTOM,
|
|
1398
|
+
|
|
1399
|
+
|
|
1400
|
+
GHOSTTY_SCROLL_VIEWPORT_DELTA,
|
|
1401
|
+
|
|
1402
|
+
|
|
1403
|
+
GHOSTTY_SCROLL_VIEWPORT_ROW,
|
|
1404
|
+
GHOSTTY_SCROLL_VIEWPORT_MAX_VALUE = 0x7FFFFFFF,
|
|
1405
|
+
} GhosttyTerminalScrollViewportTag;
|
|
1406
|
+
|
|
1407
|
+
typedef union {
|
|
1408
|
+
|
|
1409
|
+
intptr_t delta;
|
|
1410
|
+
|
|
1411
|
+
|
|
1412
|
+
size_t row;
|
|
1413
|
+
|
|
1414
|
+
|
|
1415
|
+
uint64_t _padding[2];
|
|
1416
|
+
} GhosttyTerminalScrollViewportValue;
|
|
1417
|
+
|
|
1418
|
+
typedef struct {
|
|
1419
|
+
GhosttyTerminalScrollViewportTag tag;
|
|
1420
|
+
GhosttyTerminalScrollViewportValue value;
|
|
1421
|
+
} GhosttyTerminalScrollViewport;
|
|
1422
|
+
|
|
1423
|
+
typedef enum {
|
|
1424
|
+
|
|
1425
|
+
GHOSTTY_TERMINAL_SCREEN_PRIMARY = 0,
|
|
1426
|
+
|
|
1427
|
+
|
|
1428
|
+
GHOSTTY_TERMINAL_SCREEN_ALTERNATE = 1,
|
|
1429
|
+
GHOSTTY_TERMINAL_SCREEN_MAX_VALUE = 0x7FFFFFFF,
|
|
1430
|
+
} GhosttyTerminalScreen;
|
|
1431
|
+
|
|
1432
|
+
typedef enum {
|
|
1433
|
+
|
|
1434
|
+
GHOSTTY_TERMINAL_CURSOR_STYLE_BAR = 0,
|
|
1435
|
+
|
|
1436
|
+
|
|
1437
|
+
GHOSTTY_TERMINAL_CURSOR_STYLE_BLOCK = 1,
|
|
1438
|
+
|
|
1439
|
+
|
|
1440
|
+
GHOSTTY_TERMINAL_CURSOR_STYLE_UNDERLINE = 2,
|
|
1441
|
+
|
|
1442
|
+
|
|
1443
|
+
GHOSTTY_TERMINAL_CURSOR_STYLE_BLOCK_HOLLOW = 3,
|
|
1444
|
+
GHOSTTY_TERMINAL_CURSOR_STYLE_MAX_VALUE = 0x7FFFFFFF,
|
|
1445
|
+
} GhosttyTerminalCursorStyle;
|
|
1446
|
+
|
|
1447
|
+
typedef struct {
|
|
1448
|
+
|
|
1449
|
+
uint64_t total;
|
|
1450
|
+
|
|
1451
|
+
|
|
1452
|
+
uint64_t offset;
|
|
1453
|
+
|
|
1454
|
+
|
|
1455
|
+
uint64_t len;
|
|
1456
|
+
} GhosttyTerminalScrollbar;
|
|
1457
|
+
|
|
1458
|
+
typedef void (*GhosttyTerminalBellFn)(GhosttyTerminal terminal,
|
|
1459
|
+
void* userdata);
|
|
1460
|
+
|
|
1461
|
+
typedef enum {
|
|
1462
|
+
|
|
1463
|
+
GHOSTTY_TERMINAL_UNKNOWN_SEQUENCE_APC = 0,
|
|
1464
|
+
|
|
1465
|
+
|
|
1466
|
+
GHOSTTY_TERMINAL_UNKNOWN_SEQUENCE_OSC = 1,
|
|
1467
|
+
GHOSTTY_TERMINAL_UNKNOWN_SEQUENCE_MAX_VALUE = 0x7FFFFFFF,
|
|
1468
|
+
} GhosttyTerminalUnknownSequenceTag;
|
|
1469
|
+
|
|
1470
|
+
typedef struct {
|
|
1471
|
+
|
|
1472
|
+
bool truncated;
|
|
1473
|
+
|
|
1474
|
+
|
|
1475
|
+
GhosttyString content;
|
|
1476
|
+
} GhosttyTerminalUnknownStringSequence;
|
|
1477
|
+
|
|
1478
|
+
typedef struct {
|
|
1479
|
+
|
|
1480
|
+
bool truncated;
|
|
1481
|
+
|
|
1482
|
+
|
|
1483
|
+
GhosttyString content;
|
|
1484
|
+
|
|
1485
|
+
|
|
1486
|
+
GhosttyOscTerminator terminator;
|
|
1487
|
+
} GhosttyTerminalUnknownOscSequence;
|
|
1488
|
+
|
|
1489
|
+
typedef union {
|
|
1490
|
+
|
|
1491
|
+
GhosttyTerminalUnknownStringSequence apc;
|
|
1492
|
+
|
|
1493
|
+
|
|
1494
|
+
GhosttyTerminalUnknownOscSequence osc;
|
|
1495
|
+
|
|
1496
|
+
|
|
1497
|
+
uint64_t _padding[16];
|
|
1498
|
+
} GhosttyTerminalUnknownSequenceValue;
|
|
1499
|
+
|
|
1500
|
+
typedef struct {
|
|
1501
|
+
GhosttyTerminalUnknownSequenceTag tag;
|
|
1502
|
+
GhosttyTerminalUnknownSequenceValue value;
|
|
1503
|
+
} GhosttyTerminalUnknownSequence;
|
|
1504
|
+
|
|
1505
|
+
typedef void (*GhosttyTerminalUnknownSequenceFn)(
|
|
1506
|
+
GhosttyTerminal terminal,
|
|
1507
|
+
void* userdata,
|
|
1508
|
+
const GhosttyTerminalUnknownSequence* sequence);
|
|
1509
|
+
|
|
1510
|
+
typedef enum {
|
|
1511
|
+
|
|
1512
|
+
GHOSTTY_CLIPBOARD_LOCATION_STANDARD = 0,
|
|
1513
|
+
|
|
1514
|
+
|
|
1515
|
+
GHOSTTY_CLIPBOARD_LOCATION_SELECTION = 1,
|
|
1516
|
+
|
|
1517
|
+
|
|
1518
|
+
GHOSTTY_CLIPBOARD_LOCATION_PRIMARY = 2,
|
|
1519
|
+
GHOSTTY_CLIPBOARD_LOCATION_MAX_VALUE = 0x7FFFFFFF,
|
|
1520
|
+
} GhosttyClipboardLocation;
|
|
1521
|
+
|
|
1522
|
+
typedef struct {
|
|
1523
|
+
|
|
1524
|
+
GhosttyString mime;
|
|
1525
|
+
|
|
1526
|
+
|
|
1527
|
+
GhosttyString data;
|
|
1528
|
+
} GhosttyClipboardContent;
|
|
1529
|
+
|
|
1530
|
+
typedef enum {
|
|
1531
|
+
|
|
1532
|
+
GHOSTTY_CLIPBOARD_WRITE_RESULT_SUCCESS = 0,
|
|
1533
|
+
|
|
1534
|
+
|
|
1535
|
+
GHOSTTY_CLIPBOARD_WRITE_RESULT_DENIED = 1,
|
|
1536
|
+
|
|
1537
|
+
|
|
1538
|
+
GHOSTTY_CLIPBOARD_WRITE_RESULT_UNSUPPORTED = 2,
|
|
1539
|
+
|
|
1540
|
+
|
|
1541
|
+
GHOSTTY_CLIPBOARD_WRITE_RESULT_BUSY = 3,
|
|
1542
|
+
|
|
1543
|
+
|
|
1544
|
+
GHOSTTY_CLIPBOARD_WRITE_RESULT_INVALID_DATA = 4,
|
|
1545
|
+
|
|
1546
|
+
|
|
1547
|
+
GHOSTTY_CLIPBOARD_WRITE_RESULT_IO_ERROR = 5,
|
|
1548
|
+
GHOSTTY_CLIPBOARD_WRITE_RESULT_MAX_VALUE = 0x7FFFFFFF,
|
|
1549
|
+
} GhosttyClipboardWriteResult;
|
|
1550
|
+
|
|
1551
|
+
typedef struct {
|
|
1552
|
+
|
|
1553
|
+
size_t size;
|
|
1554
|
+
|
|
1555
|
+
|
|
1556
|
+
GhosttyClipboardWriteResult result;
|
|
1557
|
+
|
|
1558
|
+
|
|
1559
|
+
bool remember;
|
|
1560
|
+
} GhosttyClipboardWriteReply;
|
|
1561
|
+
|
|
1562
|
+
typedef struct GhosttyClipboardWrite GhosttyClipboardWrite;
|
|
1563
|
+
|
|
1564
|
+
typedef void (*GhosttyClipboardWriteReplyFn)(
|
|
1565
|
+
const GhosttyClipboardWrite* write,
|
|
1566
|
+
const GhosttyClipboardWriteReply* reply);
|
|
1567
|
+
|
|
1568
|
+
struct GhosttyClipboardWrite {
|
|
1569
|
+
|
|
1570
|
+
size_t size;
|
|
1571
|
+
|
|
1572
|
+
|
|
1573
|
+
GhosttyClipboardLocation location;
|
|
1574
|
+
|
|
1575
|
+
|
|
1576
|
+
const GhosttyClipboardContent* contents;
|
|
1577
|
+
|
|
1578
|
+
|
|
1579
|
+
size_t contents_len;
|
|
1580
|
+
|
|
1581
|
+
|
|
1582
|
+
GhosttyString name;
|
|
1583
|
+
|
|
1584
|
+
|
|
1585
|
+
bool granted;
|
|
1586
|
+
|
|
1587
|
+
|
|
1588
|
+
bool can_remember;
|
|
1589
|
+
|
|
1590
|
+
|
|
1591
|
+
const void* ctx;
|
|
1592
|
+
|
|
1593
|
+
|
|
1594
|
+
GhosttyClipboardWriteReplyFn reply;
|
|
1595
|
+
};
|
|
1596
|
+
|
|
1597
|
+
typedef void (*GhosttyTerminalClipboardWriteFn)(
|
|
1598
|
+
GhosttyTerminal terminal,
|
|
1599
|
+
void* userdata,
|
|
1600
|
+
const GhosttyClipboardWrite* write);
|
|
1601
|
+
|
|
1602
|
+
typedef enum {
|
|
1603
|
+
|
|
1604
|
+
GHOSTTY_CLIPBOARD_READ_RESULT_SUCCESS = 0,
|
|
1605
|
+
|
|
1606
|
+
|
|
1607
|
+
GHOSTTY_CLIPBOARD_READ_RESULT_DENIED = 1,
|
|
1608
|
+
|
|
1609
|
+
|
|
1610
|
+
GHOSTTY_CLIPBOARD_READ_RESULT_UNSUPPORTED = 2,
|
|
1611
|
+
|
|
1612
|
+
|
|
1613
|
+
GHOSTTY_CLIPBOARD_READ_RESULT_BUSY = 3,
|
|
1614
|
+
|
|
1615
|
+
|
|
1616
|
+
GHOSTTY_CLIPBOARD_READ_RESULT_IO_ERROR = 4,
|
|
1617
|
+
GHOSTTY_CLIPBOARD_READ_RESULT_MAX_VALUE = 0x7FFFFFFF,
|
|
1618
|
+
} GhosttyClipboardReadResult;
|
|
1619
|
+
|
|
1620
|
+
typedef struct {
|
|
1621
|
+
|
|
1622
|
+
size_t size;
|
|
1623
|
+
|
|
1624
|
+
|
|
1625
|
+
GhosttyClipboardReadResult result;
|
|
1626
|
+
|
|
1627
|
+
|
|
1628
|
+
const GhosttyClipboardContent* contents;
|
|
1629
|
+
|
|
1630
|
+
|
|
1631
|
+
size_t contents_len;
|
|
1632
|
+
|
|
1633
|
+
|
|
1634
|
+
const GhosttyString* available;
|
|
1635
|
+
|
|
1636
|
+
|
|
1637
|
+
size_t available_len;
|
|
1638
|
+
|
|
1639
|
+
|
|
1640
|
+
bool remember;
|
|
1641
|
+
} GhosttyClipboardReadReply;
|
|
1642
|
+
|
|
1643
|
+
typedef struct GhosttyClipboardRead GhosttyClipboardRead;
|
|
1644
|
+
|
|
1645
|
+
typedef void (*GhosttyClipboardReadReplyFn)(
|
|
1646
|
+
const GhosttyClipboardRead* read,
|
|
1647
|
+
const GhosttyClipboardReadReply* reply);
|
|
1648
|
+
|
|
1649
|
+
struct GhosttyClipboardRead {
|
|
1650
|
+
|
|
1651
|
+
size_t size;
|
|
1652
|
+
|
|
1653
|
+
|
|
1654
|
+
GhosttyClipboardLocation location;
|
|
1655
|
+
|
|
1656
|
+
|
|
1657
|
+
const GhosttyString* mimes;
|
|
1658
|
+
|
|
1659
|
+
|
|
1660
|
+
size_t mimes_len;
|
|
1661
|
+
|
|
1662
|
+
|
|
1663
|
+
bool list;
|
|
1664
|
+
|
|
1665
|
+
|
|
1666
|
+
GhosttyString name;
|
|
1667
|
+
|
|
1668
|
+
|
|
1669
|
+
bool granted;
|
|
1670
|
+
|
|
1671
|
+
|
|
1672
|
+
bool can_remember;
|
|
1673
|
+
|
|
1674
|
+
|
|
1675
|
+
const void* ctx;
|
|
1676
|
+
|
|
1677
|
+
|
|
1678
|
+
GhosttyClipboardReadReplyFn reply;
|
|
1679
|
+
};
|
|
1680
|
+
|
|
1681
|
+
typedef void (*GhosttyTerminalClipboardReadFn)(
|
|
1682
|
+
GhosttyTerminal terminal,
|
|
1683
|
+
void* userdata,
|
|
1684
|
+
const GhosttyClipboardRead* read);
|
|
1685
|
+
|
|
1686
|
+
typedef struct {
|
|
1687
|
+
|
|
1688
|
+
size_t size;
|
|
1689
|
+
|
|
1690
|
+
|
|
1691
|
+
GhosttyString title;
|
|
1692
|
+
|
|
1693
|
+
|
|
1694
|
+
GhosttyString body;
|
|
1695
|
+
} GhosttyTerminalDesktopNotification;
|
|
1696
|
+
|
|
1697
|
+
typedef void (*GhosttyTerminalDesktopNotificationFn)(
|
|
1698
|
+
GhosttyTerminal terminal,
|
|
1699
|
+
void* userdata,
|
|
1700
|
+
const GhosttyTerminalDesktopNotification* notification);
|
|
1701
|
+
|
|
1702
|
+
typedef enum {
|
|
1703
|
+
|
|
1704
|
+
GHOSTTY_TERMINAL_PROGRESS_STATE_REMOVE = 0,
|
|
1705
|
+
|
|
1706
|
+
|
|
1707
|
+
GHOSTTY_TERMINAL_PROGRESS_STATE_SET = 1,
|
|
1708
|
+
|
|
1709
|
+
|
|
1710
|
+
GHOSTTY_TERMINAL_PROGRESS_STATE_ERROR = 2,
|
|
1711
|
+
|
|
1712
|
+
|
|
1713
|
+
GHOSTTY_TERMINAL_PROGRESS_STATE_INDETERMINATE = 3,
|
|
1714
|
+
|
|
1715
|
+
|
|
1716
|
+
GHOSTTY_TERMINAL_PROGRESS_STATE_PAUSE = 4,
|
|
1717
|
+
GHOSTTY_TERMINAL_PROGRESS_STATE_MAX_VALUE = 0x7FFFFFFF,
|
|
1718
|
+
} GhosttyTerminalProgressState;
|
|
1719
|
+
|
|
1720
|
+
typedef struct {
|
|
1721
|
+
|
|
1722
|
+
size_t size;
|
|
1723
|
+
|
|
1724
|
+
|
|
1725
|
+
GhosttyTerminalProgressState state;
|
|
1726
|
+
|
|
1727
|
+
|
|
1728
|
+
int8_t progress;
|
|
1729
|
+
} GhosttyTerminalProgressReport;
|
|
1730
|
+
|
|
1731
|
+
typedef void (*GhosttyTerminalProgressReportFn)(
|
|
1732
|
+
GhosttyTerminal terminal,
|
|
1733
|
+
void* userdata,
|
|
1734
|
+
const GhosttyTerminalProgressReport* report);
|
|
1735
|
+
|
|
1736
|
+
typedef bool (*GhosttyTerminalColorSchemeFn)(GhosttyTerminal terminal,
|
|
1737
|
+
void* userdata,
|
|
1738
|
+
GhosttyColorScheme* out_scheme);
|
|
1739
|
+
|
|
1740
|
+
typedef bool (*GhosttyTerminalDeviceAttributesFn)(GhosttyTerminal terminal,
|
|
1741
|
+
void* userdata,
|
|
1742
|
+
GhosttyDeviceAttributes* out_attrs);
|
|
1743
|
+
|
|
1744
|
+
typedef GhosttyString (*GhosttyTerminalEnquiryFn)(GhosttyTerminal terminal,
|
|
1745
|
+
void* userdata);
|
|
1746
|
+
|
|
1747
|
+
typedef bool (*GhosttyTerminalSizeFn)(GhosttyTerminal terminal,
|
|
1748
|
+
void* userdata,
|
|
1749
|
+
GhosttySizeReportSize* out_size);
|
|
1750
|
+
|
|
1751
|
+
typedef void (*GhosttyTerminalTitleChangedFn)(GhosttyTerminal terminal,
|
|
1752
|
+
void* userdata);
|
|
1753
|
+
|
|
1754
|
+
typedef void (*GhosttyTerminalRenderHoldFn)(GhosttyTerminal terminal,
|
|
1755
|
+
void* userdata,
|
|
1756
|
+
bool held);
|
|
1757
|
+
|
|
1758
|
+
typedef void (*GhosttyTerminalPwdChangedFn)(GhosttyTerminal terminal,
|
|
1759
|
+
void* userdata);
|
|
1760
|
+
|
|
1761
|
+
typedef void (*GhosttyTerminalWritePtyFn)(GhosttyTerminal terminal,
|
|
1762
|
+
void* userdata,
|
|
1763
|
+
const uint8_t* data,
|
|
1764
|
+
size_t len);
|
|
1765
|
+
|
|
1766
|
+
typedef GhosttyString (*GhosttyTerminalXtversionFn)(GhosttyTerminal terminal,
|
|
1767
|
+
void* userdata);
|
|
1768
|
+
|
|
1769
|
+
typedef struct {
|
|
1770
|
+
|
|
1771
|
+
GhosttyMode mode;
|
|
1772
|
+
|
|
1773
|
+
|
|
1774
|
+
bool value;
|
|
1775
|
+
} GhosttyTerminalModeConfig;
|
|
1776
|
+
|
|
1777
|
+
typedef enum {
|
|
1778
|
+
|
|
1779
|
+
GHOSTTY_TERMINAL_OPT_USERDATA = 0,
|
|
1780
|
+
|
|
1781
|
+
|
|
1782
|
+
GHOSTTY_TERMINAL_OPT_WRITE_PTY = 1,
|
|
1783
|
+
|
|
1784
|
+
|
|
1785
|
+
GHOSTTY_TERMINAL_OPT_BELL = 2,
|
|
1786
|
+
|
|
1787
|
+
|
|
1788
|
+
GHOSTTY_TERMINAL_OPT_ENQUIRY = 3,
|
|
1789
|
+
|
|
1790
|
+
|
|
1791
|
+
GHOSTTY_TERMINAL_OPT_XTVERSION = 4,
|
|
1792
|
+
|
|
1793
|
+
|
|
1794
|
+
GHOSTTY_TERMINAL_OPT_TITLE_CHANGED = 5,
|
|
1795
|
+
|
|
1796
|
+
|
|
1797
|
+
GHOSTTY_TERMINAL_OPT_SIZE = 6,
|
|
1798
|
+
|
|
1799
|
+
|
|
1800
|
+
GHOSTTY_TERMINAL_OPT_COLOR_SCHEME = 7,
|
|
1801
|
+
|
|
1802
|
+
|
|
1803
|
+
GHOSTTY_TERMINAL_OPT_DEVICE_ATTRIBUTES = 8,
|
|
1804
|
+
|
|
1805
|
+
|
|
1806
|
+
GHOSTTY_TERMINAL_OPT_TITLE = 9,
|
|
1807
|
+
|
|
1808
|
+
|
|
1809
|
+
GHOSTTY_TERMINAL_OPT_PWD = 10,
|
|
1810
|
+
|
|
1811
|
+
|
|
1812
|
+
GHOSTTY_TERMINAL_OPT_COLOR_FOREGROUND = 11,
|
|
1813
|
+
|
|
1814
|
+
|
|
1815
|
+
GHOSTTY_TERMINAL_OPT_COLOR_BACKGROUND = 12,
|
|
1816
|
+
|
|
1817
|
+
|
|
1818
|
+
GHOSTTY_TERMINAL_OPT_COLOR_CURSOR = 13,
|
|
1819
|
+
|
|
1820
|
+
|
|
1821
|
+
GHOSTTY_TERMINAL_OPT_COLOR_PALETTE = 14,
|
|
1822
|
+
|
|
1823
|
+
|
|
1824
|
+
GHOSTTY_TERMINAL_OPT_KITTY_IMAGE_STORAGE_LIMIT = 15,
|
|
1825
|
+
|
|
1826
|
+
|
|
1827
|
+
GHOSTTY_TERMINAL_OPT_KITTY_IMAGE_MEDIUM_FILE = 16,
|
|
1828
|
+
|
|
1829
|
+
|
|
1830
|
+
GHOSTTY_TERMINAL_OPT_KITTY_IMAGE_MEDIUM_TEMP_FILE = 17,
|
|
1831
|
+
|
|
1832
|
+
|
|
1833
|
+
GHOSTTY_TERMINAL_OPT_KITTY_IMAGE_MEDIUM_SHARED_MEM = 18,
|
|
1834
|
+
|
|
1835
|
+
|
|
1836
|
+
GHOSTTY_TERMINAL_OPT_APC_MAX_BYTES = 19,
|
|
1837
|
+
|
|
1838
|
+
|
|
1839
|
+
GHOSTTY_TERMINAL_OPT_APC_MAX_BYTES_KITTY = 20,
|
|
1840
|
+
|
|
1841
|
+
|
|
1842
|
+
GHOSTTY_TERMINAL_OPT_SELECTION = 21,
|
|
1843
|
+
|
|
1844
|
+
|
|
1845
|
+
GHOSTTY_TERMINAL_OPT_DEFAULT_CURSOR_STYLE = 22,
|
|
1846
|
+
|
|
1847
|
+
|
|
1848
|
+
GHOSTTY_TERMINAL_OPT_DEFAULT_CURSOR_BLINK = 23,
|
|
1849
|
+
|
|
1850
|
+
|
|
1851
|
+
GHOSTTY_TERMINAL_OPT_GLYPH_PROTOCOL = 24,
|
|
1852
|
+
|
|
1853
|
+
|
|
1854
|
+
GHOSTTY_TERMINAL_OPT_PWD_CHANGED = 25,
|
|
1855
|
+
|
|
1856
|
+
|
|
1857
|
+
GHOSTTY_TERMINAL_OPT_CLIPBOARD_WRITE = 26,
|
|
1858
|
+
|
|
1859
|
+
|
|
1860
|
+
GHOSTTY_TERMINAL_OPT_SCROLLBACK_MAX_BYTES = 27,
|
|
1861
|
+
|
|
1862
|
+
|
|
1863
|
+
GHOSTTY_TERMINAL_OPT_SCROLLBACK_MAX_LINES = 28,
|
|
1864
|
+
|
|
1865
|
+
|
|
1866
|
+
GHOSTTY_TERMINAL_OPT_DESKTOP_NOTIFICATION = 29,
|
|
1867
|
+
|
|
1868
|
+
|
|
1869
|
+
GHOSTTY_TERMINAL_OPT_PROGRESS_REPORT = 30,
|
|
1870
|
+
|
|
1871
|
+
|
|
1872
|
+
GHOSTTY_TERMINAL_OPT_CONTINUATION_MAX_BYTES = 31,
|
|
1873
|
+
|
|
1874
|
+
|
|
1875
|
+
GHOSTTY_TERMINAL_OPT_TITLE_REPORT = 32,
|
|
1876
|
+
|
|
1877
|
+
|
|
1878
|
+
GHOSTTY_TERMINAL_OPT_MODE_DEFAULT = 33,
|
|
1879
|
+
|
|
1880
|
+
|
|
1881
|
+
GHOSTTY_TERMINAL_OPT_MODE = 34,
|
|
1882
|
+
|
|
1883
|
+
|
|
1884
|
+
GHOSTTY_TERMINAL_OPT_UNKNOWN_SEQUENCE = 35,
|
|
1885
|
+
|
|
1886
|
+
|
|
1887
|
+
GHOSTTY_TERMINAL_OPT_UNKNOWN_MAX_BYTES = 36,
|
|
1888
|
+
|
|
1889
|
+
|
|
1890
|
+
GHOSTTY_TERMINAL_OPT_TERMINFO_NAME = 37,
|
|
1891
|
+
|
|
1892
|
+
|
|
1893
|
+
GHOSTTY_TERMINAL_OPT_CLIPBOARD_READ = 38,
|
|
1894
|
+
|
|
1895
|
+
|
|
1896
|
+
GHOSTTY_TERMINAL_OPT_CLIPBOARD_WRITE_MAX_BYTES = 39,
|
|
1897
|
+
|
|
1898
|
+
|
|
1899
|
+
GHOSTTY_TERMINAL_OPT_RESIZE_PULL_SCROLLBACK = 40,
|
|
1900
|
+
|
|
1901
|
+
|
|
1902
|
+
GHOSTTY_TERMINAL_OPT_RENDER_HOLD = 41,
|
|
1903
|
+
GHOSTTY_TERMINAL_OPT_MAX_VALUE = 0x7FFFFFFF,
|
|
1904
|
+
} GhosttyTerminalOption;
|
|
1905
|
+
|
|
1906
|
+
typedef enum {
|
|
1907
|
+
|
|
1908
|
+
GHOSTTY_TERMINAL_DATA_INVALID = 0,
|
|
1909
|
+
|
|
1910
|
+
|
|
1911
|
+
GHOSTTY_TERMINAL_DATA_COLS = 1,
|
|
1912
|
+
|
|
1913
|
+
|
|
1914
|
+
GHOSTTY_TERMINAL_DATA_ROWS = 2,
|
|
1915
|
+
|
|
1916
|
+
|
|
1917
|
+
GHOSTTY_TERMINAL_DATA_CURSOR_X = 3,
|
|
1918
|
+
|
|
1919
|
+
|
|
1920
|
+
GHOSTTY_TERMINAL_DATA_CURSOR_Y = 4,
|
|
1921
|
+
|
|
1922
|
+
|
|
1923
|
+
GHOSTTY_TERMINAL_DATA_CURSOR_PENDING_WRAP = 5,
|
|
1924
|
+
|
|
1925
|
+
|
|
1926
|
+
GHOSTTY_TERMINAL_DATA_ACTIVE_SCREEN = 6,
|
|
1927
|
+
|
|
1928
|
+
|
|
1929
|
+
GHOSTTY_TERMINAL_DATA_CURSOR_VISIBLE = 7,
|
|
1930
|
+
|
|
1931
|
+
|
|
1932
|
+
GHOSTTY_TERMINAL_DATA_KITTY_KEYBOARD_FLAGS = 8,
|
|
1933
|
+
|
|
1934
|
+
|
|
1935
|
+
GHOSTTY_TERMINAL_DATA_SCROLLBAR = 9,
|
|
1936
|
+
|
|
1937
|
+
|
|
1938
|
+
GHOSTTY_TERMINAL_DATA_CURSOR_STYLE = 10,
|
|
1939
|
+
|
|
1940
|
+
|
|
1941
|
+
GHOSTTY_TERMINAL_DATA_MOUSE_TRACKING = 11,
|
|
1942
|
+
|
|
1943
|
+
|
|
1944
|
+
GHOSTTY_TERMINAL_DATA_TITLE = 12,
|
|
1945
|
+
|
|
1946
|
+
|
|
1947
|
+
GHOSTTY_TERMINAL_DATA_PWD = 13,
|
|
1948
|
+
|
|
1949
|
+
|
|
1950
|
+
GHOSTTY_TERMINAL_DATA_TOTAL_ROWS = 14,
|
|
1951
|
+
|
|
1952
|
+
|
|
1953
|
+
GHOSTTY_TERMINAL_DATA_SCROLLBACK_ROWS = 15,
|
|
1954
|
+
|
|
1955
|
+
|
|
1956
|
+
GHOSTTY_TERMINAL_DATA_WIDTH_PX = 16,
|
|
1957
|
+
|
|
1958
|
+
|
|
1959
|
+
GHOSTTY_TERMINAL_DATA_HEIGHT_PX = 17,
|
|
1960
|
+
|
|
1961
|
+
|
|
1962
|
+
GHOSTTY_TERMINAL_DATA_COLOR_FOREGROUND = 18,
|
|
1963
|
+
|
|
1964
|
+
|
|
1965
|
+
GHOSTTY_TERMINAL_DATA_COLOR_BACKGROUND = 19,
|
|
1966
|
+
|
|
1967
|
+
|
|
1968
|
+
GHOSTTY_TERMINAL_DATA_COLOR_CURSOR = 20,
|
|
1969
|
+
|
|
1970
|
+
|
|
1971
|
+
GHOSTTY_TERMINAL_DATA_COLOR_PALETTE = 21,
|
|
1972
|
+
|
|
1973
|
+
|
|
1974
|
+
GHOSTTY_TERMINAL_DATA_COLOR_FOREGROUND_DEFAULT = 22,
|
|
1975
|
+
|
|
1976
|
+
|
|
1977
|
+
GHOSTTY_TERMINAL_DATA_COLOR_BACKGROUND_DEFAULT = 23,
|
|
1978
|
+
|
|
1979
|
+
|
|
1980
|
+
GHOSTTY_TERMINAL_DATA_COLOR_CURSOR_DEFAULT = 24,
|
|
1981
|
+
|
|
1982
|
+
|
|
1983
|
+
GHOSTTY_TERMINAL_DATA_COLOR_PALETTE_DEFAULT = 25,
|
|
1984
|
+
|
|
1985
|
+
|
|
1986
|
+
GHOSTTY_TERMINAL_DATA_KITTY_IMAGE_STORAGE_LIMIT = 26,
|
|
1987
|
+
|
|
1988
|
+
|
|
1989
|
+
GHOSTTY_TERMINAL_DATA_KITTY_IMAGE_MEDIUM_FILE = 27,
|
|
1990
|
+
|
|
1991
|
+
|
|
1992
|
+
GHOSTTY_TERMINAL_DATA_KITTY_IMAGE_MEDIUM_TEMP_FILE = 28,
|
|
1993
|
+
|
|
1994
|
+
|
|
1995
|
+
GHOSTTY_TERMINAL_DATA_KITTY_IMAGE_MEDIUM_SHARED_MEM = 29,
|
|
1996
|
+
|
|
1997
|
+
|
|
1998
|
+
GHOSTTY_TERMINAL_DATA_KITTY_GRAPHICS = 30,
|
|
1999
|
+
|
|
2000
|
+
|
|
2001
|
+
GHOSTTY_TERMINAL_DATA_SELECTION = 31,
|
|
2002
|
+
|
|
2003
|
+
|
|
2004
|
+
GHOSTTY_TERMINAL_DATA_VIEWPORT_ACTIVE = 32,
|
|
2005
|
+
|
|
2006
|
+
|
|
2007
|
+
GHOSTTY_TERMINAL_DATA_VT_PROCESSING_ERROR = 33,
|
|
2008
|
+
|
|
2009
|
+
|
|
2010
|
+
GHOSTTY_TERMINAL_DATA_SCROLLBACK_MAX_BYTES = 34,
|
|
2011
|
+
|
|
2012
|
+
|
|
2013
|
+
GHOSTTY_TERMINAL_DATA_SCROLLBACK_MAX_LINES = 35,
|
|
2014
|
+
|
|
2015
|
+
|
|
2016
|
+
GHOSTTY_TERMINAL_DATA_CONTINUATION_MAX_BYTES = 36,
|
|
2017
|
+
|
|
2018
|
+
|
|
2019
|
+
GHOSTTY_TERMINAL_DATA_MODE = 37,
|
|
2020
|
+
|
|
2021
|
+
|
|
2022
|
+
GHOSTTY_TERMINAL_DATA_VT_GROUND = 38,
|
|
2023
|
+
|
|
2024
|
+
|
|
2025
|
+
GHOSTTY_TERMINAL_DATA_CURSOR_AT_PROMPT = 39,
|
|
2026
|
+
|
|
2027
|
+
|
|
2028
|
+
GHOSTTY_TERMINAL_DATA_CLIPBOARD_WRITE_MAX_BYTES = 40,
|
|
2029
|
+
|
|
2030
|
+
|
|
2031
|
+
GHOSTTY_TERMINAL_DATA_MOUSE_SHAPE = 41,
|
|
2032
|
+
GHOSTTY_TERMINAL_DATA_MAX_VALUE = 0x7FFFFFFF,
|
|
2033
|
+
} GhosttyTerminalData;
|
|
2034
|
+
|
|
2035
|
+
GhosttyResult ghostty_terminal_new(const GhosttyAllocator* allocator,
|
|
2036
|
+
GhosttyTerminal* terminal,
|
|
2037
|
+
uint16_t cols,
|
|
2038
|
+
uint16_t rows);
|
|
2039
|
+
|
|
2040
|
+
void ghostty_terminal_free(GhosttyTerminal terminal);
|
|
2041
|
+
|
|
2042
|
+
void ghostty_terminal_reset(GhosttyTerminal terminal);
|
|
2043
|
+
|
|
2044
|
+
GhosttyResult ghostty_terminal_resize(GhosttyTerminal terminal,
|
|
2045
|
+
uint16_t cols,
|
|
2046
|
+
uint16_t rows,
|
|
2047
|
+
uint32_t cell_width_px,
|
|
2048
|
+
uint32_t cell_height_px);
|
|
2049
|
+
|
|
2050
|
+
GhosttyResult ghostty_terminal_set(GhosttyTerminal terminal,
|
|
2051
|
+
GhosttyTerminalOption option,
|
|
2052
|
+
const void* value);
|
|
2053
|
+
|
|
2054
|
+
void ghostty_terminal_vt_write(GhosttyTerminal terminal,
|
|
2055
|
+
const uint8_t* data,
|
|
2056
|
+
size_t len);
|
|
2057
|
+
|
|
2058
|
+
GhosttyResult ghostty_terminal_vt_write_until_ground(
|
|
2059
|
+
GhosttyTerminal terminal,
|
|
2060
|
+
const uint8_t* data,
|
|
2061
|
+
size_t len,
|
|
2062
|
+
size_t* out_consumed);
|
|
2063
|
+
|
|
2064
|
+
GhosttyResult ghostty_terminal_continuation_write(
|
|
2065
|
+
GhosttyTerminal terminal,
|
|
2066
|
+
GhosttyWriter writer);
|
|
2067
|
+
|
|
2068
|
+
GhosttyResult ghostty_terminal_continuation_buf(
|
|
2069
|
+
GhosttyTerminal terminal,
|
|
2070
|
+
uint8_t* buf,
|
|
2071
|
+
size_t buf_len,
|
|
2072
|
+
size_t* out_written);
|
|
2073
|
+
|
|
2074
|
+
GhosttyResult ghostty_terminal_continuation_alloc(
|
|
2075
|
+
GhosttyTerminal terminal,
|
|
2076
|
+
const GhosttyAllocator* allocator,
|
|
2077
|
+
uint8_t** out_ptr,
|
|
2078
|
+
size_t* out_len);
|
|
2079
|
+
|
|
2080
|
+
void ghostty_terminal_scroll_viewport(GhosttyTerminal terminal,
|
|
2081
|
+
GhosttyTerminalScrollViewport behavior);
|
|
2082
|
+
|
|
2083
|
+
GhosttyResult ghostty_terminal_compression_activity(
|
|
2084
|
+
GhosttyTerminal terminal,
|
|
2085
|
+
uint64_t* out_activity);
|
|
2086
|
+
|
|
2087
|
+
GhosttyResult ghostty_terminal_compress(
|
|
2088
|
+
GhosttyTerminal terminal,
|
|
2089
|
+
GhosttyTerminalCompressionMode mode,
|
|
2090
|
+
GhosttyTerminalCompressionResult* out_result);
|
|
2091
|
+
|
|
2092
|
+
GhosttyResult ghostty_terminal_get(GhosttyTerminal terminal,
|
|
2093
|
+
GhosttyTerminalData data,
|
|
2094
|
+
void *out);
|
|
2095
|
+
|
|
2096
|
+
GhosttyResult ghostty_terminal_get_multi(GhosttyTerminal terminal,
|
|
2097
|
+
size_t count,
|
|
2098
|
+
const GhosttyTerminalData* keys,
|
|
2099
|
+
void** values,
|
|
2100
|
+
size_t* out_written);
|
|
2101
|
+
|
|
2102
|
+
GhosttyResult ghostty_terminal_grid_ref(GhosttyTerminal terminal,
|
|
2103
|
+
GhosttyPoint point,
|
|
2104
|
+
GhosttyGridRef *out_ref);
|
|
2105
|
+
|
|
2106
|
+
GhosttyResult ghostty_terminal_grid_ref_track(
|
|
2107
|
+
GhosttyTerminal terminal,
|
|
2108
|
+
GhosttyPoint point,
|
|
2109
|
+
GhosttyTrackedGridRef *out_ref);
|
|
2110
|
+
|
|
2111
|
+
GhosttyResult ghostty_terminal_point_from_grid_ref(
|
|
2112
|
+
GhosttyTerminal terminal,
|
|
2113
|
+
const GhosttyGridRef *ref,
|
|
2114
|
+
GhosttyPointTag tag,
|
|
2115
|
+
GhosttyPointCoordinate *out);
|
|
2116
|
+
|
|
2117
|
+
/* --- formatter.h --- */
|
|
2118
|
+
|
|
2119
|
+
typedef struct {
|
|
2120
|
+
|
|
2121
|
+
size_t size;
|
|
2122
|
+
|
|
2123
|
+
|
|
2124
|
+
bool cursor;
|
|
2125
|
+
|
|
2126
|
+
|
|
2127
|
+
bool style;
|
|
2128
|
+
|
|
2129
|
+
|
|
2130
|
+
bool hyperlink;
|
|
2131
|
+
|
|
2132
|
+
|
|
2133
|
+
bool protection;
|
|
2134
|
+
|
|
2135
|
+
|
|
2136
|
+
bool kitty_keyboard;
|
|
2137
|
+
|
|
2138
|
+
|
|
2139
|
+
bool charsets;
|
|
2140
|
+
} GhosttyFormatterScreenExtra;
|
|
2141
|
+
|
|
2142
|
+
typedef struct {
|
|
2143
|
+
|
|
2144
|
+
size_t size;
|
|
2145
|
+
|
|
2146
|
+
|
|
2147
|
+
bool palette;
|
|
2148
|
+
|
|
2149
|
+
|
|
2150
|
+
bool modes;
|
|
2151
|
+
|
|
2152
|
+
|
|
2153
|
+
bool scrolling_region;
|
|
2154
|
+
|
|
2155
|
+
|
|
2156
|
+
bool tabstops;
|
|
2157
|
+
|
|
2158
|
+
|
|
2159
|
+
bool pwd;
|
|
2160
|
+
|
|
2161
|
+
|
|
2162
|
+
bool keyboard;
|
|
2163
|
+
|
|
2164
|
+
|
|
2165
|
+
GhosttyFormatterScreenExtra screen;
|
|
2166
|
+
} GhosttyFormatterTerminalExtra;
|
|
2167
|
+
|
|
2168
|
+
typedef struct {
|
|
2169
|
+
|
|
2170
|
+
size_t size;
|
|
2171
|
+
|
|
2172
|
+
|
|
2173
|
+
GhosttyFormatterFormat emit;
|
|
2174
|
+
|
|
2175
|
+
|
|
2176
|
+
bool unwrap;
|
|
2177
|
+
|
|
2178
|
+
|
|
2179
|
+
bool trim;
|
|
2180
|
+
|
|
2181
|
+
|
|
2182
|
+
GhosttyFormatterTerminalExtra extra;
|
|
2183
|
+
|
|
2184
|
+
|
|
2185
|
+
const GhosttySelection *selection;
|
|
2186
|
+
} GhosttyFormatterTerminalOptions;
|
|
2187
|
+
|
|
2188
|
+
GhosttyResult ghostty_formatter_terminal_new(
|
|
2189
|
+
const GhosttyAllocator* allocator,
|
|
2190
|
+
GhosttyFormatter* formatter,
|
|
2191
|
+
GhosttyTerminal terminal,
|
|
2192
|
+
GhosttyFormatterTerminalOptions options);
|
|
2193
|
+
|
|
2194
|
+
GhosttyResult ghostty_formatter_format(
|
|
2195
|
+
GhosttyFormatter formatter,
|
|
2196
|
+
GhosttyWriter writer);
|
|
2197
|
+
|
|
2198
|
+
GhosttyResult ghostty_formatter_format_buf(GhosttyFormatter formatter,
|
|
2199
|
+
uint8_t* buf,
|
|
2200
|
+
size_t buf_len,
|
|
2201
|
+
size_t* out_written);
|
|
2202
|
+
|
|
2203
|
+
GhosttyResult ghostty_formatter_format_alloc(GhosttyFormatter formatter,
|
|
2204
|
+
const GhosttyAllocator* allocator,
|
|
2205
|
+
uint8_t** out_ptr,
|
|
2206
|
+
size_t* out_len);
|
|
2207
|
+
|
|
2208
|
+
void ghostty_formatter_free(GhosttyFormatter formatter);
|
|
2209
|
+
|
|
2210
|
+
/* --- render.h --- */
|
|
2211
|
+
|
|
2212
|
+
typedef enum {
|
|
2213
|
+
|
|
2214
|
+
GHOSTTY_RENDER_STATE_DIRTY_FALSE = 0,
|
|
2215
|
+
|
|
2216
|
+
|
|
2217
|
+
GHOSTTY_RENDER_STATE_DIRTY_PARTIAL = 1,
|
|
2218
|
+
|
|
2219
|
+
|
|
2220
|
+
GHOSTTY_RENDER_STATE_DIRTY_FULL = 2,
|
|
2221
|
+
GHOSTTY_RENDER_STATE_DIRTY_MAX_VALUE = 0x7FFFFFFF,
|
|
2222
|
+
} GhosttyRenderStateDirty;
|
|
2223
|
+
|
|
2224
|
+
typedef enum {
|
|
2225
|
+
|
|
2226
|
+
GHOSTTY_RENDER_STATE_CURSOR_VISUAL_STYLE_BAR = 0,
|
|
2227
|
+
|
|
2228
|
+
|
|
2229
|
+
GHOSTTY_RENDER_STATE_CURSOR_VISUAL_STYLE_BLOCK = 1,
|
|
2230
|
+
|
|
2231
|
+
|
|
2232
|
+
GHOSTTY_RENDER_STATE_CURSOR_VISUAL_STYLE_UNDERLINE = 2,
|
|
2233
|
+
|
|
2234
|
+
|
|
2235
|
+
GHOSTTY_RENDER_STATE_CURSOR_VISUAL_STYLE_BLOCK_HOLLOW = 3,
|
|
2236
|
+
GHOSTTY_RENDER_STATE_CURSOR_VISUAL_STYLE_MAX_VALUE = 0x7FFFFFFF,
|
|
2237
|
+
} GhosttyRenderStateCursorVisualStyle;
|
|
2238
|
+
|
|
2239
|
+
typedef struct {
|
|
2240
|
+
|
|
2241
|
+
uint16_t above;
|
|
2242
|
+
|
|
2243
|
+
|
|
2244
|
+
uint16_t below;
|
|
2245
|
+
} GhosttyRenderStateOverscan;
|
|
2246
|
+
|
|
2247
|
+
typedef struct {
|
|
2248
|
+
|
|
2249
|
+
uint64_t bits[2];
|
|
2250
|
+
} GhosttyRenderStateRowId;
|
|
2251
|
+
|
|
2252
|
+
typedef enum {
|
|
2253
|
+
|
|
2254
|
+
GHOSTTY_RENDER_STATE_DATA_INVALID = 0,
|
|
2255
|
+
|
|
2256
|
+
|
|
2257
|
+
GHOSTTY_RENDER_STATE_DATA_COLS = 1,
|
|
2258
|
+
|
|
2259
|
+
|
|
2260
|
+
GHOSTTY_RENDER_STATE_DATA_ROWS = 2,
|
|
2261
|
+
|
|
2262
|
+
|
|
2263
|
+
GHOSTTY_RENDER_STATE_DATA_DIRTY = 3,
|
|
2264
|
+
|
|
2265
|
+
|
|
2266
|
+
GHOSTTY_RENDER_STATE_DATA_ROW_ITERATOR = 4,
|
|
2267
|
+
|
|
2268
|
+
|
|
2269
|
+
GHOSTTY_RENDER_STATE_DATA_COLOR_BACKGROUND = 5,
|
|
2270
|
+
|
|
2271
|
+
|
|
2272
|
+
GHOSTTY_RENDER_STATE_DATA_COLOR_FOREGROUND = 6,
|
|
2273
|
+
|
|
2274
|
+
|
|
2275
|
+
GHOSTTY_RENDER_STATE_DATA_COLOR_CURSOR = 7,
|
|
2276
|
+
|
|
2277
|
+
|
|
2278
|
+
GHOSTTY_RENDER_STATE_DATA_COLOR_CURSOR_HAS_VALUE = 8,
|
|
2279
|
+
|
|
2280
|
+
|
|
2281
|
+
GHOSTTY_RENDER_STATE_DATA_COLOR_PALETTE = 9,
|
|
2282
|
+
|
|
2283
|
+
|
|
2284
|
+
GHOSTTY_RENDER_STATE_DATA_CURSOR_VISUAL_STYLE = 10,
|
|
2285
|
+
|
|
2286
|
+
|
|
2287
|
+
GHOSTTY_RENDER_STATE_DATA_CURSOR_VISIBLE = 11,
|
|
2288
|
+
|
|
2289
|
+
|
|
2290
|
+
GHOSTTY_RENDER_STATE_DATA_CURSOR_BLINKING = 12,
|
|
2291
|
+
|
|
2292
|
+
|
|
2293
|
+
GHOSTTY_RENDER_STATE_DATA_CURSOR_PASSWORD_INPUT = 13,
|
|
2294
|
+
|
|
2295
|
+
|
|
2296
|
+
GHOSTTY_RENDER_STATE_DATA_CURSOR_VIEWPORT_HAS_VALUE = 14,
|
|
2297
|
+
|
|
2298
|
+
|
|
2299
|
+
GHOSTTY_RENDER_STATE_DATA_CURSOR_VIEWPORT_X = 15,
|
|
2300
|
+
|
|
2301
|
+
|
|
2302
|
+
GHOSTTY_RENDER_STATE_DATA_CURSOR_VIEWPORT_Y = 16,
|
|
2303
|
+
|
|
2304
|
+
|
|
2305
|
+
GHOSTTY_RENDER_STATE_DATA_CURSOR_VIEWPORT_WIDE_TAIL = 17,
|
|
2306
|
+
|
|
2307
|
+
|
|
2308
|
+
GHOSTTY_RENDER_STATE_DATA_CURSOR = 18,
|
|
2309
|
+
|
|
2310
|
+
|
|
2311
|
+
GHOSTTY_RENDER_STATE_DATA_COLORS = 19,
|
|
2312
|
+
|
|
2313
|
+
|
|
2314
|
+
GHOSTTY_RENDER_STATE_DATA_OVERSCAN = 20,
|
|
2315
|
+
|
|
2316
|
+
|
|
2317
|
+
GHOSTTY_RENDER_STATE_DATA_OVERSCAN_REQUEST = 21,
|
|
2318
|
+
GHOSTTY_RENDER_STATE_DATA_MAX_VALUE = 0x7FFFFFFF,
|
|
2319
|
+
} GhosttyRenderStateData;
|
|
2320
|
+
|
|
2321
|
+
typedef enum {
|
|
2322
|
+
|
|
2323
|
+
GHOSTTY_RENDER_STATE_OPTION_DIRTY = 0,
|
|
2324
|
+
|
|
2325
|
+
|
|
2326
|
+
GHOSTTY_RENDER_STATE_OPTION_OVERSCAN = 1,
|
|
2327
|
+
GHOSTTY_RENDER_STATE_OPTION_MAX_VALUE = 0x7FFFFFFF,
|
|
2328
|
+
} GhosttyRenderStateOption;
|
|
2329
|
+
|
|
2330
|
+
typedef enum {
|
|
2331
|
+
|
|
2332
|
+
GHOSTTY_RENDER_STATE_ROW_DATA_INVALID = 0,
|
|
2333
|
+
|
|
2334
|
+
|
|
2335
|
+
GHOSTTY_RENDER_STATE_ROW_DATA_DIRTY = 1,
|
|
2336
|
+
|
|
2337
|
+
|
|
2338
|
+
GHOSTTY_RENDER_STATE_ROW_DATA_RAW = 2,
|
|
2339
|
+
|
|
2340
|
+
|
|
2341
|
+
GHOSTTY_RENDER_STATE_ROW_DATA_CELLS = 3,
|
|
2342
|
+
|
|
2343
|
+
|
|
2344
|
+
GHOSTTY_RENDER_STATE_ROW_DATA_SELECTION = 4,
|
|
2345
|
+
|
|
2346
|
+
|
|
2347
|
+
GHOSTTY_RENDER_STATE_ROW_DATA_CELLS_RAW = 5,
|
|
2348
|
+
|
|
2349
|
+
|
|
2350
|
+
GHOSTTY_RENDER_STATE_ROW_DATA_VIEWPORT_Y = 6,
|
|
2351
|
+
|
|
2352
|
+
|
|
2353
|
+
GHOSTTY_RENDER_STATE_ROW_DATA_ID = 7,
|
|
2354
|
+
GHOSTTY_RENDER_STATE_ROW_DATA_MAX_VALUE = 0x7FFFFFFF,
|
|
2355
|
+
} GhosttyRenderStateRowData;
|
|
2356
|
+
|
|
2357
|
+
typedef enum {
|
|
2358
|
+
|
|
2359
|
+
GHOSTTY_RENDER_STATE_ROW_OPTION_DIRTY = 0,
|
|
2360
|
+
GHOSTTY_RENDER_STATE_ROW_OPTION_MAX_VALUE = 0x7FFFFFFF,
|
|
2361
|
+
} GhosttyRenderStateRowOption;
|
|
2362
|
+
|
|
2363
|
+
typedef struct {
|
|
2364
|
+
|
|
2365
|
+
size_t size;
|
|
2366
|
+
|
|
2367
|
+
|
|
2368
|
+
uint16_t start_x;
|
|
2369
|
+
|
|
2370
|
+
|
|
2371
|
+
uint16_t end_x;
|
|
2372
|
+
} GhosttyRenderStateRowSelection;
|
|
2373
|
+
|
|
2374
|
+
typedef struct {
|
|
2375
|
+
|
|
2376
|
+
size_t size;
|
|
2377
|
+
|
|
2378
|
+
|
|
2379
|
+
bool viewport_has_value;
|
|
2380
|
+
|
|
2381
|
+
|
|
2382
|
+
uint16_t viewport_x;
|
|
2383
|
+
|
|
2384
|
+
|
|
2385
|
+
uint16_t viewport_y;
|
|
2386
|
+
|
|
2387
|
+
|
|
2388
|
+
bool wide_tail;
|
|
2389
|
+
|
|
2390
|
+
|
|
2391
|
+
bool visible;
|
|
2392
|
+
|
|
2393
|
+
|
|
2394
|
+
bool blinking;
|
|
2395
|
+
|
|
2396
|
+
|
|
2397
|
+
bool password_input;
|
|
2398
|
+
|
|
2399
|
+
|
|
2400
|
+
GhosttyRenderStateCursorVisualStyle visual_style;
|
|
2401
|
+
} GhosttyRenderStateCursor;
|
|
2402
|
+
|
|
2403
|
+
typedef struct {
|
|
2404
|
+
|
|
2405
|
+
size_t size;
|
|
2406
|
+
|
|
2407
|
+
|
|
2408
|
+
GhosttyColorRgb background;
|
|
2409
|
+
|
|
2410
|
+
|
|
2411
|
+
GhosttyColorRgb foreground;
|
|
2412
|
+
|
|
2413
|
+
|
|
2414
|
+
GhosttyColorRgb cursor;
|
|
2415
|
+
|
|
2416
|
+
|
|
2417
|
+
bool cursor_has_value;
|
|
2418
|
+
|
|
2419
|
+
|
|
2420
|
+
GhosttyColorRgb palette[256];
|
|
2421
|
+
} GhosttyRenderStateColors;
|
|
2422
|
+
|
|
2423
|
+
GhosttyResult ghostty_render_state_new(const GhosttyAllocator* allocator,
|
|
2424
|
+
GhosttyRenderState* state);
|
|
2425
|
+
|
|
2426
|
+
void ghostty_render_state_free(GhosttyRenderState state);
|
|
2427
|
+
|
|
2428
|
+
GhosttyResult ghostty_render_state_update(GhosttyRenderState state,
|
|
2429
|
+
GhosttyTerminal terminal);
|
|
2430
|
+
|
|
2431
|
+
GhosttyResult ghostty_render_state_begin_update(GhosttyRenderState state,
|
|
2432
|
+
GhosttyTerminal terminal);
|
|
2433
|
+
|
|
2434
|
+
GhosttyResult ghostty_render_state_end_update(GhosttyRenderState state);
|
|
2435
|
+
|
|
2436
|
+
GhosttyResult ghostty_render_state_clean(GhosttyRenderState state);
|
|
2437
|
+
|
|
2438
|
+
GhosttyResult ghostty_render_state_get(GhosttyRenderState state,
|
|
2439
|
+
GhosttyRenderStateData data,
|
|
2440
|
+
void* out);
|
|
2441
|
+
|
|
2442
|
+
GhosttyResult ghostty_render_state_get_multi(
|
|
2443
|
+
GhosttyRenderState state,
|
|
2444
|
+
size_t count,
|
|
2445
|
+
const GhosttyRenderStateData* keys,
|
|
2446
|
+
void** values,
|
|
2447
|
+
size_t* out_written);
|
|
2448
|
+
|
|
2449
|
+
GhosttyResult ghostty_render_state_set(GhosttyRenderState state,
|
|
2450
|
+
GhosttyRenderStateOption option,
|
|
2451
|
+
const void* value);
|
|
2452
|
+
|
|
2453
|
+
GhosttyResult ghostty_render_state_row_iterator_new(
|
|
2454
|
+
const GhosttyAllocator* allocator,
|
|
2455
|
+
GhosttyRenderStateRowIterator* out_iterator);
|
|
2456
|
+
|
|
2457
|
+
void ghostty_render_state_row_iterator_free(GhosttyRenderStateRowIterator iterator);
|
|
2458
|
+
|
|
2459
|
+
bool ghostty_render_state_row_iterator_next(GhosttyRenderStateRowIterator iterator);
|
|
2460
|
+
|
|
2461
|
+
bool ghostty_render_state_row_iterator_next_dirty(
|
|
2462
|
+
GhosttyRenderStateRowIterator iterator,
|
|
2463
|
+
uint16_t* out_y);
|
|
2464
|
+
|
|
2465
|
+
GhosttyResult ghostty_render_state_row_get(
|
|
2466
|
+
GhosttyRenderStateRowIterator iterator,
|
|
2467
|
+
GhosttyRenderStateRowData data,
|
|
2468
|
+
void* out);
|
|
2469
|
+
|
|
2470
|
+
GhosttyResult ghostty_render_state_row_get_multi(
|
|
2471
|
+
GhosttyRenderStateRowIterator iterator,
|
|
2472
|
+
size_t count,
|
|
2473
|
+
const GhosttyRenderStateRowData* keys,
|
|
2474
|
+
void** values,
|
|
2475
|
+
size_t* out_written);
|
|
2476
|
+
|
|
2477
|
+
GhosttyResult ghostty_render_state_row_set(
|
|
2478
|
+
GhosttyRenderStateRowIterator iterator,
|
|
2479
|
+
GhosttyRenderStateRowOption option,
|
|
2480
|
+
const void* value);
|
|
2481
|
+
|
|
2482
|
+
GhosttyResult ghostty_render_state_row_cells_new(
|
|
2483
|
+
const GhosttyAllocator* allocator,
|
|
2484
|
+
GhosttyRenderStateRowCells* out_cells);
|
|
2485
|
+
|
|
2486
|
+
typedef enum {
|
|
2487
|
+
|
|
2488
|
+
GHOSTTY_RENDER_STATE_ROW_CELLS_DATA_INVALID = 0,
|
|
2489
|
+
|
|
2490
|
+
|
|
2491
|
+
GHOSTTY_RENDER_STATE_ROW_CELLS_DATA_RAW = 1,
|
|
2492
|
+
|
|
2493
|
+
|
|
2494
|
+
GHOSTTY_RENDER_STATE_ROW_CELLS_DATA_STYLE = 2,
|
|
2495
|
+
|
|
2496
|
+
|
|
2497
|
+
GHOSTTY_RENDER_STATE_ROW_CELLS_DATA_GRAPHEMES_LEN = 3,
|
|
2498
|
+
|
|
2499
|
+
|
|
2500
|
+
GHOSTTY_RENDER_STATE_ROW_CELLS_DATA_GRAPHEMES_BUF = 4,
|
|
2501
|
+
|
|
2502
|
+
|
|
2503
|
+
GHOSTTY_RENDER_STATE_ROW_CELLS_DATA_BG_COLOR = 5,
|
|
2504
|
+
|
|
2505
|
+
|
|
2506
|
+
GHOSTTY_RENDER_STATE_ROW_CELLS_DATA_FG_COLOR = 6,
|
|
2507
|
+
|
|
2508
|
+
|
|
2509
|
+
GHOSTTY_RENDER_STATE_ROW_CELLS_DATA_SELECTED = 7,
|
|
2510
|
+
|
|
2511
|
+
|
|
2512
|
+
GHOSTTY_RENDER_STATE_ROW_CELLS_DATA_HAS_STYLING = 8,
|
|
2513
|
+
|
|
2514
|
+
|
|
2515
|
+
GHOSTTY_RENDER_STATE_ROW_CELLS_DATA_GRAPHEMES_UTF8 = 9,
|
|
2516
|
+
GHOSTTY_RENDER_STATE_ROW_CELLS_DATA_MAX_VALUE = 0x7FFFFFFF,
|
|
2517
|
+
} GhosttyRenderStateRowCellsData;
|
|
2518
|
+
|
|
2519
|
+
bool ghostty_render_state_row_cells_next(GhosttyRenderStateRowCells cells);
|
|
2520
|
+
|
|
2521
|
+
GhosttyResult ghostty_render_state_row_cells_select(
|
|
2522
|
+
GhosttyRenderStateRowCells cells, uint16_t x);
|
|
2523
|
+
|
|
2524
|
+
GhosttyResult ghostty_render_state_row_cells_get(
|
|
2525
|
+
GhosttyRenderStateRowCells cells,
|
|
2526
|
+
GhosttyRenderStateRowCellsData data,
|
|
2527
|
+
void* out);
|
|
2528
|
+
|
|
2529
|
+
GhosttyResult ghostty_render_state_row_cells_get_multi(
|
|
2530
|
+
GhosttyRenderStateRowCells cells,
|
|
2531
|
+
size_t count,
|
|
2532
|
+
const GhosttyRenderStateRowCellsData* keys,
|
|
2533
|
+
void** values,
|
|
2534
|
+
size_t* out_written);
|
|
2535
|
+
|
|
2536
|
+
void ghostty_render_state_row_cells_free(GhosttyRenderStateRowCells cells);
|
|
2537
|
+
|
|
2538
|
+
/* --- grid_ref_tracked.h --- */
|
|
2539
|
+
|
|
2540
|
+
void ghostty_tracked_grid_ref_free(GhosttyTrackedGridRef ref);
|
|
2541
|
+
|
|
2542
|
+
bool ghostty_tracked_grid_ref_has_value(
|
|
2543
|
+
GhosttyTrackedGridRef ref);
|
|
2544
|
+
|
|
2545
|
+
GhosttyResult ghostty_tracked_grid_ref_point(
|
|
2546
|
+
GhosttyTrackedGridRef ref,
|
|
2547
|
+
GhosttyPointTag tag,
|
|
2548
|
+
GhosttyPointCoordinate *out_point);
|
|
2549
|
+
|
|
2550
|
+
GhosttyResult ghostty_tracked_grid_ref_set(
|
|
2551
|
+
GhosttyTrackedGridRef ref,
|
|
2552
|
+
GhosttyTerminal terminal,
|
|
2553
|
+
GhosttyPoint point);
|
|
2554
|
+
|
|
2555
|
+
GhosttyResult ghostty_tracked_grid_ref_snapshot(
|
|
2556
|
+
GhosttyTrackedGridRef ref,
|
|
2557
|
+
GhosttyGridRef *out_ref);
|
|
2558
|
+
|
|
2559
|
+
/* --- sgr.h --- */
|
|
2560
|
+
|
|
2561
|
+
typedef enum {
|
|
2562
|
+
GHOSTTY_SGR_ATTR_UNSET = 0,
|
|
2563
|
+
GHOSTTY_SGR_ATTR_UNKNOWN = 1,
|
|
2564
|
+
GHOSTTY_SGR_ATTR_BOLD = 2,
|
|
2565
|
+
GHOSTTY_SGR_ATTR_RESET_BOLD = 3,
|
|
2566
|
+
GHOSTTY_SGR_ATTR_ITALIC = 4,
|
|
2567
|
+
GHOSTTY_SGR_ATTR_RESET_ITALIC = 5,
|
|
2568
|
+
GHOSTTY_SGR_ATTR_FAINT = 6,
|
|
2569
|
+
GHOSTTY_SGR_ATTR_UNDERLINE = 7,
|
|
2570
|
+
GHOSTTY_SGR_ATTR_UNDERLINE_COLOR = 8,
|
|
2571
|
+
GHOSTTY_SGR_ATTR_UNDERLINE_COLOR_256 = 9,
|
|
2572
|
+
GHOSTTY_SGR_ATTR_RESET_UNDERLINE_COLOR = 10,
|
|
2573
|
+
GHOSTTY_SGR_ATTR_OVERLINE = 11,
|
|
2574
|
+
GHOSTTY_SGR_ATTR_RESET_OVERLINE = 12,
|
|
2575
|
+
GHOSTTY_SGR_ATTR_BLINK = 13,
|
|
2576
|
+
GHOSTTY_SGR_ATTR_RESET_BLINK = 14,
|
|
2577
|
+
GHOSTTY_SGR_ATTR_INVERSE = 15,
|
|
2578
|
+
GHOSTTY_SGR_ATTR_RESET_INVERSE = 16,
|
|
2579
|
+
GHOSTTY_SGR_ATTR_INVISIBLE = 17,
|
|
2580
|
+
GHOSTTY_SGR_ATTR_RESET_INVISIBLE = 18,
|
|
2581
|
+
GHOSTTY_SGR_ATTR_STRIKETHROUGH = 19,
|
|
2582
|
+
GHOSTTY_SGR_ATTR_RESET_STRIKETHROUGH = 20,
|
|
2583
|
+
GHOSTTY_SGR_ATTR_DIRECT_COLOR_FG = 21,
|
|
2584
|
+
GHOSTTY_SGR_ATTR_DIRECT_COLOR_BG = 22,
|
|
2585
|
+
GHOSTTY_SGR_ATTR_BG_8 = 23,
|
|
2586
|
+
GHOSTTY_SGR_ATTR_FG_8 = 24,
|
|
2587
|
+
GHOSTTY_SGR_ATTR_RESET_FG = 25,
|
|
2588
|
+
GHOSTTY_SGR_ATTR_RESET_BG = 26,
|
|
2589
|
+
GHOSTTY_SGR_ATTR_BRIGHT_BG_8 = 27,
|
|
2590
|
+
GHOSTTY_SGR_ATTR_BRIGHT_FG_8 = 28,
|
|
2591
|
+
GHOSTTY_SGR_ATTR_BG_256 = 29,
|
|
2592
|
+
GHOSTTY_SGR_ATTR_FG_256 = 30,
|
|
2593
|
+
GHOSTTY_SGR_ATTR_MAX_VALUE = 0x7FFFFFFF,
|
|
2594
|
+
} GhosttySgrAttributeTag;
|
|
2595
|
+
|
|
2596
|
+
typedef enum {
|
|
2597
|
+
GHOSTTY_SGR_UNDERLINE_NONE = 0,
|
|
2598
|
+
GHOSTTY_SGR_UNDERLINE_SINGLE = 1,
|
|
2599
|
+
GHOSTTY_SGR_UNDERLINE_DOUBLE = 2,
|
|
2600
|
+
GHOSTTY_SGR_UNDERLINE_CURLY = 3,
|
|
2601
|
+
GHOSTTY_SGR_UNDERLINE_DOTTED = 4,
|
|
2602
|
+
GHOSTTY_SGR_UNDERLINE_DASHED = 5,
|
|
2603
|
+
GHOSTTY_SGR_UNDERLINE_MAX_VALUE = 0x7FFFFFFF,
|
|
2604
|
+
} GhosttySgrUnderline;
|
|
2605
|
+
|
|
2606
|
+
typedef struct {
|
|
2607
|
+
const uint16_t* full_ptr;
|
|
2608
|
+
size_t full_len;
|
|
2609
|
+
const uint16_t* partial_ptr;
|
|
2610
|
+
size_t partial_len;
|
|
2611
|
+
} GhosttySgrUnknown;
|
|
2612
|
+
|
|
2613
|
+
typedef union {
|
|
2614
|
+
GhosttySgrUnknown unknown;
|
|
2615
|
+
GhosttySgrUnderline underline;
|
|
2616
|
+
GhosttyColorRgb underline_color;
|
|
2617
|
+
GhosttyColorPaletteIndex underline_color_256;
|
|
2618
|
+
GhosttyColorRgb direct_color_fg;
|
|
2619
|
+
GhosttyColorRgb direct_color_bg;
|
|
2620
|
+
GhosttyColorPaletteIndex bg_8;
|
|
2621
|
+
GhosttyColorPaletteIndex fg_8;
|
|
2622
|
+
GhosttyColorPaletteIndex bright_bg_8;
|
|
2623
|
+
GhosttyColorPaletteIndex bright_fg_8;
|
|
2624
|
+
GhosttyColorPaletteIndex bg_256;
|
|
2625
|
+
GhosttyColorPaletteIndex fg_256;
|
|
2626
|
+
uint64_t _padding[8];
|
|
2627
|
+
} GhosttySgrAttributeValue;
|
|
2628
|
+
|
|
2629
|
+
typedef struct {
|
|
2630
|
+
GhosttySgrAttributeTag tag;
|
|
2631
|
+
GhosttySgrAttributeValue value;
|
|
2632
|
+
} GhosttySgrAttribute;
|
|
2633
|
+
|
|
2634
|
+
GhosttyResult ghostty_sgr_new(const GhosttyAllocator* allocator,
|
|
2635
|
+
GhosttySgrParser* parser);
|
|
2636
|
+
|
|
2637
|
+
void ghostty_sgr_free(GhosttySgrParser parser);
|
|
2638
|
+
|
|
2639
|
+
void ghostty_sgr_reset(GhosttySgrParser parser);
|
|
2640
|
+
|
|
2641
|
+
GhosttyResult ghostty_sgr_set_params(GhosttySgrParser parser,
|
|
2642
|
+
const uint16_t* params,
|
|
2643
|
+
const char* separators,
|
|
2644
|
+
size_t len);
|
|
2645
|
+
|
|
2646
|
+
bool ghostty_sgr_next(GhosttySgrParser parser, GhosttySgrAttribute* attr);
|
|
2647
|
+
|
|
2648
|
+
size_t ghostty_sgr_unknown_full(GhosttySgrUnknown unknown,
|
|
2649
|
+
const uint16_t** ptr);
|
|
2650
|
+
|
|
2651
|
+
size_t ghostty_sgr_unknown_partial(GhosttySgrUnknown unknown,
|
|
2652
|
+
const uint16_t** ptr);
|
|
2653
|
+
|
|
2654
|
+
GhosttySgrAttributeTag ghostty_sgr_attribute_tag(GhosttySgrAttribute attr);
|
|
2655
|
+
|
|
2656
|
+
GhosttySgrAttributeValue* ghostty_sgr_attribute_value(
|
|
2657
|
+
GhosttySgrAttribute* attr);
|
|
2658
|
+
|
|
2659
|
+
/* --- sys.h --- */
|
|
2660
|
+
|
|
2661
|
+
typedef struct {
|
|
2662
|
+
|
|
2663
|
+
uint32_t width;
|
|
2664
|
+
|
|
2665
|
+
|
|
2666
|
+
uint32_t height;
|
|
2667
|
+
|
|
2668
|
+
|
|
2669
|
+
uint8_t* data;
|
|
2670
|
+
|
|
2671
|
+
|
|
2672
|
+
size_t data_len;
|
|
2673
|
+
} GhosttySysImage;
|
|
2674
|
+
|
|
2675
|
+
typedef enum {
|
|
2676
|
+
GHOSTTY_SYS_LOG_LEVEL_ERROR = 0,
|
|
2677
|
+
GHOSTTY_SYS_LOG_LEVEL_WARNING = 1,
|
|
2678
|
+
GHOSTTY_SYS_LOG_LEVEL_INFO = 2,
|
|
2679
|
+
GHOSTTY_SYS_LOG_LEVEL_DEBUG = 3,
|
|
2680
|
+
GHOSTTY_SYS_LOG_LEVEL_MAX_VALUE = 0x7FFFFFFF,
|
|
2681
|
+
} GhosttySysLogLevel;
|
|
2682
|
+
|
|
2683
|
+
typedef void (*GhosttySysLogFn)(
|
|
2684
|
+
void* userdata,
|
|
2685
|
+
GhosttySysLogLevel level,
|
|
2686
|
+
const uint8_t* scope,
|
|
2687
|
+
size_t scope_len,
|
|
2688
|
+
const uint8_t* message,
|
|
2689
|
+
size_t message_len);
|
|
2690
|
+
|
|
2691
|
+
typedef bool (*GhosttySysDecodePngFn)(
|
|
2692
|
+
void* userdata,
|
|
2693
|
+
const GhosttyAllocator* allocator,
|
|
2694
|
+
const uint8_t* data,
|
|
2695
|
+
size_t data_len,
|
|
2696
|
+
GhosttySysImage* out);
|
|
2697
|
+
|
|
2698
|
+
typedef bool (*GhosttySysRandomSecureFn)(
|
|
2699
|
+
void* userdata,
|
|
2700
|
+
uint8_t* buf,
|
|
2701
|
+
size_t len);
|
|
2702
|
+
|
|
2703
|
+
typedef enum {
|
|
2704
|
+
|
|
2705
|
+
GHOSTTY_SYS_OPT_USERDATA = 0,
|
|
2706
|
+
|
|
2707
|
+
|
|
2708
|
+
GHOSTTY_SYS_OPT_DECODE_PNG = 1,
|
|
2709
|
+
|
|
2710
|
+
|
|
2711
|
+
GHOSTTY_SYS_OPT_LOG = 2,
|
|
2712
|
+
|
|
2713
|
+
|
|
2714
|
+
GHOSTTY_SYS_OPT_RANDOM_SECURE = 3,
|
|
2715
|
+
GHOSTTY_SYS_OPT_MAX_VALUE = 0x7FFFFFFF,
|
|
2716
|
+
} GhosttySysOption;
|
|
2717
|
+
|
|
2718
|
+
GhosttyResult ghostty_sys_set(GhosttySysOption option,
|
|
2719
|
+
const void* value);
|
|
2720
|
+
|
|
2721
|
+
void ghostty_sys_log_stderr(void* userdata,
|
|
2722
|
+
GhosttySysLogLevel level,
|
|
2723
|
+
const uint8_t* scope,
|
|
2724
|
+
size_t scope_len,
|
|
2725
|
+
const uint8_t* message,
|
|
2726
|
+
size_t message_len);
|
|
2727
|
+
|
|
2728
|
+
/* --- event.h --- */
|
|
2729
|
+
|
|
2730
|
+
typedef struct GhosttyKeyEventImpl *GhosttyKeyEvent;
|
|
2731
|
+
|
|
2732
|
+
typedef enum {
|
|
2733
|
+
|
|
2734
|
+
GHOSTTY_KEY_ACTION_RELEASE = 0,
|
|
2735
|
+
|
|
2736
|
+
GHOSTTY_KEY_ACTION_PRESS = 1,
|
|
2737
|
+
|
|
2738
|
+
GHOSTTY_KEY_ACTION_REPEAT = 2,
|
|
2739
|
+
GHOSTTY_KEY_ACTION_MAX_VALUE = 0x7FFFFFFF,
|
|
2740
|
+
} GhosttyKeyAction;
|
|
2741
|
+
|
|
2742
|
+
typedef uint16_t GhosttyMods;
|
|
2743
|
+
|
|
2744
|
+
typedef enum {
|
|
2745
|
+
GHOSTTY_KEY_UNIDENTIFIED = 0,
|
|
2746
|
+
|
|
2747
|
+
|
|
2748
|
+
GHOSTTY_KEY_BACKQUOTE,
|
|
2749
|
+
GHOSTTY_KEY_BACKSLASH,
|
|
2750
|
+
GHOSTTY_KEY_BRACKET_LEFT,
|
|
2751
|
+
GHOSTTY_KEY_BRACKET_RIGHT,
|
|
2752
|
+
GHOSTTY_KEY_COMMA,
|
|
2753
|
+
GHOSTTY_KEY_DIGIT_0,
|
|
2754
|
+
GHOSTTY_KEY_DIGIT_1,
|
|
2755
|
+
GHOSTTY_KEY_DIGIT_2,
|
|
2756
|
+
GHOSTTY_KEY_DIGIT_3,
|
|
2757
|
+
GHOSTTY_KEY_DIGIT_4,
|
|
2758
|
+
GHOSTTY_KEY_DIGIT_5,
|
|
2759
|
+
GHOSTTY_KEY_DIGIT_6,
|
|
2760
|
+
GHOSTTY_KEY_DIGIT_7,
|
|
2761
|
+
GHOSTTY_KEY_DIGIT_8,
|
|
2762
|
+
GHOSTTY_KEY_DIGIT_9,
|
|
2763
|
+
GHOSTTY_KEY_EQUAL,
|
|
2764
|
+
GHOSTTY_KEY_INTL_BACKSLASH,
|
|
2765
|
+
GHOSTTY_KEY_INTL_RO,
|
|
2766
|
+
GHOSTTY_KEY_INTL_YEN,
|
|
2767
|
+
GHOSTTY_KEY_A,
|
|
2768
|
+
GHOSTTY_KEY_B,
|
|
2769
|
+
GHOSTTY_KEY_C,
|
|
2770
|
+
GHOSTTY_KEY_D,
|
|
2771
|
+
GHOSTTY_KEY_E,
|
|
2772
|
+
GHOSTTY_KEY_F,
|
|
2773
|
+
GHOSTTY_KEY_G,
|
|
2774
|
+
GHOSTTY_KEY_H,
|
|
2775
|
+
GHOSTTY_KEY_I,
|
|
2776
|
+
GHOSTTY_KEY_J,
|
|
2777
|
+
GHOSTTY_KEY_K,
|
|
2778
|
+
GHOSTTY_KEY_L,
|
|
2779
|
+
GHOSTTY_KEY_M,
|
|
2780
|
+
GHOSTTY_KEY_N,
|
|
2781
|
+
GHOSTTY_KEY_O,
|
|
2782
|
+
GHOSTTY_KEY_P,
|
|
2783
|
+
GHOSTTY_KEY_Q,
|
|
2784
|
+
GHOSTTY_KEY_R,
|
|
2785
|
+
GHOSTTY_KEY_S,
|
|
2786
|
+
GHOSTTY_KEY_T,
|
|
2787
|
+
GHOSTTY_KEY_U,
|
|
2788
|
+
GHOSTTY_KEY_V,
|
|
2789
|
+
GHOSTTY_KEY_W,
|
|
2790
|
+
GHOSTTY_KEY_X,
|
|
2791
|
+
GHOSTTY_KEY_Y,
|
|
2792
|
+
GHOSTTY_KEY_Z,
|
|
2793
|
+
GHOSTTY_KEY_MINUS,
|
|
2794
|
+
GHOSTTY_KEY_PERIOD,
|
|
2795
|
+
GHOSTTY_KEY_QUOTE,
|
|
2796
|
+
GHOSTTY_KEY_SEMICOLON,
|
|
2797
|
+
GHOSTTY_KEY_SLASH,
|
|
2798
|
+
|
|
2799
|
+
|
|
2800
|
+
GHOSTTY_KEY_ALT_LEFT,
|
|
2801
|
+
GHOSTTY_KEY_ALT_RIGHT,
|
|
2802
|
+
GHOSTTY_KEY_BACKSPACE,
|
|
2803
|
+
GHOSTTY_KEY_CAPS_LOCK,
|
|
2804
|
+
GHOSTTY_KEY_CONTEXT_MENU,
|
|
2805
|
+
GHOSTTY_KEY_CONTROL_LEFT,
|
|
2806
|
+
GHOSTTY_KEY_CONTROL_RIGHT,
|
|
2807
|
+
GHOSTTY_KEY_ENTER,
|
|
2808
|
+
GHOSTTY_KEY_META_LEFT,
|
|
2809
|
+
GHOSTTY_KEY_META_RIGHT,
|
|
2810
|
+
GHOSTTY_KEY_SHIFT_LEFT,
|
|
2811
|
+
GHOSTTY_KEY_SHIFT_RIGHT,
|
|
2812
|
+
GHOSTTY_KEY_SPACE,
|
|
2813
|
+
GHOSTTY_KEY_TAB,
|
|
2814
|
+
GHOSTTY_KEY_CONVERT,
|
|
2815
|
+
GHOSTTY_KEY_KANA_MODE,
|
|
2816
|
+
GHOSTTY_KEY_NON_CONVERT,
|
|
2817
|
+
|
|
2818
|
+
|
|
2819
|
+
GHOSTTY_KEY_DELETE,
|
|
2820
|
+
GHOSTTY_KEY_END,
|
|
2821
|
+
GHOSTTY_KEY_HELP,
|
|
2822
|
+
GHOSTTY_KEY_HOME,
|
|
2823
|
+
GHOSTTY_KEY_INSERT,
|
|
2824
|
+
GHOSTTY_KEY_PAGE_DOWN,
|
|
2825
|
+
GHOSTTY_KEY_PAGE_UP,
|
|
2826
|
+
|
|
2827
|
+
|
|
2828
|
+
GHOSTTY_KEY_ARROW_DOWN,
|
|
2829
|
+
GHOSTTY_KEY_ARROW_LEFT,
|
|
2830
|
+
GHOSTTY_KEY_ARROW_RIGHT,
|
|
2831
|
+
GHOSTTY_KEY_ARROW_UP,
|
|
2832
|
+
|
|
2833
|
+
|
|
2834
|
+
GHOSTTY_KEY_NUM_LOCK,
|
|
2835
|
+
GHOSTTY_KEY_NUMPAD_0,
|
|
2836
|
+
GHOSTTY_KEY_NUMPAD_1,
|
|
2837
|
+
GHOSTTY_KEY_NUMPAD_2,
|
|
2838
|
+
GHOSTTY_KEY_NUMPAD_3,
|
|
2839
|
+
GHOSTTY_KEY_NUMPAD_4,
|
|
2840
|
+
GHOSTTY_KEY_NUMPAD_5,
|
|
2841
|
+
GHOSTTY_KEY_NUMPAD_6,
|
|
2842
|
+
GHOSTTY_KEY_NUMPAD_7,
|
|
2843
|
+
GHOSTTY_KEY_NUMPAD_8,
|
|
2844
|
+
GHOSTTY_KEY_NUMPAD_9,
|
|
2845
|
+
GHOSTTY_KEY_NUMPAD_ADD,
|
|
2846
|
+
GHOSTTY_KEY_NUMPAD_BACKSPACE,
|
|
2847
|
+
GHOSTTY_KEY_NUMPAD_CLEAR,
|
|
2848
|
+
GHOSTTY_KEY_NUMPAD_CLEAR_ENTRY,
|
|
2849
|
+
GHOSTTY_KEY_NUMPAD_COMMA,
|
|
2850
|
+
GHOSTTY_KEY_NUMPAD_DECIMAL,
|
|
2851
|
+
GHOSTTY_KEY_NUMPAD_DIVIDE,
|
|
2852
|
+
GHOSTTY_KEY_NUMPAD_ENTER,
|
|
2853
|
+
GHOSTTY_KEY_NUMPAD_EQUAL,
|
|
2854
|
+
GHOSTTY_KEY_NUMPAD_MEMORY_ADD,
|
|
2855
|
+
GHOSTTY_KEY_NUMPAD_MEMORY_CLEAR,
|
|
2856
|
+
GHOSTTY_KEY_NUMPAD_MEMORY_RECALL,
|
|
2857
|
+
GHOSTTY_KEY_NUMPAD_MEMORY_STORE,
|
|
2858
|
+
GHOSTTY_KEY_NUMPAD_MEMORY_SUBTRACT,
|
|
2859
|
+
GHOSTTY_KEY_NUMPAD_MULTIPLY,
|
|
2860
|
+
GHOSTTY_KEY_NUMPAD_PAREN_LEFT,
|
|
2861
|
+
GHOSTTY_KEY_NUMPAD_PAREN_RIGHT,
|
|
2862
|
+
GHOSTTY_KEY_NUMPAD_SUBTRACT,
|
|
2863
|
+
GHOSTTY_KEY_NUMPAD_SEPARATOR,
|
|
2864
|
+
GHOSTTY_KEY_NUMPAD_UP,
|
|
2865
|
+
GHOSTTY_KEY_NUMPAD_DOWN,
|
|
2866
|
+
GHOSTTY_KEY_NUMPAD_RIGHT,
|
|
2867
|
+
GHOSTTY_KEY_NUMPAD_LEFT,
|
|
2868
|
+
GHOSTTY_KEY_NUMPAD_BEGIN,
|
|
2869
|
+
GHOSTTY_KEY_NUMPAD_HOME,
|
|
2870
|
+
GHOSTTY_KEY_NUMPAD_END,
|
|
2871
|
+
GHOSTTY_KEY_NUMPAD_INSERT,
|
|
2872
|
+
GHOSTTY_KEY_NUMPAD_DELETE,
|
|
2873
|
+
GHOSTTY_KEY_NUMPAD_PAGE_UP,
|
|
2874
|
+
GHOSTTY_KEY_NUMPAD_PAGE_DOWN,
|
|
2875
|
+
|
|
2876
|
+
|
|
2877
|
+
GHOSTTY_KEY_ESCAPE,
|
|
2878
|
+
GHOSTTY_KEY_F1,
|
|
2879
|
+
GHOSTTY_KEY_F2,
|
|
2880
|
+
GHOSTTY_KEY_F3,
|
|
2881
|
+
GHOSTTY_KEY_F4,
|
|
2882
|
+
GHOSTTY_KEY_F5,
|
|
2883
|
+
GHOSTTY_KEY_F6,
|
|
2884
|
+
GHOSTTY_KEY_F7,
|
|
2885
|
+
GHOSTTY_KEY_F8,
|
|
2886
|
+
GHOSTTY_KEY_F9,
|
|
2887
|
+
GHOSTTY_KEY_F10,
|
|
2888
|
+
GHOSTTY_KEY_F11,
|
|
2889
|
+
GHOSTTY_KEY_F12,
|
|
2890
|
+
GHOSTTY_KEY_F13,
|
|
2891
|
+
GHOSTTY_KEY_F14,
|
|
2892
|
+
GHOSTTY_KEY_F15,
|
|
2893
|
+
GHOSTTY_KEY_F16,
|
|
2894
|
+
GHOSTTY_KEY_F17,
|
|
2895
|
+
GHOSTTY_KEY_F18,
|
|
2896
|
+
GHOSTTY_KEY_F19,
|
|
2897
|
+
GHOSTTY_KEY_F20,
|
|
2898
|
+
GHOSTTY_KEY_F21,
|
|
2899
|
+
GHOSTTY_KEY_F22,
|
|
2900
|
+
GHOSTTY_KEY_F23,
|
|
2901
|
+
GHOSTTY_KEY_F24,
|
|
2902
|
+
GHOSTTY_KEY_F25,
|
|
2903
|
+
GHOSTTY_KEY_FN,
|
|
2904
|
+
GHOSTTY_KEY_FN_LOCK,
|
|
2905
|
+
GHOSTTY_KEY_PRINT_SCREEN,
|
|
2906
|
+
GHOSTTY_KEY_SCROLL_LOCK,
|
|
2907
|
+
GHOSTTY_KEY_PAUSE,
|
|
2908
|
+
|
|
2909
|
+
|
|
2910
|
+
GHOSTTY_KEY_BROWSER_BACK,
|
|
2911
|
+
GHOSTTY_KEY_BROWSER_FAVORITES,
|
|
2912
|
+
GHOSTTY_KEY_BROWSER_FORWARD,
|
|
2913
|
+
GHOSTTY_KEY_BROWSER_HOME,
|
|
2914
|
+
GHOSTTY_KEY_BROWSER_REFRESH,
|
|
2915
|
+
GHOSTTY_KEY_BROWSER_SEARCH,
|
|
2916
|
+
GHOSTTY_KEY_BROWSER_STOP,
|
|
2917
|
+
GHOSTTY_KEY_EJECT,
|
|
2918
|
+
GHOSTTY_KEY_LAUNCH_APP_1,
|
|
2919
|
+
GHOSTTY_KEY_LAUNCH_APP_2,
|
|
2920
|
+
GHOSTTY_KEY_LAUNCH_MAIL,
|
|
2921
|
+
GHOSTTY_KEY_MEDIA_PLAY_PAUSE,
|
|
2922
|
+
GHOSTTY_KEY_MEDIA_SELECT,
|
|
2923
|
+
GHOSTTY_KEY_MEDIA_STOP,
|
|
2924
|
+
GHOSTTY_KEY_MEDIA_TRACK_NEXT,
|
|
2925
|
+
GHOSTTY_KEY_MEDIA_TRACK_PREVIOUS,
|
|
2926
|
+
GHOSTTY_KEY_POWER,
|
|
2927
|
+
GHOSTTY_KEY_SLEEP,
|
|
2928
|
+
GHOSTTY_KEY_AUDIO_VOLUME_DOWN,
|
|
2929
|
+
GHOSTTY_KEY_AUDIO_VOLUME_MUTE,
|
|
2930
|
+
GHOSTTY_KEY_AUDIO_VOLUME_UP,
|
|
2931
|
+
GHOSTTY_KEY_WAKE_UP,
|
|
2932
|
+
|
|
2933
|
+
|
|
2934
|
+
GHOSTTY_KEY_COPY,
|
|
2935
|
+
GHOSTTY_KEY_CUT,
|
|
2936
|
+
GHOSTTY_KEY_PASTE,
|
|
2937
|
+
GHOSTTY_KEY_MAX_VALUE = 0x7FFFFFFF,
|
|
2938
|
+
} GhosttyKey;
|
|
2939
|
+
|
|
2940
|
+
GhosttyResult ghostty_key_event_new(const GhosttyAllocator *allocator, GhosttyKeyEvent *event);
|
|
2941
|
+
|
|
2942
|
+
void ghostty_key_event_free(GhosttyKeyEvent event);
|
|
2943
|
+
|
|
2944
|
+
void ghostty_key_event_set_action(GhosttyKeyEvent event, GhosttyKeyAction action);
|
|
2945
|
+
|
|
2946
|
+
GhosttyKeyAction ghostty_key_event_get_action(GhosttyKeyEvent event);
|
|
2947
|
+
|
|
2948
|
+
void ghostty_key_event_set_key(GhosttyKeyEvent event, GhosttyKey key);
|
|
2949
|
+
|
|
2950
|
+
GhosttyKey ghostty_key_event_get_key(GhosttyKeyEvent event);
|
|
2951
|
+
|
|
2952
|
+
void ghostty_key_event_set_mods(GhosttyKeyEvent event, GhosttyMods mods);
|
|
2953
|
+
|
|
2954
|
+
GhosttyMods ghostty_key_event_get_mods(GhosttyKeyEvent event);
|
|
2955
|
+
|
|
2956
|
+
void ghostty_key_event_set_consumed_mods(GhosttyKeyEvent event, GhosttyMods consumed_mods);
|
|
2957
|
+
|
|
2958
|
+
GhosttyMods ghostty_key_event_get_consumed_mods(GhosttyKeyEvent event);
|
|
2959
|
+
|
|
2960
|
+
void ghostty_key_event_set_composing(GhosttyKeyEvent event, bool composing);
|
|
2961
|
+
|
|
2962
|
+
bool ghostty_key_event_get_composing(GhosttyKeyEvent event);
|
|
2963
|
+
|
|
2964
|
+
void ghostty_key_event_set_utf8(GhosttyKeyEvent event, const char *utf8, size_t len);
|
|
2965
|
+
|
|
2966
|
+
const char *ghostty_key_event_get_utf8(GhosttyKeyEvent event, size_t *len);
|
|
2967
|
+
|
|
2968
|
+
void ghostty_key_event_set_unshifted_codepoint(GhosttyKeyEvent event, uint32_t codepoint);
|
|
2969
|
+
|
|
2970
|
+
uint32_t ghostty_key_event_get_unshifted_codepoint(GhosttyKeyEvent event);
|
|
2971
|
+
|
|
2972
|
+
/* --- encoder.h --- */
|
|
2973
|
+
|
|
2974
|
+
typedef struct GhosttyKeyEncoderImpl *GhosttyKeyEncoder;
|
|
2975
|
+
|
|
2976
|
+
typedef uint8_t GhosttyKittyKeyFlags;
|
|
2977
|
+
|
|
2978
|
+
typedef enum {
|
|
2979
|
+
|
|
2980
|
+
GHOSTTY_OPTION_AS_ALT_FALSE = 0,
|
|
2981
|
+
|
|
2982
|
+
GHOSTTY_OPTION_AS_ALT_TRUE = 1,
|
|
2983
|
+
|
|
2984
|
+
GHOSTTY_OPTION_AS_ALT_LEFT = 2,
|
|
2985
|
+
|
|
2986
|
+
GHOSTTY_OPTION_AS_ALT_RIGHT = 3,
|
|
2987
|
+
GHOSTTY_OPTION_AS_ALT_MAX_VALUE = 0x7FFFFFFF,
|
|
2988
|
+
} GhosttyOptionAsAlt;
|
|
2989
|
+
|
|
2990
|
+
typedef enum {
|
|
2991
|
+
|
|
2992
|
+
GHOSTTY_KEY_ENCODER_OPT_CURSOR_KEY_APPLICATION = 0,
|
|
2993
|
+
|
|
2994
|
+
|
|
2995
|
+
GHOSTTY_KEY_ENCODER_OPT_KEYPAD_KEY_APPLICATION = 1,
|
|
2996
|
+
|
|
2997
|
+
|
|
2998
|
+
GHOSTTY_KEY_ENCODER_OPT_IGNORE_KEYPAD_WITH_NUMLOCK = 2,
|
|
2999
|
+
|
|
3000
|
+
|
|
3001
|
+
GHOSTTY_KEY_ENCODER_OPT_ALT_ESC_PREFIX = 3,
|
|
3002
|
+
|
|
3003
|
+
|
|
3004
|
+
GHOSTTY_KEY_ENCODER_OPT_MODIFY_OTHER_KEYS_STATE_2 = 4,
|
|
3005
|
+
|
|
3006
|
+
|
|
3007
|
+
GHOSTTY_KEY_ENCODER_OPT_KITTY_FLAGS = 5,
|
|
3008
|
+
|
|
3009
|
+
|
|
3010
|
+
GHOSTTY_KEY_ENCODER_OPT_MACOS_OPTION_AS_ALT = 6,
|
|
3011
|
+
|
|
3012
|
+
|
|
3013
|
+
GHOSTTY_KEY_ENCODER_OPT_BACKARROW_KEY_MODE = 7,
|
|
3014
|
+
|
|
3015
|
+
GHOSTTY_KEY_ENCODER_OPT_MAX_VALUE = 0x7FFFFFFF,
|
|
3016
|
+
} GhosttyKeyEncoderOption;
|
|
3017
|
+
|
|
3018
|
+
GhosttyResult ghostty_key_encoder_new(const GhosttyAllocator *allocator, GhosttyKeyEncoder *encoder);
|
|
3019
|
+
|
|
3020
|
+
void ghostty_key_encoder_free(GhosttyKeyEncoder encoder);
|
|
3021
|
+
|
|
3022
|
+
void ghostty_key_encoder_setopt(GhosttyKeyEncoder encoder, GhosttyKeyEncoderOption option, const void *value);
|
|
3023
|
+
|
|
3024
|
+
void ghostty_key_encoder_setopt_from_terminal(GhosttyKeyEncoder encoder, GhosttyTerminal terminal);
|
|
3025
|
+
|
|
3026
|
+
GhosttyResult ghostty_key_encoder_encode(GhosttyKeyEncoder encoder, GhosttyKeyEvent event, char *out_buf, size_t out_buf_size, size_t *out_len);
|
|
3027
|
+
|
|
3028
|
+
/* --- event.h --- */
|
|
3029
|
+
|
|
3030
|
+
typedef struct GhosttyMouseEventImpl *GhosttyMouseEvent;
|
|
3031
|
+
|
|
3032
|
+
typedef enum {
|
|
3033
|
+
|
|
3034
|
+
GHOSTTY_MOUSE_ACTION_PRESS = 0,
|
|
3035
|
+
|
|
3036
|
+
|
|
3037
|
+
GHOSTTY_MOUSE_ACTION_RELEASE = 1,
|
|
3038
|
+
|
|
3039
|
+
|
|
3040
|
+
GHOSTTY_MOUSE_ACTION_MOTION = 2,
|
|
3041
|
+
GHOSTTY_MOUSE_ACTION_MAX_VALUE = 0x7FFFFFFF,
|
|
3042
|
+
} GhosttyMouseAction;
|
|
3043
|
+
|
|
3044
|
+
typedef enum {
|
|
3045
|
+
GHOSTTY_MOUSE_BUTTON_UNKNOWN = 0,
|
|
3046
|
+
GHOSTTY_MOUSE_BUTTON_LEFT = 1,
|
|
3047
|
+
GHOSTTY_MOUSE_BUTTON_RIGHT = 2,
|
|
3048
|
+
GHOSTTY_MOUSE_BUTTON_MIDDLE = 3,
|
|
3049
|
+
GHOSTTY_MOUSE_BUTTON_FOUR = 4,
|
|
3050
|
+
GHOSTTY_MOUSE_BUTTON_FIVE = 5,
|
|
3051
|
+
GHOSTTY_MOUSE_BUTTON_SIX = 6,
|
|
3052
|
+
GHOSTTY_MOUSE_BUTTON_SEVEN = 7,
|
|
3053
|
+
GHOSTTY_MOUSE_BUTTON_EIGHT = 8,
|
|
3054
|
+
GHOSTTY_MOUSE_BUTTON_NINE = 9,
|
|
3055
|
+
GHOSTTY_MOUSE_BUTTON_TEN = 10,
|
|
3056
|
+
GHOSTTY_MOUSE_BUTTON_ELEVEN = 11,
|
|
3057
|
+
GHOSTTY_MOUSE_BUTTON_MAX_VALUE = 0x7FFFFFFF,
|
|
3058
|
+
} GhosttyMouseButton;
|
|
3059
|
+
|
|
3060
|
+
typedef struct {
|
|
3061
|
+
float x;
|
|
3062
|
+
float y;
|
|
3063
|
+
} GhosttyMousePosition;
|
|
3064
|
+
|
|
3065
|
+
GhosttyResult ghostty_mouse_event_new(const GhosttyAllocator *allocator,
|
|
3066
|
+
GhosttyMouseEvent *event);
|
|
3067
|
+
|
|
3068
|
+
void ghostty_mouse_event_free(GhosttyMouseEvent event);
|
|
3069
|
+
|
|
3070
|
+
void ghostty_mouse_event_set_action(GhosttyMouseEvent event,
|
|
3071
|
+
GhosttyMouseAction action);
|
|
3072
|
+
|
|
3073
|
+
GhosttyMouseAction ghostty_mouse_event_get_action(GhosttyMouseEvent event);
|
|
3074
|
+
|
|
3075
|
+
void ghostty_mouse_event_set_button(GhosttyMouseEvent event,
|
|
3076
|
+
GhosttyMouseButton button);
|
|
3077
|
+
|
|
3078
|
+
void ghostty_mouse_event_clear_button(GhosttyMouseEvent event);
|
|
3079
|
+
|
|
3080
|
+
bool ghostty_mouse_event_get_button(GhosttyMouseEvent event,
|
|
3081
|
+
GhosttyMouseButton *out_button);
|
|
3082
|
+
|
|
3083
|
+
void ghostty_mouse_event_set_mods(GhosttyMouseEvent event,
|
|
3084
|
+
GhosttyMods mods);
|
|
3085
|
+
|
|
3086
|
+
GhosttyMods ghostty_mouse_event_get_mods(GhosttyMouseEvent event);
|
|
3087
|
+
|
|
3088
|
+
void ghostty_mouse_event_set_position(GhosttyMouseEvent event,
|
|
3089
|
+
GhosttyMousePosition position);
|
|
3090
|
+
|
|
3091
|
+
GhosttyMousePosition ghostty_mouse_event_get_position(GhosttyMouseEvent event);
|
|
3092
|
+
|
|
3093
|
+
/* --- encoder.h --- */
|
|
3094
|
+
|
|
3095
|
+
typedef struct GhosttyMouseEncoderImpl *GhosttyMouseEncoder;
|
|
3096
|
+
|
|
3097
|
+
typedef enum {
|
|
3098
|
+
|
|
3099
|
+
GHOSTTY_MOUSE_TRACKING_NONE = 0,
|
|
3100
|
+
|
|
3101
|
+
|
|
3102
|
+
GHOSTTY_MOUSE_TRACKING_X10 = 1,
|
|
3103
|
+
|
|
3104
|
+
|
|
3105
|
+
GHOSTTY_MOUSE_TRACKING_NORMAL = 2,
|
|
3106
|
+
|
|
3107
|
+
|
|
3108
|
+
GHOSTTY_MOUSE_TRACKING_BUTTON = 3,
|
|
3109
|
+
|
|
3110
|
+
|
|
3111
|
+
GHOSTTY_MOUSE_TRACKING_ANY = 4,
|
|
3112
|
+
GHOSTTY_MOUSE_TRACKING_MAX_VALUE = 0x7FFFFFFF,
|
|
3113
|
+
} GhosttyMouseTrackingMode;
|
|
3114
|
+
|
|
3115
|
+
typedef enum {
|
|
3116
|
+
GHOSTTY_MOUSE_FORMAT_X10 = 0,
|
|
3117
|
+
GHOSTTY_MOUSE_FORMAT_UTF8 = 1,
|
|
3118
|
+
GHOSTTY_MOUSE_FORMAT_SGR = 2,
|
|
3119
|
+
GHOSTTY_MOUSE_FORMAT_URXVT = 3,
|
|
3120
|
+
GHOSTTY_MOUSE_FORMAT_SGR_PIXELS = 4,
|
|
3121
|
+
GHOSTTY_MOUSE_FORMAT_MAX_VALUE = 0x7FFFFFFF,
|
|
3122
|
+
} GhosttyMouseFormat;
|
|
3123
|
+
|
|
3124
|
+
typedef struct {
|
|
3125
|
+
|
|
3126
|
+
size_t size;
|
|
3127
|
+
|
|
3128
|
+
|
|
3129
|
+
uint32_t screen_width;
|
|
3130
|
+
|
|
3131
|
+
|
|
3132
|
+
uint32_t screen_height;
|
|
3133
|
+
|
|
3134
|
+
|
|
3135
|
+
uint32_t cell_width;
|
|
3136
|
+
|
|
3137
|
+
|
|
3138
|
+
uint32_t cell_height;
|
|
3139
|
+
|
|
3140
|
+
|
|
3141
|
+
uint32_t padding_top;
|
|
3142
|
+
|
|
3143
|
+
|
|
3144
|
+
uint32_t padding_bottom;
|
|
3145
|
+
|
|
3146
|
+
|
|
3147
|
+
uint32_t padding_right;
|
|
3148
|
+
|
|
3149
|
+
|
|
3150
|
+
uint32_t padding_left;
|
|
3151
|
+
} GhosttyMouseEncoderSize;
|
|
3152
|
+
|
|
3153
|
+
typedef enum {
|
|
3154
|
+
|
|
3155
|
+
GHOSTTY_MOUSE_ENCODER_OPT_EVENT = 0,
|
|
3156
|
+
|
|
3157
|
+
|
|
3158
|
+
GHOSTTY_MOUSE_ENCODER_OPT_FORMAT = 1,
|
|
3159
|
+
|
|
3160
|
+
|
|
3161
|
+
GHOSTTY_MOUSE_ENCODER_OPT_SIZE = 2,
|
|
3162
|
+
|
|
3163
|
+
|
|
3164
|
+
GHOSTTY_MOUSE_ENCODER_OPT_ANY_BUTTON_PRESSED = 3,
|
|
3165
|
+
|
|
3166
|
+
|
|
3167
|
+
GHOSTTY_MOUSE_ENCODER_OPT_TRACK_LAST_CELL = 4,
|
|
3168
|
+
GHOSTTY_MOUSE_ENCODER_OPT_MAX_VALUE = 0x7FFFFFFF,
|
|
3169
|
+
} GhosttyMouseEncoderOption;
|
|
3170
|
+
|
|
3171
|
+
GhosttyResult ghostty_mouse_encoder_new(const GhosttyAllocator *allocator,
|
|
3172
|
+
GhosttyMouseEncoder *encoder);
|
|
3173
|
+
|
|
3174
|
+
void ghostty_mouse_encoder_free(GhosttyMouseEncoder encoder);
|
|
3175
|
+
|
|
3176
|
+
void ghostty_mouse_encoder_setopt(GhosttyMouseEncoder encoder,
|
|
3177
|
+
GhosttyMouseEncoderOption option,
|
|
3178
|
+
const void *value);
|
|
3179
|
+
|
|
3180
|
+
void ghostty_mouse_encoder_setopt_from_terminal(GhosttyMouseEncoder encoder,
|
|
3181
|
+
GhosttyTerminal terminal);
|
|
3182
|
+
|
|
3183
|
+
void ghostty_mouse_encoder_reset(GhosttyMouseEncoder encoder);
|
|
3184
|
+
|
|
3185
|
+
GhosttyResult ghostty_mouse_encoder_encode(GhosttyMouseEncoder encoder,
|
|
3186
|
+
GhosttyMouseEvent event,
|
|
3187
|
+
char *out_buf,
|
|
3188
|
+
size_t out_buf_size,
|
|
3189
|
+
size_t *out_len);
|
|
3190
|
+
|
|
3191
|
+
/* --- mouse.h --- */
|
|
3192
|
+
|
|
3193
|
+
typedef enum {
|
|
3194
|
+
GHOSTTY_MOUSE_SHAPE_DEFAULT = 0,
|
|
3195
|
+
GHOSTTY_MOUSE_SHAPE_CONTEXT_MENU = 1,
|
|
3196
|
+
GHOSTTY_MOUSE_SHAPE_HELP = 2,
|
|
3197
|
+
GHOSTTY_MOUSE_SHAPE_POINTER = 3,
|
|
3198
|
+
GHOSTTY_MOUSE_SHAPE_PROGRESS = 4,
|
|
3199
|
+
GHOSTTY_MOUSE_SHAPE_WAIT = 5,
|
|
3200
|
+
GHOSTTY_MOUSE_SHAPE_CELL = 6,
|
|
3201
|
+
GHOSTTY_MOUSE_SHAPE_CROSSHAIR = 7,
|
|
3202
|
+
GHOSTTY_MOUSE_SHAPE_TEXT = 8,
|
|
3203
|
+
GHOSTTY_MOUSE_SHAPE_VERTICAL_TEXT = 9,
|
|
3204
|
+
GHOSTTY_MOUSE_SHAPE_ALIAS = 10,
|
|
3205
|
+
GHOSTTY_MOUSE_SHAPE_COPY = 11,
|
|
3206
|
+
GHOSTTY_MOUSE_SHAPE_MOVE = 12,
|
|
3207
|
+
GHOSTTY_MOUSE_SHAPE_NO_DROP = 13,
|
|
3208
|
+
GHOSTTY_MOUSE_SHAPE_NOT_ALLOWED = 14,
|
|
3209
|
+
GHOSTTY_MOUSE_SHAPE_GRAB = 15,
|
|
3210
|
+
GHOSTTY_MOUSE_SHAPE_GRABBING = 16,
|
|
3211
|
+
GHOSTTY_MOUSE_SHAPE_ALL_SCROLL = 17,
|
|
3212
|
+
GHOSTTY_MOUSE_SHAPE_COL_RESIZE = 18,
|
|
3213
|
+
GHOSTTY_MOUSE_SHAPE_ROW_RESIZE = 19,
|
|
3214
|
+
GHOSTTY_MOUSE_SHAPE_N_RESIZE = 20,
|
|
3215
|
+
GHOSTTY_MOUSE_SHAPE_E_RESIZE = 21,
|
|
3216
|
+
GHOSTTY_MOUSE_SHAPE_S_RESIZE = 22,
|
|
3217
|
+
GHOSTTY_MOUSE_SHAPE_W_RESIZE = 23,
|
|
3218
|
+
GHOSTTY_MOUSE_SHAPE_NE_RESIZE = 24,
|
|
3219
|
+
GHOSTTY_MOUSE_SHAPE_NW_RESIZE = 25,
|
|
3220
|
+
GHOSTTY_MOUSE_SHAPE_SE_RESIZE = 26,
|
|
3221
|
+
GHOSTTY_MOUSE_SHAPE_SW_RESIZE = 27,
|
|
3222
|
+
GHOSTTY_MOUSE_SHAPE_EW_RESIZE = 28,
|
|
3223
|
+
GHOSTTY_MOUSE_SHAPE_NS_RESIZE = 29,
|
|
3224
|
+
GHOSTTY_MOUSE_SHAPE_NESW_RESIZE = 30,
|
|
3225
|
+
GHOSTTY_MOUSE_SHAPE_NWSE_RESIZE = 31,
|
|
3226
|
+
GHOSTTY_MOUSE_SHAPE_ZOOM_IN = 32,
|
|
3227
|
+
GHOSTTY_MOUSE_SHAPE_ZOOM_OUT = 33,
|
|
3228
|
+
GHOSTTY_MOUSE_SHAPE_MAX_VALUE = 0x7FFFFFFF,
|
|
3229
|
+
} GhosttyMouseShape;
|
|
3230
|
+
|
|
3231
|
+
/* --- paste.h --- */
|
|
3232
|
+
|
|
3233
|
+
typedef enum {
|
|
3234
|
+
|
|
3235
|
+
GHOSTTY_PASTE_SOURCE_CLIPBOARD = 0,
|
|
3236
|
+
|
|
3237
|
+
|
|
3238
|
+
GHOSTTY_PASTE_SOURCE_TEXT = 1,
|
|
3239
|
+
GHOSTTY_PASTE_SOURCE_MAX_VALUE = 0x7FFFFFFF,
|
|
3240
|
+
} GhosttyPasteSource;
|
|
3241
|
+
|
|
3242
|
+
typedef struct {
|
|
3243
|
+
|
|
3244
|
+
size_t size;
|
|
3245
|
+
|
|
3246
|
+
|
|
3247
|
+
GhosttyClipboardLocation location;
|
|
3248
|
+
|
|
3249
|
+
|
|
3250
|
+
GhosttyPasteSource source;
|
|
3251
|
+
|
|
3252
|
+
|
|
3253
|
+
const GhosttyString* mimes;
|
|
3254
|
+
|
|
3255
|
+
|
|
3256
|
+
size_t mimes_len;
|
|
3257
|
+
|
|
3258
|
+
|
|
3259
|
+
GhosttyMimeReader reader;
|
|
3260
|
+
|
|
3261
|
+
|
|
3262
|
+
bool allow_unsafe;
|
|
3263
|
+
} GhosttyPaste;
|
|
3264
|
+
|
|
3265
|
+
GhosttyResult ghostty_terminal_paste(
|
|
3266
|
+
GhosttyTerminal terminal,
|
|
3267
|
+
const GhosttyPaste* paste,
|
|
3268
|
+
bool* out_written);
|
|
3269
|
+
|
|
3270
|
+
bool ghostty_paste_is_safe(const char* data, size_t len);
|
|
3271
|
+
|
|
3272
|
+
GhosttyResult ghostty_paste_encode(
|
|
3273
|
+
char* data,
|
|
3274
|
+
size_t data_len,
|
|
3275
|
+
bool bracketed,
|
|
3276
|
+
char* buf,
|
|
3277
|
+
size_t buf_len,
|
|
3278
|
+
size_t* out_written);
|
|
3279
|
+
|
|
3280
|
+
/* --- search.h --- */
|
|
3281
|
+
|
|
3282
|
+
typedef enum {
|
|
3283
|
+
|
|
3284
|
+
GHOSTTY_SEARCH_STATUS_RUNNING = 0,
|
|
3285
|
+
|
|
3286
|
+
|
|
3287
|
+
GHOSTTY_SEARCH_STATUS_FEED_REQUIRED = 1,
|
|
3288
|
+
|
|
3289
|
+
|
|
3290
|
+
GHOSTTY_SEARCH_STATUS_COMPLETE = 2,
|
|
3291
|
+
|
|
3292
|
+
GHOSTTY_SEARCH_STATUS_MAX_VALUE = 0x7FFFFFFF,
|
|
3293
|
+
} GhosttySearchStatus;
|
|
3294
|
+
|
|
3295
|
+
typedef enum {
|
|
3296
|
+
|
|
3297
|
+
GHOSTTY_SEARCH_SCROLL_IF_NEEDED = 0,
|
|
3298
|
+
|
|
3299
|
+
|
|
3300
|
+
GHOSTTY_SEARCH_SCROLL_NONE = 1,
|
|
3301
|
+
|
|
3302
|
+
GHOSTTY_SEARCH_SCROLL_MAX_VALUE = 0x7FFFFFFF,
|
|
3303
|
+
} GhosttySearchScroll;
|
|
3304
|
+
|
|
3305
|
+
typedef enum {
|
|
3306
|
+
|
|
3307
|
+
GHOSTTY_SEARCH_DATA_STATUS = 0,
|
|
3308
|
+
|
|
3309
|
+
|
|
3310
|
+
GHOSTTY_SEARCH_DATA_NEEDLE = 1,
|
|
3311
|
+
|
|
3312
|
+
|
|
3313
|
+
GHOSTTY_SEARCH_DATA_TOTAL_MATCHES = 2,
|
|
3314
|
+
|
|
3315
|
+
|
|
3316
|
+
GHOSTTY_SEARCH_DATA_SELECTED_INDEX = 3,
|
|
3317
|
+
|
|
3318
|
+
|
|
3319
|
+
GHOSTTY_SEARCH_DATA_SELECTED_MATCH = 4,
|
|
3320
|
+
|
|
3321
|
+
|
|
3322
|
+
GHOSTTY_SEARCH_DATA_MATCHES = 5,
|
|
3323
|
+
|
|
3324
|
+
|
|
3325
|
+
GHOSTTY_SEARCH_DATA_VIEWPORT_MATCHES = 6,
|
|
3326
|
+
|
|
3327
|
+
|
|
3328
|
+
GHOSTTY_SEARCH_DATA_SELECT_SCROLL = 7,
|
|
3329
|
+
|
|
3330
|
+
GHOSTTY_SEARCH_DATA_MAX_VALUE = 0x7FFFFFFF,
|
|
3331
|
+
} GhosttySearchData;
|
|
3332
|
+
|
|
3333
|
+
typedef enum {
|
|
3334
|
+
|
|
3335
|
+
GHOSTTY_SEARCH_OPT_NEEDLE = 0,
|
|
3336
|
+
|
|
3337
|
+
|
|
3338
|
+
GHOSTTY_SEARCH_OPT_SELECT_NEXT = 1,
|
|
3339
|
+
|
|
3340
|
+
|
|
3341
|
+
GHOSTTY_SEARCH_OPT_SELECT_PREV = 2,
|
|
3342
|
+
|
|
3343
|
+
|
|
3344
|
+
GHOSTTY_SEARCH_OPT_SELECT_SCROLL = 3,
|
|
3345
|
+
|
|
3346
|
+
GHOSTTY_SEARCH_OPT_MAX_VALUE = 0x7FFFFFFF,
|
|
3347
|
+
} GhosttySearchOption;
|
|
3348
|
+
|
|
3349
|
+
GhosttyResult ghostty_search_new(
|
|
3350
|
+
const GhosttyAllocator* allocator,
|
|
3351
|
+
GhosttySearch* out_search,
|
|
3352
|
+
GhosttyTerminal terminal);
|
|
3353
|
+
|
|
3354
|
+
void ghostty_search_free(GhosttySearch search);
|
|
3355
|
+
|
|
3356
|
+
GhosttyResult ghostty_search_tick(
|
|
3357
|
+
GhosttySearch search,
|
|
3358
|
+
GhosttySearchStatus* out_status);
|
|
3359
|
+
|
|
3360
|
+
GhosttyResult ghostty_search_feed(GhosttySearch search);
|
|
3361
|
+
|
|
3362
|
+
GhosttyResult ghostty_search_run(GhosttySearch search);
|
|
3363
|
+
|
|
3364
|
+
GhosttyResult ghostty_search_set(
|
|
3365
|
+
GhosttySearch search,
|
|
3366
|
+
GhosttySearchOption option,
|
|
3367
|
+
const void* value);
|
|
3368
|
+
|
|
3369
|
+
GhosttyResult ghostty_search_get(
|
|
3370
|
+
GhosttySearch search,
|
|
3371
|
+
GhosttySearchData data,
|
|
3372
|
+
void* value);
|
|
3373
|
+
|
|
3374
|
+
GhosttyResult ghostty_search_get_multi(
|
|
3375
|
+
GhosttySearch search,
|
|
3376
|
+
size_t count,
|
|
3377
|
+
const GhosttySearchData* keys,
|
|
3378
|
+
void** values,
|
|
3379
|
+
size_t* out_written);
|
|
3380
|
+
|
|
3381
|
+
/* --- snapshot.h --- */
|
|
3382
|
+
|
|
3383
|
+
typedef enum {
|
|
3384
|
+
|
|
3385
|
+
GHOSTTY_SNAPSHOT_DECODER_OPT_MAX_CONTINUATION_BYTES = 0,
|
|
3386
|
+
|
|
3387
|
+
|
|
3388
|
+
GHOSTTY_SNAPSHOT_DECODER_OPT_RETAIN_CONTINUATION = 1,
|
|
3389
|
+
|
|
3390
|
+
GHOSTTY_SNAPSHOT_DECODER_OPT_MAX_VALUE = 0x7FFFFFFF,
|
|
3391
|
+
} GhosttySnapshotDecoderOption;
|
|
3392
|
+
|
|
3393
|
+
typedef enum {
|
|
3394
|
+
|
|
3395
|
+
GHOSTTY_SNAPSHOT_DECODER_DATA_INVALID = 0,
|
|
3396
|
+
|
|
3397
|
+
|
|
3398
|
+
GHOSTTY_SNAPSHOT_DECODER_DATA_MAX_CONTINUATION_BYTES = 1,
|
|
3399
|
+
|
|
3400
|
+
|
|
3401
|
+
GHOSTTY_SNAPSHOT_DECODER_DATA_SOURCE_OFFSET = 2,
|
|
3402
|
+
|
|
3403
|
+
|
|
3404
|
+
GHOSTTY_SNAPSHOT_DECODER_DATA_HISTORY_ROWS_PRIMARY = 3,
|
|
3405
|
+
|
|
3406
|
+
|
|
3407
|
+
GHOSTTY_SNAPSHOT_DECODER_DATA_HISTORY_ROWS_ALTERNATE = 4,
|
|
3408
|
+
|
|
3409
|
+
|
|
3410
|
+
GHOSTTY_SNAPSHOT_DECODER_DATA_PROGRESS_SCREEN = 5,
|
|
3411
|
+
|
|
3412
|
+
|
|
3413
|
+
GHOSTTY_SNAPSHOT_DECODER_DATA_PROGRESS_ROWS = 6,
|
|
3414
|
+
|
|
3415
|
+
|
|
3416
|
+
GHOSTTY_SNAPSHOT_DECODER_DATA_PROGRESS_REMAINING = 7,
|
|
3417
|
+
|
|
3418
|
+
|
|
3419
|
+
GHOSTTY_SNAPSHOT_DECODER_DATA_RETAIN_CONTINUATION = 8,
|
|
3420
|
+
|
|
3421
|
+
GHOSTTY_SNAPSHOT_DECODER_DATA_MAX_VALUE = 0x7FFFFFFF,
|
|
3422
|
+
} GhosttySnapshotDecoderData;
|
|
3423
|
+
|
|
3424
|
+
GhosttyResult ghostty_snapshot_encode(GhosttyTerminal terminal,
|
|
3425
|
+
GhosttyWriter writer);
|
|
3426
|
+
|
|
3427
|
+
GhosttyResult ghostty_snapshot_encode_buf(
|
|
3428
|
+
GhosttyTerminal terminal,
|
|
3429
|
+
uint8_t* buf,
|
|
3430
|
+
size_t buf_len,
|
|
3431
|
+
size_t* out_written);
|
|
3432
|
+
|
|
3433
|
+
GhosttyResult ghostty_snapshot_encode_alloc(
|
|
3434
|
+
GhosttyTerminal terminal,
|
|
3435
|
+
const GhosttyAllocator* allocator,
|
|
3436
|
+
uint8_t** out_ptr,
|
|
3437
|
+
size_t* out_len);
|
|
3438
|
+
|
|
3439
|
+
GhosttyResult ghostty_snapshot_decoder_new(
|
|
3440
|
+
const GhosttyAllocator* allocator,
|
|
3441
|
+
GhosttySnapshotDecoder* decoder,
|
|
3442
|
+
GhosttyReader reader);
|
|
3443
|
+
|
|
3444
|
+
GhosttyResult ghostty_snapshot_decoder_new_buf(
|
|
3445
|
+
const GhosttyAllocator* allocator,
|
|
3446
|
+
GhosttySnapshotDecoder* decoder,
|
|
3447
|
+
const uint8_t* ptr,
|
|
3448
|
+
size_t len);
|
|
3449
|
+
|
|
3450
|
+
void ghostty_snapshot_decoder_free(GhosttySnapshotDecoder decoder);
|
|
3451
|
+
|
|
3452
|
+
GhosttyResult ghostty_snapshot_decoder_set(
|
|
3453
|
+
GhosttySnapshotDecoder decoder,
|
|
3454
|
+
GhosttySnapshotDecoderOption option,
|
|
3455
|
+
const void* value);
|
|
3456
|
+
|
|
3457
|
+
GhosttyResult ghostty_snapshot_decoder_ready(
|
|
3458
|
+
GhosttySnapshotDecoder decoder,
|
|
3459
|
+
GhosttyTerminal* terminal);
|
|
3460
|
+
|
|
3461
|
+
GhosttyResult ghostty_snapshot_decoder_next(
|
|
3462
|
+
GhosttySnapshotDecoder decoder);
|
|
3463
|
+
|
|
3464
|
+
GhosttyResult ghostty_snapshot_decoder_decode(
|
|
3465
|
+
GhosttySnapshotDecoder decoder,
|
|
3466
|
+
GhosttyTerminal* terminal);
|
|
3467
|
+
|
|
3468
|
+
GhosttyResult ghostty_snapshot_decoder_get(
|
|
3469
|
+
GhosttySnapshotDecoder decoder,
|
|
3470
|
+
GhosttySnapshotDecoderData data,
|
|
3471
|
+
void* out);
|
|
3472
|
+
|
|
3473
|
+
GhosttyResult ghostty_snapshot_decoder_get_multi(
|
|
3474
|
+
GhosttySnapshotDecoder decoder,
|
|
3475
|
+
size_t count,
|
|
3476
|
+
const GhosttySnapshotDecoderData* keys,
|
|
3477
|
+
void** values,
|
|
3478
|
+
size_t* out_written);
|
|
3479
|
+
|
|
3480
|
+
/* --- unicode.h --- */
|
|
3481
|
+
|
|
3482
|
+
uint8_t ghostty_unicode_codepoint_width(uint32_t cp);
|
|
3483
|
+
|
|
3484
|
+
size_t ghostty_unicode_grapheme_width(const uint32_t *cps,
|
|
3485
|
+
size_t len,
|
|
3486
|
+
uint8_t *width);
|
|
3487
|
+
'''
|