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
227 GHOSTTY_RENDER_STATE_ROW_DATA_MAX_VALUE = GHOSTTY_ENUM_MAX_VALUE,
229
235typedef enum GHOSTTY_ENUM_TYPED {
238 GHOSTTY_RENDER_STATE_ROW_OPTION_MAX_VALUE = GHOSTTY_ENUM_MAX_VALUE,
240
253typedef struct {
255 size_t size;
256
258 uint16_t start_x;
259
261 uint16_t end_x;
263
279typedef struct {
281 size_t size;
282
285
288
291
298
302
314 GhosttyRenderState* state);
315
327
343 GhosttyTerminal terminal);
344
361 void* out);
362
385 GhosttyRenderState state,
386 size_t count,
387 const GhosttyRenderStateData* keys,
388 void** values,
389 size_t* out_written);
390
408 const void* value);
409
426 GhosttyRenderStateColors* out_colors);
427
443 const GhosttyAllocator* allocator,
444 GhosttyRenderStateRowIterator* out_iterator);
445
454
468
488 void* out);
489
513 size_t count,
514 const GhosttyRenderStateRowData* keys,
515 void** values,
516 size_t* out_written);
517
538 const void* value);
539
558 const GhosttyAllocator* allocator,
559 GhosttyRenderStateRowCells* out_cells);
560
566typedef enum GHOSTTY_ENUM_TYPED {
569
572
575
579
584
592
600
610 GHOSTTY_RENDER_STATE_ROW_CELLS_DATA_MAX_VALUE = GHOSTTY_ENUM_MAX_VALUE,
612
626
642 GhosttyRenderStateRowCells cells, uint16_t x);
643
664 void* out);
665
689 size_t count,
691 void** values,
692 size_t* out_written);
693
702
704
705#ifdef __cplusplus
706}
707#endif
708
709#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:151
GHOSTTY_API GhosttyResult ghostty_render_state_colors_get(GhosttyRenderState state, GhosttyRenderStateColors *out_colors)
struct GhosttyRenderStateImpl * GhosttyRenderState
Definition types.h:144
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:566
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:235
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:158
@ GHOSTTY_RENDER_STATE_ROW_DATA_INVALID
Definition render.h:211
@ GHOSTTY_RENDER_STATE_ROW_DATA_SELECTION
Definition render.h:226
@ 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:571
@ GHOSTTY_RENDER_STATE_ROW_CELLS_DATA_INVALID
Definition render.h:568
@ GHOSTTY_RENDER_STATE_ROW_CELLS_DATA_GRAPHEMES_LEN
Definition render.h:578
@ GHOSTTY_RENDER_STATE_ROW_CELLS_DATA_FG_COLOR
Definition render.h:599
@ GHOSTTY_RENDER_STATE_ROW_CELLS_DATA_GRAPHEMES_BUF
Definition render.h:583
@ GHOSTTY_RENDER_STATE_ROW_CELLS_DATA_BG_COLOR
Definition render.h:591
@ GHOSTTY_RENDER_STATE_ROW_CELLS_DATA_SELECTED
Definition render.h:609
@ GHOSTTY_RENDER_STATE_ROW_CELLS_DATA_STYLE
Definition render.h:574
@ 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:237
struct GhosttyTerminalImpl * GhosttyTerminal
Definition types.h:95
GhosttyColorRgb cursor
Definition render.h:290
GhosttyColorRgb foreground
Definition render.h:287
GhosttyColorRgb background
Definition render.h:284
GhosttyColorRgb palette[256]
Definition render.h:300
GhosttyResult
Definition types.h:74
#define GHOSTTY_ENUM_TYPED
Definition types.h:67