diff -u -r rockbox_svn.orig/apps/alarm_menu.c rockbox_svn/apps/alarm_menu.c --- rockbox_svn.orig/apps/alarm_menu.c 2007-07-23 20:59:31.062500000 -0500 +++ rockbox_svn/apps/alarm_menu.c 2007-08-31 22:05:15.781250000 -0500 @@ -70,7 +70,7 @@ { FOR_NB_SCREENS(i) { - screens[i].setmargins(0, 0); + screens[i].setmargins(0, screens[i].width, 0); gui_textarea_clear(&screens[i]); screens[i].puts(0, 3, str(LANG_ALARM_MOD_KEYS)); } diff -u -r rockbox_svn.orig/apps/debug_menu.c rockbox_svn/apps/debug_menu.c --- rockbox_svn.orig/apps/debug_menu.c 2007-08-26 17:53:58.000000000 -0500 +++ rockbox_svn/apps/debug_menu.c 2007-08-31 22:05:15.812500000 -0500 @@ -266,7 +266,7 @@ char buf[32]; struct audio_debug d; - lcd_setmargins(0, 0); + lcd_setmargins(0, LCD_WIDTH, 0); lcd_setfont(FONT_SYSFIXED); while(1) @@ -338,7 +338,7 @@ tick_add_task(dbg_audio_task); - lcd_setmargins(0, 0); + lcd_setmargins(0, LCD_WIDTH, 0); lcd_setfont(FONT_SYSFIXED); while(!done) { @@ -529,7 +529,7 @@ system_memory_guard(oldmode); /* re-enable memory guard */ - lcd_setmargins(0, 0); + lcd_setmargins(0, LCD_WIDTH, 0); lcd_setfont(FONT_SYSFIXED); lcd_clear_display(); @@ -580,7 +580,7 @@ system_memory_guard(oldmode); /* re-enable memory guard */ - lcd_setmargins(0, 0); + lcd_setmargins(0, LCD_WIDTH, 0); lcd_setfont(FONT_SYSFIXED); lcd_clear_display(); @@ -631,7 +631,7 @@ (PP_VER1 >> 24) & 0xff, (PP_VER1 >> 16) & 0xff, (PP_VER1 >> 8) & 0xff, (PP_VER1) & 0xff, '\0' }; - lcd_setmargins(0, 0); + lcd_setmargins(0, LCD_WIDTH, 0); lcd_setfont(FONT_SYSFIXED); lcd_clear_display(); @@ -821,7 +821,7 @@ 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_setmargins(0, LCD_WIDTH, 0); lcd_clear_display(); lcd_setfont(FONT_SYSFIXED); @@ -1025,7 +1025,7 @@ int adc_battery_voltage, adc_battery_level; lcd_setfont(FONT_SYSFIXED); - lcd_setmargins(0, 0); + lcd_setmargins(0, LCD_WIDTH, 0); lcd_clear_display(); while(1) @@ -1071,7 +1071,7 @@ char buf[128]; int line; - lcd_setmargins(0, 0); + lcd_setmargins(0, LCD_WIDTH ,0); lcd_clear_display(); lcd_setfont(FONT_SYSFIXED); @@ -1151,7 +1151,7 @@ char buf[128]; int line; - lcd_setmargins(0, 0); + lcd_setmargins(0, LCD_WIDTH, 0); lcd_clear_display(); lcd_setfont(FONT_SYSFIXED); @@ -1250,7 +1250,7 @@ char buf[128]; int line; - lcd_setmargins(0, 0); + lcd_setmargins(0, LCD_WIDTH, 0); lcd_clear_display(); lcd_setfont(FONT_SYSFIXED); @@ -1292,7 +1292,7 @@ char buf[50]; int line; - lcd_setmargins(0, 0); + lcd_setmargins(0, LCD_WIDTH, 0); lcd_clear_display(); lcd_setfont(FONT_SYSFIXED); @@ -1433,7 +1433,7 @@ int button; #ifdef HAVE_LCD_BITMAP - lcd_setmargins(0, 0); + lcd_setmargins(0, LCD_WIDTH, 0); lcd_setfont(FONT_SYSFIXED); #endif lcd_clear_display(); @@ -1494,7 +1494,7 @@ unsigned short maxv, minv; char buf[32]; - lcd_setmargins(0, 0); + lcd_setmargins(0, LCD_WIDTH, 0); lcd_setfont(FONT_SYSFIXED); while(1) @@ -2119,7 +2119,7 @@ static bool dbg_lcd_power_off(void) { - lcd_setmargins(0, 0); + lcd_setmargins(0, LCD_WIDTH, 0); while(1) { @@ -2202,7 +2202,7 @@ int lines = LCD_HEIGHT/SYSFONT_HEIGHT; char *str; bool done; - lcd_setmargins(0, 0); + lcd_setmargins(0, LCD_WIDTH, 0); lcd_setfont(FONT_SYSFIXED); str = cpu_boost_log_getlog_first(); while (i < count) Only in rockbox_svn/apps: debug_menu.c.orig diff -u -r rockbox_svn.orig/apps/gui/gwps-common.c rockbox_svn/apps/gui/gwps-common.c --- rockbox_svn.orig/apps/gui/gwps-common.c 2007-08-18 00:36:35.046875000 -0500 +++ rockbox_svn/apps/gui/gwps-common.c 2007-08-31 22:05:15.875000000 -0500 @@ -21,6 +21,7 @@ #include #include #include +#include #include "system.h" #include "settings.h" #include "rbunicode.h" @@ -1338,6 +1339,14 @@ return NULL; #endif + case WPS_TOKEN_ALIGN_SCROLLMARGIN_LEFT: + gwps->display->setmargins( token->value.i, gwps->display->getrightmargin(), gwps->display->getymargin() ); + return NULL; + + case WPS_TOKEN_ALIGN_SCROLLMARGIN_RIGHT: + gwps->display->setmargins( gwps->display->getleftmargin(), token->value.i, gwps->display->getymargin() ); + return NULL; + default: return NULL; } @@ -1664,6 +1673,7 @@ int ypos; int space_width; int string_height; + const int scroll_width = display->getrightmargin()-display->getleftmargin(); /* calculate different string sizes and positions */ display->getstringsize((unsigned char *)" ", &space_width, &string_height); @@ -1674,7 +1684,7 @@ else { left_width = 0; } - left_xpos = 0; + left_xpos = display->getleftmargin(); if (format_align->center != 0) { display->getstringsize((unsigned char *)format_align->center, @@ -1683,7 +1693,7 @@ else { center_width = 0; } - center_xpos=(display->width - center_width) / 2; + center_xpos=(display->getrightmargin() + display->getleftmargin() - center_width)/2; if (format_align->right != 0) { display->getstringsize((unsigned char *)format_align->right, @@ -1692,7 +1702,7 @@ else { right_width = 0; } - right_xpos = (display->width - right_width); + right_xpos = (display->getrightmargin() - right_width); /* Checks for overlapping strings. If needed the overlapping strings will be merged, separated by a @@ -1707,7 +1717,7 @@ *(--format_align->center) = ' '; /* calculate the new width and position of the merged string */ left_width = left_width + space_width + center_width; - left_xpos = 0; + /* left_xpos unchanged */ /* there is no centered string anymore */ center_width = 0; } @@ -1718,7 +1728,7 @@ format_align->left = format_align->center; /* calculate the new width and position of the string */ left_width = center_width; - left_xpos = 0; + /* left_xpos unchanged */ /* there is no centered string anymore */ center_width = 0; } @@ -1734,7 +1744,7 @@ format_align->right = format_align->center; /* calculate the new width and position of the merged string */ right_width = center_width + space_width + right_width; - right_xpos = (display->width - right_width); + right_xpos = (display->getrightmargin() - right_width); /* there is no centered string anymore */ center_width = 0; } @@ -1745,7 +1755,7 @@ format_align->right = format_align->center; /* calculate the new width and position of the string */ right_width = center_width; - right_xpos = (display->width - right_width); + right_xpos = (display->getrightmargin() - right_width); /* there is no centered string anymore */ center_width = 0; } @@ -1761,7 +1771,7 @@ *(--format_align->right) = ' '; /* calculate the new width and position of the string */ left_width = left_width + space_width + right_width; - left_xpos = 0; + /* left_xpos unchanged */ /* there is no right string anymore */ right_width = 0; } @@ -1772,7 +1782,7 @@ format_align->left = format_align->right; /* calculate the new width and position of the string */ left_width = right_width; - left_xpos = 0; + /* left_xpos unchanged */ /* there is no right string anymore */ right_width = 0; } @@ -1780,7 +1790,7 @@ ypos = (line * string_height) + display->getymargin(); - if (scroll && left_width > display->width) + if (scroll && ( left_width > scroll_width || center_width > scroll_width || right_width > scroll_width ) ) { display->puts_scroll(0, line, (unsigned char *)format_align->left); Only in rockbox_svn/apps/gui: gwps-common.c.orig diff -u -r rockbox_svn.orig/apps/gui/gwps.c rockbox_svn/apps/gui/gwps.c --- rockbox_svn.orig/apps/gui/gwps.c 2007-08-26 17:53:55.671875000 -0500 +++ rockbox_svn/apps/gui/gwps.c 2007-08-31 22:05:15.921875000 -0500 @@ -84,11 +84,10 @@ { int offset = 0; struct wps_data *data = gwps->data; - if(data->wps_sb_tag && data->show_sb_on_wps) + if((data->wps_sb_tag && data->show_sb_on_wps) || + (global_settings.statusbar && !data->wps_sb_tag)) offset = STATUSBAR_HEIGHT; - else if ( global_settings.statusbar && !data->wps_sb_tag) - offset = STATUSBAR_HEIGHT; - gwps->display->setmargins(0, offset); + gwps->display->setmargins(0, gwps->display->width, offset); } #endif diff -u -r rockbox_svn.orig/apps/gui/gwps.h rockbox_svn/apps/gui/gwps.h --- rockbox_svn.orig/apps/gui/gwps.h 2007-08-08 21:59:56.640625000 -0500 +++ rockbox_svn/apps/gui/gwps.h 2007-08-31 22:05:15.953125000 -0500 @@ -107,6 +107,8 @@ WPS_TOKEN_ALIGN_LEFT, WPS_TOKEN_ALIGN_CENTER, WPS_TOKEN_ALIGN_RIGHT, + WPS_TOKEN_ALIGN_SCROLLMARGIN_LEFT, + WPS_TOKEN_ALIGN_SCROLLMARGIN_RIGHT, /* Sublines */ WPS_TOKEN_SUBLINE_TIMEOUT, diff -u -r rockbox_svn.orig/apps/gui/list.c rockbox_svn/apps/gui/list.c --- rockbox_svn.orig/apps/gui/list.c 2007-08-31 22:04:01.062500000 -0500 +++ rockbox_svn/apps/gui/list.c 2007-08-31 22:05:16.000000000 -0500 @@ -147,7 +147,7 @@ int line_ypos=display->getymargin()+display->char_height*selected_line; if (global_settings.invert_cursor) { - int line_xpos=display->getxmargin(); + int line_xpos=display->getleftmargin(); display->set_drawmode(DRMODE_COMPLEMENT); display->fillrect(line_xpos, line_ypos, display->width, display->char_height); @@ -219,7 +219,7 @@ static int last_lines[NB_SCREENS] = {0}; #ifdef HAVE_LCD_BITMAP int item_offset; - int old_margin = display->getxmargin(); + int old_margin = display->getleftmargin(); #endif int start, end; bool partial_draw = false; Only in rockbox_svn/apps/gui: list.c.orig diff -u -r rockbox_svn.orig/apps/gui/wps_parser.c rockbox_svn/apps/gui/wps_parser.c --- rockbox_svn.orig/apps/gui/wps_parser.c 2007-08-08 21:59:56.671875000 -0500 +++ rockbox_svn/apps/gui/wps_parser.c 2007-08-31 22:05:16.046875000 -0500 @@ -113,6 +113,8 @@ struct wps_token *token, struct wps_data *wps_data); static int parse_dir_level(const char *wps_bufptr, struct wps_token *token, struct wps_data *wps_data); +static int parse_scrollmargins(const char *wps_bufptr, + struct wps_token *token, struct wps_data *wps_data); #ifdef HAVE_LCD_BITMAP static int parse_image_special(const char *wps_bufptr, struct wps_token *token, struct wps_data *wps_data); @@ -286,6 +288,7 @@ #if (LCD_DEPTH > 1) || (defined(HAVE_LCD_REMOTE) && (LCD_REMOTE_DEPTH > 1)) { WPS_TOKEN_IMAGE_BACKDROP, "X", 0, parse_image_special }, #endif + { WPS_NO_TOKEN, "m", 0, parse_scrollmargins }, #endif { WPS_TOKEN_UNKNOWN, "", 0, NULL } @@ -606,6 +609,33 @@ #endif } +static int parse_scrollmargins(const char *wps_bufptr, struct wps_token *token, struct wps_data *wps_data) +{ + /* valid tag looks like %m|12|34| */ + if(*wps_bufptr == '|') + { + const char * _pleft = wps_bufptr + 1; + const char * _pright = NULL, * _pend = NULL; + if( isdigit(*_pleft) && ( _pright = strchr( _pleft, '|' ) ) ) + { + _pright++; + if( isdigit(*_pright) && ( _pend = strchr( _pright, '|' ) ) ) + { + wps_data->num_tokens += 2; + token->type = WPS_TOKEN_ALIGN_SCROLLMARGIN_LEFT; + token->value.i = atoi(_pleft); + token++; + token->type = WPS_TOKEN_ALIGN_SCROLLMARGIN_RIGHT; + token->value.i = atoi(_pright); + + return( _pend - wps_bufptr + 1 ); + } + } + } + + return(0); +} + /* 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) { Only in rockbox_svn/apps/gui: wps_parser.c.orig diff -u -r rockbox_svn.orig/apps/logfdisp.c rockbox_svn/apps/logfdisp.c --- rockbox_svn.orig/apps/logfdisp.c 2007-07-19 18:40:32.640625000 -0500 +++ rockbox_svn/apps/logfdisp.c 2007-08-31 22:05:16.078125000 -0500 @@ -64,7 +64,7 @@ if(!lines) return false; - lcd_setmargins(0, 0); + lcd_setmargins(0, LCD_WIDTH, 0); lcd_clear_display(); do { diff -u -r rockbox_svn.orig/apps/menus/main_menu.c rockbox_svn/apps/menus/main_menu.c --- rockbox_svn.orig/apps/menus/main_menu.c 2007-08-26 17:53:56.250000000 -0500 +++ rockbox_svn/apps/menus/main_menu.c 2007-08-31 22:05:16.093750000 -0500 @@ -155,7 +155,7 @@ }; #if defined(HAVE_LCD_BITMAP) FOR_NB_SCREENS(i) - screens[i].setmargins(0, 0); + screens[i].setmargins(0, screens[i].width, 0); #endif while (!done) { Only in rockbox_svn/apps/menus: main_menu.c.orig diff -u -r rockbox_svn.orig/apps/menus/recording_menu.c rockbox_svn/apps/menus/recording_menu.c --- rockbox_svn.orig/apps/menus/recording_menu.c 2007-08-08 21:59:57.500000000 -0500 +++ rockbox_svn/apps/menus/recording_menu.c 2007-08-31 22:05:16.125000000 -0500 @@ -431,7 +431,7 @@ int exit_request = false; enum trigger_menu_option selected = TRIGGER_MODE; bool retval = false; - int old_x_margin[NB_SCREENS]; + int old_left_margin[NB_SCREENS], old_right_margin[NB_SCREENS]; int old_y_margin[NB_SCREENS]; #define TRIGGER_MODE_COUNT 3 @@ -503,12 +503,13 @@ { screens[i].clear_display(); - old_x_margin[i] = screens[i].getxmargin(); + old_left_margin[i] = screens[i].getleftmargin(); + old_right_margin[i] = screens[i].getrightmargin(); old_y_margin[i] = screens[i].getymargin(); if(global_settings.statusbar) - screens[i].setmargins(0, STATUSBAR_HEIGHT); + screens[i].setmargins(0, screens[i].width, STATUSBAR_HEIGHT); else - screens[i].setmargins(0, 0); + screens[i].setmargins(0, screens[i].width, 0); screens[i].getstringsize("M", &w, &h); @@ -789,7 +790,7 @@ FOR_NB_SCREENS(i) { screens[i].setfont(FONT_UI); - screens[i].setmargins(old_x_margin[i], old_y_margin[i]); + screens[i].setmargins(old_left_margin[i], old_right_margin[i], old_y_margin[i]); } return retval; } Only in rockbox_svn/apps/menus: settings_menu.c.orig diff -u -r rockbox_svn.orig/apps/playlist.c rockbox_svn/apps/playlist.c --- rockbox_svn.orig/apps/playlist.c 2007-08-08 21:59:59.953125000 -0500 +++ rockbox_svn/apps/playlist.c 2007-08-31 22:06:53.640625000 -0500 @@ -481,9 +481,9 @@ #ifdef HAVE_LCD_BITMAP if(global_settings.statusbar) - lcd_setmargins(0, STATUSBAR_HEIGHT); + lcd_setmargins(0, LCD_WIDTH, STATUSBAR_HEIGHT); else - lcd_setmargins(0, 0); + lcd_setmargins(0, LCD_WIDTH, 0); #endif gui_syncsplash(0, ID2P(LANG_WAIT)); @@ -1679,9 +1679,9 @@ #ifdef HAVE_LCD_BITMAP if(global_settings.statusbar) - lcd_setmargins(0, STATUSBAR_HEIGHT); + lcd_setmargins(0, LCD_WIDTH, STATUSBAR_HEIGHT); else - lcd_setmargins(0, 0); + lcd_setmargins(0, LCD_WIDTH, 0); #endif gui_syncsplash(0, fmt, count, str(LANG_OFF_ABORT)); Only in rockbox_svn/apps: playlist.c.orig diff -u -r rockbox_svn.orig/apps/plugin.c rockbox_svn/apps/plugin.c --- rockbox_svn.orig/apps/plugin.c 2007-08-18 00:36:38.296875000 -0500 +++ rockbox_svn/apps/plugin.c 2007-08-31 22:05:16.234375000 -0500 @@ -597,9 +597,9 @@ plugin_loaded = true; - xm = lcd_getxmargin(); - ym = lcd_getymargin(); - lcd_setmargins(0,0); + xm = lcd_getleftmargin(); + ym = lcd_getrightmargin(); + lcd_setmargins(0,LCD_WIDTH,0); #if defined HAVE_LCD_BITMAP && LCD_DEPTH > 1 old_backdrop = lcd_get_backdrop(); @@ -608,9 +608,9 @@ lcd_update(); #ifdef HAVE_REMOTE_LCD - rxm = lcd_remote_getxmargin(); + rxm = lcd_remote_getleftmargin(); rym = lcd_remote_getymargin(); - lcd_remote_setmargins(0, 0); + lcd_remote_setmargins(0, LCD_REMOTE_WIDTH, 0); lcd_remote_clear_display(); lcd_remote_update(); #endif @@ -637,7 +637,7 @@ #endif /* HAVE_LCD_BITMAP */ /* restore margins */ - lcd_setmargins(xm,ym); + lcd_setmargins(xm, LCD_WIDTH, ym); lcd_clear_display(); lcd_update(); @@ -648,7 +648,7 @@ #else lcd_remote_set_drawmode(DRMODE_SOLID); #endif - lcd_remote_setmargins(rxm, rym); + lcd_remote_setmargins(rxm, LCD_REMOTE_WIDTH, rym); lcd_remote_clear_display(); lcd_remote_update(); #endif Only in rockbox_svn/apps: plugin.c.orig diff -u -r rockbox_svn.orig/apps/plugin.h rockbox_svn/apps/plugin.h --- rockbox_svn.orig/apps/plugin.h 2007-08-26 17:53:57.953125000 -0500 +++ rockbox_svn/apps/plugin.h 2007-08-31 22:05:16.250000000 -0500 @@ -138,7 +138,7 @@ void (*lcd_set_contrast)(int x); void (*lcd_update)(void); void (*lcd_clear_display)(void); - void (*lcd_setmargins)(int x, int y); + void (*lcd_setmargins)(int leftmargin, int rightmargin, int ymargin); 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); diff -u -r rockbox_svn.orig/apps/plugins/solitaire.c rockbox_svn/apps/plugins/solitaire.c --- rockbox_svn.orig/apps/plugins/solitaire.c 2007-08-18 00:36:34.140625000 -0500 +++ rockbox_svn/apps/plugins/solitaire.c 2007-08-31 22:05:16.281250000 -0500 @@ -650,7 +650,7 @@ break; case 3: - rb->lcd_setmargins(0, 0); + rb->lcd_setmargins(0, LCD_WIDTH, 0); if (solitaire_help() == HELP_USB) result = MENU_USB; break; @@ -665,7 +665,7 @@ } } menu_exit(m); - rb->lcd_setmargins(0, 0); + rb->lcd_setmargins(0, LCD_WIDTH, 0); return result; } diff -u -r rockbox_svn.orig/apps/plugins/viewer.c rockbox_svn/apps/plugins/viewer.c --- rockbox_svn.orig/apps/plugins/viewer.c 2007-08-26 17:53:55.125000000 -0500 +++ rockbox_svn/apps/plugins/viewer.c 2007-08-31 22:05:16.312500000 -0500 @@ -1297,7 +1297,7 @@ result = menu_run(m); menu_exit(m); #ifdef HAVE_LCD_BITMAP - rb->lcd_setmargins(0,0); + rb->lcd_setmargins(0,LCD_WIDTH,0); /* Show-scrollbar mode for current view-width mode */ if (!ONE_SCREEN_FITS_ALL()) @@ -1338,7 +1338,7 @@ } menu_exit(m); #ifdef HAVE_LCD_BITMAP - rb->lcd_setmargins(0,0); + rb->lcd_setmargins(0,LCD_WIDTH,0); #endif viewer_draw(col); } Only in rockbox_svn/apps/plugins: viewer.c.orig diff -u -r rockbox_svn.orig/apps/recorder/recording.c rockbox_svn/apps/recorder/recording.c --- rockbox_svn.orig/apps/recorder/recording.c 2007-08-31 21:23:12.171875000 -0500 +++ rockbox_svn/apps/recorder/recording.c 2007-08-31 22:05:16.343750000 -0500 @@ -930,7 +930,7 @@ { screens[i].setfont(FONT_SYSFIXED); screens[i].getstringsize("M", &w, &h); - screens[i].setmargins(global_settings.invert_cursor ? 0 : w, 8); + screens[i].setmargins(global_settings.invert_cursor ? 0 : w, screens[i].width, 8); filename_offset[i] = ((screens[i].height >= 80) ? 1 : 0); pm_y[i] = 8 + h * (2 + filename_offset[i]); } @@ -1331,7 +1331,7 @@ { screens[i].setfont(FONT_SYSFIXED); screens[i].setmargins( - global_settings.invert_cursor ? 0 : w, 8); + global_settings.invert_cursor ? 0 : w, screens[i].width, 8); } } } Only in rockbox_svn/apps/recorder: recording.c.orig diff -u -r rockbox_svn.orig/apps/screen_access.c rockbox_svn/apps/screen_access.c --- rockbox_svn.orig/apps/screen_access.c 2007-08-05 00:06:53.640625000 -0500 +++ rockbox_svn/apps/screen_access.c 2007-08-31 22:05:16.390625000 -0500 @@ -47,7 +47,8 @@ screen->height=LCD_REMOTE_HEIGHT; screen->setmargins=&lcd_remote_setmargins; screen->getymargin=&lcd_remote_getymargin; - screen->getxmargin=&lcd_remote_getxmargin; + screen->getleftmargin=&lcd_remote_getleftmargin; + screen->getrightmargin=&lcd_remote_getrightmargin; screen->getstringsize=&lcd_remote_getstringsize; #if 1 /* all remote LCDs are bitmapped so far */ screen->setfont=&lcd_remote_setfont; @@ -132,7 +133,8 @@ screen->height=LCD_HEIGHT; screen->setmargins=&lcd_setmargins; screen->getymargin=&lcd_getymargin; - screen->getxmargin=&lcd_getxmargin; + screen->getleftmargin=&lcd_getleftmargin; + screen->getrightmargin=&lcd_getrightmargin; screen->getstringsize=&lcd_getstringsize; #ifdef HAVE_LCD_BITMAP screen->setfont=&lcd_setfont; Only in rockbox_svn/apps: screen_access.c.orig diff -u -r rockbox_svn.orig/apps/screen_access.h rockbox_svn/apps/screen_access.h --- rockbox_svn.orig/apps/screen_access.h 2007-08-05 00:06:53.718750000 -0500 +++ rockbox_svn/apps/screen_access.h 2007-08-31 22:05:16.421875000 -0500 @@ -69,8 +69,9 @@ #ifdef HAS_BUTTONBAR bool has_buttonbar; #endif - void (*setmargins)(int x, int y); - int (*getxmargin)(void); + void (*setmargins)(int x1, int x2, int y); + int (*getleftmargin)(void); + int (*getrightmargin)(void); int (*getymargin)(void); int (*getstringsize)(const unsigned char *str, int *w, int *h); @@ -162,10 +163,10 @@ /* * 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 + * - leftmargin : the number of pixels to the left of the screen */ #define screen_set_xmargin(screen, xmargin) \ - (screen)->setmargins(xmargin, (screen)->getymargin()); + (screen)->setmargins(xmargin, (screen)->width, (screen)->getymargin()); /* * Sets the y margin in pixels for the given screen @@ -173,7 +174,7 @@ * - xmargin : the number of pixels to the top of the screen */ #define screen_set_ymargin(screen, ymargin) \ - (screen)->setmargins((screen)->getxmargin(), ymargin); + (screen)->setmargins((screen)->getleftmargin(), (screen)->width, ymargin); #if defined(HAVE_LCD_BITMAP) || defined(HAVE_REMOTE_LCD) /* Only in rockbox_svn/apps: screen_access.h.orig diff -u -r rockbox_svn.orig/apps/screens.c rockbox_svn/apps/screens.c --- rockbox_svn.orig/apps/screens.c 2007-08-26 17:53:57.687500000 -0500 +++ rockbox_svn/apps/screens.c 2007-08-31 22:05:16.468750000 -0500 @@ -648,7 +648,7 @@ struct option_select left_option; struct option_select bottom_option; struct option_select right_option; - int oldrepeat, old_x_margin, old_y_margin; + int oldrepeat, old_left_margin, old_right_margin, old_y_margin; static const struct opt_items left_items[] = { [0]={ STR(LANG_SYSFONT_OFF) }, @@ -671,9 +671,10 @@ }; struct gui_quickscreen qs; - old_x_margin = lcd_getxmargin(); + old_left_margin = lcd_getleftmargin(); + old_right_margin = lcd_getrightmargin(); old_y_margin = lcd_getymargin(); - lcd_setmargins(0, 0); + lcd_setmargins(0, LCD_WIDTH, 0); option_select_init_items(&left_option, (char *)str(LANG_SYSFONT_SHUFFLE), @@ -714,7 +715,7 @@ } settings_save(); } - lcd_setmargins(old_x_margin, old_y_margin); + lcd_setmargins(old_left_margin, old_right_margin, old_y_margin); return(res); } @@ -737,7 +738,7 @@ struct option_select left_option; struct option_select bottom_option; struct option_select right_option; - int old_x_margin, old_y_margin; + int old_left_margin, old_right_margin, old_y_margin; static const struct opt_items onoff_items[] = { [0]={ STR(LANG_SYSFONT_OFF) }, @@ -750,9 +751,10 @@ struct gui_quickscreen qs; - old_x_margin = lcd_getxmargin(); + old_left_margin = lcd_getrightmargin(); + old_right_margin = lcd_getleftmargin(); old_y_margin = lcd_getymargin(); - lcd_setmargins(0, 0); + lcd_setmargins(0, LCD_WIDTH, 0); option_select_init_items(&left_option, str(LANG_SYSFONT_SCROLL_BAR), @@ -774,7 +776,7 @@ res=gui_syncquickscreen_run(&qs, button_enter); if(!res) settings_save(); - lcd_setmargins(old_x_margin, old_y_margin); + lcd_setmargins(old_left_margin, old_right_margin, old_y_margin); return(res); } #endif /* BUTTON_F3 */ Only in rockbox_svn/apps: screens.c.orig diff -u -r rockbox_svn.orig/apps/settings.h rockbox_svn/apps/settings.h --- rockbox_svn.orig/apps/settings.h 2007-08-31 21:23:16.218750000 -0500 +++ rockbox_svn/apps/settings.h 2007-08-31 21:44:49.453125000 -0500 @@ -725,6 +725,11 @@ #if defined(HAVE_RTC_ALARM) && \ (defined(HAVE_RECORDING) || CONFIG_TUNER) int alarm_wake_up_screen; + #if (CONFIG_KEYPAD == IPOD_4G_PAD) && !defined(IPOD_MINI) + unsigned int ipod_scroll_wheel_acceleration_fast; + unsigned int ipod_scroll_wheel_acceleration_faster; + unsigned int ipod_scroll_wheel_acceleration_fastest; + #endif #endif /* customizable icons */ #ifdef HAVE_LCD_BITMAP Only in rockbox_svn/apps: settings.h.orig Only in rockbox_svn/apps: settings_list.c.orig diff -u -r rockbox_svn.orig/firmware/drivers/lcd-16bit.c rockbox_svn/firmware/drivers/lcd-16bit.c --- rockbox_svn.orig/firmware/drivers/lcd-16bit.c 2007-08-31 22:07:47.250000000 -0500 +++ rockbox_svn/firmware/drivers/lcd-16bit.c 2007-08-31 22:05:16.484375000 -0500 @@ -57,7 +57,8 @@ #endif static int drawmode = DRMODE_SOLID; -static int xmargin = 0; +static int leftmargin = 0; +static int rightmargin = LCD_WIDTH; static int ymargin = 0; static int curfont = FONT_SYSFIXED; @@ -110,15 +111,21 @@ bg_pattern = bg_color; } -void lcd_setmargins(int x, int y) +void lcd_setmargins(int x1, int x2, int y) { - xmargin = x; + leftmargin = x1; + rightmargin = x2; ymargin = y; } -int lcd_getxmargin(void) +int lcd_getleftmargin(void) { - return xmargin; + return leftmargin; +} + +int lcd_getrightmargin(void) +{ + return rightmargin; } int lcd_getymargin(void) @@ -730,16 +737,18 @@ lcd_bitmap_transparent_part(src, 0, 0, width, x, y, width, height); } -/* put a string at a given pixel position, skipping first ofs pixel columns */ -static void lcd_putsxyofs(int x, int y, int ofs, const unsigned char *str) +/* put a string at a given pixel position, skipping first ofs pixel columns + if rmargin==0 the global rightmargin is used */ +static void lcd_putsxyofs(int x, int y, int ofs, const unsigned char *str, int rmargin) { unsigned short ch; unsigned short *ucs; struct font* pf = font_get(curfont); - + int used_rightmargin=rmargin?rmargin:rightmargin; + ucs = bidi_l2v(str, 1); - while ((ch = *ucs++) != 0 && x < LCD_WIDTH) + while ((ch = *ucs++) != 0 && x < used_rightmargin) { int width; const unsigned char *bits; @@ -755,7 +764,7 @@ bits = font_get_bits(pf, ch); - lcd_mono_bitmap_part(bits, ofs, 0, width, x, y, width - ofs, pf->height); + lcd_mono_bitmap_part(bits, ofs, 0, width, x, y, (x+width > used_rightmargin?used_rightmargin-x:width) - ofs, pf->height); x += width - ofs; ofs = 0; @@ -765,7 +774,7 @@ /* put a string at a given pixel position */ void lcd_putsxy(int x, int y, const unsigned char *str) { - lcd_putsxyofs(x, y, 0, str); + lcd_putsxyofs(x, y, 0, str, 0); } /*** line oriented text output ***/ @@ -803,7 +812,7 @@ return; lcd_getstringsize(str, &w, &h); - xpos = xmargin + x*w / utf8length(str); + xpos = leftmargin + x*w / utf8length(str); ypos = ymargin + y*h; drawmode = (style & STYLE_INVERT) ? (DRMODE_SOLID|DRMODE_INVERSEVID) : DRMODE_SOLID; @@ -813,10 +822,10 @@ else bg_pattern = style & STYLE_COLOR_MASK; } - lcd_putsxyofs(xpos, ypos, offset, str); + lcd_putsxyofs(xpos, ypos, offset, str, 0); drawmode ^= DRMODE_INVERSEVID; xrect = xpos + MAX(w - offset, 0); - lcd_fillrect(xrect, ypos, LCD_WIDTH - xrect, h); + lcd_fillrect(xrect, ypos, rightmargin - xrect, h); drawmode = lastmode; fg_pattern = oldfgcolor; bg_pattern = oldbgcolor; @@ -857,7 +866,7 @@ lcd_getstringsize(string, &w, &h); - if (LCD_WIDTH - x * 8 - xmargin < w) { + if (rightmargin - x * 8 - leftmargin < w) { /* prepare scroll line */ char *end; @@ -870,7 +879,7 @@ /* scroll bidirectional or forward only depending on the string width */ if ( lcd_scroll_info.bidir_limit ) { - s->bidir = s->width < (LCD_WIDTH - xmargin) * + s->bidir = s->width < (rightmargin - leftmargin) * (100 + lcd_scroll_info.bidir_limit) / 100; } else @@ -883,16 +892,18 @@ } end = strchr(s->line, '\0'); - strncpy(end, string, LCD_WIDTH/2); + strncpy(end, string, rightmargin/2); s->len = utf8length(string); s->offset = offset; - s->startx = xmargin + x * s->width / s->len; + s->startx = leftmargin + x * s->width / s->len; s->backward = false; s->line_color = (style&STYLE_COLORED)? (style&STYLE_COLOR_MASK): -1; lcd_scroll_info.lines |= (1<y_margin=ymargin; + s->left_margin=leftmargin; + s->right_margin=rightmargin; } else /* force a bit switch-off since it doesn't scroll */ @@ -947,9 +958,9 @@ s->backward = false; s->start_tick = current_tick + lcd_scroll_info.delay * 2; } - if (s->offset >= s->width - (LCD_WIDTH - xpos)) { + if (s->offset >= s->width - (s->right_margin - xpos)) { /* at end of line */ - s->offset = s->width - (LCD_WIDTH - xpos); + s->offset = s->width - (s->right_margin - xpos); s->backward = true; s->start_tick = current_tick + lcd_scroll_info.delay * 2; } @@ -963,9 +974,9 @@ lastmode = drawmode; drawmode = s->invert ? (DRMODE_SOLID|DRMODE_INVERSEVID) : DRMODE_SOLID; - lcd_putsxyofs(xpos, ypos, s->offset, s->line); + lcd_putsxyofs(xpos, ypos, s->offset, s->line, s->right_margin); drawmode = lastmode; - lcd_update_rect(xpos, ypos, LCD_WIDTH - xpos, pf->height); + lcd_update_rect(xpos, ypos, s->right_margin - xpos, pf->height); } fg_pattern = old_fgcolor; diff -u -r rockbox_svn.orig/firmware/drivers/lcd-1bit-vert.c rockbox_svn/firmware/drivers/lcd-1bit-vert.c --- rockbox_svn.orig/firmware/drivers/lcd-1bit-vert.c 2007-08-31 22:07:47.281250000 -0500 +++ rockbox_svn/firmware/drivers/lcd-1bit-vert.c 2007-08-31 22:05:16.515625000 -0500 @@ -36,7 +36,8 @@ unsigned char lcd_framebuffer[LCD_FBHEIGHT][LCD_FBWIDTH]; static int drawmode = DRMODE_SOLID; -static int xmargin = 0; +static int leftmargin = 0; +static int rightmargin = 0; static int ymargin = 0; static int curfont = FONT_SYSFIXED; @@ -61,15 +62,21 @@ return drawmode; } -void lcd_setmargins(int x, int y) +void lcd_setmargins(int x1, int x2, int y) { - xmargin = x; + leftmargin = x1; + rightmargin = x2; ymargin = y; } -int lcd_getxmargin(void) +int lcd_getleftmargin(void) { - return xmargin; + return leftmargin; +} + +int lcd_getrightmargin(void) +{ + return rightmargin; } int lcd_getymargin(void) @@ -648,14 +655,17 @@ return; lcd_getstringsize(str, &w, &h); - xpos = xmargin + x*w / utf8length(str); + xpos = leftmargin + x*w / utf8length(str); ypos = ymargin + y*h; drawmode = (style & STYLE_INVERT) ? (DRMODE_SOLID|DRMODE_INVERSEVID) : DRMODE_SOLID; lcd_putsxyofs(xpos, ypos, offset, str); drawmode ^= DRMODE_INVERSEVID; xrect = xpos + MAX(w - offset, 0); - lcd_fillrect(xrect, ypos, LCD_WIDTH - xrect, h); + lcd_fillrect(xpos + w, ypos, rightmargin - (xpos + w), h); + if (LCD_WIDTH>rightmargin) { + lcd_fillrect(rightmargin, ypos, LCD_WIDTH - rightmargin, h); + } drawmode = lastmode; } @@ -697,7 +707,7 @@ lcd_getstringsize(string, &w, &h); - if (LCD_WIDTH - x * 8 - xmargin < w) { + if (rightmargin - x * 8 - leftmargin < w) { /* prepare scroll line */ char *end; @@ -710,7 +720,7 @@ /* scroll bidirectional or forward only depending on the string width */ if ( lcd_scroll_info.bidir_limit ) { - s->bidir = s->width < (LCD_WIDTH - xmargin) * + s->bidir = s->width < (right_margin - xmargin) * (100 + lcd_scroll_info.bidir_limit) / 100; } else @@ -723,12 +733,14 @@ } end = strchr(s->line, '\0'); - strncpy(end, string, LCD_WIDTH/2); + strncpy(end, string, rightmargin/2); s->len = utf8length(string); s->offset = offset; - s->startx = xmargin + x * s->width / s->len;; + s->startx = leftmargin + x * s->width / s->len;; s->backward = false; + s->left_margin=leftmargin; + s->right_margin=rightmargin; lcd_scroll_info.lines |= (1<y_margin=ymargin; } @@ -772,9 +784,9 @@ s->backward = false; s->start_tick = current_tick + lcd_scroll_info.delay * 2; } - if (s->offset >= s->width - (LCD_WIDTH - xpos)) { + if (s->offset >= s->width - (s->right_margin - xpos)) { /* at end of line */ - s->offset = s->width - (LCD_WIDTH - xpos); + s->offset = s->width - (s->right_margin - xpos); s->backward = true; s->start_tick = current_tick + lcd_scroll_info.delay * 2; } @@ -789,7 +801,11 @@ drawmode = s->invert ? (DRMODE_SOLID|DRMODE_INVERSEVID) : DRMODE_SOLID; lcd_putsxyofs(xpos, ypos, s->offset, s->line); + if (LCD_WIDTH>s->right_margin) { + drawmode ^= DRMODE_INVERSEVID; + lcd_fillrect(s->right_margin, ypos, LCD_WIDTH - s->right_margin, pf->height); + } drawmode = lastmode; - lcd_update_rect(xpos, ypos, LCD_WIDTH - xpos, pf->height); + lcd_update_rect(xpos, ypos, s->right_margin - xpos, pf->height); } } diff -u -r rockbox_svn.orig/firmware/drivers/lcd-2bit-horz.c rockbox_svn/firmware/drivers/lcd-2bit-horz.c --- rockbox_svn.orig/firmware/drivers/lcd-2bit-horz.c 2007-08-31 22:07:47.312500000 -0500 +++ rockbox_svn/firmware/drivers/lcd-2bit-horz.c 2007-08-31 22:05:16.531250000 -0500 @@ -49,7 +49,8 @@ static unsigned fg_pattern IDATA_ATTR = 0xFF; /* initially black */ static unsigned bg_pattern IDATA_ATTR = 0x00; /* initially white */ static int drawmode = DRMODE_SOLID; -static int xmargin = 0; +static int leftmargin = 0; +static int rightmargin = 0; static int ymargin = 0; static int curfont = FONT_SYSFIXED; @@ -101,15 +102,21 @@ lcd_set_background(bg_brightness); } -void lcd_setmargins(int x, int y) +void lcd_setmargins(int x1, int x2, int y) { - xmargin = x; + leftmargin = x1; + rightmargin = x2; ymargin = y; } -int lcd_getxmargin(void) +int lcd_getleftmargin(void) { - return xmargin; + return leftmargin; +} + +int lcd_getrightmargin(void) +{ + return rightmargin; } int lcd_getymargin(void) @@ -848,7 +855,7 @@ return; lcd_getstringsize(str, &w, &h); - xpos = xmargin + x*w / utf8length((char *)str); + xpos = leftmargin + x*w / utf8length((char *)str); ypos = ymargin + y*h; drawmode = (style & STYLE_INVERT) ? (DRMODE_SOLID|DRMODE_INVERSEVID) : DRMODE_SOLID; @@ -896,7 +903,7 @@ lcd_getstringsize(string, &w, &h); - if (LCD_WIDTH - x * 8 - xmargin < w) { + if (LCD_WIDTH - x * 8 - leftmargin < w) { /* prepare scroll line */ char *end; @@ -909,7 +916,7 @@ /* scroll bidirectional or forward only depending on the string width */ if ( lcd_scroll_info.bidir_limit ) { - s->bidir = s->width < (LCD_WIDTH - xmargin) * + s->bidir = s->width < (LCD_WIDTH - leftmargin) * (100 + lcd_scroll_info.bidir_limit) / 100; } else @@ -926,7 +933,7 @@ s->len = utf8length((char *)string); s->offset = offset; - s->startx = xmargin + x * s->width / s->len;; + s->startx = leftmargin + x * s->width / s->len;; s->backward = false; lcd_scroll_info.lines |= (1<y_margin=ymargin; diff -u -r rockbox_svn.orig/firmware/drivers/lcd-2bit-vert.c rockbox_svn/firmware/drivers/lcd-2bit-vert.c --- rockbox_svn.orig/firmware/drivers/lcd-2bit-vert.c 2007-08-31 22:07:47.343750000 -0500 +++ rockbox_svn/firmware/drivers/lcd-2bit-vert.c 2007-08-31 22:05:16.562500000 -0500 @@ -51,7 +51,8 @@ static unsigned fg_pattern IDATA_ATTR = 0xFF; /* initially black */ static unsigned bg_pattern IDATA_ATTR = 0x00; /* initially white */ static int drawmode = DRMODE_SOLID; -static int xmargin = 0; +static int leftmargin = 0; +static int rightmargin = 0; static int ymargin = 0; static int curfont = FONT_SYSFIXED; @@ -103,17 +104,25 @@ lcd_set_background(bg_brightness); } -void lcd_setmargins(int x, int y) +void lcd_setmargins(int x1, int x2, int y) { - xmargin = x; + leftmargin = x1; + rightmargin = x2; ymargin = y; + +} + +int lcd_getleftmargin(void) +{ + return leftmargin; } -int lcd_getxmargin(void) +int lcd_getrightmargin(void) { - return xmargin; + return rightmargin; } + int lcd_getymargin(void) { return ymargin; @@ -983,14 +992,17 @@ return; lcd_getstringsize(str, &w, &h); - xpos = xmargin + x*w / utf8length((char *)str); + xpos = leftmargin + x*w / utf8length((char *)str); ypos = ymargin + y*h; drawmode = (style & STYLE_INVERT) ? (DRMODE_SOLID|DRMODE_INVERSEVID) : DRMODE_SOLID; lcd_putsxyofs(xpos, ypos, offset, str); drawmode ^= DRMODE_INVERSEVID; xrect = xpos + MAX(w - offset, 0); - lcd_fillrect(xrect, ypos, LCD_WIDTH - xrect, h); + lcd_fillrect(xpos + w, ypos, rightmargin - (xpos + w), h); + if (LCD_WIDTH>rightmargin) { + lcd_fillrect(rightmargin, ypos, LCD_WIDTH - rightmargin, h); + } drawmode = lastmode; } @@ -1032,7 +1044,7 @@ lcd_getstringsize(string, &w, &h); - if (LCD_WIDTH - x * 8 - xmargin < w) { + if (rightmargin - x * 8 - leftmargin < w) { /* prepare scroll line */ char *end; @@ -1045,7 +1057,7 @@ /* scroll bidirectional or forward only depending on the string width */ if ( lcd_scroll_info.bidir_limit ) { - s->bidir = s->width < (LCD_WIDTH - xmargin) * + s->bidir = s->width < (LCD_WIDTH - leftmargin) * (100 + lcd_scroll_info.bidir_limit) / 100; } else @@ -1058,12 +1070,14 @@ } end = strchr(s->line, '\0'); - strncpy(end, (char *)string, LCD_WIDTH/2); + strncpy(end, (char *)string, rightmargin/2); s->len = utf8length((char *)string); s->offset = offset; - s->startx = xmargin + x * s->width / s->len; + s->startx = leftmargin + x * s->width / s->len; s->backward = false; + s->left_margin=leftmargin; + s->right_margin=rightmargin; lcd_scroll_info.lines |= (1<y_margin=ymargin; } @@ -1107,9 +1121,9 @@ s->backward = false; s->start_tick = current_tick + lcd_scroll_info.delay * 2; } - if (s->offset >= s->width - (LCD_WIDTH - xpos)) { + if (s->offset >= s->width - (s->right_margin - xpos)) { /* at end of line */ - s->offset = s->width - (LCD_WIDTH - xpos); + s->offset = s->width - (s->rightmargin - xpos); s->backward = true; s->start_tick = current_tick + lcd_scroll_info.delay * 2; } @@ -1124,7 +1138,11 @@ drawmode = s->invert ? (DRMODE_SOLID|DRMODE_INVERSEVID) : DRMODE_SOLID; lcd_putsxyofs(xpos, ypos, s->offset, s->line); + if (LCD_WIDTH>s->right_margin) { + drawmode ^= DRMODE_INVERSEVID; + lcd_fillrect(s->right_margin, ypos, LCD_WIDTH - s->right_margin, pf->height); + } drawmode = lastmode; - lcd_update_rect(xpos, ypos, LCD_WIDTH - xpos, pf->height); + lcd_update_rect(xpos, ypos, s->right_margin - xpos, pf->height); } } diff -u -r rockbox_svn.orig/firmware/drivers/lcd-remote-1bit-v.c rockbox_svn/firmware/drivers/lcd-remote-1bit-v.c --- rockbox_svn.orig/firmware/drivers/lcd-remote-1bit-v.c 2007-08-31 22:07:47.359375000 -0500 +++ rockbox_svn/firmware/drivers/lcd-remote-1bit-v.c 2007-08-31 22:05:16.578125000 -0500 @@ -39,7 +39,8 @@ IBSS_ATTR; static int drawmode = DRMODE_SOLID; -static int xmargin = 0; +static int leftmargin = 0; +static int rightmargin = 0; static int ymargin = 0; static int curfont = FONT_SYSFIXED; @@ -55,15 +56,21 @@ return drawmode; } -void lcd_remote_setmargins(int x, int y) +void lcd_remote_setmargins(int x1, int x2, int y) { - xmargin = x; + leftmargin = x1; + rightmargin = x2; ymargin = y; } -int lcd_remote_getxmargin(void) +int lcd_remote_getleftmargin(void) { - return xmargin; + return leftmargin; +} + +int lcd_remote_getrightmargin(void) +{ + return rightmargin; } int lcd_remote_getymargin(void) @@ -636,7 +643,7 @@ void lcd_remote_puts_style_offset(int x, int y, const unsigned char *str, int style, int offset) { - int xpos,ypos,w,h,xrect; + int xpos,ypos,w,h; int lastmode = drawmode; /* make sure scrolling is turned off on the line we are updating */ @@ -646,14 +653,16 @@ return; lcd_remote_getstringsize(str, &w, &h); - xpos = xmargin + x*w / utf8length((char *)str); + xpos = leftmargin + x*w / utf8length((char *)str); ypos = ymargin + y*h; drawmode = (style & STYLE_INVERT) ? (DRMODE_SOLID|DRMODE_INVERSEVID) : DRMODE_SOLID; lcd_remote_putsxyofs(xpos, ypos, offset, str); drawmode ^= DRMODE_INVERSEVID; - xrect = xpos + MAX(w - offset, 0); - lcd_remote_fillrect(xrect, ypos, LCD_REMOTE_WIDTH - xrect, h); + lcd_remote_fillrect(xpos + w, ypos, rightmargin - (xpos + w), h); + if (LCD_REMOTE_WIDTH>rightmargin) { + lcd_remote_fillrect(rightmargin, ypos, LCD_WIDTH - rightmargin, h); + } drawmode = lastmode; } @@ -695,7 +704,7 @@ lcd_remote_getstringsize(string, &w, &h); - if (LCD_REMOTE_WIDTH - x * 8 - xmargin < w) { + if (rightmargin - x * 8 - leftmargin < w) { /* prepare scroll line */ char *end; @@ -708,7 +717,7 @@ /* scroll bidirectional or forward only depending on the string width */ if ( lcd_remote_scroll_info.bidir_limit ) { - s->bidir = s->width < (LCD_REMOTE_WIDTH - xmargin) * + s->bidir = s->width < (rightmargin - xmargin) * (100 + lcd_remote_scroll_info.bidir_limit) / 100; } else @@ -721,12 +730,14 @@ } end = strchr(s->line, '\0'); - strncpy(end, (char *)string, LCD_REMOTE_WIDTH/2); + strncpy(end, (char *)string, rightmargin/2); s->len = utf8length((char *)string); s->offset = offset; - s->startx = xmargin + x * s->width / s->len;; + s->startx = leftmargin + x * s->width / s->len;; s->backward = false; + s->left_margin=leftmargin; + s->right_margin=rightmargin; lcd_remote_scroll_info.lines |= (1<y_margin=ymargin; } @@ -770,9 +781,9 @@ s->backward = false; s->start_tick = current_tick + lcd_remote_scroll_info.delay*2; } - if (s->offset >= s->width - (LCD_REMOTE_WIDTH - xpos)) { + if (s->offset >= s->width - (s->right_margin - xpos)) { /* at end of line */ - s->offset = s->width - (LCD_REMOTE_WIDTH - xpos); + s->offset = s->width - (s->right_margin - xpos); s->backward = true; s->start_tick = current_tick + lcd_remote_scroll_info.delay*2; } @@ -787,8 +798,12 @@ drawmode = s->invert ? (DRMODE_SOLID|DRMODE_INVERSEVID) : DRMODE_SOLID; lcd_remote_putsxyofs(xpos, ypos, s->offset, s->line); + if (LCD_REMOTE_WIDTH > s->right_margin) { + drawmode ^= DRMODE_INVERSEVID; + lcd_remote_fillrect(s->right_margin, ypos, LCD_WIDTH - s->right_margin, pf->height); + } drawmode = lastmode; - lcd_remote_update_rect(xpos, ypos, LCD_REMOTE_WIDTH - xpos, pf->height); + lcd_remote_update_rect(xpos, ypos, s->right_margin - xpos, pf->height); } } diff -u -r rockbox_svn.orig/firmware/drivers/lcd-remote-2bit-vi.c rockbox_svn/firmware/drivers/lcd-remote-2bit-vi.c --- rockbox_svn.orig/firmware/drivers/lcd-remote-2bit-vi.c 2007-08-31 22:07:47.375000000 -0500 +++ rockbox_svn/firmware/drivers/lcd-remote-2bit-vi.c 2007-08-31 22:05:16.609375000 -0500 @@ -49,7 +49,8 @@ static unsigned fg_pattern IDATA_ATTR = 0xFFFF; /* initially black */ static unsigned bg_pattern IDATA_ATTR = 0x0000; /* initially white */ static int drawmode = DRMODE_SOLID; -static int xmargin = 0; +static int leftmargin = 0; +static int rightmargin = LCD_REMOTE_WIDTH; static int ymargin = 0; static int curfont = FONT_SYSFIXED; @@ -105,17 +106,23 @@ lcd_remote_set_background(bg_brightness); } -void lcd_remote_setmargins(int x, int y) +void lcd_remote_setmargins(int x1, int x2, int y) { - xmargin = x; + leftmargin = x1; + rightmargin = x2; ymargin = y; } -int lcd_remote_getxmargin(void) +int lcd_remote_getleftmargin(void) { - return xmargin; + return leftmargin; } +int lcd_remote_getrightmargin(void) +{ + return rightmargin; +} + int lcd_remote_getymargin(void) { return ymargin; @@ -912,16 +919,18 @@ lcd_remote_bitmap_part(src, 0, 0, width, x, y, width, height); } -/* put a string at a given pixel position, skipping first ofs pixel columns */ -void lcd_remote_putsxyofs(int x, int y, int ofs, const unsigned char *str) +/* put a string at a given pixel position, skipping first ofs pixel columns + if rmargin==0 the global rightmargin is used */ +static void lcd_remote_putsxyofs(int x, int y, int ofs, const unsigned char *str, int rmargin) { unsigned short ch; unsigned short *ucs; struct font* pf = font_get(curfont); - + int used_rightmargin=rmargin?rmargin:rightmargin; + ucs = bidi_l2v(str, 1); - while ((ch = *ucs++) != 0 && x < LCD_REMOTE_WIDTH) + while ((ch = *ucs++) != 0 && x < used_rightmargin) { int width; const unsigned char *bits; @@ -937,7 +946,7 @@ bits = font_get_bits(pf, ch); - lcd_remote_mono_bitmap_part(bits, ofs, 0, width, x, y, width - ofs, + lcd_remote_mono_bitmap_part(bits, ofs, 0, width, x, y, (x+width > used_rightmargin?used_rightmargin-x:width) - ofs, pf->height); x += width - ofs; @@ -948,7 +957,7 @@ /* put a string at a given pixel position */ void lcd_remote_putsxy(int x, int y, const unsigned char *str) { - lcd_remote_putsxyofs(x, y, 0, str); + lcd_remote_putsxyofs(x, y, 0, str, 0); } /*** line oriented text output ***/ @@ -984,14 +993,14 @@ return; lcd_remote_getstringsize(str, &w, &h); - xpos = xmargin + x*w / utf8length((char *)str); + xpos = leftmargin + x*w / utf8length((char *)str); ypos = ymargin + y*h; drawmode = (style & STYLE_INVERT) ? (DRMODE_SOLID|DRMODE_INVERSEVID) : DRMODE_SOLID; - lcd_remote_putsxyofs(xpos, ypos, offset, str); + lcd_remote_putsxyofs(xpos, ypos, offset, str, 0); drawmode ^= DRMODE_INVERSEVID; xrect = xpos + MAX(w - offset, 0); - lcd_remote_fillrect(xrect, ypos, LCD_REMOTE_WIDTH - xrect, h); + lcd_remote_fillrect(xpos + w, ypos, rightmargin - (xpos + w), h); drawmode = lastmode; } @@ -1032,7 +1041,7 @@ lcd_remote_getstringsize(string, &w, &h); - if (LCD_REMOTE_WIDTH - x * 8 - xmargin < w) { + if (LCD_REMOTE_WIDTH - x * 8 - leftmargin < w) { /* prepare scroll line */ char *end; @@ -1045,7 +1054,7 @@ /* scroll bidirectional or forward only depending on the string width */ if ( lcd_remote_scroll_info.bidir_limit ) { - s->bidir = s->width < (LCD_REMOTE_WIDTH - xmargin) * + s->bidir = s->width < (LCD_REMOTE_WIDTH - leftmargin) * (100 + lcd_remote_scroll_info.bidir_limit) / 100; } else @@ -1058,12 +1067,14 @@ } end = strchr(s->line, '\0'); - strncpy(end, (char *)string, LCD_REMOTE_WIDTH/2); + strncpy(end, (char *)string, rightmargin/2); s->len = utf8length((char *)string); s->offset = offset; - s->startx = xmargin + x * s->width / s->len;; + s->startx = leftmargin + x * s->width / s->len;; s->backward = false; + s->left_margin=leftmargin; + s->right_margin=rightmargin; lcd_remote_scroll_info.lines |= (1<y_margin=ymargin; } @@ -1107,9 +1118,9 @@ s->backward = false; s->start_tick = current_tick + lcd_remote_scroll_info.delay*2; } - if (s->offset >= s->width - (LCD_REMOTE_WIDTH - xpos)) { + if (s->offset >= s->width - (s->right_margin - xpos)) { /* at end of line */ - s->offset = s->width - (LCD_REMOTE_WIDTH - xpos); + s->offset = s->width - (s->right_margin - xpos); s->backward = true; s->start_tick = current_tick + lcd_remote_scroll_info.delay*2; } @@ -1123,9 +1134,9 @@ lastmode = drawmode; drawmode = s->invert ? (DRMODE_SOLID|DRMODE_INVERSEVID) : DRMODE_SOLID; - lcd_remote_putsxyofs(xpos, ypos, s->offset, s->line); + lcd_remote_putsxyofs(xpos, ypos, s->offset, s->line, s->right_margin); drawmode = lastmode; - lcd_remote_update_rect(xpos, ypos, LCD_REMOTE_WIDTH - xpos, pf->height); + lcd_remote_update_rect(xpos, ypos, s->right_margin - xpos, pf->height); } } diff -u -r rockbox_svn.orig/firmware/export/lcd-remote.h rockbox_svn/firmware/export/lcd-remote.h --- rockbox_svn.orig/firmware/export/lcd-remote.h 2007-08-18 00:36:43.281250000 -0500 +++ rockbox_svn/firmware/export/lcd-remote.h 2007-08-31 22:05:16.625000000 -0500 @@ -138,8 +138,9 @@ 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 void lcd_remote_setmargins(int leftmargin, int rightmargin, int ymargin); +extern int lcd_remote_getleftmargin(void); +extern int lcd_remote_getrightmargin(void); extern int lcd_remote_getymargin(void); extern void lcd_remote_setfont(int font); extern int lcd_remote_getstringsize(const unsigned char *str, int *w, int *h); diff -u -r rockbox_svn.orig/firmware/export/lcd.h rockbox_svn/firmware/export/lcd.h --- rockbox_svn.orig/firmware/export/lcd.h 2007-07-31 11:16:07.562500000 -0500 +++ rockbox_svn/firmware/export/lcd.h 2007-08-31 22:05:16.671875000 -0500 @@ -62,8 +62,9 @@ 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 void lcd_setmargins(int leftmargin, int rightmargin, int ymargin); +extern int lcd_getleftmargin(void); +extern int lcd_getrightmargin(void); extern int lcd_getymargin(void); extern int lcd_getstringsize(const unsigned char *str, int *w, int *h); Only in rockbox_svn/firmware/export: lcd.h.orig diff -u -r rockbox_svn.orig/firmware/export/scroll_engine.h rockbox_svn/firmware/export/scroll_engine.h --- rockbox_svn.orig/firmware/export/scroll_engine.h 2007-08-31 22:07:47.406250000 -0500 +++ rockbox_svn/firmware/export/scroll_engine.h 2007-08-31 22:05:16.703125000 -0500 @@ -49,6 +49,8 @@ bool bidir; long start_tick; int y_margin; + int left_margin; + int right_margin; #ifdef HAVE_LCD_COLOR int line_color; #endif diff -u -r rockbox_svn.orig/firmware/logf.c rockbox_svn/firmware/logf.c --- rockbox_svn.orig/firmware/logf.c 2007-07-19 18:44:30.468750000 -0500 +++ rockbox_svn/firmware/logf.c 2007-08-31 22:05:16.718750000 -0500 @@ -54,7 +54,7 @@ lcd_remote_getstringsize("A", &w, &h); lines = LCD_REMOTE_HEIGHT/h; columns = LCD_REMOTE_WIDTH/w; - lcd_remote_setmargins(0, 0); + lcd_remote_setmargins(0, LCD_REMOTE_WIDTH, 0); lcd_remote_clear_display(); index = logfindex;