### Eclipse Workspace Patch 1.0
#P rockbox-devel
Index: apps/gui/list.c
===================================================================
--- apps/gui/list.c.orig
+++ apps/gui/list.c
@@ -141,7 +141,16 @@ void gui_list_put_selection_in_screen(st
 #endif
 
     gui_textarea_update_nblines(gui_list->display);
-    int nb_lines=gui_list->display->nb_lines;
+    int nb_lines;
+	
+	struct screen * display=gui_list->display;
+	bool use_custom_list=display->screen_type==SCREEN_MAIN;
+	if (use_custom_list &&global_settings.listlines) {
+		nb_lines = global_settings.listlines;
+	} else {
+		nb_lines = gui_list->display->nb_lines;
+	}
+	
     if (SHOW_LIST_TITLE)
         nb_lines--;
     if(put_from_end)
@@ -208,6 +217,8 @@ void gui_list_draw(struct gui_list * gui
     bool draw_cursor;
     int i;
     int lines;
+	bool use_custom_list=display->screen_type==SCREEN_MAIN;
+
 #ifdef HAVE_LCD_BITMAP
     int item_offset;
 	
@@ -236,9 +247,22 @@ void gui_list_draw(struct gui_list * gui
         i = 1;
         lines = display->nb_lines - 1;
 
-        if (gui_list->title_icon != NOICON && draw_icons)
-        {
-            screen_put_iconxy(display, 0, 0, gui_list->title_icon);
+		// MWE dont draw path icon
+		if (use_custom_list && (global_settings.listxpos || 
+					global_settings.listypos || 
+					global_settings.listlines))
+		{
+		} 
+		else 
+		{
+			if (gui_list->title_icon != NOICON && draw_icons)
+			{
+				screen_put_iconxy(display, 0, 0, gui_list->title_icon);
+			}
+		}
+				
+		if (gui_list->title_icon != NOICON && draw_icons)
+		{		
 #ifdef HAVE_LCD_BITMAP
             text_pos = 8; /* pixels */
 #else
@@ -250,11 +274,27 @@ void gui_list_draw(struct gui_list * gui
             text_pos = 0;
         }
 
-#ifdef HAVE_LCD_BITMAP
-        screen_set_xmargin(display, text_pos); /* margin for title */
+#ifdef HAVE_LCD_BITMAP    	
+		screen_set_xmargin(display, text_pos); /* margin for title */
+	
+		if (use_custom_list && global_settings.listxpos) {
+			screen_set_xmargin(display, global_settings.listxpos);
+		} 
+		if (use_custom_list && global_settings.listypos) {
+			screen_set_ymargin(display, global_settings.listypos);
+		} else {
+			screen_set_ymargin(display, 
+			(global_settings.statusbar?STATUSBAR_HEIGHT:0));
+		}
+		if (use_custom_list && global_settings.listwidth) {
+			display->set_custom_width(global_settings.listwidth);
+		} else {
+			display->set_custom_width(display->width-display->getleftmargin());
+		}
+	
         item_offset = gui_list_get_item_offset(gui_list, gui_list->title_width,
                                                text_pos);
-        if (item_offset > gui_list->title_width - (display->width - text_pos))
+        if (item_offset > gui_list->title_width - (display->get_custom_width() - text_pos))
             display->puts_offset(0, 0, gui_list->title, item_offset);
         else
             display->puts_scroll_offset(0, 0, gui_list->title, item_offset);
@@ -267,7 +307,11 @@ void gui_list_draw(struct gui_list * gui
         i = 0;
         lines = display->nb_lines;
     }
-
+	
+    if (use_custom_list && global_settings.listlines) {
+    	lines = global_settings.listlines;
+    }
+    
     /* Adjust the position of icon, cursor, text for the list */
 #ifdef HAVE_LCD_BITMAP
     
@@ -278,6 +322,13 @@ void gui_list_draw(struct gui_list * gui
     
     draw_cursor = !global_settings.invert_cursor;
     text_pos = 0; /* here it's in pixels */
+	  
+	if (use_custom_list && global_settings.listxpos) {
+        text_pos = global_settings.listxpos;
+		cursor_pos = global_settings.listxpos/6;
+		icon_pos = global_settings.listxpos/6+1;
+	}
+
     if(draw_scrollbar || SHOW_LIST_TITLE) /* indent if there's
                                              a title */
     {
@@ -302,9 +353,27 @@ void gui_list_draw(struct gui_list * gui
 
 #ifdef HAVE_LCD_BITMAP
     screen_set_xmargin(display, text_pos); /* margin for list */
+   
+	if (use_custom_list && global_settings.listypos) {
+		screen_set_ymargin(display, global_settings.listypos);
+	} else {
+		screen_set_ymargin(display, 
+		(global_settings.statusbar?STATUSBAR_HEIGHT:0));
+	}
+	if (use_custom_list && global_settings.listwidth) {
+		display->set_custom_width(global_settings.listwidth-
+		(draw_icons?8:0)-(draw_scrollbar?SCROLLBAR_WIDTH:0));
+	} else {
+		display->set_custom_width(display->width-display->getleftmargin());
+	}
+	
 #endif
 
-    while (i < display->nb_lines)
+	int maxLines=display->nb_lines;
+	if(use_custom_list && global_settings.listlines){
+		maxLines=global_settings.listlines;
+	}
+    while (i < maxLines)
     {
         char entry_buffer[MAX_PATH];
         unsigned char *entry_name;
@@ -331,7 +400,7 @@ void gui_list_draw(struct gui_list * gui
 #ifdef HAVE_LCD_BITMAP
             if (global_settings.invert_cursor)/* Display inverted-line-style*/
                 /* if text got out of view */
-                if (item_offset > item_width - (display->width - text_pos))
+                if (item_offset > item_width - (display->get_custom_width() - text_pos))
                     /* don't scroll */
                     display->puts_style_offset(0, i, entry_name,
                                                STYLE_INVERT,item_offset);
@@ -341,7 +410,7 @@ void gui_list_draw(struct gui_list * gui
                                                       item_offset);
 
             else  /*  if (!global_settings.invert_cursor) */
-                if (item_offset > item_width - (display->width - text_pos))
+                if (item_offset > item_width - (display->get_custom_width() - text_pos))
                     display->puts_offset(0, i, entry_name,item_offset);
             else
                 display->puts_scroll_offset(0, i, entry_name,item_offset);
@@ -389,15 +458,29 @@ void gui_list_draw(struct gui_list * gui
     if(draw_scrollbar)
     {
         int y_start = gui_textarea_get_ystart(display);
+		int x_start =0;
         if (SHOW_LIST_TITLE)
             y_start += display->char_height;
         int scrollbar_y_end = display->char_height *
                               lines + y_start;
-        gui_scrollbar_draw(display, 0, y_start, SCROLLBAR_WIDTH-1,
-                           scrollbar_y_end - y_start, gui_list->nb_items,
-                           gui_list->start_item,
-                           gui_list->start_item + lines, VERTICAL);
-    }
+        
+        if (use_custom_list && (global_settings.listxpos || 
+             global_settings.listypos || 
+             global_settings.listlines))
+        {
+            y_start=global_settings.listypos;
+            if(gui_list->title){
+                y_start+=+display->char_height;
+            }
+			x_start=global_settings.listxpos - SCROLLBAR_WIDTH;
+            scrollbar_y_end = display->char_height * lines + global_settings.listypos;
+			lines=global_settings.listlines;
+        }	
+        gui_scrollbar_draw(display, x_start, y_start, SCROLLBAR_WIDTH-1,
+                       scrollbar_y_end - y_start, gui_list->nb_items,
+                       gui_list->start_item,
+                       gui_list->start_item + lines, VERTICAL);
+	}
 #endif
 
     gui_textarea_update(display);
@@ -424,7 +507,17 @@ void gui_list_select_next(struct gui_lis
     else
     {
         gui_list->selected_item+=gui_list->selected_size;
-        int nb_lines = gui_list->display->nb_lines;
+       
+        int nb_lines;
+		struct screen * display=gui_list->display;
+		bool use_custom_list=display->screen_type==SCREEN_MAIN;
+		
+        if (use_custom_list &&global_settings.listlines) {
+	        nb_lines = global_settings.listlines;
+        } else {
+    	    nb_lines = gui_list->display->nb_lines;
+        }
+    	    
         if (SHOW_LIST_TITLE)
             nb_lines--;
         int item_pos = gui_list->selected_item - gui_list->start_item;
@@ -456,7 +549,15 @@ void gui_list_select_next(struct gui_lis
 
 void gui_list_select_previous(struct gui_list * gui_list)
 {
-    int nb_lines = gui_list->display->nb_lines;        
+	int nb_lines;
+	struct screen * display=gui_list->display;
+	bool use_custom_list=display->screen_type==SCREEN_MAIN;
+		
+	if (use_custom_list &&global_settings.listlines) {
+		nb_lines = global_settings.listlines;
+	} else {
+		nb_lines = gui_list->display->nb_lines;
+	}
     if (SHOW_LIST_TITLE)
         nb_lines--;
     if( gui_list->selected_item-gui_list->selected_size < 0 )
@@ -551,7 +652,15 @@ void gui_list_del_item(struct gui_list *
     if(gui_list->nb_items > 0)
     {
         gui_textarea_update_nblines(gui_list->display);
-        int nb_lines = gui_list->display->nb_lines;
+		int nb_lines;
+		struct screen * display=gui_list->display;
+		bool use_custom_list=display->screen_type==SCREEN_MAIN;
+		
+		if (use_custom_list &&global_settings.listlines) {
+			nb_lines = global_settings.listlines;
+		} else {
+			nb_lines = gui_list->display->nb_lines;
+		}
 
         int dist_selected_from_end = gui_list->nb_items
             - gui_list->selected_item - 1;
Index: apps/gui/statusbar.c
===================================================================
--- apps/gui/statusbar.c.orig
+++ apps/gui/statusbar.c
@@ -32,6 +32,7 @@
 #include "button.h"
 #include "usb.h"
 #include "led.h"
+#include "debug.h"
 
 #include "status.h" /* needed for battery_state global var */
 #include "action.h" /* for keys_locked */
@@ -135,6 +136,11 @@ void gui_statusbar_init(struct gui_statu
 void gui_statusbar_draw(struct gui_statusbar * bar, bool force_redraw)
 {
     struct screen * display = bar->display;
+#ifdef HAVE_LCD_BITMAP
+	//int custom_width_orig = display->get_custom_width()-display->getleftmargin();
+	display->set_custom_width(display->width);
+	//DEBUGF("%d - %d\n", display->get_custom_width(),display->getleftmargin());
+#endif
 
 #ifdef HAVE_LCD_CHARCELLS
     int val;
@@ -339,6 +345,10 @@ void gui_statusbar_draw(struct gui_statu
     display->icon(ICON_PARAM, param);
     display->icon(ICON_USB, usb);
 #endif /* HAVE_LCD_CHARCELLS */
+
+#ifdef HAVE_LCD_BITMAP
+	//display->set_custom_width(custom_width_orig);
+#endif
 }
 
 #ifdef HAVE_LCD_BITMAP
Index: apps/gui/quickscreen.c
===================================================================
--- apps/gui/quickscreen.c.orig
+++ apps/gui/quickscreen.c
@@ -54,12 +54,11 @@ void gui_quickscreen_draw(struct gui_qui
     const unsigned char *option;
     const unsigned char *title;
     int w, font_h;
-    bool statusbar = global_settings.statusbar;
+	
 #ifdef HAS_BUTTONBAR
     display->has_buttonbar=false;
 #endif
     gui_textarea_clear(display);
-	// MWE or BROWSER?
     display->setfont(FONT_MENU);
     display->getstringsize("A", NULL, &font_h);
 
@@ -67,10 +66,14 @@ void gui_quickscreen_draw(struct gui_qui
     option=(unsigned char *)option_select_get_text(qs->left_option, buffer,
                                                    sizeof buffer);
     title=(unsigned char *)qs->left_option->title;
-    display->puts_scroll(2, PUTS_CENTER-4+!statusbar, title);
-    display->puts_scroll(2, PUTS_CENTER-3+!statusbar, option);
-    display->mono_bitmap(bitmap_icons_7x8[Icon_FastBackward], 1,
-                         PUTSXY_CENTER-(font_h*3), 7, 8);
+	int ypos=PUTS_CENTER-4;
+	if(ypos<0){
+		ypos=0;
+	}
+    display->puts_scroll(2, ypos, title);
+	ypos++;
+    display->puts_scroll(2, ypos, option);
+    display->mono_bitmap(bitmap_icons_7x8[Icon_FastBackward], 1, ypos*font_h, 7, 8);
 
     /* Displays the second line of text */
     option=(unsigned char *)option_select_get_text(qs->right_option, buffer,
@@ -79,21 +82,21 @@ void gui_quickscreen_draw(struct gui_qui
     display->getstringsize(title, &w, NULL);
     if(w > display->width - 8)
     {
-        display->puts_scroll(2, PUTS_CENTER-2+!statusbar, title);
+        display->puts_scroll(2, PUTS_CENTER-2, title);
         display->mono_bitmap(bitmap_icons_7x8[Icon_FastForward], 1,
                              PUTSXY_CENTER-font_h, 7, 8);
     }
     else
     {
-        display->putsxy(display->width - w - 12, PUTSXY_CENTER-font_h, title);
+        display->putsxy(display->width - w - 12, PUTSXY_CENTER-2*font_h, title);
         display->mono_bitmap(bitmap_icons_7x8[Icon_FastForward],
                         display->width - 8, PUTSXY_CENTER-font_h, 7, 8);
     }
     display->getstringsize(option, &w, NULL);
     if(w > display->width)
-        display->puts_scroll(0, PUTS_CENTER-1+!statusbar, option);
+        display->puts_scroll(0, PUTS_CENTER-1, option);
     else
-        display->putsxy(display->width -w-12, PUTSXY_CENTER, option);
+        display->putsxy(display->width -w-12, PUTSXY_CENTER-font_h, option);
 
     /* Displays the third line of text */
     option=(unsigned char *)option_select_get_text(qs->bottom_option, buffer,
@@ -102,13 +105,13 @@ void gui_quickscreen_draw(struct gui_qui
 
     display->getstringsize(title, &w, NULL);
     if(w > display->width)
-        display->puts_scroll(0, PUTS_BOTTOM-4+!statusbar, title);
+        display->puts_scroll(0, PUTS_BOTTOM-4, title);
     else
         display->putsxy(display->width/2-w/2, PUTSXY_BOTTOM-(font_h*3), title);
 
     display->getstringsize(option, &w, NULL);
     if(w > display->width)
-        display->puts_scroll(0, PUTS_BOTTOM-3+!statusbar, option);
+        display->puts_scroll(0, PUTS_BOTTOM-3, option);
     else
         display->putsxy(display->width/2-w/2, PUTSXY_BOTTOM-(font_h*2), option);
     display->mono_bitmap(bitmap_icons_7x8[Icon_DownArrow], display->width/2-4,
Index: apps/settings.h
===================================================================
--- apps/settings.h.orig
+++ apps/settings.h
@@ -550,6 +550,14 @@ struct user_settings
     int fm_region;
 #endif
     bool audioscrobbler; /* Audioscrobbler logging  */
+  	 	
+#ifdef HAVE_LCD_BITMAP
+ 	/* custom coordinates/settings for the lists (Menus/File list) */
+ 	int listxpos; 
+ 	int listypos;
+ 	int listlines;
+	int listwidth;
+#endif
 
     /* If values are just added to the end, no need to bump plugin API
        version. */
Index: apps/settings.c
===================================================================
--- apps/settings.c.orig
+++ apps/settings.c
@@ -895,6 +895,13 @@ void theme_settings_reset(void)
 	global_settings.userfont5[0] = '\0';
 	global_settings.userfont6[0] = '\0';
 	global_settings.userfont7[0] = '\0';
+	
+#ifdef HAVE_LCD_BITMAP
+	global_settings.listxpos=0; 
+	global_settings.listypos=0;
+	global_settings.listlines=0;
+	global_settings.listwidth=0;
+#endif
 }
 
 bool settings_load_config(const char* file, bool apply)
Index: apps/settings_list.c
===================================================================
--- apps/settings_list.c.orig
+++ apps/settings_list.c
@@ -712,6 +712,12 @@ const struct settings_list settings[] = 
     FILENAME_SETTING(0,kbd_file,"kbd","",ROCKBOX_DIR "/",".kbd",MAX_FILENAME+1),
 #endif
 
+#ifdef HAVE_LCD_BITMAP
+    {F_T_INT,GS(listxpos),-1,INT(0),"listxpos",NULL,UNUSED},
+    {F_T_INT,GS(listypos),-1,INT(0),"listypos",NULL,UNUSED},
+    {F_T_INT,GS(listlines),-1,INT(0),"listlines",NULL,UNUSED},
+    {F_T_INT,GS(listwidth),-1,INT(0),"listwidth",NULL,UNUSED},
+#endif
 };
 
 const int nb_settings = sizeof(settings)/sizeof(*settings);
