From 40e98a2e4915464b9306ab7b0f6feb173de095c5 Mon Sep 17 00:00:00 2001 From: William Wilgus Date: Mon, 26 Oct 2020 12:38:22 -0400 Subject: Whitespace cleanup on fb_viewport Rewrite Change-Id: I24aac41c8abecf7b78a44d7f59e842b791be4563 --- apps/gui/pitchscreen.c | 88 ++++++++++++++++++------------------ apps/gui/skin_engine/skin_display.c | 18 ++++---- apps/gui/skin_engine/skin_render.c | 86 +++++++++++++++++------------------ apps/gui/skin_engine/wps_internals.h | 14 +++--- apps/gui/splash.c | 2 +- apps/gui/viewport.c | 2 +- apps/gui/viewport.h | 2 +- apps/gui/yesno.c | 10 ++-- 8 files changed, 111 insertions(+), 111 deletions(-) (limited to 'apps/gui') diff --git a/apps/gui/pitchscreen.c b/apps/gui/pitchscreen.c index b5b719ef02..a6e6e42c43 100644 --- a/apps/gui/pitchscreen.c +++ b/apps/gui/pitchscreen.c @@ -64,13 +64,13 @@ enum }; -/* This is a table of semitone percentage values of the appropriate +/* This is a table of semitone percentage values of the appropriate precision (based on PITCH_SPEED_PRECISION). Note that these are all constant expressions, which will be evaluated at compile time, - so no need to worry about how complex the expressions look. + so no need to worry about how complex the expressions look. That's just to get the precision right. - I calculated these values, starting from 50, as + I calculated these values, starting from 50, as x(n) = 50 * 2^(n/12) @@ -81,7 +81,7 @@ enum */ #define TO_INT_WITH_PRECISION(x) \ ( (unsigned short)(((x) * PITCH_SPEED_PRECISION * 10 + 5) / 10) ) - + static const unsigned short semitone_table[] = { TO_INT_WITH_PRECISION(50.00000000), /* Octave lower */ @@ -115,12 +115,12 @@ static const unsigned short semitone_table[] = #define SEMITONE_END (NUM_SEMITONES/2) #define SEMITONE_START (-SEMITONE_END) -/* A table of values for approximating the cent curve with +/* A table of values for approximating the cent curve with linear interpolation. Multipy the next lowest semitone - by this much to find the corresponding cent percentage. - - These values were calculated as - x(n) = 100 * 2^(n * 20/1200) + by this much to find the corresponding cent percentage. + + These values were calculated as + x(n) = 100 * 2^(n * 20/1200) */ static const unsigned short cent_interp[] = @@ -308,16 +308,16 @@ static void pitchscreen_draw(struct screen *display, int max_lines, { snprintf(buf, sizeof(buf), "%s: %s%d.%02d", str(LANG_PITCH), semitone >= 0 ? "+" : "-", - abs(semitone / PITCH_SPEED_PRECISION), - abs((semitone % PITCH_SPEED_PRECISION) / + abs(semitone / PITCH_SPEED_PRECISION), + abs((semitone % PITCH_SPEED_PRECISION) / (PITCH_SPEED_PRECISION / 100)) ); } else { snprintf(buf, sizeof(buf), "%s: %ld.%ld%%", str(LANG_PITCH), - pitch / PITCH_SPEED_PRECISION, - (pitch % PITCH_SPEED_PRECISION) / + pitch / PITCH_SPEED_PRECISION, + (pitch % PITCH_SPEED_PRECISION) / (PITCH_SPEED_PRECISION / 10)); } } @@ -337,8 +337,8 @@ static void pitchscreen_draw(struct screen *display, int max_lines, /* "Speed:XXX%" */ if(global_settings.pitch_mode_timestretch) { - snprintf(buf, sizeof(buf), "%s: %ld.%ld%%", str(LANG_SPEED), - speed / PITCH_SPEED_PRECISION, + snprintf(buf, sizeof(buf), "%s: %ld.%ld%%", str(LANG_SPEED), + speed / PITCH_SPEED_PRECISION, (speed % PITCH_SPEED_PRECISION) / (PITCH_SPEED_PRECISION / 10)); } else @@ -347,23 +347,23 @@ static void pitchscreen_draw(struct screen *display, int max_lines, { snprintf(buf, sizeof(buf), "%s%d.%02d", semitone >= 0 ? "+" : "-", - abs(semitone / PITCH_SPEED_PRECISION), - abs((semitone % PITCH_SPEED_PRECISION) / + abs(semitone / PITCH_SPEED_PRECISION), + abs((semitone % PITCH_SPEED_PRECISION) / (PITCH_SPEED_PRECISION / 100)) ); } else { snprintf(buf, sizeof(buf), "%ld.%ld%%", - pitch / PITCH_SPEED_PRECISION, + pitch / PITCH_SPEED_PRECISION, (pitch % PITCH_SPEED_PRECISION) / (PITCH_SPEED_PRECISION / 10)); } } display->getstringsize(buf, &w, &h); display->putsxy((pitch_viewports[PITCH_MID].width / 2) - (w / 2), - show_lang_pitch ? (pitch_viewports[PITCH_MID].height / 2) : - (pitch_viewports[PITCH_MID].height / 2) - (h / 2), + show_lang_pitch ? (pitch_viewports[PITCH_MID].height / 2) : + (pitch_viewports[PITCH_MID].height / 2) - (h / 2), buf); if (w > width_used) width_used = w; @@ -401,8 +401,8 @@ static void pitchscreen_draw(struct screen *display, int max_lines, { display->putsxy(0, (pitch_viewports[PITCH_MID].height / 2) - (h / 2), leftlabel); - display->putsxy((pitch_viewports[PITCH_MID].width - w), - (pitch_viewports[PITCH_MID].height / 2) - (h / 2), + display->putsxy((pitch_viewports[PITCH_MID].width - w), + (pitch_viewports[PITCH_MID].height / 2) - (h / 2), rightlabel); } display->update_viewport(); @@ -421,7 +421,7 @@ static int32_t pitch_increase(int32_t pitch, int32_t pitch_delta, bool allow_cut if (pitch_delta < 0) { /* for large jumps, snap up to whole numbers */ - if(allow_cutoff && pitch_delta <= -PITCH_SPEED_PRECISION && + if(allow_cutoff && pitch_delta <= -PITCH_SPEED_PRECISION && (pitch + pitch_delta) % PITCH_SPEED_PRECISION != 0) { pitch_delta += PITCH_SPEED_PRECISION - ((pitch + pitch_delta) % PITCH_SPEED_PRECISION); @@ -442,7 +442,7 @@ static int32_t pitch_increase(int32_t pitch, int32_t pitch_delta, bool allow_cut else if (pitch_delta > 0) { /* for large jumps, snap down to whole numbers */ - if(allow_cutoff && pitch_delta >= PITCH_SPEED_PRECISION && + if(allow_cutoff && pitch_delta >= PITCH_SPEED_PRECISION && (pitch + pitch_delta) % PITCH_SPEED_PRECISION != 0) { pitch_delta -= (pitch + pitch_delta) % PITCH_SPEED_PRECISION; @@ -480,7 +480,7 @@ static int32_t pitch_increase(int32_t pitch, int32_t pitch_delta, bool allow_cut new_pitch = GET_PITCH(speed, STRETCH_MAX); } - if(new_stretch >= STRETCH_MAX || + if(new_stretch >= STRETCH_MAX || new_stretch <= STRETCH_MIN) { at_limit = true; @@ -505,7 +505,7 @@ static int32_t get_semitone_from_pitch(int32_t pitch) /* now find the fractional part */ - while(pitch > (cent_interp[fractional_index + 1] * + while(pitch > (cent_interp[fractional_index + 1] * semitone_table[semitone] / PITCH_SPEED_100)) { /* Check to make sure fractional_index isn't too big */ @@ -517,17 +517,17 @@ static int32_t get_semitone_from_pitch(int32_t pitch) fractional_index++; } - int32_t semitone_pitch_a = cent_interp[fractional_index] * + int32_t semitone_pitch_a = cent_interp[fractional_index] * semitone_table[semitone] / PITCH_SPEED_100; - int32_t semitone_pitch_b = cent_interp[fractional_index + 1] * + int32_t semitone_pitch_b = cent_interp[fractional_index + 1] * semitone_table[semitone] / PITCH_SPEED_100; /* this will be the integer offset from the cent_interp entry */ int32_t semitone_frac_ofs = (pitch - semitone_pitch_a) * CENT_INTERP_INTERVAL / (semitone_pitch_b - semitone_pitch_a); - semitone = (semitone + SEMITONE_START) * PITCH_SPEED_PRECISION + - fractional_index * CENT_INTERP_INTERVAL + + semitone = (semitone + SEMITONE_START) * PITCH_SPEED_PRECISION + + fractional_index * CENT_INTERP_INTERVAL + semitone_frac_ofs; return semitone; @@ -543,14 +543,14 @@ static int32_t get_pitch_from_semitone(int32_t semitone) /* set pitch to the semitone's integer part value */ int32_t pitch = semitone_table[semitone_index]; /* get the range of the cent modification for future calculation */ - int32_t pitch_mod_a = - cent_interp[(adjusted_semitone % PITCH_SPEED_PRECISION) / + int32_t pitch_mod_a = + cent_interp[(adjusted_semitone % PITCH_SPEED_PRECISION) / CENT_INTERP_INTERVAL]; - int32_t pitch_mod_b = - cent_interp[(adjusted_semitone % PITCH_SPEED_PRECISION) / + int32_t pitch_mod_b = + cent_interp[(adjusted_semitone % PITCH_SPEED_PRECISION) / CENT_INTERP_INTERVAL + 1]; /* figure out the cent mod amount based on the semitone fractional value */ - int32_t pitch_mod = pitch_mod_a + (pitch_mod_b - pitch_mod_a) * + int32_t pitch_mod = pitch_mod_a + (pitch_mod_b - pitch_mod_a) * (adjusted_semitone % CENT_INTERP_INTERVAL) / CENT_INTERP_INTERVAL; /* modify pitch based on the mod amount we just calculated */ @@ -558,7 +558,7 @@ static int32_t get_pitch_from_semitone(int32_t semitone) } static int32_t pitch_increase_semitone(int32_t pitch, - int32_t current_semitone, + int32_t current_semitone, int32_t semitone_delta , int32_t speed ) @@ -618,7 +618,7 @@ static int32_t pitch_increase_semitone(int32_t pitch, #ifdef HAVE_TOUCHSCREEN /* * Check for touchscreen presses as per sketch above in this file - * + * * goes through each row of the, checks whether the touchscreen * was pressed in it. Then it looks the columns of each row for specific actions */ @@ -638,7 +638,7 @@ static int pitchscreen_do_touchscreen(struct viewport vps[]) if ((x < column || x > (2*column)) && (ret == BUTTON_REL)) return ACTION_PS_TOGGLE_MODE; - + else if (x >= column && x <= (2*column)) { /* center column pressed */ if (ret == BUTTON_REPEAT) @@ -828,7 +828,7 @@ int gui_syncpitchscreen_run(void) updated = 0; button = get_action(CONTEXT_PITCHSCREEN, HZ); - + #ifdef HAVE_TOUCHSCREEN if (button == ACTION_TOUCHSCREEN) { @@ -841,7 +841,7 @@ int gui_syncpitchscreen_run(void) case ACTION_PS_INC_SMALL: if(global_settings.pitch_mode_semitone) pitch_delta = SEMITONE_SMALL_DELTA; - else + else pitch_delta = PITCH_SMALL_DELTA; updated = 1; break; @@ -849,7 +849,7 @@ int gui_syncpitchscreen_run(void) case ACTION_PS_INC_BIG: if(global_settings.pitch_mode_semitone) pitch_delta = SEMITONE_BIG_DELTA; - else + else pitch_delta = PITCH_BIG_DELTA; updated = 1; break; @@ -857,7 +857,7 @@ int gui_syncpitchscreen_run(void) case ACTION_PS_DEC_SMALL: if(global_settings.pitch_mode_semitone) pitch_delta = -SEMITONE_SMALL_DELTA; - else + else pitch_delta = -PITCH_SMALL_DELTA; updated = 1; break; @@ -865,7 +865,7 @@ int gui_syncpitchscreen_run(void) case ACTION_PS_DEC_BIG: if(global_settings.pitch_mode_semitone) pitch_delta = -SEMITONE_BIG_DELTA; - else + else pitch_delta = -PITCH_BIG_DELTA; updated = 1; break; @@ -1045,7 +1045,7 @@ int gui_syncpitchscreen_run(void) } new_stretch = GET_STRETCH(pitch, new_speed); - if(new_stretch >= STRETCH_MAX || + if(new_stretch >= STRETCH_MAX || new_stretch <= STRETCH_MIN) { at_limit = true; diff --git a/apps/gui/skin_engine/skin_display.c b/apps/gui/skin_engine/skin_display.c index bd3a2b40aa..c35b09eaac 100644 --- a/apps/gui/skin_engine/skin_display.c +++ b/apps/gui/skin_engine/skin_display.c @@ -80,14 +80,14 @@ void skin_update(enum skinnable_screens skin, enum screen_type screen, unsigned int update_type) { struct gui_wps *gwps = skin_get_gwps(skin, screen); - /* This maybe shouldnt be here, + /* This maybe shouldnt be here, * This is also safe for skined screen which dont use the id3 */ struct mp3entry *id3 = skin_get_global_state()->id3; bool cuesheet_update = (id3 != NULL ? cuesheet_subtrack_changed(id3) : false); if (cuesheet_update) skin_request_full_update(skin); - - skin_render(gwps, skin_do_full_update(skin, screen) ? + + skin_render(gwps, skin_do_full_update(skin, screen) ? SKIN_REFRESH_ALL : update_type); } @@ -96,7 +96,7 @@ void skin_update(enum skinnable_screens skin, enum screen_type screen, #define DIRECTION_RIGHT 1 #define DIRECTION_LEFT -1 -static int ab_calc_mark_x_pos(int mark, int capacity, +static int ab_calc_mark_x_pos(int mark, int capacity, int offset, int size) { return offset + ( (size * mark) / capacity ); @@ -124,7 +124,7 @@ static void ab_draw_arrow_mark(struct screen * screen, } } -void ab_draw_markers(struct screen * screen, int capacity, +void ab_draw_markers(struct screen * screen, int capacity, int x, int y, int w, int h) { bool a_set, b_set; @@ -245,13 +245,13 @@ void draw_progressbar(struct gui_wps *gwps, int line, struct progressbar *pb) length = 1; end = 0; } - + if (!pb->horizontal) { /* we want to fill upwards which is technically inverted. */ flags = INVERTFILL; } - + if (pb->invert_fill_direction) { flags ^= INVERTFILL; @@ -421,7 +421,7 @@ void wps_display_images(struct gui_wps *gwps, struct viewport* vp) /* Evaluate the conditional that is at *token_index and return whether a skip has ocurred. *token_index is updated with the new position. */ -int evaluate_conditional(struct gui_wps *gwps, int offset, +int evaluate_conditional(struct gui_wps *gwps, int offset, struct conditional *conditional, int num_options) { if (!gwps) @@ -641,7 +641,7 @@ bool skin_has_sbs(enum screen_type screen, struct wps_data *data) } /* do the button loop as often as required for the peak meters to update - * with a good refresh rate. + * with a good refresh rate. */ int skin_wait_for_action(enum skinnable_screens skin, int context, int timeout) { diff --git a/apps/gui/skin_engine/skin_render.c b/apps/gui/skin_engine/skin_render.c index 00981f5b67..ed2f783e7a 100644 --- a/apps/gui/skin_engine/skin_render.c +++ b/apps/gui/skin_engine/skin_render.c @@ -60,17 +60,17 @@ struct skin_draw_info { int line_number; unsigned long refresh_type; struct line_desc line_desc; - + char* cur_align_start; struct align_pos align; bool no_line_break; bool line_scrolls; bool force_redraw; bool viewport_change; - + char *buf; size_t buf_size; - + int offset; /* used by the playlist viewer */ }; @@ -102,7 +102,7 @@ static bool do_non_text_tags(struct gui_wps *gwps, struct skin_draw_info *info, bool do_refresh = (element->tag->flags & info->refresh_type) > 0; switch (token->type) - { + { #if (LCD_DEPTH > 1) || (defined(HAVE_REMOTE_LCD) && (LCD_REMOTE_DEPTH > 1)) case SKIN_TOKEN_VIEWPORT_FGCOLOUR: { @@ -161,7 +161,7 @@ static bool do_non_text_tags(struct gui_wps *gwps, struct skin_draw_info *info, while (viewport) { struct skin_viewport *skinvp = SKINOFFSETTOPTR(skin_buffer, viewport->data); - + char *vplabel = SKINOFFSETTOPTR(skin_buffer, skinvp->label); if (skinvp->label == VP_DEFAULT_LABEL) vplabel = VP_DEFAULT_LABEL_STRING; @@ -171,7 +171,7 @@ static bool do_non_text_tags(struct gui_wps *gwps, struct skin_draw_info *info, if (skinvp->hidden_flags&VP_DRAW_HIDDEN) { temp |= VP_DRAW_WASHIDDEN; - } + } skinvp->hidden_flags = temp; } viewport = SKINOFFSETTOPTR(skin_buffer, viewport->next); @@ -351,7 +351,7 @@ static void do_tags_in_hidden_conditional(struct skin_element* branch, struct wps_data *data = gwps->data; struct viewport *last_vp; - /* Tags here are ones which need to be "turned off" or cleared + /* Tags here are ones which need to be "turned off" or cleared * if they are in a conditional branch which isnt being used */ if (branch->type == LINE_ALTERNATOR) { @@ -387,7 +387,7 @@ static void do_tags_in_hidden_conditional(struct skin_element* branch, if (token->type == SKIN_TOKEN_IMAGE_PRELOAD_DISPLAY) { struct image_display *id = SKINOFFSETTOPTR(skin_buffer, token->value.data); - struct gui_img *img = skin_find_item(SKINOFFSETTOPTR(skin_buffer, id->label), + struct gui_img *img = skin_find_item(SKINOFFSETTOPTR(skin_buffer, id->label), SKIN_FIND_IMAGE, data); clear_image_pos(gwps, img); } @@ -455,7 +455,7 @@ static void do_tags_in_hidden_conditional(struct skin_element* branch, } } } - + static void fix_line_alignment(struct skin_draw_info *info, struct skin_element *element) { struct align_pos *align = &info->align; @@ -497,16 +497,16 @@ static void fix_line_alignment(struct skin_draw_info *info, struct skin_element break; } } - + /* Draw a LINE element onto the display */ static bool skin_render_line(struct skin_element* line, struct skin_draw_info *info) { bool needs_update = false; int last_value, value; - + if (line->children_count == 0) return false; /* empty line, do nothing */ - + struct skin_element *child = get_child(line->children, 0); struct conditional *conditional; skin_render_func func = skin_render_line; @@ -518,14 +518,14 @@ static bool skin_render_line(struct skin_element* line, struct skin_draw_info *i case CONDITIONAL: conditional = SKINOFFSETTOPTR(skin_buffer, child->data); last_value = conditional->last_value; - value = evaluate_conditional(info->gwps, info->offset, + value = evaluate_conditional(info->gwps, info->offset, conditional, child->children_count); conditional->last_value = value; if (child->children_count == 1) { - /* special handling so + /* special handling so * %?aa and %? need special handlng here */ - + if (value == -1) /* tag is false */ { /* we are in a false branch of a %?aa conditional */ @@ -545,18 +545,18 @@ static bool skin_render_line(struct skin_element* line, struct skin_draw_info *i } else if (get_child(child->children, value)->type == LINE) func = skin_render_line; - + if (value != last_value) { info->refresh_type = SKIN_REFRESH_ALL; info->force_redraw = true; } - + if (func(get_child(child->children, value), info)) needs_update = true; else needs_update = needs_update || (last_value != value); - + info->refresh_type = old_refresh_mode; break; case TAG: @@ -564,9 +564,9 @@ static bool skin_render_line(struct skin_element* line, struct skin_draw_info *i info->no_line_break = true; if (child->tag->type == SKIN_TOKEN_SUBLINE_SCROLL) info->line_scrolls = true; - + fix_line_alignment(info, child); - + if (!SKINOFFSETTOPTR(skin_buffer, child->data)) { break; @@ -583,17 +583,17 @@ static bool skin_render_line(struct skin_element* line, struct skin_draw_info *i if (child->tag->flags&SKIN_RTC_REFRESH) needs_update = needs_update || info->refresh_type&SKIN_REFRESH_DYNAMIC; #endif - needs_update = needs_update || + needs_update = needs_update || ((child->tag->flags&info->refresh_type)!=0); - strlcat(info->cur_align_start, valuestr, + strlcat(info->cur_align_start, valuestr, info->buf_size - (info->cur_align_start-info->buf)); } } break; case TEXT: - strlcat(info->cur_align_start, SKINOFFSETTOPTR(skin_buffer, child->data), + strlcat(info->cur_align_start, SKINOFFSETTOPTR(skin_buffer, child->data), info->buf_size - (info->cur_align_start-info->buf)); - needs_update = needs_update || + needs_update = needs_update || (info->refresh_type&SKIN_REFRESH_STATIC) != 0; break; case COMMENT: @@ -664,7 +664,7 @@ bool skin_render_alternator(struct skin_element* element, struct skin_draw_info int try_line = start; bool suitable = false; int rettimeout = DEFAULT_SUBLINE_TIME_MULTIPLIER*TIMEOUT_UNIT; - + /* find a subline which has at least one token in it, * and that line doesnt have a timeout set to 0 through conditionals */ do { @@ -674,7 +674,7 @@ bool skin_render_alternator(struct skin_element* element, struct skin_draw_info if (get_child(element->children, try_line)->children_count != 0) { current_line = get_child(element->children, try_line); - rettimeout = get_subline_timeout(info->gwps, + rettimeout = get_subline_timeout(info->gwps, get_child(current_line->children, 0)); if (rettimeout > 0) { @@ -683,7 +683,7 @@ bool skin_render_alternator(struct skin_element* element, struct skin_draw_info } } while (try_line != start && !suitable); - + if (suitable) { alternator->current_line = try_line; @@ -749,14 +749,14 @@ void skin_render_viewport(struct skin_element* viewport, struct gui_wps *gwps, if (++info.line_desc.line > info.line_desc.nlines) info.line_desc.style = STYLE_DEFAULT; } -#endif +#endif #endif info.cur_align_start = info.buf; align->left = info.buf; align->center = NULL; align->right = NULL; - - + + if (line->type == LINE_ALTERNATOR) func = skin_render_alternator; else if (line->type == LINE) @@ -798,11 +798,11 @@ void skin_render(struct gui_wps *gwps, unsigned refresh_mode) const int vp_is_appearing = (VP_DRAW_WASHIDDEN|VP_DRAW_HIDEABLE); struct wps_data *data = gwps->data; struct screen *display = gwps->display; - + struct skin_element* viewport; struct skin_viewport* skin_viewport; char *label; - + int old_refresh_mode = refresh_mode; skin_buffer = get_skin_buffer(gwps->data); @@ -828,7 +828,7 @@ void skin_render(struct gui_wps *gwps, unsigned refresh_mode) if (label && SKINOFFSETTOPTR(skin_buffer, viewport->next) && !strcmp(label,VP_DEFAULT_LABEL_STRING)) refresh_mode = 0; - + for (viewport = SKINOFFSETTOPTR(skin_buffer, data->tree); viewport; viewport = SKINOFFSETTOPTR(skin_buffer, viewport->next)) @@ -848,7 +848,7 @@ void skin_render(struct gui_wps *gwps, unsigned refresh_mode) skin_backdrop_show(data->backdrop_id); } #endif - + /* dont redraw the viewport if its disabled */ if (skin_viewport->hidden_flags&VP_NEVER_VISIBLE) { /* don't draw anything into this one */ @@ -864,7 +864,7 @@ void skin_render(struct gui_wps *gwps, unsigned refresh_mode) vp_refresh_mode = SKIN_REFRESH_ALL; skin_viewport->hidden_flags = VP_DRAW_HIDEABLE; } - + display->set_viewport_ex(&skin_viewport->vp, VP_FLAG_VP_SET_CLEAN); if ((vp_refresh_mode&SKIN_REFRESH_ALL) == SKIN_REFRESH_ALL) @@ -929,17 +929,17 @@ void skin_render_playlistviewer(struct playlistviewer* viewer, else #endif { - struct cuesheet *cue = skin_get_global_state()->id3 ? + struct cuesheet *cue = skin_get_global_state()->id3 ? skin_get_global_state()->id3->cuesheet : NULL; cur_pos = playlist_get_display_index(); max = playlist_amount()+1; if (cue) max += cue->track_count; - start_item = MAX(0, cur_pos + viewer->start_offset); + start_item = MAX(0, cur_pos + viewer->start_offset); } if (max-start_item > nb_lines) max = start_item + nb_lines; - + line = SKINOFFSETTOPTR(skin_buffer, viewer->line); while (start_item < max) { @@ -947,20 +947,20 @@ void skin_render_playlistviewer(struct playlistviewer* viewer, info.no_line_break = false; info.line_scrolls = false; info.force_redraw = false; - + info.cur_align_start = info.buf; align->left = info.buf; align->center = NULL; align->right = NULL; - - + + if (line->type == LINE_ALTERNATOR) func = skin_render_alternator; else if (line->type == LINE) func = skin_render_line; - + needs_update = func(line, &info); - + /* only update if the line needs to be, and there is something to write */ if (refresh_type && needs_update) { diff --git a/apps/gui/skin_engine/wps_internals.h b/apps/gui/skin_engine/wps_internals.h index bf7f52bdbf..48898483de 100644 --- a/apps/gui/skin_engine/wps_internals.h +++ b/apps/gui/skin_engine/wps_internals.h @@ -21,7 +21,7 @@ /* This stuff is for the wps engine only.. anyone caught using this outside * of apps/gui/wps_engine will be shot on site! */ - + #ifndef _WPS_ENGINE_INTERNALS_ #define _WPS_ENGINE_INTERNALS_ @@ -114,9 +114,9 @@ struct progressbar { short width; short height; bool follow_lang_direction; - + OFFSETTYPE(struct gui_img *) image; - + bool invert_fill_direction; bool nofill; bool noborder; @@ -125,7 +125,7 @@ struct progressbar { bool horizontal; OFFSETTYPE(struct gui_img *) backdrop; int setting_id; /* for the setting bar type */ - + }; struct draw_rectangle { @@ -207,7 +207,7 @@ struct touchregion { PRESS, /* quick press only */ LONG_PRESS, /* Long press without repeat */ REPEAT, /* long press allowing repeats */ - } press_length; + } press_length; int action; /* action this button will return */ bool armed; /* A region is armed on press. Only armed regions are triggered on repeat or release. */ @@ -264,12 +264,12 @@ struct skin_albumart { unsigned char xalign; /* WPS_ALBUMART_ALIGN_LEFT, _CENTER, _RIGHT */ unsigned char yalign; /* WPS_ALBUMART_ALIGN_TOP, _CENTER, _BOTTOM */ unsigned char state; /* WPS_ALBUMART_NONE, _CHECK, _LOAD */ - + OFFSETTYPE(struct viewport *) vp; int draw_handle; }; #endif - + struct line { unsigned update_mode; diff --git a/apps/gui/splash.c b/apps/gui/splash.c index 1415d47a70..b85e4693aa 100644 --- a/apps/gui/splash.c +++ b/apps/gui/splash.c @@ -120,7 +120,7 @@ static void splash_internal(struct screen * screen, const char *fmt, va_list ap) vp.y += (vp.height - height) / 2; vp.width = width; vp.height = height; - + vp.flags |= VP_FLAG_ALIGN_CENTER; #if LCD_DEPTH > 1 if (screen->depth > 1) diff --git a/apps/gui/viewport.c b/apps/gui/viewport.c index 9fdf88e8f0..3dd8bca979 100644 --- a/apps/gui/viewport.c +++ b/apps/gui/viewport.c @@ -207,7 +207,7 @@ void viewportmanager_theme_undo(enum screen_type screen, bool force_redraw) int top = --theme_stack_top[screen]; if (top < 0) panicf("Stack underflow... viewportmanager"); - + toggle_theme(screen, force_redraw); } diff --git a/apps/gui/viewport.h b/apps/gui/viewport.h index be80e44721..2810be2ac3 100644 --- a/apps/gui/viewport.h +++ b/apps/gui/viewport.h @@ -55,7 +55,7 @@ void viewportmanager_init(void) INIT_ATTR; void viewportmanager_theme_enable(enum screen_type screen, bool enable, struct viewport *viewport); -/* Force will cause a redraw even if the theme was previously and +/* Force will cause a redraw even if the theme was previously and * currently enabled (i,e the undo doing nothing). * Should almost always be set to false except coming out of fully skinned screens */ void viewportmanager_theme_undo(enum screen_type screen, bool force_redraw); diff --git a/apps/gui/yesno.c b/apps/gui/yesno.c index d70b66f230..e0d8ad457c 100644 --- a/apps/gui/yesno.c +++ b/apps/gui/yesno.c @@ -34,7 +34,7 @@ struct gui_yesno { const struct text_message * main_message; const struct text_message * result_message[2]; - + struct viewport *vp; struct screen * display; }; @@ -63,12 +63,12 @@ static int put_message(struct screen *display, int i; for(i=0; inb_lines && i+startputs_scroll(0, i+start, + display->puts_scroll(0, i+start, P2STR((unsigned char *)message->message_lines[i])); } return i; } - + /* * Draws the yesno * - yn : the yesno structure @@ -87,7 +87,7 @@ static void gui_yesno_draw(struct gui_yesno * yn) if(nb_lines+3< vp_lines) line_shift=1; - + line_shift += put_message(display, yn->main_message, line_shift, vp_lines); #ifdef HAVE_TOUCHSCREEN @@ -216,7 +216,7 @@ enum yesno_res gui_syncyesno_run(const struct text_message * main_message, if (global_settings.talk_menu) { - talk_text_message((result == YESNO_YES) ? yes_message + talk_text_message((result == YESNO_YES) ? yes_message : no_message, false); talk_force_enqueue_next(); } -- cgit v1.2.3