summaryrefslogtreecommitdiff
path: root/firmware/drivers/lcd-h100-remote.c
diff options
context:
space:
mode:
authorTomas Salfischberger <tomas@rockbox.org>2006-01-22 01:42:05 +0000
committerTomas Salfischberger <tomas@rockbox.org>2006-01-22 01:42:05 +0000
commit7fa39df4277fba4b567a57c79a8933afc96d9339 (patch)
tree89b5fcf1e0f6f80828e5ebe41531151b88de4b75 /firmware/drivers/lcd-h100-remote.c
parentee6a95a7d188e4d53f43e35713f0e1c9efe34236 (diff)
downloadrockbox-7fa39df4277fba4b567a57c79a8933afc96d9339.tar.gz
rockbox-7fa39df4277fba4b567a57c79a8933afc96d9339.zip
Horizontal scrolling patch by Shachar Liberman
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@8412 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/drivers/lcd-h100-remote.c')
-rw-r--r--firmware/drivers/lcd-h100-remote.c31
1 files changed, 27 insertions, 4 deletions
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
@@ -1143,6 +1143,17 @@ void lcd_remote_puts(int x, int y, const unsigned char *str)
1143 1143
1144void lcd_remote_puts_style(int x, int y, const unsigned char *str, int style) 1144void lcd_remote_puts_style(int x, int y, const unsigned char *str, int style)
1145{ 1145{
1146 lcd_remote_puts_style_offset(x, y, str, style, 0);
1147}
1148
1149void lcd_remote_puts_offset(int x, int y, const unsigned char *str, int offset)
1150{
1151 lcd_remote_puts_style_offset(x, y, str, STYLE_DEFAULT, offset);
1152}
1153
1154/* put a string at a given char position at a given style and with a given offset */
1155void lcd_remote_puts_style_offset(int x, int y, const unsigned char *str, int style, int offset)
1156{
1146 int xpos,ypos,w,h; 1157 int xpos,ypos,w,h;
1147 int lastmode = drawmode; 1158 int lastmode = drawmode;
1148 1159
@@ -1155,7 +1166,7 @@ void lcd_remote_puts_style(int x, int y, const unsigned char *str, int style)
1155 lcd_remote_getstringsize(str, &w, &h); 1166 lcd_remote_getstringsize(str, &w, &h);
1156 xpos = xmargin + x*w / utf8length((char *)str); 1167 xpos = xmargin + x*w / utf8length((char *)str);
1157 ypos = ymargin + y*h; 1168 ypos = ymargin + y*h;
1158 lcd_remote_putsxy(xpos, ypos, str); 1169 lcd_remote_putsxyofs(xpos, ypos, offset, str);
1159 drawmode = (DRMODE_SOLID|DRMODE_INVERSEVID); 1170 drawmode = (DRMODE_SOLID|DRMODE_INVERSEVID);
1160 lcd_remote_fillrect(xpos + w, ypos, LCD_REMOTE_WIDTH - (xpos + w), h); 1171 lcd_remote_fillrect(xpos + w, ypos, LCD_REMOTE_WIDTH - (xpos + w), h);
1161 if (style & STYLE_INVERT) 1172 if (style & STYLE_INVERT)
@@ -1212,6 +1223,17 @@ void lcd_remote_puts_scroll(int x, int y, const unsigned char *string)
1212 1223
1213void lcd_remote_puts_scroll_style(int x, int y, const unsigned char *string, int style) 1224void lcd_remote_puts_scroll_style(int x, int y, const unsigned char *string, int style)
1214{ 1225{
1226 lcd_remote_puts_scroll_style_offset(x, y, string, style, 0);
1227}
1228
1229void lcd_remote_puts_scroll_offset(int x, int y, const unsigned char *string, int offset)
1230{
1231 lcd_remote_puts_scroll_style_offset(x, y, string, STYLE_DEFAULT, offset);
1232}
1233
1234void lcd_remote_puts_scroll_style_offset(int x, int y, const unsigned char *string,
1235 int style, int offset)
1236{
1215 struct scrollinfo* s; 1237 struct scrollinfo* s;
1216 int w, h; 1238 int w, h;
1217 1239
@@ -1221,10 +1243,10 @@ void lcd_remote_puts_scroll_style(int x, int y, const unsigned char *string, int
1221 s->invert = false; 1243 s->invert = false;
1222 if (style & STYLE_INVERT) { 1244 if (style & STYLE_INVERT) {
1223 s->invert = true; 1245 s->invert = true;
1224 lcd_remote_puts_style(x,y,string,STYLE_INVERT); 1246 lcd_remote_puts_style_offset(x,y,string,STYLE_INVERT,offset);
1225 } 1247 }
1226 else 1248 else
1227 lcd_remote_puts(x,y,string); 1249 lcd_remote_puts_offset(x,y,string,offset);
1228 1250
1229 lcd_remote_getstringsize(string, &w, &h); 1251 lcd_remote_getstringsize(string, &w, &h);
1230 1252
@@ -1257,7 +1279,7 @@ void lcd_remote_puts_scroll_style(int x, int y, const unsigned char *string, int
1257 strncpy(end, (char *)string, LCD_REMOTE_WIDTH/2); 1279 strncpy(end, (char *)string, LCD_REMOTE_WIDTH/2);
1258 1280
1259 s->len = utf8length((char *)string); 1281 s->len = utf8length((char *)string);
1260 s->offset = 0; 1282 s->offset = offset;
1261 s->startx = x; 1283 s->startx = x;
1262 s->backward = false; 1284 s->backward = false;
1263 scrolling_lines |= (1<<y); 1285 scrolling_lines |= (1<<y);
@@ -1267,6 +1289,7 @@ void lcd_remote_puts_scroll_style(int x, int y, const unsigned char *string, int
1267 scrolling_lines &= ~(1<<y); 1289 scrolling_lines &= ~(1<<y);
1268} 1290}
1269 1291
1292
1270static void scroll_thread(void) 1293static void scroll_thread(void)
1271{ 1294{
1272 struct font* pf; 1295 struct font* pf;