From 3216d32a0538e4b75ae9e82dadc555011181633f Mon Sep 17 00:00:00 2001 From: Thomas Martitz Date: Sun, 1 Nov 2009 15:48:31 +0000 Subject: 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 --- apps/gui/backdrop.h | 5 ++--- apps/gui/skin_engine/skin_display.c | 28 ---------------------------- apps/gui/skin_engine/skin_parser.c | 34 +++++++++++++++++++++++++++++++++- 3 files changed, 35 insertions(+), 32 deletions(-) (limited to 'apps') 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*); void backdrop_unload(enum backdrop_type bdrop); void backdrop_show(enum backdrop_type bdrop); -#else /* LCD_DEPTH > 1 */ +#else /* LCD_DEPTH <= 1 || __PCTOOL__ */ -static inline -bool backdrop_load(enum backdrop_type bdrop, const char* filename) +static inline bool backdrop_load(enum backdrop_type bdrop, const char* filename) { (void)filename; (void)bdrop; return true; } 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) return true; } -#ifdef HAVE_LCD_BITMAP -struct gui_img* find_image(char label, struct wps_data *data) -{ - struct skin_token_list *list = data->images; - while (list) - { - struct gui_img *img = (struct gui_img *)list->token->value.data; - if (img->label == label) - return img; - list = list->next; - } - return NULL; -} -#endif - -struct skin_viewport* find_viewport(char label, struct wps_data *data) -{ - struct skin_token_list *list = data->viewports; - while (list) - { - struct skin_viewport *vp = (struct skin_viewport *)list->token->value.data; - if (vp->label == label) - return vp; - list = list->next; - } - return NULL; -} - /* Read a (sub)line to the given alignment format buffer. 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 t->next = item; } } + +/* traverse the image linked-list for an image */ +#ifdef HAVE_LCD_BITMAP +struct gui_img* find_image(char label, struct wps_data *data) +{ + struct skin_token_list *list = data->images; + while (list) + { + struct gui_img *img = (struct gui_img *)list->token->value.data; + if (img->label == label) + return img; + list = list->next; + } + return NULL; +} +#endif + +/* traverse the viewport linked list for a viewport */ +struct skin_viewport* find_viewport(char label, struct wps_data *data) +{ + struct skin_token_list *list = data->viewports; + while (list) + { + struct skin_viewport *vp = (struct skin_viewport *)list->token->value.data; + if (vp->label == label) + return vp; + list = list->next; + } + return NULL; +} + + /* create and init a new wpsll item. * passing NULL to token will alloc a new one. * 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, return false; } #endif -#ifdef HAVE_ALBUMART +#if defined(HAVE_ALBUMART) && !defined(__PCTOOL__) status = audio_status(); if (status & AUDIO_STATUS_PLAY) { -- cgit v1.2.3