Some of SIXEL output path.

This commit is contained in:
Nicholas Marriott
2026-10-14 11:04:00 +01:00
parent 9a37890133
commit d68e56f130
7 changed files with 307 additions and 9 deletions

20
tty.c
View File

@@ -155,13 +155,22 @@ tty_resize(struct tty *tty)
tty_invalidate(tty);
}
void
int
tty_set_size(struct tty *tty, u_int sx, u_int sy, u_int xpixel, u_int ypixel)
{
if (tty->sx == sx &&
tty->sy == sy &&
tty->xpixel == xpixel &&
tty->ypixel == ypixel)
return (0);
tty->sx = sx;
tty->sy = sy;
tty->xpixel = xpixel;
tty->ypixel = ypixel;
#ifdef ENABLE_IMAGES
image_tty_size_changed(tty);
#endif
return (1);
}
static void
@@ -523,6 +532,9 @@ tty_close(struct tty *tty)
tty_stop_tty(tty);
if (tty->flags & TTY_OPENED) {
#ifdef ENABLE_IMAGES
image_tty_free(tty);
#endif
evbuffer_free(tty->in);
event_del(&tty->event_in);
evbuffer_free(tty->out);
@@ -539,6 +551,9 @@ void
tty_free(struct tty *tty)
{
tty_close(tty);
#ifdef ENABLE_IMAGES
image_tty_free(tty);
#endif
}
void
@@ -548,6 +563,9 @@ tty_update_features(struct tty *tty)
if (tty_apply_features(tty->term))
tty_term_apply_overrides(tty->term);
#ifdef ENABLE_IMAGES
image_tty_update(tty);
#endif
if (tty_use_margin(tty))
tty_putcode(tty, TTYC_ENMG);