### Eclipse Workspace Patch 1.0
#P rockbox-devel
Index: apps/settings.h
===================================================================
RCS file: /cvsroot/rockbox/apps/settings.h,v
retrieving revision 1.233
diff -u -r1.233 settings.h
--- apps/settings.h	16 Aug 2006 23:26:54 -0000	1.233
+++ apps/settings.h	24 Aug 2006 18:11:37 -0000
@@ -477,6 +477,12 @@
 #endif
     bool hold_lr_for_scroll_in_list; /* hold L/R scrolls the list left/right */
     int show_path_in_browser; /* 0=off, 1=current directory, 2=full path */
+    
+    /* custom coordinates/settings for the lists (Menus/File list) */
+    int listxpos; 
+    int listypos;
+    int listlines;
+    int listwidth;
 };
 
 enum optiontype { INT, BOOL };
Index: apps/settings.c
===================================================================
RCS file: /cvsroot/rockbox/apps/settings.c,v
retrieving revision 1.409
diff -u -r1.409 settings.c
--- apps/settings.c	23 Aug 2006 20:02:05 -0000	1.409
+++ apps/settings.c	24 Aug 2006 18:11:36 -0000
@@ -323,6 +323,12 @@
 
     /* new stuff to be added here */
     /* If values are just added to the end, no need to bump the version. */
+#ifdef HAVE_LCD_BITMAP
+    {16, S_O(listxpos), 0, "listxpos", NULL }, /*0..320*/
+    {8, S_O(listypos), 0, "listypos", NULL }, /*0..240*/
+    {8, S_O(listlines), 0, "listlines", NULL }, /*1..100*/
+    {16, S_O(listwidth), 0, "listwidth", NULL }, /*1..320*/
+#endif
 
     /* Current sum of bits: 277 (worst case, but w/o remote lcd) */
     /* Sum of all bit sizes must not grow beyond 288! */
@@ -1475,6 +1679,13 @@
     if (fd < 0)
         return false;
 
+#ifdef HAVE_LCD_BITMAP
+   	global_settings.listxpos = 0;
+   	global_settings.listypos = 0;
+   	global_settings.listlines = 0;
+   	global_settings.listwidth = 0;
+#endif
+        	
     while (read_line(fd, line, sizeof line) > 0)
     {
         char* name;
@@ -1537,6 +1543,26 @@
                 set_file(value, (char *)global_settings.kbd_file, MAX_FILENAME);
         }
 #endif
+#ifdef HAVE_LCD_BITMAP
+        else if (!strcasecmp(name, "listxpos")) {
+        	global_settings.listxpos = atoi(value);
+        }
+#endif
+#ifdef HAVE_LCD_BITMAP
+        else if (!strcasecmp(name, "listypos")) {
+        	global_settings.listypos = atoi(value);
+        }
+#endif
+#ifdef HAVE_LCD_BITMAP
+        else if (!strcasecmp(name, "listlines")) {
+        	global_settings.listlines = atoi(value);
+        }
+#endif
+#ifdef HAVE_LCD_BITMAP
+        else if (!strcasecmp(name, "listwidth")) {
+        	global_settings.listwidth = atoi(value);
+        }
+#endif
 
 
         /* check for scalar values, using the two tables */
@@ -1707,6 +1733,29 @@
                  global_settings.kbd_file);
 #endif
 
+#ifdef HAVE_LCD_BITMAP
+    if (global_settings.listxpos)
+        fdprintf(fd, "listxpos: %d\r\n", 
+                 global_settings.listxpos);
+#endif
+
+#ifdef HAVE_LCD_BITMAP
+    if (global_settings.listypos)
+        fdprintf(fd, "listypos: %d\r\n", 
+                 global_settings.listypos);
+#endif
+
+#ifdef HAVE_LCD_BITMAP
+    if (global_settings.listlines)
+        fdprintf(fd, "listlines: %d\r\n", 
+                 global_settings.listlines);
+#endif
+#ifdef HAVE_LCD_BITMAP
+    if (global_settings.listwidth)
+        fdprintf(fd, "listwidth: %d\r\n", 
+                 global_settings.listwidth);
+#endif
+
     /* here's the action: write values to file, specified via table */
     save_cfg_table(rtc_bits, sizeof(rtc_bits)/sizeof(rtc_bits[0]), fd);
     save_cfg_table(hd_bits, sizeof(hd_bits)/sizeof(hd_bits[0]), fd);
Index: apps/gui/list.c
===================================================================
RCS file: /cvsroot/rockbox/apps/gui/list.c,v
retrieving revision 1.31
diff -u -r1.31 list.c
--- apps/gui/list.c	23 Aug 2006 20:02:06 -0000	1.31
+++ apps/gui/list.c	24 Aug 2006 18:11:38 -0000
@@ -216,9 +216,20 @@
 
 #ifdef HAVE_LCD_BITMAP
         screen_set_xmargin(display, text_pos); /* margin for title */
