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
95
101typedef enum GHOSTTY_ENUM_TYPED {
104
107
110 GHOSTTY_RENDER_STATE_DIRTY_MAX_VALUE = GHOSTTY_ENUM_MAX_VALUE,
112
118typedef enum GHOSTTY_ENUM_TYPED {
121
124
127
130 GHOSTTY_RENDER_STATE_CURSOR_VISUAL_STYLE_MAX_VALUE = GHOSTTY_ENUM_MAX_VALUE,
132
138typedef enum GHOSTTY_ENUM_TYPED {
141
144
147
150
157
160
163
168
171
174
177
180
183
186
190
194
198
202 GHOSTTY_RENDER_STATE_DATA_MAX_VALUE = GHOSTTY_ENUM_MAX_VALUE,
204
210typedef enum GHOSTTY_ENUM_TYPED {
213 GHOSTTY_RENDER_STATE_OPTION_MAX_VALUE = GHOSTTY_ENUM_MAX_VALUE,
215
221typedef enum GHOSTTY_ENUM_TYPED {
224
227
230
236
239 GHOSTTY_RENDER_STATE_ROW_DATA_MAX_VALUE = GHOSTTY_ENUM_MAX_VALUE,
241
247typedef enum GHOSTTY_ENUM_TYPED {
250 GHOSTTY_RENDER_STATE_ROW_OPTION_MAX_VALUE = GHOSTTY_ENUM_MAX_VALUE,
252
265typedef struct {
267 size_t size;
268
270 uint16_t start_x;
271
273 uint16_t end_x;
275
291typedef struct {
293 size_t size;
294
297
300
303
310
314
326 GhosttyRenderState* state);
327
339
361 GhosttyTerminal terminal);
362
393 GhosttyTerminal terminal);
394
410
427 void* out);
428
451 GhosttyRenderState state,
452 size_t count,
453 const GhosttyRenderStateData* keys,
454 void** values,
455 size_t* out_written);
456
474 const void* value);
475
492 GhosttyRenderStateColors* out_colors);
493
509 const GhosttyAllocator* allocator,
510 GhosttyRenderStateRowIterator* out_iterator);
511
520
534
554 void* out);
555
579 size_t count,
580 const GhosttyRenderStateRowData* keys,
581 void** values,
582 size_t* out_written);
583
604 const void* value);
605
624 const GhosttyAllocator* allocator,
625 GhosttyRenderStateRowCells* out_cells);
626
632typedef enum GHOSTTY_ENUM_TYPED {
635
638
641
645
650
658
666
676
683
696 GHOSTTY_RENDER_STATE_ROW_CELLS_DATA_MAX_VALUE = GHOSTTY_ENUM_MAX_VALUE,
698
712
728 GhosttyRenderStateRowCells cells, uint16_t x);
729
750 void* out);
751
775 size_t count,
777 void** values,
778 size_t* out_written);
779
788
790
791#ifdef __cplusplus
792}
793#endif
794
795#endif /* GHOSTTY_VT_RENDER_H */
GhosttyRenderStateRowData
Definition render.h:221
GHOSTTY_API GhosttyResult ghostty_render_state_row_cells_new(const GhosttyAllocator *allocator, GhosttyRenderStateRowCells *out_cells)
GhosttyRenderStateData
Definition render.h:138
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:210
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)
GHOSTTY_API GhosttyResult ghostty_render_state_begin_update(GhosttyRenderState state, GhosttyTerminal terminal)
GHOSTTY_API GhosttyResult ghostty_render_state_end_update(GhosttyRenderState state)
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:632
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:118
GHOSTTY_API bool ghostty_render_state_row_iterator_next(GhosttyRenderStateRowIterator iterator)
GhosttyRenderStateDirty
Definition render.h:101
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:247
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:223
@ GHOSTTY_RENDER_STATE_ROW_DATA_SELECTION
Definition render.h:238
@ GHOSTTY_RENDER_STATE_ROW_DATA_CELLS
Definition render.h:235
@ GHOSTTY_RENDER_STATE_ROW_DATA_RAW
Definition render.h:229
@ GHOSTTY_RENDER_STATE_ROW_DATA_DIRTY
Definition render.h:226
@ GHOSTTY_RENDER_STATE_DATA_CURSOR_VIEWPORT_X
Definition render.h:193
@ GHOSTTY_RENDER_STATE_DATA_COLOR_FOREGROUND
Definition render.h:162
@ GHOSTTY_RENDER_STATE_DATA_COLOR_PALETTE
Definition render.h:173
@ GHOSTTY_RENDER_STATE_DATA_COLOR_CURSOR
Definition render.h:167
@ GHOSTTY_RENDER_STATE_DATA_DIRTY
Definition render.h:149
@ GHOSTTY_RENDER_STATE_DATA_CURSOR_VIEWPORT_HAS_VALUE
Definition render.h:189
@ GHOSTTY_RENDER_STATE_DATA_CURSOR_VISUAL_STYLE
Definition render.h:176
@ GHOSTTY_RENDER_STATE_DATA_COLOR_CURSOR_HAS_VALUE
Definition render.h:170
@ GHOSTTY_RENDER_STATE_DATA_CURSOR_VIEWPORT_Y
Definition render.h:197
@ GHOSTTY_RENDER_STATE_DATA_INVALID
Definition render.h:140
@ GHOSTTY_RENDER_STATE_DATA_CURSOR_PASSWORD_INPUT
Definition render.h:185
@ GHOSTTY_RENDER_STATE_DATA_CURSOR_VISIBLE
Definition render.h:179
@ GHOSTTY_RENDER_STATE_DATA_CURSOR_VIEWPORT_WIDE_TAIL
Definition render.h:201
@ GHOSTTY_RENDER_STATE_DATA_COLOR_BACKGROUND
Definition render.h:159
@ GHOSTTY_RENDER_STATE_DATA_ROW_ITERATOR
Definition render.h:156
@ GHOSTTY_RENDER_STATE_DATA_CURSOR_BLINKING
Definition render.h:182
@ GHOSTTY_RENDER_STATE_DATA_ROWS
Definition render.h:146
@ GHOSTTY_RENDER_STATE_DATA_COLS
Definition render.h:143
@ GHOSTTY_RENDER_STATE_OPTION_DIRTY
Definition render.h:212
@ GHOSTTY_RENDER_STATE_ROW_CELLS_DATA_HAS_STYLING
Definition render.h:682
@ GHOSTTY_RENDER_STATE_ROW_CELLS_DATA_RAW
Definition render.h:637
@ GHOSTTY_RENDER_STATE_ROW_CELLS_DATA_INVALID
Definition render.h:634
@ GHOSTTY_RENDER_STATE_ROW_CELLS_DATA_GRAPHEMES_LEN
Definition render.h:644
@ GHOSTTY_RENDER_STATE_ROW_CELLS_DATA_FG_COLOR
Definition render.h:665
@ GHOSTTY_RENDER_STATE_ROW_CELLS_DATA_GRAPHEMES_BUF
Definition render.h:649
@ GHOSTTY_RENDER_STATE_ROW_CELLS_DATA_BG_COLOR
Definition render.h:657
@ GHOSTTY_RENDER_STATE_ROW_CELLS_DATA_SELECTED
Definition render.h:675
@ GHOSTTY_RENDER_STATE_ROW_CELLS_DATA_STYLE
Definition render.h:640
@ GHOSTTY_RENDER_STATE_ROW_CELLS_DATA_GRAPHEMES_UTF8
Definition render.h:695
@ GHOSTTY_RENDER_STATE_CURSOR_VISUAL_STYLE_BLOCK
Definition render.h:123
@ GHOSTTY_RENDER_STATE_CURSOR_VISUAL_STYLE_BAR
Definition render.h:120
@ GHOSTTY_RENDER_STATE_CURSOR_VISUAL_STYLE_BLOCK_HOLLOW
Definition render.h:129
@ GHOSTTY_RENDER_STATE_CURSOR_VISUAL_STYLE_UNDERLINE
Definition render.h:126
@ GHOSTTY_RENDER_STATE_DIRTY_FALSE
Definition render.h:103
@ GHOSTTY_RENDER_STATE_DIRTY_PARTIAL
Definition render.h:106
@ GHOSTTY_RENDER_STATE_DIRTY_FULL
Definition render.h:109
@ GHOSTTY_RENDER_STATE_ROW_OPTION_DIRTY
Definition render.h:249
struct GhosttyTerminalImpl * GhosttyTerminal
Definition types.h:95
GhosttyColorRgb cursor
Definition render.h:302
GhosttyColorRgb foreground
Definition render.h:299
GhosttyColorRgb background
Definition render.h:296
GhosttyColorRgb palette[256]
Definition render.h:312
GhosttyResult
Definition types.h:74
#define GHOSTTY_ENUM_TYPED
Definition types.h:67