Cleanup the C200 keymap a bit, fixes the time settings screen for now.
[Rockbox.git] / firmware / export / scroll_engine.h
blobaa11a9ba1f6a43ce0d3ef427f39054b6ea24ca76
1 /***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
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__
26 void scroll_init(void);
27 void lcd_scroll_fn(void);
28 void lcd_remote_scroll_fn(void);
30 /* internal usage, but in multiple drivers */
31 #define SCROLL_SPACING 3
32 #ifdef HAVE_LCD_BITMAP
33 #define SCROLL_LINE_SIZE (MAX_PATH + SCROLL_SPACING + 3*LCD_WIDTH/2 + 2)
34 #else
35 #define SCROLL_LINE_SIZE (MAX_PATH + SCROLL_SPACING + 3*LCD_WIDTH + 2)
36 #endif
38 struct scrollinfo
40 char line[SCROLL_LINE_SIZE];
41 int len; /* length of line in chars */
42 int offset;
43 int startx;
44 #ifdef HAVE_LCD_BITMAP
45 int width; /* length of line in pixels */
46 bool invert; /* invert the scrolled text */
47 #endif
48 bool backward; /* scroll presently forward or backward? */
49 bool bidir;
50 long start_tick;
51 #ifdef HAVE_LCD_COLOR
52 int line_color;
53 #endif
56 struct scroll_screen_info
58 struct scrollinfo * const scroll;
59 const int num_scroll; /* number of scrollable lines (also number of scroll structs) */
60 int lines; /* Bitpattern of which lines are scrolling */
61 long ticks; /* # of ticks between updates*/
62 long delay; /* ticks delay before start */
63 int bidir_limit; /* percent */
64 #ifdef HAVE_LCD_CHARCELLS
65 long jump_scroll_delay; /* delay between jump scroll jumps */
66 int jump_scroll; /* 0=off, 1=once, ..., JUMP_SCROLL_ALWAYS */
67 #endif
68 #if defined(HAVE_LCD_BITMAP) || defined(HAVE_REMOTE_LCD)
69 int step; /* pixels per scroll step */
70 #endif
71 #if defined(HAVE_REMOTE_LCD)
72 long last_scroll;
73 #endif
76 /** main lcd **/
77 #ifdef HAVE_LCD_BITMAP
78 #define LCD_SCROLLABLE_LINES ((LCD_HEIGHT+4)/5 < 32 ? (LCD_HEIGHT+4)/5 : 32)
79 #else
80 #define LCD_SCROLLABLE_LINES LCD_HEIGHT
81 #endif
83 extern struct scroll_screen_info lcd_scroll_info;
85 /** remote lcd **/
86 #ifdef HAVE_REMOTE_LCD
87 #define LCD_REMOTE_SCROLLABLE_LINES \
88 (((LCD_REMOTE_HEIGHT+4)/5 < 32) ? (LCD_REMOTE_HEIGHT+4)/5 : 32)
89 extern struct scroll_screen_info lcd_remote_scroll_info;
90 #endif
92 #endif /* __SCROLL_ENGINE_H__ */