libghostty
Loading...
Searching...
No Matches
formatter.h
Go to the documentation of this file.
1
6
7#ifndef GHOSTTY_VT_FORMATTER_H
8#define GHOSTTY_VT_FORMATTER_H
9
10#include <stdbool.h>
11#include <stddef.h>
12#include <stdint.h>
15#include <ghostty/vt/types.h>
16#include <ghostty/vt/terminal.h>
17
18#ifdef __cplusplus
19extern "C" {
20#endif
21
34
40typedef enum GHOSTTY_ENUM_TYPED {
43
46
49 GHOSTTY_FORMATTER_FORMAT_MAX_VALUE = GHOSTTY_ENUM_MAX_VALUE,
51
57typedef struct {
59 size_t size;
60
62 bool cursor;
63
65 bool style;
66
69
72
75
79
85typedef struct {
87 size_t size;
88
90 bool palette;
91
93 bool modes;
94
97
100
102 bool pwd;
103
106
110
116typedef struct {
118 size_t size;
119
122
124 bool unwrap;
125
127 bool trim;
128
131
136
152 const GhosttyAllocator* allocator,
153 GhosttyFormatter* formatter,
154 GhosttyTerminal terminal,
156
179 uint8_t* buf,
180 size_t buf_len,
181 size_t* out_written);
182
202 const GhosttyAllocator* allocator,
203 uint8_t** out_ptr,
204 size_t* out_len);
205
216GHOSTTY_API void ghostty_formatter_free(GhosttyFormatter formatter);
217
219
220#ifdef __cplusplus
221}
222#endif
223
224#endif /* GHOSTTY_VT_FORMATTER_H */
GHOSTTY_API GhosttyResult ghostty_formatter_format_alloc(GhosttyFormatter formatter, const GhosttyAllocator *allocator, uint8_t **out_ptr, size_t *out_len)
GHOSTTY_API void ghostty_formatter_free(GhosttyFormatter formatter)
GHOSTTY_API GhosttyResult ghostty_formatter_terminal_new(const GhosttyAllocator *allocator, GhosttyFormatter *formatter, GhosttyTerminal terminal, GhosttyFormatterTerminalOptions options)
GhosttyFormatterFormat
Definition formatter.h:40
GHOSTTY_API GhosttyResult ghostty_formatter_format_buf(GhosttyFormatter formatter, uint8_t *buf, size_t buf_len, size_t *out_written)
struct GhosttyFormatterImpl * GhosttyFormatter
Definition types.h:163
@ GHOSTTY_FORMATTER_FORMAT_PLAIN
Definition formatter.h:42
@ GHOSTTY_FORMATTER_FORMAT_HTML
Definition formatter.h:48
@ GHOSTTY_FORMATTER_FORMAT_VT
Definition formatter.h:45
struct GhosttyTerminalImpl * GhosttyTerminal
Definition types.h:95
GhosttyFormatterScreenExtra screen
Definition formatter.h:108
GhosttyFormatterFormat emit
Definition formatter.h:121
GhosttyFormatterTerminalExtra extra
Definition formatter.h:130
const GhosttySelection * selection
Definition formatter.h:134
GhosttyResult
Definition types.h:74
#define GHOSTTY_ENUM_TYPED
Definition types.h:67