diff options
author | Thomas Martitz <kugel@rockbox.org> | 2013-12-20 23:34:28 +0100 |
---|---|---|
committer | Thomas Martitz <kugel@rockbox.org> | 2014-01-07 14:13:40 +0100 |
commit | 91ef65306bf4e459f430d6dc44e5923d6b9f8399 (patch) | |
tree | fefdfa516c8b061371f7a79ed22647aaec1a1922 /apps/gui/skin_engine/skin_display.c | |
parent | eec89a90ffdd077d687914fe18a9e48028f07fb4 (diff) | |
download | rockbox-91ef65306bf4e459f430d6dc44e5923d6b9f8399.tar.gz rockbox-91ef65306bf4e459f430d6dc44e5923d6b9f8399.zip |
skin_engine: Adapt put_line().
This allows for code unification and removal of a workaround (STYLE_XY_PIXELS).
Change-Id: Ie92d377414cad943cdb06976af10b4f315f32710
Diffstat (limited to 'apps/gui/skin_engine/skin_display.c')
-rwxr-xr-x | apps/gui/skin_engine/skin_display.c | 53 |
1 files changed, 12 insertions, 41 deletions
diff --git a/apps/gui/skin_engine/skin_display.c b/apps/gui/skin_engine/skin_display.c index c33e38392d..c2ede75e16 100755 --- a/apps/gui/skin_engine/skin_display.c +++ b/apps/gui/skin_engine/skin_display.c | |||
@@ -40,6 +40,7 @@ | |||
40 | #include "settings.h" | 40 | #include "settings.h" |
41 | #include "scrollbar.h" | 41 | #include "scrollbar.h" |
42 | #include "screen_access.h" | 42 | #include "screen_access.h" |
43 | #include "line.h" | ||
43 | #include "playlist.h" | 44 | #include "playlist.h" |
44 | #include "audio.h" | 45 | #include "audio.h" |
45 | #include "tagcache.h" | 46 | #include "tagcache.h" |
@@ -393,11 +394,8 @@ int evaluate_conditional(struct gui_wps *gwps, int offset, | |||
393 | scroll indicates whether the line is a scrolling one or not. | 394 | scroll indicates whether the line is a scrolling one or not. |
394 | */ | 395 | */ |
395 | void write_line(struct screen *display, struct align_pos *format_align, | 396 | void write_line(struct screen *display, struct align_pos *format_align, |
396 | int line, bool scroll, unsigned style) | 397 | int line, bool scroll, struct line_desc *linedes) |
397 | { | 398 | { |
398 | #ifndef HAVE_LCD_BITMAP | ||
399 | (void)style; | ||
400 | #endif | ||
401 | int left_width = 0; | 399 | int left_width = 0; |
402 | int center_width = 0, center_xpos; | 400 | int center_width = 0, center_xpos; |
403 | int right_width = 0, right_xpos; | 401 | int right_width = 0, right_xpos; |
@@ -511,16 +509,12 @@ void write_line(struct screen *display, struct align_pos *format_align, | |||
511 | (center_width > scroll_width) || | 509 | (center_width > scroll_width) || |
512 | (right_width > scroll_width))) | 510 | (right_width > scroll_width))) |
513 | { | 511 | { |
514 | #ifdef HAVE_LCD_BITMAP | 512 | linedes->scroll = true; |
515 | display->puts_scroll_style(0, line, | 513 | display->put_line(0, line * string_height, linedes, (unsigned char *)format_align->left); |
516 | (unsigned char *)format_align->left, style); | ||
517 | #else | ||
518 | display->puts_scroll(0, line, | ||
519 | (unsigned char *)format_align->left); | ||
520 | #endif | ||
521 | } | 514 | } |
522 | else | 515 | else |
523 | { | 516 | { |
517 | linedes->scroll = false; | ||
524 | #ifdef HAVE_LCD_BITMAP | 518 | #ifdef HAVE_LCD_BITMAP |
525 | /* clear the line first */ | 519 | /* clear the line first */ |
526 | display->set_drawmode(DRMODE_SOLID|DRMODE_INVERSEVID); | 520 | display->set_drawmode(DRMODE_SOLID|DRMODE_INVERSEVID); |
@@ -532,42 +526,19 @@ void write_line(struct screen *display, struct align_pos *format_align, | |||
532 | which will reset the scroller for that line */ | 526 | which will reset the scroller for that line */ |
533 | display->puts_scroll(0, line, (unsigned char *)""); | 527 | display->puts_scroll(0, line, (unsigned char *)""); |
534 | #ifdef HAVE_LCD_BITMAP | 528 | #ifdef HAVE_LCD_BITMAP |
535 | style |= STYLE_XY_PIXELS; | ||
536 | line *= string_height; | 529 | line *= string_height; |
530 | center_xpos = (viewport_width-center_width)/2; | ||
531 | right_xpos = viewport_width-right_width; | ||
532 | #endif | ||
537 | /* print aligned strings */ | 533 | /* print aligned strings */ |
538 | if (left_width != 0) | 534 | if (left_width != 0) |
539 | { | 535 | display->put_line(0, line, linedes, format_align->left); |
540 | display->puts_style_xyoffset(0, line, | ||
541 | (unsigned char *)format_align->left, style, 0, 0); | ||
542 | 536 | ||
543 | } | ||
544 | if (center_width != 0) | 537 | if (center_width != 0) |
545 | { | 538 | display->put_line(center_xpos, line, linedes, format_align->center); |
546 | display->puts_style_xyoffset((viewport_width-center_width)/2, line, | 539 | |
547 | (unsigned char *)format_align->center, style, 0, 0); | ||
548 | } | ||
549 | if (right_width != 0) | ||
550 | { | ||
551 | display->puts_style_xyoffset(viewport_width-right_width, line, | ||
552 | (unsigned char *)format_align->right, style, 0, 0); | ||
553 | } | ||
554 | #else | ||
555 | if (left_width != 0) | ||
556 | { | ||
557 | display->putsxy(0, line, | ||
558 | (unsigned char *)format_align->left); | ||
559 | } | ||
560 | if (center_width != 0) | ||
561 | { | ||
562 | display->putsxy(center_xpos, line, | ||
563 | (unsigned char *)format_align->center); | ||
564 | } | ||
565 | if (right_width != 0) | 540 | if (right_width != 0) |
566 | { | 541 | display->put_line(right_xpos, line, linedes, format_align->right); |
567 | display->putsxy(right_xpos, line, | ||
568 | (unsigned char *)format_align->right); | ||
569 | } | ||
570 | #endif | ||
571 | } | 542 | } |
572 | } | 543 | } |
573 | 544 | ||