summaryrefslogtreecommitdiff
path: root/apps/gui
diff options
context:
space:
mode:
authorWilliam Wilgus <wilgus.william@gmail.com>2020-10-26 12:38:22 -0400
committerWilliam Wilgus <wilgus.william@gmail.com>2020-10-26 12:38:22 -0400
commit40e98a2e4915464b9306ab7b0f6feb173de095c5 (patch)
tree4e987640ae4ad201f029c4e26e51ebc61a4549b1 /apps/gui
parent3237ae4a4ff9296a377ff9194a11038da161208f (diff)
downloadrockbox-40e98a2e4915464b9306ab7b0f6feb173de095c5.tar.gz
rockbox-40e98a2e4915464b9306ab7b0f6feb173de095c5.zip
Whitespace cleanup on fb_viewport Rewrite
Change-Id: I24aac41c8abecf7b78a44d7f59e842b791be4563
Diffstat (limited to 'apps/gui')
-rw-r--r--apps/gui/pitchscreen.c88
-rw-r--r--apps/gui/skin_engine/skin_display.c18
-rw-r--r--apps/gui/skin_engine/skin_render.c86
-rw-r--r--apps/gui/skin_engine/wps_internals.h14
-rw-r--r--apps/gui/splash.c2
-rw-r--r--apps/gui/viewport.c2
-rw-r--r--apps/gui/viewport.h2
-rw-r--r--apps/gui/yesno.c10
8 files changed, 111 insertions, 111 deletions
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
64}; 64};
65 65
66 66
67/* This is a table of semitone percentage values of the appropriate 67/* This is a table of semitone percentage values of the appropriate
68 precision (based on PITCH_SPEED_PRECISION). Note that these are 68 precision (based on PITCH_SPEED_PRECISION). Note that these are
69 all constant expressions, which will be evaluated at compile time, 69 all constant expressions, which will be evaluated at compile time,
70 so no need to worry about how complex the expressions look. 70 so no need to worry about how complex the expressions look.
71 That's just to get the precision right. 71 That's just to get the precision right.
72 72
73 I calculated these values, starting from 50, as 73 I calculated these values, starting from 50, as
74 74
75 x(n) = 50 * 2^(n/12) 75 x(n) = 50 * 2^(n/12)
76 76
@@ -81,7 +81,7 @@ enum
81*/ 81*/
82#define TO_INT_WITH_PRECISION(x) \ 82#define TO_INT_WITH_PRECISION(x) \
83 ( (unsigned short)(((x) * PITCH_SPEED_PRECISION * 10 + 5) / 10) ) 83 ( (unsigned short)(((x) * PITCH_SPEED_PRECISION * 10 + 5) / 10) )
84 84
85static const unsigned short semitone_table[] = 85static const unsigned short semitone_table[] =
86{ 86{
87 TO_INT_WITH_PRECISION(50.00000000), /* Octave lower */ 87 TO_INT_WITH_PRECISION(50.00000000), /* Octave lower */
@@ -115,12 +115,12 @@ static const unsigned short semitone_table[] =
115#define SEMITONE_END (NUM_SEMITONES/2) 115#define SEMITONE_END (NUM_SEMITONES/2)
116#define SEMITONE_START (-SEMITONE_END) 116#define SEMITONE_START (-SEMITONE_END)
117 117
118/* A table of values for approximating the cent curve with 118/* A table of values for approximating the cent curve with
119 linear interpolation. Multipy the next lowest semitone 119 linear interpolation. Multipy the next lowest semitone
120 by this much to find the corresponding cent percentage. 120 by this much to find the corresponding cent percentage.
121 121
122 These values were calculated as 122 These values were calculated as
123 x(n) = 100 * 2^(n * 20/1200) 123 x(n) = 100 * 2^(n * 20/1200)
124*/ 124*/
125 125
126static const unsigned short cent_interp[] = 126static const unsigned short cent_interp[] =
@@ -308,16 +308,16 @@ static void pitchscreen_draw(struct screen *display, int max_lines,
308 { 308 {
309 snprintf(buf, sizeof(buf), "%s: %s%d.%02d", str(LANG_PITCH), 309 snprintf(buf, sizeof(buf), "%s: %s%d.%02d", str(LANG_PITCH),
310 semitone >= 0 ? "+" : "-", 310 semitone >= 0 ? "+" : "-",
311 abs(semitone / PITCH_SPEED_PRECISION), 311 abs(semitone / PITCH_SPEED_PRECISION),
312 abs((semitone % PITCH_SPEED_PRECISION) / 312 abs((semitone % PITCH_SPEED_PRECISION) /
313 (PITCH_SPEED_PRECISION / 100)) 313 (PITCH_SPEED_PRECISION / 100))
314 ); 314 );
315 } 315 }
316 else 316 else
317 { 317 {
318 snprintf(buf, sizeof(buf), "%s: %ld.%ld%%", str(LANG_PITCH), 318 snprintf(buf, sizeof(buf), "%s: %ld.%ld%%", str(LANG_PITCH),
319 pitch / PITCH_SPEED_PRECISION, 319 pitch / PITCH_SPEED_PRECISION,
320 (pitch % PITCH_SPEED_PRECISION) / 320 (pitch % PITCH_SPEED_PRECISION) /
321 (PITCH_SPEED_PRECISION / 10)); 321 (PITCH_SPEED_PRECISION / 10));
322 } 322 }
323 } 323 }
@@ -337,8 +337,8 @@ static void pitchscreen_draw(struct screen *display, int max_lines,
337 /* "Speed:XXX%" */ 337 /* "Speed:XXX%" */
338 if(global_settings.pitch_mode_timestretch) 338 if(global_settings.pitch_mode_timestretch)
339 { 339 {
340 snprintf(buf, sizeof(buf), "%s: %ld.%ld%%", str(LANG_SPEED), 340 snprintf(buf, sizeof(buf), "%s: %ld.%ld%%", str(LANG_SPEED),
341 speed / PITCH_SPEED_PRECISION, 341 speed / PITCH_SPEED_PRECISION,
342 (speed % PITCH_SPEED_PRECISION) / (PITCH_SPEED_PRECISION / 10)); 342 (speed % PITCH_SPEED_PRECISION) / (PITCH_SPEED_PRECISION / 10));
343 } 343 }
344 else 344 else
@@ -347,23 +347,23 @@ static void pitchscreen_draw(struct screen *display, int max_lines,
347 { 347 {
348 snprintf(buf, sizeof(buf), "%s%d.%02d", 348 snprintf(buf, sizeof(buf), "%s%d.%02d",
349 semitone >= 0 ? "+" : "-", 349 semitone >= 0 ? "+" : "-",
350 abs(semitone / PITCH_SPEED_PRECISION), 350 abs(semitone / PITCH_SPEED_PRECISION),
351 abs((semitone % PITCH_SPEED_PRECISION) / 351 abs((semitone % PITCH_SPEED_PRECISION) /
352 (PITCH_SPEED_PRECISION / 100)) 352 (PITCH_SPEED_PRECISION / 100))
353 ); 353 );
354 } 354 }
355 else 355 else
356 { 356 {
357 snprintf(buf, sizeof(buf), "%ld.%ld%%", 357 snprintf(buf, sizeof(buf), "%ld.%ld%%",
358 pitch / PITCH_SPEED_PRECISION, 358 pitch / PITCH_SPEED_PRECISION,
359 (pitch % PITCH_SPEED_PRECISION) / (PITCH_SPEED_PRECISION / 10)); 359 (pitch % PITCH_SPEED_PRECISION) / (PITCH_SPEED_PRECISION / 10));
360 } 360 }
361 } 361 }
362 362
363 display->getstringsize(buf, &w, &h); 363 display->getstringsize(buf, &w, &h);
364 display->putsxy((pitch_viewports[PITCH_MID].width / 2) - (w / 2), 364 display->putsxy((pitch_viewports[PITCH_MID].width / 2) - (w / 2),
365 show_lang_pitch ? (pitch_viewports[PITCH_MID].height / 2) : 365 show_lang_pitch ? (pitch_viewports[PITCH_MID].height / 2) :
366 (pitch_viewports[PITCH_MID].height / 2) - (h / 2), 366 (pitch_viewports[PITCH_MID].height / 2) - (h / 2),
367 buf); 367 buf);
368 if (w > width_used) 368 if (w > width_used)
369 width_used = w; 369 width_used = w;
@@ -401,8 +401,8 @@ static void pitchscreen_draw(struct screen *display, int max_lines,
401 { 401 {
402 display->putsxy(0, (pitch_viewports[PITCH_MID].height / 2) - (h / 2), 402 display->putsxy(0, (pitch_viewports[PITCH_MID].height / 2) - (h / 2),
403 leftlabel); 403 leftlabel);
404 display->putsxy((pitch_viewports[PITCH_MID].width - w), 404 display->putsxy((pitch_viewports[PITCH_MID].width - w),
405 (pitch_viewports[PITCH_MID].height / 2) - (h / 2), 405 (pitch_viewports[PITCH_MID].height / 2) - (h / 2),
406 rightlabel); 406 rightlabel);
407 } 407 }
408 display->update_viewport(); 408 display->update_viewport();
@@ -421,7 +421,7 @@ static int32_t pitch_increase(int32_t pitch, int32_t pitch_delta, bool allow_cut
421 if (pitch_delta < 0) 421 if (pitch_delta < 0)
422 { 422 {
423 /* for large jumps, snap up to whole numbers */ 423 /* for large jumps, snap up to whole numbers */
424 if(allow_cutoff && pitch_delta <= -PITCH_SPEED_PRECISION && 424 if(allow_cutoff && pitch_delta <= -PITCH_SPEED_PRECISION &&
425 (pitch + pitch_delta) % PITCH_SPEED_PRECISION != 0) 425 (pitch + pitch_delta) % PITCH_SPEED_PRECISION != 0)
426 { 426 {
427 pitch_delta += PITCH_SPEED_PRECISION - ((pitch + pitch_delta) % PITCH_SPEED_PRECISION); 427 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
442 else if (pitch_delta > 0) 442 else if (pitch_delta > 0)
443 { 443 {
444 /* for large jumps, snap down to whole numbers */ 444 /* for large jumps, snap down to whole numbers */
445 if(allow_cutoff && pitch_delta >= PITCH_SPEED_PRECISION && 445 if(allow_cutoff && pitch_delta >= PITCH_SPEED_PRECISION &&
446 (pitch + pitch_delta) % PITCH_SPEED_PRECISION != 0) 446 (pitch + pitch_delta) % PITCH_SPEED_PRECISION != 0)
447 { 447 {
448 pitch_delta -= (pitch + pitch_delta) % PITCH_SPEED_PRECISION; 448 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
480 new_pitch = GET_PITCH(speed, STRETCH_MAX); 480 new_pitch = GET_PITCH(speed, STRETCH_MAX);
481 } 481 }
482 482
483 if(new_stretch >= STRETCH_MAX || 483 if(new_stretch >= STRETCH_MAX ||
484 new_stretch <= STRETCH_MIN) 484 new_stretch <= STRETCH_MIN)
485 { 485 {
486 at_limit = true; 486 at_limit = true;
@@ -505,7 +505,7 @@ static int32_t get_semitone_from_pitch(int32_t pitch)
505 505
506 506
507 /* now find the fractional part */ 507 /* now find the fractional part */
508 while(pitch > (cent_interp[fractional_index + 1] * 508 while(pitch > (cent_interp[fractional_index + 1] *
509 semitone_table[semitone] / PITCH_SPEED_100)) 509 semitone_table[semitone] / PITCH_SPEED_100))
510 { 510 {
511 /* Check to make sure fractional_index isn't too big */ 511 /* Check to make sure fractional_index isn't too big */
@@ -517,17 +517,17 @@ static int32_t get_semitone_from_pitch(int32_t pitch)
517 fractional_index++; 517 fractional_index++;
518 } 518 }
519 519
520 int32_t semitone_pitch_a = cent_interp[fractional_index] * 520 int32_t semitone_pitch_a = cent_interp[fractional_index] *
521 semitone_table[semitone] / 521 semitone_table[semitone] /
522 PITCH_SPEED_100; 522 PITCH_SPEED_100;
523 int32_t semitone_pitch_b = cent_interp[fractional_index + 1] * 523 int32_t semitone_pitch_b = cent_interp[fractional_index + 1] *
524 semitone_table[semitone] / 524 semitone_table[semitone] /
525 PITCH_SPEED_100; 525 PITCH_SPEED_100;
526 /* this will be the integer offset from the cent_interp entry */ 526 /* this will be the integer offset from the cent_interp entry */
527 int32_t semitone_frac_ofs = (pitch - semitone_pitch_a) * CENT_INTERP_INTERVAL / 527 int32_t semitone_frac_ofs = (pitch - semitone_pitch_a) * CENT_INTERP_INTERVAL /
528 (semitone_pitch_b - semitone_pitch_a); 528 (semitone_pitch_b - semitone_pitch_a);
529 semitone = (semitone + SEMITONE_START) * PITCH_SPEED_PRECISION + 529 semitone = (semitone + SEMITONE_START) * PITCH_SPEED_PRECISION +
530 fractional_index * CENT_INTERP_INTERVAL + 530 fractional_index * CENT_INTERP_INTERVAL +
531 semitone_frac_ofs; 531 semitone_frac_ofs;
532 532
533 return semitone; 533 return semitone;
@@ -543,14 +543,14 @@ static int32_t get_pitch_from_semitone(int32_t semitone)
543 /* set pitch to the semitone's integer part value */ 543 /* set pitch to the semitone's integer part value */
544 int32_t pitch = semitone_table[semitone_index]; 544 int32_t pitch = semitone_table[semitone_index];
545 /* get the range of the cent modification for future calculation */ 545 /* get the range of the cent modification for future calculation */
546 int32_t pitch_mod_a = 546 int32_t pitch_mod_a =
547 cent_interp[(adjusted_semitone % PITCH_SPEED_PRECISION) / 547 cent_interp[(adjusted_semitone % PITCH_SPEED_PRECISION) /
548 CENT_INTERP_INTERVAL]; 548 CENT_INTERP_INTERVAL];
549 int32_t pitch_mod_b = 549 int32_t pitch_mod_b =
550 cent_interp[(adjusted_semitone % PITCH_SPEED_PRECISION) / 550 cent_interp[(adjusted_semitone % PITCH_SPEED_PRECISION) /
551 CENT_INTERP_INTERVAL + 1]; 551 CENT_INTERP_INTERVAL + 1];
552 /* figure out the cent mod amount based on the semitone fractional value */ 552 /* figure out the cent mod amount based on the semitone fractional value */
553 int32_t pitch_mod = pitch_mod_a + (pitch_mod_b - pitch_mod_a) * 553 int32_t pitch_mod = pitch_mod_a + (pitch_mod_b - pitch_mod_a) *
554 (adjusted_semitone % CENT_INTERP_INTERVAL) / CENT_INTERP_INTERVAL; 554 (adjusted_semitone % CENT_INTERP_INTERVAL) / CENT_INTERP_INTERVAL;
555 555
556 /* modify pitch based on the mod amount we just calculated */ 556 /* modify pitch based on the mod amount we just calculated */
@@ -558,7 +558,7 @@ static int32_t get_pitch_from_semitone(int32_t semitone)
558} 558}
559 559
560static int32_t pitch_increase_semitone(int32_t pitch, 560static int32_t pitch_increase_semitone(int32_t pitch,
561 int32_t current_semitone, 561 int32_t current_semitone,
562 int32_t semitone_delta 562 int32_t semitone_delta
563 , int32_t speed 563 , int32_t speed
564 ) 564 )
@@ -618,7 +618,7 @@ static int32_t pitch_increase_semitone(int32_t pitch,
618#ifdef HAVE_TOUCHSCREEN 618#ifdef HAVE_TOUCHSCREEN
619/* 619/*
620 * Check for touchscreen presses as per sketch above in this file 620 * Check for touchscreen presses as per sketch above in this file
621 * 621 *
622 * goes through each row of the, checks whether the touchscreen 622 * goes through each row of the, checks whether the touchscreen
623 * was pressed in it. Then it looks the columns of each row for specific actions 623 * was pressed in it. Then it looks the columns of each row for specific actions
624 */ 624 */
@@ -638,7 +638,7 @@ static int pitchscreen_do_touchscreen(struct viewport vps[])
638 if ((x < column || x > (2*column)) && (ret == BUTTON_REL)) 638 if ((x < column || x > (2*column)) && (ret == BUTTON_REL))
639 return ACTION_PS_TOGGLE_MODE; 639 return ACTION_PS_TOGGLE_MODE;
640 640
641 641
642 else if (x >= column && x <= (2*column)) 642 else if (x >= column && x <= (2*column))
643 { /* center column pressed */ 643 { /* center column pressed */
644 if (ret == BUTTON_REPEAT) 644 if (ret == BUTTON_REPEAT)
@@ -828,7 +828,7 @@ int gui_syncpitchscreen_run(void)
828 updated = 0; 828 updated = 0;
829 829
830 button = get_action(CONTEXT_PITCHSCREEN, HZ); 830 button = get_action(CONTEXT_PITCHSCREEN, HZ);
831 831
832#ifdef HAVE_TOUCHSCREEN 832#ifdef HAVE_TOUCHSCREEN
833 if (button == ACTION_TOUCHSCREEN) 833 if (button == ACTION_TOUCHSCREEN)
834 { 834 {
@@ -841,7 +841,7 @@ int gui_syncpitchscreen_run(void)
841 case ACTION_PS_INC_SMALL: 841 case ACTION_PS_INC_SMALL:
842 if(global_settings.pitch_mode_semitone) 842 if(global_settings.pitch_mode_semitone)
843 pitch_delta = SEMITONE_SMALL_DELTA; 843 pitch_delta = SEMITONE_SMALL_DELTA;
844 else 844 else
845 pitch_delta = PITCH_SMALL_DELTA; 845 pitch_delta = PITCH_SMALL_DELTA;
846 updated = 1; 846 updated = 1;
847 break; 847 break;
@@ -849,7 +849,7 @@ int gui_syncpitchscreen_run(void)
849 case ACTION_PS_INC_BIG: 849 case ACTION_PS_INC_BIG:
850 if(global_settings.pitch_mode_semitone) 850 if(global_settings.pitch_mode_semitone)
851 pitch_delta = SEMITONE_BIG_DELTA; 851 pitch_delta = SEMITONE_BIG_DELTA;
852 else 852 else
853 pitch_delta = PITCH_BIG_DELTA; 853 pitch_delta = PITCH_BIG_DELTA;
854 updated = 1; 854 updated = 1;
855 break; 855 break;
@@ -857,7 +857,7 @@ int gui_syncpitchscreen_run(void)
857 case ACTION_PS_DEC_SMALL: 857 case ACTION_PS_DEC_SMALL:
858 if(global_settings.pitch_mode_semitone) 858 if(global_settings.pitch_mode_semitone)
859 pitch_delta = -SEMITONE_SMALL_DELTA; 859 pitch_delta = -SEMITONE_SMALL_DELTA;
860 else 860 else
861 pitch_delta = -PITCH_SMALL_DELTA; 861 pitch_delta = -PITCH_SMALL_DELTA;
862 updated = 1; 862 updated = 1;
863 break; 863 break;
@@ -865,7 +865,7 @@ int gui_syncpitchscreen_run(void)
865 case ACTION_PS_DEC_BIG: 865 case ACTION_PS_DEC_BIG:
866 if(global_settings.pitch_mode_semitone) 866 if(global_settings.pitch_mode_semitone)
867 pitch_delta = -SEMITONE_BIG_DELTA; 867 pitch_delta = -SEMITONE_BIG_DELTA;
868 else 868 else
869 pitch_delta = -PITCH_BIG_DELTA; 869 pitch_delta = -PITCH_BIG_DELTA;
870 updated = 1; 870 updated = 1;
871 break; 871 break;
@@ -1045,7 +1045,7 @@ int gui_syncpitchscreen_run(void)
1045 } 1045 }
1046 1046
1047 new_stretch = GET_STRETCH(pitch, new_speed); 1047 new_stretch = GET_STRETCH(pitch, new_speed);
1048 if(new_stretch >= STRETCH_MAX || 1048 if(new_stretch >= STRETCH_MAX ||
1049 new_stretch <= STRETCH_MIN) 1049 new_stretch <= STRETCH_MIN)
1050 { 1050 {
1051 at_limit = true; 1051 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,
80 unsigned int update_type) 80 unsigned int update_type)
81{ 81{
82 struct gui_wps *gwps = skin_get_gwps(skin, screen); 82 struct gui_wps *gwps = skin_get_gwps(skin, screen);
83 /* This maybe shouldnt be here, 83 /* This maybe shouldnt be here,
84 * This is also safe for skined screen which dont use the id3 */ 84 * This is also safe for skined screen which dont use the id3 */
85 struct mp3entry *id3 = skin_get_global_state()->id3; 85 struct mp3entry *id3 = skin_get_global_state()->id3;
86 bool cuesheet_update = (id3 != NULL ? cuesheet_subtrack_changed(id3) : false); 86 bool cuesheet_update = (id3 != NULL ? cuesheet_subtrack_changed(id3) : false);
87 if (cuesheet_update) 87 if (cuesheet_update)
88 skin_request_full_update(skin); 88 skin_request_full_update(skin);
89 89
90 skin_render(gwps, skin_do_full_update(skin, screen) ? 90 skin_render(gwps, skin_do_full_update(skin, screen) ?
91 SKIN_REFRESH_ALL : update_type); 91 SKIN_REFRESH_ALL : update_type);
92} 92}
93 93
@@ -96,7 +96,7 @@ void skin_update(enum skinnable_screens skin, enum screen_type screen,
96#define DIRECTION_RIGHT 1 96#define DIRECTION_RIGHT 1
97#define DIRECTION_LEFT -1 97#define DIRECTION_LEFT -1
98 98
99static int ab_calc_mark_x_pos(int mark, int capacity, 99static int ab_calc_mark_x_pos(int mark, int capacity,
100 int offset, int size) 100 int offset, int size)
101{ 101{
102 return offset + ( (size * mark) / capacity ); 102 return offset + ( (size * mark) / capacity );
@@ -124,7 +124,7 @@ static void ab_draw_arrow_mark(struct screen * screen,
124 } 124 }
125} 125}
126 126
127void ab_draw_markers(struct screen * screen, int capacity, 127void ab_draw_markers(struct screen * screen, int capacity,
128 int x, int y, int w, int h) 128 int x, int y, int w, int h)
129{ 129{
130 bool a_set, b_set; 130 bool a_set, b_set;
@@ -245,13 +245,13 @@ void draw_progressbar(struct gui_wps *gwps, int line, struct progressbar *pb)
245 length = 1; 245 length = 1;
246 end = 0; 246 end = 0;
247 } 247 }
248 248
249 if (!pb->horizontal) 249 if (!pb->horizontal)
250 { 250 {
251 /* we want to fill upwards which is technically inverted. */ 251 /* we want to fill upwards which is technically inverted. */
252 flags = INVERTFILL; 252 flags = INVERTFILL;
253 } 253 }
254 254
255 if (pb->invert_fill_direction) 255 if (pb->invert_fill_direction)
256 { 256 {
257 flags ^= INVERTFILL; 257 flags ^= INVERTFILL;
@@ -421,7 +421,7 @@ void wps_display_images(struct gui_wps *gwps, struct viewport* vp)
421/* Evaluate the conditional that is at *token_index and return whether a skip 421/* Evaluate the conditional that is at *token_index and return whether a skip
422 has ocurred. *token_index is updated with the new position. 422 has ocurred. *token_index is updated with the new position.
423*/ 423*/
424int evaluate_conditional(struct gui_wps *gwps, int offset, 424int evaluate_conditional(struct gui_wps *gwps, int offset,
425 struct conditional *conditional, int num_options) 425 struct conditional *conditional, int num_options)
426{ 426{
427 if (!gwps) 427 if (!gwps)
@@ -641,7 +641,7 @@ bool skin_has_sbs(enum screen_type screen, struct wps_data *data)
641} 641}
642 642
643/* do the button loop as often as required for the peak meters to update 643/* do the button loop as often as required for the peak meters to update
644 * with a good refresh rate. 644 * with a good refresh rate.
645 */ 645 */
646int skin_wait_for_action(enum skinnable_screens skin, int context, int timeout) 646int skin_wait_for_action(enum skinnable_screens skin, int context, int timeout)
647{ 647{
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 {
60 int line_number; 60 int line_number;
61 unsigned long refresh_type; 61 unsigned long refresh_type;
62 struct line_desc line_desc; 62 struct line_desc line_desc;
63 63
64 char* cur_align_start; 64 char* cur_align_start;
65 struct align_pos align; 65 struct align_pos align;
66 bool no_line_break; 66 bool no_line_break;
67 bool line_scrolls; 67 bool line_scrolls;
68 bool force_redraw; 68 bool force_redraw;
69 bool viewport_change; 69 bool viewport_change;
70 70
71 char *buf; 71 char *buf;
72 size_t buf_size; 72 size_t buf_size;
73 73
74 int offset; /* used by the playlist viewer */ 74 int offset; /* used by the playlist viewer */
75}; 75};
76 76
@@ -102,7 +102,7 @@ static bool do_non_text_tags(struct gui_wps *gwps, struct skin_draw_info *info,
102 bool do_refresh = (element->tag->flags & info->refresh_type) > 0; 102 bool do_refresh = (element->tag->flags & info->refresh_type) > 0;
103 103
104 switch (token->type) 104 switch (token->type)
105 { 105 {
106#if (LCD_DEPTH > 1) || (defined(HAVE_REMOTE_LCD) && (LCD_REMOTE_DEPTH > 1)) 106#if (LCD_DEPTH > 1) || (defined(HAVE_REMOTE_LCD) && (LCD_REMOTE_DEPTH > 1))
107 case SKIN_TOKEN_VIEWPORT_FGCOLOUR: 107 case SKIN_TOKEN_VIEWPORT_FGCOLOUR:
108 { 108 {
@@ -161,7 +161,7 @@ static bool do_non_text_tags(struct gui_wps *gwps, struct skin_draw_info *info,
161 while (viewport) 161 while (viewport)
162 { 162 {
163 struct skin_viewport *skinvp = SKINOFFSETTOPTR(skin_buffer, viewport->data); 163 struct skin_viewport *skinvp = SKINOFFSETTOPTR(skin_buffer, viewport->data);
164 164
165 char *vplabel = SKINOFFSETTOPTR(skin_buffer, skinvp->label); 165 char *vplabel = SKINOFFSETTOPTR(skin_buffer, skinvp->label);
166 if (skinvp->label == VP_DEFAULT_LABEL) 166 if (skinvp->label == VP_DEFAULT_LABEL)
167 vplabel = VP_DEFAULT_LABEL_STRING; 167 vplabel = VP_DEFAULT_LABEL_STRING;
@@ -171,7 +171,7 @@ static bool do_non_text_tags(struct gui_wps *gwps, struct skin_draw_info *info,
171 if (skinvp->hidden_flags&VP_DRAW_HIDDEN) 171 if (skinvp->hidden_flags&VP_DRAW_HIDDEN)
172 { 172 {
173 temp |= VP_DRAW_WASHIDDEN; 173 temp |= VP_DRAW_WASHIDDEN;
174 } 174 }
175 skinvp->hidden_flags = temp; 175 skinvp->hidden_flags = temp;
176 } 176 }
177 viewport = SKINOFFSETTOPTR(skin_buffer, viewport->next); 177 viewport = SKINOFFSETTOPTR(skin_buffer, viewport->next);
@@ -351,7 +351,7 @@ static void do_tags_in_hidden_conditional(struct skin_element* branch,
351 struct wps_data *data = gwps->data; 351 struct wps_data *data = gwps->data;
352 struct viewport *last_vp; 352 struct viewport *last_vp;
353 353
354 /* Tags here are ones which need to be "turned off" or cleared 354 /* Tags here are ones which need to be "turned off" or cleared
355 * if they are in a conditional branch which isnt being used */ 355 * if they are in a conditional branch which isnt being used */
356 if (branch->type == LINE_ALTERNATOR) 356 if (branch->type == LINE_ALTERNATOR)
357 { 357 {
@@ -387,7 +387,7 @@ static void do_tags_in_hidden_conditional(struct skin_element* branch,
387 if (token->type == SKIN_TOKEN_IMAGE_PRELOAD_DISPLAY) 387 if (token->type == SKIN_TOKEN_IMAGE_PRELOAD_DISPLAY)
388 { 388 {
389 struct image_display *id = SKINOFFSETTOPTR(skin_buffer, token->value.data); 389 struct image_display *id = SKINOFFSETTOPTR(skin_buffer, token->value.data);
390 struct gui_img *img = skin_find_item(SKINOFFSETTOPTR(skin_buffer, id->label), 390 struct gui_img *img = skin_find_item(SKINOFFSETTOPTR(skin_buffer, id->label),
391 SKIN_FIND_IMAGE, data); 391 SKIN_FIND_IMAGE, data);
392 clear_image_pos(gwps, img); 392 clear_image_pos(gwps, img);
393 } 393 }
@@ -455,7 +455,7 @@ static void do_tags_in_hidden_conditional(struct skin_element* branch,
455 } 455 }
456 } 456 }
457} 457}
458 458
459static void fix_line_alignment(struct skin_draw_info *info, struct skin_element *element) 459static void fix_line_alignment(struct skin_draw_info *info, struct skin_element *element)
460{ 460{
461 struct align_pos *align = &info->align; 461 struct align_pos *align = &info->align;
@@ -497,16 +497,16 @@ static void fix_line_alignment(struct skin_draw_info *info, struct skin_element
497 break; 497 break;
498 } 498 }
499} 499}
500 500
501/* Draw a LINE element onto the display */ 501/* Draw a LINE element onto the display */
502static bool skin_render_line(struct skin_element* line, struct skin_draw_info *info) 502static bool skin_render_line(struct skin_element* line, struct skin_draw_info *info)
503{ 503{
504 bool needs_update = false; 504 bool needs_update = false;
505 int last_value, value; 505 int last_value, value;
506 506
507 if (line->children_count == 0) 507 if (line->children_count == 0)
508 return false; /* empty line, do nothing */ 508 return false; /* empty line, do nothing */
509 509
510 struct skin_element *child = get_child(line->children, 0); 510 struct skin_element *child = get_child(line->children, 0);
511 struct conditional *conditional; 511 struct conditional *conditional;
512 skin_render_func func = skin_render_line; 512 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
518 case CONDITIONAL: 518 case CONDITIONAL:
519 conditional = SKINOFFSETTOPTR(skin_buffer, child->data); 519 conditional = SKINOFFSETTOPTR(skin_buffer, child->data);
520 last_value = conditional->last_value; 520 last_value = conditional->last_value;
521 value = evaluate_conditional(info->gwps, info->offset, 521 value = evaluate_conditional(info->gwps, info->offset,
522 conditional, child->children_count); 522 conditional, child->children_count);
523 conditional->last_value = value; 523 conditional->last_value = value;
524 if (child->children_count == 1) 524 if (child->children_count == 1)
525 { 525 {
526 /* special handling so 526 /* special handling so
527 * %?aa<true> and %?<true|false> need special handlng here */ 527 * %?aa<true> and %?<true|false> need special handlng here */
528 528
529 if (value == -1) /* tag is false */ 529 if (value == -1) /* tag is false */
530 { 530 {
531 /* we are in a false branch of a %?aa<true> conditional */ 531 /* we are in a false branch of a %?aa<true> conditional */
@@ -545,18 +545,18 @@ static bool skin_render_line(struct skin_element* line, struct skin_draw_info *i
545 } 545 }
546 else if (get_child(child->children, value)->type == LINE) 546 else if (get_child(child->children, value)->type == LINE)
547 func = skin_render_line; 547 func = skin_render_line;
548 548
549 if (value != last_value) 549 if (value != last_value)
550 { 550 {
551 info->refresh_type = SKIN_REFRESH_ALL; 551 info->refresh_type = SKIN_REFRESH_ALL;
552 info->force_redraw = true; 552 info->force_redraw = true;
553 } 553 }
554 554
555 if (func(get_child(child->children, value), info)) 555 if (func(get_child(child->children, value), info))
556 needs_update = true; 556 needs_update = true;
557 else 557 else
558 needs_update = needs_update || (last_value != value); 558 needs_update = needs_update || (last_value != value);
559 559
560 info->refresh_type = old_refresh_mode; 560 info->refresh_type = old_refresh_mode;
561 break; 561 break;
562 case TAG: 562 case TAG:
@@ -564,9 +564,9 @@ static bool skin_render_line(struct skin_element* line, struct skin_draw_info *i
564 info->no_line_break = true; 564 info->no_line_break = true;
565 if (child->tag->type == SKIN_TOKEN_SUBLINE_SCROLL) 565 if (child->tag->type == SKIN_TOKEN_SUBLINE_SCROLL)
566 info->line_scrolls = true; 566 info->line_scrolls = true;
567 567
568 fix_line_alignment(info, child); 568 fix_line_alignment(info, child);
569 569
570 if (!SKINOFFSETTOPTR(skin_buffer, child->data)) 570 if (!SKINOFFSETTOPTR(skin_buffer, child->data))
571 { 571 {
572 break; 572 break;
@@ -583,17 +583,17 @@ static bool skin_render_line(struct skin_element* line, struct skin_draw_info *i
583 if (child->tag->flags&SKIN_RTC_REFRESH) 583 if (child->tag->flags&SKIN_RTC_REFRESH)
584 needs_update = needs_update || info->refresh_type&SKIN_REFRESH_DYNAMIC; 584 needs_update = needs_update || info->refresh_type&SKIN_REFRESH_DYNAMIC;
585#endif 585#endif
586 needs_update = needs_update || 586 needs_update = needs_update ||
587 ((child->tag->flags&info->refresh_type)!=0); 587 ((child->tag->flags&info->refresh_type)!=0);
588 strlcat(info->cur_align_start, valuestr, 588 strlcat(info->cur_align_start, valuestr,
589 info->buf_size - (info->cur_align_start-info->buf)); 589 info->buf_size - (info->cur_align_start-info->buf));
590 } 590 }
591 } 591 }
592 break; 592 break;
593 case TEXT: 593 case TEXT:
594 strlcat(info->cur_align_start, SKINOFFSETTOPTR(skin_buffer, child->data), 594 strlcat(info->cur_align_start, SKINOFFSETTOPTR(skin_buffer, child->data),
595 info->buf_size - (info->cur_align_start-info->buf)); 595 info->buf_size - (info->cur_align_start-info->buf));
596 needs_update = needs_update || 596 needs_update = needs_update ||
597 (info->refresh_type&SKIN_REFRESH_STATIC) != 0; 597 (info->refresh_type&SKIN_REFRESH_STATIC) != 0;
598 break; 598 break;
599 case COMMENT: 599 case COMMENT:
@@ -664,7 +664,7 @@ bool skin_render_alternator(struct skin_element* element, struct skin_draw_info
664 int try_line = start; 664 int try_line = start;
665 bool suitable = false; 665 bool suitable = false;
666 int rettimeout = DEFAULT_SUBLINE_TIME_MULTIPLIER*TIMEOUT_UNIT; 666 int rettimeout = DEFAULT_SUBLINE_TIME_MULTIPLIER*TIMEOUT_UNIT;
667 667
668 /* find a subline which has at least one token in it, 668 /* find a subline which has at least one token in it,
669 * and that line doesnt have a timeout set to 0 through conditionals */ 669 * and that line doesnt have a timeout set to 0 through conditionals */
670 do { 670 do {
@@ -674,7 +674,7 @@ bool skin_render_alternator(struct skin_element* element, struct skin_draw_info
674 if (get_child(element->children, try_line)->children_count != 0) 674 if (get_child(element->children, try_line)->children_count != 0)
675 { 675 {
676 current_line = get_child(element->children, try_line); 676 current_line = get_child(element->children, try_line);
677 rettimeout = get_subline_timeout(info->gwps, 677 rettimeout = get_subline_timeout(info->gwps,
678 get_child(current_line->children, 0)); 678 get_child(current_line->children, 0));
679 if (rettimeout > 0) 679 if (rettimeout > 0)
680 { 680 {
@@ -683,7 +683,7 @@ bool skin_render_alternator(struct skin_element* element, struct skin_draw_info
683 } 683 }
684 } 684 }
685 while (try_line != start && !suitable); 685 while (try_line != start && !suitable);
686 686
687 if (suitable) 687 if (suitable)
688 { 688 {
689 alternator->current_line = try_line; 689 alternator->current_line = try_line;
@@ -749,14 +749,14 @@ void skin_render_viewport(struct skin_element* viewport, struct gui_wps *gwps,
749 if (++info.line_desc.line > info.line_desc.nlines) 749 if (++info.line_desc.line > info.line_desc.nlines)
750 info.line_desc.style = STYLE_DEFAULT; 750 info.line_desc.style = STYLE_DEFAULT;
751 } 751 }
752#endif 752#endif
753#endif 753#endif
754 info.cur_align_start = info.buf; 754 info.cur_align_start = info.buf;
755 align->left = info.buf; 755 align->left = info.buf;
756 align->center = NULL; 756 align->center = NULL;
757 align->right = NULL; 757 align->right = NULL;
758 758
759 759
760 if (line->type == LINE_ALTERNATOR) 760 if (line->type == LINE_ALTERNATOR)
761 func = skin_render_alternator; 761 func = skin_render_alternator;
762 else if (line->type == LINE) 762 else if (line->type == LINE)
@@ -798,11 +798,11 @@ void skin_render(struct gui_wps *gwps, unsigned refresh_mode)
798 const int vp_is_appearing = (VP_DRAW_WASHIDDEN|VP_DRAW_HIDEABLE); 798 const int vp_is_appearing = (VP_DRAW_WASHIDDEN|VP_DRAW_HIDEABLE);
799 struct wps_data *data = gwps->data; 799 struct wps_data *data = gwps->data;
800 struct screen *display = gwps->display; 800 struct screen *display = gwps->display;
801 801
802 struct skin_element* viewport; 802 struct skin_element* viewport;
803 struct skin_viewport* skin_viewport; 803 struct skin_viewport* skin_viewport;
804 char *label; 804 char *label;
805 805
806 int old_refresh_mode = refresh_mode; 806 int old_refresh_mode = refresh_mode;
807 skin_buffer = get_skin_buffer(gwps->data); 807 skin_buffer = get_skin_buffer(gwps->data);
808 808
@@ -828,7 +828,7 @@ void skin_render(struct gui_wps *gwps, unsigned refresh_mode)
828 if (label && SKINOFFSETTOPTR(skin_buffer, viewport->next) && 828 if (label && SKINOFFSETTOPTR(skin_buffer, viewport->next) &&
829 !strcmp(label,VP_DEFAULT_LABEL_STRING)) 829 !strcmp(label,VP_DEFAULT_LABEL_STRING))
830 refresh_mode = 0; 830 refresh_mode = 0;
831 831
832 for (viewport = SKINOFFSETTOPTR(skin_buffer, data->tree); 832 for (viewport = SKINOFFSETTOPTR(skin_buffer, data->tree);
833 viewport; 833 viewport;
834 viewport = SKINOFFSETTOPTR(skin_buffer, viewport->next)) 834 viewport = SKINOFFSETTOPTR(skin_buffer, viewport->next))
@@ -848,7 +848,7 @@ void skin_render(struct gui_wps *gwps, unsigned refresh_mode)
848 skin_backdrop_show(data->backdrop_id); 848 skin_backdrop_show(data->backdrop_id);
849 } 849 }
850#endif 850#endif
851 851
852 /* dont redraw the viewport if its disabled */ 852 /* dont redraw the viewport if its disabled */
853 if (skin_viewport->hidden_flags&VP_NEVER_VISIBLE) 853 if (skin_viewport->hidden_flags&VP_NEVER_VISIBLE)
854 { /* don't draw anything into this one */ 854 { /* don't draw anything into this one */
@@ -864,7 +864,7 @@ void skin_render(struct gui_wps *gwps, unsigned refresh_mode)
864 vp_refresh_mode = SKIN_REFRESH_ALL; 864 vp_refresh_mode = SKIN_REFRESH_ALL;
865 skin_viewport->hidden_flags = VP_DRAW_HIDEABLE; 865 skin_viewport->hidden_flags = VP_DRAW_HIDEABLE;
866 } 866 }
867 867
868 display->set_viewport_ex(&skin_viewport->vp, VP_FLAG_VP_SET_CLEAN); 868 display->set_viewport_ex(&skin_viewport->vp, VP_FLAG_VP_SET_CLEAN);
869 869
870 if ((vp_refresh_mode&SKIN_REFRESH_ALL) == SKIN_REFRESH_ALL) 870 if ((vp_refresh_mode&SKIN_REFRESH_ALL) == SKIN_REFRESH_ALL)
@@ -929,17 +929,17 @@ void skin_render_playlistviewer(struct playlistviewer* viewer,
929 else 929 else
930#endif 930#endif
931 { 931 {
932 struct cuesheet *cue = skin_get_global_state()->id3 ? 932 struct cuesheet *cue = skin_get_global_state()->id3 ?
933 skin_get_global_state()->id3->cuesheet : NULL; 933 skin_get_global_state()->id3->cuesheet : NULL;
934 cur_pos = playlist_get_display_index(); 934 cur_pos = playlist_get_display_index();
935 max = playlist_amount()+1; 935 max = playlist_amount()+1;
936 if (cue) 936 if (cue)
937 max += cue->track_count; 937 max += cue->track_count;
938 start_item = MAX(0, cur_pos + viewer->start_offset); 938 start_item = MAX(0, cur_pos + viewer->start_offset);
939 } 939 }
940 if (max-start_item > nb_lines) 940 if (max-start_item > nb_lines)
941 max = start_item + nb_lines; 941 max = start_item + nb_lines;
942 942
943 line = SKINOFFSETTOPTR(skin_buffer, viewer->line); 943 line = SKINOFFSETTOPTR(skin_buffer, viewer->line);
944 while (start_item < max) 944 while (start_item < max)
945 { 945 {
@@ -947,20 +947,20 @@ void skin_render_playlistviewer(struct playlistviewer* viewer,
947 info.no_line_break = false; 947 info.no_line_break = false;
948 info.line_scrolls = false; 948 info.line_scrolls = false;
949 info.force_redraw = false; 949 info.force_redraw = false;
950 950
951 info.cur_align_start = info.buf; 951 info.cur_align_start = info.buf;
952 align->left = info.buf; 952 align->left = info.buf;
953 align->center = NULL; 953 align->center = NULL;
954 align->right = NULL; 954 align->right = NULL;
955 955
956 956
957 if (line->type == LINE_ALTERNATOR) 957 if (line->type == LINE_ALTERNATOR)
958 func = skin_render_alternator; 958 func = skin_render_alternator;
959 else if (line->type == LINE) 959 else if (line->type == LINE)
960 func = skin_render_line; 960 func = skin_render_line;
961 961
962 needs_update = func(line, &info); 962 needs_update = func(line, &info);
963 963
964 /* only update if the line needs to be, and there is something to write */ 964 /* only update if the line needs to be, and there is something to write */
965 if (refresh_type && needs_update) 965 if (refresh_type && needs_update)
966 { 966 {
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 @@
21 21
22 /* This stuff is for the wps engine only.. anyone caught using this outside 22 /* This stuff is for the wps engine only.. anyone caught using this outside
23 * of apps/gui/wps_engine will be shot on site! */ 23 * of apps/gui/wps_engine will be shot on site! */
24 24
25#ifndef _WPS_ENGINE_INTERNALS_ 25#ifndef _WPS_ENGINE_INTERNALS_
26#define _WPS_ENGINE_INTERNALS_ 26#define _WPS_ENGINE_INTERNALS_
27 27
@@ -114,9 +114,9 @@ struct progressbar {
114 short width; 114 short width;
115 short height; 115 short height;
116 bool follow_lang_direction; 116 bool follow_lang_direction;
117 117
118 OFFSETTYPE(struct gui_img *) image; 118 OFFSETTYPE(struct gui_img *) image;
119 119
120 bool invert_fill_direction; 120 bool invert_fill_direction;
121 bool nofill; 121 bool nofill;
122 bool noborder; 122 bool noborder;
@@ -125,7 +125,7 @@ struct progressbar {
125 bool horizontal; 125 bool horizontal;
126 OFFSETTYPE(struct gui_img *) backdrop; 126 OFFSETTYPE(struct gui_img *) backdrop;
127 int setting_id; /* for the setting bar type */ 127 int setting_id; /* for the setting bar type */
128 128
129}; 129};
130 130
131struct draw_rectangle { 131struct draw_rectangle {
@@ -207,7 +207,7 @@ struct touchregion {
207 PRESS, /* quick press only */ 207 PRESS, /* quick press only */
208 LONG_PRESS, /* Long press without repeat */ 208 LONG_PRESS, /* Long press without repeat */
209 REPEAT, /* long press allowing repeats */ 209 REPEAT, /* long press allowing repeats */
210 } press_length; 210 } press_length;
211 int action; /* action this button will return */ 211 int action; /* action this button will return */
212 bool armed; /* A region is armed on press. Only armed regions are triggered 212 bool armed; /* A region is armed on press. Only armed regions are triggered
213 on repeat or release. */ 213 on repeat or release. */
@@ -264,12 +264,12 @@ struct skin_albumart {
264 unsigned char xalign; /* WPS_ALBUMART_ALIGN_LEFT, _CENTER, _RIGHT */ 264 unsigned char xalign; /* WPS_ALBUMART_ALIGN_LEFT, _CENTER, _RIGHT */
265 unsigned char yalign; /* WPS_ALBUMART_ALIGN_TOP, _CENTER, _BOTTOM */ 265 unsigned char yalign; /* WPS_ALBUMART_ALIGN_TOP, _CENTER, _BOTTOM */
266 unsigned char state; /* WPS_ALBUMART_NONE, _CHECK, _LOAD */ 266 unsigned char state; /* WPS_ALBUMART_NONE, _CHECK, _LOAD */
267 267
268 OFFSETTYPE(struct viewport *) vp; 268 OFFSETTYPE(struct viewport *) vp;
269 int draw_handle; 269 int draw_handle;
270}; 270};
271#endif 271#endif
272 272
273 273
274struct line { 274struct line {
275 unsigned update_mode; 275 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)
120 vp.y += (vp.height - height) / 2; 120 vp.y += (vp.height - height) / 2;
121 vp.width = width; 121 vp.width = width;
122 vp.height = height; 122 vp.height = height;
123 123
124 vp.flags |= VP_FLAG_ALIGN_CENTER; 124 vp.flags |= VP_FLAG_ALIGN_CENTER;
125#if LCD_DEPTH > 1 125#if LCD_DEPTH > 1
126 if (screen->depth > 1) 126 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)
207 int top = --theme_stack_top[screen]; 207 int top = --theme_stack_top[screen];
208 if (top < 0) 208 if (top < 0)
209 panicf("Stack underflow... viewportmanager"); 209 panicf("Stack underflow... viewportmanager");
210 210
211 toggle_theme(screen, force_redraw); 211 toggle_theme(screen, force_redraw);
212} 212}
213 213
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;
55 55
56void viewportmanager_theme_enable(enum screen_type screen, bool enable, 56void viewportmanager_theme_enable(enum screen_type screen, bool enable,
57 struct viewport *viewport); 57 struct viewport *viewport);
58/* Force will cause a redraw even if the theme was previously and 58/* Force will cause a redraw even if the theme was previously and
59 * currently enabled (i,e the undo doing nothing). 59 * currently enabled (i,e the undo doing nothing).
60 * Should almost always be set to false except coming out of fully skinned screens */ 60 * Should almost always be set to false except coming out of fully skinned screens */
61void viewportmanager_theme_undo(enum screen_type screen, bool force_redraw); 61void 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
34{ 34{
35 const struct text_message * main_message; 35 const struct text_message * main_message;
36 const struct text_message * result_message[2]; 36 const struct text_message * result_message[2];
37 37
38 struct viewport *vp; 38 struct viewport *vp;
39 struct screen * display; 39 struct screen * display;
40}; 40};
@@ -63,12 +63,12 @@ static int put_message(struct screen *display,
63 int i; 63 int i;
64 for(i=0; i<message->nb_lines && i+start<max_y; i++) 64 for(i=0; i<message->nb_lines && i+start<max_y; i++)
65 { 65 {
66 display->puts_scroll(0, i+start, 66 display->puts_scroll(0, i+start,
67 P2STR((unsigned char *)message->message_lines[i])); 67 P2STR((unsigned char *)message->message_lines[i]));
68 } 68 }
69 return i; 69 return i;
70} 70}
71 71
72/* 72/*
73 * Draws the yesno 73 * Draws the yesno
74 * - yn : the yesno structure 74 * - yn : the yesno structure
@@ -87,7 +87,7 @@ static void gui_yesno_draw(struct gui_yesno * yn)
87 87
88 if(nb_lines+3< vp_lines) 88 if(nb_lines+3< vp_lines)
89 line_shift=1; 89 line_shift=1;
90 90
91 line_shift += put_message(display, yn->main_message, 91 line_shift += put_message(display, yn->main_message,
92 line_shift, vp_lines); 92 line_shift, vp_lines);
93#ifdef HAVE_TOUCHSCREEN 93#ifdef HAVE_TOUCHSCREEN
@@ -216,7 +216,7 @@ enum yesno_res gui_syncyesno_run(const struct text_message * main_message,
216 216
217 if (global_settings.talk_menu) 217 if (global_settings.talk_menu)
218 { 218 {
219 talk_text_message((result == YESNO_YES) ? yes_message 219 talk_text_message((result == YESNO_YES) ? yes_message
220 : no_message, false); 220 : no_message, false);
221 talk_force_enqueue_next(); 221 talk_force_enqueue_next();
222 } 222 }