Index: apps/gui/skin_engine/skin_parser.c =================================================================== --- apps/gui/skin_engine/skin_parser.c (revision 26075) +++ apps/gui/skin_engine/skin_parser.c (working copy) @@ -205,6 +205,7 @@ { WPS_TOKEN_ALIGN_RIGHT, "ar", 0, NULL }, { WPS_TOKEN_ALIGN_RIGHT_RTL, "aR", 0, NULL }, { WPS_NO_TOKEN, "ax", 0, parse_languagedirection }, + { WPS_TOKEN_DONT_CLEAR_LINE, "aZ", 0, NULL }, { WPS_TOKEN_BATTERY_PERCENT, "bl", WPS_REFRESH_DYNAMIC, parse_progressbar }, { WPS_TOKEN_BATTERY_VOLTS, "bv", WPS_REFRESH_DYNAMIC, NULL }, @@ -730,7 +731,11 @@ if (img->num_subimages <= 0) return WPS_ERROR_INVALID_PARAM; } - struct skin_token_list *item = new_skin_token_list_item(NULL, img); + /* %xl is a WPS_NO_TOKEN so add it to the list and alloc a new token + * %x doesnt need that */ + + struct wps_token *out = (token->type != WPS_TOKEN_IMAGE_DISPLAY) ? NULL : token; + struct skin_token_list *item = new_skin_token_list_item(out, img); if (!item) return WPS_ERROR_INVALID_PARAM; add_to_ll_chain(&wps_data->images, item); Index: apps/gui/skin_engine/skin_tokens.c =================================================================== --- apps/gui/skin_engine/skin_tokens.c (revision 26078) +++ apps/gui/skin_engine/skin_tokens.c (working copy) @@ -594,10 +594,19 @@ return NULL; case WPS_TOKEN_ALBUMART_DISPLAY: - if (!data->albumart) - return NULL; - if (!data->albumart->draw) - data->albumart->draw = true; + if (data->albumart) + { + int handle = playback_current_aa_hid(data->playback_aa_slot); +#if CONFIG_TUNER + if (in_radio_screen()) + { + struct dim dim = {data->albumart->width, data->albumart->height}; + handle = radio_get_art_hid(&dim); + } +#endif + draw_album_art(gwps, handle, false); + data->albumart->draw = false; + } return NULL; #endif Index: apps/gui/skin_engine/skin_display.c =================================================================== --- apps/gui/skin_engine/skin_display.c (revision 26096) +++ apps/gui/skin_engine/skin_display.c (working copy) @@ -125,10 +125,9 @@ } static void draw_progressbar(struct gui_wps *gwps, - struct progressbar *pb) + struct progressbar *pb, struct viewport *vp) { struct screen *display = gwps->display; - struct viewport *vp = pb->vp; struct wps_state *state = gwps->state; struct mp3entry *id3 = state->id3; int y = pb->y, height = pb->height; @@ -414,52 +413,6 @@ #endif } -static void wps_display_images(struct gui_wps *gwps, struct viewport* vp) -{ - if(!gwps || !gwps->data || !gwps->display) - return; - - struct wps_data *data = gwps->data; - struct screen *display = gwps->display; - struct skin_token_list *list = data->images; - - while (list) - { - struct gui_img *img = (struct gui_img*)list->token->value.data; - if (img->loaded) - { - if (img->display >= 0) - { - wps_draw_image(gwps, img, img->display); - } - else if (img->always_display && img->vp == vp) - { - wps_draw_image(gwps, img, 0); - } - } - list = list->next; - } -#ifdef HAVE_ALBUMART - /* now draw the AA */ - if (data->albumart && data->albumart->vp == vp - && data->albumart->draw) - { - int handle = playback_current_aa_hid(data->playback_aa_slot); -#if CONFIG_TUNER - if (in_radio_screen()) - { - struct dim dim = {data->albumart->width, data->albumart->height}; - handle = radio_get_art_hid(&dim); - } -#endif - draw_album_art(gwps, handle, false); - data->albumart->draw = false; - } -#endif - - display->set_drawmode(DRMODE_SOLID); -} - #else /* HAVE_LCD_CHARCELL */ static bool draw_player_progress(struct gui_wps *gwps) @@ -711,7 +664,8 @@ struct align_pos *align, char *linebuf, int linebuf_size, - unsigned refresh_mode) + unsigned refresh_mode, + struct skin_viewport *viewport) { struct wps_data *data = gwps->data; @@ -730,6 +684,7 @@ align->left = NULL; align->center = NULL; align->right = NULL; + align->clear_line = true; /* Process all tokens of the desired subline */ for (i = subline->first_token_idx; i <= subline->last_token_idx; i++) @@ -756,7 +711,7 @@ case WPS_TOKEN_PROGRESSBAR: { struct progressbar *bar = (struct progressbar*)data->tokens[i].value.data; - bar->draw = true; + draw_progressbar(gwps, bar, &viewport->vp); } break; case WPS_TOKEN_IMAGE_PRELOAD_DISPLAY: @@ -766,16 +721,21 @@ struct gui_img *img = find_image(n, data); if (img && img->loaded) - img->display = subimage; + { + wps_draw_image(gwps, img, img->always_display ? 0 : subimage); + } break; } + case WPS_TOKEN_DRAW_INBUILTBAR: gui_statusbar_draw(&(statusbars.statusbars[gwps->display->screen_type]), refresh_mode == WPS_REFRESH_ALL, data->tokens[i].value.data); break; #endif - + case WPS_TOKEN_DONT_CLEAR_LINE: + align->clear_line = false; + break; case WPS_TOKEN_ALIGN_LEFT: case WPS_TOKEN_ALIGN_LEFT_RTL: case WPS_TOKEN_ALIGN_CENTER: @@ -1092,16 +1052,21 @@ else { #ifdef HAVE_LCD_BITMAP - /* clear the line first */ - display->set_drawmode(DRMODE_SOLID|DRMODE_INVERSEVID); - display->fillrect(left_xpos, ypos, display->getwidth(), string_height); - display->set_drawmode(DRMODE_SOLID); + if (format_align->clear_line) + { + /* clear the line first */ + display->set_drawmode(DRMODE_SOLID|DRMODE_INVERSEVID); + display->fillrect(left_xpos, ypos, display->getwidth(), string_height); + display->set_drawmode(DRMODE_SOLID); + } #endif /* Nasty hack: we output an empty scrolling string, which will reset the scroller for that line */ - display->puts_scroll(0, line, (unsigned char *)""); - + if (format_align->clear_line) + display->puts_scroll(0, line, (unsigned char *)""); + else + display->set_drawmode(DRMODE_FG); /* print aligned strings */ if (left_width != 0) { @@ -1119,6 +1084,7 @@ (unsigned char *)format_align->right); } } + display->set_drawmode(DRMODE_SOLID); } static bool skin_redraw(struct gui_wps *gwps, unsigned refresh_mode) @@ -1211,16 +1177,6 @@ int hidden_vp = 0; -#ifdef HAVE_LCD_BITMAP - /* Set images to not to be displayed */ - struct skin_token_list *imglist = data->images; - while (imglist) - { - struct gui_img *img = (struct gui_img *)imglist->token->value.data; - img->display = -1; - imglist = imglist->next; - } -#endif /* dont redraw the viewport if its disabled */ if (skin_viewport->hidden_flags&VP_NEVER_VISIBLE) { /* don't draw anything into this one */ @@ -1266,7 +1222,7 @@ { /* get_line tells us if we need to update the line */ update_line = get_line(gwps, subline, &align, - linebuf, sizeof(linebuf), vp_refresh_mode); + linebuf, sizeof(linebuf), vp_refresh_mode, skin_viewport); } #ifdef HAVE_LCD_BITMAP /* peakmeter */ @@ -1327,25 +1283,6 @@ write_line(display, &align, line_count, false); } } -#ifdef HAVE_LCD_BITMAP - /* progressbar */ - if (vp_refresh_mode & WPS_REFRESH_PLAYER_PROGRESS) - { - struct skin_token_list *bar = gwps->data->progressbars; - while (bar) - { - struct progressbar *thisbar = (struct progressbar*)bar->token->value.data; - if (thisbar->vp == &skin_viewport->vp && thisbar->draw) - { - draw_progressbar(gwps, thisbar); - } - bar = bar->next; - } - } - /* Now display any images in this viewport */ - if (!hidden_vp) - wps_display_images(gwps, &skin_viewport->vp); -#endif } /* Restore the default viewport */ Index: apps/gui/skin_engine/skin_tokens.h =================================================================== --- apps/gui/skin_engine/skin_tokens.h (revision 26075) +++ apps/gui/skin_engine/skin_tokens.h (working copy) @@ -37,6 +37,7 @@ WPS_TOKEN_TRANSLATEDSTRING, /* Alignment */ + WPS_TOKEN_DONT_CLEAR_LINE, WPS_TOKEN_ALIGN_LEFT, WPS_TOKEN_ALIGN_LEFT_RTL, WPS_TOKEN_ALIGN_CENTER, Index: apps/gui/skin_engine/wps_internals.h =================================================================== --- apps/gui/skin_engine/wps_internals.h (revision 26075) +++ apps/gui/skin_engine/wps_internals.h (working copy) @@ -82,7 +82,6 @@ short int y; /* y-pos */ short int num_subimages; /* number of sub-images */ short int subimage_height; /* height of each sub-image */ - short int display; /* -1 for no display, 0..n to display a subimage */ struct bitmap bm; char label; bool loaded; /* load state */ @@ -116,6 +115,7 @@ char* left; char* center; char* right; + bool clear_line; }; #ifdef HAVE_LCD_BITMAP