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>
13
#include <
ghostty/vt/allocator.h
>
14
#include <
ghostty/vt/selection.h
>
15
#include <
ghostty/vt/types.h
>
16
#include <
ghostty/vt/terminal.h
>
17
18
#ifdef __cplusplus
19
extern
"C"
{
20
#endif
21
34
40
typedef
enum
GHOSTTY_ENUM_TYPED
{
42
GHOSTTY_FORMATTER_FORMAT_PLAIN
,
43
45
GHOSTTY_FORMATTER_FORMAT_VT
,
46
48
GHOSTTY_FORMATTER_FORMAT_HTML
,
49
GHOSTTY_FORMATTER_FORMAT_MAX_VALUE = GHOSTTY_ENUM_MAX_VALUE,
50
}
GhosttyFormatterFormat
;
51
57
typedef
struct
{
59
size_t
size
;
60
62
bool
cursor
;
63
65
bool
style
;
66
68
bool
hyperlink
;
69
71
bool
protection
;
72
74
bool
kitty_keyboard
;
75
77
bool
charsets
;
78
}
GhosttyFormatterScreenExtra
;
79
85
typedef
struct
{
87
size_t
size
;
88
90
bool
palette
;
91
93
bool
modes
;
94
96
bool
scrolling_region
;
97
99
bool
tabstops
;
100
102
bool
pwd
;
103
105
bool
keyboard
;
106
108
GhosttyFormatterScreenExtra
screen
;
109
}
GhosttyFormatterTerminalExtra
;
110
116
typedef
struct
{
118
size_t
size
;
119
121
GhosttyFormatterFormat
emit
;
122
124
bool
unwrap
;
125
127
bool
trim
;
128
130
GhosttyFormatterTerminalExtra
extra
;
131
134
const
GhosttySelection
*
selection
;
135
}
GhosttyFormatterTerminalOptions
;
136
151
GHOSTTY_API
GhosttyResult
ghostty_formatter_terminal_new
(
152
const
GhosttyAllocator
* allocator,
153
GhosttyFormatter
* formatter,
154
GhosttyTerminal
terminal,
155
GhosttyFormatterTerminalOptions
options);
156
178
GHOSTTY_API
GhosttyResult
ghostty_formatter_format_buf
(
GhosttyFormatter
formatter,
179
uint8_t* buf,
180
size_t
buf_len,
181
size_t
* out_written);
182
201
GHOSTTY_API
GhosttyResult
ghostty_formatter_format_alloc
(
GhosttyFormatter
formatter,
202
const
GhosttyAllocator
* allocator,
203
uint8_t** out_ptr,
204
size_t
* out_len);
205
216
GHOSTTY_API
void
ghostty_formatter_free
(
GhosttyFormatter
formatter);
217
219
220
#ifdef __cplusplus
221
}
222
#endif
223
224
#endif
/* GHOSTTY_VT_FORMATTER_H */
allocator.h
ghostty_formatter_format_alloc
GHOSTTY_API GhosttyResult ghostty_formatter_format_alloc(GhosttyFormatter formatter, const GhosttyAllocator *allocator, uint8_t **out_ptr, size_t *out_len)
ghostty_formatter_free
GHOSTTY_API void ghostty_formatter_free(GhosttyFormatter formatter)
ghostty_formatter_terminal_new
GHOSTTY_API GhosttyResult ghostty_formatter_terminal_new(const GhosttyAllocator *allocator, GhosttyFormatter *formatter, GhosttyTerminal terminal, GhosttyFormatterTerminalOptions options)
GhosttyFormatterFormat
GhosttyFormatterFormat
Definition
formatter.h:40
ghostty_formatter_format_buf
GHOSTTY_API GhosttyResult ghostty_formatter_format_buf(GhosttyFormatter formatter, uint8_t *buf, size_t buf_len, size_t *out_written)
GhosttyFormatter
struct GhosttyFormatterImpl * GhosttyFormatter
Definition
types.h:163
GHOSTTY_FORMATTER_FORMAT_PLAIN
@ GHOSTTY_FORMATTER_FORMAT_PLAIN
Definition
formatter.h:42
GHOSTTY_FORMATTER_FORMAT_HTML
@ GHOSTTY_FORMATTER_FORMAT_HTML
Definition
formatter.h:48
GHOSTTY_FORMATTER_FORMAT_VT
@ GHOSTTY_FORMATTER_FORMAT_VT
Definition
formatter.h:45
GhosttyTerminal
struct GhosttyTerminalImpl * GhosttyTerminal
Definition
types.h:95
selection.h
GhosttyAllocator
Definition
allocator.h:198
GhosttyFormatterScreenExtra
Definition
formatter.h:57
GhosttyFormatterScreenExtra::style
bool style
Definition
formatter.h:65
GhosttyFormatterScreenExtra::hyperlink
bool hyperlink
Definition
formatter.h:68
GhosttyFormatterScreenExtra::size
size_t size
Definition
formatter.h:59
GhosttyFormatterScreenExtra::protection
bool protection
Definition
formatter.h:71
GhosttyFormatterScreenExtra::kitty_keyboard
bool kitty_keyboard
Definition
formatter.h:74
GhosttyFormatterScreenExtra::cursor
bool cursor
Definition
formatter.h:62
GhosttyFormatterScreenExtra::charsets
bool charsets
Definition
formatter.h:77
GhosttyFormatterTerminalExtra
Definition
formatter.h:85
GhosttyFormatterTerminalExtra::scrolling_region
bool scrolling_region
Definition
formatter.h:96
GhosttyFormatterTerminalExtra::keyboard
bool keyboard
Definition
formatter.h:105
GhosttyFormatterTerminalExtra::modes
bool modes
Definition
formatter.h:93
GhosttyFormatterTerminalExtra::tabstops
bool tabstops
Definition
formatter.h:99
GhosttyFormatterTerminalExtra::pwd
bool pwd
Definition
formatter.h:102
GhosttyFormatterTerminalExtra::size
size_t size
Definition
formatter.h:87
GhosttyFormatterTerminalExtra::palette
bool palette
Definition
formatter.h:90
GhosttyFormatterTerminalExtra::screen
GhosttyFormatterScreenExtra screen
Definition
formatter.h:108
GhosttyFormatterTerminalOptions
Definition
formatter.h:116
GhosttyFormatterTerminalOptions::trim
bool trim
Definition
formatter.h:127
GhosttyFormatterTerminalOptions::emit
GhosttyFormatterFormat emit
Definition
formatter.h:121
GhosttyFormatterTerminalOptions::unwrap
bool unwrap
Definition
formatter.h:124
GhosttyFormatterTerminalOptions::extra
GhosttyFormatterTerminalExtra extra
Definition
formatter.h:130
GhosttyFormatterTerminalOptions::size
size_t size
Definition
formatter.h:118
GhosttyFormatterTerminalOptions::selection
const GhosttySelection * selection
Definition
formatter.h:134
GhosttySelection
Definition
selection.h:33
terminal.h
types.h
GhosttyResult
GhosttyResult
Definition
types.h:74
GHOSTTY_ENUM_TYPED
#define GHOSTTY_ENUM_TYPED
Definition
types.h:67
include
ghostty
vt
formatter.h
Generated by
1.16.1