### Eclipse Workspace Patch 1.0
#P rockbox-devel
Index: firmware/drivers/lcd-16bit.c
===================================================================
--- firmware/drivers/lcd-16bit.c.orig
+++ firmware/drivers/lcd-16bit.c
@@ -130,6 +130,16 @@ void lcd_setmargins(int x1, int x2, int 
     ymargin = y;
 }
 
+void lcd_set_custom_width(int width)
+{
+    rightmargin = leftmargin+width;
+}
+
+int lcd_get_custom_width(void)
+{
+    return rightmargin;
+}
+
 int lcd_getleftmargin(void)
 {
     return leftmargin;
@@ -732,7 +742,7 @@ static void lcd_putsxyofs(int x, int y, 
 
     ucs = bidi_l2v(str, 1);
 
-    while ((ch = *ucs++) != 0 && x < LCD_WIDTH)
+    while ((ch = *ucs++) != 0 && x < lcd_get_custom_width())
     {
         int width;
         const unsigned char *bits;
@@ -745,10 +755,12 @@ static void lcd_putsxyofs(int x, int y, 
             ofs -= width;
             continue;
         }
-
+        
         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 > lcd_get_custom_width()?lcd_get_custom_width()-x:width) - ofs, 
+        	pf->height);
         
         x += width - ofs;
         ofs = 0;
Index: apps/screen_access.c
===================================================================
--- apps/screen_access.c.orig
+++ apps/screen_access.c
@@ -48,7 +48,9 @@ void screen_init(struct screen * screen,
             screen->getymargin=&lcd_remote_getymargin;
             screen->getleftmargin=&lcd_remote_getleftmargin;
             screen->getrightmargin=&lcd_remote_getrightmargin;
-            screen->setfont=&lcd_remote_setfont;
+			screen->set_custom_width=&lcd_remote_set_custom_width;
+			screen->get_custom_width=&lcd_remote_get_custom_width;
+			screen->setfont=&lcd_remote_setfont;
             screen->setfont(FONT_UI);
             screen->getstringsize=&lcd_remote_getstringsize;
             screen->putsxy=&lcd_remote_putsxy;
@@ -118,6 +120,8 @@ void screen_init(struct screen * screen,
             screen->width=LCD_WIDTH;
             screen->height=LCD_HEIGHT;
             screen->setmargins=&lcd_setmargins;
+            screen->set_custom_width=&lcd_set_custom_width;
+            screen->get_custom_width=&lcd_get_custom_width;
             screen->getymargin=&lcd_getymargin;
             screen->getleftmargin=&lcd_getleftmargin;
             screen->getrightmargin=&lcd_getrightmargin;
Index: apps/screen_access.h
===================================================================
--- apps/screen_access.h.orig
+++ apps/screen_access.h
@@ -63,11 +63,14 @@ struct screen
 
 #if defined(HAVE_LCD_BITMAP) || defined(HAVE_REMOTE_LCD) /* always bitmap */
     void (*setmargins)(int x1, int x2, int y);
+    void (*set_custom_width)(int width);
+    int (*get_custom_width)(void);
     int (*getleftmargin)(void);
     int (*getrightmargin)(void);
     int (*getymargin)(void);
 
     void (*setfont)(int newfont);
+     
     int (*getstringsize)(const unsigned char *str, int *w, int *h);
     void (*putsxy)(int x, int y, const unsigned char *str);
 
Index: firmware/export/lcd.h
===================================================================
--- firmware/export/lcd.h.orig
+++ firmware/export/lcd.h
@@ -269,6 +269,12 @@ extern void lcd_setmargins(int leftmargi
 extern int  lcd_getleftmargin(void);
 extern int  lcd_getrightmargin(void);
 extern int  lcd_getymargin(void);
+
+#if HAVE_LCD_BITMAP
+extern int  lcd_get_custom_width(void);
+extern void  lcd_set_custom_width(int width);
+#endif
+
 extern void lcd_setfont(int font);
 extern int  lcd_getstringsize(const unsigned char *str, int *w, int *h);
 
Index: firmware/export/lcd-remote.h
===================================================================
--- firmware/export/lcd-remote.h.orig
+++ firmware/export/lcd-remote.h
@@ -121,6 +121,8 @@ extern void lcd_remote_setmargins(int le
 extern int  lcd_remote_getleftmargin(void);
 extern int  lcd_remote_getrightmargin(void);
 extern int  lcd_remote_getymargin(void);
+extern void lcd_remote_set_custom_width(int width);
+extern int lcd_remote_get_custom_width(void);
 extern void lcd_remote_setfont(int font);
 extern int  lcd_remote_getstringsize(const unsigned char *str, int *w, int *h);
 
Index: firmware/drivers/lcd-remote-2bit-vi.c
===================================================================
--- firmware/drivers/lcd-remote-2bit-vi.c.orig
+++ firmware/drivers/lcd-remote-2bit-vi.c
@@ -138,6 +138,16 @@ int lcd_remote_getymargin(void)
     return ymargin;
 }
 
+void lcd_remote_set_custom_width(int width)
+{
+	rightmargin = leftmargin+width;
+}
+
+int lcd_remote_get_custom_width(void)
+{
+	return rightmargin;
+} 
+
 void lcd_remote_setfont(int newfont)
 {
     curfont = newfont;
