1 /***************************************************************************
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
10 * Copyright (C) 2007 Michael Sevakis
12 * LCD scrolling driver and scheduler
14 * Much collected and combined from the various Rockbox LCD drivers.
16 * All files in this archive are subject to the GNU General Public License.
17 * See the file COPYING in the source tree root for full license agreement.
19 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
20 * KIND, either express or implied.
22 ****************************************************************************/
23 #ifndef __SCROLL_ENGINE_H__
24 #define __SCROLL_ENGINE_H__
28 void scroll_init(void);
29 void lcd_scroll_stop(struct viewport
* vp
);
30 void lcd_scroll_stop_line(struct viewport
* vp
, int y
);
31 void lcd_scroll_fn(void);
32 #ifdef HAVE_REMOTE_LCD
33 void lcd_remote_scroll_fn(void);
34 void lcd_remote_scroll_stop(struct viewport
* vp
);
35 void lcd_remote_scroll_stop_line(struct viewport
* vp
, int y
);
38 /* internal usage, but in multiple drivers */
39 #define SCROLL_SPACING 3
40 #ifdef HAVE_LCD_BITMAP
41 #define SCROLL_LINE_SIZE (MAX_PATH + SCROLL_SPACING + 3*LCD_WIDTH/2 + 2)
43 #define SCROLL_LINE_SIZE (MAX_PATH + SCROLL_SPACING + 3*LCD_WIDTH + 2)
49 char line
[SCROLL_LINE_SIZE
];
50 int len
; /* length of line in chars */
51 int y
; /* Position of the line on the screen (char co-ordinates) */
54 #ifdef HAVE_LCD_BITMAP
55 int width
; /* length of line in pixels */
56 int style
; /* line style */
57 #endif/* HAVE_LCD_BITMAP */
58 bool backward
; /* scroll presently forward or backward? */
63 struct scroll_screen_info
65 struct scrollinfo
* const scroll
;
66 const int num_scroll
; /* number of scrollable lines (also number of scroll structs) */
67 int lines
; /* Number of currently scrolling lines */
68 long ticks
; /* # of ticks between updates*/
69 long delay
; /* ticks delay before start */
70 int bidir_limit
; /* percent */
71 #ifdef HAVE_LCD_CHARCELLS
72 long jump_scroll_delay
; /* delay between jump scroll jumps */
73 int jump_scroll
; /* 0=off, 1=once, ..., JUMP_SCROLL_ALWAYS */
75 #if defined(HAVE_LCD_BITMAP) || defined(HAVE_REMOTE_LCD)
76 int step
; /* pixels per scroll step */
78 #if defined(HAVE_REMOTE_LCD)
84 #ifdef HAVE_LCD_BITMAP
85 #define LCD_SCROLLABLE_LINES ((LCD_HEIGHT+4)/5 < 32 ? (LCD_HEIGHT+4)/5 : 32)
87 #define LCD_SCROLLABLE_LINES LCD_HEIGHT * 2
90 extern struct scroll_screen_info lcd_scroll_info
;
93 #ifdef HAVE_REMOTE_LCD
94 #define LCD_REMOTE_SCROLLABLE_LINES \
95 (((LCD_REMOTE_HEIGHT+4)/5 < 32) ? (LCD_REMOTE_HEIGHT+4)/5 : 32)
96 extern struct scroll_screen_info lcd_remote_scroll_info
;
99 #endif /* __SCROLL_ENGINE_H__ */