term: add term_scrollback_to_text() and term_view_to_text()

These functions extract the current view, or the entire scrollback as
an UTF-8 encoded byte buffer.
This commit is contained in:
Daniel Eklöf 2020-07-15 11:33:37 +02:00
parent e6acafa118
commit 4d17423ed1
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F
2 changed files with 62 additions and 2 deletions

View file

@ -543,5 +543,7 @@ void term_disable_app_sync_updates(struct terminal *term);
enum term_surface term_surface_kind(
const struct terminal *term, const struct wl_surface *surface);
bool term_scrollback_to_text(const struct terminal *term, wchar_t **text);
bool term_view_to_text(const struct terminal *term, wchar_t **text);
bool term_scrollback_to_text(
const struct terminal *term, char **text, size_t *len);
bool term_view_to_text(
const struct terminal *term, char **text, size_t *len);