libghostty
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
83
89typedef enum GHOSTTY_ENUM_TYPED {
92
95
98 GHOSTTY_RENDER_STATE_DIRTY_MAX_VALUE = GHOSTTY_ENUM_MAX_VALUE,
100
106typedef enum GHOSTTY_ENUM_TYPED {
109
112
115
118 GHOSTTY_RENDER_STATE_CURSOR_VISUAL_STYLE_MAX_VALUE = GHOSTTY_ENUM_MAX_VALUE,
120
126typedef enum GHOSTTY_ENUM_TYPED {
129
132
135
138
145
148
151
156
159
162
165
168
171
174
178
182
186
190 GHOSTTY_RENDER_STATE_DATA_MAX_VALUE = GHOSTTY_ENUM_MAX_VALUE,
192
198typedef enum GHOSTTY_ENUM_TYPED {
201 GHOSTTY_RENDER_STATE_OPTION_MAX_VALUE = GHOSTTY_ENUM_MAX_VALUE,
203
209typedef enum GHOSTTY_ENUM_TYPED {
212
215
218
224 GHOSTTY_RENDER_STATE_ROW_DATA_MAX_VALUE = GHOSTTY_ENUM_MAX_VALUE,
226
232typedef enum GHOSTTY_ENUM_TYPED {
235 GHOSTTY_RENDER_STATE_ROW_OPTION_MAX_VALUE = GHOSTTY_ENUM_MAX_VALUE,
237
253typedef struct {
255 size_t size;
256
259
262
265
272
276
288 GhosttyRenderState* state);
289
301
317 GhosttyTerminal terminal);
318
335 void* out);
336
359 GhosttyRenderState state,
360 size_t count,
361 const GhosttyRenderStateData* keys,
362 void** values,
363 size_t* out_written);
364
382 const void* value);
383
400 GhosttyRenderStateColors* out_colors);
401
417 const GhosttyAllocator* allocator,
418 GhosttyRenderStateRowIterator* out_iterator);
419
428
442
462 void* out);
463
487 size_t count,
488 const GhosttyRenderStateRowData* keys,
489 void** values,
490 size_t* out_written);
491
512 const void* value);
513
532 const GhosttyAllocator* allocator,
533 GhosttyRenderStateRowCells* out_cells);
534
540typedef enum GHOSTTY_ENUM_TYPED {
543
546
549
553
558
566
574 GHOSTTY_RENDER_STATE_ROW_CELLS_DATA_MAX_VALUE = GHOSTTY_ENUM_MAX_VALUE,
576
590
606 GhosttyRenderStateRowCells cells, uint16_t x);
607
628 void* out);
629
653 size_t count,
655 void** values,
656 size_t* out_written);
657
666
668
669#ifdef __cplusplus
670}
671#endif
672
673#endif /* GHOSTTY_VT_RENDER_H */
GhosttyRenderStateRowData
Definition render.h:209
GHOSTTY_API GhosttyResult ghostty_render_state_row_cells_new(const GhosttyAllocator *allocator, GhosttyRenderStateRowCells *out_cells)
GhosttyRenderStateData
Definition render.h:126
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:198
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:139
GHOSTTY_API GhosttyResult ghostty_render_state_colors_get(GhosttyRenderState state, GhosttyRenderStateColors *out_colors)
struct GhosttyRenderStateImpl * GhosttyRenderState
Definition types.h:132
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)
GhosttyRenderStateRowCellsData
Definition render.h:540
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)
GhosttyRenderStateCursorVisualStyle
Definition render.h:106
GHOSTTY_API bool ghostty_render_state_row_iterator_next(GhosttyRenderStateRowIterator iterator)
GhosttyRenderStateDirty
Definition render.h:89
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:232
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:146
@ GHOSTTY_RENDER_STATE_ROW_DATA_INVALID
Definition render.h:211
@ GHOSTTY_RENDER_STATE_ROW_DATA_CELLS
Definition render.h:223
@ GHOSTTY_RENDER_STATE_ROW_DATA_RAW
Definition render.h:217
@ GHOSTTY_RENDER_STATE_ROW_DATA_DIRTY
Definition render.h:214
@ GHOSTTY_RENDER_STATE_DATA_CURSOR_VIEWPORT_X
Definition render.h:181
@ GHOSTTY_RENDER_STATE_DATA_COLOR_FOREGROUND
Definition render.h:150
@ GHOSTTY_RENDER_STATE_DATA_COLOR_PALETTE
Definition render.h:161
@ GHOSTTY_RENDER_STATE_DATA_COLOR_CURSOR
Definition render.h:155
@ GHOSTTY_RENDER_STATE_DATA_DIRTY
Definition render.h:137
@ GHOSTTY_RENDER_STATE_DATA_CURSOR_VIEWPORT_HAS_VALUE
Definition render.h:177
@ GHOSTTY_RENDER_STATE_DATA_CURSOR_VISUAL_STYLE
Definition render.h:164
@ GHOSTTY_RENDER_STATE_DATA_COLOR_CURSOR_HAS_VALUE
Definition render.h:158
@ GHOSTTY_RENDER_STATE_DATA_CURSOR_VIEWPORT_Y
Definition render.h:185
@ GHOSTTY_RENDER_STATE_DATA_INVALID
Definition render.h:128
@ GHOSTTY_RENDER_STATE_DATA_CURSOR_PASSWORD_INPUT
Definition render.h:173
@ GHOSTTY_RENDER_STATE_DATA_CURSOR_VISIBLE
Definition render.h:167
@ GHOSTTY_RENDER_STATE_DATA_CURSOR_VIEWPORT_WIDE_TAIL
Definition render.h:189
@ GHOSTTY_RENDER_STATE_DATA_COLOR_BACKGROUND
Definition render.h:147
@ GHOSTTY_RENDER_STATE_DATA_ROW_ITERATOR
Definition render.h:144
@ GHOSTTY_RENDER_STATE_DATA_CURSOR_BLINKING
Definition render.h:170
@ GHOSTTY_RENDER_STATE_DATA_ROWS
Definition render.h:134
@ GHOSTTY_RENDER_STATE_DATA_COLS
Definition render.h:131
@ GHOSTTY_RENDER_STATE_OPTION_DIRTY
Definition render.h:200
@ GHOSTTY_RENDER_STATE_ROW_CELLS_DATA_RAW
Definition render.h:545
@ GHOSTTY_RENDER_STATE_ROW_CELLS_DATA_INVALID
Definition render.h:542
@ GHOSTTY_RENDER_STATE_ROW_CELLS_DATA_GRAPHEMES_LEN
Definition render.h:552
@ GHOSTTY_RENDER_STATE_ROW_CELLS_DATA_FG_COLOR
Definition render.h:573
@ GHOSTTY_RENDER_STATE_ROW_CELLS_DATA_GRAPHEMES_BUF
Definition render.h:557
@ GHOSTTY_RENDER_STATE_ROW_CELLS_DATA_BG_COLOR
Definition render.h:565
@ GHOSTTY_RENDER_STATE_ROW_CELLS_DATA_STYLE
Definition render.h:548
@ GHOSTTY_RENDER_STATE_CURSOR_VISUAL_STYLE_BLOCK
Definition render.h:111
@ GHOSTTY_RENDER_STATE_CURSOR_VISUAL_STYLE_BAR
Definition render.h:108
@ GHOSTTY_RENDER_STATE_CURSOR_VISUAL_STYLE_BLOCK_HOLLOW
Definition render.h:117
@ GHOSTTY_RENDER_STATE_CURSOR_VISUAL_STYLE_UNDERLINE
Definition render.h:114
@ GHOSTTY_RENDER_STATE_DIRTY_FALSE
Definition render.h:91
@ GHOSTTY_RENDER_STATE_DIRTY_PARTIAL
Definition render.h:94
@ GHOSTTY_RENDER_STATE_DIRTY_FULL
Definition render.h:97
@ GHOSTTY_RENDER_STATE_ROW_OPTION_DIRTY
Definition render.h:234
struct GhosttyTerminalImpl * GhosttyTerminal
Definition types.h:95
GhosttyColorRgb cursor
Definition render.h:264
GhosttyColorRgb foreground
Definition render.h:261
GhosttyColorRgb background
Definition render.h:258
GhosttyColorRgb palette[256]
Definition render.h:274
GhosttyResult
Definition types.h:74
#define GHOSTTY_ENUM_TYPED
Definition types.h:67