diff options
author | William Wilgus <wilgus.william@gmail.com> | 2020-10-26 12:38:22 -0400 |
---|---|---|
committer | William Wilgus <wilgus.william@gmail.com> | 2020-10-26 12:38:22 -0400 |
commit | 40e98a2e4915464b9306ab7b0f6feb173de095c5 (patch) | |
tree | 4e987640ae4ad201f029c4e26e51ebc61a4549b1 /apps/gui/skin_engine | |
parent | 3237ae4a4ff9296a377ff9194a11038da161208f (diff) | |
download | rockbox-40e98a2e4915464b9306ab7b0f6feb173de095c5.tar.gz rockbox-40e98a2e4915464b9306ab7b0f6feb173de095c5.zip |
Whitespace cleanup on fb_viewport Rewrite
Change-Id: I24aac41c8abecf7b78a44d7f59e842b791be4563
Diffstat (limited to 'apps/gui/skin_engine')
-rw-r--r-- | apps/gui/skin_engine/skin_display.c | 18 | ||||
-rw-r--r-- | apps/gui/skin_engine/skin_render.c | 86 | ||||
-rw-r--r-- | apps/gui/skin_engine/wps_internals.h | 14 |
3 files changed, 59 insertions, 59 deletions
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 | ||
99 | static int ab_calc_mark_x_pos(int mark, int capacity, | 99 | static 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 | ||
127 | void ab_draw_markers(struct screen * screen, int capacity, | 127 | void 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 | */ |
424 | int evaluate_conditional(struct gui_wps *gwps, int offset, | 424 | int 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 | */ |
646 | int skin_wait_for_action(enum skinnable_screens skin, int context, int timeout) | 646 | int 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 | ||
459 | static void fix_line_alignment(struct skin_draw_info *info, struct skin_element *element) | 459 | static 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 */ |
502 | static bool skin_render_line(struct skin_element* line, struct skin_draw_info *info) | 502 | static 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 | ||
131 | struct draw_rectangle { | 131 | struct 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 | ||
274 | struct line { | 274 | struct line { |
275 | unsigned update_mode; | 275 | unsigned update_mode; |