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
497
503typedef enum GHOSTTY_ENUM_TYPED {
506
509
512 GHOSTTY_RENDER_STATE_DIRTY_MAX_VALUE = GHOSTTY_ENUM_MAX_VALUE,
514
520typedef enum GHOSTTY_ENUM_TYPED {
523
526
529
532 GHOSTTY_RENDER_STATE_CURSOR_VISUAL_STYLE_MAX_VALUE = GHOSTTY_ENUM_MAX_VALUE,
534
545typedef struct {
547 uint16_t above;
548
550 uint16_t below;
552
569typedef struct {
571 uint64_t bits[2];
573
579typedef enum GHOSTTY_ENUM_TYPED {
582
585
589
592
603
606
609
614
617
620
623
626
629
632
636
640
644
648
652
656
663
669
674
689 GHOSTTY_RENDER_STATE_DATA_MAX_VALUE = GHOSTTY_ENUM_MAX_VALUE,
691
697typedef enum GHOSTTY_ENUM_TYPED {
700
709 GHOSTTY_RENDER_STATE_OPTION_MAX_VALUE = GHOSTTY_ENUM_MAX_VALUE,
711
726typedef enum GHOSTTY_ENUM_TYPED {
730 GHOSTTY_IMAGE_PROTOCOL_MAX_VALUE = GHOSTTY_ENUM_MAX_VALUE,
732
743typedef enum GHOSTTY_ENUM_TYPED {
746
749
752 GHOSTTY_RENDER_STATE_IMAGE_LAYER_MAX_VALUE = GHOSTTY_ENUM_MAX_VALUE,
754
764typedef enum GHOSTTY_ENUM_TYPED {
768
790
799 GHOSTTY_RENDER_STATE_KITTY_PLACEMENT_KIND_MAX_VALUE = GHOSTTY_ENUM_MAX_VALUE,
801
816typedef enum GHOSTTY_ENUM_TYPED {
819
822
827
838
841
847
855
864
867
870
877
884
887
890
894
898
902
906
916
920 GHOSTTY_RENDER_STATE_IMAGE_DATA_MAX_VALUE = GHOSTTY_ENUM_MAX_VALUE,
922
928typedef enum GHOSTTY_ENUM_TYPED {
931
934
937
943
946
962
969
974 GHOSTTY_RENDER_STATE_ROW_DATA_MAX_VALUE = GHOSTTY_ENUM_MAX_VALUE,
976
982typedef enum GHOSTTY_ENUM_TYPED {
985 GHOSTTY_RENDER_STATE_ROW_OPTION_MAX_VALUE = GHOSTTY_ENUM_MAX_VALUE,
987
1000typedef struct {
1002 size_t size;
1003
1005 uint16_t start_x;
1006
1008 uint16_t end_x;
1010
1023typedef struct {
1025 size_t size;
1026
1029
1031 uint16_t viewport_x;
1032
1034 uint16_t viewport_y;
1035
1038
1041
1044
1047
1051
1068typedef struct {
1070 size_t size;
1071
1074
1077
1080
1087
1091
1103 GhosttyRenderState* state);
1104
1116
1138 GhosttyTerminal terminal);
1139
1170 GhosttyTerminal terminal);
1171
1187
1204
1222 void* out);
1223
1246 GhosttyRenderState state,
1247 size_t count,
1248 const GhosttyRenderStateData* keys,
1249 void** values,
1250 size_t* out_written);
1251
1269 const void* value);
1270
1286 const GhosttyAllocator* allocator,
1287 GhosttyRenderStateRowIterator* out_iterator);
1288
1297
1315
1341 uint16_t* out_y);
1342
1363 void* out);
1364
1388 size_t count,
1389 const GhosttyRenderStateRowData* keys,
1390 void** values,
1391 size_t* out_written);
1392
1414 const void* value);
1415
1434 const GhosttyAllocator* allocator,
1435 GhosttyRenderStateRowCells* out_cells);
1436
1445
1448
1451
1455
1460
1468
1476
1486
1493
1506 GHOSTTY_RENDER_STATE_ROW_CELLS_DATA_MAX_VALUE = GHOSTTY_ENUM_MAX_VALUE,
1508
1522
1538 GhosttyRenderStateRowCells cells, uint16_t x);
1539
1560 void* out);
1561
1585 size_t count,
1587 void** values,
1588 size_t* out_written);
1589
1598
1616 const GhosttyAllocator* allocator,
1617 GhosttyRenderStateImageIterator* out_iterator);
1618
1628
1655
1677 void* out);
1678
1701 size_t count,
1702 const GhosttyRenderStateImageData* keys,
1703 void** values,
1704 size_t* out_written);
1705
1707
1708#ifdef __cplusplus
1709}
1710#endif
1711
1712#endif /* GHOSTTY_VT_RENDER_H */
GhosttyRenderStateRowData
Definition render.h:928
GhosttyImageProtocol
Definition render.h:726
GHOSTTY_API GhosttyResult ghostty_render_state_row_cells_new(const GhosttyAllocator *allocator, GhosttyRenderStateRowCells *out_cells)
GhosttyRenderStateData
Definition render.h:579
GhosttyRenderStateKittyPlacementKind
Definition render.h:764
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:697
GHOSTTY_API GhosttyResult ghostty_render_state_image_get_multi(GhosttyRenderStateImageIterator iterator, size_t count, const GhosttyRenderStateImageData *keys, void **values, size_t *out_written)
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 void ghostty_render_state_image_iterator_free(GhosttyRenderStateImageIterator iterator)
GHOSTTY_API GhosttyResult ghostty_render_state_begin_update(GhosttyRenderState state, GhosttyTerminal terminal)
GHOSTTY_API GhosttyResult ghostty_render_state_end_update(GhosttyRenderState state)
GhosttyRenderStateImageData
Definition render.h:816
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)
GHOSTTY_API GhosttyResult ghostty_render_state_image_iterator_new(const GhosttyAllocator *allocator, GhosttyRenderStateImageIterator *out_iterator)
GhosttyRenderStateRowCellsData
Definition render.h:1442
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)
GhosttyRenderStateImageLayer
Definition render.h:743
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_image_iterator_next(GhosttyRenderStateImageIterator iterator)
GHOSTTY_API bool ghostty_render_state_row_iterator_next_dirty(GhosttyRenderStateRowIterator iterator, uint16_t *out_y)
GhosttyRenderStateCursorVisualStyle
Definition render.h:520
GHOSTTY_API GhosttyResult ghostty_render_state_image_get(GhosttyRenderStateImageIterator iterator, GhosttyRenderStateImageData data, void *out)
struct GhosttyRenderStateImageIteratorImpl * GhosttyRenderStateImageIterator
Definition types.h:197
GHOSTTY_API bool ghostty_render_state_row_iterator_next(GhosttyRenderStateRowIterator iterator)
GhosttyRenderStateDirty
Definition render.h:503
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:982
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:930
@ GHOSTTY_RENDER_STATE_ROW_DATA_SELECTION
Definition render.h:945
@ GHOSTTY_RENDER_STATE_ROW_DATA_CELLS
Definition render.h:942
@ GHOSTTY_RENDER_STATE_ROW_DATA_CELLS_RAW
Definition render.h:961
@ GHOSTTY_RENDER_STATE_ROW_DATA_ID
Definition render.h:973
@ GHOSTTY_RENDER_STATE_ROW_DATA_RAW
Definition render.h:936
@ GHOSTTY_RENDER_STATE_ROW_DATA_VIEWPORT_Y
Definition render.h:968
@ GHOSTTY_RENDER_STATE_ROW_DATA_DIRTY
Definition render.h:933
@ GHOSTTY_IMAGE_PROTOCOL_KITTY
Definition render.h:729
@ GHOSTTY_RENDER_STATE_DATA_CURSOR_VIEWPORT_X
Definition render.h:639
@ GHOSTTY_RENDER_STATE_DATA_COLOR_FOREGROUND
Definition render.h:608
@ GHOSTTY_RENDER_STATE_DATA_COLOR_PALETTE
Definition render.h:619
@ GHOSTTY_RENDER_STATE_DATA_OVERSCAN_REQUEST
Definition render.h:668
@ GHOSTTY_RENDER_STATE_DATA_IMAGE_ITERATOR
Definition render.h:673
@ GHOSTTY_RENDER_STATE_DATA_COLOR_CURSOR
Definition render.h:613
@ GHOSTTY_RENDER_STATE_DATA_DIRTY
Definition render.h:591
@ GHOSTTY_RENDER_STATE_DATA_CURSOR_VIEWPORT_HAS_VALUE
Definition render.h:635
@ GHOSTTY_RENDER_STATE_DATA_COLORS
Definition render.h:655
@ GHOSTTY_RENDER_STATE_DATA_IMAGE_PLACEMENTS_GENERATION
Definition render.h:688
@ GHOSTTY_RENDER_STATE_DATA_CURSOR_VISUAL_STYLE
Definition render.h:622
@ GHOSTTY_RENDER_STATE_DATA_COLOR_CURSOR_HAS_VALUE
Definition render.h:616
@ GHOSTTY_RENDER_STATE_DATA_CURSOR_VIEWPORT_Y
Definition render.h:643
@ GHOSTTY_RENDER_STATE_DATA_OVERSCAN
Definition render.h:662
@ GHOSTTY_RENDER_STATE_DATA_INVALID
Definition render.h:581
@ GHOSTTY_RENDER_STATE_DATA_CURSOR_PASSWORD_INPUT
Definition render.h:631
@ GHOSTTY_RENDER_STATE_DATA_CURSOR_VISIBLE
Definition render.h:625
@ GHOSTTY_RENDER_STATE_DATA_CURSOR_VIEWPORT_WIDE_TAIL
Definition render.h:647
@ GHOSTTY_RENDER_STATE_DATA_COLOR_BACKGROUND
Definition render.h:605
@ GHOSTTY_RENDER_STATE_DATA_ROW_ITERATOR
Definition render.h:602
@ GHOSTTY_RENDER_STATE_DATA_CURSOR
Definition render.h:651
@ GHOSTTY_RENDER_STATE_DATA_CURSOR_BLINKING
Definition render.h:628
@ GHOSTTY_RENDER_STATE_DATA_ROWS
Definition render.h:588
@ GHOSTTY_RENDER_STATE_DATA_COLS
Definition render.h:584
@ GHOSTTY_RENDER_STATE_KITTY_PLACEMENT_KIND_FIXED
Definition render.h:798
@ GHOSTTY_RENDER_STATE_KITTY_PLACEMENT_KIND_VIRTUAL
Definition render.h:767
@ GHOSTTY_RENDER_STATE_KITTY_PLACEMENT_KIND_RELATIVE
Definition render.h:789
@ GHOSTTY_RENDER_STATE_OPTION_DIRTY
Definition render.h:699
@ GHOSTTY_RENDER_STATE_OPTION_OVERSCAN
Definition render.h:708
@ GHOSTTY_RENDER_STATE_IMAGE_DATA_Z
Definition render.h:846
@ GHOSTTY_RENDER_STATE_IMAGE_DATA_PIXEL_HEIGHT
Definition render.h:889
@ GHOSTTY_RENDER_STATE_IMAGE_DATA_PROTOCOL
Definition render.h:821
@ GHOSTTY_RENDER_STATE_IMAGE_DATA_IMAGE_ID
Definition render.h:826
@ GHOSTTY_RENDER_STATE_IMAGE_DATA_VIEWPORT_COL
Definition render.h:854
@ GHOSTTY_RENDER_STATE_IMAGE_DATA_CELL_OFFSET_X
Definition render.h:876
@ GHOSTTY_RENDER_STATE_IMAGE_DATA_IMAGE_GENERATION
Definition render.h:837
@ GHOSTTY_RENDER_STATE_IMAGE_DATA_SOURCE_Y
Definition render.h:897
@ GHOSTTY_RENDER_STATE_IMAGE_DATA_KITTY_PLACEMENT_ID
Definition render.h:915
@ GHOSTTY_RENDER_STATE_IMAGE_DATA_VIEWPORT_ROW
Definition render.h:863
@ GHOSTTY_RENDER_STATE_IMAGE_DATA_PIXEL_WIDTH
Definition render.h:886
@ GHOSTTY_RENDER_STATE_IMAGE_DATA_GRID_ROWS
Definition render.h:869
@ GHOSTTY_RENDER_STATE_IMAGE_DATA_CELL_OFFSET_Y
Definition render.h:883
@ GHOSTTY_RENDER_STATE_IMAGE_DATA_SOURCE_HEIGHT
Definition render.h:905
@ GHOSTTY_RENDER_STATE_IMAGE_DATA_KITTY_KIND
Definition render.h:919
@ GHOSTTY_RENDER_STATE_IMAGE_DATA_INVALID
Definition render.h:818
@ GHOSTTY_RENDER_STATE_IMAGE_DATA_SOURCE_X
Definition render.h:893
@ GHOSTTY_RENDER_STATE_IMAGE_DATA_GRID_COLS
Definition render.h:866
@ GHOSTTY_RENDER_STATE_IMAGE_DATA_LAYER
Definition render.h:840
@ GHOSTTY_RENDER_STATE_IMAGE_DATA_SOURCE_WIDTH
Definition render.h:901
@ GHOSTTY_RENDER_STATE_ROW_CELLS_DATA_HAS_STYLING
Definition render.h:1492
@ GHOSTTY_RENDER_STATE_ROW_CELLS_DATA_RAW
Definition render.h:1447
@ GHOSTTY_RENDER_STATE_ROW_CELLS_DATA_INVALID
Definition render.h:1444
@ GHOSTTY_RENDER_STATE_ROW_CELLS_DATA_GRAPHEMES_LEN
Definition render.h:1454
@ GHOSTTY_RENDER_STATE_ROW_CELLS_DATA_FG_COLOR
Definition render.h:1475
@ GHOSTTY_RENDER_STATE_ROW_CELLS_DATA_GRAPHEMES_BUF
Definition render.h:1459
@ GHOSTTY_RENDER_STATE_ROW_CELLS_DATA_BG_COLOR
Definition render.h:1467
@ GHOSTTY_RENDER_STATE_ROW_CELLS_DATA_SELECTED
Definition render.h:1485
@ GHOSTTY_RENDER_STATE_ROW_CELLS_DATA_STYLE
Definition render.h:1450
@ GHOSTTY_RENDER_STATE_ROW_CELLS_DATA_GRAPHEMES_UTF8
Definition render.h:1505
@ GHOSTTY_RENDER_STATE_IMAGE_LAYER_BELOW_TEXT
Definition render.h:748
@ GHOSTTY_RENDER_STATE_IMAGE_LAYER_BELOW_BACKGROUND
Definition render.h:745
@ GHOSTTY_RENDER_STATE_IMAGE_LAYER_ABOVE_TEXT
Definition render.h:751
@ GHOSTTY_RENDER_STATE_CURSOR_VISUAL_STYLE_BLOCK
Definition render.h:525
@ GHOSTTY_RENDER_STATE_CURSOR_VISUAL_STYLE_BAR
Definition render.h:522
@ GHOSTTY_RENDER_STATE_CURSOR_VISUAL_STYLE_BLOCK_HOLLOW
Definition render.h:531
@ GHOSTTY_RENDER_STATE_CURSOR_VISUAL_STYLE_UNDERLINE
Definition render.h:528
@ GHOSTTY_RENDER_STATE_DIRTY_FALSE
Definition render.h:505
@ GHOSTTY_RENDER_STATE_DIRTY_PARTIAL
Definition render.h:508
@ GHOSTTY_RENDER_STATE_DIRTY_FULL
Definition render.h:511
@ GHOSTTY_RENDER_STATE_ROW_OPTION_DIRTY
Definition render.h:984
struct GhosttyTerminalImpl * GhosttyTerminal
Definition types.h:119
GhosttyColorRgb cursor
Definition render.h:1079
GhosttyColorRgb foreground
Definition render.h:1076
GhosttyColorRgb background
Definition render.h:1073
GhosttyColorRgb palette[256]
Definition render.h:1089
GhosttyRenderStateCursorVisualStyle visual_style
Definition render.h:1049
GhosttyResult
Definition types.h:88
#define GHOSTTY_ENUM_TYPED
Definition types.h:81