Fixed the icon for unknown file types on the archos Player, and the bug when removing the last file on the screen in filetree, added some code for playlists integration with multi-screen

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@7800 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Kevin Ferrare 2005-11-09 01:17:57 +00:00
parent 0b00108c3e
commit f7c97522a8
8 changed files with 88 additions and 14 deletions

View file

@ -162,7 +162,7 @@ int filetype_get_icon(int attr)
#ifdef HAVE_LCD_BITMAP
return NULL;
#else
return -1;
return Icon_Unknown;
#endif
}
else

View file

@ -55,6 +55,7 @@ void gui_list_init(struct gui_list * gui_list,
gui_list->start_item = 0;
gui_list->limit_scroll = false;
gui_list->data=data;
gui_list->cursor_flash_state=false;
}
void gui_list_set_display(struct gui_list * gui_list, struct screen * display)
@ -68,6 +69,42 @@ void gui_list_set_display(struct gui_list * gui_list, struct screen * display)
gui_list_put_selection_in_screen(gui_list, false);
}
void gui_list_flash(struct gui_list * gui_list)
{
struct screen * display=gui_list->display;
gui_list->cursor_flash_state=!gui_list->cursor_flash_state;
int selected_line=gui_list->selected_item-gui_list->start_item;
#ifdef HAVE_LCD_BITMAP
int cursor_xpos=global_settings.scrollbar?1:0;
int line_xpos=display->getxmargin();
int line_ypos=display->getymargin()+display->char_height*selected_line;
if (global_settings.invert_cursor)
{
display->set_drawmode(DRMODE_COMPLEMENT);
display->fillrect(line_xpos, line_ypos, display->width,
display->char_height);
display->set_drawmode(DRMODE_SOLID);
display->invertscroll(0, selected_line);
}
else
{
if(gui_list->cursor_flash_state)
screen_clear_area(display, cursor_xpos*SCROLLBAR_WIDTH, line_ypos,
CURSOR_WIDTH, CURSOR_HEIGHT);
else
screen_put_cursorxy(display, cursor_xpos, selected_line);
}
display->update_rect(0, line_ypos,display->width,
display->char_height);
#else
if(gui_list->cursor_flash_state)
display->putc(0, selected_line, ' ');
else
screen_put_cursorxy(display, 0, selected_line);
gui_textarea_update(display);
#endif
}
void gui_list_put_selection_in_screen(struct gui_list * gui_list,
bool put_from_end)
{
@ -117,9 +154,7 @@ void gui_list_draw(struct gui_list * gui_list)
text_pos += SCROLLBAR_WIDTH;
}
if(!draw_cursor)
{
icon_pos--;
}
else
text_pos += CURSOR_WIDTH;
@ -181,7 +216,8 @@ void gui_list_draw(struct gui_list * gui_list)
gui_list->callback_get_item_icon(current_item,
gui_list->data,
&icon);
screen_put_iconxy(display, icon_pos, i, icon);
if(icon)
screen_put_iconxy(display, icon_pos, i, icon);
}
}
#ifdef HAVE_LCD_BITMAP
@ -429,6 +465,13 @@ void gui_synclist_limit_scroll(struct gui_synclist * lists, bool scroll)
gui_list_limit_scroll(&(lists->gui_list[i]), scroll);
}
void gui_synclist_flash(struct gui_synclist * lists)
{
int i;
for(i = 0;i < NB_SCREENS;i++)
gui_list_flash(&(lists->gui_list[i]));
}
bool gui_synclist_do_button(struct gui_synclist * lists, unsigned button)
{
gui_synclist_limit_scroll(lists, true);

View file

@ -93,6 +93,7 @@ struct gui_list
{
int nb_items;
int selected_item;
bool cursor_flash_state;
int start_item; /* the item that is displayed at the top of the screen */
void (*callback_get_item_icon)
@ -235,6 +236,14 @@ extern void gui_list_del_item(struct gui_list * gui_list);
#define gui_list_limit_scroll(gui_list, scroll) \
(gui_list)->limit_scroll=scroll
/*
* One call on 2, the selected lune will either blink the cursor or
* invert/display normal the selected line
* - gui_list : the list structure
*/
extern void gui_list_flash(struct gui_list * gui_list);
/*
* This part handles as many lists as there are connected screens
* (the api is similar to the ones above)
@ -278,6 +287,7 @@ extern void gui_synclist_select_previous_page(struct gui_synclist * lists,
extern void gui_synclist_add_item(struct gui_synclist * lists);
extern void gui_synclist_del_item(struct gui_synclist * lists);
extern void gui_synclist_limit_scroll(struct gui_synclist * lists, bool scroll);
extern void gui_synclist_flash(struct gui_synclist * lists);
/*
* Do the action implied by the given button,

View file

@ -24,10 +24,7 @@ void gui_textarea_clear(struct screen * display)
#ifdef HAVE_LCD_BITMAP
int y_start = gui_textarea_get_ystart(display);
int y_end = gui_textarea_get_yend(display);
display->set_drawmode(DRMODE_SOLID|DRMODE_INVERSEVID);
display->fillrect(0, y_start, display->width, y_end - y_start);
display->set_drawmode(DRMODE_SOLID);
screen_clear_area(display, 0, y_start, display->width, y_end - y_start);
display->stop_scroll();
screen_set_ymargin(display, y_start);
#else

View file

@ -168,7 +168,6 @@ int menu_show(int m)
#ifdef MENU_RC_EXIT_MENU
case MENU_RC_EXIT_MENU:
#endif
//lcd_stop_scroll();
exit = true;
break;

View file

@ -65,6 +65,7 @@ void screen_init(struct screen * screen, enum screen_type screen_type)
screen->scroll_delay=&lcd_remote_scroll_delay;
screen->scroll_step=&lcd_remote_scroll_step;
screen->puts_scroll_style=&lcd_remote_puts_scroll_style;
screen->invertscroll=&lcd_remote_invertscroll;
#endif /* HAVE_LCD_BITMAP */
#ifdef HAVE_LCD_CHARCELLS
@ -114,6 +115,7 @@ void screen_init(struct screen * screen, enum screen_type screen_type)
screen->scroll_delay=&lcd_scroll_delay;
screen->scroll_step=&lcd_scroll_step;
screen->puts_scroll_style=&lcd_puts_scroll_style;
screen->invertscroll=&lcd_invertscroll;
#endif /* HAVE_LCD_BITMAP */
#ifdef HAVE_LCD_CHARCELLS
@ -150,8 +152,17 @@ void screen_init(struct screen * screen, enum screen_type screen_type)
void screen_access_init(void)
{
screen_init(&screens[0], SCREEN_MAIN);
#if defined(HAVE_REMOTE_LCD) && !defined(ROCKBOX_HAS_LOGF)
screen_init(&screens[1], SCREEN_REMOTE);
#endif
int i;
for(i=0;i<NB_SCREENS;i++)
screen_init(&screens[i], i);
}
#ifdef HAVE_LCD_BITMAP
void screen_clear_area(struct screen * display, int xstart, int ystart,
int width, int height)
{
display->set_drawmode(DRMODE_SOLID|DRMODE_INVERSEVID);
display->fillrect(xstart, ystart, width, height);
display->set_drawmode(DRMODE_SOLID);
}
#endif

View file

@ -83,6 +83,7 @@ struct screen
void (*drawline)(int x1, int y1, int x2, int y2);
void (*vline)(int x, int y1, int y2);
void (*hline)(int x1, int x2, int y);
void (*invertscroll) (int x, int y);
#endif /* HAVE_LCD_BITMAP */
#ifdef HAVE_LCD_CHARCELLS
@ -136,6 +137,17 @@ extern void screen_init(struct screen * screen, enum screen_type screen_type);
#define screen_set_ymargin(screen, ymargin) \
(screen)->setmargins((screen)->getxmargin(), ymargin);
#ifdef HAVE_LCD_BITMAP
/*
* Clear only a given area of the screen
* - screen : the screen structure
* - xstart, ystart : where the area starts
* - width, height : size of the area
*/
void screen_clear_area(struct screen * display, int xstart, int ystart,
int width, int height);
#endif
/*
* Initializes the whole screen_access api
*/

View file

@ -337,6 +337,9 @@ static int update_dir(void)
}
}
gui_synclist_set_nb_items(&tree_lists, tc.filesindir);
if( tc.selected_item >= tc.filesindir)
tc.selected_item=tc.filesindir-1;
gui_synclist_select_item(&tree_lists, tc.selected_item);
gui_synclist_draw(&tree_lists);
gui_syncstatusbar_draw(&statusbars, true);
@ -799,7 +802,6 @@ static bool dirbrowse(void)
}
onplay_result = onplay(buf, attr, curr_context);
}
switch (onplay_result)
{
case ONPLAY_OK: