summaryrefslogtreecommitdiffstats
path: root/apps/gui/skin_engine/skin_display.c
diff options
context:
space:
mode:
authorThomas Martitz <kugel@rockbox.org>2013-12-20 23:34:28 +0100
committerThomas Martitz <kugel@rockbox.org>2014-01-07 14:13:40 +0100
commit91ef65306bf4e459f430d6dc44e5923d6b9f8399 (patch)
treefefdfa516c8b061371f7a79ed22647aaec1a1922 /apps/gui/skin_engine/skin_display.c
parenteec89a90ffdd077d687914fe18a9e48028f07fb4 (diff)
downloadrockbox-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-xapps/gui/skin_engine/skin_display.c53
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 @@
#include "settings.h"
#include "scrollbar.h"
#include "screen_access.h"
+#include "line.h"
#include "playlist.h"
#include "audio.h"
#include "tagcache.h"
@@ -393,11 +394,8 @@ int evaluate_conditional(struct gui_wps *gwps, int offset,
scroll indicates whether the line is a scrolling one or not.
*/
void write_line(struct screen *display, struct align_pos *format_align,
- int line, bool scroll, unsigned style)
+ int line, bool scroll, struct line_desc *linedes)
{
-#ifndef HAVE_LCD_BITMAP
- (void)style;
-#endif
int left_width = 0;
int center_width = 0, center_xpos;
int right_width = 0, right_xpos;
@@ -511,16 +509,12 @@ void write_line(struct screen *display, struct align_pos *format_align,
(center_width > scroll_width) ||
(right_width > scroll_width)))
{
-#ifdef HAVE_LCD_BITMAP
- display->puts_scroll_style(0, line,
- (unsigned char *)format_align->left, style);
-#else
- display->puts_scroll(0, line,
- (unsigned char *)format_align->left);
-#endif
+ linedes->scroll = true;
+ display->put_line(0, line * string_height, linedes, (unsigned char *)format_align->left);
}
else
{
+ linedes->scroll = false;
#ifdef HAVE_LCD_BITMAP
/* clear the line first */
display->set_drawmode(DRMODE_SOLID|DRMODE_INVERSEVID);
@@ -532,42 +526,19 @@ void write_line(struct screen *display, struct align_pos *format_align,
which will reset the scroller for that line */
display->puts_scroll(0, line, (unsigned char *)"");
#ifdef HAVE_LCD_BITMAP
- style |= STYLE_XY_PIXELS;
line *= string_height;
+ center_xpos = (viewport_width-center_width)/2;
+ right_xpos = viewport_width-right_width;
+#endif
/* print aligned strings */
if (left_width != 0)
- {
- display->puts_style_xyoffset(0, line,
- (unsigned char *)format_align->left, style, 0, 0);
+ display->put_line(0, line, linedes, format_align->left);
- }
if (center_width != 0)
- {
- display->puts_style_xyoffset((viewport_width-center_width)/2, line,
- (unsigned char *)format_align->center, style, 0, 0);
- }
- if (right_width != 0)
- {
- display->puts_style_xyoffset(viewport_width-right_width, line,
- (unsigned char *)format_align->right, style, 0, 0);
- }
-#else
- if (left_width != 0)
- {
- display->putsxy(0, line,
- (unsigned char *)format_align->left);
- }
- if (center_width != 0)
- {
- display->putsxy(center_xpos, line,
- (unsigned char *)format_align->center);
- }
+ display->put_line(center_xpos, line, linedes, format_align->center);
+
if (right_width != 0)
- {
- display->putsxy(right_xpos, line,
- (unsigned char *)format_align->right);
- }
-#endif
+ display->put_line(right_xpos, line, linedes, format_align->right);
}
}