libghostty-vt 0.0.0
Loading...
Searching...
No Matches
render.h
Go to the documentation of this file.
1
6
7#ifndef GHOSTTY_VT_RENDER_H
8#define GHOSTTY_VT_RENDER_H
9
10#include <stdbool.h>
11#include <stddef.h>
12#include <stdint.h>
14#include <ghostty/vt/color.h>
15#include <ghostty/vt/terminal.h>
16#include <ghostty/vt/types.h>
17
18#ifdef __cplusplus
19extern "C" {
20#endif
21
43
49typedef enum GHOSTTY_ENUM_TYPED {
52
55
58 GHOSTTY_RENDER_STATE_DIRTY_MAX_VALUE = GHOSTTY_ENUM_MAX_VALUE,
60
71typedef struct {
73 uint16_t above;
74
76 uint16_t below;
78
95typedef struct {
97 uint64_t bits[2];
99
105typedef enum GHOSTTY_ENUM_TYPED {
108
111
115
118
129
132
135
140
143
146
149
152
155
158
162
166
170
174
178
182
189
195
199
214 GHOSTTY_RENDER_STATE_DATA_MAX_VALUE = GHOSTTY_ENUM_MAX_VALUE,
216
222typedef enum GHOSTTY_ENUM_TYPED {
229
234
243 GHOSTTY_RENDER_STATE_OPT_MAX_VALUE = GHOSTTY_ENUM_MAX_VALUE,
245
260typedef enum GHOSTTY_ENUM_TYPED {
264 GHOSTTY_IMAGE_PROTOCOL_MAX_VALUE = GHOSTTY_ENUM_MAX_VALUE,
266
276typedef enum GHOSTTY_ENUM_TYPED {
280
301
310 GHOSTTY_RENDER_STATE_KITTY_PLACEMENT_KIND_MAX_VALUE = GHOSTTY_ENUM_MAX_VALUE,
312
327typedef enum GHOSTTY_ENUM_TYPED {
330
333
338
349
352
358
365
374
377
380
387
394
397
400
404
408
412
416
426
430 GHOSTTY_RENDER_STATE_IMAGE_DATA_MAX_VALUE = GHOSTTY_ENUM_MAX_VALUE,
432
438typedef enum GHOSTTY_ENUM_TYPED {
441
444
447
453
456
472
479
484 GHOSTTY_RENDER_STATE_ROW_DATA_MAX_VALUE = GHOSTTY_ENUM_MAX_VALUE,
486
492typedef enum GHOSTTY_ENUM_TYPED {
499
504 GHOSTTY_RENDER_STATE_ROW_OPT_MAX_VALUE = GHOSTTY_ENUM_MAX_VALUE,
506
518typedef struct {
520 size_t size;
521
523 uint16_t start_x;
524
526 uint16_t end_x;
528
540typedef struct {
542 size_t size;
543
546
548 uint16_t viewport_x;
549
551 uint16_t viewport_y;
552
555
558
561
564
568
584typedef struct {
586 size_t size;
587
590
593
596
603
607
611
623 GhosttyRenderState* state);
624
636
638
642
664 GhosttyTerminal terminal);
665
696 GhosttyTerminal terminal);
697
713
730
732
736
755 void* out);
756
787 GhosttyRenderState state,
788 size_t count,
789 const GhosttyRenderStateData* keys,
790 void** values,
791 size_t* out_written);
792
825 const void* value);
826
828
832
848 const GhosttyAllocator* allocator,
849 GhosttyRenderStateRowIterator* out_iterator);
850
859
877
903 uint16_t* out_y);
904
927 void* out);
928
960 size_t count,
961 const GhosttyRenderStateRowData* keys,
962 void** values,
963 size_t* out_written);
964
988 const void* value);
989
991
997typedef enum GHOSTTY_ENUM_TYPED {
1000
1003
1006
1010
1033
1041
1049
1059
1066
1079 GHOSTTY_RENDER_STATE_ROW_CELLS_DATA_MAX_VALUE = GHOSTTY_ENUM_MAX_VALUE,
1081
1085
1104 const GhosttyAllocator* allocator,
1105 GhosttyRenderStateRowCells* out_cells);
1106
1120
1136 GhosttyRenderStateRowCells cells, uint16_t x);
1137
1159 void* out);
1160
1192 size_t count,
1194 void** values,
1195 size_t* out_written);
1196
1205
1207
1211
1229 const GhosttyAllocator* allocator,
1230 GhosttyRenderStateImageIterator* out_iterator);
1231
1241
1268
1290 void* out);
1291
1320 size_t count,
1321 const GhosttyRenderStateImageData* keys,
1322 void** values,
1323 size_t* out_written);
1324
1326
1328
1329#ifdef __cplusplus
1330}
1331#endif
1332
1333#endif /* GHOSTTY_VT_RENDER_H */
GhosttyResult
Definition types.h:143
#define GHOSTTY_ENUM_TYPED
Definition types.h:124
GhosttyRenderStateRowData
Definition render.h:438
GhosttyImageProtocol
Definition render.h:260
GHOSTTY_API GhosttyResult ghostty_render_state_row_cells_new(const GhosttyAllocator *allocator, GhosttyRenderStateRowCells *out_cells)
GhosttyRenderStateData
Definition render.h:105
GhosttyRenderStateKittyPlacementKind
Definition render.h:276
GHOSTTY_API GhosttyResult ghostty_render_state_set(GhosttyRenderState state, GhosttyRenderStateOption option, const void *value)
GHOSTTY_API GhosttyResult ghostty_render_state_row_cells_get(GhosttyRenderStateRowCells cells, GhosttyRenderStateRowCellsData data, void *out)
GhosttyRenderStateOption
Definition render.h:222
GHOSTTY_API GhosttyResult ghostty_render_state_image_get_multi(GhosttyRenderStateImageIterator iterator, size_t count, const GhosttyRenderStateImageData *keys, void **values, size_t *out_written)
GHOSTTY_API GhosttyResult ghostty_render_state_clean(GhosttyRenderState state)
GHOSTTY_API bool ghostty_render_state_row_cells_next(GhosttyRenderStateRowCells cells)
GHOSTTY_API GhosttyResult ghostty_render_state_update(GhosttyRenderState state, GhosttyTerminal terminal)
struct GhosttyRenderStateRowIteratorImpl * GhosttyRenderStateRowIterator
Definition types.h:259
GHOSTTY_API void ghostty_render_state_image_iterator_free(GhosttyRenderStateImageIterator iterator)
GHOSTTY_API GhosttyResult ghostty_render_state_begin_update(GhosttyRenderState state, GhosttyTerminal terminal)
GHOSTTY_API GhosttyResult ghostty_render_state_end_update(GhosttyRenderState state)
GhosttyRenderStateImageData
Definition render.h:327
struct GhosttyRenderStateImpl * GhosttyRenderState
Definition types.h:252
GHOSTTY_API GhosttyResult ghostty_render_state_row_cells_get_multi(GhosttyRenderStateRowCells cells, size_t count, const GhosttyRenderStateRowCellsData *keys, void **values, size_t *out_written)
GHOSTTY_API GhosttyResult ghostty_render_state_new(const GhosttyAllocator *allocator, GhosttyRenderState *state)
GHOSTTY_API GhosttyResult ghostty_render_state_row_iterator_new(const GhosttyAllocator *allocator, GhosttyRenderStateRowIterator *out_iterator)
GHOSTTY_API void ghostty_render_state_row_cells_free(GhosttyRenderStateRowCells cells)
GHOSTTY_API GhosttyResult ghostty_render_state_image_iterator_new(const GhosttyAllocator *allocator, GhosttyRenderStateImageIterator *out_iterator)
GhosttyRenderStateRowCellsData
Definition render.h:997
GHOSTTY_API GhosttyResult ghostty_render_state_row_cells_select(GhosttyRenderStateRowCells cells, uint16_t x)
GHOSTTY_API void ghostty_render_state_row_iterator_free(GhosttyRenderStateRowIterator iterator)
GHOSTTY_API void ghostty_render_state_free(GhosttyRenderState state)
GHOSTTY_API GhosttyResult ghostty_render_state_row_get_multi(GhosttyRenderStateRowIterator iterator, size_t count, const GhosttyRenderStateRowData *keys, void **values, size_t *out_written)
GHOSTTY_API GhosttyResult ghostty_render_state_get(GhosttyRenderState state, GhosttyRenderStateData data, void *out)
GHOSTTY_API bool ghostty_render_state_image_iterator_next(GhosttyRenderStateImageIterator iterator)
GHOSTTY_API bool ghostty_render_state_row_iterator_next_dirty(GhosttyRenderStateRowIterator iterator, uint16_t *out_y)
GHOSTTY_API GhosttyResult ghostty_render_state_image_get(GhosttyRenderStateImageIterator iterator, GhosttyRenderStateImageData data, void *out)
struct GhosttyRenderStateImageIteratorImpl * GhosttyRenderStateImageIterator
Definition types.h:274
GHOSTTY_API bool ghostty_render_state_row_iterator_next(GhosttyRenderStateRowIterator iterator)
GhosttyRenderStateDirty
Definition render.h:49
GHOSTTY_API GhosttyResult ghostty_render_state_row_set(GhosttyRenderStateRowIterator iterator, GhosttyRenderStateRowOption option, const void *value)
GHOSTTY_API GhosttyResult ghostty_render_state_row_get(GhosttyRenderStateRowIterator iterator, GhosttyRenderStateRowData data, void *out)
GhosttyRenderStateRowOption
Definition render.h:492
GHOSTTY_API GhosttyResult ghostty_render_state_get_multi(GhosttyRenderState state, size_t count, const GhosttyRenderStateData *keys, void **values, size_t *out_written)
struct GhosttyRenderStateRowCellsImpl * GhosttyRenderStateRowCells
Definition types.h:266
@ GHOSTTY_RENDER_STATE_ROW_DATA_INVALID
Definition render.h:440
@ GHOSTTY_RENDER_STATE_ROW_DATA_SELECTION
Definition render.h:455
@ GHOSTTY_RENDER_STATE_ROW_DATA_CELLS
Definition render.h:452
@ GHOSTTY_RENDER_STATE_ROW_DATA_CELLS_RAW
Definition render.h:471
@ GHOSTTY_RENDER_STATE_ROW_DATA_ID
Definition render.h:483
@ GHOSTTY_RENDER_STATE_ROW_DATA_RAW
Definition render.h:446
@ GHOSTTY_RENDER_STATE_ROW_DATA_VIEWPORT_Y
Definition render.h:478
@ GHOSTTY_RENDER_STATE_ROW_DATA_DIRTY
Definition render.h:443
@ GHOSTTY_IMAGE_PROTOCOL_KITTY
Definition render.h:263
@ GHOSTTY_RENDER_STATE_DATA_CURSOR_VIEWPORT_X
Definition render.h:165
@ GHOSTTY_RENDER_STATE_DATA_COLOR_FOREGROUND
Definition render.h:134
@ GHOSTTY_RENDER_STATE_DATA_COLOR_PALETTE
Definition render.h:145
@ GHOSTTY_RENDER_STATE_DATA_OVERSCAN_REQUEST
Definition render.h:194
@ GHOSTTY_RENDER_STATE_DATA_IMAGE_ITERATOR
Definition render.h:198
@ GHOSTTY_RENDER_STATE_DATA_COLOR_CURSOR
Definition render.h:139
@ GHOSTTY_RENDER_STATE_DATA_DIRTY
Definition render.h:117
@ GHOSTTY_RENDER_STATE_DATA_CURSOR_VIEWPORT_HAS_VALUE
Definition render.h:161
@ GHOSTTY_RENDER_STATE_DATA_COLORS
Definition render.h:181
@ GHOSTTY_RENDER_STATE_DATA_IMAGE_PLACEMENTS_GENERATION
Definition render.h:213
@ GHOSTTY_RENDER_STATE_DATA_CURSOR_VISUAL_STYLE
Definition render.h:148
@ GHOSTTY_RENDER_STATE_DATA_COLOR_CURSOR_HAS_VALUE
Definition render.h:142
@ GHOSTTY_RENDER_STATE_DATA_CURSOR_VIEWPORT_Y
Definition render.h:169
@ GHOSTTY_RENDER_STATE_DATA_OVERSCAN
Definition render.h:188
@ GHOSTTY_RENDER_STATE_DATA_INVALID
Definition render.h:107
@ GHOSTTY_RENDER_STATE_DATA_CURSOR_PASSWORD_INPUT
Definition render.h:157
@ GHOSTTY_RENDER_STATE_DATA_CURSOR_VISIBLE
Definition render.h:151
@ GHOSTTY_RENDER_STATE_DATA_CURSOR_VIEWPORT_WIDE_TAIL
Definition render.h:173
@ GHOSTTY_RENDER_STATE_DATA_COLOR_BACKGROUND
Definition render.h:131
@ GHOSTTY_RENDER_STATE_DATA_ROW_ITERATOR
Definition render.h:128
@ GHOSTTY_RENDER_STATE_DATA_CURSOR
Definition render.h:177
@ GHOSTTY_RENDER_STATE_DATA_CURSOR_BLINKING
Definition render.h:154
@ GHOSTTY_RENDER_STATE_DATA_ROWS
Definition render.h:114
@ GHOSTTY_RENDER_STATE_DATA_COLS
Definition render.h:110
@ GHOSTTY_RENDER_STATE_KITTY_PLACEMENT_KIND_FIXED
Definition render.h:309
@ GHOSTTY_RENDER_STATE_KITTY_PLACEMENT_KIND_VIRTUAL
Definition render.h:279
@ GHOSTTY_RENDER_STATE_KITTY_PLACEMENT_KIND_RELATIVE
Definition render.h:300
@ GHOSTTY_RENDER_STATE_OPT_OVERSCAN
Definition render.h:242
@ GHOSTTY_RENDER_STATE_OPT_INVALID
Definition render.h:228
@ GHOSTTY_RENDER_STATE_OPT_DIRTY
Definition render.h:233
@ GHOSTTY_RENDER_STATE_IMAGE_DATA_Z
Definition render.h:357
@ GHOSTTY_RENDER_STATE_IMAGE_DATA_PIXEL_HEIGHT
Definition render.h:399
@ GHOSTTY_RENDER_STATE_IMAGE_DATA_PROTOCOL
Definition render.h:332
@ GHOSTTY_RENDER_STATE_IMAGE_DATA_IMAGE_ID
Definition render.h:337
@ GHOSTTY_RENDER_STATE_IMAGE_DATA_VIEWPORT_COL
Definition render.h:364
@ GHOSTTY_RENDER_STATE_IMAGE_DATA_CELL_OFFSET_X
Definition render.h:386
@ GHOSTTY_RENDER_STATE_IMAGE_DATA_IMAGE_GENERATION
Definition render.h:348
@ GHOSTTY_RENDER_STATE_IMAGE_DATA_SOURCE_Y
Definition render.h:407
@ GHOSTTY_RENDER_STATE_IMAGE_DATA_KITTY_PLACEMENT_ID
Definition render.h:425
@ GHOSTTY_RENDER_STATE_IMAGE_DATA_VIEWPORT_ROW
Definition render.h:373
@ GHOSTTY_RENDER_STATE_IMAGE_DATA_PIXEL_WIDTH
Definition render.h:396
@ GHOSTTY_RENDER_STATE_IMAGE_DATA_GRID_ROWS
Definition render.h:379
@ GHOSTTY_RENDER_STATE_IMAGE_DATA_CELL_OFFSET_Y
Definition render.h:393
@ GHOSTTY_RENDER_STATE_IMAGE_DATA_SOURCE_HEIGHT
Definition render.h:415
@ GHOSTTY_RENDER_STATE_IMAGE_DATA_KITTY_KIND
Definition render.h:429
@ GHOSTTY_RENDER_STATE_IMAGE_DATA_INVALID
Definition render.h:329
@ GHOSTTY_RENDER_STATE_IMAGE_DATA_SOURCE_X
Definition render.h:403
@ GHOSTTY_RENDER_STATE_IMAGE_DATA_GRID_COLS
Definition render.h:376
@ GHOSTTY_RENDER_STATE_IMAGE_DATA_LAYER
Definition render.h:351
@ GHOSTTY_RENDER_STATE_IMAGE_DATA_SOURCE_WIDTH
Definition render.h:411
@ GHOSTTY_RENDER_STATE_ROW_CELLS_DATA_HAS_STYLING
Definition render.h:1065
@ GHOSTTY_RENDER_STATE_ROW_CELLS_DATA_RAW
Definition render.h:1002
@ GHOSTTY_RENDER_STATE_ROW_CELLS_DATA_INVALID
Definition render.h:999
@ GHOSTTY_RENDER_STATE_ROW_CELLS_DATA_GRAPHEMES_LEN
Definition render.h:1009
@ GHOSTTY_RENDER_STATE_ROW_CELLS_DATA_FG_COLOR
Definition render.h:1048
@ GHOSTTY_RENDER_STATE_ROW_CELLS_DATA_GRAPHEMES_BUF
Definition render.h:1032
@ GHOSTTY_RENDER_STATE_ROW_CELLS_DATA_BG_COLOR
Definition render.h:1040
@ GHOSTTY_RENDER_STATE_ROW_CELLS_DATA_SELECTED
Definition render.h:1058
@ GHOSTTY_RENDER_STATE_ROW_CELLS_DATA_STYLE
Definition render.h:1005
@ GHOSTTY_RENDER_STATE_ROW_CELLS_DATA_GRAPHEMES_UTF8
Definition render.h:1078
@ GHOSTTY_RENDER_STATE_DIRTY_FALSE
Definition render.h:51
@ GHOSTTY_RENDER_STATE_DIRTY_PARTIAL
Definition render.h:54
@ GHOSTTY_RENDER_STATE_DIRTY_FULL
Definition render.h:57
@ GHOSTTY_RENDER_STATE_ROW_OPT_DIRTY
Definition render.h:503
@ GHOSTTY_RENDER_STATE_ROW_OPT_INVALID
Definition render.h:498
struct GhosttyTerminalImpl * GhosttyTerminal
Definition types.h:196
GhosttyCursorStyle
Definition types.h:355
GhosttyColorRgb cursor
Definition render.h:595
GhosttyColorRgb foreground
Definition render.h:592
GhosttyColorRgb background
Definition render.h:589
GhosttyColorRgb palette[256]
Definition render.h:605
GhosttyCursorStyle visual_style
Definition render.h:566
uint64_t bits[2]
Definition render.h:97