From 6985d9a715d9167bc3d53a12e45357d0d0f5ca22 Mon Sep 17 00:00:00 2001 From: nick black Date: Sat, 25 Sep 2021 21:38:43 -0400 Subject: [PATCH] drop tinfo argument from pixel_init() --- src/lib/sixel.c | 6 ++---- src/lib/sprite.c | 2 +- src/lib/sprite.h | 4 ++-- src/lib/termdesc.h | 2 +- 4 files changed, 6 insertions(+), 8 deletions(-) diff --git a/src/lib/sixel.c b/src/lib/sixel.c index 0edce629b..345e50578 100644 --- a/src/lib/sixel.c +++ b/src/lib/sixel.c @@ -1042,16 +1042,14 @@ int sixel_draw(const tinfo* ti, const ncpile* p, sprixel* s, fbuf* f, return s->glyph.used; } -int sixel_init(const tinfo* ti, int fd){ - (void)ti; +int sixel_init(int fd){ // \e[?8452: DECSDM private "sixel scrolling" mode keeps the sixel from // scrolling, but puts it at the current cursor location (as opposed to // the upper left corner of the screen). return tty_emit("\e[?80;8452h", fd); } -int sixel_init_inverted(const tinfo* ti, int fd){ - (void)ti; +int sixel_init_inverted(int fd){ // except MLterm (and a few others, possibly including the physical VT340), // which inverts the usual sense of DECSDM. return tty_emit("\e[?80l\e[?8452h", fd); diff --git a/src/lib/sprite.c b/src/lib/sprite.c index f14c197e6..883df47e4 100644 --- a/src/lib/sprite.c +++ b/src/lib/sprite.c @@ -220,7 +220,7 @@ int sprite_init(const tinfo* t, int fd){ if(t->pixel_init == NULL){ return 0; } - return t->pixel_init(t, fd); + return t->pixel_init(fd); } uint8_t* sprixel_auxiliary_vector(const sprixel* s){ diff --git a/src/lib/sprite.h b/src/lib/sprite.h index 46e0d3462..402b16c1d 100644 --- a/src/lib/sprite.h +++ b/src/lib/sprite.h @@ -183,8 +183,8 @@ int kitty_scrub(const struct ncpile* p, sprixel* s); int fbcon_scrub(const struct ncpile* p, sprixel* s); int kitty_remove(int id, fbuf* f); int kitty_clear_all(fbuf* f); -int sixel_init(const tinfo* t, int fd); -int sixel_init_inverted(const tinfo* t, int fd); +int sixel_init(int fd); +int sixel_init_inverted(int fd); int kitty_shutdown(fbuf* f); int sixel_shutdown(fbuf* f); uint8_t* sixel_trans_auxvec(const struct tinfo* ti); diff --git a/src/lib/termdesc.h b/src/lib/termdesc.h index a0881abef..c5e2f5cee 100644 --- a/src/lib/termdesc.h +++ b/src/lib/termdesc.h @@ -127,7 +127,7 @@ typedef struct tinfo { // it leaves the sprixel in INVALIDATED so that it's drawn in phase 2. void (*pixel_refresh)(const struct ncpile* p, struct sprixel* s); int (*pixel_remove)(int id, fbuf* f); // kitty only, issue actual delete command - int (*pixel_init)(const struct tinfo*, int fd); // called when support is detected + int (*pixel_init)(int fd); // called when support is detected int (*pixel_draw)(const struct tinfo*, const struct ncpile* p, struct sprixel* s, fbuf* f, int y, int x); int (*pixel_draw_late)(const struct tinfo*, struct sprixel* s, int yoff, int xoff);