Rockbox open source high quality audio player as a Music Player Daemon
mpris rockbox mpd libadwaita audio rust zig deno
2
fork

Configure Feed

Select the types of activity you want to include in your feed.

New feature for the %xl (image load) tag. If you give it the filename __list_icons__ it will use the list icon strip instead of loading a different bmp. example: %xl(I, __list_icons__, 0, 0) %xd(I, %Li)

^ display the list icon at position 0,0 in that viewport. (you can of course %xd(Ia) if you really wanted also.)


git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27787 a1c6a512-1295-4272-9138-f99709370657

+43 -8
+5 -1
apps/gui/skin_engine/skin_display.c
··· 441 441 while (list) 442 442 { 443 443 struct gui_img *img = (struct gui_img*)list->token->value.data; 444 - if (img->loaded) 444 + if (img->using_preloaded_icons && img->display >= 0) 445 + { 446 + screen_put_icon(display, img->x, img->y, img->display); 447 + } 448 + else if (img->loaded) 445 449 { 446 450 if (img->display >= 0) 447 451 {
+20 -6
apps/gui/skin_engine/skin_parser.c
··· 243 243 } 244 244 id->label = label; 245 245 id->offset = 0; 246 + img->using_preloaded_icons = false; 247 + if (!strcmp(img->bm.data, "__list_icons__")) 248 + { 249 + img->num_subimages = Icon_Last_Themeable; 250 + img->using_preloaded_icons = true; 251 + token->type = SKIN_TOKEN_IMAGE_DISPLAY_LISTICON; 252 + } 246 253 247 254 if (element->params_count > 1) 248 255 { ··· 302 309 img->y = y; 303 310 img->num_subimages = 1; 304 311 img->always_display = false; 305 - // img->just_drawn = false; 306 312 img->display = -1; 307 313 308 314 /* save current viewport */ ··· 318 324 if (img->num_subimages <= 0) 319 325 return WPS_ERROR_INVALID_PARAM; 320 326 } 327 + 321 328 struct skin_token_list *item = 322 329 (struct skin_token_list *)new_skin_token_list_item(NULL, img); 323 330 if (!item) ··· 994 1001 struct gui_img *img = (struct gui_img*)list->token->value.data; 995 1002 if (img->bm.data) 996 1003 { 997 - img->loaded = load_skin_bmp(wps_data, &img->bm, bmpdir); 998 - if (img->loaded) 999 - img->subimage_height = img->bm.height / img->num_subimages; 1004 + if (img->using_preloaded_icons) 1005 + { 1006 + img->loaded = true; 1007 + list->token->type = SKIN_TOKEN_IMAGE_DISPLAY_LISTICON; 1008 + } 1000 1009 else 1001 - retval = false; 1010 + { 1011 + img->loaded = load_skin_bmp(wps_data, &img->bm, bmpdir); 1012 + if (img->loaded) 1013 + img->subimage_height = img->bm.height / img->num_subimages; 1014 + else 1015 + retval = false; 1016 + } 1002 1017 } 1003 1018 list = list->next; 1004 1019 } ··· 1022 1037 retval = false; 1023 1038 } 1024 1039 #endif /* has backdrop support */ 1025 - 1026 1040 return retval; 1027 1041 } 1028 1042
+5 -1
apps/gui/skin_engine/skin_render.c
··· 142 142 } 143 143 break; 144 144 #ifdef HAVE_LCD_BITMAP 145 + case SKIN_TOKEN_IMAGE_DISPLAY_LISTICON: 145 146 case SKIN_TOKEN_IMAGE_PRELOAD_DISPLAY: 146 147 { 147 148 struct image_display *id = token->value.data; ··· 163 164 /* NOTE: get_token_value() returns values starting at 1! */ 164 165 if (a == -1) 165 166 a = (out && *out) ? 1 : 2; 166 - a--; 167 + if (token->type == SKIN_TOKEN_IMAGE_DISPLAY_LISTICON) 168 + a -= 2; /* 2 is added in statusbar-skinned.c! */ 169 + else 170 + a--; 167 171 a += id->offset; 168 172 169 173 /* Clear the image, as in conditionals */
+1
apps/gui/skin_engine/wps_internals.h
··· 81 81 bool loaded; /* load state */ 82 82 bool always_display; /* not using the preload/display mechanism */ 83 83 int display; 84 + bool using_preloaded_icons; /* using the icon system instead of a bmp */ 84 85 }; 85 86 86 87 struct image_display {
+10
apps/gui/statusbar-skinned.c
··· 77 77 /* Icon_NOICON == -1 which the skin engine wants at position 1, so + 2 */ 78 78 token->value.i = icon+2; 79 79 } 80 + else if (element->params_count) 81 + { 82 + int i; 83 + for (i=0; i<element->params_count; i++) 84 + { 85 + if (element->params[i].type == CODE) 86 + retval |= set_title_worker(title, icon, data, 87 + element->params[i].data.code); 88 + } 89 + } 80 90 } 81 91 if (element->children_count) 82 92 {
+1
lib/skin_parser/tag_table.h
··· 156 156 SKIN_TOKEN_IMAGE_PRELOAD, 157 157 SKIN_TOKEN_IMAGE_PRELOAD_DISPLAY, 158 158 SKIN_TOKEN_IMAGE_DISPLAY, 159 + SKIN_TOKEN_IMAGE_DISPLAY_LISTICON, 159 160 160 161 /* Albumart */ 161 162 SKIN_TOKEN_ALBUMART_LOAD,
+1
manual/appendix/wps_tags.tex
··· 317 317 & Preload an image for later display (useful for when your images are displayed conditionally).\newline 318 318 \config{n}: image ID (a-z and A-Z) for later referencing in \config{\%xd}\newline 319 319 \config{filename}: file name relative to \fname{/.rockbox/} and including ``.bmp''\newline 320 + If the filename is __list_icons__ the list icon bitmap will be used instead\newline 320 321 \config{x}: x coordinate\newline 321 322 \config{y}: y coordinate\newline 322 323 \config{nimages}: (optional) number of sub-images (tiled vertically, of the same height)