diff options
author | Jonathan Gordon <rockbox@jdgordon.info> | 2011-09-06 13:49:41 +0000 |
---|---|---|
committer | Jonathan Gordon <rockbox@jdgordon.info> | 2011-09-06 13:49:41 +0000 |
commit | 9b6ac01c7b55691b62aab15c3302a46f61972197 (patch) | |
tree | 8868026c013cddc6c6722597724006eef911c554 | |
parent | 77a82ad56ab8aa923f47c908ac10b167c8051cf3 (diff) | |
download | rockbox-9b6ac01c7b55691b62aab15c3302a46f61972197.tar.gz rockbox-9b6ac01c7b55691b62aab15c3302a46f61972197.zip |
Lists can now be completly draw using the skin engine!
due to lack of user feedback the actual tags may change, hopefully not though.
The way it works is the skin specifies a rectangle and a viewport label. For each item in the list that is being displayed all viewports with the specified label are drawn. However, instead of the viewport x/y position being offset from the top left corner like normal they are offset from the rectangle position in the list (so think of them as child-viewports of the rectangle which moves).
Normally the rectangle will move down the screen to show a normal list, this can be changed to move across the screen in a grid pattern.
The UI viewport is used to bound the items (i.e %Vi() )
Scrolling is completly disabled in all items except the currently selected item.
This works well in combination with the %cs tag to show differently styled lists based on the current screen :)
New tags:
%LT - Get the current items text
%LI - Get the current items icon number
%Lc - Use as a conditional to determine if the current item is the selected item
%LB - BAR TAG to show the scroll bar, params/options like other bar types. It still needs a bit of work though. Use as a conditional to find out if the bar is actually needed
%Lb(viewport, width, height [,tile]) - specify the viewport label to draw for each item and the size of each item. if the last param is 'tile' it will form a grid instead of a list
example.sbs:
%?cs<%Lb(a,100,20)|>
%V(0,0,10,-,1)%Vf(aabbcc)
%?LB<%LB(0,0,10,185, invert)>
%Vi(-,10,0,-,-35,1)
%Vl(a,5,5,160,12,1)
%s%?Lc<%Vg(00ffaa, ff0000, 000000)%Vs(gradient)%>%>%>%ac>zzzzzzz %LT zzzzz%s%?Lc<%ar%<%<%<>
%V(0,185,-,-,1)
%s%LT
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30461 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r-- | apps/SOURCES | 1 | ||||
-rw-r--r-- | apps/gui/list.c | 8 | ||||
-rw-r--r-- | apps/gui/list.h | 22 | ||||
-rw-r--r-- | apps/gui/skin_engine/skin_display.c | 8 | ||||
-rw-r--r-- | apps/gui/skin_engine/skin_display.h | 5 | ||||
-rw-r--r-- | apps/gui/skin_engine/skin_parser.c | 32 | ||||
-rw-r--r-- | apps/gui/skin_engine/skin_render.c | 26 | ||||
-rw-r--r-- | apps/gui/skin_engine/skin_tokens.c | 12 | ||||
-rw-r--r-- | apps/gui/skin_engine/wps_internals.h | 1 | ||||
-rw-r--r-- | apps/gui/statusbar-skinned.c | 5 | ||||
-rw-r--r-- | apps/gui/viewport.c | 3 | ||||
-rw-r--r-- | apps/misc.c | 15 | ||||
-rw-r--r-- | lib/skin_parser/tag_table.c | 5 | ||||
-rw-r--r-- | lib/skin_parser/tag_table.h | 7 |
14 files changed, 138 insertions, 12 deletions
diff --git a/apps/SOURCES b/apps/SOURCES index e0244b240d..6b72d6ad09 100644 --- a/apps/SOURCES +++ b/apps/SOURCES | |||
@@ -75,6 +75,7 @@ gui/icon.c | |||
75 | gui/list.c | 75 | gui/list.c |
76 | #ifdef HAVE_LCD_BITMAP | 76 | #ifdef HAVE_LCD_BITMAP |
77 | gui/bitmap/list.c | 77 | gui/bitmap/list.c |
78 | gui/bitmap/list-skinned.c | ||
78 | #else | 79 | #else |
79 | gui/charcell/list.c | 80 | gui/charcell/list.c |
80 | #endif | 81 | #endif |
diff --git a/apps/gui/list.c b/apps/gui/list.c index f450bd579f..fbcdcb28c9 100644 --- a/apps/gui/list.c +++ b/apps/gui/list.c | |||
@@ -121,6 +121,9 @@ bool list_display_title(struct gui_synclist *list, enum screen_type screen) | |||
121 | static int list_get_nb_lines(struct gui_synclist *list, enum screen_type screen) | 121 | static int list_get_nb_lines(struct gui_synclist *list, enum screen_type screen) |
122 | { | 122 | { |
123 | struct viewport vp = *list->parent[screen]; | 123 | struct viewport vp = *list->parent[screen]; |
124 | int skin_count = skinlist_get_line_count(screen, list); | ||
125 | if (skin_count >= 0) | ||
126 | return skin_count; | ||
124 | if (list_display_title(list, screen)) | 127 | if (list_display_title(list, screen)) |
125 | vp.height -= font_get(list->parent[screen]->font)->height; | 128 | vp.height -= font_get(list->parent[screen]->font)->height; |
126 | return viewport_get_nb_lines(&vp); | 129 | return viewport_get_nb_lines(&vp); |
@@ -239,7 +242,10 @@ void gui_synclist_draw(struct gui_synclist *gui_list) | |||
239 | #endif | 242 | #endif |
240 | FOR_NB_SCREENS(i) | 243 | FOR_NB_SCREENS(i) |
241 | { | 244 | { |
242 | list_draw(&screens[i], gui_list); | 245 | #ifdef HAVE_LCD_BITMAP |
246 | if (!skinlist_draw(&screens[i], gui_list)) | ||
247 | #endif | ||
248 | list_draw(&screens[i], gui_list); | ||
243 | } | 249 | } |
244 | } | 250 | } |
245 | 251 | ||
diff --git a/apps/gui/list.h b/apps/gui/list.h index 38d7e95f8d..b54e7d7f5b 100644 --- a/apps/gui/list.h +++ b/apps/gui/list.h | |||
@@ -25,6 +25,7 @@ | |||
25 | #include "config.h" | 25 | #include "config.h" |
26 | #include "icon.h" | 26 | #include "icon.h" |
27 | #include "screen_access.h" | 27 | #include "screen_access.h" |
28 | #include "skin_engine/skin_engine.h" | ||
28 | 29 | ||
29 | #define SCROLLBAR_WIDTH global_settings.scrollbar_width | 30 | #define SCROLLBAR_WIDTH global_settings.scrollbar_width |
30 | 31 | ||
@@ -173,6 +174,27 @@ extern bool gui_synclist_item_is_onscreen(struct gui_synclist *lists, | |||
173 | extern bool gui_synclist_do_button(struct gui_synclist * lists, | 174 | extern bool gui_synclist_do_button(struct gui_synclist * lists, |
174 | int *action, | 175 | int *action, |
175 | enum list_wrap); | 176 | enum list_wrap); |
177 | #if defined(HAVE_LCD_BITMAP) && !defined(PLUGIN) | ||
178 | struct listitem_viewport_cfg { | ||
179 | struct wps_data *data; | ||
180 | char* label; | ||
181 | int width; | ||
182 | int height; | ||
183 | int xmargin; | ||
184 | int ymargin; | ||
185 | bool tile; | ||
186 | struct skin_viewport selected_item_vp; | ||
187 | }; | ||
188 | bool skinlist_draw(struct screen *display, struct gui_synclist *list); | ||
189 | bool skinlist_is_selected_item(void); | ||
190 | void skinlist_set_cfg(enum screen_type screen, | ||
191 | struct listitem_viewport_cfg *cfg); | ||
192 | const char* skinlist_get_item_text(void); | ||
193 | enum themable_icons skinlist_get_item_icon(void); | ||
194 | bool skinlist_needs_scrollbar(enum screen_type screen); | ||
195 | void skinlist_get_scrollbar(int* nb_item, int* first_shown, int* last_shown); | ||
196 | int skinlist_get_line_count(enum screen_type screen, struct gui_synclist *list); | ||
197 | #endif | ||
176 | 198 | ||
177 | #if defined(HAVE_TOUCHSCREEN) | 199 | #if defined(HAVE_TOUCHSCREEN) |
178 | /* this needs to be fixed if we ever get more than 1 touchscreen on a target */ | 200 | /* this needs to be fixed if we ever get more than 1 touchscreen on a target */ |
diff --git a/apps/gui/skin_engine/skin_display.c b/apps/gui/skin_engine/skin_display.c index 2be5bb9106..49f9f86133 100644 --- a/apps/gui/skin_engine/skin_display.c +++ b/apps/gui/skin_engine/skin_display.c | |||
@@ -42,6 +42,7 @@ | |||
42 | #include "playlist.h" | 42 | #include "playlist.h" |
43 | #include "audio.h" | 43 | #include "audio.h" |
44 | #include "tagcache.h" | 44 | #include "tagcache.h" |
45 | #include "list.h" | ||
45 | 46 | ||
46 | #ifdef HAVE_LCD_BITMAP | 47 | #ifdef HAVE_LCD_BITMAP |
47 | #include "peakmeter.h" | 48 | #include "peakmeter.h" |
@@ -169,6 +170,13 @@ void draw_progressbar(struct gui_wps *gwps, int line, struct progressbar *pb) | |||
169 | length = MAX_PEAK; | 170 | length = MAX_PEAK; |
170 | end = peak_meter_scale_value(val, length); | 171 | end = peak_meter_scale_value(val, length); |
171 | } | 172 | } |
173 | else if (pb->type == SKIN_TOKEN_LIST_SCROLLBAR) | ||
174 | { | ||
175 | int val, min, max; | ||
176 | skinlist_get_scrollbar(&val, &min, &max); | ||
177 | end = val - min; | ||
178 | length = max - min; | ||
179 | } | ||
172 | #if CONFIG_TUNER | 180 | #if CONFIG_TUNER |
173 | else if (in_radio_screen() || (get_radio_status() != FMRADIO_OFF)) | 181 | else if (in_radio_screen() || (get_radio_status() != FMRADIO_OFF)) |
174 | { | 182 | { |
diff --git a/apps/gui/skin_engine/skin_display.h b/apps/gui/skin_engine/skin_display.h index 9faaea30cf..81d04e5a60 100644 --- a/apps/gui/skin_engine/skin_display.h +++ b/apps/gui/skin_engine/skin_display.h | |||
@@ -36,6 +36,11 @@ void draw_playlist_viewer_list(struct gui_wps *gwps, struct playlistviewer *view | |||
36 | void clear_image_pos(struct gui_wps *gwps, struct gui_img *img); | 36 | void clear_image_pos(struct gui_wps *gwps, struct gui_img *img); |
37 | void wps_draw_image(struct gui_wps *gwps, struct gui_img *img, int subimage); | 37 | void wps_draw_image(struct gui_wps *gwps, struct gui_img *img, int subimage); |
38 | void wps_display_images(struct gui_wps *gwps, struct viewport* vp); | 38 | void wps_display_images(struct gui_wps *gwps, struct viewport* vp); |
39 | |||
40 | |||
41 | void skin_render_viewport(struct skin_element* viewport, struct gui_wps *gwps, | ||
42 | struct skin_viewport* skin_viewport, unsigned long refresh_type); | ||
43 | |||
39 | #endif | 44 | #endif |
40 | 45 | ||
41 | /* Evaluate the conditional that is at *token_index and return whether a skip | 46 | /* Evaluate the conditional that is at *token_index and return whether a skip |
diff --git a/apps/gui/skin_engine/skin_parser.c b/apps/gui/skin_engine/skin_parser.c index 58ac5f552c..049c117af3 100644 --- a/apps/gui/skin_engine/skin_parser.c +++ b/apps/gui/skin_engine/skin_parser.c | |||
@@ -483,6 +483,32 @@ static int parse_viewport_gradient_setup(struct skin_element *element, | |||
483 | } | 483 | } |
484 | #endif | 484 | #endif |
485 | 485 | ||
486 | |||
487 | static int parse_listitemviewport(struct skin_element *element, | ||
488 | struct wps_token *token, | ||
489 | struct wps_data *wps_data) | ||
490 | { | ||
491 | struct listitem_viewport_cfg *cfg = | ||
492 | (struct listitem_viewport_cfg *)skin_buffer_alloc( | ||
493 | sizeof(struct listitem_viewport_cfg)); | ||
494 | if (!cfg) | ||
495 | return -1; | ||
496 | cfg->data = wps_data; | ||
497 | cfg->tile = false; | ||
498 | cfg->label = element->params[0].data.text; | ||
499 | cfg->width = -1; | ||
500 | cfg->height = -1; | ||
501 | if (!isdefault(&element->params[1])) | ||
502 | cfg->width = element->params[1].data.number; | ||
503 | if (!isdefault(&element->params[2])) | ||
504 | cfg->height = element->params[2].data.number; | ||
505 | if (element->params_count > 3 && | ||
506 | !strcmp(element->params[3].data.text, "tile")) | ||
507 | cfg->tile = true; | ||
508 | token->value.data = (void*)cfg; | ||
509 | return 0; | ||
510 | } | ||
511 | |||
486 | #if (LCD_DEPTH > 1) || (defined(HAVE_REMOTE_LCD) && (LCD_REMOTE_DEPTH > 1)) | 512 | #if (LCD_DEPTH > 1) || (defined(HAVE_REMOTE_LCD) && (LCD_REMOTE_DEPTH > 1)) |
487 | static int parse_viewporttextstyle(struct skin_element *element, | 513 | static int parse_viewporttextstyle(struct skin_element *element, |
488 | struct wps_token *token, | 514 | struct wps_token *token, |
@@ -877,6 +903,8 @@ static int parse_progressbar_tag(struct skin_element* element, | |||
877 | token->type = SKIN_TOKEN_PEAKMETER_LEFTBAR; | 903 | token->type = SKIN_TOKEN_PEAKMETER_LEFTBAR; |
878 | else if (token->type == SKIN_TOKEN_PEAKMETER_RIGHT) | 904 | else if (token->type == SKIN_TOKEN_PEAKMETER_RIGHT) |
879 | token->type = SKIN_TOKEN_PEAKMETER_RIGHTBAR; | 905 | token->type = SKIN_TOKEN_PEAKMETER_RIGHTBAR; |
906 | else if (token->type == SKIN_TOKEN_LIST_NEEDS_SCROLLBAR) | ||
907 | token->type = SKIN_TOKEN_LIST_SCROLLBAR; | ||
880 | pb->type = token->type; | 908 | pb->type = token->type; |
881 | 909 | ||
882 | return 0; | 910 | return 0; |
@@ -1719,6 +1747,7 @@ static int skin_element_callback(struct skin_element* element, void* data) | |||
1719 | case SKIN_TOKEN_PLAYER_PROGRESSBAR: | 1747 | case SKIN_TOKEN_PLAYER_PROGRESSBAR: |
1720 | case SKIN_TOKEN_PEAKMETER_LEFT: | 1748 | case SKIN_TOKEN_PEAKMETER_LEFT: |
1721 | case SKIN_TOKEN_PEAKMETER_RIGHT: | 1749 | case SKIN_TOKEN_PEAKMETER_RIGHT: |
1750 | case SKIN_TOKEN_LIST_NEEDS_SCROLLBAR: | ||
1722 | #ifdef HAVE_RADIO_RSSI | 1751 | #ifdef HAVE_RADIO_RSSI |
1723 | case SKIN_TOKEN_TUNER_RSSI: | 1752 | case SKIN_TOKEN_TUNER_RSSI: |
1724 | #endif | 1753 | #endif |
@@ -1809,6 +1838,9 @@ static int skin_element_callback(struct skin_element* element, void* data) | |||
1809 | function = parse_skinvar; | 1838 | function = parse_skinvar; |
1810 | break; | 1839 | break; |
1811 | #endif | 1840 | #endif |
1841 | case SKIN_TOKEN_LIST_ITEM_CFG: | ||
1842 | function = parse_listitemviewport; | ||
1843 | break; | ||
1812 | default: | 1844 | default: |
1813 | break; | 1845 | break; |
1814 | } | 1846 | } |
diff --git a/apps/gui/skin_engine/skin_render.c b/apps/gui/skin_engine/skin_render.c index 27e6747c29..dd266b1ee6 100644 --- a/apps/gui/skin_engine/skin_render.c +++ b/apps/gui/skin_engine/skin_render.c | |||
@@ -46,6 +46,7 @@ | |||
46 | #include "playlist.h" | 46 | #include "playlist.h" |
47 | #include "root_menu.h" | 47 | #include "root_menu.h" |
48 | #include "misc.h" | 48 | #include "misc.h" |
49 | #include "list.h" | ||
49 | 50 | ||
50 | 51 | ||
51 | #define MAX_LINE 1024 | 52 | #define MAX_LINE 1024 |
@@ -142,6 +143,11 @@ static bool do_non_text_tags(struct gui_wps *gwps, struct skin_draw_info *info, | |||
142 | } | 143 | } |
143 | } | 144 | } |
144 | break; | 145 | break; |
146 | case SKIN_TOKEN_LIST_ITEM_CFG: | ||
147 | if (do_refresh) | ||
148 | skinlist_set_cfg(gwps->display->screen_type, | ||
149 | token->value.data); | ||
150 | break; | ||
145 | #ifdef HAVE_LCD_BITMAP | 151 | #ifdef HAVE_LCD_BITMAP |
146 | case SKIN_TOKEN_UIVIEWPORT_ENABLE: | 152 | case SKIN_TOKEN_UIVIEWPORT_ENABLE: |
147 | sb_set_info_vp(gwps->display->screen_type, | 153 | sb_set_info_vp(gwps->display->screen_type, |
@@ -164,6 +170,7 @@ static bool do_non_text_tags(struct gui_wps *gwps, struct skin_draw_info *info, | |||
164 | #ifdef HAVE_LCD_BITMAP | 170 | #ifdef HAVE_LCD_BITMAP |
165 | case SKIN_TOKEN_PROGRESSBAR: | 171 | case SKIN_TOKEN_PROGRESSBAR: |
166 | case SKIN_TOKEN_TUNER_RSSI_BAR: | 172 | case SKIN_TOKEN_TUNER_RSSI_BAR: |
173 | case SKIN_TOKEN_LIST_SCROLLBAR: | ||
167 | { | 174 | { |
168 | struct progressbar *bar = (struct progressbar*)token->value.data; | 175 | struct progressbar *bar = (struct progressbar*)token->value.data; |
169 | if (do_refresh) | 176 | if (do_refresh) |
@@ -488,10 +495,10 @@ static bool skin_render_line(struct skin_element* line, struct skin_draw_info *i | |||
488 | if (!do_non_text_tags(info->gwps, info, child, &info->skin_vp->vp)) | 495 | if (!do_non_text_tags(info->gwps, info, child, &info->skin_vp->vp)) |
489 | { | 496 | { |
490 | static char tempbuf[128]; | 497 | static char tempbuf[128]; |
491 | const char *value = get_token_value(info->gwps, child->data, | 498 | const char *valuestr = get_token_value(info->gwps, child->data, |
492 | info->offset, tempbuf, | 499 | info->offset, tempbuf, |
493 | sizeof(tempbuf), NULL); | 500 | sizeof(tempbuf), NULL); |
494 | if (value) | 501 | if (valuestr) |
495 | { | 502 | { |
496 | #if CONFIG_RTC | 503 | #if CONFIG_RTC |
497 | if (child->tag->flags&SKIN_RTC_REFRESH) | 504 | if (child->tag->flags&SKIN_RTC_REFRESH) |
@@ -499,7 +506,7 @@ static bool skin_render_line(struct skin_element* line, struct skin_draw_info *i | |||
499 | #endif | 506 | #endif |
500 | needs_update = needs_update || | 507 | needs_update = needs_update || |
501 | ((child->tag->flags&info->refresh_type)!=0); | 508 | ((child->tag->flags&info->refresh_type)!=0); |
502 | strlcat(info->cur_align_start, value, | 509 | strlcat(info->cur_align_start, valuestr, |
503 | info->buf_size - (info->cur_align_start-info->buf)); | 510 | info->buf_size - (info->cur_align_start-info->buf)); |
504 | } | 511 | } |
505 | } | 512 | } |
@@ -612,8 +619,8 @@ bool skin_render_alternator(struct skin_element* element, struct skin_draw_info | |||
612 | return changed_lines || ret; | 619 | return changed_lines || ret; |
613 | } | 620 | } |
614 | 621 | ||
615 | static void skin_render_viewport(struct skin_element* viewport, struct gui_wps *gwps, | 622 | void skin_render_viewport(struct skin_element* viewport, struct gui_wps *gwps, |
616 | struct skin_viewport* skin_viewport, unsigned long refresh_type) | 623 | struct skin_viewport* skin_viewport, unsigned long refresh_type) |
617 | { | 624 | { |
618 | struct screen *display = gwps->display; | 625 | struct screen *display = gwps->display; |
619 | char linebuf[MAX_LINE]; | 626 | char linebuf[MAX_LINE]; |
@@ -784,10 +791,11 @@ void skin_render(struct gui_wps *gwps, unsigned refresh_mode) | |||
784 | } | 791 | } |
785 | 792 | ||
786 | #ifdef HAVE_LCD_BITMAP | 793 | #ifdef HAVE_LCD_BITMAP |
787 | static __attribute__((noinline)) void skin_render_playlistviewer(struct playlistviewer* viewer, | 794 | static __attribute__((noinline)) |
788 | struct gui_wps *gwps, | 795 | void skin_render_playlistviewer(struct playlistviewer* viewer, |
789 | struct skin_viewport* skin_viewport, | 796 | struct gui_wps *gwps, |
790 | unsigned long refresh_type) | 797 | struct skin_viewport* skin_viewport, |
798 | unsigned long refresh_type) | ||
791 | { | 799 | { |
792 | struct screen *display = gwps->display; | 800 | struct screen *display = gwps->display; |
793 | char linebuf[MAX_LINE]; | 801 | char linebuf[MAX_LINE]; |
diff --git a/apps/gui/skin_engine/skin_tokens.c b/apps/gui/skin_engine/skin_tokens.c index ec6f606938..8e15ddc84a 100644 --- a/apps/gui/skin_engine/skin_tokens.c +++ b/apps/gui/skin_engine/skin_tokens.c | |||
@@ -71,6 +71,7 @@ | |||
71 | #include "radio.h" | 71 | #include "radio.h" |
72 | #include "tuner.h" | 72 | #include "tuner.h" |
73 | #endif | 73 | #endif |
74 | #include "list.h" | ||
74 | 75 | ||
75 | #define NOINLINE __attribute__ ((noinline)) | 76 | #define NOINLINE __attribute__ ((noinline)) |
76 | 77 | ||
@@ -894,6 +895,17 @@ const char *get_token_value(struct gui_wps *gwps, | |||
894 | *intval = sb_get_icon(gwps->display->screen_type); | 895 | *intval = sb_get_icon(gwps->display->screen_type); |
895 | snprintf(buf, buf_size, "%d",sb_get_icon(gwps->display->screen_type)); | 896 | snprintf(buf, buf_size, "%d",sb_get_icon(gwps->display->screen_type)); |
896 | return buf; | 897 | return buf; |
898 | case SKIN_TOKEN_LIST_ITEM_TEXT: | ||
899 | return skinlist_get_item_text(); | ||
900 | case SKIN_TOKEN_LIST_ITEM_IS_SELECTED: | ||
901 | return skinlist_is_selected_item()?"s":""; | ||
902 | case SKIN_TOKEN_LIST_ITEM_ICON: | ||
903 | if (intval) | ||
904 | *intval = skinlist_get_item_icon(); | ||
905 | snprintf(buf, buf_size, "%d",skinlist_get_item_icon()); | ||
906 | return buf; | ||
907 | case SKIN_TOKEN_LIST_NEEDS_SCROLLBAR: | ||
908 | return skinlist_needs_scrollbar(gwps->display->screen_type) ? "s" : ""; | ||
897 | #endif | 909 | #endif |
898 | case SKIN_TOKEN_PLAYLIST_NAME: | 910 | case SKIN_TOKEN_PLAYLIST_NAME: |
899 | return playlist_name(NULL, buf, buf_size); | 911 | return playlist_name(NULL, buf, buf_size); |
diff --git a/apps/gui/skin_engine/wps_internals.h b/apps/gui/skin_engine/wps_internals.h index 01f67d4a0b..136ec2921a 100644 --- a/apps/gui/skin_engine/wps_internals.h +++ b/apps/gui/skin_engine/wps_internals.h | |||
@@ -193,6 +193,7 @@ struct viewport_colour { | |||
193 | struct viewport *vp; | 193 | struct viewport *vp; |
194 | unsigned colour; | 194 | unsigned colour; |
195 | }; | 195 | }; |
196 | |||
196 | #ifdef HAVE_TOUCHSCREEN | 197 | #ifdef HAVE_TOUCHSCREEN |
197 | struct touchregion { | 198 | struct touchregion { |
198 | char* label; /* label to identify this region */ | 199 | char* label; /* label to identify this region */ |
diff --git a/apps/gui/statusbar-skinned.c b/apps/gui/statusbar-skinned.c index 58f58e4890..3f914bd922 100644 --- a/apps/gui/statusbar-skinned.c +++ b/apps/gui/statusbar-skinned.c | |||
@@ -139,6 +139,7 @@ int sb_get_backdrop(enum screen_type screen) | |||
139 | } | 139 | } |
140 | 140 | ||
141 | #endif | 141 | #endif |
142 | static bool force_waiting = false; | ||
142 | void sb_skin_update(enum screen_type screen, bool force) | 143 | void sb_skin_update(enum screen_type screen, bool force) |
143 | { | 144 | { |
144 | struct wps_data *data = skin_get_gwps(CUSTOM_STATUSBAR, screen)->data; | 145 | struct wps_data *data = skin_get_gwps(CUSTOM_STATUSBAR, screen)->data; |
@@ -146,8 +147,9 @@ void sb_skin_update(enum screen_type screen, bool force) | |||
146 | int i = screen; | 147 | int i = screen; |
147 | if (!data->wps_loaded) | 148 | if (!data->wps_loaded) |
148 | return; | 149 | return; |
149 | if (TIME_AFTER(current_tick, next_update[i]) || force) | 150 | if (TIME_AFTER(current_tick, next_update[i]) || force || force_waiting) |
150 | { | 151 | { |
152 | force_waiting = false; | ||
151 | #if defined(HAVE_LCD_ENABLE) || defined(HAVE_LCD_SLEEP) | 153 | #if defined(HAVE_LCD_ENABLE) || defined(HAVE_LCD_SLEEP) |
152 | /* currently, all remotes are readable without backlight | 154 | /* currently, all remotes are readable without backlight |
153 | * so still update those */ | 155 | * so still update those */ |
@@ -168,6 +170,7 @@ void do_sbs_update_callback(void *param) | |||
168 | /* the WPS handles changing the actual id3 data in the id3 pointers | 170 | /* the WPS handles changing the actual id3 data in the id3 pointers |
169 | * we imported, we just want a full update */ | 171 | * we imported, we just want a full update */ |
170 | skin_request_full_update(CUSTOM_STATUSBAR); | 172 | skin_request_full_update(CUSTOM_STATUSBAR); |
173 | force_waiting = true; | ||
171 | /* force timeout in wps main loop, so that the update is instantly */ | 174 | /* force timeout in wps main loop, so that the update is instantly */ |
172 | queue_post(&button_queue, BUTTON_NONE, 0); | 175 | queue_post(&button_queue, BUTTON_NONE, 0); |
173 | } | 176 | } |
diff --git a/apps/gui/viewport.c b/apps/gui/viewport.c index 45094e421a..34ebbf9043 100644 --- a/apps/gui/viewport.c +++ b/apps/gui/viewport.c | |||
@@ -28,7 +28,7 @@ | |||
28 | #include "screen_access.h" | 28 | #include "screen_access.h" |
29 | #include "settings.h" | 29 | #include "settings.h" |
30 | #include "misc.h" | 30 | #include "misc.h" |
31 | 31 | #include "list.h" | |
32 | /*some short cuts for fg/bg/line selector handling */ | 32 | /*some short cuts for fg/bg/line selector handling */ |
33 | #ifdef HAVE_LCD_COLOR | 33 | #ifdef HAVE_LCD_COLOR |
34 | #define FG_FALLBACK global_settings.fg_color | 34 | #define FG_FALLBACK global_settings.fg_color |
@@ -178,6 +178,7 @@ static void toggle_theme(enum screen_type screen, bool force) | |||
178 | screens[screen].backdrop_show(NULL); | 178 | screens[screen].backdrop_show(NULL); |
179 | #endif | 179 | #endif |
180 | screens[screen].stop_scroll(); | 180 | screens[screen].stop_scroll(); |
181 | skinlist_set_cfg(screen, NULL); | ||
181 | } | 182 | } |
182 | /* let list initialize viewport in case viewport dimensions is changed. */ | 183 | /* let list initialize viewport in case viewport dimensions is changed. */ |
183 | send_event(GUI_EVENT_THEME_CHANGED, NULL); | 184 | send_event(GUI_EVENT_THEME_CHANGED, NULL); |
diff --git a/apps/misc.c b/apps/misc.c index 69c62da238..6e2bf32770 100644 --- a/apps/misc.c +++ b/apps/misc.c | |||
@@ -56,6 +56,7 @@ | |||
56 | #include "playlist.h" | 56 | #include "playlist.h" |
57 | #include "yesno.h" | 57 | #include "yesno.h" |
58 | #include "viewport.h" | 58 | #include "viewport.h" |
59 | #include "list.h" | ||
59 | 60 | ||
60 | #include "debug.h" | 61 | #include "debug.h" |
61 | 62 | ||
@@ -1078,11 +1079,25 @@ static enum current_activity | |||
1078 | static int current_activity_top = 0; | 1079 | static int current_activity_top = 0; |
1079 | void push_current_activity(enum current_activity screen) | 1080 | void push_current_activity(enum current_activity screen) |
1080 | { | 1081 | { |
1082 | #if HAVE_LCD_BITMAP | ||
1083 | int i; | ||
1084 | #endif | ||
1081 | current_activity[current_activity_top++] = screen; | 1085 | current_activity[current_activity_top++] = screen; |
1086 | #if HAVE_LCD_BITMAP | ||
1087 | FOR_NB_SCREENS(i) | ||
1088 | skinlist_set_cfg(i, NULL); | ||
1089 | #endif | ||
1082 | } | 1090 | } |
1083 | void pop_current_activity(void) | 1091 | void pop_current_activity(void) |
1084 | { | 1092 | { |
1093 | #if HAVE_LCD_BITMAP | ||
1094 | int i; | ||
1095 | #endif | ||
1085 | current_activity_top--; | 1096 | current_activity_top--; |
1097 | #if HAVE_LCD_BITMAP | ||
1098 | FOR_NB_SCREENS(i) | ||
1099 | skinlist_set_cfg(i, NULL); | ||
1100 | #endif | ||
1086 | } | 1101 | } |
1087 | enum current_activity get_current_activity(void) | 1102 | enum current_activity get_current_activity(void) |
1088 | { | 1103 | { |
diff --git a/lib/skin_parser/tag_table.c b/lib/skin_parser/tag_table.c index db8c2e5557..849e1d92dd 100644 --- a/lib/skin_parser/tag_table.c +++ b/lib/skin_parser/tag_table.c | |||
@@ -188,7 +188,12 @@ static const struct tag_info legal_tags[] = | |||
188 | 188 | ||
189 | { SKIN_TOKEN_VIEWPORT_CUSTOMLIST, "Vp" , "IC", SKIN_REFRESH_DYNAMIC|NOBREAK }, | 189 | { SKIN_TOKEN_VIEWPORT_CUSTOMLIST, "Vp" , "IC", SKIN_REFRESH_DYNAMIC|NOBREAK }, |
190 | { SKIN_TOKEN_LIST_TITLE_TEXT, "Lt" , "", SKIN_REFRESH_DYNAMIC }, | 190 | { SKIN_TOKEN_LIST_TITLE_TEXT, "Lt" , "", SKIN_REFRESH_DYNAMIC }, |
191 | { SKIN_TOKEN_LIST_ITEM_TEXT, "LT", "", SKIN_REFRESH_DYNAMIC }, | ||
191 | { SKIN_TOKEN_LIST_TITLE_ICON, "Li" , "", SKIN_REFRESH_DYNAMIC }, | 192 | { SKIN_TOKEN_LIST_TITLE_ICON, "Li" , "", SKIN_REFRESH_DYNAMIC }, |
193 | { SKIN_TOKEN_LIST_ITEM_ICON, "LI", "", SKIN_REFRESH_DYNAMIC }, | ||
194 | { SKIN_TOKEN_LIST_ITEM_CFG, "Lb" , "Sii|S", SKIN_REFRESH_STATIC }, | ||
195 | { SKIN_TOKEN_LIST_ITEM_IS_SELECTED, "Lc" , "", SKIN_REFRESH_DYNAMIC }, | ||
196 | { SKIN_TOKEN_LIST_NEEDS_SCROLLBAR, "LB", BAR_PARAMS, SKIN_REFRESH_DYNAMIC }, | ||
192 | 197 | ||
193 | { SKIN_TOKEN_VIEWPORT_FGCOLOUR, "Vf" , "s", SKIN_REFRESH_STATIC|NOBREAK }, | 198 | { SKIN_TOKEN_VIEWPORT_FGCOLOUR, "Vf" , "s", SKIN_REFRESH_STATIC|NOBREAK }, |
194 | { SKIN_TOKEN_VIEWPORT_BGCOLOUR, "Vb" , "s", SKIN_REFRESH_STATIC|NOBREAK }, | 199 | { SKIN_TOKEN_VIEWPORT_BGCOLOUR, "Vb" , "s", SKIN_REFRESH_STATIC|NOBREAK }, |
diff --git a/lib/skin_parser/tag_table.h b/lib/skin_parser/tag_table.h index 58c14b5e0b..5a93e36866 100644 --- a/lib/skin_parser/tag_table.h +++ b/lib/skin_parser/tag_table.h | |||
@@ -212,6 +212,13 @@ enum skin_token_type { | |||
212 | SKIN_TOKEN_DRAW_INBUILTBAR, | 212 | SKIN_TOKEN_DRAW_INBUILTBAR, |
213 | SKIN_TOKEN_LIST_TITLE_TEXT, | 213 | SKIN_TOKEN_LIST_TITLE_TEXT, |
214 | SKIN_TOKEN_LIST_TITLE_ICON, | 214 | SKIN_TOKEN_LIST_TITLE_ICON, |
215 | SKIN_TOKEN_LIST_ITEM_CFG, | ||
216 | SKIN_TOKEN_LIST_SELECTED_ITEM_CFG, | ||
217 | SKIN_TOKEN_LIST_ITEM_IS_SELECTED, | ||
218 | SKIN_TOKEN_LIST_ITEM_TEXT, | ||
219 | SKIN_TOKEN_LIST_ITEM_ICON, | ||
220 | SKIN_TOKEN_LIST_NEEDS_SCROLLBAR, | ||
221 | SKIN_TOKEN_LIST_SCROLLBAR, | ||
215 | 222 | ||
216 | SKIN_TOKEN_LOAD_FONT, | 223 | SKIN_TOKEN_LOAD_FONT, |
217 | 224 | ||