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 | |
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')
-rw-r--r-- | apps/debug_menu.c | 16 | ||||
-rw-r--r-- | apps/gui/gwps-common.c | 23 | ||||
-rw-r--r-- | apps/gui/gwps.c | 69 | ||||
-rw-r--r-- | apps/gui/gwps.h | 1 | ||||
-rw-r--r-- | apps/gui/icon.c | 2 | ||||
-rw-r--r-- | apps/gui/statusbar.h | 5 | ||||
-rw-r--r-- | apps/gui/viewport.c | 2 | ||||
-rw-r--r-- | apps/gui/wps_debug.c | 5 | ||||
-rw-r--r-- | apps/gui/wps_parser.c | 69 | ||||
-rw-r--r-- | apps/logfdisp.c | 1 | ||||
-rw-r--r-- | apps/menus/display_menu.c | 3 | ||||
-rw-r--r-- | apps/playlist.c | 9 | ||||
-rw-r--r-- | apps/plugin.c | 29 | ||||
-rw-r--r-- | apps/plugin.h | 20 | ||||
-rw-r--r-- | apps/plugins/solitaire.c | 2 | ||||
-rw-r--r-- | apps/plugins/test_codec.c | 1 | ||||
-rw-r--r-- | apps/plugins/test_disk.c | 1 | ||||
-rw-r--r-- | apps/plugins/test_fps.c | 2 | ||||
-rw-r--r-- | apps/plugins/test_viewports.c | 18 | ||||
-rw-r--r-- | apps/plugins/viewer.c | 4 | ||||
-rw-r--r-- | apps/recorder/recording.c | 53 | ||||
-rw-r--r-- | apps/screen_access.c | 6 | ||||
-rw-r--r-- | apps/screen_access.h | 29 |
23 files changed, 110 insertions, 260 deletions
diff --git a/apps/debug_menu.c b/apps/debug_menu.c index 479ca34995..ab3075afc1 100644 --- a/apps/debug_menu.c +++ b/apps/debug_menu.c | |||
@@ -226,7 +226,6 @@ static bool dbg_audio_thread(void) | |||
226 | char buf[32]; | 226 | char buf[32]; |
227 | struct audio_debug d; | 227 | struct audio_debug d; |
228 | 228 | ||
229 | lcd_setmargins(0, 0); | ||
230 | lcd_setfont(FONT_SYSFIXED); | 229 | lcd_setfont(FONT_SYSFIXED); |
231 | 230 | ||
232 | while(1) | 231 | while(1) |
@@ -299,7 +298,6 @@ static bool dbg_buffering_thread(void) | |||
299 | 298 | ||
300 | tick_add_task(dbg_audio_task); | 299 | tick_add_task(dbg_audio_task); |
301 | 300 | ||
302 | lcd_setmargins(0, 0); | ||
303 | lcd_setfont(FONT_SYSFIXED); | 301 | lcd_setfont(FONT_SYSFIXED); |
304 | while(!done) | 302 | while(!done) |
305 | { | 303 | { |
@@ -521,7 +519,6 @@ static bool dbg_hw_info(void) | |||
521 | 519 | ||
522 | system_memory_guard(oldmode); /* re-enable memory guard */ | 520 | system_memory_guard(oldmode); /* re-enable memory guard */ |
523 | 521 | ||
524 | lcd_setmargins(0, 0); | ||
525 | lcd_setfont(FONT_SYSFIXED); | 522 | lcd_setfont(FONT_SYSFIXED); |
526 | lcd_clear_display(); | 523 | lcd_clear_display(); |
527 | 524 | ||
@@ -572,7 +569,6 @@ static bool dbg_hw_info(void) | |||
572 | 569 | ||
573 | system_memory_guard(oldmode); /* re-enable memory guard */ | 570 | system_memory_guard(oldmode); /* re-enable memory guard */ |
574 | 571 | ||
575 | lcd_setmargins(0, 0); | ||
576 | lcd_setfont(FONT_SYSFIXED); | 572 | lcd_setfont(FONT_SYSFIXED); |
577 | lcd_clear_display(); | 573 | lcd_clear_display(); |
578 | 574 | ||
@@ -623,7 +619,6 @@ static bool dbg_hw_info(void) | |||
623 | (PP_VER1 >> 24) & 0xff, (PP_VER1 >> 16) & 0xff, | 619 | (PP_VER1 >> 24) & 0xff, (PP_VER1 >> 16) & 0xff, |
624 | (PP_VER1 >> 8) & 0xff, (PP_VER1) & 0xff, '\0' }; | 620 | (PP_VER1 >> 8) & 0xff, (PP_VER1) & 0xff, '\0' }; |
625 | 621 | ||
626 | lcd_setmargins(0, 0); | ||
627 | lcd_setfont(FONT_SYSFIXED); | 622 | lcd_setfont(FONT_SYSFIXED); |
628 | lcd_clear_display(); | 623 | lcd_clear_display(); |
629 | 624 | ||
@@ -660,7 +655,6 @@ static bool dbg_hw_info(void) | |||
660 | (PP_VER1 >> 8) & 0xff, PP_VER1 & 0xff, '\0' }; | 655 | (PP_VER1 >> 8) & 0xff, PP_VER1 & 0xff, '\0' }; |
661 | 656 | ||
662 | 657 | ||
663 | lcd_setmargins(0, 0); | ||
664 | lcd_setfont(FONT_SYSFIXED); | 658 | lcd_setfont(FONT_SYSFIXED); |
665 | lcd_clear_display(); | 659 | lcd_clear_display(); |
666 | 660 | ||
@@ -823,7 +817,6 @@ static bool dbg_spdif(void) | |||
823 | int spdif_source = spdif_get_output_source(&spdif_src_on); | 817 | int spdif_source = spdif_get_output_source(&spdif_src_on); |
824 | spdif_set_output_source(AUDIO_SRC_SPDIF IF_SPDIF_POWER_(, true)); | 818 | spdif_set_output_source(AUDIO_SRC_SPDIF IF_SPDIF_POWER_(, true)); |
825 | 819 | ||
826 | lcd_setmargins(0, 0); | ||
827 | lcd_clear_display(); | 820 | lcd_clear_display(); |
828 | lcd_setfont(FONT_SYSFIXED); | 821 | lcd_setfont(FONT_SYSFIXED); |
829 | 822 | ||
@@ -1033,7 +1026,6 @@ bool dbg_ports(void) | |||
1033 | int adc_battery_voltage, adc_battery_level; | 1026 | int adc_battery_voltage, adc_battery_level; |
1034 | 1027 | ||
1035 | lcd_setfont(FONT_SYSFIXED); | 1028 | lcd_setfont(FONT_SYSFIXED); |
1036 | lcd_setmargins(0, 0); | ||
1037 | lcd_clear_display(); | 1029 | lcd_clear_display(); |
1038 | 1030 | ||
1039 | while(1) | 1031 | while(1) |
@@ -1075,7 +1067,6 @@ bool dbg_ports(void) | |||
1075 | char buf[128]; | 1067 | char buf[128]; |
1076 | int line; | 1068 | int line; |
1077 | 1069 | ||
1078 | lcd_setmargins(0, 0); | ||
1079 | lcd_clear_display(); | 1070 | lcd_clear_display(); |
1080 | lcd_setfont(FONT_SYSFIXED); | 1071 | lcd_setfont(FONT_SYSFIXED); |
1081 | 1072 | ||
@@ -1151,7 +1142,6 @@ bool dbg_ports(void) | |||
1151 | char buf[128]; | 1142 | char buf[128]; |
1152 | int line; | 1143 | int line; |
1153 | 1144 | ||
1154 | lcd_setmargins(0, 0); | ||
1155 | lcd_clear_display(); | 1145 | lcd_clear_display(); |
1156 | lcd_setfont(FONT_SYSFIXED); | 1146 | lcd_setfont(FONT_SYSFIXED); |
1157 | 1147 | ||
@@ -1248,7 +1238,6 @@ bool dbg_ports(void) | |||
1248 | char buf[128]; | 1238 | char buf[128]; |
1249 | int line; | 1239 | int line; |
1250 | 1240 | ||
1251 | lcd_setmargins(0, 0); | ||
1252 | lcd_clear_display(); | 1241 | lcd_clear_display(); |
1253 | lcd_setfont(FONT_SYSFIXED); | 1242 | lcd_setfont(FONT_SYSFIXED); |
1254 | 1243 | ||
@@ -1374,7 +1363,6 @@ static bool dbg_pcf(void) | |||
1374 | int line; | 1363 | int line; |
1375 | 1364 | ||
1376 | #ifdef HAVE_LCD_BITMAP | 1365 | #ifdef HAVE_LCD_BITMAP |
1377 | lcd_setmargins(0, 0); | ||
1378 | lcd_setfont(FONT_SYSFIXED); | 1366 | lcd_setfont(FONT_SYSFIXED); |
1379 | #endif | 1367 | #endif |
1380 | lcd_clear_display(); | 1368 | lcd_clear_display(); |
@@ -1429,7 +1417,6 @@ static bool dbg_cpufreq(void) | |||
1429 | int button; | 1417 | int button; |
1430 | 1418 | ||
1431 | #ifdef HAVE_LCD_BITMAP | 1419 | #ifdef HAVE_LCD_BITMAP |
1432 | lcd_setmargins(0, 0); | ||
1433 | lcd_setfont(FONT_SYSFIXED); | 1420 | lcd_setfont(FONT_SYSFIXED); |
1434 | #endif | 1421 | #endif |
1435 | lcd_clear_display(); | 1422 | lcd_clear_display(); |
@@ -1559,7 +1546,6 @@ static bool view_battery(void) | |||
1559 | unsigned short maxv, minv; | 1546 | unsigned short maxv, minv; |
1560 | char buf[32]; | 1547 | char buf[32]; |
1561 | 1548 | ||
1562 | lcd_setmargins(0, 0); | ||
1563 | lcd_setfont(FONT_SYSFIXED); | 1549 | lcd_setfont(FONT_SYSFIXED); |
1564 | 1550 | ||
1565 | while(1) | 1551 | while(1) |
@@ -2316,7 +2302,6 @@ static bool cpu_boost_log(void) | |||
2316 | int lines = LCD_HEIGHT/SYSFONT_HEIGHT; | 2302 | int lines = LCD_HEIGHT/SYSFONT_HEIGHT; |
2317 | char *str; | 2303 | char *str; |
2318 | bool done; | 2304 | bool done; |
2319 | lcd_setmargins(0, 0); | ||
2320 | lcd_setfont(FONT_SYSFIXED); | 2305 | lcd_setfont(FONT_SYSFIXED); |
2321 | str = cpu_boost_log_getlog_first(); | 2306 | str = cpu_boost_log_getlog_first(); |
2322 | while (i < count) | 2307 | while (i < count) |
@@ -2369,7 +2354,6 @@ static bool dbg_scrollwheel(void) | |||
2369 | char buf[64]; | 2354 | char buf[64]; |
2370 | unsigned int speed; | 2355 | unsigned int speed; |
2371 | 2356 | ||
2372 | lcd_setmargins(0, 0); | ||
2373 | lcd_setfont(FONT_SYSFIXED); | 2357 | lcd_setfont(FONT_SYSFIXED); |
2374 | 2358 | ||
2375 | while (1) | 2359 | while (1) |
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 |
diff --git a/apps/gui/gwps.c b/apps/gui/gwps.c index 5426c937c0..31b1989786 100644 --- a/apps/gui/gwps.c +++ b/apps/gui/gwps.c | |||
@@ -77,19 +77,6 @@ static void gui_wps_set_disp(struct gui_wps *gui_wps, struct screen *display); | |||
77 | /* connects a wps with a statusbar*/ | 77 | /* connects a wps with a statusbar*/ |
78 | static void gui_wps_set_statusbar(struct gui_wps *gui_wps, struct gui_statusbar *statusbar); | 78 | static void gui_wps_set_statusbar(struct gui_wps *gui_wps, struct gui_statusbar *statusbar); |
79 | 79 | ||
80 | #ifdef HAVE_LCD_BITMAP | ||
81 | static void gui_wps_set_margin(struct gui_wps *gwps) | ||
82 | { | ||
83 | int offset = 0; | ||
84 | struct wps_data *data = gwps->data; | ||
85 | if(data->wps_sb_tag && data->show_sb_on_wps) | ||
86 | offset = STATUSBAR_HEIGHT; | ||
87 | else if ( global_settings.statusbar && !data->wps_sb_tag) | ||
88 | offset = STATUSBAR_HEIGHT; | ||
89 | gwps->display->setmargins(0, offset); | ||
90 | } | ||
91 | #endif | ||
92 | |||
93 | static void prev_track(unsigned skip_thresh) | 80 | static void prev_track(unsigned skip_thresh) |
94 | { | 81 | { |
95 | if (!wps_state.id3 || (wps_state.id3->elapsed < skip_thresh*1000)) { | 82 | if (!wps_state.id3 || (wps_state.id3->elapsed < skip_thresh*1000)) { |
@@ -152,10 +139,6 @@ long gui_wps_show(void) | |||
152 | status_set_audio(true); | 139 | status_set_audio(true); |
153 | status_set_param(false); | 140 | status_set_param(false); |
154 | #else | 141 | #else |
155 | FOR_NB_SCREENS(i) | ||
156 | { | ||
157 | gui_wps_set_margin(&gui_wps[i]); | ||
158 | } | ||
159 | #if LCD_DEPTH > 1 | 142 | #if LCD_DEPTH > 1 |
160 | show_wps_backdrop(); | 143 | show_wps_backdrop(); |
161 | #endif /* LCD_DEPTH > 1 */ | 144 | #endif /* LCD_DEPTH > 1 */ |
@@ -299,12 +282,6 @@ long gui_wps_show(void) | |||
299 | #if defined(HAVE_REMOTE_LCD) && LCD_REMOTE_DEPTH > 1 | 282 | #if defined(HAVE_REMOTE_LCD) && LCD_REMOTE_DEPTH > 1 |
300 | show_remote_wps_backdrop(); | 283 | show_remote_wps_backdrop(); |
301 | #endif | 284 | #endif |
302 | #ifdef HAVE_LCD_BITMAP | ||
303 | FOR_NB_SCREENS(i) | ||
304 | { | ||
305 | gui_wps_set_margin(&gui_wps[i]); | ||
306 | } | ||
307 | #endif | ||
308 | restore = true; | 285 | restore = true; |
309 | break; | 286 | break; |
310 | 287 | ||
@@ -558,12 +535,6 @@ long gui_wps_show(void) | |||
558 | #if defined(HAVE_REMOTE_LCD) && LCD_REMOTE_DEPTH > 1 | 535 | #if defined(HAVE_REMOTE_LCD) && LCD_REMOTE_DEPTH > 1 |
559 | show_remote_wps_backdrop(); | 536 | show_remote_wps_backdrop(); |
560 | #endif | 537 | #endif |
561 | #ifdef HAVE_LCD_BITMAP | ||
562 | FOR_NB_SCREENS(i) | ||
563 | { | ||
564 | gui_wps_set_margin(&gui_wps[i]); | ||
565 | } | ||
566 | #endif | ||
567 | restore = true; | 538 | restore = true; |
568 | break; | 539 | break; |
569 | #endif /* HAVE_QUICKSCREEN */ | 540 | #endif /* HAVE_QUICKSCREEN */ |
@@ -579,12 +550,6 @@ long gui_wps_show(void) | |||
579 | #endif | 550 | #endif |
580 | if (quick_screen_f3(BUTTON_F3)) | 551 | if (quick_screen_f3(BUTTON_F3)) |
581 | return SYS_USB_CONNECTED; | 552 | return SYS_USB_CONNECTED; |
582 | #ifdef HAVE_LCD_BITMAP | ||
583 | FOR_NB_SCREENS(i) | ||
584 | { | ||
585 | gui_wps_set_margin(&gui_wps[i]); | ||
586 | } | ||
587 | #endif | ||
588 | restore = true; | 553 | restore = true; |
589 | break; | 554 | break; |
590 | #endif /* BUTTON_F3 */ | 555 | #endif /* BUTTON_F3 */ |
@@ -643,12 +608,6 @@ long gui_wps_show(void) | |||
643 | #if defined(HAVE_REMOTE_LCD) && LCD_REMOTE_DEPTH > 1 | 608 | #if defined(HAVE_REMOTE_LCD) && LCD_REMOTE_DEPTH > 1 |
644 | show_remote_wps_backdrop(); | 609 | show_remote_wps_backdrop(); |
645 | #endif | 610 | #endif |
646 | #ifdef HAVE_LCD_BITMAP | ||
647 | FOR_NB_SCREENS(i) | ||
648 | { | ||
649 | gui_wps_set_margin(&gui_wps[i]); | ||
650 | } | ||
651 | #endif | ||
652 | restore = true; | 611 | restore = true; |
653 | break; | 612 | break; |
654 | 613 | ||
@@ -812,7 +771,32 @@ void gui_sync_wps_screen_init(void) | |||
812 | FOR_NB_SCREENS(i) | 771 | FOR_NB_SCREENS(i) |
813 | gui_wps_set_disp(&gui_wps[i], &screens[i]); | 772 | gui_wps_set_disp(&gui_wps[i], &screens[i]); |
814 | } | 773 | } |
774 | #ifdef HAVE_LCD_BITMAP | ||
775 | static void statusbar_toggle_handler(void *data) | ||
776 | { | ||
777 | (void)data; | ||
778 | int i; | ||
779 | bool draw = global_settings.statusbar; | ||
815 | 780 | ||
781 | FOR_NB_SCREENS(i) | ||
782 | { | ||
783 | struct wps_viewport *vp = &gui_wps[i].data->viewports[0]; | ||
784 | if (gui_wps[i].data->wps_sb_tag) | ||
785 | draw = gui_wps[i].data->show_sb_on_wps; | ||
786 | if (!global_settings.statusbar && !draw) | ||
787 | { | ||
788 | vp->vp.y = 0; | ||
789 | vp->vp.height = screens[i].height; | ||
790 | } | ||
791 | else | ||
792 | { | ||
793 | vp->vp.y = STATUSBAR_HEIGHT; | ||
794 | vp->vp.height = screens[i].height - STATUSBAR_HEIGHT; | ||
795 | } | ||
796 | } | ||
797 | } | ||
798 | #endif | ||
799 | |||
816 | void gui_sync_wps_init(void) | 800 | void gui_sync_wps_init(void) |
817 | { | 801 | { |
818 | int i; | 802 | int i; |
@@ -826,6 +810,9 @@ void gui_sync_wps_init(void) | |||
826 | gui_wps_set_data(&gui_wps[i], &wps_datas[i]); | 810 | gui_wps_set_data(&gui_wps[i], &wps_datas[i]); |
827 | gui_wps_set_statusbar(&gui_wps[i], &statusbars.statusbars[i]); | 811 | gui_wps_set_statusbar(&gui_wps[i], &statusbars.statusbars[i]); |
828 | } | 812 | } |
813 | #ifdef HAVE_LCD_BITMAP | ||
814 | add_event(STATUSBAR_TOGGLE_EVENT, false, statusbar_toggle_handler); | ||
815 | #endif | ||
829 | #if LCD_DEPTH > 1 | 816 | #if LCD_DEPTH > 1 |
830 | unload_wps_backdrop(); | 817 | unload_wps_backdrop(); |
831 | #endif | 818 | #endif |
diff --git a/apps/gui/gwps.h b/apps/gui/gwps.h index 25cfc08505..ad0c4a53c4 100644 --- a/apps/gui/gwps.h +++ b/apps/gui/gwps.h | |||
@@ -136,7 +136,6 @@ enum wps_token_type { | |||
136 | WPS_TOKEN_ALIGN_LEFT, | 136 | WPS_TOKEN_ALIGN_LEFT, |
137 | WPS_TOKEN_ALIGN_CENTER, | 137 | WPS_TOKEN_ALIGN_CENTER, |
138 | WPS_TOKEN_ALIGN_RIGHT, | 138 | WPS_TOKEN_ALIGN_RIGHT, |
139 | WPS_TOKEN_LEFTMARGIN, | ||
140 | 139 | ||
141 | /* Sublines */ | 140 | /* Sublines */ |
142 | WPS_TOKEN_SUBLINE_TIMEOUT, | 141 | WPS_TOKEN_SUBLINE_TIMEOUT, |
diff --git a/apps/gui/icon.c b/apps/gui/icon.c index 968d83548f..c8ac48de92 100644 --- a/apps/gui/icon.c +++ b/apps/gui/icon.c | |||
@@ -103,7 +103,7 @@ void screen_put_icon_with_offset(struct screen * display, | |||
103 | int screen = display->screen_type; | 103 | int screen = display->screen_type; |
104 | display->getstringsize((unsigned char *)"M", &width, &height); | 104 | display->getstringsize((unsigned char *)"M", &width, &height); |
105 | xpos = x*ICON_WIDTH(screen) + off_x; | 105 | xpos = x*ICON_WIDTH(screen) + off_x; |
106 | ypos = y*height + display->getymargin() + off_y; | 106 | ypos = y*height + off_y; |
107 | 107 | ||
108 | if ( height > ICON_HEIGHT(screen) )/* center the cursor */ | 108 | if ( height > ICON_HEIGHT(screen) )/* center the cursor */ |
109 | ypos += (height - ICON_HEIGHT(screen)) / 2; | 109 | ypos += (height - ICON_HEIGHT(screen)) / 2; |
diff --git a/apps/gui/statusbar.h b/apps/gui/statusbar.h index 989d1cbe3c..57be2b1873 100644 --- a/apps/gui/statusbar.h +++ b/apps/gui/statusbar.h | |||
@@ -22,11 +22,16 @@ | |||
22 | 22 | ||
23 | #include "status.h" | 23 | #include "status.h" |
24 | #include "screen_access.h" | 24 | #include "screen_access.h" |
25 | #include "events.h" | ||
25 | 26 | ||
26 | #define STATUSBAR_X_POS 0 | 27 | #define STATUSBAR_X_POS 0 |
27 | #define STATUSBAR_Y_POS 0 /* MUST be a multiple of 8 */ | 28 | #define STATUSBAR_Y_POS 0 /* MUST be a multiple of 8 */ |
28 | #define STATUSBAR_HEIGHT 8 | 29 | #define STATUSBAR_HEIGHT 8 |
29 | 30 | ||
31 | /* possibly a horrible misuse of the event system. | ||
32 | This is triggered when the statusbar setting changes */ | ||
33 | #define STATUSBAR_TOGGLE_EVENT (EVENT_CLASS_GUI|1) | ||
34 | |||
30 | struct status_info { | 35 | struct status_info { |
31 | int battlevel; | 36 | int battlevel; |
32 | int batt_charge_step; | 37 | int batt_charge_step; |
diff --git a/apps/gui/viewport.c b/apps/gui/viewport.c index fbf520eed7..8f9998b2d6 100644 --- a/apps/gui/viewport.c +++ b/apps/gui/viewport.c | |||
@@ -45,8 +45,6 @@ int viewport_get_nb_lines(struct viewport *vp) | |||
45 | 45 | ||
46 | void viewport_set_defaults(struct viewport *vp, enum screen_type screen) | 46 | void viewport_set_defaults(struct viewport *vp, enum screen_type screen) |
47 | { | 47 | { |
48 | vp->xmargin = 0; | ||
49 | vp->ymargin = 0; | ||
50 | vp->x = 0; | 48 | vp->x = 0; |
51 | vp->width = screens[screen].width; | 49 | vp->width = screens[screen].width; |
52 | 50 | ||
diff --git a/apps/gui/wps_debug.c b/apps/gui/wps_debug.c index 4fa12167f2..f5ac27ade3 100644 --- a/apps/gui/wps_debug.c +++ b/apps/gui/wps_debug.c | |||
@@ -79,11 +79,6 @@ static char *get_token_desc(struct wps_token *token, struct wps_data *data, | |||
79 | case WPS_TOKEN_ALIGN_RIGHT: | 79 | case WPS_TOKEN_ALIGN_RIGHT: |
80 | snprintf(buf, bufsize, "align right"); | 80 | snprintf(buf, bufsize, "align right"); |
81 | break; | 81 | break; |
82 | |||
83 | case WPS_TOKEN_LEFTMARGIN: | ||
84 | snprintf(buf, bufsize, "left margin, value: %d", | ||
85 | token->value.i); | ||
86 | break; | ||
87 | #endif | 82 | #endif |
88 | 83 | ||
89 | case WPS_TOKEN_SUBLINE_TIMEOUT: | 84 | case WPS_TOKEN_SUBLINE_TIMEOUT: |
diff --git a/apps/gui/wps_parser.c b/apps/gui/wps_parser.c index c6b0d447e9..805379152f 100644 --- a/apps/gui/wps_parser.c +++ b/apps/gui/wps_parser.c | |||
@@ -133,8 +133,6 @@ static int parse_viewport_display(const char *wps_bufptr, | |||
133 | struct wps_token *token, struct wps_data *wps_data); | 133 | struct wps_token *token, struct wps_data *wps_data); |
134 | static int parse_viewport(const char *wps_bufptr, | 134 | static int parse_viewport(const char *wps_bufptr, |
135 | struct wps_token *token, struct wps_data *wps_data); | 135 | struct wps_token *token, struct wps_data *wps_data); |
136 | static int parse_leftmargin(const char *wps_bufptr, | ||
137 | struct wps_token *token, struct wps_data *wps_data); | ||
138 | static int parse_statusbar_enable(const char *wps_bufptr, | 136 | static int parse_statusbar_enable(const char *wps_bufptr, |
139 | struct wps_token *token, struct wps_data *wps_data); | 137 | struct wps_token *token, struct wps_data *wps_data); |
140 | static int parse_statusbar_disable(const char *wps_bufptr, | 138 | static int parse_statusbar_disable(const char *wps_bufptr, |
@@ -273,10 +271,6 @@ static const struct wps_tag all_tags[] = { | |||
273 | { WPS_TOKEN_PLAYBACK_STATUS, "mp", WPS_REFRESH_DYNAMIC, NULL }, | 271 | { WPS_TOKEN_PLAYBACK_STATUS, "mp", WPS_REFRESH_DYNAMIC, NULL }, |
274 | 272 | ||
275 | #ifdef HAVE_LCD_BITMAP | 273 | #ifdef HAVE_LCD_BITMAP |
276 | { WPS_TOKEN_LEFTMARGIN, "m", 0, parse_leftmargin }, | ||
277 | #endif | ||
278 | |||
279 | #ifdef HAVE_LCD_BITMAP | ||
280 | { WPS_TOKEN_PEAKMETER, "pm", WPS_REFRESH_PEAK_METER, NULL }, | 274 | { WPS_TOKEN_PEAKMETER, "pm", WPS_REFRESH_PEAK_METER, NULL }, |
281 | #else | 275 | #else |
282 | { WPS_TOKEN_PLAYER_PROGRESSBAR, "pf", | 276 | { WPS_TOKEN_PLAYER_PROGRESSBAR, "pf", |
@@ -368,6 +362,11 @@ static int parse_statusbar_enable(const char *wps_bufptr, | |||
368 | (void)token; /* Kill warnings */ | 362 | (void)token; /* Kill warnings */ |
369 | wps_data->wps_sb_tag = true; | 363 | wps_data->wps_sb_tag = true; |
370 | wps_data->show_sb_on_wps = true; | 364 | wps_data->show_sb_on_wps = true; |
365 | if (wps_data->viewports[0].vp.y == 0) | ||
366 | { | ||
367 | wps_data->viewports[0].vp.y = STATUSBAR_HEIGHT; | ||
368 | wps_data->viewports[0].vp.height -= STATUSBAR_HEIGHT; | ||
369 | } | ||
371 | return skip_end_of_line(wps_bufptr); | 370 | return skip_end_of_line(wps_bufptr); |
372 | } | 371 | } |
373 | 372 | ||
@@ -378,6 +377,11 @@ static int parse_statusbar_disable(const char *wps_bufptr, | |||
378 | (void)token; /* Kill warnings */ | 377 | (void)token; /* Kill warnings */ |
379 | wps_data->wps_sb_tag = true; | 378 | wps_data->wps_sb_tag = true; |
380 | wps_data->show_sb_on_wps = false; | 379 | wps_data->show_sb_on_wps = false; |
380 | if (wps_data->viewports[0].vp.y == STATUSBAR_HEIGHT) | ||
381 | { | ||
382 | wps_data->viewports[0].vp.y = 0; | ||
383 | wps_data->viewports[0].vp.height += STATUSBAR_HEIGHT; | ||
384 | } | ||
381 | return skip_end_of_line(wps_bufptr); | 385 | return skip_end_of_line(wps_bufptr); |
382 | } | 386 | } |
383 | 387 | ||
@@ -616,8 +620,6 @@ static int parse_viewport(const char *wps_bufptr, | |||
616 | 620 | ||
617 | /* Set the defaults for fields not user-specified */ | 621 | /* Set the defaults for fields not user-specified */ |
618 | vp->drawmode = DRMODE_SOLID; | 622 | vp->drawmode = DRMODE_SOLID; |
619 | vp->xmargin = 0; | ||
620 | vp->ymargin = 0; | ||
621 | 623 | ||
622 | /* Work out the depth of this display */ | 624 | /* Work out the depth of this display */ |
623 | #ifdef HAVE_REMOTE_LCD | 625 | #ifdef HAVE_REMOTE_LCD |
@@ -818,16 +820,6 @@ static int parse_progressbar(const char *wps_bufptr, | |||
818 | int line_y_pos = font_height*(wps_data->num_lines - | 820 | int line_y_pos = font_height*(wps_data->num_lines - |
819 | wps_data->viewports[wps_data->num_viewports].first_line); | 821 | wps_data->viewports[wps_data->num_viewports].first_line); |
820 | 822 | ||
821 | /** Remove this bit when the remove lcd margins patch goes in **/ | ||
822 | bool draw_sb = global_settings.statusbar; | ||
823 | |||
824 | if (wps_data->wps_sb_tag) | ||
825 | draw_sb = wps_data->show_sb_on_wps; | ||
826 | |||
827 | if (wps_data->num_viewports == 0 && draw_sb) | ||
828 | line_y_pos += STATUSBAR_HEIGHT; | ||
829 | /** Remove the above bit when the remove lcd margins patch goes in **/ | ||
830 | |||
831 | if (wps_data->progressbar_count +1 >= MAX_PROGRESSBARS) | 823 | if (wps_data->progressbar_count +1 >= MAX_PROGRESSBARS) |
832 | return WPS_ERROR_INVALID_PARAM; | 824 | return WPS_ERROR_INVALID_PARAM; |
833 | 825 | ||
@@ -1106,33 +1098,6 @@ static int parse_albumart_conditional(const char *wps_bufptr, | |||
1106 | }; | 1098 | }; |
1107 | #endif /* HAVE_ALBUMART */ | 1099 | #endif /* HAVE_ALBUMART */ |
1108 | 1100 | ||
1109 | #ifdef HAVE_LCD_BITMAP | ||
1110 | static int parse_leftmargin(const char *wps_bufptr, struct wps_token *token, | ||
1111 | struct wps_data *wps_data) | ||
1112 | { | ||
1113 | const char* p; | ||
1114 | const char* pend; | ||
1115 | const char *newline; | ||
1116 | |||
1117 | (void)wps_data; /* Kill the warning */ | ||
1118 | |||
1119 | /* valid tag looks like %m|12| */ | ||
1120 | if(*wps_bufptr == '|') | ||
1121 | { | ||
1122 | p = wps_bufptr + 1; | ||
1123 | newline = strchr(wps_bufptr, '\n'); | ||
1124 | if(isdigit(*p) && (pend = strchr(p, '|')) && pend < newline) | ||
1125 | { | ||
1126 | token->value.i = atoi(p); | ||
1127 | return pend - wps_bufptr + 1; | ||
1128 | } | ||
1129 | } | ||
1130 | |||
1131 | /* invalid tag syntax */ | ||
1132 | return WPS_ERROR_INVALID_PARAM; | ||
1133 | } | ||
1134 | #endif | ||
1135 | |||
1136 | 1101 | ||
1137 | /* Parse a generic token from the given string. Return the length read */ | 1102 | /* Parse a generic token from the given string. Return the length read */ |
1138 | static int parse_token(const char *wps_bufptr, struct wps_data *wps_data) | 1103 | static int parse_token(const char *wps_bufptr, struct wps_data *wps_data) |
@@ -1583,15 +1548,21 @@ bool wps_data_load(struct wps_data *wps_data, | |||
1583 | 1548 | ||
1584 | /* Initialise the first (default) viewport */ | 1549 | /* Initialise the first (default) viewport */ |
1585 | wps_data->viewports[0].vp.x = 0; | 1550 | wps_data->viewports[0].vp.x = 0; |
1586 | wps_data->viewports[0].vp.y = 0; | ||
1587 | wps_data->viewports[0].vp.width = display->width; | 1551 | wps_data->viewports[0].vp.width = display->width; |
1588 | wps_data->viewports[0].vp.height = display->height; | 1552 | if (!global_settings.statusbar) |
1553 | { | ||
1554 | wps_data->viewports[0].vp.y = 0; | ||
1555 | wps_data->viewports[0].vp.height = display->height; | ||
1556 | } | ||
1557 | else | ||
1558 | { | ||
1559 | wps_data->viewports[0].vp.y = STATUSBAR_HEIGHT; | ||
1560 | wps_data->viewports[0].vp.height = display->height - STATUSBAR_HEIGHT; | ||
1561 | } | ||
1589 | #ifdef HAVE_LCD_BITMAP | 1562 | #ifdef HAVE_LCD_BITMAP |
1590 | wps_data->viewports[0].vp.font = FONT_UI; | 1563 | wps_data->viewports[0].vp.font = FONT_UI; |
1591 | wps_data->viewports[0].vp.drawmode = DRMODE_SOLID; | 1564 | wps_data->viewports[0].vp.drawmode = DRMODE_SOLID; |
1592 | #endif | 1565 | #endif |
1593 | wps_data->viewports[0].vp.xmargin = display->getxmargin(); | ||
1594 | wps_data->viewports[0].vp.ymargin = display->getymargin(); | ||
1595 | #if LCD_DEPTH > 1 | 1566 | #if LCD_DEPTH > 1 |
1596 | if (display->depth > 1) | 1567 | if (display->depth > 1) |
1597 | { | 1568 | { |
diff --git a/apps/logfdisp.c b/apps/logfdisp.c index 4a5ab43089..2bdc613136 100644 --- a/apps/logfdisp.c +++ b/apps/logfdisp.c | |||
@@ -66,7 +66,6 @@ bool logfdisplay(void) | |||
66 | if(!lines) | 66 | if(!lines) |
67 | return false; | 67 | return false; |
68 | 68 | ||
69 | lcd_setmargins(0, 0); | ||
70 | lcd_clear_display(); | 69 | lcd_clear_display(); |
71 | 70 | ||
72 | do { | 71 | do { |
diff --git a/apps/menus/display_menu.c b/apps/menus/display_menu.c index 5ba8c2ecb1..e52a6c98ad 100644 --- a/apps/menus/display_menu.c +++ b/apps/menus/display_menu.c | |||
@@ -21,6 +21,7 @@ | |||
21 | #include <stddef.h> | 21 | #include <stddef.h> |
22 | #include <limits.h> | 22 | #include <limits.h> |
23 | #include "config.h" | 23 | #include "config.h" |
24 | #include "events.h" | ||
24 | #include "lang.h" | 25 | #include "lang.h" |
25 | #include "action.h" | 26 | #include "action.h" |
26 | #include "settings.h" | 27 | #include "settings.h" |
@@ -35,6 +36,7 @@ | |||
35 | #include "lcd.h" | 36 | #include "lcd.h" |
36 | #include "lcd-remote.h" | 37 | #include "lcd-remote.h" |
37 | #include "backdrop.h" | 38 | #include "backdrop.h" |
39 | #include "statusbar.h" | ||
38 | 40 | ||
39 | #ifdef HAVE_BACKLIGHT | 41 | #ifdef HAVE_BACKLIGHT |
40 | static int filterfirstkeypress_callback(int action,const struct menu_item_ex *this_item) | 42 | static int filterfirstkeypress_callback(int action,const struct menu_item_ex *this_item) |
@@ -300,6 +302,7 @@ static int statusbar_callback(int action,const struct menu_item_ex *this_item) | |||
300 | switch (action) | 302 | switch (action) |
301 | { | 303 | { |
302 | case ACTION_EXIT_MENUITEM: | 304 | case ACTION_EXIT_MENUITEM: |
305 | send_event(STATUSBAR_TOGGLE_EVENT, NULL); | ||
303 | /* this should be changed so only the viewports are reloaded */ | 306 | /* this should be changed so only the viewports are reloaded */ |
304 | settings_apply(false); | 307 | settings_apply(false); |
305 | break; | 308 | break; |
diff --git a/apps/playlist.c b/apps/playlist.c index 30fd0f11e9..83bce9036b 100644 --- a/apps/playlist.c +++ b/apps/playlist.c | |||
@@ -1758,15 +1758,6 @@ static void display_playlist_count(int count, const unsigned char *fmt, | |||
1758 | } | 1758 | } |
1759 | fmt = P2STR(fmt); | 1759 | fmt = P2STR(fmt); |
1760 | 1760 | ||
1761 | lcd_clear_display(); | ||
1762 | |||
1763 | #ifdef HAVE_LCD_BITMAP | ||
1764 | if(global_settings.statusbar) | ||
1765 | lcd_setmargins(0, STATUSBAR_HEIGHT); | ||
1766 | else | ||
1767 | lcd_setmargins(0, 0); | ||
1768 | #endif | ||
1769 | |||
1770 | gui_syncsplash(0, fmt, count, str(LANG_OFF_ABORT)); | 1761 | gui_syncsplash(0, fmt, count, str(LANG_OFF_ABORT)); |
1771 | } | 1762 | } |
1772 | 1763 | ||
diff --git a/apps/plugin.c b/apps/plugin.c index 9a435b24bc..21f6d178ea 100644 --- a/apps/plugin.c +++ b/apps/plugin.c | |||
@@ -75,7 +75,6 @@ static const struct plugin_api rockbox_api = { | |||
75 | lcd_set_contrast, | 75 | lcd_set_contrast, |
76 | lcd_update, | 76 | lcd_update, |
77 | lcd_clear_display, | 77 | lcd_clear_display, |
78 | lcd_setmargins, | ||
79 | lcd_getstringsize, | 78 | lcd_getstringsize, |
80 | lcd_putsxy, | 79 | lcd_putsxy, |
81 | lcd_puts, | 80 | lcd_puts, |
@@ -131,6 +130,10 @@ static const struct plugin_api rockbox_api = { | |||
131 | #ifdef HAVE_LCD_INVERT | 130 | #ifdef HAVE_LCD_INVERT |
132 | lcd_set_invert_display, | 131 | lcd_set_invert_display, |
133 | #endif /* HAVE_LCD_INVERT */ | 132 | #endif /* HAVE_LCD_INVERT */ |
133 | #ifdef HAVE_LCD_ENABLE | ||
134 | lcd_set_enable_hook, | ||
135 | &button_queue, | ||
136 | #endif | ||
134 | bidi_l2v, | 137 | bidi_l2v, |
135 | font_get_bits, | 138 | font_get_bits, |
136 | font_load, | 139 | font_load, |
@@ -158,7 +161,6 @@ static const struct plugin_api rockbox_api = { | |||
158 | /* remote lcd */ | 161 | /* remote lcd */ |
159 | lcd_remote_set_contrast, | 162 | lcd_remote_set_contrast, |
160 | lcd_remote_clear_display, | 163 | lcd_remote_clear_display, |
161 | lcd_remote_setmargins, | ||
162 | lcd_remote_puts, | 164 | lcd_remote_puts, |
163 | lcd_remote_puts_scroll, | 165 | lcd_remote_puts_scroll, |
164 | lcd_remote_stop_scroll, | 166 | lcd_remote_stop_scroll, |
@@ -216,6 +218,8 @@ static const struct plugin_api rockbox_api = { | |||
216 | gui_synclist_limit_scroll, | 218 | gui_synclist_limit_scroll, |
217 | gui_synclist_do_button, | 219 | gui_synclist_do_button, |
218 | gui_synclist_set_title, | 220 | gui_synclist_set_title, |
221 | simplelist_info_init, | ||
222 | simplelist_show_list, | ||
219 | 223 | ||
220 | /* button */ | 224 | /* button */ |
221 | button_get, | 225 | button_get, |
@@ -598,13 +602,7 @@ static const struct plugin_api rockbox_api = { | |||
598 | 602 | ||
599 | /* new stuff at the end, sort into place next time | 603 | /* new stuff at the end, sort into place next time |
600 | the API gets incompatible */ | 604 | the API gets incompatible */ |
601 | simplelist_info_init, | ||
602 | simplelist_show_list, | ||
603 | 605 | ||
604 | #ifdef HAVE_LCD_ENABLE | ||
605 | lcd_set_enable_hook, | ||
606 | &button_queue, | ||
607 | #endif | ||
608 | }; | 606 | }; |
609 | 607 | ||
610 | int plugin_load(const char* plugin, const void* parameter) | 608 | int plugin_load(const char* plugin, const void* parameter) |
@@ -620,10 +618,6 @@ int plugin_load(const char* plugin, const void* parameter) | |||
620 | unsigned my_core; | 618 | unsigned my_core; |
621 | #endif | 619 | #endif |
622 | #endif /* !SIMULATOR */ | 620 | #endif /* !SIMULATOR */ |
623 | int xm, ym; | ||
624 | #ifdef HAVE_REMOTE_LCD | ||
625 | int rxm, rym; | ||
626 | #endif | ||
627 | 621 | ||
628 | #if LCD_DEPTH > 1 | 622 | #if LCD_DEPTH > 1 |
629 | fb_data* old_backdrop; | 623 | fb_data* old_backdrop; |
@@ -705,10 +699,7 @@ int plugin_load(const char* plugin, const void* parameter) | |||
705 | #endif | 699 | #endif |
706 | 700 | ||
707 | plugin_loaded = true; | 701 | plugin_loaded = true; |
708 | 702 | ||
709 | xm = lcd_getxmargin(); | ||
710 | ym = lcd_getymargin(); | ||
711 | lcd_setmargins(0,0); | ||
712 | 703 | ||
713 | #if defined HAVE_LCD_BITMAP && LCD_DEPTH > 1 | 704 | #if defined HAVE_LCD_BITMAP && LCD_DEPTH > 1 |
714 | old_backdrop = lcd_get_backdrop(); | 705 | old_backdrop = lcd_get_backdrop(); |
@@ -717,9 +708,6 @@ int plugin_load(const char* plugin, const void* parameter) | |||
717 | lcd_update(); | 708 | lcd_update(); |
718 | 709 | ||
719 | #ifdef HAVE_REMOTE_LCD | 710 | #ifdef HAVE_REMOTE_LCD |
720 | rxm = lcd_remote_getxmargin(); | ||
721 | rym = lcd_remote_getymargin(); | ||
722 | lcd_remote_setmargins(0, 0); | ||
723 | lcd_remote_clear_display(); | 711 | lcd_remote_clear_display(); |
724 | lcd_remote_update(); | 712 | lcd_remote_update(); |
725 | #endif | 713 | #endif |
@@ -744,8 +732,6 @@ int plugin_load(const char* plugin, const void* parameter) | |||
744 | #endif /* LCD_DEPTH */ | 732 | #endif /* LCD_DEPTH */ |
745 | #endif /* HAVE_LCD_BITMAP */ | 733 | #endif /* HAVE_LCD_BITMAP */ |
746 | 734 | ||
747 | /* restore margins */ | ||
748 | lcd_setmargins(xm,ym); | ||
749 | lcd_clear_display(); | 735 | lcd_clear_display(); |
750 | lcd_update(); | 736 | lcd_update(); |
751 | 737 | ||
@@ -756,7 +742,6 @@ int plugin_load(const char* plugin, const void* parameter) | |||
756 | #else | 742 | #else |
757 | lcd_remote_set_drawmode(DRMODE_SOLID); | 743 | lcd_remote_set_drawmode(DRMODE_SOLID); |
758 | #endif | 744 | #endif |
759 | lcd_remote_setmargins(rxm, rym); | ||
760 | lcd_remote_clear_display(); | 745 | lcd_remote_clear_display(); |
761 | 746 | ||
762 | 747 | ||
diff --git a/apps/plugin.h b/apps/plugin.h index edd54989da..4be76adfd1 100644 --- a/apps/plugin.h +++ b/apps/plugin.h | |||
@@ -124,12 +124,12 @@ void* plugin_get_buffer(size_t *buffer_size); | |||
124 | #define PLUGIN_MAGIC 0x526F634B /* RocK */ | 124 | #define PLUGIN_MAGIC 0x526F634B /* RocK */ |
125 | 125 | ||
126 | /* increase this every time the api struct changes */ | 126 | /* increase this every time the api struct changes */ |
127 | #define PLUGIN_API_VERSION 116 | 127 | #define PLUGIN_API_VERSION 117 |
128 | 128 | ||
129 | /* update this to latest version if a change to the api struct breaks | 129 | /* update this to latest version if a change to the api struct breaks |
130 | backwards compatibility (and please take the opportunity to sort in any | 130 | backwards compatibility (and please take the opportunity to sort in any |
131 | new function which are "waiting" at the end of the function table) */ | 131 | new function which are "waiting" at the end of the function table) */ |
132 | #define PLUGIN_MIN_API_VERSION 114 | 132 | #define PLUGIN_MIN_API_VERSION 117 |
133 | 133 | ||
134 | /* plugin return codes */ | 134 | /* plugin return codes */ |
135 | enum plugin_status { | 135 | enum plugin_status { |
@@ -150,7 +150,6 @@ struct plugin_api { | |||
150 | void (*lcd_set_contrast)(int x); | 150 | void (*lcd_set_contrast)(int x); |
151 | void (*lcd_update)(void); | 151 | void (*lcd_update)(void); |
152 | void (*lcd_clear_display)(void); | 152 | void (*lcd_clear_display)(void); |
153 | void (*lcd_setmargins)(int x, int y); | ||
154 | int (*lcd_getstringsize)(const unsigned char *str, int *w, int *h); | 153 | int (*lcd_getstringsize)(const unsigned char *str, int *w, int *h); |
155 | void (*lcd_putsxy)(int x, int y, const unsigned char *string); | 154 | void (*lcd_putsxy)(int x, int y, const unsigned char *string); |
156 | void (*lcd_puts)(int x, int y, const unsigned char *string); | 155 | void (*lcd_puts)(int x, int y, const unsigned char *string); |
@@ -220,6 +219,10 @@ struct plugin_api { | |||
220 | void (*lcd_set_invert_display)(bool yesno); | 219 | void (*lcd_set_invert_display)(bool yesno); |
221 | #endif /* HAVE_LCD_INVERT */ | 220 | #endif /* HAVE_LCD_INVERT */ |
222 | 221 | ||
222 | #ifdef HAVE_LCD_ENABLE | ||
223 | void (*lcd_set_enable_hook)(void (*enable_hook)(void)); | ||
224 | struct event_queue *button_queue; | ||
225 | #endif | ||
223 | unsigned short *(*bidi_l2v)( const unsigned char *str, int orientation ); | 226 | unsigned short *(*bidi_l2v)( const unsigned char *str, int orientation ); |
224 | const unsigned char *(*font_get_bits)( struct font *pf, unsigned short char_code ); | 227 | const unsigned char *(*font_get_bits)( struct font *pf, unsigned short char_code ); |
225 | struct font* (*font_load)(const char *path); | 228 | struct font* (*font_load)(const char *path); |
@@ -253,7 +256,6 @@ struct plugin_api { | |||
253 | /* remote lcd */ | 256 | /* remote lcd */ |
254 | void (*lcd_remote_set_contrast)(int x); | 257 | void (*lcd_remote_set_contrast)(int x); |
255 | void (*lcd_remote_clear_display)(void); | 258 | void (*lcd_remote_clear_display)(void); |
256 | void (*lcd_remote_setmargins)(int x, int y); | ||
257 | void (*lcd_remote_puts)(int x, int y, const unsigned char *string); | 259 | void (*lcd_remote_puts)(int x, int y, const unsigned char *string); |
258 | void (*lcd_remote_puts_scroll)(int x, int y, const unsigned char* string); | 260 | void (*lcd_remote_puts_scroll)(int x, int y, const unsigned char* string); |
259 | void (*lcd_remote_stop_scroll)(void); | 261 | void (*lcd_remote_stop_scroll)(void); |
@@ -317,6 +319,9 @@ struct plugin_api { | |||
317 | bool (*gui_synclist_do_button)(struct gui_synclist * lists, | 319 | bool (*gui_synclist_do_button)(struct gui_synclist * lists, |
318 | unsigned *action, enum list_wrap wrap); | 320 | unsigned *action, enum list_wrap wrap); |
319 | void (*gui_synclist_set_title)(struct gui_synclist *lists, char* title, int icon); | 321 | void (*gui_synclist_set_title)(struct gui_synclist *lists, char* title, int icon); |
322 | void (*simplelist_info_init)(struct simplelist_info *info, char* title, | ||
323 | int count, void* data); | ||
324 | bool (*simplelist_show_list)(struct simplelist_info *info); | ||
320 | 325 | ||
321 | /* button */ | 326 | /* button */ |
322 | long (*button_get)(bool block); | 327 | long (*button_get)(bool block); |
@@ -748,14 +753,7 @@ struct plugin_api { | |||
748 | 753 | ||
749 | /* new stuff at the end, sort into place next time | 754 | /* new stuff at the end, sort into place next time |
750 | the API gets incompatible */ | 755 | the API gets incompatible */ |
751 | void (*simplelist_info_init)(struct simplelist_info *info, char* title, | ||
752 | int count, void* data); | ||
753 | bool (*simplelist_show_list)(struct simplelist_info *info); | ||
754 | 756 | ||
755 | #ifdef HAVE_LCD_ENABLE | ||
756 | void (*lcd_set_enable_hook)(void (*enable_hook)(void)); | ||
757 | struct event_queue *button_queue; | ||
758 | #endif | ||
759 | }; | 757 | }; |
760 | 758 | ||
761 | /* plugin header */ | 759 | /* plugin header */ |
diff --git a/apps/plugins/solitaire.c b/apps/plugins/solitaire.c index 94ef282698..e4e2a9ce45 100644 --- a/apps/plugins/solitaire.c +++ b/apps/plugins/solitaire.c | |||
@@ -744,7 +744,6 @@ int solitaire_menu(bool in_game) | |||
744 | break; | 744 | break; |
745 | 745 | ||
746 | case 2: | 746 | case 2: |
747 | rb->lcd_setmargins(0, 0); | ||
748 | if (solitaire_help() == HELP_USB) | 747 | if (solitaire_help() == HELP_USB) |
749 | result = MENU_USB; | 748 | result = MENU_USB; |
750 | break; | 749 | break; |
@@ -766,7 +765,6 @@ int solitaire_menu(bool in_game) | |||
766 | } | 765 | } |
767 | } | 766 | } |
768 | menu_exit(m); | 767 | menu_exit(m); |
769 | rb->lcd_setmargins(0, 0); | ||
770 | return result; | 768 | return result; |
771 | } | 769 | } |
772 | 770 | ||
diff --git a/apps/plugins/test_codec.c b/apps/plugins/test_codec.c index 2379ebb1b7..31e8a319f9 100644 --- a/apps/plugins/test_codec.c +++ b/apps/plugins/test_codec.c | |||
@@ -44,7 +44,6 @@ static bool log_init(bool use_logfile) | |||
44 | { | 44 | { |
45 | int h; | 45 | int h; |
46 | 46 | ||
47 | rb->lcd_setmargins(0, 0); | ||
48 | rb->lcd_getstringsize("A", NULL, &h); | 47 | rb->lcd_getstringsize("A", NULL, &h); |
49 | max_line = LCD_HEIGHT / h; | 48 | max_line = LCD_HEIGHT / h; |
50 | line = 0; | 49 | line = 0; |
diff --git a/apps/plugins/test_disk.c b/apps/plugins/test_disk.c index 93464807c3..06017a3c5c 100644 --- a/apps/plugins/test_disk.c +++ b/apps/plugins/test_disk.c | |||
@@ -77,7 +77,6 @@ static bool log_init(void) | |||
77 | { | 77 | { |
78 | int h; | 78 | int h; |
79 | 79 | ||
80 | rb->lcd_setmargins(0, 0); | ||
81 | rb->lcd_getstringsize("A", NULL, &h); | 80 | rb->lcd_getstringsize("A", NULL, &h); |
82 | max_line = LCD_HEIGHT / h; | 81 | max_line = LCD_HEIGHT / h; |
83 | line = 0; | 82 | line = 0; |
diff --git a/apps/plugins/test_fps.c b/apps/plugins/test_fps.c index 0852e0a9fb..d5b34faeb9 100644 --- a/apps/plugins/test_fps.c +++ b/apps/plugins/test_fps.c | |||
@@ -57,14 +57,12 @@ static void log_init(void) | |||
57 | { | 57 | { |
58 | int h; | 58 | int h; |
59 | 59 | ||
60 | rb->lcd_setmargins(0, 0); | ||
61 | rb->lcd_getstringsize("A", NULL, &h); | 60 | rb->lcd_getstringsize("A", NULL, &h); |
62 | max_line = LCD_HEIGHT / h; | 61 | max_line = LCD_HEIGHT / h; |
63 | line = 0; | 62 | line = 0; |
64 | rb->lcd_clear_display(); | 63 | rb->lcd_clear_display(); |
65 | rb->lcd_update(); | 64 | rb->lcd_update(); |
66 | #ifdef HAVE_REMOTE_LCD | 65 | #ifdef HAVE_REMOTE_LCD |
67 | rb->lcd_remote_setmargins(0, 0); | ||
68 | rb->lcd_remote_getstringsize("A", NULL, &h); | 66 | rb->lcd_remote_getstringsize("A", NULL, &h); |
69 | remote_max_line = LCD_REMOTE_HEIGHT / h; | 67 | remote_max_line = LCD_REMOTE_HEIGHT / h; |
70 | remote_line = 0; | 68 | remote_line = 0; |
diff --git a/apps/plugins/test_viewports.c b/apps/plugins/test_viewports.c index bb1b4b9af9..874ed6f52c 100644 --- a/apps/plugins/test_viewports.c +++ b/apps/plugins/test_viewports.c | |||
@@ -43,8 +43,6 @@ static struct viewport vp0 = | |||
43 | .height = 20, | 43 | .height = 20, |
44 | .font = FONT_UI, | 44 | .font = FONT_UI, |
45 | .drawmode = DRMODE_SOLID, | 45 | .drawmode = DRMODE_SOLID, |
46 | .xmargin = 0, | ||
47 | .ymargin = 0, | ||
48 | #if LCD_DEPTH > 1 | 46 | #if LCD_DEPTH > 1 |
49 | .fg_pattern = LCD_DEFAULT_FG, | 47 | .fg_pattern = LCD_DEFAULT_FG, |
50 | .bg_pattern = BGCOLOR_1, | 48 | .bg_pattern = BGCOLOR_1, |
@@ -64,8 +62,6 @@ static struct viewport vp1 = | |||
64 | .height = LCD_HEIGHT / 2, | 62 | .height = LCD_HEIGHT / 2, |
65 | .font = FONT_SYSFIXED, | 63 | .font = FONT_SYSFIXED, |
66 | .drawmode = DRMODE_SOLID, | 64 | .drawmode = DRMODE_SOLID, |
67 | .xmargin = 0, | ||
68 | .ymargin = 0, | ||
69 | #if LCD_DEPTH > 1 | 65 | #if LCD_DEPTH > 1 |
70 | .fg_pattern = LCD_DEFAULT_FG, | 66 | .fg_pattern = LCD_DEFAULT_FG, |
71 | .bg_pattern = LCD_DEFAULT_BG, | 67 | .bg_pattern = LCD_DEFAULT_BG, |
@@ -85,8 +81,6 @@ static struct viewport vp2 = | |||
85 | .height = (LCD_HEIGHT / 2), | 81 | .height = (LCD_HEIGHT / 2), |
86 | .font = FONT_UI, | 82 | .font = FONT_UI, |
87 | .drawmode = DRMODE_SOLID, | 83 | .drawmode = DRMODE_SOLID, |
88 | .xmargin = 0, | ||
89 | .ymargin = 0, | ||
90 | #if LCD_DEPTH > 1 | 84 | #if LCD_DEPTH > 1 |
91 | .fg_pattern = FGCOLOR_1, | 85 | .fg_pattern = FGCOLOR_1, |
92 | .bg_pattern = BGCOLOR_2, | 86 | .bg_pattern = BGCOLOR_2, |
@@ -107,8 +101,6 @@ static struct viewport vp3 = | |||
107 | .height = (LCD_HEIGHT / 4), | 101 | .height = (LCD_HEIGHT / 4), |
108 | .font = FONT_SYSFIXED, | 102 | .font = FONT_SYSFIXED, |
109 | .drawmode = DRMODE_SOLID, | 103 | .drawmode = DRMODE_SOLID, |
110 | .xmargin = 0, | ||
111 | .ymargin = 0, | ||
112 | #if LCD_DEPTH > 1 | 104 | #if LCD_DEPTH > 1 |
113 | .fg_pattern = LCD_BLACK, | 105 | .fg_pattern = LCD_BLACK, |
114 | .bg_pattern = LCD_WHITE, | 106 | .bg_pattern = LCD_WHITE, |
@@ -130,8 +122,6 @@ static struct viewport rvp0 = | |||
130 | .height = LCD_REMOTE_HEIGHT - 10, | 122 | .height = LCD_REMOTE_HEIGHT - 10, |
131 | .font = FONT_SYSFIXED, | 123 | .font = FONT_SYSFIXED, |
132 | .drawmode = DRMODE_SOLID, | 124 | .drawmode = DRMODE_SOLID, |
133 | .xmargin = 0, | ||
134 | .ymargin = 0, | ||
135 | #if LCD_REMOTE_DEPTH > 1 | 125 | #if LCD_REMOTE_DEPTH > 1 |
136 | .fg_pattern = LCD_REMOTE_BLACK, | 126 | .fg_pattern = LCD_REMOTE_BLACK, |
137 | .bg_pattern = LCD_REMOTE_LIGHTGRAY, | 127 | .bg_pattern = LCD_REMOTE_LIGHTGRAY, |
@@ -146,8 +136,6 @@ static struct viewport rvp1 = | |||
146 | .height = LCD_REMOTE_HEIGHT - 10, | 136 | .height = LCD_REMOTE_HEIGHT - 10, |
147 | .font = FONT_SYSFIXED, | 137 | .font = FONT_SYSFIXED, |
148 | .drawmode = DRMODE_SOLID, | 138 | .drawmode = DRMODE_SOLID, |
149 | .xmargin = 0, | ||
150 | .ymargin = 0, | ||
151 | #if LCD_REMOTE_DEPTH > 1 | 139 | #if LCD_REMOTE_DEPTH > 1 |
152 | .fg_pattern = LCD_REMOTE_DEFAULT_FG, | 140 | .fg_pattern = LCD_REMOTE_DEFAULT_FG, |
153 | .bg_pattern = LCD_REMOTE_DEFAULT_BG | 141 | .bg_pattern = LCD_REMOTE_DEFAULT_BG |
@@ -253,8 +241,6 @@ static struct viewport vp0 = | |||
253 | .y = 0, | 241 | .y = 0, |
254 | .width = 5, | 242 | .width = 5, |
255 | .height = 1, | 243 | .height = 1, |
256 | .xmargin = 0, | ||
257 | .ymargin = 0, | ||
258 | }; | 244 | }; |
259 | 245 | ||
260 | static struct viewport vp1 = | 246 | static struct viewport vp1 = |
@@ -263,8 +249,6 @@ static struct viewport vp1 = | |||
263 | .y = 0, | 249 | .y = 0, |
264 | .width = 5, | 250 | .width = 5, |
265 | .height = 1, | 251 | .height = 1, |
266 | .xmargin = 0, | ||
267 | .ymargin = 0, | ||
268 | }; | 252 | }; |
269 | 253 | ||
270 | static struct viewport vp2 = | 254 | static struct viewport vp2 = |
@@ -273,8 +257,6 @@ static struct viewport vp2 = | |||
273 | .y = 1, | 257 | .y = 1, |
274 | .width = LCD_WIDTH, | 258 | .width = LCD_WIDTH, |
275 | .height = 1, | 259 | .height = 1, |
276 | .xmargin = 0, | ||
277 | .ymargin = 0, | ||
278 | }; | 260 | }; |
279 | 261 | ||
280 | 262 | ||
diff --git a/apps/plugins/viewer.c b/apps/plugins/viewer.c index d596f43b83..507efac6df 100644 --- a/apps/plugins/viewer.c +++ b/apps/plugins/viewer.c | |||
@@ -1421,7 +1421,6 @@ static bool viewer_options_menu(void) | |||
1421 | result = menu_run(m); | 1421 | result = menu_run(m); |
1422 | menu_exit(m); | 1422 | menu_exit(m); |
1423 | #ifdef HAVE_LCD_BITMAP | 1423 | #ifdef HAVE_LCD_BITMAP |
1424 | rb->lcd_setmargins(0,0); | ||
1425 | 1424 | ||
1426 | /* Show-scrollbar mode for current view-width mode */ | 1425 | /* Show-scrollbar mode for current view-width mode */ |
1427 | init_need_scrollbar(); | 1426 | init_need_scrollbar(); |
@@ -1459,9 +1458,6 @@ static void viewer_menu(void) | |||
1459 | break; | 1458 | break; |
1460 | } | 1459 | } |
1461 | menu_exit(m); | 1460 | menu_exit(m); |
1462 | #ifdef HAVE_LCD_BITMAP | ||
1463 | rb->lcd_setmargins(0,0); | ||
1464 | #endif | ||
1465 | viewer_draw(col); | 1461 | viewer_draw(col); |
1466 | } | 1462 | } |
1467 | 1463 | ||
diff --git a/apps/recorder/recording.c b/apps/recorder/recording.c index 28b3a44b3a..ae2decf3d5 100644 --- a/apps/recorder/recording.c +++ b/apps/recorder/recording.c | |||
@@ -68,6 +68,7 @@ | |||
68 | #include "action.h" | 68 | #include "action.h" |
69 | #include "radio.h" | 69 | #include "radio.h" |
70 | #include "sound_menu.h" | 70 | #include "sound_menu.h" |
71 | #include "viewport.h" | ||
71 | 72 | ||
72 | #ifdef HAVE_RECORDING | 73 | #ifdef HAVE_RECORDING |
73 | /* This array holds the record timer interval lengths, in seconds */ | 74 | /* This array holds the record timer interval lengths, in seconds */ |
@@ -882,6 +883,8 @@ bool recording_screen(bool no_source) | |||
882 | 883 | ||
883 | int base_style = STYLE_INVERT; | 884 | int base_style = STYLE_INVERT; |
884 | int style; | 885 | int style; |
886 | struct viewport vp[NB_SCREENS]; | ||
887 | int ymargin = global_settings.cursor_style?0:10; | ||
885 | #ifdef HAVE_LCD_COLOR | 888 | #ifdef HAVE_LCD_COLOR |
886 | if (global_settings.cursor_style == 2) { | 889 | if (global_settings.cursor_style == 2) { |
887 | base_style |= STYLE_COLORBAR; | 890 | base_style |= STYLE_COLORBAR; |
@@ -956,11 +959,12 @@ bool recording_screen(bool no_source) | |||
956 | 959 | ||
957 | FOR_NB_SCREENS(i) | 960 | FOR_NB_SCREENS(i) |
958 | { | 961 | { |
959 | screens[i].setfont(FONT_SYSFIXED); | 962 | viewport_set_defaults(&vp[i], i); |
963 | vp[i].font = FONT_SYSFIXED; | ||
964 | screens[i].set_viewport(&vp[i]); | ||
960 | screens[i].getstringsize("M", &w, &h); | 965 | screens[i].getstringsize("M", &w, &h); |
961 | screens[i].setmargins(global_settings.cursor_style ? 0 : w, 8); | 966 | filename_offset[i] = ((vp[i].height >= 80) ? 1 : 0); |
962 | filename_offset[i] = ((screens[i].height >= 80) ? 1 : 0); | 967 | pm_y[i] = h * (2 + filename_offset[i]); |
963 | pm_y[i] = 8 + h * (2 + filename_offset[i]); | ||
964 | } | 968 | } |
965 | 969 | ||
966 | #ifdef HAVE_REMOTE_LCD | 970 | #ifdef HAVE_REMOTE_LCD |
@@ -968,8 +972,8 @@ bool recording_screen(bool no_source) | |||
968 | { | 972 | { |
969 | screens[1].clear_display(); | 973 | screens[1].clear_display(); |
970 | snprintf(buf, sizeof(buf), str(LANG_REMOTE_LCD_ON)); | 974 | snprintf(buf, sizeof(buf), str(LANG_REMOTE_LCD_ON)); |
971 | screens[1].puts((screens[1].width/w - strlen(buf))/2 + 1, | 975 | screens[1].puts((vp[1].width/w - strlen(buf))/2 + 1, |
972 | screens[1].height/(h*2) + 1, buf); | 976 | vp[1].height/(h*2) + 1, buf); |
973 | screens[1].update(); | 977 | screens[1].update(); |
974 | gui_syncsplash(0, str(LANG_REMOTE_LCD_OFF)); | 978 | gui_syncsplash(0, str(LANG_REMOTE_LCD_OFF)); |
975 | } | 979 | } |
@@ -1363,9 +1367,8 @@ bool recording_screen(bool no_source) | |||
1363 | 1367 | ||
1364 | FOR_NB_SCREENS(i) | 1368 | FOR_NB_SCREENS(i) |
1365 | { | 1369 | { |
1370 | screens[i].set_viewport(&vp[i]); | ||
1366 | screens[i].setfont(FONT_SYSFIXED); | 1371 | screens[i].setfont(FONT_SYSFIXED); |
1367 | screens[i].setmargins( | ||
1368 | global_settings.cursor_style ? 0 : w, 8); | ||
1369 | } | 1372 | } |
1370 | } | 1373 | } |
1371 | } | 1374 | } |
@@ -1613,7 +1616,9 @@ bool recording_screen(bool no_source) | |||
1613 | else | 1616 | else |
1614 | { | 1617 | { |
1615 | for(i = 0; i < screen_update; i++) | 1618 | for(i = 0; i < screen_update; i++) |
1616 | screens[i].puts(0, filename_offset[i] + PM_HEIGHT + 2, buf); | 1619 | screens[i].putsxy(ymargin, |
1620 | SYSFONT_HEIGHT*(filename_offset[i]+ | ||
1621 | PM_HEIGHT + 2), buf); | ||
1617 | } | 1622 | } |
1618 | 1623 | ||
1619 | if(global_settings.rec_source == AUDIO_SRC_MIC) | 1624 | if(global_settings.rec_source == AUDIO_SRC_MIC) |
@@ -1632,8 +1637,9 @@ bool recording_screen(bool no_source) | |||
1632 | else | 1637 | else |
1633 | { | 1638 | { |
1634 | for(i = 0; i < screen_update; i++) | 1639 | for(i = 0; i < screen_update; i++) |
1635 | screens[i].puts(0, filename_offset[i] + | 1640 | screens[i].putsxy(ymargin, |
1636 | PM_HEIGHT + 3, buf); | 1641 | SYSFONT_HEIGHT*(filename_offset[i] + |
1642 | PM_HEIGHT + 3), buf); | ||
1637 | } | 1643 | } |
1638 | } | 1644 | } |
1639 | else if(0 | 1645 | else if(0 |
@@ -1664,8 +1670,9 @@ bool recording_screen(bool no_source) | |||
1664 | else | 1670 | else |
1665 | { | 1671 | { |
1666 | for(i = 0; i < screen_update; i++) | 1672 | for(i = 0; i < screen_update; i++) |
1667 | screens[i].puts(0, filename_offset[i] + | 1673 | screens[i].putsxy(ymargin, |
1668 | PM_HEIGHT + 3, buf); | 1674 | SYSFONT_HEIGHT*(filename_offset[i] + |
1675 | PM_HEIGHT + 3), buf); | ||
1669 | } | 1676 | } |
1670 | 1677 | ||
1671 | snprintf(buf, sizeof(buf), "%s:%s", | 1678 | snprintf(buf, sizeof(buf), "%s:%s", |
@@ -1688,8 +1695,9 @@ bool recording_screen(bool no_source) | |||
1688 | else | 1695 | else |
1689 | { | 1696 | { |
1690 | for(i = 0; i < screen_update; i++) | 1697 | for(i = 0; i < screen_update; i++) |
1691 | screens[i].puts(0, filename_offset[i] + | 1698 | screens[i].putsxy(ymargin, |
1692 | PM_HEIGHT + 4, buf); | 1699 | SYSFONT_HEIGHT*(filename_offset[i] + |
1700 | PM_HEIGHT + 4), buf); | ||
1693 | } | 1701 | } |
1694 | } | 1702 | } |
1695 | #ifdef HAVE_LCD_COLOR | 1703 | #ifdef HAVE_LCD_COLOR |
@@ -1721,7 +1729,7 @@ bool recording_screen(bool no_source) | |||
1721 | break; | 1729 | break; |
1722 | } /* end switch */ | 1730 | } /* end switch */ |
1723 | #ifdef HAVE_AGC | 1731 | #ifdef HAVE_AGC |
1724 | if (screens[i].height < h * (2 + filename_offset[i] + | 1732 | if (vp[i].height < h * (2 + filename_offset[i] + |
1725 | PM_HEIGHT + line[i])) | 1733 | PM_HEIGHT + line[i])) |
1726 | { | 1734 | { |
1727 | line[i] -= 1; | 1735 | line[i] -= 1; |
@@ -1785,8 +1793,9 @@ bool recording_screen(bool no_source) | |||
1785 | { | 1793 | { |
1786 | for(i = 0; i < screen_update; i++) { | 1794 | for(i = 0; i < screen_update; i++) { |
1787 | if (display_agc[i]) { | 1795 | if (display_agc[i]) { |
1788 | screens[i].puts(0, filename_offset[i] + | 1796 | screens[i].putsxy(ymargin, |
1789 | PM_HEIGHT + line[i], buf); | 1797 | SYSFONT_HEIGHT*(filename_offset[i] + |
1798 | PM_HEIGHT + line[i]), buf); | ||
1790 | } | 1799 | } |
1791 | } | 1800 | } |
1792 | } | 1801 | } |
@@ -1859,7 +1868,9 @@ bool recording_screen(bool no_source) | |||
1859 | 1868 | ||
1860 | for(i = 0; i < screen_update; i++) | 1869 | for(i = 0; i < screen_update; i++) |
1861 | { | 1870 | { |
1871 | screens[i].set_viewport(NULL); | ||
1862 | gui_statusbar_draw(&(statusbars.statusbars[i]), true); | 1872 | gui_statusbar_draw(&(statusbars.statusbars[i]), true); |
1873 | screens[i].set_viewport(&vp[i]); | ||
1863 | peak_meter_screen(&screens[i], pm_x, pm_y[i], h*PM_HEIGHT); | 1874 | peak_meter_screen(&screens[i], pm_x, pm_y[i], h*PM_HEIGHT); |
1864 | screens[i].update(); | 1875 | screens[i].update(); |
1865 | } | 1876 | } |
@@ -1867,11 +1878,11 @@ bool recording_screen(bool no_source) | |||
1867 | /* draw the trigger status */ | 1878 | /* draw the trigger status */ |
1868 | FOR_NB_SCREENS(i) | 1879 | FOR_NB_SCREENS(i) |
1869 | { | 1880 | { |
1870 | trig_width[i] = ((screens[i].height < 64) || | 1881 | trig_width[i] = ((vp[i].height < 64) || |
1871 | ((screens[i].height < 72) && (PM_HEIGHT > 1))) ? | 1882 | ((vp[i].height < 72) && (PM_HEIGHT > 1))) ? |
1872 | screens[i].width - 14 * w : screens[i].width; | 1883 | screens[i].width - 14 * w : screens[i].width; |
1873 | trig_xpos[i] = screens[i].width - trig_width[i]; | 1884 | trig_xpos[i] = screens[i].width - trig_width[i]; |
1874 | trig_ypos[i] = ((screens[i].height < 72) && (PM_HEIGHT > 1)) ? | 1885 | trig_ypos[i] = ((vp[i].height < 72) && (PM_HEIGHT > 1)) ? |
1875 | h*2 : | 1886 | h*2 : |
1876 | h*(1 + filename_offset[i] + PM_HEIGHT + | 1887 | h*(1 + filename_offset[i] + PM_HEIGHT + |
1877 | line[i] | 1888 | line[i] |
diff --git a/apps/screen_access.c b/apps/screen_access.c index acb376e92a..8dcd091e81 100644 --- a/apps/screen_access.c +++ b/apps/screen_access.c | |||
@@ -51,11 +51,8 @@ struct screen screens[NB_SCREENS] = | |||
51 | .has_disk_led=true, | 51 | .has_disk_led=true, |
52 | #endif | 52 | #endif |
53 | .set_viewport=&lcd_set_viewport, | 53 | .set_viewport=&lcd_set_viewport, |
54 | .setmargins=&lcd_setmargins, | ||
55 | .getwidth=&lcd_getwidth, | 54 | .getwidth=&lcd_getwidth, |
56 | .getheight=&lcd_getheight, | 55 | .getheight=&lcd_getheight, |
57 | .getymargin=&lcd_getymargin, | ||
58 | .getxmargin=&lcd_getxmargin, | ||
59 | .getstringsize=&lcd_getstringsize, | 56 | .getstringsize=&lcd_getstringsize, |
60 | #ifdef HAVE_LCD_BITMAP | 57 | #ifdef HAVE_LCD_BITMAP |
61 | .setfont=&lcd_setfont, | 58 | .setfont=&lcd_setfont, |
@@ -142,11 +139,8 @@ struct screen screens[NB_SCREENS] = | |||
142 | .pixel_format=LCD_REMOTE_PIXELFORMAT, | 139 | .pixel_format=LCD_REMOTE_PIXELFORMAT, |
143 | .has_disk_led=false, | 140 | .has_disk_led=false, |
144 | .set_viewport=&lcd_remote_set_viewport, | 141 | .set_viewport=&lcd_remote_set_viewport, |
145 | .setmargins=&lcd_remote_setmargins, | ||
146 | .getwidth=&lcd_remote_getwidth, | 142 | .getwidth=&lcd_remote_getwidth, |
147 | .getheight=&lcd_remote_getheight, | 143 | .getheight=&lcd_remote_getheight, |
148 | .getymargin=&lcd_remote_getymargin, | ||
149 | .getxmargin=&lcd_remote_getxmargin, | ||
150 | .getstringsize=&lcd_remote_getstringsize, | 144 | .getstringsize=&lcd_remote_getstringsize, |
151 | #if 1 /* all remote LCDs are bitmapped so far */ | 145 | #if 1 /* all remote LCDs are bitmapped so far */ |
152 | .setfont=&lcd_remote_setfont, | 146 | .setfont=&lcd_remote_setfont, |
diff --git a/apps/screen_access.h b/apps/screen_access.h index 07684b0a76..e0237db3b0 100644 --- a/apps/screen_access.h +++ b/apps/screen_access.h | |||
@@ -72,11 +72,8 @@ struct screen | |||
72 | bool has_buttonbar; | 72 | bool has_buttonbar; |
73 | #endif | 73 | #endif |
74 | void (*set_viewport)(struct viewport* vp); | 74 | void (*set_viewport)(struct viewport* vp); |
75 | void (*setmargins)(int x, int y); | ||
76 | int (*getwidth)(void); | 75 | int (*getwidth)(void); |
77 | int (*getheight)(void); | 76 | int (*getheight)(void); |
78 | int (*getxmargin)(void); | ||
79 | int (*getymargin)(void); | ||
80 | int (*getstringsize)(const unsigned char *str, int *w, int *h); | 77 | int (*getstringsize)(const unsigned char *str, int *w, int *h); |
81 | #if defined(HAVE_LCD_BITMAP) || defined(HAVE_REMOTE_LCD) /* always bitmap */ | 78 | #if defined(HAVE_LCD_BITMAP) || defined(HAVE_REMOTE_LCD) /* always bitmap */ |
82 | void (*setfont)(int newfont); | 79 | void (*setfont)(int newfont); |
@@ -155,32 +152,6 @@ struct screen | |||
155 | void (*backlight_set_timeout)(int index); | 152 | void (*backlight_set_timeout)(int index); |
156 | }; | 153 | }; |
157 | 154 | ||
158 | #ifdef HAVE_BUTTONBAR | ||
159 | /* | ||
160 | * Sets if the given screen has a buttonbar or not | ||
161 | * - screen : the screen structure | ||
162 | * - has : a boolean telling wether the current screen will have a buttonbar or not | ||
163 | */ | ||
164 | #define screen_has_buttonbar(screen, has_btnb) \ | ||
165 | (screen)->has_buttonbar=has_btnb; | ||
166 | #endif | ||
167 | |||
168 | /* | ||
169 | * Sets the x margin in pixels for the given screen | ||
170 | * - screen : the screen structure | ||
171 | * - xmargin : the number of pixels to the left of the screen | ||
172 | */ | ||
173 | #define screen_set_xmargin(screen, xmargin) \ | ||
174 | (screen)->setmargins(xmargin, (screen)->getymargin()); | ||
175 | |||
176 | /* | ||
177 | * Sets the y margin in pixels for the given screen | ||
178 | * - screen : the screen structure | ||
179 | * - xmargin : the number of pixels to the top of the screen | ||
180 | */ | ||
181 | #define screen_set_ymargin(screen, ymargin) \ | ||
182 | (screen)->setmargins((screen)->getxmargin(), ymargin); | ||
183 | |||
184 | #if defined(HAVE_LCD_BITMAP) || defined(HAVE_REMOTE_LCD) | 155 | #if defined(HAVE_LCD_BITMAP) || defined(HAVE_REMOTE_LCD) |
185 | /* | 156 | /* |
186 | * Clear only a given area of the screen | 157 | * Clear only a given area of the screen |