+   
+	    if (global_settings.listxpos) {
+    		screen_set_xmargin(display, global_settings.listxpos);
+	    }
+	    if (global_settings.listypos) {
+    		screen_set_ymargin(display, global_settings.listypos);
+	    }
+    	if (global_settings.listwidth) {
+    		display->set_custom_width(global_settings.listwidth);
+    	}
+    	
         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);
@@ -232,6 +243,11 @@
         lines = display->nb_lines;
     }
 
+    
+    if (global_settings.listlines) {
+    	lines = global_settings.listlines;
+    }
+    
     /* Adjust the position of icon, cursor, text for the list */
 #ifdef HAVE_LCD_BITMAP
     display->setfont(FONT_UI);
@@ -243,6 +259,13 @@
     
     draw_cursor = !global_settings.invert_cursor;
     text_pos = 0; /* here it's in pixels */
+    
+	if (global_settings.listxpos) {
+		text_pos = global_settings.listxpos;
+		cursor_pos = global_settings.listxpos;
+		icon_pos = global_settings.listxpos/6+1;
+	}
+
     if(draw_scrollbar || gui_list->title) /* indent if there's a title */
     {
         cursor_pos++;
@@ -266,9 +304,24 @@
 
 #ifdef HAVE_LCD_BITMAP
     screen_set_xmargin(display, text_pos); /* margin for list */
+   
+    if (global_settings.listypos) {
+    	screen_set_ymargin(display, global_settings.listypos);
+    } else {
+    	screen_set_ymargin(display, 
+    		(global_settings.statusbar?STATUSBAR_HEIGHT:0));
+    }
+    if (global_settings.listwidth) {
+    	display->set_custom_width(global_settings.listwidth-
+    		(draw_icons?8:0)-(draw_scrollbar?SCROLLBAR_WIDTH:0));
+    } else {
+    	display->set_custom_width(LCD_WIDTH);
+    }
 #endif
 
-    while (i < display->nb_lines)
+    while (i < (global_settings.listlines?
+    				global_settings.listlines:
+    				display->nb_lines))
     {
         char entry_buffer[MAX_PATH];
         unsigned char *entry_name;
@@ -294,14 +326,14 @@
 #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);
                 else
                     display->puts_scroll_style_offset(0, i, entry_name, STYLE_INVERT,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);
@@ -353,10 +404,23 @@
             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,
+        
+        if (global_settings.listxpos || 
+        	global_settings.listypos || 
+        	global_settings.listlines) 
+        {
+        	gui_scrollbar_draw(display, (global_settings.listxpos?global_settings.listxpos - SCROLLBAR_WIDTH:0), 
+        				   global_settings.listypos, SCROLLBAR_WIDTH-1,
+                           scrollbar_y_end - y_start, gui_list->nb_items,
+                           gui_list->start_item,
+                           gui_list->start_item + global_settings.listlines, 
+                           VERTICAL);
+        } else {
+        	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 + display->nb_lines, VERTICAL);
+        }
     }
 #endif
 
@@ -384,7 +429,15 @@
     else
     {
         gui_list->selected_item+=gui_list->selected_size;
-        int nb_lines = gui_list->display->nb_lines;
+        
+        int nb_lines;
+        
+        if (global_settings.listlines) {
+	        nb_lines = global_settings.listlines;
+        } else {
+    	    nb_lines = gui_list->display->nb_lines;
+        }
+    	    
         if (gui_list->title)
             nb_lines--;
         int item_pos = gui_list->selected_item - gui_list->start_item;
@@ -414,7 +467,14 @@
 
 void gui_list_select_previous(struct gui_list * gui_list)
 {
-    int nb_lines = gui_list->display->nb_lines;        
+	int nb_lines;
+	
+	if (global_settings.listlines) {
+	    nb_lines = global_settings.listlines;        
+	} else {
+    	nb_lines = gui_list->display->nb_lines;
+	}
+    	        
     if (gui_list->title)
         nb_lines--;
     if( gui_list->selected_item-gui_list->selected_size < 0 )
Index: apps/gui/statusbar.c
===================================================================
RCS file: /cvsroot/rockbox/apps/gui/statusbar.c,v
retrieving revision 1.27
diff -u -r1.27 statusbar.c
--- apps/gui/statusbar.c	17 Aug 2006 12:33:36 -0000	1.27
+++ apps/gui/statusbar.c	30 Aug 2006 11:12:50 -0000
@@ -114,6 +114,10 @@
 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->getxmargin();
+	display->set_custom_width(LCD_WIDTH);
+#endif
 
 #ifdef HAVE_LCD_CHARCELLS
     int val;
@@ -306,6 +310,11 @@
     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);
+    display->setfont(FONT_MENU);
+#endif
 }
 
 #ifdef HAVE_LCD_BITMAP
