diff options
Diffstat (limited to 'firmware/export')
-rw-r--r-- | firmware/export/scroll_engine.h | 30 |
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); | |||
37 | 37 | ||
38 | extern void lcd_scroll_stop(void); | 38 | extern void lcd_scroll_stop(void); |
39 | extern void lcd_scroll_stop_viewport(const struct viewport *vp); | 39 | extern void lcd_scroll_stop_viewport(const struct viewport *vp); |
40 | extern void lcd_scroll_stop_viewport_line(const struct viewport *vp, int line); | 40 | extern void lcd_scroll_stop_viewport_rect(const struct viewport *vp, int x, int y, int width, int height); |
41 | extern void lcd_scroll_fn(void); | ||
42 | #ifdef HAVE_REMOTE_LCD | 41 | #ifdef HAVE_REMOTE_LCD |
43 | extern void lcd_remote_scroll_speed(int speed); | 42 | extern void lcd_remote_scroll_speed(int speed); |
44 | extern void lcd_remote_scroll_delay(int ms); | 43 | extern void lcd_remote_scroll_delay(int ms); |
45 | 44 | ||
46 | extern void lcd_remote_scroll_stop(void); | 45 | extern void lcd_remote_scroll_stop(void); |
47 | extern void lcd_remote_scroll_stop_viewport(const struct viewport *vp); | 46 | extern void lcd_remote_scroll_stop_viewport(const struct viewport *vp); |
48 | extern void lcd_remote_scroll_stop_viewport_line(const struct viewport *vp, int line); | 47 | extern void lcd_remote_scroll_stop_viewport_rect(const struct viewport *vp, int x, int y, int width, int height); |
49 | extern void lcd_remote_scroll_fn(void); | ||
50 | #endif | 48 | #endif |
51 | 49 | ||
52 | /* internal usage, but in multiple drivers */ | 50 | /* internal usage, but in multiple drivers |
51 | * larger than the normal linebuffer since it holds the line a second | ||
52 | * time (+3 spaces) for non-bidir scrolling */ | ||
53 | #define SCROLL_SPACING 3 | 53 | #define SCROLL_SPACING 3 |
54 | #ifdef HAVE_LCD_BITMAP | 54 | #ifdef HAVE_LCD_BITMAP |
55 | #define SCROLL_LINE_SIZE (MAX_PATH + SCROLL_SPACING + 3*LCD_WIDTH/2 + 2) | 55 | #define SCROLL_LINE_SIZE (MAX_PATH + SCROLL_SPACING + 3*LCD_WIDTH/2 + 2) |
@@ -60,21 +60,27 @@ extern void lcd_remote_scroll_fn(void); | |||
60 | struct scrollinfo | 60 | struct scrollinfo |
61 | { | 61 | { |
62 | struct viewport* vp; | 62 | struct viewport* vp; |
63 | char line[SCROLL_LINE_SIZE]; | 63 | char linebuffer[9*MAX_PATH/10]; |
64 | const char *line; | ||
64 | #ifdef HAVE_LCD_CHARCELLS | 65 | #ifdef HAVE_LCD_CHARCELLS |
65 | int len; /* length of line in chars */ | 66 | int len; /* length of line in chars */ |
66 | #endif | 67 | #endif |
67 | int y; /* Position of the line on the screen (char co-ordinates) */ | 68 | /* rectangle for the line */ |
69 | int x, y; /* relative to the viewort */ | ||
70 | int width, height; | ||
71 | /* pixel to skip from the beginning of the string, increments as the text scrolls */ | ||
68 | int offset; | 72 | int offset; |
69 | int startx; | ||
70 | int y_offset; /* y offset of the line, used for pixel-accurate list scrolling */ | ||
71 | #ifdef HAVE_LCD_BITMAP | 73 | #ifdef HAVE_LCD_BITMAP |
72 | int width; /* length of line in pixels */ | ||
73 | int style; /* line style */ | 74 | int style; /* line style */ |
74 | #endif/* HAVE_LCD_BITMAP */ | 75 | #endif /* HAVE_LCD_BITMAP */ |
75 | bool backward; /* scroll presently forward or backward? */ | 76 | /* scroll presently forward or backward? */ |
77 | bool backward; | ||
76 | bool bidir; | 78 | bool bidir; |
77 | long start_tick; | 79 | long start_tick; |
80 | |||
81 | /* support for custom scrolling functions */ | ||
82 | void (*scroll_func)(struct scrollinfo *s); | ||
83 | void *userdata; | ||
78 | }; | 84 | }; |
79 | 85 | ||
80 | struct scroll_screen_info | 86 | struct scroll_screen_info |