diff options
author | Jonathan Gordon <rockbox@jdgordon.info> | 2008-06-23 13:20:35 +0000 |
---|---|---|
committer | Jonathan Gordon <rockbox@jdgordon.info> | 2008-06-23 13:20:35 +0000 |
commit | bdbdb97f19655a635a2d37f81f9fe1e31f9162b2 (patch) | |
tree | ea5672478b70e550910bc179a7644afa70c0d057 /firmware/drivers/lcd-2bit-vert.c | |
parent | c1b8df05e1def3096ff6d2ea55f23b2e72936fce (diff) | |
download | rockbox-bdbdb97f19655a635a2d37f81f9fe1e31f9162b2.tar.gz rockbox-bdbdb97f19655a635a2d37f81f9fe1e31f9162b2.zip |
FS#9051 - remove LCD margins... use viewports if you need them...
NOTE to WPS people....
%m has been removed, but (i think) because of the other %m tags it wont fail if you try loading a wps with %m|..|, it will just be ignored.
Also note that if the statusbar is enabled the default viewport is 8 pixels shorter than when its not, i.e (0,0) is really (0,8) if the statusbar is shown... I dont think this will be a major issue because almost no WPS show the bar and use bitmaps... text only WPS shouldnt be affected.
Please report problem screens in http://forums.rockbox.org/index.php?topic=17358.0
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17763 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/drivers/lcd-2bit-vert.c')
-rw-r--r-- | firmware/drivers/lcd-2bit-vert.c | 30 |
1 files changed, 6 insertions, 24 deletions
diff --git a/firmware/drivers/lcd-2bit-vert.c b/firmware/drivers/lcd-2bit-vert.c index d43bf6cc81..285a592893 100644 --- a/firmware/drivers/lcd-2bit-vert.c +++ b/firmware/drivers/lcd-2bit-vert.c | |||
@@ -56,8 +56,6 @@ static struct viewport default_vp = | |||
56 | .height = LCD_HEIGHT, | 56 | .height = LCD_HEIGHT, |
57 | .font = FONT_SYSFIXED, | 57 | .font = FONT_SYSFIXED, |
58 | .drawmode = DRMODE_SOLID, | 58 | .drawmode = DRMODE_SOLID, |
59 | .xmargin = 0, | ||
60 | .ymargin = 0, | ||
61 | .fg_pattern = LCD_DEFAULT_FG, | 59 | .fg_pattern = LCD_DEFAULT_FG, |
62 | .bg_pattern = LCD_DEFAULT_BG | 60 | .bg_pattern = LCD_DEFAULT_BG |
63 | }; | 61 | }; |
@@ -144,22 +142,6 @@ void lcd_set_drawinfo(int mode, unsigned fg_brightness, unsigned bg_brightness) | |||
144 | lcd_set_background(bg_brightness); | 142 | lcd_set_background(bg_brightness); |
145 | } | 143 | } |
146 | 144 | ||
147 | void lcd_setmargins(int x, int y) | ||
148 | { | ||
149 | current_vp->xmargin = x; | ||
150 | current_vp->ymargin = y; | ||
151 | } | ||
152 | |||
153 | int lcd_getxmargin(void) | ||
154 | { | ||
155 | return current_vp->xmargin; | ||
156 | } | ||
157 | |||
158 | int lcd_getymargin(void) | ||
159 | { | ||
160 | return current_vp->ymargin; | ||
161 | } | ||
162 | |||
163 | int lcd_getwidth(void) | 145 | int lcd_getwidth(void) |
164 | { | 146 | { |
165 | return current_vp->width; | 147 | return current_vp->width; |
@@ -1088,8 +1070,8 @@ void lcd_puts_style_offset(int x, int y, const unsigned char *str, | |||
1088 | return; | 1070 | return; |
1089 | 1071 | ||
1090 | lcd_getstringsize(str, &w, &h); | 1072 | lcd_getstringsize(str, &w, &h); |
1091 | xpos = current_vp->xmargin + x*w / utf8length((char *)str); | 1073 | xpos = x*w / utf8length((char *)str); |
1092 | ypos = current_vp->ymargin + y*h; | 1074 | ypos = y*h; |
1093 | current_vp->drawmode = (style & STYLE_INVERT) ? | 1075 | current_vp->drawmode = (style & STYLE_INVERT) ? |
1094 | (DRMODE_SOLID|DRMODE_INVERSEVID) : DRMODE_SOLID; | 1076 | (DRMODE_SOLID|DRMODE_INVERSEVID) : DRMODE_SOLID; |
1095 | lcd_putsxyofs(xpos, ypos, offset, str); | 1077 | lcd_putsxyofs(xpos, ypos, offset, str); |
@@ -1142,7 +1124,7 @@ void lcd_puts_scroll_style_offset(int x, int y, const unsigned char *string, | |||
1142 | 1124 | ||
1143 | lcd_getstringsize(string, &w, &h); | 1125 | lcd_getstringsize(string, &w, &h); |
1144 | 1126 | ||
1145 | if (current_vp->width - x * 8 - current_vp->xmargin < w) { | 1127 | if (current_vp->width - x * 8< w) { |
1146 | /* prepare scroll line */ | 1128 | /* prepare scroll line */ |
1147 | char *end; | 1129 | char *end; |
1148 | 1130 | ||
@@ -1155,7 +1137,7 @@ void lcd_puts_scroll_style_offset(int x, int y, const unsigned char *string, | |||
1155 | /* scroll bidirectional or forward only depending on the string | 1137 | /* scroll bidirectional or forward only depending on the string |
1156 | width */ | 1138 | width */ |
1157 | if ( lcd_scroll_info.bidir_limit ) { | 1139 | if ( lcd_scroll_info.bidir_limit ) { |
1158 | s->bidir = s->width < (current_vp->width - current_vp->xmargin) * | 1140 | s->bidir = s->width < (current_vp->width) * |
1159 | (100 + lcd_scroll_info.bidir_limit) / 100; | 1141 | (100 + lcd_scroll_info.bidir_limit) / 100; |
1160 | } | 1142 | } |
1161 | else | 1143 | else |
@@ -1174,7 +1156,7 @@ void lcd_puts_scroll_style_offset(int x, int y, const unsigned char *string, | |||
1174 | s->y = y; | 1156 | s->y = y; |
1175 | s->len = utf8length((char *)string); | 1157 | s->len = utf8length((char *)string); |
1176 | s->offset = offset; | 1158 | s->offset = offset; |
1177 | s->startx = current_vp->xmargin + x * s->width / s->len; | 1159 | s->startx = x * s->width / s->len; |
1178 | s->backward = false; | 1160 | s->backward = false; |
1179 | 1161 | ||
1180 | lcd_scroll_info.lines++; | 1162 | lcd_scroll_info.lines++; |
@@ -1206,7 +1188,7 @@ void lcd_scroll_fn(void) | |||
1206 | 1188 | ||
1207 | pf = font_get(current_vp->font); | 1189 | pf = font_get(current_vp->font); |
1208 | xpos = s->startx; | 1190 | xpos = s->startx; |
1209 | ypos = current_vp->ymargin + s->y * pf->height; | 1191 | ypos = s->y * pf->height; |
1210 | 1192 | ||
1211 | if (s->bidir) { /* scroll bidirectional */ | 1193 | if (s->bidir) { /* scroll bidirectional */ |
1212 | if (s->offset <= 0) { | 1194 | if (s->offset <= 0) { |