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
227
233typedef enum GHOSTTY_ENUM_TYPED {
236
239
242 GHOSTTY_RENDER_STATE_DIRTY_MAX_VALUE = GHOSTTY_ENUM_MAX_VALUE,
244
250typedef enum GHOSTTY_ENUM_TYPED {
253
256
259
262 GHOSTTY_RENDER_STATE_CURSOR_VISUAL_STYLE_MAX_VALUE = GHOSTTY_ENUM_MAX_VALUE,
264
275typedef struct {
277 uint16_t above;
278
280 uint16_t below;
282
299typedef struct {
301 uint64_t bits[2];
303
309typedef enum GHOSTTY_ENUM_TYPED {
312
315
319
322
333
336
339
344
347
350
353
356
359
362
366
370
374
378
382
386
393
399 GHOSTTY_RENDER_STATE_DATA_MAX_VALUE = GHOSTTY_ENUM_MAX_VALUE,
401
407typedef enum GHOSTTY_ENUM_TYPED {
410
419 GHOSTTY_RENDER_STATE_OPTION_MAX_VALUE = GHOSTTY_ENUM_MAX_VALUE,
421
427typedef enum GHOSTTY_ENUM_TYPED {
430
433
436
442
445
461
468
473 GHOSTTY_RENDER_STATE_ROW_DATA_MAX_VALUE = GHOSTTY_ENUM_MAX_VALUE,
475
481typedef enum GHOSTTY_ENUM_TYPED {
484 GHOSTTY_RENDER_STATE_ROW_OPTION_MAX_VALUE = GHOSTTY_ENUM_MAX_VALUE,
486
499typedef struct {
501 size_t size;
502
504 uint16_t start_x;
505
507 uint16_t end_x;
509
522typedef struct {
524 size_t size;
525
528
530 uint16_t viewport_x;
531
533 uint16_t viewport_y;
534
537
540
543
546
550
567typedef struct {
569 size_t size;
570
573
576
579
586
590
602 GhosttyRenderState* state);
603
615
637 GhosttyTerminal terminal);
638
669 GhosttyTerminal terminal);
670
686
703
721 void* out);
722
745 GhosttyRenderState state,
746 size_t count,
747 const GhosttyRenderStateData* keys,
748 void** values,
749 size_t* out_written);
750
768 const void* value);
769
785 const GhosttyAllocator* allocator,
786 GhosttyRenderStateRowIterator* out_iterator);
787
796
814
840 uint16_t* out_y);
841
862 void* out);
863
887 size_t count,
888 const GhosttyRenderStateRowData* keys,
889 void** values,
890 size_t* out_written);
891
913 const void* value);
914
933 const GhosttyAllocator* allocator,
934 GhosttyRenderStateRowCells* out_cells);
935
941typedef enum GHOSTTY_ENUM_TYPED {
944
947
950
954
959
967
975
985
992
1005 GHOSTTY_RENDER_STATE_ROW_CELLS_DATA_MAX_VALUE = GHOSTTY_ENUM_MAX_VALUE,
1007
1021
1037 GhosttyRenderStateRowCells cells, uint16_t x);
1038
1059 void* out);
1060
1084 size_t count,
1086 void** values,
1087 size_t* out_written);
1088
1097
1099
1100#ifdef __cplusplus
1101}
1102#endif
1103
1104#endif /* GHOSTTY_VT_RENDER_H */
GhosttyRenderStateRowData
Definition render.h:427
GHOSTTY_API GhosttyResult ghostty_render_state_row_cells_new(const GhosttyAllocator *allocator, GhosttyRenderStateRowCells *out_cells)
GhosttyRenderStateData
Definition render.h:309
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:407
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:941
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:250
GHOSTTY_API bool ghostty_render_state_row_iterator_next(GhosttyRenderStateRowIterator iterator)
GhosttyRenderStateDirty
Definition render.h:233
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:481
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:429
@ GHOSTTY_RENDER_STATE_ROW_DATA_SELECTION
Definition render.h:444
@ GHOSTTY_RENDER_STATE_ROW_DATA_CELLS
Definition render.h:441
@ GHOSTTY_RENDER_STATE_ROW_DATA_CELLS_RAW
Definition render.h:460
@ GHOSTTY_RENDER_STATE_ROW_DATA_ID
Definition render.h:472
@ GHOSTTY_RENDER_STATE_ROW_DATA_RAW
Definition render.h:435
@ GHOSTTY_RENDER_STATE_ROW_DATA_VIEWPORT_Y
Definition render.h:467
@ GHOSTTY_RENDER_STATE_ROW_DATA_DIRTY
Definition render.h:432
@ GHOSTTY_RENDER_STATE_DATA_CURSOR_VIEWPORT_X
Definition render.h:369
@ GHOSTTY_RENDER_STATE_DATA_COLOR_FOREGROUND
Definition render.h:338
@ GHOSTTY_RENDER_STATE_DATA_COLOR_PALETTE
Definition render.h:349
@ GHOSTTY_RENDER_STATE_DATA_OVERSCAN_REQUEST
Definition render.h:398
@ GHOSTTY_RENDER_STATE_DATA_COLOR_CURSOR
Definition render.h:343
@ GHOSTTY_RENDER_STATE_DATA_DIRTY
Definition render.h:321
@ GHOSTTY_RENDER_STATE_DATA_CURSOR_VIEWPORT_HAS_VALUE
Definition render.h:365
@ GHOSTTY_RENDER_STATE_DATA_COLORS
Definition render.h:385
@ GHOSTTY_RENDER_STATE_DATA_CURSOR_VISUAL_STYLE
Definition render.h:352
@ GHOSTTY_RENDER_STATE_DATA_COLOR_CURSOR_HAS_VALUE
Definition render.h:346
@ GHOSTTY_RENDER_STATE_DATA_CURSOR_VIEWPORT_Y
Definition render.h:373
@ GHOSTTY_RENDER_STATE_DATA_OVERSCAN
Definition render.h:392
@ GHOSTTY_RENDER_STATE_DATA_INVALID
Definition render.h:311
@ GHOSTTY_RENDER_STATE_DATA_CURSOR_PASSWORD_INPUT
Definition render.h:361
@ GHOSTTY_RENDER_STATE_DATA_CURSOR_VISIBLE
Definition render.h:355
@ GHOSTTY_RENDER_STATE_DATA_CURSOR_VIEWPORT_WIDE_TAIL
Definition render.h:377
@ GHOSTTY_RENDER_STATE_DATA_COLOR_BACKGROUND
Definition render.h:335
@ GHOSTTY_RENDER_STATE_DATA_ROW_ITERATOR
Definition render.h:332
@ GHOSTTY_RENDER_STATE_DATA_CURSOR
Definition render.h:381
@ GHOSTTY_RENDER_STATE_DATA_CURSOR_BLINKING
Definition render.h:358
@ GHOSTTY_RENDER_STATE_DATA_ROWS
Definition render.h:318
@ GHOSTTY_RENDER_STATE_DATA_COLS
Definition render.h:314
@ GHOSTTY_RENDER_STATE_OPTION_DIRTY
Definition render.h:409
@ GHOSTTY_RENDER_STATE_OPTION_OVERSCAN
Definition render.h:418
@ GHOSTTY_RENDER_STATE_ROW_CELLS_DATA_HAS_STYLING
Definition render.h:991
@ GHOSTTY_RENDER_STATE_ROW_CELLS_DATA_RAW
Definition render.h:946
@ GHOSTTY_RENDER_STATE_ROW_CELLS_DATA_INVALID
Definition render.h:943
@ GHOSTTY_RENDER_STATE_ROW_CELLS_DATA_GRAPHEMES_LEN
Definition render.h:953
@ GHOSTTY_RENDER_STATE_ROW_CELLS_DATA_FG_COLOR
Definition render.h:974
@ GHOSTTY_RENDER_STATE_ROW_CELLS_DATA_GRAPHEMES_BUF
Definition render.h:958
@ GHOSTTY_RENDER_STATE_ROW_CELLS_DATA_BG_COLOR
Definition render.h:966
@ GHOSTTY_RENDER_STATE_ROW_CELLS_DATA_SELECTED
Definition render.h:984
@ GHOSTTY_RENDER_STATE_ROW_CELLS_DATA_STYLE
Definition render.h:949
@ GHOSTTY_RENDER_STATE_ROW_CELLS_DATA_GRAPHEMES_UTF8
Definition render.h:1004
@ GHOSTTY_RENDER_STATE_CURSOR_VISUAL_STYLE_BLOCK
Definition render.h:255
@ GHOSTTY_RENDER_STATE_CURSOR_VISUAL_STYLE_BAR
Definition render.h:252
@ GHOSTTY_RENDER_STATE_CURSOR_VISUAL_STYLE_BLOCK_HOLLOW
Definition render.h:261
@ GHOSTTY_RENDER_STATE_CURSOR_VISUAL_STYLE_UNDERLINE
Definition render.h:258
@ GHOSTTY_RENDER_STATE_DIRTY_FALSE
Definition render.h:235
@ GHOSTTY_RENDER_STATE_DIRTY_PARTIAL
Definition render.h:238
@ GHOSTTY_RENDER_STATE_DIRTY_FULL
Definition render.h:241
@ GHOSTTY_RENDER_STATE_ROW_OPTION_DIRTY
Definition render.h:483
struct GhosttyTerminalImpl * GhosttyTerminal
Definition types.h:119
GhosttyColorRgb cursor
Definition render.h:578
GhosttyColorRgb foreground
Definition render.h:575
GhosttyColorRgb background
Definition render.h:572
GhosttyColorRgb palette[256]
Definition render.h:588
GhosttyRenderStateCursorVisualStyle visual_style
Definition render.h:548
GhosttyResult
Definition types.h:88
#define GHOSTTY_ENUM_TYPED
Definition types.h:81