summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2005-05-24 14:26:23 +0000
committerDaniel Stenberg <daniel@haxx.se>2005-05-24 14:26:23 +0000
commite2c4a6c642deba789016b8bd09890994a76b0728 (patch)
treec1dfbeac91ad74c00aaf19a13fb26122f88f965b
parent38404c0fe00092a171b3cc4c13ee5575415338d6 (diff)
downloadrockbox-e2c4a6c642deba789016b8bd09890994a76b0728.tar.gz
rockbox-e2c4a6c642deba789016b8bd09890994a76b0728.zip
initial take at logf log browser
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@6519 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--apps/logfdisp.c77
-rw-r--r--apps/logfdisp.h21
2 files changed, 98 insertions, 0 deletions
diff --git a/apps/logfdisp.c b/apps/logfdisp.c
new file mode 100644
index 0000000000..510cb28b57
--- /dev/null
+++ b/apps/logfdisp.c
@@ -0,0 +1,77 @@
1/***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
9 *
10 * Copyright (C) 2005 Daniel Stenberg
11 *
12 * All files in this archive are subject to the GNU General Public License.
13 * See the file COPYING in the source tree root for full license agreement.
14 *
15 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
16 * KIND, either express or implied.
17 *
18 ****************************************************************************/
19#include "config.h"
20#include <timefuncs.h>
21#include <string.h>
22#include <kernel.h>
23#include <button.h>
24
25#include <lcd.h>
26#include "menu.h"
27#include "logf.h"
28
29#ifdef HAVE_LCD_BITMAP
30bool logfdisplay(void)
31
32{
33 int w, h;
34 int lines;
35 int i;
36 int button;
37
38 bool lcd = false; /* fixed atm */
39 int index;
40
41 lcd_getstringsize("A", &w, &h);
42 lines = (lcd?
43#ifdef HAVE_REMOTE_LCD
44 LCD_REMOTE_HEIGHT
45#else
46 0
47#endif
48 :LCD_HEIGHT)/h;
49 if(!lines)
50 return false;
51
52 lcd_setmargins(0, 0);
53 lcd_clear_display();
54
55 do {
56 index = logfindex;
57 for(i = lines-1; i>=0; i--) {
58 unsigned char buffer[17];
59
60 if(--index < 0) {
61 if(logfwrap)
62 index = MAX_LOGF_LINES-1;
63 else
64 break; /* done */
65 }
66
67 memcpy(buffer, logfbuffer[index], 16);
68 buffer[16]=0;
69 lcd_puts(0, i, buffer);
70 }
71 lcd_update();
72 button = button_get_w_tmo(HZ/2);
73 } while(button != BUTTON_OFF);
74
75 return false;
76}
77#endif
diff --git a/apps/logfdisp.h b/apps/logfdisp.h
new file mode 100644
index 0000000000..58ec9b9969
--- /dev/null
+++ b/apps/logfdisp.h
@@ -0,0 +1,21 @@
1/***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
9 *
10 * Copyright (C) 2005 Daniel Stenberg
11 *
12 * All files in this archive are subject to the GNU General Public License.
13 * See the file COPYING in the source tree root for full license agreement.
14 *
15 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
16 * KIND, either express or implied.
17 *
18 ****************************************************************************/
19#ifdef HAVE_LCD_BITMAP
20bool logfdisplay(void);
21#endif