summaryrefslogtreecommitdiff
path: root/apps/gui/skin_engine/skin_parser.c
diff options
context:
space:
mode:
authorJonathan Gordon <rockbox@jdgordon.info>2010-05-05 13:48:50 +0000
committerJonathan Gordon <rockbox@jdgordon.info>2010-05-05 13:48:50 +0000
commitefd1f4e49facbcdcbb11dbf6a8ead3843df586d3 (patch)
tree1247db65aa3b5eb15814b01d3becd8dbe98d2eb0 /apps/gui/skin_engine/skin_parser.c
parent268f7c42f0d7128a4c88cb1c9b64b663dd266bf6 (diff)
downloadrockbox-efd1f4e49facbcdcbb11dbf6a8ead3843df586d3.tar.gz
rockbox-efd1f4e49facbcdcbb11dbf6a8ead3843df586d3.zip
Make it possible to move the UI viewport using conditional viewports.
%Vi|<label>|<Usual %Vi params>| <- specify the possible viewports to use %VI<label> <- make the UI viewport use the %Vi definition with the <label> label. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@25826 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/gui/skin_engine/skin_parser.c')
-rw-r--r--apps/gui/skin_engine/skin_parser.c24
1 files changed, 21 insertions, 3 deletions
diff --git a/apps/gui/skin_engine/skin_parser.c b/apps/gui/skin_engine/skin_parser.c
index 6ea0180534..78ec26eaf9 100644
--- a/apps/gui/skin_engine/skin_parser.c
+++ b/apps/gui/skin_engine/skin_parser.c
@@ -370,6 +370,8 @@ static const struct wps_tag all_tags[] = {
370 370
371 { WPS_VIEWPORT_ENABLE, "Vd", WPS_REFRESH_DYNAMIC, 371 { WPS_VIEWPORT_ENABLE, "Vd", WPS_REFRESH_DYNAMIC,
372 parse_viewport_display }, 372 parse_viewport_display },
373 { WPS_TOKEN_UIVIEWPORT_ENABLE, "VI", WPS_REFRESH_STATIC,
374 parse_viewport_display },
373#ifdef HAVE_LCD_BITMAP 375#ifdef HAVE_LCD_BITMAP
374 { WPS_VIEWPORT_CUSTOMLIST, "Vp", WPS_REFRESH_STATIC, parse_playlistview }, 376 { WPS_VIEWPORT_CUSTOMLIST, "Vp", WPS_REFRESH_STATIC, parse_playlistview },
375 { WPS_TOKEN_LIST_TITLE_TEXT, "Lt", WPS_REFRESH_DYNAMIC, NULL }, 377 { WPS_TOKEN_LIST_TITLE_TEXT, "Lt", WPS_REFRESH_DYNAMIC, NULL },
@@ -915,9 +917,25 @@ static int parse_viewport(const char *wps_bufptr,
915 917
916 if (*ptr == 'i') 918 if (*ptr == 'i')
917 { 919 {
918 skin_vp->label = VP_INFO_LABEL; 920 if (*(ptr+1) == '|')
919 skin_vp->hidden_flags = VP_NEVER_VISIBLE; 921 {
920 ++ptr; 922 char label = *(ptr+2);
923 if (label >= 'a' && label <= 'z')
924 {
925 skin_vp->hidden_flags = VP_NEVER_VISIBLE;
926 skin_vp->label = VP_INFO_LABEL|label;
927 ptr += 3;
928 }
929 else
930 {
931 skin_vp->label = VP_INFO_LABEL|VP_DEFAULT_LABEL;
932 skin_vp->hidden_flags = VP_NEVER_VISIBLE;
933 ++ptr;
934 }
935 }
936 else
937 return WPS_ERROR_INVALID_PARAM; /* malformed token: e.g. %Cl7 */
938
921 } 939 }
922 else if (*ptr == 'l') 940 else if (*ptr == 'l')
923 { 941 {