diff options
author | Thomas Martitz <kugel@rockbox.org> | 2009-11-01 15:48:31 +0000 |
---|---|---|
committer | Thomas Martitz <kugel@rockbox.org> | 2009-11-01 15:48:31 +0000 |
commit | 3216d32a0538e4b75ae9e82dadc555011181633f (patch) | |
tree | 5aa262498e2c8b2f7e2468be6f4407a76a9a687c /apps | |
parent | 30faf032ad56fcdc84c0d03af341b6cbd0374340 (diff) | |
download | rockbox-3216d32a0538e4b75ae9e82dadc555011181633f.tar.gz rockbox-3216d32a0538e4b75ae9e82dadc555011181633f.zip |
Move find_viewport() and find_image() to skin_parser.c where the reset of the linked-list handling sits. That enables removing duplicated code from checkwps. Also remove a few stubs in favor having the restart playback mechanism on albumart change #ifdef __PCTOOL__
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@23465 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps')
-rw-r--r-- | apps/gui/backdrop.h | 5 | ||||
-rw-r--r-- | apps/gui/skin_engine/skin_display.c | 28 | ||||
-rw-r--r-- | apps/gui/skin_engine/skin_parser.c | 34 |
3 files changed, 35 insertions, 32 deletions
diff --git a/apps/gui/backdrop.h b/apps/gui/backdrop.h index 9281cc4045..b37071b5d4 100644 --- a/apps/gui/backdrop.h +++ b/apps/gui/backdrop.h | |||
@@ -36,10 +36,9 @@ bool backdrop_load(enum backdrop_type bdrop, const char*); | |||
36 | void backdrop_unload(enum backdrop_type bdrop); | 36 | void backdrop_unload(enum backdrop_type bdrop); |
37 | void backdrop_show(enum backdrop_type bdrop); | 37 | void backdrop_show(enum backdrop_type bdrop); |
38 | 38 | ||
39 | #else /* LCD_DEPTH > 1 */ | 39 | #else /* LCD_DEPTH <= 1 || __PCTOOL__ */ |
40 | 40 | ||
41 | static inline | 41 | static inline bool backdrop_load(enum backdrop_type bdrop, const char* filename) |
42 | bool backdrop_load(enum backdrop_type bdrop, const char* filename) | ||
43 | { | 42 | { |
44 | (void)filename; (void)bdrop; return true; | 43 | (void)filename; (void)bdrop; return true; |
45 | } | 44 | } |
diff --git a/apps/gui/skin_engine/skin_display.c b/apps/gui/skin_engine/skin_display.c index 743f1b7a35..51f86e5686 100644 --- a/apps/gui/skin_engine/skin_display.c +++ b/apps/gui/skin_engine/skin_display.c | |||
@@ -489,34 +489,6 @@ static bool evaluate_conditional(struct gui_wps *gwps, int *token_index) | |||
489 | return true; | 489 | return true; |
490 | } | 490 | } |
491 | 491 | ||
492 | #ifdef HAVE_LCD_BITMAP | ||
493 | struct gui_img* find_image(char label, struct wps_data *data) | ||
494 | { | ||
495 | struct skin_token_list *list = data->images; | ||
496 | while (list) | ||
497 | { | ||
498 | struct gui_img *img = (struct gui_img *)list->token->value.data; | ||
499 | if (img->label == label) | ||
500 | return img; | ||
501 | list = list->next; | ||
502 | } | ||
503 | return NULL; | ||
504 | } | ||
505 | #endif | ||
506 | |||
507 | struct skin_viewport* find_viewport(char label, struct wps_data *data) | ||
508 | { | ||
509 | struct skin_token_list *list = data->viewports; | ||
510 | while (list) | ||
511 | { | ||
512 | struct skin_viewport *vp = (struct skin_viewport *)list->token->value.data; | ||
513 | if (vp->label == label) | ||
514 | return vp; | ||
515 | list = list->next; | ||
516 | } | ||
517 | return NULL; | ||
518 | } | ||
519 | |||
520 | 492 | ||
521 | /* Read a (sub)line to the given alignment format buffer. | 493 | /* Read a (sub)line to the given alignment format buffer. |
522 | linebuf is the buffer where the data is actually stored. | 494 | linebuf is the buffer where the data is actually stored. |
diff --git a/apps/gui/skin_engine/skin_parser.c b/apps/gui/skin_engine/skin_parser.c index 7f6e80d108..c05ebca45e 100644 --- a/apps/gui/skin_engine/skin_parser.c +++ b/apps/gui/skin_engine/skin_parser.c | |||
@@ -381,6 +381,38 @@ static void add_to_ll_chain(struct skin_token_list **list, struct skin_token_lis | |||
381 | t->next = item; | 381 | t->next = item; |
382 | } | 382 | } |
383 | } | 383 | } |
384 | |||
385 | /* traverse the image linked-list for an image */ | ||
386 | #ifdef HAVE_LCD_BITMAP | ||
387 | struct gui_img* find_image(char label, struct wps_data *data) | ||
388 | { | ||
389 | struct skin_token_list *list = data->images; | ||
390 | while (list) | ||
391 | { | ||
392 | struct gui_img *img = (struct gui_img *)list->token->value.data; | ||
393 | if (img->label == label) | ||
394 | return img; | ||
395 | list = list->next; | ||
396 | } | ||
397 | return NULL; | ||
398 | } | ||
399 | #endif | ||
400 | |||
401 | /* traverse the viewport linked list for a viewport */ | ||
402 | struct skin_viewport* find_viewport(char label, struct wps_data *data) | ||
403 | { | ||
404 | struct skin_token_list *list = data->viewports; | ||
405 | while (list) | ||
406 | { | ||
407 | struct skin_viewport *vp = (struct skin_viewport *)list->token->value.data; | ||
408 | if (vp->label == label) | ||
409 | return vp; | ||
410 | list = list->next; | ||
411 | } | ||
412 | return NULL; | ||
413 | } | ||
414 | |||
415 | |||
384 | /* create and init a new wpsll item. | 416 | /* create and init a new wpsll item. |
385 | * passing NULL to token will alloc a new one. | 417 | * passing NULL to token will alloc a new one. |
386 | * You should only pass NULL for the token when the token type (table above) | 418 | * You should only pass NULL for the token when the token type (table above) |
@@ -1841,7 +1873,7 @@ bool skin_data_load(struct wps_data *wps_data, | |||
1841 | return false; | 1873 | return false; |
1842 | } | 1874 | } |
1843 | #endif | 1875 | #endif |
1844 | #ifdef HAVE_ALBUMART | 1876 | #if defined(HAVE_ALBUMART) && !defined(__PCTOOL__) |
1845 | status = audio_status(); | 1877 | status = audio_status(); |
1846 | if (status & AUDIO_STATUS_PLAY) | 1878 | if (status & AUDIO_STATUS_PLAY) |
1847 | { | 1879 | { |