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/types.h
>
15
#include <
ghostty/vt/terminal.h
>
16
17
#ifdef __cplusplus
18
extern
"C"
{
19
#endif
20
33
39
typedef
enum
{
41
GHOSTTY_FORMATTER_FORMAT_PLAIN
,
42
44
GHOSTTY_FORMATTER_FORMAT_VT
,
45
47
GHOSTTY_FORMATTER_FORMAT_HTML
,
48
}
GhosttyFormatterFormat
;
49
55
typedef
struct
{
57
size_t
size
;
58
60
bool
cursor
;
61
63
bool
style
;
64
66
bool
hyperlink
;
67
69
bool
protection
;
70
72
bool
kitty_keyboard
;
73
75
bool
charsets
;
76
}
GhosttyFormatterScreenExtra
;
77
83
typedef
struct
{
85
size_t
size
;
86
88
bool
palette
;
89
91
bool
modes
;
92
94
bool
scrolling_region
;
95
97
bool
tabstops
;
98
100
bool
pwd
;
101
103
bool
keyboard
;
104
106
GhosttyFormatterScreenExtra
screen
;
107
}
GhosttyFormatterTerminalExtra
;
108
114
typedef
struct
GhosttyFormatter
*
GhosttyFormatter
;
115
121
typedef
struct
{
123
size_t
size
;
124
126
GhosttyFormatterFormat
emit
;
127
129
bool
unwrap
;
130
132
bool
trim
;
133
135
GhosttyFormatterTerminalExtra
extra
;
136
}
GhosttyFormatterTerminalOptions
;
137
152
GhosttyResult
ghostty_formatter_terminal_new
(
153
const
GhosttyAllocator
* allocator,
154
GhosttyFormatter
* formatter,
155
GhosttyTerminal
terminal,
156
GhosttyFormatterTerminalOptions
options);
157
179
GhosttyResult
ghostty_formatter_format_buf
(
GhosttyFormatter
formatter,
180
uint8_t* buf,
181
size_t
buf_len,
182
size_t
* out_written);
183
203
GhosttyResult
ghostty_formatter_format_alloc
(
GhosttyFormatter
formatter,
204
const
GhosttyAllocator
* allocator,
205
uint8_t** out_ptr,
206
size_t
* out_len);
207
218
void
ghostty_formatter_free
(
GhosttyFormatter
formatter);
219
221
222
#ifdef __cplusplus
223
}
224
#endif
225
226
#endif
/* GHOSTTY_VT_FORMATTER_H */
allocator.h
ghostty_formatter_format_alloc
GhosttyResult ghostty_formatter_format_alloc(GhosttyFormatter formatter, const GhosttyAllocator *allocator, uint8_t **out_ptr, size_t *out_len)
ghostty_formatter_format_buf
GhosttyResult ghostty_formatter_format_buf(GhosttyFormatter formatter, uint8_t *buf, size_t buf_len, size_t *out_written)
ghostty_formatter_free
void ghostty_formatter_free(GhosttyFormatter formatter)
ghostty_formatter_terminal_new
GhosttyResult ghostty_formatter_terminal_new(const GhosttyAllocator *allocator, GhosttyFormatter *formatter, GhosttyTerminal terminal, GhosttyFormatterTerminalOptions options)
GhosttyFormatter
struct GhosttyFormatter * GhosttyFormatter
Definition
formatter.h:114
GhosttyFormatterFormat
GhosttyFormatterFormat
Definition
formatter.h:39
GHOSTTY_FORMATTER_FORMAT_PLAIN
@ GHOSTTY_FORMATTER_FORMAT_PLAIN
Definition
formatter.h:41
GHOSTTY_FORMATTER_FORMAT_HTML
@ GHOSTTY_FORMATTER_FORMAT_HTML
Definition
formatter.h:47
GHOSTTY_FORMATTER_FORMAT_VT
@ GHOSTTY_FORMATTER_FORMAT_VT
Definition
formatter.h:44
GhosttyTerminal
struct GhosttyTerminal * GhosttyTerminal
Definition
terminal.h:34
GhosttyAllocator
Definition
allocator.h:179
GhosttyFormatterScreenExtra
Definition
formatter.h:55
GhosttyFormatterScreenExtra::style
bool style
Definition
formatter.h:63
GhosttyFormatterScreenExtra::hyperlink
bool hyperlink
Definition
formatter.h:66
GhosttyFormatterScreenExtra::size
size_t size
Definition
formatter.h:57
GhosttyFormatterScreenExtra::protection
bool protection
Definition
formatter.h:69
GhosttyFormatterScreenExtra::kitty_keyboard
bool kitty_keyboard
Definition
formatter.h:72
GhosttyFormatterScreenExtra::cursor
bool cursor
Definition
formatter.h:60
GhosttyFormatterScreenExtra::charsets
bool charsets
Definition
formatter.h:75
GhosttyFormatterTerminalExtra
Definition
formatter.h:83
GhosttyFormatterTerminalExtra::scrolling_region
bool scrolling_region
Definition
formatter.h:94
GhosttyFormatterTerminalExtra::keyboard
bool keyboard
Definition
formatter.h:103
GhosttyFormatterTerminalExtra::modes
bool modes
Definition
formatter.h:91
GhosttyFormatterTerminalExtra::tabstops
bool tabstops
Definition
formatter.h:97
GhosttyFormatterTerminalExtra::pwd
bool pwd
Definition
formatter.h:100
GhosttyFormatterTerminalExtra::size
size_t size
Definition
formatter.h:85
GhosttyFormatterTerminalExtra::palette
bool palette
Definition
formatter.h:88
GhosttyFormatterTerminalExtra::screen
GhosttyFormatterScreenExtra screen
Definition
formatter.h:106
GhosttyFormatterTerminalOptions
Definition
formatter.h:121
GhosttyFormatterTerminalOptions::trim
bool trim
Definition
formatter.h:132
GhosttyFormatterTerminalOptions::emit
GhosttyFormatterFormat emit
Definition
formatter.h:126
GhosttyFormatterTerminalOptions::unwrap
bool unwrap
Definition
formatter.h:129
GhosttyFormatterTerminalOptions::extra
GhosttyFormatterTerminalExtra extra
Definition
formatter.h:135
GhosttyFormatterTerminalOptions::size
size_t size
Definition
formatter.h:123
terminal.h
types.h
GhosttyResult
GhosttyResult
Definition
types.h:13
include
ghostty
vt
formatter.h
Generated by
1.16.1