From 488a1b983e1c2fac14de25aa781caf12628e53c8 Mon Sep 17 00:00:00 2001 From: Thomas Martitz Date: Sun, 12 Jan 2014 01:30:26 +0100 Subject: put_line/scrolling: Make the scroll engine inform custom scrollers about start/stop of scrolling. With the new lcd_putsxy_scroll_func() code can register custom scroll functions (put_line() makes use of that). In order for the custom scroller to be able to properly manage its userdata pointer (set via struct scrollinfo::userdata) the scroll engine must inform the scroller about start and stop of scrolling. To inform about start the lcd_scroll_* functions now return true when the line will scroll. To inform about stop the scroll engine calls into the scroller one last time, with the text set to NULL. put_line() can use this to release the userdata registered per scrolling line so that it can be recycled. This fixes that some scrolling lines became glitchy after some time because the userdata was recycled too early. Change-Id: Iff0a6ce2a4f9ae2bada1b8e62f4f5950224942a9 --- apps/plugin.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'apps/plugin.h') diff --git a/apps/plugin.h b/apps/plugin.h index 2cf40d5758..5d6527d7a4 100644 --- a/apps/plugin.h +++ b/apps/plugin.h @@ -197,7 +197,7 @@ struct plugin_api { void (*lcd_putsxyf)(int x, int y, const unsigned char *fmt, ...); void (*lcd_puts)(int x, int y, const unsigned char *string); void (*lcd_putsf)(int x, int y, const unsigned char *fmt, ...); - void (*lcd_puts_scroll)(int x, int y, const unsigned char* string); + bool (*lcd_puts_scroll)(int x, int y, const unsigned char* string); void (*lcd_scroll_stop)(void); #ifdef HAVE_LCD_CHARCELLS void (*lcd_define_pattern)(unsigned long ucs, const char *pattern); -- cgit v1.2.3