summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--apps/debug_menu.c16
-rw-r--r--apps/gui/gwps-common.c23
-rw-r--r--apps/gui/gwps.c69
-rw-r--r--apps/gui/gwps.h1
-rw-r--r--apps/gui/icon.c2
-rw-r--r--apps/gui/statusbar.h5
-rw-r--r--apps/gui/viewport.c2
-rw-r--r--apps/gui/wps_debug.c5
-rw-r--r--apps/gui/wps_parser.c69
-rw-r--r--apps/logfdisp.c1
-rw-r--r--apps/menus/display_menu.c3
-rw-r--r--apps/playlist.c9
-rw-r--r--apps/plugin.c29
-rw-r--r--apps/plugin.h20
-rw-r--r--apps/plugins/solitaire.c2
-rw-r--r--apps/plugins/test_codec.c1
-rw-r--r--apps/plugins/test_disk.c1
-rw-r--r--apps/plugins/test_fps.c2
-rw-r--r--apps/plugins/test_viewports.c18
-rw-r--r--apps/plugins/viewer.c4
-rw-r--r--apps/recorder/recording.c53
-rw-r--r--apps/screen_access.c6
-rw-r--r--apps/screen_access.h29
-rw-r--r--firmware/drivers/lcd-16bit.c30
-rw-r--r--firmware/drivers/lcd-1bit-vert.c30
-rw-r--r--firmware/drivers/lcd-2bit-horz.c30
-rw-r--r--firmware/drivers/lcd-2bit-vert.c30
-rw-r--r--firmware/drivers/lcd-2bit-vi.c31
-rw-r--r--firmware/drivers/lcd-charcell.c26
-rw-r--r--firmware/export/events.h1
-rw-r--r--firmware/export/lcd-remote.h3
-rw-r--r--firmware/export/lcd.h5
-rw-r--r--firmware/logf.c1
-rw-r--r--firmware/target/arm/imx31/debug-imx31.c2
-rw-r--r--firmware/target/arm/s3c2440/debug-s3c2440.c1
-rw-r--r--firmware/target/arm/tcc77x/debug-tcc77x.c1
-rw-r--r--firmware/target/arm/tcc780x/debug-tcc780x.c1
-rwxr-xr-xfirmware/target/arm/tms320dm320/debug-dm320.c1
38 files changed, 145 insertions, 418 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)
char buf[32];
struct audio_debug d;
- lcd_setmargins(0, 0);
lcd_setfont(FONT_SYSFIXED);
while(1)
@@ -299,7 +298,6 @@ static bool dbg_buffering_thread(void)
tick_add_task(dbg_audio_task);
- lcd_setmargins(0, 0);
lcd_setfont(FONT_SYSFIXED);
while(!done)
{
@@ -521,7 +519,6 @@ static bool dbg_hw_info(void)
system_memory_guard(oldmode); /* re-enable memory guard */
- lcd_setmargins(0, 0);
lcd_setfont(FONT_SYSFIXED);
lcd_clear_display();
@@ -572,7 +569,6 @@ static bool dbg_hw_info(void)
system_memory_guard(oldmode); /* re-enable memory guard */
- lcd_setmargins(0, 0);
lcd_setfont(FONT_SYSFIXED);
lcd_clear_display();
@@ -623,7 +619,6 @@ static bool dbg_hw_info(void)
(PP_VER1 >> 24) & 0xff, (PP_VER1 >> 16) & 0xff,
(PP_VER1 >> 8) & 0xff, (PP_VER1) & 0xff, '\0' };
- lcd_setmargins(0, 0);
lcd_setfont(FONT_SYSFIXED);
lcd_clear_display();
@@ -660,7 +655,6 @@ static bool dbg_hw_info(void)
(PP_VER1 >> 8) & 0xff, PP_VER1 & 0xff, '\0' };
- lcd_setmargins(0, 0);
lcd_setfont(FONT_SYSFIXED);
lcd_clear_display();
@@ -823,7 +817,6 @@ static bool dbg_spdif(void)
int spdif_source = spdif_get_output_source(&spdif_src_on);
spdif_set_output_source(AUDIO_SRC_SPDIF IF_SPDIF_POWER_(, true));
- lcd_setmargins(0, 0);
lcd_clear_display();
lcd_setfont(FONT_SYSFIXED);
@@ -1033,7 +1026,6 @@ bool dbg_ports(void)
int adc_battery_voltage, adc_battery_level;
lcd_setfont(FONT_SYSFIXED);
- lcd_setmargins(0, 0);
lcd_clear_display();
while(1)
@@ -1075,7 +1067,6 @@ bool dbg_ports(void)
char buf[128];
int line;
- lcd_setmargins(0, 0);
lcd_clear_display();
lcd_setfont(FONT_SYSFIXED);
@@ -1151,7 +1142,6 @@ bool dbg_ports(void)
char buf[128];
int line;
- lcd_setmargins(0, 0);
lcd_clear_display();
lcd_setfont(FONT_SYSFIXED);
@@ -1248,7 +1238,6 @@ bool dbg_ports(void)
char buf[128];
int line;
- lcd_setmargins(0, 0);
lcd_clear_display();
lcd_setfont(FONT_SYSFIXED);
@@ -1374,7 +1363,6 @@ static bool dbg_pcf(void)
int line;
#ifdef HAVE_LCD_BITMAP
- lcd_setmargins(0, 0);
lcd_setfont(FONT_SYSFIXED);
#endif
lcd_clear_display();
@@ -1429,7 +1417,6 @@ static bool dbg_cpufreq(void)
int button;
#ifdef HAVE_LCD_BITMAP
- lcd_setmargins(0, 0);
lcd_setfont(FONT_SYSFIXED);
#endif
lcd_clear_display();
@@ -1559,7 +1546,6 @@ static bool view_battery(void)
unsigned short maxv, minv;
char buf[32];
- lcd_setmargins(0, 0);
lcd_setfont(FONT_SYSFIXED);
while(1)
@@ -2316,7 +2302,6 @@ static bool cpu_boost_log(void)
int lines = LCD_HEIGHT/SYSFONT_HEIGHT;
char *str;
bool done;
- lcd_setmargins(0, 0);
lcd_setfont(FONT_SYSFIXED);
str = cpu_boost_log_getlog_first();
while (i < count)
@@ -2369,7 +2354,6 @@ static bool dbg_scrollwheel(void)
char buf[64];
unsigned int speed;
- lcd_setmargins(0, 0);
lcd_setfont(FONT_SYSFIXED);
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)
/* Update the values in the first (default) viewport - in case the user
has modified the statusbar or colour settings */
#ifdef HAVE_LCD_BITMAP
- gui_wps[i].data->viewports[0].vp.ymargin = gui_wps[i].display->getymargin();
#if LCD_DEPTH > 1
if (gui_wps[i].display->depth > 1)
{
@@ -1408,14 +1407,6 @@ static char *get_token_value(struct gui_wps *gwps,
else
return NULL;
#endif
-
-#ifdef HAVE_LCD_BITMAP
- case WPS_TOKEN_LEFTMARGIN:
- gwps->display->setmargins(token->value.i,
- gwps->display->getymargin());
- return NULL;
-#endif
-
default:
return NULL;
}
@@ -1529,11 +1520,6 @@ static bool get_line(struct gui_wps *gwps,
align->center = NULL;
align->right = NULL;
-#ifdef HAVE_LCD_BITMAP
- /* Reset margins - only bitmap targets modify them */
- gwps->display->setmargins(0, gwps->display->getymargin());
-#endif
-
/* Process all tokens of the desired subline */
last_token_idx = wps_last_token_index(data, line, subline);
for (i = wps_first_token_index(data, line, subline);
@@ -1800,7 +1786,7 @@ static void write_line(struct screen *display,
&center_width, &string_height);
}
- left_xpos = display->getxmargin();
+ left_xpos = 0;
right_xpos = (display->getwidth() - right_width);
center_xpos = (display->getwidth() + left_xpos - center_width) / 2;
@@ -1885,7 +1871,7 @@ static void write_line(struct screen *display,
right_width = 0;
}
- ypos = (line * string_height) + display->getymargin();
+ ypos = (line * string_height);
if (scroll && ((left_width > scroll_width) ||
@@ -1968,7 +1954,8 @@ bool gui_wps_refresh(struct gui_wps *gwps,
/* reset to first subline if refresh all flag is set */
if (refresh_mode == WPS_REFRESH_ALL)
{
- display->clear_display();
+ display->set_viewport(&data->viewports[0].vp);
+ display->clear_viewport();
for (i = 0; i <= data->num_lines; i++)
{
@@ -2063,7 +2050,7 @@ bool gui_wps_refresh(struct gui_wps *gwps,
update_line = false;
int h = font_get(data->viewports[v].vp.font)->height;
- int peak_meter_y = display->getymargin() + (line - data->viewports[v].first_line)* h;
+ int peak_meter_y = (line - data->viewports[v].first_line)* h;
/* The user might decide to have the peak meter in the last
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);
/* connects a wps with a statusbar*/
static void gui_wps_set_statusbar(struct gui_wps *gui_wps, struct gui_statusbar *statusbar);
-#ifdef HAVE_LCD_BITMAP
-static void gui_wps_set_margin(struct gui_wps *gwps)
-{
- int offset = 0;
- struct wps_data *data = gwps->data;
- if(data->wps_sb_tag && data->show_sb_on_wps)
- offset = STATUSBAR_HEIGHT;
- else if ( global_settings.statusbar && !data->wps_sb_tag)
- offset = STATUSBAR_HEIGHT;
- gwps->display->setmargins(0, offset);
-}
-#endif
-
static void prev_track(unsigned skip_thresh)
{
if (!wps_state.id3 || (wps_state.id3->elapsed < skip_thresh*1000)) {
@@ -152,10 +139,6 @@ long gui_wps_show(void)
status_set_audio(true);
status_set_param(false);
#else
- FOR_NB_SCREENS(i)
- {
- gui_wps_set_margin(&gui_wps[i]);
- }
#if LCD_DEPTH > 1
show_wps_backdrop();
#endif /* LCD_DEPTH > 1 */
@@ -299,12 +282,6 @@ long gui_wps_show(void)
#if defined(HAVE_REMOTE_LCD) && LCD_REMOTE_DEPTH > 1
show_remote_wps_backdrop();
#endif
-#ifdef HAVE_LCD_BITMAP
- FOR_NB_SCREENS(i)
- {
- gui_wps_set_margin(&gui_wps[i]);
- }
-#endif
restore = true;
break;
@@ -558,12 +535,6 @@ long gui_wps_show(void)
#if defined(HAVE_REMOTE_LCD) && LCD_REMOTE_DEPTH > 1
show_remote_wps_backdrop();
#endif
-#ifdef HAVE_LCD_BITMAP
- FOR_NB_SCREENS(i)
- {
- gui_wps_set_margin(&gui_wps[i]);
- }
-#endif
restore = true;
break;
#endif /* HAVE_QUICKSCREEN */
@@ -579,12 +550,6 @@ long gui_wps_show(void)
#endif
if (quick_screen_f3(BUTTON_F3))
return SYS_USB_CONNECTED;
-#ifdef HAVE_LCD_BITMAP
- FOR_NB_SCREENS(i)
- {
- gui_wps_set_margin(&gui_wps[i]);
- }
-#endif
restore = true;
break;
#endif /* BUTTON_F3 */
@@ -643,12 +608,6 @@ long gui_wps_show(void)
#if defined(HAVE_REMOTE_LCD) && LCD_REMOTE_DEPTH > 1
show_remote_wps_backdrop();
#endif
-#ifdef HAVE_LCD_BITMAP
- FOR_NB_SCREENS(i)
- {
- gui_wps_set_margin(&gui_wps[i]);
- }
-#endif
restore = true;
break;
@@ -812,7 +771,32 @@ void gui_sync_wps_screen_init(void)
FOR_NB_SCREENS(i)
gui_wps_set_disp(&gui_wps[i], &screens[i]);
}
+#ifdef HAVE_LCD_BITMAP
+static void statusbar_toggle_handler(void *data)
+{
+ (void)data;
+ int i;
+ bool draw = global_settings.statusbar;
+ FOR_NB_SCREENS(i)
+ {
+ struct wps_viewport *vp = &gui_wps[i].data->viewports[0];
+ if (gui_wps[i].data->wps_sb_tag)
+ draw = gui_wps[i].data->show_sb_on_wps;
+ if (!global_settings.statusbar && !draw)
+ {
+ vp->vp.y = 0;
+ vp->vp.height = screens[i].height;
+ }
+ else
+ {
+ vp->vp.y = STATUSBAR_HEIGHT;
+ vp->vp.height = screens[i].height - STATUSBAR_HEIGHT;
+ }
+ }
+}
+#endif
+
void gui_sync_wps_init(void)
{
int i;
@@ -826,6 +810,9 @@ void gui_sync_wps_init(void)
gui_wps_set_data(&gui_wps[i], &wps_datas[i]);
gui_wps_set_statusbar(&gui_wps[i], &statusbars.statusbars[i]);
}
+#ifdef HAVE_LCD_BITMAP
+ add_event(STATUSBAR_TOGGLE_EVENT, false, statusbar_toggle_handler);
+#endif
#if LCD_DEPTH > 1
unload_wps_backdrop();
#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 {
WPS_TOKEN_ALIGN_LEFT,
WPS_TOKEN_ALIGN_CENTER,
WPS_TOKEN_ALIGN_RIGHT,
- WPS_TOKEN_LEFTMARGIN,
/* Sublines */
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,
int screen = display->screen_type;
display->getstringsize((unsigned char *)"M", &width, &height);
xpos = x*ICON_WIDTH(screen) + off_x;
- ypos = y*height + display->getymargin() + off_y;
+ ypos = y*height + off_y;
if ( height > ICON_HEIGHT(screen) )/* center the cursor */
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 @@
#include "status.h"
#include "screen_access.h"
+#include "events.h"
#define STATUSBAR_X_POS 0
#define STATUSBAR_Y_POS 0 /* MUST be a multiple of 8 */
#define STATUSBAR_HEIGHT 8
+/* possibly a horrible misuse of the event system.
+ This is triggered when the statusbar setting changes */
+#define STATUSBAR_TOGGLE_EVENT (EVENT_CLASS_GUI|1)
+
struct status_info {
int battlevel;
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)
void viewport_set_defaults(struct viewport *vp, enum screen_type screen)
{
- vp->xmargin = 0;
- vp->ymargin = 0;
vp->x = 0;
vp->width = screens[screen].width;
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,
case WPS_TOKEN_ALIGN_RIGHT:
snprintf(buf, bufsize, "align right");
break;
-
- case WPS_TOKEN_LEFTMARGIN:
- snprintf(buf, bufsize, "left margin, value: %d",
- token->value.i);
- break;
#endif
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,
struct wps_token *token, struct wps_data *wps_data);
static int parse_viewport(const char *wps_bufptr,
struct wps_token *token, struct wps_data *wps_data);
-static int parse_leftmargin(const char *wps_bufptr,
- struct wps_token *token, struct wps_data *wps_data);
static int parse_statusbar_enable(const char *wps_bufptr,
struct wps_token *token, struct wps_data *wps_data);
static int parse_statusbar_disable(const char *wps_bufptr,
@@ -273,10 +271,6 @@ static const struct wps_tag all_tags[] = {
{ WPS_TOKEN_PLAYBACK_STATUS, "mp", WPS_REFRESH_DYNAMIC, NULL },
#ifdef HAVE_LCD_BITMAP
- { WPS_TOKEN_LEFTMARGIN, "m", 0, parse_leftmargin },
-#endif
-
-#ifdef HAVE_LCD_BITMAP
{ WPS_TOKEN_PEAKMETER, "pm", WPS_REFRESH_PEAK_METER, NULL },
#else
{ WPS_TOKEN_PLAYER_PROGRESSBAR, "pf",
@@ -368,6 +362,11 @@ static int parse_statusbar_enable(const char *wps_bufptr,
(void)token; /* Kill warnings */
wps_data->wps_sb_tag = true;
wps_data->show_sb_on_wps = true;
+ if (wps_data->viewports[0].vp.y == 0)
+ {
+ wps_data->viewports[0].vp.y = STATUSBAR_HEIGHT;
+ wps_data->viewports[0].vp.height -= STATUSBAR_HEIGHT;
+ }
return skip_end_of_line(wps_bufptr);
}
@@ -378,6 +377,11 @@ static int parse_statusbar_disable(const char *wps_bufptr,
(void)token; /* Kill warnings */
wps_data->wps_sb_tag = true;
wps_data->show_sb_on_wps = false;
+ if (wps_data->viewports[0].vp.y == STATUSBAR_HEIGHT)
+ {
+ wps_data->viewports[0].vp.y = 0;
+ wps_data->viewports[0].vp.height += STATUSBAR_HEIGHT;
+ }
return skip_end_of_line(wps_bufptr);
}
@@ -616,8 +620,6 @@ static int parse_viewport(const char *wps_bufptr,
/* Set the defaults for fields not user-specified */
vp->drawmode = DRMODE_SOLID;
- vp->xmargin = 0;
- vp->ymargin = 0;
/* Work out the depth of this display */
#ifdef HAVE_REMOTE_LCD
@@ -818,16 +820,6 @@ static int parse_progressbar(const char *wps_bufptr,
int line_y_pos = font_height*(wps_data->num_lines -
wps_data->viewports[wps_data->num_viewports].first_line);
- /** Remove this bit when the remove lcd margins patch goes in **/
- bool draw_sb = global_settings.statusbar;
-
- if (wps_data->wps_sb_tag)
- draw_sb = wps_data->show_sb_on_wps;
-
- if (wps_data->num_viewports == 0 && draw_sb)
- line_y_pos += STATUSBAR_HEIGHT;
- /** Remove the above bit when the remove lcd margins patch goes in **/
-
if (wps_data->progressbar_count +1 >= MAX_PROGRESSBARS)
return WPS_ERROR_INVALID_PARAM;
@@ -1106,33 +1098,6 @@ static int parse_albumart_conditional(const char *wps_bufptr,
};
#endif /* HAVE_ALBUMART */
-#ifdef HAVE_LCD_BITMAP
-static int parse_leftmargin(const char *wps_bufptr, struct wps_token *token,
- struct wps_data *wps_data)
-{
- const char* p;
- const char* pend;
- const char *newline;
-
- (void)wps_data; /* Kill the warning */
-
- /* valid tag looks like %m|12| */
- if(*wps_bufptr == '|')
- {
- p = wps_bufptr + 1;
- newline = strchr(wps_bufptr, '\n');
- if(isdigit(*p) && (pend = strchr(p, '|')) && pend < newline)
- {
- token->value.i = atoi(p);
- return pend - wps_bufptr + 1;
- }
- }
-
- /* invalid tag syntax */
- return WPS_ERROR_INVALID_PARAM;
-}
-#endif
-
/* Parse a generic token from the given string. Return the length read */
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,
/* Initialise the first (default) viewport */
wps_data->viewports[0].vp.x = 0;
- wps_data->viewports[0].vp.y = 0;
wps_data->viewports[0].vp.width = display->width;
- wps_data->viewports[0].vp.height = display->height;
+ if (!global_settings.statusbar)
+ {
+ wps_data->viewports[0].vp.y = 0;
+ wps_data->viewports[0].vp.height = display->height;
+ }
+ else
+ {
+ wps_data->viewports[0].vp.y = STATUSBAR_HEIGHT;
+ wps_data->viewports[0].vp.height = display->height - STATUSBAR_HEIGHT;
+ }
#ifdef HAVE_LCD_BITMAP
wps_data->viewports[0].vp.font = FONT_UI;
wps_data->viewports[0].vp.drawmode = DRMODE_SOLID;
#endif
- wps_data->viewports[0].vp.xmargin = display->getxmargin();
- wps_data->viewports[0].vp.ymargin = display->getymargin();
#if LCD_DEPTH > 1
if (display->depth > 1)
{
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)
if(!lines)
return false;
- lcd_setmargins(0, 0);
lcd_clear_display();
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 @@
#include <stddef.h>
#include <limits.h>
#include "config.h"
+#include "events.h"
#include "lang.h"
#include "action.h"
#include "settings.h"
@@ -35,6 +36,7 @@
#include "lcd.h"
#include "lcd-remote.h"
#include "backdrop.h"
+#include "statusbar.h"
#ifdef HAVE_BACKLIGHT
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)
switch (action)
{
case ACTION_EXIT_MENUITEM:
+ send_event(STATUSBAR_TOGGLE_EVENT, NULL);
/* this should be changed so only the viewports are reloaded */
settings_apply(false);
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,
}
fmt = P2STR(fmt);
- lcd_clear_display();
-
-#ifdef HAVE_LCD_BITMAP
- if(global_settings.statusbar)
- lcd_setmargins(0, STATUSBAR_HEIGHT);
- else
- lcd_setmargins(0, 0);
-#endif
-
gui_syncsplash(0, fmt, count, str(LANG_OFF_ABORT));
}
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 = {
lcd_set_contrast,
lcd_update,
lcd_clear_display,
- lcd_setmargins,
lcd_getstringsize,
lcd_putsxy,
lcd_puts,
@@ -131,6 +130,10 @@ static const struct plugin_api rockbox_api = {
#ifdef HAVE_LCD_INVERT
lcd_set_invert_display,
#endif /* HAVE_LCD_INVERT */
+#ifdef HAVE_LCD_ENABLE
+ lcd_set_enable_hook,
+ &button_queue,
+#endif
bidi_l2v,
font_get_bits,
font_load,
@@ -158,7 +161,6 @@ static const struct plugin_api rockbox_api = {
/* remote lcd */
lcd_remote_set_contrast,
lcd_remote_clear_display,
- lcd_remote_setmargins,
lcd_remote_puts,
lcd_remote_puts_scroll,
lcd_remote_stop_scroll,
@@ -216,6 +218,8 @@ static const struct plugin_api rockbox_api = {
gui_synclist_limit_scroll,
gui_synclist_do_button,
gui_synclist_set_title,
+ simplelist_info_init,
+ simplelist_show_list,
/* button */
button_get,
@@ -598,13 +602,7 @@ static const struct plugin_api rockbox_api = {
/* new stuff at the end, sort into place next time
the API gets incompatible */
- simplelist_info_init,
- simplelist_show_list,
-#ifdef HAVE_LCD_ENABLE
- lcd_set_enable_hook,
- &button_queue,
-#endif
};
int plugin_load(const char* plugin, const void* parameter)
@@ -620,10 +618,6 @@ int plugin_load(const char* plugin, const void* parameter)
unsigned my_core;
#endif
#endif /* !SIMULATOR */
- int xm, ym;
-#ifdef HAVE_REMOTE_LCD
- int rxm, rym;
-#endif
#if LCD_DEPTH > 1
fb_data* old_backdrop;
@@ -705,10 +699,7 @@ int plugin_load(const char* plugin, const void* parameter)
#endif
plugin_loaded = true;
-
- xm = lcd_getxmargin();
- ym = lcd_getymargin();
- lcd_setmargins(0,0);
+
#if defined HAVE_LCD_BITMAP && LCD_DEPTH > 1
old_backdrop = lcd_get_backdrop();
@@ -717,9 +708,6 @@ int plugin_load(const char* plugin, const void* parameter)
lcd_update();
#ifdef HAVE_REMOTE_LCD
- rxm = lcd_remote_getxmargin();
- rym = lcd_remote_getymargin();
- lcd_remote_setmargins(0, 0);
lcd_remote_clear_display();
lcd_remote_update();
#endif
@@ -744,8 +732,6 @@ int plugin_load(const char* plugin, const void* parameter)
#endif /* LCD_DEPTH */
#endif /* HAVE_LCD_BITMAP */
- /* restore margins */
- lcd_setmargins(xm,ym);
lcd_clear_display();
lcd_update();
@@ -756,7 +742,6 @@ int plugin_load(const char* plugin, const void* parameter)
#else
lcd_remote_set_drawmode(DRMODE_SOLID);
#endif
- lcd_remote_setmargins(rxm, rym);
lcd_remote_clear_display();
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);
#define PLUGIN_MAGIC 0x526F634B /* RocK */
/* increase this every time the api struct changes */
-#define PLUGIN_API_VERSION 116
+#define PLUGIN_API_VERSION 117
/* update this to latest version if a change to the api struct breaks
backwards compatibility (and please take the opportunity to sort in any
new function which are "waiting" at the end of the function table) */
-#define PLUGIN_MIN_API_VERSION 114
+#define PLUGIN_MIN_API_VERSION 117
/* plugin return codes */
enum plugin_status {
@@ -150,7 +150,6 @@ struct plugin_api {
void (*lcd_set_contrast)(int x);
void (*lcd_update)(void);
void (*lcd_clear_display)(void);
- void (*lcd_setmargins)(int x, int y);
int (*lcd_getstringsize)(const unsigned char *str, int *w, int *h);
void (*lcd_putsxy)(int x, int y, const unsigned char *string);
void (*lcd_puts)(int x, int y, const unsigned char *string);
@@ -220,6 +219,10 @@ struct plugin_api {
void (*lcd_set_invert_display)(bool yesno);
#endif /* HAVE_LCD_INVERT */
+#ifdef HAVE_LCD_ENABLE
+ void (*lcd_set_enable_hook)(void (*enable_hook)(void));
+ struct event_queue *button_queue;
+#endif
unsigned short *(*bidi_l2v)( const unsigned char *str, int orientation );
const unsigned char *(*font_get_bits)( struct font *pf, unsigned short char_code );
struct font* (*font_load)(const char *path);
@@ -253,7 +256,6 @@ struct plugin_api {
/* remote lcd */
void (*lcd_remote_set_contrast)(int x);
void (*lcd_remote_clear_display)(void);
- void (*lcd_remote_setmargins)(int x, int y);
void (*lcd_remote_puts)(int x, int y, const unsigned char *string);
void (*lcd_remote_puts_scroll)(int x, int y, const unsigned char* string);
void (*lcd_remote_stop_scroll)(void);
@@ -317,6 +319,9 @@ struct plugin_api {
bool (*gui_synclist_do_button)(struct gui_synclist * lists,
unsigned *action, enum list_wrap wrap);
void (*gui_synclist_set_title)(struct gui_synclist *lists, char* title, int icon);
+ void (*simplelist_info_init)(struct simplelist_info *info, char* title,
+ int count, void* data);
+ bool (*simplelist_show_list)(struct simplelist_info *info);
/* button */
long (*button_get)(bool block);
@@ -748,14 +753,7 @@ struct plugin_api {
/* new stuff at the end, sort into place next time
the API gets incompatible */
- void (*simplelist_info_init)(struct simplelist_info *info, char* title,
- int count, void* data);
- bool (*simplelist_show_list)(struct simplelist_info *info);
-#ifdef HAVE_LCD_ENABLE
- void (*lcd_set_enable_hook)(void (*enable_hook)(void));
- struct event_queue *button_queue;
-#endif
};
/* 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)
break;
case 2:
- rb->lcd_setmargins(0, 0);
if (solitaire_help() == HELP_USB)
result = MENU_USB;
break;
@@ -766,7 +765,6 @@ int solitaire_menu(bool in_game)
}
}
menu_exit(m);
- rb->lcd_setmargins(0, 0);
return result;
}
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)
{
int h;
- rb->lcd_setmargins(0, 0);
rb->lcd_getstringsize("A", NULL, &h);
max_line = LCD_HEIGHT / h;
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)
{
int h;
- rb->lcd_setmargins(0, 0);
rb->lcd_getstringsize("A", NULL, &h);
max_line = LCD_HEIGHT / h;
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)
{
int h;
- rb->lcd_setmargins(0, 0);
rb->lcd_getstringsize("A", NULL, &h);
max_line = LCD_HEIGHT / h;
line = 0;
rb->lcd_clear_display();
rb->lcd_update();
#ifdef HAVE_REMOTE_LCD
- rb->lcd_remote_setmargins(0, 0);
rb->lcd_remote_getstringsize("A", NULL, &h);
remote_max_line = LCD_REMOTE_HEIGHT / h;
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 =
.height = 20,
.font = FONT_UI,
.drawmode = DRMODE_SOLID,
- .xmargin = 0,
- .ymargin = 0,
#if LCD_DEPTH > 1
.fg_pattern = LCD_DEFAULT_FG,
.bg_pattern = BGCOLOR_1,
@@ -64,8 +62,6 @@ static struct viewport vp1 =
.height = LCD_HEIGHT / 2,
.font = FONT_SYSFIXED,
.drawmode = DRMODE_SOLID,
- .xmargin = 0,
- .ymargin = 0,
#if LCD_DEPTH > 1
.fg_pattern = LCD_DEFAULT_FG,
.bg_pattern = LCD_DEFAULT_BG,
@@ -85,8 +81,6 @@ static struct viewport vp2 =
.height = (LCD_HEIGHT / 2),
.font = FONT_UI,
.drawmode = DRMODE_SOLID,
- .xmargin = 0,
- .ymargin = 0,
#if LCD_DEPTH > 1
.fg_pattern = FGCOLOR_1,
.bg_pattern = BGCOLOR_2,
@@ -107,8 +101,6 @@ static struct viewport vp3 =
.height = (LCD_HEIGHT / 4),
.font = FONT_SYSFIXED,
.drawmode = DRMODE_SOLID,
- .xmargin = 0,
- .ymargin = 0,
#if LCD_DEPTH > 1
.fg_pattern = LCD_BLACK,
.bg_pattern = LCD_WHITE,
@@ -130,8 +122,6 @@ static struct viewport rvp0 =
.height = LCD_REMOTE_HEIGHT - 10,
.font = FONT_SYSFIXED,
.drawmode = DRMODE_SOLID,
- .xmargin = 0,
- .ymargin = 0,
#if LCD_REMOTE_DEPTH > 1
.fg_pattern = LCD_REMOTE_BLACK,
.bg_pattern = LCD_REMOTE_LIGHTGRAY,
@@ -146,8 +136,6 @@ static struct viewport rvp1 =
.height = LCD_REMOTE_HEIGHT - 10,
.font = FONT_SYSFIXED,
.drawmode = DRMODE_SOLID,
- .xmargin = 0,
- .ymargin = 0,
#if LCD_REMOTE_DEPTH > 1
.fg_pattern = LCD_REMOTE_DEFAULT_FG,
.bg_pattern = LCD_REMOTE_DEFAULT_BG
@@ -253,8 +241,6 @@ static struct viewport vp0 =
.y = 0,
.width = 5,
.height = 1,
- .xmargin = 0,
- .ymargin = 0,
};
static struct viewport vp1 =
@@ -263,8 +249,6 @@ static struct viewport vp1 =
.y = 0,
.width = 5,
.height = 1,
- .xmargin = 0,
- .ymargin = 0,
};
static struct viewport vp2 =
@@ -273,8 +257,6 @@ static struct viewport vp2 =
.y = 1,
.width = LCD_WIDTH,
.height = 1,
- .xmargin = 0,
- .ymargin = 0,
};
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)
result = menu_run(m);
menu_exit(m);
#ifdef HAVE_LCD_BITMAP
- rb->lcd_setmargins(0,0);
/* Show-scrollbar mode for current view-width mode */
init_need_scrollbar();
@@ -1459,9 +1458,6 @@ static void viewer_menu(void)
break;
}
menu_exit(m);
-#ifdef HAVE_LCD_BITMAP
- rb->lcd_setmargins(0,0);
-#endif
viewer_draw(col);
}
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 @@
#include "action.h"
#include "radio.h"
#include "sound_menu.h"
+#include "viewport.h"
#ifdef HAVE_RECORDING
/* This array holds the record timer interval lengths, in seconds */
@@ -882,6 +883,8 @@ bool recording_screen(bool no_source)
int base_style = STYLE_INVERT;
int style;
+ struct viewport vp[NB_SCREENS];
+ int ymargin = global_settings.cursor_style?0:10;
#ifdef HAVE_LCD_COLOR
if (global_settings.cursor_style == 2) {
base_style |= STYLE_COLORBAR;
@@ -956,11 +959,12 @@ bool recording_screen(bool no_source)
FOR_NB_SCREENS(i)
{
- screens[i].setfont(FONT_SYSFIXED);
+ viewport_set_defaults(&vp[i], i);
+ vp[i].font = FONT_SYSFIXED;
+ screens[i].set_viewport(&vp[i]);
screens[i].getstringsize("M", &w, &h);
- screens[i].setmargins(global_settings.cursor_style ? 0 : w, 8);
- filename_offset[i] = ((screens[i].height >= 80) ? 1 : 0);
- pm_y[i] = 8 + h * (2 + filename_offset[i]);
+ filename_offset[i] = ((vp[i].height >= 80) ? 1 : 0);
+ pm_y[i] = h * (2 + filename_offset[i]);
}
#ifdef HAVE_REMOTE_LCD
@@ -968,8 +972,8 @@ bool recording_screen(bool no_source)
{
screens[1].clear_display();
snprintf(buf, sizeof(buf), str(LANG_REMOTE_LCD_ON));
- screens[1].puts((screens[1].width/w - strlen(buf))/2 + 1,
- screens[1].height/(h*2) + 1, buf);
+ screens[1].puts((vp[1].width/w - strlen(buf))/2 + 1,
+ vp[1].height/(h*2) + 1, buf);
screens[1].update();
gui_syncsplash(0, str(LANG_REMOTE_LCD_OFF));
}
@@ -1363,9 +1367,8 @@ bool recording_screen(bool no_source)
FOR_NB_SCREENS(i)
{
+ screens[i].set_viewport(&vp[i]);
screens[i].setfont(FONT_SYSFIXED);
- screens[i].setmargins(
- global_settings.cursor_style ? 0 : w, 8);
}
}
}
@@ -1613,7 +1616,9 @@ bool recording_screen(bool no_source)
else
{
for(i = 0; i < screen_update; i++)
- screens[i].puts(0, filename_offset[i] + PM_HEIGHT + 2, buf);
+ screens[i].putsxy(ymargin,
+ SYSFONT_HEIGHT*(filename_offset[i]+
+ PM_HEIGHT + 2), buf);
}
if(global_settings.rec_source == AUDIO_SRC_MIC)
@@ -1632,8 +1637,9 @@ bool recording_screen(bool no_source)
else
{
for(i = 0; i < screen_update; i++)
- screens[i].puts(0, filename_offset[i] +
- PM_HEIGHT + 3, buf);
+ screens[i].putsxy(ymargin,
+ SYSFONT_HEIGHT*(filename_offset[i] +
+ PM_HEIGHT + 3), buf);
}
}
else if(0
@@ -1664,8 +1670,9 @@ bool recording_screen(bool no_source)
else
{
for(i = 0; i < screen_update; i++)
- screens[i].puts(0, filename_offset[i] +
- PM_HEIGHT + 3, buf);
+ screens[i].putsxy(ymargin,
+ SYSFONT_HEIGHT*(filename_offset[i] +
+ PM_HEIGHT + 3), buf);
}
snprintf(buf, sizeof(buf), "%s:%s",
@@ -1688,8 +1695,9 @@ bool recording_screen(bool no_source)
else
{
for(i = 0; i < screen_update; i++)
- screens[i].puts(0, filename_offset[i] +
- PM_HEIGHT + 4, buf);
+ screens[i].putsxy(ymargin,
+ SYSFONT_HEIGHT*(filename_offset[i] +
+ PM_HEIGHT + 4), buf);
}
}
#ifdef HAVE_LCD_COLOR
@@ -1721,7 +1729,7 @@ bool recording_screen(bool no_source)
break;
} /* end switch */
#ifdef HAVE_AGC
- if (screens[i].height < h * (2 + filename_offset[i] +
+ if (vp[i].height < h * (2 + filename_offset[i] +
PM_HEIGHT + line[i]))
{
line[i] -= 1;
@@ -1785,8 +1793,9 @@ bool recording_screen(bool no_source)
{
for(i = 0; i < screen_update; i++) {
if (display_agc[i]) {
- screens[i].puts(0, filename_offset[i] +
- PM_HEIGHT + line[i], buf);
+ screens[i].putsxy(ymargin,
+ SYSFONT_HEIGHT*(filename_offset[i] +
+ PM_HEIGHT + line[i]), buf);
}
}
}
@@ -1859,7 +1868,9 @@ bool recording_screen(bool no_source)
for(i = 0; i < screen_update; i++)
{
+ screens[i].set_viewport(NULL);
gui_statusbar_draw(&(statusbars.statusbars[i]), true);
+ screens[i].set_viewport(&vp[i]);
peak_meter_screen(&screens[i], pm_x, pm_y[i], h*PM_HEIGHT);
screens[i].update();
}
@@ -1867,11 +1878,11 @@ bool recording_screen(bool no_source)
/* draw the trigger status */
FOR_NB_SCREENS(i)
{
- trig_width[i] = ((screens[i].height < 64) ||
- ((screens[i].height < 72) && (PM_HEIGHT > 1))) ?
+ trig_width[i] = ((vp[i].height < 64) ||
+ ((vp[i].height < 72) && (PM_HEIGHT > 1))) ?
screens[i].width - 14 * w : screens[i].width;
trig_xpos[i] = screens[i].width - trig_width[i];
- trig_ypos[i] = ((screens[i].height < 72) && (PM_HEIGHT > 1)) ?
+ trig_ypos[i] = ((vp[i].height < 72) && (PM_HEIGHT > 1)) ?
h*2 :
h*(1 + filename_offset[i] + PM_HEIGHT +
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] =
.has_disk_led=true,
#endif
.set_viewport=&lcd_set_viewport,
- .setmargins=&lcd_setmargins,
.getwidth=&lcd_getwidth,
.getheight=&lcd_getheight,
- .getymargin=&lcd_getymargin,
- .getxmargin=&lcd_getxmargin,
.getstringsize=&lcd_getstringsize,
#ifdef HAVE_LCD_BITMAP
.setfont=&lcd_setfont,
@@ -142,11 +139,8 @@ struct screen screens[NB_SCREENS] =
.pixel_format=LCD_REMOTE_PIXELFORMAT,
.has_disk_led=false,
.set_viewport=&lcd_remote_set_viewport,
- .setmargins=&lcd_remote_setmargins,
.getwidth=&lcd_remote_getwidth,
.getheight=&lcd_remote_getheight,
- .getymargin=&lcd_remote_getymargin,
- .getxmargin=&lcd_remote_getxmargin,
.getstringsize=&lcd_remote_getstringsize,
#if 1 /* all remote LCDs are bitmapped so far */
.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
bool has_buttonbar;
#endif
void (*set_viewport)(struct viewport* vp);
- void (*setmargins)(int x, int y);
int (*getwidth)(void);
int (*getheight)(void);
- int (*getxmargin)(void);
- int (*getymargin)(void);
int (*getstringsize)(const unsigned char *str, int *w, int *h);
#if defined(HAVE_LCD_BITMAP) || defined(HAVE_REMOTE_LCD) /* always bitmap */
void (*setfont)(int newfont);
@@ -155,32 +152,6 @@ struct screen
void (*backlight_set_timeout)(int index);
};
-#ifdef HAVE_BUTTONBAR
-/*
- * Sets if the given screen has a buttonbar or not
- * - screen : the screen structure
- * - has : a boolean telling wether the current screen will have a buttonbar or not
- */
-#define screen_has_buttonbar(screen, has_btnb) \
- (screen)->has_buttonbar=has_btnb;
-#endif
-
-/*
- * Sets the x margin in pixels for the given screen
- * - screen : the screen structure
- * - xmargin : the number of pixels to the left of the screen
- */
-#define screen_set_xmargin(screen, xmargin) \
- (screen)->setmargins(xmargin, (screen)->getymargin());
-
-/*
- * Sets the y margin in pixels for the given screen
- * - screen : the screen structure
- * - xmargin : the number of pixels to the top of the screen
- */
-#define screen_set_ymargin(screen, ymargin) \
- (screen)->setmargins((screen)->getxmargin(), ymargin);
-
#if defined(HAVE_LCD_BITMAP) || defined(HAVE_REMOTE_LCD)
/*
* Clear only a given area of the screen
diff --git a/firmware/drivers/lcd-16bit.c b/firmware/drivers/lcd-16bit.c
index 020d6bf63a..a5b7533cc1 100644
--- a/firmware/drivers/lcd-16bit.c
+++ b/firmware/drivers/lcd-16bit.c
@@ -61,8 +61,6 @@ static struct viewport default_vp =
.height = LCD_HEIGHT,
.font = FONT_SYSFIXED,
.drawmode = DRMODE_SOLID,
- .xmargin = 0,
- .ymargin = 0,
.fg_pattern = LCD_DEFAULT_FG,
.bg_pattern = LCD_DEFAULT_BG,
.lss_pattern = LCD_DEFAULT_BG,
@@ -180,12 +178,6 @@ void lcd_set_drawinfo(int mode, unsigned fg_color, unsigned bg_color)
current_vp->bg_pattern = bg_color;
}
-void lcd_setmargins(int x, int y)
-{
- current_vp->xmargin = x;
- current_vp->ymargin = y;
-}
-
int lcd_getwidth(void)
{
return current_vp->width;
@@ -196,16 +188,6 @@ int lcd_getheight(void)
return current_vp->height;
}
-int lcd_getxmargin(void)
-{
- return current_vp->xmargin;
-}
-
-int lcd_getymargin(void)
-{
- return current_vp->ymargin;
-}
-
void lcd_setfont(int newfont)
{
current_vp->font = newfont;
@@ -1005,8 +987,8 @@ void lcd_puts_style_offset(int x, int y, const unsigned char *str, int style,
return;
lcd_getstringsize(str, &w, &h);
- xpos = current_vp->xmargin + x*w / utf8length(str);
- ypos = current_vp->ymargin + y*h;
+ xpos = x*w / utf8length(str);
+ ypos = y*h;
current_vp->drawmode = (style & STYLE_INVERT) ?
(DRMODE_SOLID|DRMODE_INVERSEVID) : DRMODE_SOLID;
if (style & STYLE_COLORED) {
@@ -1081,7 +1063,7 @@ void lcd_puts_scroll_style_offset(int x, int y, const unsigned char *string,
lcd_getstringsize(string, &w, &h);
- if (current_vp->width - x * 8 - current_vp->xmargin < w) {
+ if (current_vp->width - x * 8 < w) {
/* prepare scroll line */
char *end;
@@ -1094,7 +1076,7 @@ void lcd_puts_scroll_style_offset(int x, int y, const unsigned char *string,
/* scroll bidirectional or forward only depending on the string
width */
if ( lcd_scroll_info.bidir_limit ) {
- s->bidir = s->width < (current_vp->width - current_vp->xmargin) *
+ s->bidir = s->width < (current_vp->width) *
(100 + lcd_scroll_info.bidir_limit) / 100;
}
else
@@ -1113,7 +1095,7 @@ void lcd_puts_scroll_style_offset(int x, int y, const unsigned char *string,
s->y = y;
s->len = utf8length(string);
s->offset = offset;
- s->startx = current_vp->xmargin + x * s->width / s->len;
+ s->startx = x * s->width / s->len;
s->backward = false;
lcd_scroll_info.lines++;
}
@@ -1159,7 +1141,7 @@ void lcd_scroll_fn(void)
pf = font_get(current_vp->font);
xpos = s->startx;
- ypos = current_vp->ymargin + s->y * pf->height;
+ ypos = s->y * pf->height;
if (s->bidir) { /* scroll bidirectional */
if (s->offset <= 0) {
diff --git a/firmware/drivers/lcd-1bit-vert.c b/firmware/drivers/lcd-1bit-vert.c
index c6fe40cdb7..ffc78bd53a 100644
--- a/firmware/drivers/lcd-1bit-vert.c
+++ b/firmware/drivers/lcd-1bit-vert.c
@@ -56,8 +56,6 @@ static struct viewport default_vp =
.height = LCDM(HEIGHT),
.font = FONT_SYSFIXED,
.drawmode = DRMODE_SOLID,
- .xmargin = 0,
- .ymargin = 0,
};
static struct viewport* current_vp = &default_vp;
@@ -107,22 +105,6 @@ int LCDFN(get_drawmode)(void)
return current_vp->drawmode;
}
-void LCDFN(setmargins)(int x, int y)
-{
- current_vp->xmargin = x;
- current_vp->ymargin = y;
-}
-
-int LCDFN(getxmargin)(void)
-{
- return current_vp->xmargin;
-}
-
-int LCDFN(getymargin)(void)
-{
- return current_vp->ymargin;
-}
-
int LCDFN(getwidth)(void)
{
return current_vp->width;
@@ -760,8 +742,8 @@ void LCDFN(puts_style_offset)(int x, int y, const unsigned char *str,
return;
LCDFN(getstringsize)(str, &w, &h);
- xpos = current_vp->xmargin + x*w / utf8length(str);
- ypos = current_vp->ymargin + y*h;
+ xpos = x*w / utf8length(str);
+ ypos = y*h;
current_vp->drawmode = (style & STYLE_INVERT) ?
(DRMODE_SOLID|DRMODE_INVERSEVID) : DRMODE_SOLID;
LCDFN(putsxyofs)(xpos, ypos, offset, str);
@@ -816,7 +798,7 @@ void LCDFN(puts_scroll_style_offset)(int x, int y, const unsigned char *string,
LCDFN(getstringsize)(string, &w, &h);
- if (current_vp->width - x * 8 - current_vp->xmargin < w) {
+ if (current_vp->width - x * 8 < w) {
/* prepare scroll line */
char *end;
@@ -829,7 +811,7 @@ void LCDFN(puts_scroll_style_offset)(int x, int y, const unsigned char *string,
/* scroll bidirectional or forward only depending on the string
width */
if ( LCDFN(scroll_info).bidir_limit ) {
- s->bidir = s->width < (current_vp->width - current_vp->xmargin) *
+ s->bidir = s->width < (current_vp->width) *
(100 + LCDFN(scroll_info).bidir_limit) / 100;
}
else
@@ -848,7 +830,7 @@ void LCDFN(puts_scroll_style_offset)(int x, int y, const unsigned char *string,
s->y = y;
s->len = utf8length(string);
s->offset = offset;
- s->startx = current_vp->xmargin + x * s->width / s->len;;
+ s->startx = x * s->width / s->len;;
s->backward = false;
LCDFN(scroll_info).lines++;
@@ -880,7 +862,7 @@ void LCDFN(scroll_fn)(void)
pf = font_get(current_vp->font);
xpos = s->startx;
- ypos = current_vp->ymargin + s->y * pf->height;
+ ypos = s->y * pf->height;
if (s->bidir) { /* scroll bidirectional */
if (s->offset <= 0) {
diff --git a/firmware/drivers/lcd-2bit-horz.c b/firmware/drivers/lcd-2bit-horz.c
index 30901efb98..0818c29d47 100644
--- a/firmware/drivers/lcd-2bit-horz.c
+++ b/firmware/drivers/lcd-2bit-horz.c
@@ -54,8 +54,6 @@ static struct viewport default_vp =
.height = LCD_HEIGHT,
.font = FONT_SYSFIXED,
.drawmode = DRMODE_SOLID,
- .xmargin = 0,
- .ymargin = 0,
.fg_pattern = LCD_DEFAULT_FG,
.bg_pattern = LCD_DEFAULT_BG
};
@@ -141,22 +139,6 @@ void lcd_set_drawinfo(int mode, unsigned fg_brightness, unsigned bg_brightness)
lcd_set_background(bg_brightness);
}
-void lcd_setmargins(int x, int y)
-{
- current_vp->xmargin = x;
- current_vp->ymargin = y;
-}
-
-int lcd_getxmargin(void)
-{
- return current_vp->xmargin;
-}
-
-int lcd_getymargin(void)
-{
- return current_vp->ymargin;
-}
-
int lcd_getwidth(void)
{
return current_vp->width;
@@ -950,8 +932,8 @@ void lcd_puts_style_offset(int x, int y, const unsigned char *str,
return;
lcd_getstringsize(str, &w, &h);
- xpos = current_vp->xmargin + x*w / utf8length((char *)str);
- ypos = current_vp->ymargin + y*h;
+ xpos = x*w / utf8length((char *)str);
+ ypos = y*h;
current_vp->drawmode = (style & STYLE_INVERT) ?
(DRMODE_SOLID|DRMODE_INVERSEVID) : DRMODE_SOLID;
lcd_putsxyofs(xpos, ypos, offset, str);
@@ -1003,7 +985,7 @@ void lcd_puts_scroll_style_offset(int x, int y, const unsigned char *string,
lcd_getstringsize(string, &w, &h);
- if (current_vp->width - x * 8 - current_vp->xmargin < w) {
+ if (current_vp->width - x * 8 < w) {
/* prepare scroll line */
char *end;
@@ -1016,7 +998,7 @@ void lcd_puts_scroll_style_offset(int x, int y, const unsigned char *string,
/* scroll bidirectional or forward only depending on the string
width */
if ( lcd_scroll_info.bidir_limit ) {
- s->bidir = s->width < (current_vp->width - current_vp->xmargin) *
+ s->bidir = s->width < (current_vp->width) *
(100 + lcd_scroll_info.bidir_limit) / 100;
}
else
@@ -1035,7 +1017,7 @@ void lcd_puts_scroll_style_offset(int x, int y, const unsigned char *string,
s->y = y;
s->len = utf8length((char *)string);
s->offset = offset;
- s->startx = current_vp->xmargin + x * s->width / s->len;;
+ s->startx = x * s->width / s->len;;
s->backward = false;
lcd_scroll_info.lines++;
}
@@ -1066,7 +1048,7 @@ void lcd_scroll_fn(void)
pf = font_get(current_vp->font);
xpos = s->startx;
- ypos = current_vp->ymargin + s->y * pf->height;
+ ypos = s->y * pf->height;
if (s->bidir) { /* scroll bidirectional */
if (s->offset <= 0) {
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 =
.height = LCD_HEIGHT,
.font = FONT_SYSFIXED,
.drawmode = DRMODE_SOLID,
- .xmargin = 0,
- .ymargin = 0,
.fg_pattern = LCD_DEFAULT_FG,
.bg_pattern = LCD_DEFAULT_BG
};
@@ -144,22 +142,6 @@ void lcd_set_drawinfo(int mode, unsigned fg_brightness, unsigned bg_brightness)
lcd_set_background(bg_brightness);
}
-void lcd_setmargins(int x, int y)
-{
- current_vp->xmargin = x;
- current_vp->ymargin = y;
-}
-
-int lcd_getxmargin(void)
-{
- return current_vp->xmargin;
-}
-
-int lcd_getymargin(void)
-{
- return current_vp->ymargin;
-}
-
int lcd_getwidth(void)
{
return current_vp->width;
@@ -1088,8 +1070,8 @@ void lcd_puts_style_offset(int x, int y, const unsigned char *str,
return;
lcd_getstringsize(str, &w, &h);
- xpos = current_vp->xmargin + x*w / utf8length((char *)str);
- ypos = current_vp->ymargin + y*h;
+ xpos = x*w / utf8length((char *)str);
+ ypos = y*h;
current_vp->drawmode = (style & STYLE_INVERT) ?
(DRMODE_SOLID|DRMODE_INVERSEVID) : DRMODE_SOLID;
lcd_putsxyofs(xpos, ypos, offset, str);
@@ -1142,7 +1124,7 @@ void lcd_puts_scroll_style_offset(int x, int y, const unsigned char *string,
lcd_getstringsize(string, &w, &h);
- if (current_vp->width - x * 8 - current_vp->xmargin < w) {
+ if (current_vp->width - x * 8< w) {
/* prepare scroll line */
char *end;
@@ -1155,7 +1137,7 @@ void lcd_puts_scroll_style_offset(int x, int y, const unsigned char *string,
/* scroll bidirectional or forward only depending on the string
width */
if ( lcd_scroll_info.bidir_limit ) {
- s->bidir = s->width < (current_vp->width - current_vp->xmargin) *
+ s->bidir = s->width < (current_vp->width) *
(100 + lcd_scroll_info.bidir_limit) / 100;
}
else
@@ -1174,7 +1156,7 @@ void lcd_puts_scroll_style_offset(int x, int y, const unsigned char *string,
s->y = y;
s->len = utf8length((char *)string);
s->offset = offset;
- s->startx = current_vp->xmargin + x * s->width / s->len;
+ s->startx = x * s->width / s->len;
s->backward = false;
lcd_scroll_info.lines++;
@@ -1206,7 +1188,7 @@ void lcd_scroll_fn(void)
pf = font_get(current_vp->font);
xpos = s->startx;
- ypos = current_vp->ymargin + s->y * pf->height;
+ ypos = s->y * pf->height;
if (s->bidir) { /* scroll bidirectional */
if (s->offset <= 0) {
diff --git a/firmware/drivers/lcd-2bit-vi.c b/firmware/drivers/lcd-2bit-vi.c
index 7d97f19174..9decc0cbab 100644
--- a/firmware/drivers/lcd-2bit-vi.c
+++ b/firmware/drivers/lcd-2bit-vi.c
@@ -60,8 +60,6 @@ static struct viewport default_vp =
.height = LCDM(HEIGHT),
.font = FONT_SYSFIXED,
.drawmode = DRMODE_SOLID,
- .xmargin = 0,
- .ymargin = 0,
.fg_pattern = LCDM(DEFAULT_FG),
.bg_pattern = LCDM(DEFAULT_BG)
};
@@ -175,23 +173,6 @@ int LCDFN(getheight)(void)
{
return current_vp->height;
}
-
-void LCDFN(setmargins)(int x, int y)
-{
- current_vp->xmargin = x;
- current_vp->ymargin = y;
-}
-
-int LCDFN(getxmargin)(void)
-{
- return current_vp->xmargin;
-}
-
-int LCDFN(getymargin)(void)
-{
- return current_vp->ymargin;
-}
-
void LCDFN(setfont)(int newfont)
{
current_vp->font = newfont;
@@ -1105,8 +1086,8 @@ void LCDFN(puts_style_offset)(int x, int y, const unsigned char *str,
return;
LCDFN(getstringsize)(str, &w, &h);
- xpos = current_vp->xmargin + x*w / utf8length((char *)str);
- ypos = current_vp->ymargin + y*h;
+ xpos = x*w / utf8length((char *)str);
+ ypos = y*h;
current_vp->drawmode = (style & STYLE_INVERT) ?
(DRMODE_SOLID|DRMODE_INVERSEVID) : DRMODE_SOLID;
LCDFN(putsxyofs)(xpos, ypos, offset, str);
@@ -1158,7 +1139,7 @@ void LCDFN(puts_scroll_style_offset)(int x, int y, const unsigned char *string,
LCDFN(getstringsize)(string, &w, &h);
- if (current_vp->width - x * 8 - current_vp->xmargin < w) {
+ if (current_vp->width - x * 8 < w) {
/* prepare scroll line */
char *end;
@@ -1171,7 +1152,7 @@ void LCDFN(puts_scroll_style_offset)(int x, int y, const unsigned char *string,
/* scroll bidirectional or forward only depending on the string
width */
if ( LCDFN(scroll_info).bidir_limit ) {
- s->bidir = s->width < (current_vp->width - current_vp->xmargin) *
+ s->bidir = s->width < (current_vp->width) *
(100 + LCDFN(scroll_info).bidir_limit) / 100;
}
else
@@ -1190,7 +1171,7 @@ void LCDFN(puts_scroll_style_offset)(int x, int y, const unsigned char *string,
s->y = y;
s->len = utf8length((char *)string);
s->offset = offset;
- s->startx = current_vp->xmargin + x * s->width / s->len;
+ s->startx = x * s->width / s->len;
s->backward = false;
LCDFN(scroll_info).lines++;
@@ -1222,7 +1203,7 @@ void LCDFN(scroll_fn)(void)
pf = font_get(current_vp->font);
xpos = s->startx;
- ypos = current_vp->ymargin + s->y * pf->height;
+ ypos = s->y * pf->height;
if (s->bidir) { /* scroll bidirectional */
if (s->offset <= 0) {
diff --git a/firmware/drivers/lcd-charcell.c b/firmware/drivers/lcd-charcell.c
index 1bc634cd2f..1c43b83ab1 100644
--- a/firmware/drivers/lcd-charcell.c
+++ b/firmware/drivers/lcd-charcell.c
@@ -58,8 +58,6 @@ static struct viewport default_vp =
.y = 0,
.width = LCD_WIDTH,
.height = LCD_HEIGHT,
- .xmargin = 0,
- .ymargin = 0,
};
static struct viewport* current_vp = &default_vp;
@@ -92,22 +90,6 @@ void lcd_update_viewport(void)
/** parameter handling **/
-void lcd_setmargins(int x, int y)
-{
- current_vp->xmargin = x;
- current_vp->ymargin = y;
-}
-
-int lcd_getxmargin(void)
-{
- return current_vp->xmargin;
-}
-
-int lcd_getymargin(void)
-{
- return current_vp->ymargin;
-}
-
int lcd_getwidth(void)
{
return current_vp->width;
@@ -484,7 +466,7 @@ void lcd_puts_scroll_offset(int x, int y, const unsigned char *string,
lcd_puts_offset(x, y, string, offset);
len = utf8length(string);
- if (current_vp->width - x - current_vp->xmargin < len)
+ if (current_vp->width - x < len)
{
/* prepare scroll line */
char *end;
@@ -498,7 +480,7 @@ void lcd_puts_scroll_offset(int x, int y, const unsigned char *string,
/* scroll bidirectional or forward only depending on the string width */
if (lcd_scroll_info.bidir_limit)
{
- s->bidir = s->len < (current_vp->width - current_vp->xmargin) *
+ s->bidir = s->len < (current_vp->width) *
(100 + lcd_scroll_info.bidir_limit) / 100;
}
else
@@ -517,7 +499,7 @@ void lcd_puts_scroll_offset(int x, int y, const unsigned char *string,
s->vp = current_vp;
s->y = y;
s->offset = offset;
- s->startx = current_vp->xmargin + x;
+ s->startx = x;
s->backward = false;
lcd_scroll_info.lines++;
}
@@ -547,7 +529,7 @@ void lcd_scroll_fn(void)
s->offset++;
xpos = s->startx;
- ypos = current_vp->ymargin + s->y;
+ ypos = s->y;
if (s->bidir) /* scroll bidirectional */
{
diff --git a/firmware/export/events.h b/firmware/export/events.h
index ede21017b0..bf0485b111 100644
--- a/firmware/export/events.h
+++ b/firmware/export/events.h
@@ -30,6 +30,7 @@
#define EVENT_CLASS_DISK 0x0100
#define EVENT_CLASS_PLAYBACK 0x0200
#define EVENT_CLASS_BUFFERING 0x0400
+#define EVENT_CLASS_GUI 0x0800
/**
* Because same playback events are used in mpeg.c and playback.c, define
diff --git a/firmware/export/lcd-remote.h b/firmware/export/lcd-remote.h
index bccc1e4b29..6d71834fe7 100644
--- a/firmware/export/lcd-remote.h
+++ b/firmware/export/lcd-remote.h
@@ -144,9 +144,6 @@ extern void lcd_remote_set_flip(bool yesno);
extern void lcd_remote_set_drawmode(int mode);
extern int lcd_remote_get_drawmode(void);
-extern void lcd_remote_setmargins(int xmargin, int ymargin);
-extern int lcd_remote_getxmargin(void);
-extern int lcd_remote_getymargin(void);
extern int lcd_remote_getwidth(void);
extern int lcd_remote_getheight(void);
extern void lcd_remote_setfont(int font);
diff --git a/firmware/export/lcd.h b/firmware/export/lcd.h
index a7f4d7e471..b68efb1b1c 100644
--- a/firmware/export/lcd.h
+++ b/firmware/export/lcd.h
@@ -33,8 +33,6 @@ struct viewport {
int font;
int drawmode;
#endif
- int xmargin; /* During the transition only - to be removed */
- int ymargin; /* During the transition only - to be removed */
#if LCD_DEPTH > 1
unsigned fg_pattern;
unsigned bg_pattern;
@@ -105,9 +103,6 @@ extern void lcd_init_device(void);
extern void lcd_backlight(bool on);
extern int lcd_default_contrast(void);
extern void lcd_set_contrast(int val);
-extern void lcd_setmargins(int xmargin, int ymargin);
-extern int lcd_getxmargin(void);
-extern int lcd_getymargin(void);
extern int lcd_getwidth(void);
extern int lcd_getheight(void);
extern int lcd_getstringsize(const unsigned char *str, int *w, int *h);
diff --git a/firmware/logf.c b/firmware/logf.c
index da05a0a0c7..0d57d45929 100644
--- a/firmware/logf.c
+++ b/firmware/logf.c
@@ -59,7 +59,6 @@ static void displayremote(void)
lcd_remote_getstringsize("A", &w, &h);
lines = LCD_REMOTE_HEIGHT/h;
columns = LCD_REMOTE_WIDTH/w;
- lcd_remote_setmargins(0, 0);
lcd_remote_clear_display();
index = logfindex;
diff --git a/firmware/target/arm/imx31/debug-imx31.c b/firmware/target/arm/imx31/debug-imx31.c
index 614a703836..22293b31d8 100644
--- a/firmware/target/arm/imx31/debug-imx31.c
+++ b/firmware/target/arm/imx31/debug-imx31.c
@@ -38,7 +38,6 @@ bool __dbg_hw_info(void)
unsigned int freq;
uint32_t regval;
- lcd_setmargins(0, 0);
lcd_clear_display();
lcd_setfont(FONT_SYSFIXED);
@@ -158,7 +157,6 @@ bool __dbg_ports(void)
uint32_t pmic_regs[ARRAYLEN(pmic_regset)];
- lcd_setmargins(0, 0);
lcd_clear_display();
lcd_setfont(FONT_SYSFIXED);
diff --git a/firmware/target/arm/s3c2440/debug-s3c2440.c b/firmware/target/arm/s3c2440/debug-s3c2440.c
index 5a55d462e2..af1d1618b1 100644
--- a/firmware/target/arm/s3c2440/debug-s3c2440.c
+++ b/firmware/target/arm/s3c2440/debug-s3c2440.c
@@ -38,7 +38,6 @@ bool __dbg_ports(void)
char buf[50];
int line;
- lcd_setmargins(0, 0);
lcd_clear_display();
lcd_setfont(FONT_SYSFIXED);
diff --git a/firmware/target/arm/tcc77x/debug-tcc77x.c b/firmware/target/arm/tcc77x/debug-tcc77x.c
index dc3db3926f..aabbebbe41 100644
--- a/firmware/target/arm/tcc77x/debug-tcc77x.c
+++ b/firmware/target/arm/tcc77x/debug-tcc77x.c
@@ -40,7 +40,6 @@ bool __dbg_hw_info(void)
bool done=false;
char buf[100];
- lcd_setmargins(0, 0);
lcd_setfont(FONT_SYSFIXED);
lcd_clear_display();
diff --git a/firmware/target/arm/tcc780x/debug-tcc780x.c b/firmware/target/arm/tcc780x/debug-tcc780x.c
index 14aa8c1c10..a56d29526a 100644
--- a/firmware/target/arm/tcc780x/debug-tcc780x.c
+++ b/firmware/target/arm/tcc780x/debug-tcc780x.c
@@ -44,7 +44,6 @@ bool __dbg_hw_info(void)
bool done=false;
char buf[100];
- lcd_setmargins(0, 0);
lcd_setfont(FONT_SYSFIXED);
lcd_clear_display();
diff --git a/firmware/target/arm/tms320dm320/debug-dm320.c b/firmware/target/arm/tms320dm320/debug-dm320.c
index 894f99c88d..1b3086de9a 100755
--- a/firmware/target/arm/tms320dm320/debug-dm320.c
+++ b/firmware/target/arm/tms320dm320/debug-dm320.c
@@ -48,7 +48,6 @@ bool __dbg_hw_info(void)
bool done=false;
char buf[100];
- lcd_setmargins(0, 0);
lcd_setfont(FONT_SYSFIXED);
lcd_clear_display();