diff options
| author | Thomas Martitz <kugel@rockbox.org> | 2013-12-20 23:34:28 +0100 |
|---|---|---|
| committer | Thomas Martitz <kugel@rockbox.org> | 2014-01-07 11:36:00 +0100 |
| commit | 6630958533d02d66dca8cc79897fda2cb744c076 (patch) | |
| tree | 598f20a9ebd1248dd4fdbfdf3875ab928f80980a /firmware | |
| parent | b8505222c02a7a5a19571c3d4577f3b473cb8558 (diff) | |
| download | rockbox-6630958533d02d66dca8cc79897fda2cb744c076.zip rockbox-6630958533d02d66dca8cc79897fda2cb744c076.tar.gz rockbox-6630958533d02d66dca8cc79897fda2cb744c076.tar.bz2 rockbox-6630958533d02d66dca8cc79897fda2cb744c076.tar.xz | |
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
Diffstat (limited to 'firmware')
| -rw-r--r-- | firmware/drivers/lcd-bitmap-common.c | 11 | ||||
| -rw-r--r-- | firmware/drivers/lcd-charcell.c | 10 | ||||
| -rw-r--r-- | firmware/export/lcd-remote.h | 3 | ||||
| -rw-r--r-- | firmware/export/lcd.h | 5 |
4 files changed, 29 insertions, 0 deletions
diff --git a/firmware/drivers/lcd-bitmap-common.c b/firmware/drivers/lcd-bitmap-common.c index d8417e1..5961bba 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); diff --git a/firmware/drivers/lcd-charcell.c b/firmware/drivers/lcd-charcell.c index db867cd..5415951 100644 --- a/firmware/drivers/lcd-charcell.c +++ b/firmware/drivers/lcd-charcell.c @@ -563,6 +563,16 @@ void lcd_puts_scroll_worker(int x, int y, const unsigned char *string, lcd_scroll_info.lines++; } +void lcd_putsxy_scroll_func(int x, int y, const unsigned char *string, + void (*scroll_func)(struct scrollinfo *), + void *data, int x_offset) +{ + if (!scroll_func) + lcd_putsxyofs(x, y, x_offset, string); + else + lcd_puts_scroll_worker(x, y, string, x_offset, scroll_func, data); +} + void lcd_scroll_fn(struct scrollinfo* s) { lcd_putsxyofs(s->x, s->y, s->offset, s->line); diff --git a/firmware/export/lcd-remote.h b/firmware/export/lcd-remote.h index be6816c..f209e6b 100644 --- a/firmware/export/lcd-remote.h +++ b/firmware/export/lcd-remote.h @@ -196,6 +196,9 @@ extern void lcd_remote_puts_scroll_style_xyoffset(int x, int y, const unsigned char *string, int style, int x_offset, int y_offset); +extern void lcd_remote_putsxy_scroll_func(int x, int y, const unsigned char *string, + void (*scroll_func)(struct scrollinfo *), + void *data, int x_offset); extern void lcd_remote_update(void); extern void lcd_remote_update_rect(int x, int y, int width, int height); diff --git a/firmware/export/lcd.h b/firmware/export/lcd.h index 7842ce5..745c445 100644 --- a/firmware/export/lcd.h +++ b/firmware/export/lcd.h @@ -108,6 +108,8 @@ enum screen_type { #endif }; +struct scrollinfo; + #if defined(LCD_STRIDEFORMAT) && LCD_STRIDEFORMAT == VERTICAL_STRIDE #define STRIDE_MAIN(w, h) (h) #else @@ -212,6 +214,9 @@ extern void lcd_putc(int x, int y, unsigned long ucs); extern void lcd_puts_scroll(int x, int y, const unsigned char* string); extern void lcd_puts_scroll_style(int x, int y, const unsigned char* string, int style); +extern void lcd_putsxy_scroll_func(int x, int y, const unsigned char *string, + void (*scroll_func)(struct scrollinfo *), + void *data, int x_offset); #ifdef HAVE_LCD_BITMAP |