summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTomas Salfischberger <tomas@rockbox.org>2006-01-22 02:14:37 +0000
committerTomas Salfischberger <tomas@rockbox.org>2006-01-22 02:14:37 +0000
commitbfe740712a3513dbb4143336cbc5e9aaab09d732 (patch)
tree367bffa64b985b93d05e29a7732448fd0e725550
parent7fa39df4277fba4b567a57c79a8933afc96d9339 (diff)
downloadrockbox-bfe740712a3513dbb4143336cbc5e9aaab09d732.zip
rockbox-bfe740712a3513dbb4143336cbc5e9aaab09d732.tar.gz
rockbox-bfe740712a3513dbb4143336cbc5e9aaab09d732.tar.bz2
rockbox-bfe740712a3513dbb4143336cbc5e9aaab09d732.tar.xz
Horizontal scrolling patch by Shachar Liberman - Part 2 :)
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@8413 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--firmware/drivers/lcd-16bit.c43
1 files changed, 33 insertions, 10 deletions
diff --git a/firmware/drivers/lcd-16bit.c b/firmware/drivers/lcd-16bit.c
index 6337fa1..b13e4ce 100644
--- a/firmware/drivers/lcd-16bit.c
+++ b/firmware/drivers/lcd-16bit.c
@@ -585,8 +585,26 @@ void lcd_putsxy(int x, int y, const unsigned char *str)
/*** line oriented text output ***/
+/* put a string at a given char position */
+void lcd_puts(int x, int y, const unsigned char *str)
+{
+ lcd_puts_style_offset(x, y, str, STYLE_DEFAULT, 0);
+}
+
void lcd_puts_style(int x, int y, const unsigned char *str, int style)
{
+ lcd_puts_style_offset(x, y, str, style, 0);
+}
+
+void lcd_puts_offset(int x, int y, const unsigned char *str, int offset)
+{
+ lcd_puts_style_offset(x, y, str, STYLE_DEFAULT, offset);
+}
+
+/* put a string at a given char position, style, and pixel position,
+ * skipping first offset pixel columns */
+void lcd_puts_style_offset(int x, int y, const unsigned char *str, int style, int offset)
+{
int xpos,ypos,w,h;
int lastmode = drawmode;
@@ -599,7 +617,7 @@ void lcd_puts_style(int x, int y, const unsigned char *str, int style)
lcd_getstringsize(str, &w, &h);
xpos = xmargin + x*w / utf8length(str);
ypos = ymargin + y*h;
- lcd_putsxy(xpos, ypos, str);
+ lcd_putsxyofs(xpos, ypos, offset, str);
drawmode = (DRMODE_SOLID|DRMODE_INVERSEVID);
(void)style;
lcd_fillrect(xpos + w, ypos, LCD_WIDTH - (xpos + w), h);
@@ -611,12 +629,6 @@ void lcd_puts_style(int x, int y, const unsigned char *str, int style)
drawmode = lastmode;
}
-/* put a string at a given char position */
-void lcd_puts(int x, int y, const unsigned char *str)
-{
- lcd_puts_style(x, y, str, STYLE_DEFAULT);
-}
-
/*** scrolling ***/
/* Reverse the invert setting of the scrolling line (if any) at given char
@@ -663,6 +675,17 @@ void lcd_puts_scroll(int x, int y, const unsigned char *string)
void lcd_puts_scroll_style(int x, int y, const unsigned char *string, int style)
{
+ lcd_puts_scroll_style_offset(x, y, string, style, 0);
+}
+
+void lcd_puts_scroll_offset(int x, int y, const unsigned char *string, int offset)
+{
+ lcd_puts_scroll_style_offset(x, y, string, STYLE_DEFAULT, offset);
+}
+
+void lcd_puts_scroll_style_offset(int x, int y, const unsigned char *string,
+ int style, int offset)
+{
struct scrollinfo* s;
int w, h;
@@ -672,10 +695,10 @@ void lcd_puts_scroll_style(int x, int y, const unsigned char *string, int style)
s->invert = false;
if (style & STYLE_INVERT) {
s->invert = true;
- lcd_puts_style(x,y,string,STYLE_INVERT);
+ lcd_puts_style_offset(x,y,string,STYLE_INVERT,offset);
}
else
- lcd_puts(x,y,string);
+ lcd_puts_offset(x,y,string,offset);
lcd_getstringsize(string, &w, &h);
@@ -708,7 +731,7 @@ void lcd_puts_scroll_style(int x, int y, const unsigned char *string, int style)
strncpy(end, string, LCD_WIDTH/2);
s->len = utf8length(string);
- s->offset = 0;
+ s->offset = offset;
s->startx = x;
s->backward = false;
scrolling_lines |= (1<<y);