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
98
104typedef enum GHOSTTY_ENUM_TYPED {
107
110
113 GHOSTTY_RENDER_STATE_DIRTY_MAX_VALUE = GHOSTTY_ENUM_MAX_VALUE,
115
121typedef enum GHOSTTY_ENUM_TYPED {
124
127
130
133 GHOSTTY_RENDER_STATE_CURSOR_VISUAL_STYLE_MAX_VALUE = GHOSTTY_ENUM_MAX_VALUE,
135
141typedef enum GHOSTTY_ENUM_TYPED {
144
147
150
153
160
163
166
171
174
177
180
183
186
189
193
197
201
205
209
213 GHOSTTY_RENDER_STATE_DATA_MAX_VALUE = GHOSTTY_ENUM_MAX_VALUE,
215
221typedef enum GHOSTTY_ENUM_TYPED {
224 GHOSTTY_RENDER_STATE_OPTION_MAX_VALUE = GHOSTTY_ENUM_MAX_VALUE,
226
232typedef enum GHOSTTY_ENUM_TYPED {
235
238
241
247
250
266 GHOSTTY_RENDER_STATE_ROW_DATA_MAX_VALUE = GHOSTTY_ENUM_MAX_VALUE,
268
274typedef enum GHOSTTY_ENUM_TYPED {
277 GHOSTTY_RENDER_STATE_ROW_OPTION_MAX_VALUE = GHOSTTY_ENUM_MAX_VALUE,
279
292typedef struct {
294 size_t size;
295
297 uint16_t start_x;
298
300 uint16_t end_x;
302
315typedef struct {
317 size_t size;
318
321
323 uint16_t viewport_x;
324
326 uint16_t viewport_y;
327
330
333
336
339
343
360typedef struct {
362 size_t size;
363
366
369
372
379
383
395 GhosttyRenderState* state);
396
408
430 GhosttyTerminal terminal);
431
462 GhosttyTerminal terminal);
463
479
496
514 void* out);
515
538 GhosttyRenderState state,
539 size_t count,
540 const GhosttyRenderStateData* keys,
541 void** values,
542 size_t* out_written);
543
561 const void* value);
562
578 const GhosttyAllocator* allocator,
579 GhosttyRenderStateRowIterator* out_iterator);
580
589
604
626 uint16_t* out_y);
627
648 void* out);
649
673 size_t count,
674 const GhosttyRenderStateRowData* keys,
675 void** values,
676 size_t* out_written);
677
699 const void* value);
700
719 const GhosttyAllocator* allocator,
720 GhosttyRenderStateRowCells* out_cells);
721
727typedef enum GHOSTTY_ENUM_TYPED {
730
733
736
740
745
753
761
771
778
791 GHOSTTY_RENDER_STATE_ROW_CELLS_DATA_MAX_VALUE = GHOSTTY_ENUM_MAX_VALUE,
793
807
823 GhosttyRenderStateRowCells cells, uint16_t x);
824
845 void* out);
846
870 size_t count,
872 void** values,
873 size_t* out_written);
874
883
885
886#ifdef __cplusplus
887}
888#endif
889
890#endif /* GHOSTTY_VT_RENDER_H */
GhosttyRenderStateRowData
Definition render.h:232
GHOSTTY_API GhosttyResult ghostty_render_state_row_cells_new(const GhosttyAllocator *allocator, GhosttyRenderStateRowCells *out_cells)
GhosttyRenderStateData
Definition render.h:141
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:221
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:182
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:175
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:727
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_row_iterator_next_dirty(GhosttyRenderStateRowIterator iterator, uint16_t *out_y)
GhosttyRenderStateCursorVisualStyle
Definition render.h:121
GHOSTTY_API bool ghostty_render_state_row_iterator_next(GhosttyRenderStateRowIterator iterator)
GhosttyRenderStateDirty
Definition render.h:104
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:274
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:189
@ GHOSTTY_RENDER_STATE_ROW_DATA_INVALID
Definition render.h:234
@ GHOSTTY_RENDER_STATE_ROW_DATA_SELECTION
Definition render.h:249
@ GHOSTTY_RENDER_STATE_ROW_DATA_CELLS
Definition render.h:246
@ GHOSTTY_RENDER_STATE_ROW_DATA_CELLS_RAW
Definition render.h:265
@ GHOSTTY_RENDER_STATE_ROW_DATA_RAW
Definition render.h:240
@ GHOSTTY_RENDER_STATE_ROW_DATA_DIRTY
Definition render.h:237
@ GHOSTTY_RENDER_STATE_DATA_CURSOR_VIEWPORT_X
Definition render.h:196
@ GHOSTTY_RENDER_STATE_DATA_COLOR_FOREGROUND
Definition render.h:165
@ GHOSTTY_RENDER_STATE_DATA_COLOR_PALETTE
Definition render.h:176
@ GHOSTTY_RENDER_STATE_DATA_COLOR_CURSOR
Definition render.h:170
@ GHOSTTY_RENDER_STATE_DATA_DIRTY
Definition render.h:152
@ GHOSTTY_RENDER_STATE_DATA_CURSOR_VIEWPORT_HAS_VALUE
Definition render.h:192
@ GHOSTTY_RENDER_STATE_DATA_COLORS
Definition render.h:212
@ GHOSTTY_RENDER_STATE_DATA_CURSOR_VISUAL_STYLE
Definition render.h:179
@ GHOSTTY_RENDER_STATE_DATA_COLOR_CURSOR_HAS_VALUE
Definition render.h:173
@ GHOSTTY_RENDER_STATE_DATA_CURSOR_VIEWPORT_Y
Definition render.h:200
@ GHOSTTY_RENDER_STATE_DATA_INVALID
Definition render.h:143
@ GHOSTTY_RENDER_STATE_DATA_CURSOR_PASSWORD_INPUT
Definition render.h:188
@ GHOSTTY_RENDER_STATE_DATA_CURSOR_VISIBLE
Definition render.h:182
@ GHOSTTY_RENDER_STATE_DATA_CURSOR_VIEWPORT_WIDE_TAIL
Definition render.h:204
@ GHOSTTY_RENDER_STATE_DATA_COLOR_BACKGROUND
Definition render.h:162
@ GHOSTTY_RENDER_STATE_DATA_ROW_ITERATOR
Definition render.h:159
@ GHOSTTY_RENDER_STATE_DATA_CURSOR
Definition render.h:208
@ GHOSTTY_RENDER_STATE_DATA_CURSOR_BLINKING
Definition render.h:185
@ GHOSTTY_RENDER_STATE_DATA_ROWS
Definition render.h:149
@ GHOSTTY_RENDER_STATE_DATA_COLS
Definition render.h:146
@ GHOSTTY_RENDER_STATE_OPTION_DIRTY
Definition render.h:223
@ GHOSTTY_RENDER_STATE_ROW_CELLS_DATA_HAS_STYLING
Definition render.h:777
@ GHOSTTY_RENDER_STATE_ROW_CELLS_DATA_RAW
Definition render.h:732
@ GHOSTTY_RENDER_STATE_ROW_CELLS_DATA_INVALID
Definition render.h:729
@ GHOSTTY_RENDER_STATE_ROW_CELLS_DATA_GRAPHEMES_LEN
Definition render.h:739
@ GHOSTTY_RENDER_STATE_ROW_CELLS_DATA_FG_COLOR
Definition render.h:760
@ GHOSTTY_RENDER_STATE_ROW_CELLS_DATA_GRAPHEMES_BUF
Definition render.h:744
@ GHOSTTY_RENDER_STATE_ROW_CELLS_DATA_BG_COLOR
Definition render.h:752
@ GHOSTTY_RENDER_STATE_ROW_CELLS_DATA_SELECTED
Definition render.h:770
@ GHOSTTY_RENDER_STATE_ROW_CELLS_DATA_STYLE
Definition render.h:735
@ GHOSTTY_RENDER_STATE_ROW_CELLS_DATA_GRAPHEMES_UTF8
Definition render.h:790
@ GHOSTTY_RENDER_STATE_CURSOR_VISUAL_STYLE_BLOCK
Definition render.h:126
@ GHOSTTY_RENDER_STATE_CURSOR_VISUAL_STYLE_BAR
Definition render.h:123
@ GHOSTTY_RENDER_STATE_CURSOR_VISUAL_STYLE_BLOCK_HOLLOW
Definition render.h:132
@ GHOSTTY_RENDER_STATE_CURSOR_VISUAL_STYLE_UNDERLINE
Definition render.h:129
@ GHOSTTY_RENDER_STATE_DIRTY_FALSE
Definition render.h:106
@ GHOSTTY_RENDER_STATE_DIRTY_PARTIAL
Definition render.h:109
@ GHOSTTY_RENDER_STATE_DIRTY_FULL
Definition render.h:112
@ GHOSTTY_RENDER_STATE_ROW_OPTION_DIRTY
Definition render.h:276
struct GhosttyTerminalImpl * GhosttyTerminal
Definition types.h:119
GhosttyColorRgb cursor
Definition render.h:371
GhosttyColorRgb foreground
Definition render.h:368
GhosttyColorRgb background
Definition render.h:365
GhosttyColorRgb palette[256]
Definition render.h:381
GhosttyRenderStateCursorVisualStyle visual_style
Definition render.h:341
GhosttyResult
Definition types.h:88
#define GHOSTTY_ENUM_TYPED
Definition types.h:81