summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolas Pennequin <nicolas.pennequin@free.fr>2007-11-14 00:45:04 +0000
committerNicolas Pennequin <nicolas.pennequin@free.fr>2007-11-14 00:45:04 +0000
commitf554e00b61a2ecfdbf72314414947de57912fe02 (patch)
tree0d85793fbdfef3c4c7f44cb341e1d02614ab9e87
parentbb999f9eb3aec0aa5b693a52b70090fb5f9caaf0 (diff)
downloadrockbox-f554e00b61a2ecfdbf72314414947de57912fe02.tar.gz
rockbox-f554e00b61a2ecfdbf72314414947de57912fe02.zip
Allow setting a margin on a non-scrolling line by using %m|margin| instead of %s|margin|. This allows to easily place dynamic info next to album art.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15610 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--apps/gui/gwps-common.c2
-rw-r--r--apps/gui/gwps.h2
-rw-r--r--apps/gui/wps_debug.c5
-rw-r--r--apps/gui/wps_parser.c13
4 files changed, 14 insertions, 8 deletions
diff --git a/apps/gui/gwps-common.c b/apps/gui/gwps-common.c
index 1b63dedc4e..f2f4272292 100644
--- a/apps/gui/gwps-common.c
+++ b/apps/gui/gwps-common.c
@@ -1353,7 +1353,7 @@ static char *get_token_value(struct gui_wps *gwps,
1353#endif 1353#endif
1354 1354
1355#ifdef HAVE_LCD_BITMAP 1355#ifdef HAVE_LCD_BITMAP
1356 case WPS_TOKEN_ALIGN_SCROLLMARGIN: 1356 case WPS_TOKEN_LEFTMARGIN:
1357 gwps->display->setmargins(token->value.i, 1357 gwps->display->setmargins(token->value.i,
1358 gwps->display->getymargin()); 1358 gwps->display->getymargin());
1359 return NULL; 1359 return NULL;
diff --git a/apps/gui/gwps.h b/apps/gui/gwps.h
index 94c2836e4e..31f58ee408 100644
--- a/apps/gui/gwps.h
+++ b/apps/gui/gwps.h
@@ -124,7 +124,7 @@ enum wps_token_type {
124 WPS_TOKEN_ALIGN_LEFT, 124 WPS_TOKEN_ALIGN_LEFT,
125 WPS_TOKEN_ALIGN_CENTER, 125 WPS_TOKEN_ALIGN_CENTER,
126 WPS_TOKEN_ALIGN_RIGHT, 126 WPS_TOKEN_ALIGN_RIGHT,
127 WPS_TOKEN_ALIGN_SCROLLMARGIN, 127 WPS_TOKEN_LEFTMARGIN,
128 128
129 /* Sublines */ 129 /* Sublines */
130 WPS_TOKEN_SUBLINE_TIMEOUT, 130 WPS_TOKEN_SUBLINE_TIMEOUT,
diff --git a/apps/gui/wps_debug.c b/apps/gui/wps_debug.c
index 883626d040..6b7b988321 100644
--- a/apps/gui/wps_debug.c
+++ b/apps/gui/wps_debug.c
@@ -81,6 +81,11 @@ static void dump_wps_tokens(struct wps_data *data)
81 case WPS_TOKEN_ALIGN_RIGHT: 81 case WPS_TOKEN_ALIGN_RIGHT:
82 snprintf(buf, sizeof(buf), "align right"); 82 snprintf(buf, sizeof(buf), "align right");
83 break; 83 break;
84
85 case WPS_TOKEN_LEFTMARGIN:
86 snprintf(buf, sizeof(buf), "left margin, value: %d",
87 token->value.i);
88 break;
84#endif 89#endif
85 90
86 case WPS_TOKEN_SUBLINE_TIMEOUT: 91 case WPS_TOKEN_SUBLINE_TIMEOUT:
diff --git a/apps/gui/wps_parser.c b/apps/gui/wps_parser.c
index 0d86a5a3a2..907a8a3278 100644
--- a/apps/gui/wps_parser.c
+++ b/apps/gui/wps_parser.c
@@ -245,12 +245,18 @@ static const struct wps_tag all_tags[] = {
245 245
246#ifdef HAS_REMOTE_BUTTON_HOLD 246#ifdef HAS_REMOTE_BUTTON_HOLD
247 { WPS_TOKEN_REMOTE_HOLD, "mr", WPS_REFRESH_DYNAMIC, NULL }, 247 { WPS_TOKEN_REMOTE_HOLD, "mr", WPS_REFRESH_DYNAMIC, NULL },
248#else
249 { WPS_TOKEN_UNKNOWN, "mr", 0, NULL },
248#endif 250#endif
249 251
250 { WPS_TOKEN_REPEAT_MODE, "mm", WPS_REFRESH_DYNAMIC, NULL }, 252 { WPS_TOKEN_REPEAT_MODE, "mm", WPS_REFRESH_DYNAMIC, NULL },
251 { WPS_TOKEN_PLAYBACK_STATUS, "mp", WPS_REFRESH_DYNAMIC, NULL }, 253 { WPS_TOKEN_PLAYBACK_STATUS, "mp", WPS_REFRESH_DYNAMIC, NULL },
252 254
253#ifdef HAVE_LCD_BITMAP 255#ifdef HAVE_LCD_BITMAP
256 { WPS_TOKEN_LEFTMARGIN, "m", 0, parse_scrollmargin },
257#endif
258
259#ifdef HAVE_LCD_BITMAP
254 { WPS_TOKEN_PEAKMETER, "pm", WPS_REFRESH_PEAK_METER, NULL }, 260 { WPS_TOKEN_PEAKMETER, "pm", WPS_REFRESH_PEAK_METER, NULL },
255#else 261#else
256 { WPS_TOKEN_PLAYER_PROGRESSBAR, "pf", 262 { WPS_TOKEN_PLAYER_PROGRESSBAR, "pf",
@@ -279,12 +285,7 @@ static const struct wps_tag all_tags[] = {
279 { WPS_TOKEN_CROSSFADE, "xf", WPS_REFRESH_DYNAMIC, NULL }, 285 { WPS_TOKEN_CROSSFADE, "xf", WPS_REFRESH_DYNAMIC, NULL },
280#endif 286#endif
281 287
282#ifdef HAVE_LCD_BITMAP
283 { WPS_TOKEN_ALIGN_SCROLLMARGIN, "s", WPS_REFRESH_SCROLL,
284 parse_scrollmargin },
285#else
286 { WPS_NO_TOKEN, "s", WPS_REFRESH_SCROLL, NULL }, 288 { WPS_NO_TOKEN, "s", WPS_REFRESH_SCROLL, NULL },
287#endif
288 { WPS_TOKEN_SUBLINE_TIMEOUT, "t", 0, parse_subline_timeout }, 289 { WPS_TOKEN_SUBLINE_TIMEOUT, "t", 0, parse_subline_timeout },
289 290
290#ifdef HAVE_LCD_BITMAP 291#ifdef HAVE_LCD_BITMAP
@@ -848,7 +849,7 @@ static int parse_scrollmargin(const char *wps_bufptr, struct wps_token *token,
848 849
849 (void)wps_data; /* Kill the warning */ 850 (void)wps_data; /* Kill the warning */
850 851
851 /* valid tag looks like %s or %s|12| */ 852 /* valid tag looks like %m or %m|12| */
852 if(*wps_bufptr == '|') 853 if(*wps_bufptr == '|')
853 { 854 {
854 p = wps_bufptr + 1; 855 p = wps_bufptr + 1;