Add "elfzip" target to make which creates a zip of all elf files, as mapzip does...
[maemo-rb.git] / firmware / export / scroll_engine.h
blob0fe6fe464a46aa5ac8dbd2fb45a07d3ed3382e72
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 * This program is free software; you can redistribute it and/or
17 * modify it under the terms of the GNU General Public License
18 * as published by the Free Software Foundation; either version 2
19 * of the License, or (at your option) any later version.
21 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
22 * KIND, either express or implied.
24 ****************************************************************************/
25 #ifndef __SCROLL_ENGINE_H__
26 #define __SCROLL_ENGINE_H__
28 #include <lcd.h>
29 #include "file.h"
31 void scroll_init(void) INIT_ATTR;
32 void lcd_scroll_stop(const struct viewport* vp);
33 void lcd_scroll_stop_line(const struct viewport* vp, int y);
34 void lcd_scroll_fn(void);
35 #ifdef HAVE_REMOTE_LCD
36 void lcd_remote_scroll_fn(void);
37 void lcd_remote_scroll_stop(const struct viewport* vp);
38 void lcd_remote_scroll_stop_line(const struct viewport* vp, int y);
39 #endif
41 /* internal usage, but in multiple drivers */
42 #define SCROLL_SPACING 3
43 #ifdef HAVE_LCD_BITMAP
44 #define SCROLL_LINE_SIZE (MAX_PATH + SCROLL_SPACING + 3*LCD_WIDTH/2 + 2)
45 #else
46 #define SCROLL_LINE_SIZE (MAX_PATH + SCROLL_SPACING + 3*LCD_WIDTH + 2)
47 #endif
49 struct scrollinfo
51 struct viewport* vp;
52 char line[SCROLL_LINE_SIZE];
53 #ifdef HAVE_LCD_CHARCELLS
54 int len; /* length of line in chars */
55 #endif
56 int y; /* Position of the line on the screen (char co-ordinates) */
57 int offset;
58 int startx;
59 int y_offset; /* y offset of the line, used for pixel-accurate list scrolling */
60 #ifdef HAVE_LCD_BITMAP
61 int width; /* length of line in pixels */
62 int style; /* line style */
63 #endif/* HAVE_LCD_BITMAP */
64 bool backward; /* scroll presently forward or backward? */
65 bool bidir;
66 long start_tick;
69 struct scroll_screen_info
71 struct scrollinfo * const scroll;
72 const int num_scroll; /* number of scrollable lines (also number of scroll structs) */
73 int lines; /* Number of currently scrolling lines */
74 long ticks; /* # of ticks between updates*/
75 long delay; /* ticks delay before start */
76 int bidir_limit; /* percent */
77 #ifdef HAVE_LCD_CHARCELLS
78 long jump_scroll_delay; /* delay between jump scroll jumps */
79 int jump_scroll; /* 0=off, 1=once, ..., JUMP_SCROLL_ALWAYS */
80 #endif
81 #if defined(HAVE_LCD_BITMAP) || defined(HAVE_REMOTE_LCD)
82 int step; /* pixels per scroll step */
83 #endif
84 #if defined(HAVE_REMOTE_LCD)
85 long last_scroll;
86 #endif
89 /** main lcd **/
90 #ifdef HAVE_LCD_BITMAP
91 #define LCD_SCROLLABLE_LINES ((LCD_HEIGHT+4)/5 < 32 ? (LCD_HEIGHT+4)/5 : 32)
92 #else
93 #define LCD_SCROLLABLE_LINES LCD_HEIGHT * 2
94 #endif
96 extern struct scroll_screen_info lcd_scroll_info;
98 /** remote lcd **/
99 #ifdef HAVE_REMOTE_LCD
100 #define LCD_REMOTE_SCROLLABLE_LINES \
101 (((LCD_REMOTE_HEIGHT+4)/5 < 32) ? (LCD_REMOTE_HEIGHT+4)/5 : 32)
102 extern struct scroll_screen_info lcd_remote_scroll_info;
103 #endif
105 #endif /* __SCROLL_ENGINE_H__ */