summaryrefslogtreecommitdiff
path: root/firmware/export/scroll_engine.h
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/export/scroll_engine.h')
-rw-r--r--firmware/export/scroll_engine.h30
1 files changed, 18 insertions, 12 deletions
diff --git a/firmware/export/scroll_engine.h b/firmware/export/scroll_engine.h
index 01a9a5e33d..c7eb97aecc 100644
--- a/firmware/export/scroll_engine.h
+++ b/firmware/export/scroll_engine.h
@@ -37,19 +37,19 @@ extern void lcd_scroll_delay(int ms);
extern void lcd_scroll_stop(void);
extern void lcd_scroll_stop_viewport(const struct viewport *vp);
-extern void lcd_scroll_stop_viewport_line(const struct viewport *vp, int line);
-extern void lcd_scroll_fn(void);
+extern void lcd_scroll_stop_viewport_rect(const struct viewport *vp, int x, int y, int width, int height);
#ifdef HAVE_REMOTE_LCD
extern void lcd_remote_scroll_speed(int speed);
extern void lcd_remote_scroll_delay(int ms);
extern void lcd_remote_scroll_stop(void);
extern void lcd_remote_scroll_stop_viewport(const struct viewport *vp);
-extern void lcd_remote_scroll_stop_viewport_line(const struct viewport *vp, int line);
-extern void lcd_remote_scroll_fn(void);
+extern void lcd_remote_scroll_stop_viewport_rect(const struct viewport *vp, int x, int y, int width, int height);
#endif
-/* internal usage, but in multiple drivers */
+/* internal usage, but in multiple drivers
+ * larger than the normal linebuffer since it holds the line a second
+ * time (+3 spaces) for non-bidir scrolling */
#define SCROLL_SPACING 3
#ifdef HAVE_LCD_BITMAP
#define SCROLL_LINE_SIZE (MAX_PATH + SCROLL_SPACING + 3*LCD_WIDTH/2 + 2)
@@ -60,21 +60,27 @@ extern void lcd_remote_scroll_fn(void);
struct scrollinfo
{
struct viewport* vp;
- char line[SCROLL_LINE_SIZE];
+ char linebuffer[9*MAX_PATH/10];
+ const char *line;
#ifdef HAVE_LCD_CHARCELLS
int len; /* length of line in chars */
#endif
- int y; /* Position of the line on the screen (char co-ordinates) */
+ /* rectangle for the line */
+ int x, y; /* relative to the viewort */
+ int width, height;
+ /* pixel to skip from the beginning of the string, increments as the text scrolls */
int offset;
- int startx;
- int y_offset; /* y offset of the line, used for pixel-accurate list scrolling */
#ifdef HAVE_LCD_BITMAP
- int width; /* length of line in pixels */
int style; /* line style */
-#endif/* HAVE_LCD_BITMAP */
- bool backward; /* scroll presently forward or backward? */
+#endif /* HAVE_LCD_BITMAP */
+ /* scroll presently forward or backward? */
+ bool backward;
bool bidir;
long start_tick;
+
+ /* support for custom scrolling functions */
+ void (*scroll_func)(struct scrollinfo *s);
+ void *userdata;
};
struct scroll_screen_info