From 541dd6fda5ae93073a0b9c499f62af2cf46f3529 Mon Sep 17 00:00:00 2001 From: Thomas Martitz Date: Sun, 13 Sep 2009 12:24:14 +0000 Subject: [PATCH] Remove some trailing whitespaces in in the skin engine files. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@22694 a1c6a512-1295-4272-9138-f99709370657 --- apps/gui/skin_engine/skin_buffer.c | 16 ++-- apps/gui/skin_engine/skin_display.c | 66 ++++++++-------- apps/gui/skin_engine/skin_parser.c | 114 ++++++++++++++-------------- apps/gui/skin_engine/skin_tokens.c | 6 +- apps/gui/skin_engine/wps_debug.c | 22 +++--- 5 files changed, 112 insertions(+), 112 deletions(-) diff --git a/apps/gui/skin_engine/skin_buffer.c b/apps/gui/skin_engine/skin_buffer.c index 1a81f55ea8..3ad2efc634 100644 --- a/apps/gui/skin_engine/skin_buffer.c +++ b/apps/gui/skin_engine/skin_buffer.c @@ -34,14 +34,14 @@ /* skin buffer management. * This module is used to allocate space in a single global skin buffer for * tokens for both/all screens. - * + * * This is mostly just copy/paste from firmware/buffer.c * * * MAIN_ and REMOTE_BUFFER are just for reasonable size calibration, * both screens can use the whole buffer as they need; it's not split * between screens - * + * * Buffer can be allocated from either "end" of the global buffer. * items with unknown sizes get allocated from the start (0->) (data) * items with known sizes get allocated from the end (<-buf_size) (tokens) @@ -49,7 +49,7 @@ * |tokens skin1|images skin2|---SPACE---|data skin2|data skin1| * Make sure to never start allocating from the beginning before letting us know * how much was used. and RESPECT THE buf_free RETURN VALUES! - * + * */ @@ -71,7 +71,7 @@ #ifdef HAVE_LCD_CHARCELLS #define SKIN_BUFFER_SIZE (LCD_HEIGHT * LCD_WIDTH) * 64 + \ - (WPS_MAX_TOKENS * sizeof(struct wps_token)) + (WPS_MAX_TOKENS * sizeof(struct wps_token)) #endif static unsigned char buffer[SKIN_BUFFER_SIZE]; @@ -87,7 +87,7 @@ void skin_buffer_init(void) if (buffer == NULL) { buf_size = SKIN_BUFFER_SIZE;/* global_settings.skin_buf_size */ - + buffer = buffer_alloc(buf_size); buffer_front = buffer; buffer_back = bufer + buf_size; @@ -124,16 +124,16 @@ void* skin_buffer_alloc(size_t size) buffer_back -= size; /* 32-bit aligned */ buffer_back = (void *)(((unsigned long)buffer_back) & ~3); - + memset(buffer_back, 0, size); return buffer_back; } /* Get a pointer to the skin buffer and the count of how much is free - * used to do your own buffer management. + * used to do your own buffer management. * Any memory used will be overwritten next time wps_buffer_alloc() * is called unless skin_buffer_increment() is called first - * + * * This is from the start of the buffer, it is YOUR responsility to make * sure you dont ever use more then *freespace, and bear in mind this will only * be valid untill skin_buffer_alloc() is next called... diff --git a/apps/gui/skin_engine/skin_display.c b/apps/gui/skin_engine/skin_display.c index 14e0bce0a9..e24ab66393 100644 --- a/apps/gui/skin_engine/skin_display.c +++ b/apps/gui/skin_engine/skin_display.c @@ -120,14 +120,14 @@ bool gui_wps_display(struct gui_wps *gwps) bool skin_update(struct gui_wps *gwps, unsigned int update_type) { bool retval; - /* This maybe shouldnt be here, but while the skin is only used to + /* This maybe shouldnt be here, but while the skin is only used to * display the music screen this is better than whereever we are being * called from. This is also safe for skined screen which dont use the id3 */ struct mp3entry *id3 = gwps->state->id3; bool cuesheet_update = (id3 != NULL ? cuesheet_subtrack_changed(id3) : false); gwps->state->do_full_update = cuesheet_update || gwps->state->do_full_update; - - retval = skin_redraw(gwps, gwps->state->do_full_update ? + + retval = skin_redraw(gwps, gwps->state->do_full_update ? WPS_REFRESH_ALL : update_type); return retval; } @@ -161,7 +161,7 @@ void skin_statusbar_changed(struct gui_wps *skin) } } - + } static void draw_progressbar(struct gui_wps *gwps, @@ -226,7 +226,7 @@ static void wps_draw_image(struct gui_wps *gwps, struct gui_img *img, int subima #if LCD_DEPTH > 1 if(img->bm.format == FORMAT_MONO) { #endif - display->mono_bitmap_part(img->bm.data, + display->mono_bitmap_part(img->bm.data, 0, img->subimage_height * subimage, img->bm.width, img->x, img->y, img->bm.width, @@ -235,8 +235,8 @@ static void wps_draw_image(struct gui_wps *gwps, struct gui_img *img, int subima } else { display->transparent_bitmap_part((fb_data *)img->bm.data, 0, img->subimage_height * subimage, - STRIDE(display->screen_type, - img->bm.width, img->bm.height), + STRIDE(display->screen_type, + img->bm.width, img->bm.height), img->x, img->y, img->bm.width, img->subimage_height); } @@ -268,14 +268,14 @@ static void wps_display_images(struct gui_wps *gwps, struct viewport* vp) } list = list->next; } -#ifdef HAVE_ALBUMART +#ifdef HAVE_ALBUMART /* now draw the AA */ if (data->albumart && data->albumart->vp == vp && data->albumart->draw) { draw_album_art(gwps, audio_current_aa_hid(), false); } #endif - + display->set_drawmode(DRMODE_SOLID); } @@ -352,14 +352,14 @@ static void draw_player_fullbar(struct gui_wps *gwps, char* buf, int buf_size) { softchar = false; memset(progress_pattern, 0, sizeof(progress_pattern)); - + if ((digit = timestr[time_idx])) { softchar = true; digit -= '0'; if (timestr[time_idx + 1] == ':') /* ones, left aligned */ - { + { memcpy(progress_pattern, numbers[digit], 4); time_idx += 2; } @@ -498,8 +498,8 @@ struct gui_img* find_image(char label, struct wps_data *data) list = list->next; } return NULL; -} -#endif +} +#endif struct skin_viewport* find_viewport(char label, struct wps_data *data) { @@ -512,9 +512,9 @@ struct skin_viewport* find_viewport(char label, struct wps_data *data) 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. align is the alignment format that'll be used to display the text. @@ -617,7 +617,7 @@ static bool get_line(struct gui_wps *gwps, struct skin_token_list *list = data->viewports; while (list) { - struct skin_viewport *vp = + struct skin_viewport *vp = (struct skin_viewport *)list->token->value.data; if (vp->label == label) { @@ -859,7 +859,7 @@ static void write_line(struct screen *display, ypos = (line * string_height); - if (scroll && ((left_width > scroll_width) || + if (scroll && ((left_width > scroll_width) || (center_width > scroll_width) || (right_width > scroll_width))) { @@ -911,7 +911,7 @@ static bool skin_redraw(struct gui_wps *gwps, unsigned refresh_mode) if (!id3) return false; - + unsigned flags; char linebuf[MAX_PATH]; @@ -919,8 +919,8 @@ static bool skin_redraw(struct gui_wps *gwps, unsigned refresh_mode) align.left = NULL; align.center = NULL; align.right = NULL; - - + + struct skin_token_list *viewport_list; bool update_line, new_subline_refresh; @@ -942,14 +942,14 @@ static bool skin_redraw(struct gui_wps *gwps, unsigned refresh_mode) if (refresh_mode == WPS_REFRESH_ALL) { struct skin_line *line; - + display->set_viewport(&find_viewport(VP_DEFAULT_LABEL, data)->vp); display->clear_viewport(); - - for (viewport_list = data->viewports; + + for (viewport_list = data->viewports; viewport_list; viewport_list = viewport_list->next) { - struct skin_viewport *skin_viewport = + struct skin_viewport *skin_viewport = (struct skin_viewport *)viewport_list->token->value.data; for(line = skin_viewport->lines; line; line = line->next) { @@ -968,10 +968,10 @@ static bool skin_redraw(struct gui_wps *gwps, unsigned refresh_mode) #endif /* disable any viewports which are conditionally displayed */ - for (viewport_list = data->viewports; + for (viewport_list = data->viewports; viewport_list; viewport_list = viewport_list->next) { - struct skin_viewport *skin_viewport = + struct skin_viewport *skin_viewport = (struct skin_viewport *)viewport_list->token->value.data; if (skin_viewport->hidden_flags&VP_DRAW_HIDEABLE) { @@ -982,10 +982,10 @@ static bool skin_redraw(struct gui_wps *gwps, unsigned refresh_mode) } } int viewport_count = 0; - for (viewport_list = data->viewports; + for (viewport_list = data->viewports; viewport_list; viewport_list = viewport_list->next, viewport_count++) { - struct skin_viewport *skin_viewport = + struct skin_viewport *skin_viewport = (struct skin_viewport *)viewport_list->token->value.data; unsigned vp_refresh_mode = refresh_mode; display->set_viewport(&skin_viewport->vp); @@ -995,7 +995,7 @@ static bool skin_redraw(struct gui_wps *gwps, unsigned refresh_mode) struct skin_token_list *imglist = data->images; while (imglist) { - struct gui_img *img = (struct gui_img *)imglist->token->value.data; + struct gui_img *img = (struct gui_img *)imglist->token->value.data; img->display = -1; imglist = imglist->next; } @@ -1019,11 +1019,11 @@ static bool skin_redraw(struct gui_wps *gwps, unsigned refresh_mode) { display->clear_viewport(); } - + /* loop over the lines for this viewport */ struct skin_line *line; int line_count = 0; - + for (line = skin_viewport->lines; line; line = line->next, line_count++) { struct skin_subline *subline; @@ -1082,7 +1082,7 @@ static bool skin_redraw(struct gui_wps *gwps, unsigned refresh_mode) } #endif - if (update_line && + if (update_line && /* conditionals clear the line which means if the %Vd is put into the default viewport there will be a blank line. To get around this we dont allow any actual drawing to happen in the diff --git a/apps/gui/skin_engine/skin_parser.c b/apps/gui/skin_engine/skin_parser.c index 5f5128533f..7d37e1972c 100644 --- a/apps/gui/skin_engine/skin_parser.c +++ b/apps/gui/skin_engine/skin_parser.c @@ -134,7 +134,7 @@ static int parse_dir_level(const char *wps_bufptr, struct wps_token *token, struct wps_data *wps_data); static int parse_setting(const char *wps_bufptr, struct wps_token *token, struct wps_data *wps_data); - + #ifdef HAVE_LCD_BITMAP static int parse_viewport_display(const char *wps_bufptr, struct wps_token *token, struct wps_data *wps_data); @@ -170,7 +170,7 @@ static int fulline_tag_not_supported(const char *wps_bufptr, return skip_end_of_line(wps_bufptr); } #define parse_touchregion fulline_tag_not_supported -#endif +#endif #ifdef CONFIG_RTC #define WPS_RTC_REFRESH WPS_REFRESH_DYNAMIC #else @@ -287,7 +287,7 @@ static const struct wps_tag all_tags[] = { { WPS_TOKEN_REPEAT_MODE, "mm", WPS_REFRESH_DYNAMIC, NULL }, { WPS_TOKEN_PLAYBACK_STATUS, "mp", WPS_REFRESH_DYNAMIC, NULL }, - { WPS_TOKEN_BUTTON_VOLUME, "mv", WPS_REFRESH_DYNAMIC, + { WPS_TOKEN_BUTTON_VOLUME, "mv", WPS_REFRESH_DYNAMIC, parse_timeout }, #ifdef HAVE_LCD_BITMAP @@ -340,7 +340,7 @@ static const struct wps_tag all_tags[] = { { WPS_TOKEN_ALBUMART_DISPLAY, "C", WPS_REFRESH_STATIC, parse_albumart_display }, #endif - { WPS_VIEWPORT_ENABLE, "Vd", WPS_REFRESH_DYNAMIC, + { WPS_VIEWPORT_ENABLE, "Vd", WPS_REFRESH_DYNAMIC, parse_viewport_display }, { WPS_NO_TOKEN, "V", 0, parse_viewport }, @@ -350,16 +350,16 @@ static const struct wps_tag all_tags[] = { #endif { WPS_TOKEN_SETTING, "St", WPS_REFRESH_DYNAMIC, parse_setting }, - + { WPS_TOKEN_LASTTOUCH, "Tl", WPS_REFRESH_DYNAMIC, parse_timeout }, { WPS_NO_TOKEN, "T", 0, parse_touchregion }, - + { WPS_TOKEN_UNKNOWN, "", 0, NULL } /* the array MUST end with an empty string (first char is \0) */ }; -/* add a skin_token_list item to the list chain. ALWAYS appended because some of the +/* add a skin_token_list item to the list chain. ALWAYS appended because some of the * chains require the order to be kept. */ static void add_to_ll_chain(struct skin_token_list **list, struct skin_token_list *item) @@ -371,9 +371,9 @@ static void add_to_ll_chain(struct skin_token_list **list, struct skin_token_lis struct skin_token_list *t = *list; while (t->next) t = t->next; - t->next = item; + t->next = item; } -} +} /* 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) @@ -392,7 +392,7 @@ static struct skin_token_list *new_skin_token_list_item(struct wps_token *token, if (token_data) llitem->token->value.data = token_data; return llitem; -} +} /* Returns the number of chars that should be skipped to jump immediately after the first eol, i.e. to the start of the next line */ @@ -414,10 +414,10 @@ static bool skin_start_new_subline(struct skin_line *line, int curr_token) subline->first_token_idx = curr_token; subline->next = NULL; - + subline->line_type = 0; subline->time_mult = 0; - + line->curr_subline->last_token_idx = curr_token-1; line->curr_subline->next = subline; line->curr_subline = subline; @@ -430,19 +430,19 @@ static bool skin_start_new_line(struct skin_viewport *vp, int curr_token) struct skin_subline *subline = NULL; if (!line) return false; - - /* init the subline */ + + /* init the subline */ subline = &line->sublines; subline->first_token_idx = curr_token; - subline->next = NULL; + subline->next = NULL; subline->line_type = 0; subline->time_mult = 0; - + /* init the new line */ - line->curr_subline = &line->sublines; + line->curr_subline = &line->sublines; line->next = NULL; line->subline_expire_time = 0; - + /* connect to curr_line and vp pointers. * 1) close the previous lines subline * 2) connect to vp pointer @@ -567,9 +567,9 @@ static int parse_image_load(const char *wps_bufptr, const char *newline; int x,y; struct gui_img *img; - + /* format: %x|n|filename.bmp|x|y| - or %xl|n|filename.bmp|x|y| + or %xl|n|filename.bmp|x|y| or %xl|n|filename.bmp|x|y|num_subimages| */ @@ -653,14 +653,14 @@ static int parse_viewport(const char *wps_bufptr, (void)token; /* Kill warnings */ const char *ptr = wps_bufptr; - const int screen = + const int screen = #ifdef HAVE_REMOTE_LCD wps_data->remote_wps ? SCREEN_REMOTE : #endif SCREEN_MAIN; struct skin_viewport *skin_vp = skin_buffer_alloc(sizeof(struct skin_viewport)); - + /* check for the optional letter to signify its a hideable viewport */ /* %Vl|