From cee18f5da70e754469e71f37fba47f06e70c6299 Mon Sep 17 00:00:00 2001 From: nick black Date: Sun, 8 Aug 2021 05:47:54 -0400 Subject: [PATCH] wire up fbcon_scroll #2010 --- src/lib/linux.c | 4 ++++ src/lib/sprite.h | 1 + src/lib/termdesc.c | 4 ++++ src/lib/termdesc.h | 2 +- 4 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/lib/linux.c b/src/lib/linux.c index edefa59cb..1d1c8d33c 100644 --- a/src/lib/linux.c +++ b/src/lib/linux.c @@ -1,6 +1,10 @@ #include "linux.h" #include "internal.h" +void fbcon_scroll(tinfo* ti, int rows){ + // FIXME +} + // auxvecs for framebuffer are 1B each for s->cellpxx * s->cellpxy elements, // and store the original alpha value. int fbcon_wipe(sprixel* s, int ycell, int xcell){ diff --git a/src/lib/sprite.h b/src/lib/sprite.h index bd352f75f..da626436e 100644 --- a/src/lib/sprite.h +++ b/src/lib/sprite.h @@ -206,6 +206,7 @@ int fbcon_blit(struct ncplane* nc, int linesize, const void* data, int leny, int lenx, const struct blitterargs* bargs); int fbcon_draw(const tinfo* ti, const struct ncpile *p, sprixel* s, fbuf* f, int y, int x); +void fbcon_scroll(tinfo* ti, int rows); typedef enum { // C=1 (disabling scrolling) was only introduced in 0.20.0, at the same diff --git a/src/lib/termdesc.c b/src/lib/termdesc.c index bf4f54def..7d8d237ed 100644 --- a/src/lib/termdesc.c +++ b/src/lib/termdesc.c @@ -58,6 +58,7 @@ setup_sixel_bitmaps(tinfo* ti, int fd, bool invert80){ ti->pixel_remove = NULL; ti->pixel_move = NULL; ti->pixel_shutdown = sixel_shutdown; + ti->pixel_scroll = NULL; ti->pixel_rebuild = sixel_rebuild; ti->pixel_trans_auxvec = sixel_trans_auxvec; ti->sprixel_scale_height = 6; @@ -76,6 +77,7 @@ setup_iterm_bitmaps(tinfo* ti, int fd){ ti->pixel_move = NULL; ti->color_registers = 0; ti->pixel_scrub = sixel_scrub; + ti->pixel_scroll = NULL; ti->pixel_draw = iterm_draw; ti->pixel_wipe = iterm_wipe; ti->pixel_rebuild = iterm_rebuild; @@ -94,6 +96,7 @@ setup_kitty_bitmaps(tinfo* ti, int fd, kitty_graphics_e level){ ti->pixel_draw = kitty_draw; ti->pixel_commit = kitty_commit; ti->pixel_move = kitty_move; + ti->pixel_scroll = NULL; ti->pixel_shutdown = kitty_shutdown; ti->pixel_clear_all = kitty_clear_all; if(level == KITTY_ALWAYS_SCROLLS){ @@ -122,6 +125,7 @@ setup_fbcon_bitmaps(tinfo* ti, int fd){ ti->pixel_rebuild = fbcon_rebuild; ti->pixel_wipe = fbcon_wipe; ti->pixel_draw = fbcon_draw; + ti->pixel_scroll = fbcon_scroll; ti->pixel_scrub = fbcon_scrub; ti->pixel_trans_auxvec = kitty_trans_auxvec; set_pixel_blitter(fbcon_blit); diff --git a/src/lib/termdesc.h b/src/lib/termdesc.h index cb466183c..7be60f883 100644 --- a/src/lib/termdesc.h +++ b/src/lib/termdesc.h @@ -164,7 +164,7 @@ typedef struct tinfo { // make a loaded graphic visible. only used with kitty. int (*pixel_commit)(fbuf* f, struct sprixel* s, unsigned noscroll); // scroll all graphics up. only used with fbcon. - void (*pixel_scroll)(const struct tinfo*, int rows); + void (*pixel_scroll)(struct tinfo*, int rows); uint8_t* (*pixel_trans_auxvec)(const struct tinfo* ti); // create tranparent auxvec // sprixel parameters. there are several different sprixel protocols, of // which we support sixel and kitty. the kitty protocol is used based