1
0
Fork 0
forked from len0rd/rockbox

text viewer: simplify display functions.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27152 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Yoshihisa Uchida 2010-06-27 08:08:33 +00:00
parent 4b18976496
commit 1ed3aba4f2
3 changed files with 51 additions and 81 deletions

View file

@ -54,29 +54,23 @@ static bool tv_set_font(const unsigned char *font)
}
#endif
static void tv_show_bookmarks(const struct tv_screen_pos *top_pos)
static void tv_draw_bookmarks(const struct tv_screen_pos *top_pos)
{
struct tv_screen_pos bookmarks[TV_MAX_BOOKMARKS];
int disp_bookmarks[TV_MAX_BOOKMARKS];
int count = tv_get_bookmark_positions(bookmarks);
int disp_count = 0;
int line;
#ifdef HAVE_LCD_BITMAP
tv_set_drawmode(DRMODE_COMPLEMENT);
#endif
while (count--)
{
line = (bookmarks[count].page - top_pos->page) * display_lines
+ (bookmarks[count].line - top_pos->line);
if (line >= 0 && line < display_lines)
{
#ifdef HAVE_LCD_BITMAP
tv_fillrect(0, line, 1);
#else
tv_put_bookmark_icon(line);
#endif
}
disp_bookmarks[disp_count++] = line;
}
tv_show_bookmarks(disp_bookmarks, disp_count);
}
void tv_draw_window(void)
@ -90,11 +84,6 @@ void tv_draw_window(void)
tv_start_display();
#ifdef HAVE_LCD_BITMAP
tv_set_drawmode(DRMODE_SOLID);
#endif
tv_clear_display();
tv_read_start(cur_window, (cur_column > 0));
for (line = 0; line < display_lines; line++)
@ -112,7 +101,7 @@ void tv_draw_window(void)
tv_show_header();
tv_show_footer(&pos);
#endif
tv_show_bookmarks(&pos);
tv_draw_bookmarks(&pos);
tv_update_display();
tv_end_display();