From 7fa39df4277fba4b567a57c79a8933afc96d9339 Mon Sep 17 00:00:00 2001 From: Tomas Salfischberger Date: Sun, 22 Jan 2006 01:42:05 +0000 Subject: Horizontal scrolling patch by Shachar Liberman git-svn-id: svn://svn.rockbox.org/rockbox/trunk@8412 a1c6a512-1295-4272-9138-f99709370657 --- firmware/drivers/lcd-h100-remote.c | 31 +++++++++++++++++++++++++++---- 1 file changed, 27 insertions(+), 4 deletions(-) (limited to 'firmware/drivers/lcd-h100-remote.c') diff --git a/firmware/drivers/lcd-h100-remote.c b/firmware/drivers/lcd-h100-remote.c index a2fe63ee97..a28cd2f4e5 100644 --- a/firmware/drivers/lcd-h100-remote.c +++ b/firmware/drivers/lcd-h100-remote.c @@ -1142,6 +1142,17 @@ void lcd_remote_puts(int x, int y, const unsigned char *str) } void lcd_remote_puts_style(int x, int y, const unsigned char *str, int style) +{ + lcd_remote_puts_style_offset(x, y, str, style, 0); +} + +void lcd_remote_puts_offset(int x, int y, const unsigned char *str, int offset) +{ + lcd_remote_puts_style_offset(x, y, str, STYLE_DEFAULT, offset); +} + +/* put a string at a given char position at a given style and with a given offset */ +void lcd_remote_puts_style_offset(int x, int y, const unsigned char *str, int style, int offset) { int xpos,ypos,w,h; int lastmode = drawmode; @@ -1155,7 +1166,7 @@ void lcd_remote_puts_style(int x, int y, const unsigned char *str, int style) lcd_remote_getstringsize(str, &w, &h); xpos = xmargin + x*w / utf8length((char *)str); ypos = ymargin + y*h; - lcd_remote_putsxy(xpos, ypos, str); + lcd_remote_putsxyofs(xpos, ypos, offset, str); drawmode = (DRMODE_SOLID|DRMODE_INVERSEVID); lcd_remote_fillrect(xpos + w, ypos, LCD_REMOTE_WIDTH - (xpos + w), h); if (style & STYLE_INVERT) @@ -1211,6 +1222,17 @@ void lcd_remote_puts_scroll(int x, int y, const unsigned char *string) } void lcd_remote_puts_scroll_style(int x, int y, const unsigned char *string, int style) +{ + lcd_remote_puts_scroll_style_offset(x, y, string, style, 0); +} + +void lcd_remote_puts_scroll_offset(int x, int y, const unsigned char *string, int offset) +{ + lcd_remote_puts_scroll_style_offset(x, y, string, STYLE_DEFAULT, offset); +} + +void lcd_remote_puts_scroll_style_offset(int x, int y, const unsigned char *string, + int style, int offset) { struct scrollinfo* s; int w, h; @@ -1221,10 +1243,10 @@ void lcd_remote_puts_scroll_style(int x, int y, const unsigned char *string, int s->invert = false; if (style & STYLE_INVERT) { s->invert = true; - lcd_remote_puts_style(x,y,string,STYLE_INVERT); + lcd_remote_puts_style_offset(x,y,string,STYLE_INVERT,offset); } else - lcd_remote_puts(x,y,string); + lcd_remote_puts_offset(x,y,string,offset); lcd_remote_getstringsize(string, &w, &h); @@ -1257,7 +1279,7 @@ void lcd_remote_puts_scroll_style(int x, int y, const unsigned char *string, int strncpy(end, (char *)string, LCD_REMOTE_WIDTH/2); s->len = utf8length((char *)string); - s->offset = 0; + s->offset = offset; s->startx = x; s->backward = false; scrolling_lines |= (1<