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 /apps/gui/gwps-common.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 'apps/gui/gwps-common.c')
-rw-r--r-- | apps/gui/gwps-common.c | 23 |
1 files changed, 5 insertions, 18 deletions
diff --git a/apps/gui/gwps-common.c b/apps/gui/gwps-common.c index 6e159b88b4..b53d68d6ba 100644 --- a/apps/gui/gwps-common.c +++ b/apps/gui/gwps-common.c | |||
@@ -345,7 +345,6 @@ bool gui_wps_display(void) | |||
345 | /* Update the values in the first (default) viewport - in case the user | 345 | /* Update the values in the first (default) viewport - in case the user |
346 | has modified the statusbar or colour settings */ | 346 | has modified the statusbar or colour settings */ |
347 | #ifdef HAVE_LCD_BITMAP | 347 | #ifdef HAVE_LCD_BITMAP |
348 | gui_wps[i].data->viewports[0].vp.ymargin = gui_wps[i].display->getymargin(); | ||
349 | #if LCD_DEPTH > 1 | 348 | #if LCD_DEPTH > 1 |
350 | if (gui_wps[i].display->depth > 1) | 349 | if (gui_wps[i].display->depth > 1) |
351 | { | 350 | { |
@@ -1408,14 +1407,6 @@ static char *get_token_value(struct gui_wps *gwps, | |||
1408 | else | 1407 | else |
1409 | return NULL; | 1408 | return NULL; |
1410 | #endif | 1409 | #endif |
1411 | |||
1412 | #ifdef HAVE_LCD_BITMAP | ||
1413 | case WPS_TOKEN_LEFTMARGIN: | ||
1414 | gwps->display->setmargins(token->value.i, | ||
1415 | gwps->display->getymargin()); | ||
1416 | return NULL; | ||
1417 | #endif | ||
1418 | |||
1419 | default: | 1410 | default: |
1420 | return NULL; | 1411 | return NULL; |
1421 | } | 1412 | } |
@@ -1529,11 +1520,6 @@ static bool get_line(struct gui_wps *gwps, | |||
1529 | align->center = NULL; | 1520 | align->center = NULL; |
1530 | align->right = NULL; | 1521 | align->right = NULL; |
1531 | 1522 | ||
1532 | #ifdef HAVE_LCD_BITMAP | ||
1533 | /* Reset margins - only bitmap targets modify them */ | ||
1534 | gwps->display->setmargins(0, gwps->display->getymargin()); | ||
1535 | #endif | ||
1536 | |||
1537 | /* Process all tokens of the desired subline */ | 1523 | /* Process all tokens of the desired subline */ |
1538 | last_token_idx = wps_last_token_index(data, line, subline); | 1524 | last_token_idx = wps_last_token_index(data, line, subline); |
1539 | for (i = wps_first_token_index(data, line, subline); | 1525 | for (i = wps_first_token_index(data, line, subline); |
@@ -1800,7 +1786,7 @@ static void write_line(struct screen *display, | |||
1800 | ¢er_width, &string_height); | 1786 | ¢er_width, &string_height); |
1801 | } | 1787 | } |
1802 | 1788 | ||
1803 | left_xpos = display->getxmargin(); | 1789 | left_xpos = 0; |
1804 | right_xpos = (display->getwidth() - right_width); | 1790 | right_xpos = (display->getwidth() - right_width); |
1805 | center_xpos = (display->getwidth() + left_xpos - center_width) / 2; | 1791 | center_xpos = (display->getwidth() + left_xpos - center_width) / 2; |
1806 | 1792 | ||
@@ -1885,7 +1871,7 @@ static void write_line(struct screen *display, | |||
1885 | right_width = 0; | 1871 | right_width = 0; |
1886 | } | 1872 | } |
1887 | 1873 | ||
1888 | ypos = (line * string_height) + display->getymargin(); | 1874 | ypos = (line * string_height); |
1889 | 1875 | ||
1890 | 1876 | ||
1891 | if (scroll && ((left_width > scroll_width) || | 1877 | if (scroll && ((left_width > scroll_width) || |
@@ -1968,7 +1954,8 @@ bool gui_wps_refresh(struct gui_wps *gwps, | |||
1968 | /* reset to first subline if refresh all flag is set */ | 1954 | /* reset to first subline if refresh all flag is set */ |
1969 | if (refresh_mode == WPS_REFRESH_ALL) | 1955 | if (refresh_mode == WPS_REFRESH_ALL) |
1970 | { | 1956 | { |
1971 | display->clear_display(); | 1957 | display->set_viewport(&data->viewports[0].vp); |
1958 | display->clear_viewport(); | ||
1972 | 1959 | ||
1973 | for (i = 0; i <= data->num_lines; i++) | 1960 | for (i = 0; i <= data->num_lines; i++) |
1974 | { | 1961 | { |
@@ -2063,7 +2050,7 @@ bool gui_wps_refresh(struct gui_wps *gwps, | |||
2063 | update_line = false; | 2050 | update_line = false; |
2064 | 2051 | ||
2065 | int h = font_get(data->viewports[v].vp.font)->height; | 2052 | int h = font_get(data->viewports[v].vp.font)->height; |
2066 | int peak_meter_y = display->getymargin() + (line - data->viewports[v].first_line)* h; | 2053 | int peak_meter_y = (line - data->viewports[v].first_line)* h; |
2067 | 2054 | ||
2068 | /* The user might decide to have the peak meter in the last | 2055 | /* The user might decide to have the peak meter in the last |
2069 | line so that it is only displayed if no status bar is | 2056 | line so that it is only displayed if no status bar is |