1
0
Fork 0
forked from len0rd/rockbox

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
This commit is contained in:
Thomas Martitz 2009-11-01 15:48:31 +00:00
parent 30faf032ad
commit 3216d32a05
4 changed files with 35 additions and 108 deletions

View file

@ -36,10 +36,9 @@ bool backdrop_load(enum backdrop_type bdrop, const char*);
void backdrop_unload(enum backdrop_type bdrop); void backdrop_unload(enum backdrop_type bdrop);
void backdrop_show(enum backdrop_type bdrop); void backdrop_show(enum backdrop_type bdrop);
#else /* LCD_DEPTH > 1 */ #else /* LCD_DEPTH <= 1 || __PCTOOL__ */
static inline static inline bool backdrop_load(enum backdrop_type bdrop, const char* filename)
bool backdrop_load(enum backdrop_type bdrop, const char* filename)
{ {
(void)filename; (void)bdrop; return true; (void)filename; (void)bdrop; return true;
} }

View file

@ -489,34 +489,6 @@ static bool evaluate_conditional(struct gui_wps *gwps, int *token_index)
return true; 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. /* Read a (sub)line to the given alignment format buffer.
linebuf is the buffer where the data is actually stored. linebuf is the buffer where the data is actually stored.

View file

@ -381,6 +381,38 @@ static void add_to_ll_chain(struct skin_token_list **list, struct skin_token_lis
t->next = item; 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. /* create and init a new wpsll item.
* passing NULL to token will alloc a new one. * passing NULL to token will alloc a new one.
* You should only pass NULL for the token when the token type (table above) * 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; return false;
} }
#endif #endif
#ifdef HAVE_ALBUMART #if defined(HAVE_ALBUMART) && !defined(__PCTOOL__)
status = audio_status(); status = audio_status();
if (status & AUDIO_STATUS_PLAY) if (status & AUDIO_STATUS_PLAY)
{ {

View file

@ -127,16 +127,6 @@ int read_line(int fd, char* buffer, int buffer_size)
return errno ? -1 : num_read; return errno ? -1 : num_read;
} }
bool load_wps_backdrop(const char* filename)
{
return true;
}
bool load_remote_wps_backdrop(const char* filename)
{
return true;
}
int recalc_dimension(struct dim *dst, struct dim *src) int recalc_dimension(struct dim *dst, struct dim *src)
{ {
return 0; return 0;
@ -165,24 +155,6 @@ int resize_on_load(struct bitmap *bm, bool dither,
return 0; return 0;
} }
int audio_status(void)
{
return 0;
}
struct mp3entry* audio_current_track(void)
{
return NULL;
}
void audio_stop(void)
{
}
void audio_play(long offset)
{
}
static char pluginbuf[PLUGIN_BUFFER_SIZE]; static char pluginbuf[PLUGIN_BUFFER_SIZE];
static unsigned dummy_func2(void) static unsigned dummy_func2(void)
@ -259,54 +231,6 @@ void screen_clear_area(struct screen * display, int xstart, int ystart,
} }
#endif #endif
/* From skin_display.c */
void skin_data_init(struct wps_data *wps_data)
{
#ifdef HAVE_LCD_BITMAP
wps_data->wps_sb_tag = false;
wps_data->show_sb_on_wps = false;
wps_data->peak_meter_enabled = false;
wps_data->images = NULL;
wps_data->progressbars = NULL;
/* progress bars */
#else /* HAVE_LCD_CHARCELLS */
int i;
for (i = 0; i < 8; i++)
{
wps_data->wps_progress_pat[i] = 0;
}
wps_data->full_line_progressbar = false;
#endif
wps_data->wps_loaded = false;
}
#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;
}
int main(int argc, char **argv) int main(int argc, char **argv)
{ {