diff options
author | Brandon Low <lostlogic@rockbox.org> | 2007-06-17 21:16:34 +0000 |
---|---|---|
committer | Brandon Low <lostlogic@rockbox.org> | 2007-06-17 21:16:34 +0000 |
commit | 74cbb0a1b24a5d2e32d2667b236483b5e7253e98 (patch) | |
tree | 4a9bd83a01bbb822305e3a567362fb3b36dfc28b /firmware/drivers/lcd-16bit.c | |
parent | b57806237d275b54380be5b73e3d783bd6972bf8 (diff) | |
download | rockbox-74cbb0a1b24a5d2e32d2667b236483b5e7253e98.tar.gz rockbox-74cbb0a1b24a5d2e32d2667b236483b5e7253e98.zip |
Give color targets the ability to display each LCD line a different color and use this newfangled ability to provide themable colored file types. See the comments on read_color_theme_file and the sample.colors file provided for how to use this. .colors files go in themes directory for now. This separate line color function should be trivial to add to menus and wpss.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@13656 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/drivers/lcd-16bit.c')
-rw-r--r-- | firmware/drivers/lcd-16bit.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/firmware/drivers/lcd-16bit.c b/firmware/drivers/lcd-16bit.c index 44e42ad617..16c97c9e99 100644 --- a/firmware/drivers/lcd-16bit.c +++ b/firmware/drivers/lcd-16bit.c | |||
@@ -807,6 +807,7 @@ void lcd_puts_style_offset(int x, int y, const unsigned char *str, int style, | |||
807 | { | 807 | { |
808 | int xpos,ypos,w,h,xrect; | 808 | int xpos,ypos,w,h,xrect; |
809 | int lastmode = drawmode; | 809 | int lastmode = drawmode; |
810 | int oldcolor = fg_pattern; | ||
810 | 811 | ||
811 | /* make sure scrolling is turned off on the line we are updating */ | 812 | /* make sure scrolling is turned off on the line we are updating */ |
812 | scrolling_lines &= ~(1 << y); | 813 | scrolling_lines &= ~(1 << y); |
@@ -819,11 +820,15 @@ void lcd_puts_style_offset(int x, int y, const unsigned char *str, int style, | |||
819 | ypos = ymargin + y*h; | 820 | ypos = ymargin + y*h; |
820 | drawmode = (style & STYLE_INVERT) ? | 821 | drawmode = (style & STYLE_INVERT) ? |
821 | (DRMODE_SOLID|DRMODE_INVERSEVID) : DRMODE_SOLID; | 822 | (DRMODE_SOLID|DRMODE_INVERSEVID) : DRMODE_SOLID; |
823 | if (drawmode == DRMODE_SOLID && style & STYLE_COLORED) { | ||
824 | fg_pattern = style & STYLE_COLOR_MASK; | ||
825 | } | ||
822 | lcd_putsxyofs(xpos, ypos, offset, str); | 826 | lcd_putsxyofs(xpos, ypos, offset, str); |
823 | drawmode ^= DRMODE_INVERSEVID; | 827 | drawmode ^= DRMODE_INVERSEVID; |
824 | xrect = xpos + MAX(w - offset, 0); | 828 | xrect = xpos + MAX(w - offset, 0); |
825 | lcd_fillrect(xrect, ypos, LCD_WIDTH - xrect, h); | 829 | lcd_fillrect(xrect, ypos, LCD_WIDTH - xrect, h); |
826 | drawmode = lastmode; | 830 | drawmode = lastmode; |
831 | fg_pattern = oldcolor; | ||
827 | } | 832 | } |
828 | 833 | ||
829 | /*** scrolling ***/ | 834 | /*** scrolling ***/ |
@@ -896,10 +901,8 @@ void lcd_puts_scroll_style_offset(int x, int y, const unsigned char *string, | |||
896 | s->invert = false; | 901 | s->invert = false; |
897 | if (style & STYLE_INVERT) { | 902 | if (style & STYLE_INVERT) { |
898 | s->invert = true; | 903 | s->invert = true; |
899 | lcd_puts_style_offset(x,y,string,STYLE_INVERT,offset); | ||
900 | } | 904 | } |
901 | else | 905 | lcd_puts_style_offset(x,y,string,style,offset); |
902 | lcd_puts_offset(x,y,string,offset); | ||
903 | 906 | ||
904 | lcd_getstringsize(string, &w, &h); | 907 | lcd_getstringsize(string, &w, &h); |
905 | 908 | ||