diff options
author | Daniel Stenberg <daniel@haxx.se> | 2002-09-30 19:05:03 +0000 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2002-09-30 19:05:03 +0000 |
commit | 773e7a70cc94fc6b6a0f9406ab99b828bea5bd42 (patch) | |
tree | a8d5789ab3544147d726d04b2a5a9399dd0eed2d /apps/tree.c | |
parent | ad911c0ac82f409251230b39b39fc3e8c2b83ff9 (diff) |
Gilles Roux's text viewer
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@2452 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/tree.c')
-rw-r--r-- | apps/tree.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/apps/tree.c b/apps/tree.c index a9b62e0beb..653b6afa2a 100644 --- a/apps/tree.c +++ b/apps/tree.c @@ -46,6 +46,7 @@ #include "rolo.h" #include "icons.h" #include "lang.h" +#include "viewer.h" #include "language.h" #include "screens.h" @@ -141,6 +142,7 @@ extern unsigned char bitmap_icons_6x8[LastIcon][6]; #define TREE_ATTR_WPS 0x100 /* wps config file */ #define TREE_ATTR_MOD 0x200 /* firmware file */ #define TREE_ATTR_EQ 0x400 /* EQ config file */ +#define TREE_ATTR_TXT 0x500 /* text file */ #define TREE_ATTR_FONT 0x800 /* font file */ #define TREE_ATTR_LNG 0x1000 /* binary lang file */ #define TREE_ATTR_MASK 0xffd0 /* which bits tree.c uses (above + DIR) */ @@ -258,6 +260,8 @@ static int showdir(char *path, int start) dptr->attr |= TREE_ATTR_EQ; else if (!strcasecmp(&entry->d_name[len-4], ".wps")) dptr->attr |= TREE_ATTR_WPS; + else if (!strcasecmp(&entry->d_name[len-4], ".txt")) + dptr->attr |= TREE_ATTR_TXT; else if (!strcasecmp(&entry->d_name[len-4], ".lng")) dptr->attr |= TREE_ATTR_LNG; #ifdef HAVE_RECORDER_KEYPAD @@ -383,6 +387,10 @@ static int showdir(char *path, int start) icon_type = Wps; break; + case TREE_ATTR_TXT: + icon_type = Wps; + break; + case TREE_ATTR_LNG: icon_type = Language; break; @@ -801,6 +809,13 @@ bool dirbrowse(char *root) restore = true; break; + case TREE_ATTR_TXT: + snprintf(buf, sizeof buf, "%s/%s", + currdir, file->name); + viewer_run(buf); + restore = true; + break; + case TREE_ATTR_LNG: snprintf(buf, sizeof buf, "%s/%s", currdir, file->name); @@ -1031,6 +1046,11 @@ bool dirbrowse(char *root) dirstart++; dircursor--; } +#ifdef HAVE_LCD_BITMAP + /* the sub-screen might've ruined the margins */ + lcd_setmargins(MARGIN_X,MARGIN_Y); /* leave room for cursor and + icon */ +#endif numentries = showdir(currdir, dirstart); put_cursorxy(CURSOR_X, CURSOR_Y + dircursor, true); } |