From 6630958533d02d66dca8cc79897fda2cb744c076 Mon Sep 17 00:00:00 2001 From: Thomas Martitz Date: Fri, 20 Dec 2013 23:34:28 +0100 Subject: lcd-common/scroll_engine: Introduce lcd_putsxy_scroll_func(). This function supports installing a custom scroll callback. This will be called when the scrollengine redraws the line. It allows to draw extended styles (or anything your can possible imagine) along with the text. It is also strictly pixel-based, the first pixel-based function that supports scrolling. Change-Id: I57f81ac7b3d08b877aea4cb8afa882f175ebcdfc --- firmware/drivers/lcd-bitmap-common.c | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'firmware/drivers/lcd-bitmap-common.c') diff --git a/firmware/drivers/lcd-bitmap-common.c b/firmware/drivers/lcd-bitmap-common.c index d8417e13e2..5961bba7a5 100644 --- a/firmware/drivers/lcd-bitmap-common.c +++ b/firmware/drivers/lcd-bitmap-common.c @@ -572,6 +572,17 @@ void LCDFN(puts_scroll_style_xyoffset)(int x, int y, const unsigned char *string true, LCDFN(scroll_fn), NULL); } +void LCDFN(putsxy_scroll_func)(int x, int y, const unsigned char *string, + void (*scroll_func)(struct scrollinfo *), + void *data, int x_offset) +{ + if (!scroll_func) + LCDFN(putsxyofs)(x, y, x_offset, string); + else + LCDFN(puts_scroll_worker)(x, y, string, STYLE_NONE, x_offset, 0, + false, scroll_func, data); +} + void LCDFN(puts_scroll)(int x, int y, const unsigned char *string) { LCDFN(puts_scroll_style)(x, y, string, STYLE_DEFAULT); -- cgit v1.2.3