diff options
author | Kevin Ferrare <kevin@rockbox.org> | 2005-10-28 23:52:49 +0000 |
---|---|---|
committer | Kevin Ferrare <kevin@rockbox.org> | 2005-10-28 23:52:49 +0000 |
commit | d452d26885e67aa7d95f50afcbed14c1b837200d (patch) | |
tree | f3b4de36b83d65351b05d7fe7ea08d9c1e73319c | |
parent | 6ff84632164962aa20a808e7c6708b7a02b015a1 (diff) | |
download | rockbox-d452d26885e67aa7d95f50afcbed14c1b837200d.tar.gz rockbox-d452d26885e67aa7d95f50afcbed14c1b837200d.zip |
Changed some fn names, also corrected a bug with fonts and made the filetree work like the original one (stop on reaching list limits when pressing button)
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@7679 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r-- | apps/gui/buttonbar.c | 8 | ||||
-rw-r--r-- | apps/gui/buttonbar.h | 2 | ||||
-rw-r--r-- | apps/gui/icon.c | 2 | ||||
-rw-r--r-- | apps/gui/icon.h | 2 | ||||
-rw-r--r-- | apps/gui/list.c | 91 | ||||
-rw-r--r-- | apps/gui/list.h | 35 | ||||
-rw-r--r-- | apps/gui/scrollbar.c | 2 | ||||
-rw-r--r-- | apps/gui/scrollbar.h | 2 | ||||
-rw-r--r-- | apps/gui/splash.c | 4 | ||||
-rw-r--r-- | apps/gui/splash.h | 2 | ||||
-rw-r--r-- | apps/gui/statusbar.c | 15 | ||||
-rw-r--r-- | apps/gui/statusbar.h | 4 | ||||
-rw-r--r-- | apps/screen_access.c | 2 | ||||
-rw-r--r-- | apps/tree.c | 2 |
14 files changed, 106 insertions, 67 deletions
diff --git a/apps/gui/buttonbar.c b/apps/gui/buttonbar.c index be87b1b81f..45dc056232 100644 --- a/apps/gui/buttonbar.c +++ b/apps/gui/buttonbar.c | |||
@@ -7,7 +7,7 @@ | |||
7 | * \/ \/ \/ \/ \/ | 7 | * \/ \/ \/ \/ \/ |
8 | * $Id$ | 8 | * $Id$ |
9 | * | 9 | * |
10 | * Copyright (C) Linus Nielsen Feltzing (2002), Kévin FERRARE (2005) | 10 | * Copyright (C) Linus Nielsen Feltzing (2002), Kevin FERRARE (2005) |
11 | * | 11 | * |
12 | * All files in this archive are subject to the GNU General Public License. | 12 | * All files in this archive are subject to the GNU General Public License. |
13 | * See the file COPYING in the source tree root for full license agreement. | 13 | * See the file COPYING in the source tree root for full license agreement. |
@@ -91,7 +91,7 @@ void gui_buttonbar_set(struct gui_buttonbar * buttonbar, | |||
91 | void gui_buttonbar_unset(struct gui_buttonbar * buttonbar) | 91 | void gui_buttonbar_unset(struct gui_buttonbar * buttonbar) |
92 | { | 92 | { |
93 | int i; | 93 | int i; |
94 | for(i = 0;i < BUTTONBAR_MAX_BUTTONS;++i) | 94 | for(i = 0;i < BUTTONBAR_MAX_BUTTONS;i++) |
95 | buttonbar->caption[i][0] = 0; | 95 | buttonbar->caption[i][0] = 0; |
96 | } | 96 | } |
97 | 97 | ||
@@ -105,7 +105,7 @@ void gui_buttonbar_draw(struct gui_buttonbar * buttonbar) | |||
105 | display->width, BUTTONBAR_HEIGHT); | 105 | display->width, BUTTONBAR_HEIGHT); |
106 | display->set_drawmode(DRMODE_SOLID); | 106 | display->set_drawmode(DRMODE_SOLID); |
107 | 107 | ||
108 | for(i = 0;i < BUTTONBAR_MAX_BUTTONS;++i) | 108 | for(i = 0;i < BUTTONBAR_MAX_BUTTONS;i++) |
109 | gui_buttonbar_draw_button(buttonbar, i); | 109 | gui_buttonbar_draw_button(buttonbar, i); |
110 | display->update_rect(0, display->height - BUTTONBAR_HEIGHT, | 110 | display->update_rect(0, display->height - BUTTONBAR_HEIGHT, |
111 | display->width, BUTTONBAR_HEIGHT); | 111 | display->width, BUTTONBAR_HEIGHT); |
@@ -117,7 +117,7 @@ bool gui_buttonbar_isset(struct gui_buttonbar * buttonbar) | |||
117 | if(!global_settings.buttonbar) | 117 | if(!global_settings.buttonbar) |
118 | return(false); | 118 | return(false); |
119 | int i; | 119 | int i; |
120 | for(i = 0;i < BUTTONBAR_MAX_BUTTONS;++i) | 120 | for(i = 0;i < BUTTONBAR_MAX_BUTTONS;i++) |
121 | if(buttonbar->caption[i] != 0) | 121 | if(buttonbar->caption[i] != 0) |
122 | return true; | 122 | return true; |
123 | return false; | 123 | return false; |
diff --git a/apps/gui/buttonbar.h b/apps/gui/buttonbar.h index ee7b8d02c4..9a3f9f4d01 100644 --- a/apps/gui/buttonbar.h +++ b/apps/gui/buttonbar.h | |||
@@ -7,7 +7,7 @@ | |||
7 | * \/ \/ \/ \/ \/ | 7 | * \/ \/ \/ \/ \/ |
8 | * $Id$ | 8 | * $Id$ |
9 | * | 9 | * |
10 | * Copyright (C) 2005 by Kévin FERRARE | 10 | * Copyright (C) 2005 by Kevin FERRARE |
11 | * | 11 | * |
12 | * All files in this archive are subject to the GNU General Public License. | 12 | * All files in this archive are subject to the GNU General Public License. |
13 | * See the file COPYING in the source tree root for full license agreement. | 13 | * See the file COPYING in the source tree root for full license agreement. |
diff --git a/apps/gui/icon.c b/apps/gui/icon.c index 4d174d3427..073cabc532 100644 --- a/apps/gui/icon.c +++ b/apps/gui/icon.c | |||
@@ -7,7 +7,7 @@ | |||
7 | * \/ \/ \/ \/ \/ | 7 | * \/ \/ \/ \/ \/ |
8 | * $Id$ | 8 | * $Id$ |
9 | * | 9 | * |
10 | * Copyright (C) Robert E. Hak(2002), Kévin FERRARE (2005) | 10 | * Copyright (C) Robert E. Hak(2002), Kevin FERRARE (2005) |
11 | * | 11 | * |
12 | * All files in this archive are subject to the GNU General Public License. | 12 | * All files in this archive are subject to the GNU General Public License. |
13 | * See the file COPYING in the source tree root for full license agreement. | 13 | * See the file COPYING in the source tree root for full license agreement. |
diff --git a/apps/gui/icon.h b/apps/gui/icon.h index 46faf0972f..119ee3cc47 100644 --- a/apps/gui/icon.h +++ b/apps/gui/icon.h | |||
@@ -7,7 +7,7 @@ | |||
7 | * \/ \/ \/ \/ \/ | 7 | * \/ \/ \/ \/ \/ |
8 | * $Id$ | 8 | * $Id$ |
9 | * | 9 | * |
10 | * Copyright (C) 2005 by Kévin FERRARE | 10 | * Copyright (C) 2005 by Kevin FERRARE |
11 | * | 11 | * |
12 | * All files in this archive are subject to the GNU General Public License. | 12 | * All files in this archive are subject to the GNU General Public License. |
13 | * See the file COPYING in the source tree root for full license agreement. | 13 | * See the file COPYING in the source tree root for full license agreement. |
diff --git a/apps/gui/list.c b/apps/gui/list.c index bb3eb7caaa..1a83a65e64 100644 --- a/apps/gui/list.c +++ b/apps/gui/list.c | |||
@@ -7,7 +7,7 @@ | |||
7 | * \/ \/ \/ \/ \/ | 7 | * \/ \/ \/ \/ \/ |
8 | * $Id$ | 8 | * $Id$ |
9 | * | 9 | * |
10 | * Copyright (C) 2005 by Kévin FERRARE | 10 | * Copyright (C) 2005 by Kevin FERRARE |
11 | * | 11 | * |
12 | * All files in this archive are subject to the GNU General Public License. | 12 | * All files in this archive are subject to the GNU General Public License. |
13 | * See the file COPYING in the source tree root for full license agreement. | 13 | * See the file COPYING in the source tree root for full license agreement. |
@@ -48,9 +48,10 @@ void gui_list_init(struct gui_list * gui_list, | |||
48 | gui_list_set_nb_items(gui_list, 0); | 48 | gui_list_set_nb_items(gui_list, 0); |
49 | gui_list->selected_item = 0; | 49 | gui_list->selected_item = 0; |
50 | gui_list->start_item = 0; | 50 | gui_list->start_item = 0; |
51 | gui_list->limit_scroll=false; | ||
51 | } | 52 | } |
52 | 53 | ||
53 | void gui_list_set_nb_items(struct gui_list * gui_list, int nb_items) | 54 | inline void gui_list_set_nb_items(struct gui_list * gui_list, int nb_items) |
54 | { | 55 | { |
55 | gui_list->nb_items = nb_items; | 56 | gui_list->nb_items = nb_items; |
56 | } | 57 | } |
@@ -88,12 +89,7 @@ void gui_list_put_selection_in_screen(struct gui_list * gui_list, | |||
88 | gui_list->start_item = 0; | 89 | gui_list->start_item = 0; |
89 | } | 90 | } |
90 | 91 | ||
91 | void gui_list_get_selected_item_name(struct gui_list * gui_list, char *buffer) | 92 | inline int gui_list_get_sel_pos(struct gui_list * gui_list) |
92 | { | ||
93 | gui_list->callback_get_item_name(gui_list->selected_item, buffer); | ||
94 | } | ||
95 | |||
96 | int gui_list_get_selected_item_position(struct gui_list * gui_list) | ||
97 | { | 93 | { |
98 | return gui_list->selected_item; | 94 | return gui_list->selected_item; |
99 | } | 95 | } |
@@ -108,7 +104,7 @@ void gui_list_draw(struct gui_list * gui_list) | |||
108 | global_settings.show_icons) ; | 104 | global_settings.show_icons) ; |
109 | bool draw_cursor; | 105 | bool draw_cursor; |
110 | int i; | 106 | int i; |
111 | 107 | ||
112 | /* Adjust the position of icon, cursor, text */ | 108 | /* Adjust the position of icon, cursor, text */ |
113 | #ifdef HAVE_LCD_BITMAP | 109 | #ifdef HAVE_LCD_BITMAP |
114 | bool draw_scrollbar = (global_settings.scrollbar && | 110 | bool draw_scrollbar = (global_settings.scrollbar && |
@@ -116,7 +112,7 @@ void gui_list_draw(struct gui_list * gui_list) | |||
116 | 112 | ||
117 | int list_y_start = screen_get_text_y_start(gui_list->display); | 113 | int list_y_start = screen_get_text_y_start(gui_list->display); |
118 | int list_y_end = screen_get_text_y_end(gui_list->display); | 114 | int list_y_end = screen_get_text_y_end(gui_list->display); |
119 | 115 | ||
120 | draw_cursor = !global_settings.invert_cursor; | 116 | draw_cursor = !global_settings.invert_cursor; |
121 | text_pos = 0; /* here it's in pixels */ | 117 | text_pos = 0; /* here it's in pixels */ |
122 | if(draw_scrollbar) | 118 | if(draw_scrollbar) |
@@ -131,7 +127,7 @@ void gui_list_draw(struct gui_list * gui_list) | |||
131 | } | 127 | } |
132 | else | 128 | else |
133 | text_pos += CURSOR_WIDTH; | 129 | text_pos += CURSOR_WIDTH; |
134 | 130 | ||
135 | if(draw_icons) | 131 | if(draw_icons) |
136 | text_pos += 8; | 132 | text_pos += 8; |
137 | #else | 133 | #else |
@@ -149,8 +145,7 @@ void gui_list_draw(struct gui_list * gui_list) | |||
149 | display->width, list_y_end - list_y_start); | 145 | display->width, list_y_end - list_y_start); |
150 | display->set_drawmode(DRMODE_SOLID); | 146 | display->set_drawmode(DRMODE_SOLID); |
151 | 147 | ||
152 | /* FIXME: should not be handled here, but rather in the | 148 | display->setfont(FONT_UI); |
153 | * code that changes fonts */ | ||
154 | screen_update_nblines(display); | 149 | screen_update_nblines(display); |
155 | 150 | ||
156 | display->stop_scroll(); | 151 | display->stop_scroll(); |
@@ -159,12 +154,12 @@ void gui_list_draw(struct gui_list * gui_list) | |||
159 | display->clear_display(); | 154 | display->clear_display(); |
160 | #endif | 155 | #endif |
161 | 156 | ||
162 | for(i = 0;i < display->nb_lines;++i) | 157 | for(i = 0;i < display->nb_lines;i++) |
163 | { | 158 | { |
164 | char entry_buffer[MAX_PATH]; | 159 | char entry_buffer[MAX_PATH]; |
165 | char * entry_name; | 160 | char * entry_name; |
166 | int current_item = gui_list->start_item + i; | 161 | int current_item = gui_list->start_item + i; |
167 | 162 | ||
168 | /* When there are less items to display than the | 163 | /* When there are less items to display than the |
169 | * current available space on the screen, we stop*/ | 164 | * current available space on the screen, we stop*/ |
170 | if(current_item >= gui_list->nb_items) | 165 | if(current_item >= gui_list->nb_items) |
@@ -234,18 +229,20 @@ void gui_list_select_next(struct gui_list * gui_list) | |||
234 | { | 229 | { |
235 | int item_pos; | 230 | int item_pos; |
236 | int end_item; | 231 | int end_item; |
237 | int nb_lines = gui_list->display->nb_lines; | ||
238 | |||
239 | ++gui_list->selected_item; | ||
240 | 232 | ||
241 | if( gui_list->selected_item >= gui_list->nb_items ) | 233 | if( gui_list->selected_item == gui_list->nb_items-1 ) |
242 | { | 234 | { |
235 | if(gui_list->limit_scroll) | ||
236 | return; | ||
237 | ++gui_list->selected_item; | ||
243 | /* we have already reached the bottom of the list */ | 238 | /* we have already reached the bottom of the list */ |
244 | gui_list->selected_item = 0; | 239 | gui_list->selected_item = 0; |
245 | gui_list->start_item = 0; | 240 | gui_list->start_item = 0; |
246 | } | 241 | } |
247 | else | 242 | else |
248 | { | 243 | { |
244 | int nb_lines = gui_list->display->nb_lines; | ||
245 | ++gui_list->selected_item; | ||
249 | item_pos = gui_list->selected_item - gui_list->start_item; | 246 | item_pos = gui_list->selected_item - gui_list->start_item; |
250 | end_item = gui_list->start_item + nb_lines; | 247 | end_item = gui_list->start_item + nb_lines; |
251 | /* we start scrolling vertically when reaching the line | 248 | /* we start scrolling vertically when reaching the line |
@@ -261,9 +258,11 @@ void gui_list_select_previous(struct gui_list * gui_list) | |||
261 | int item_pos; | 258 | int item_pos; |
262 | int nb_lines = gui_list->display->nb_lines; | 259 | int nb_lines = gui_list->display->nb_lines; |
263 | 260 | ||
264 | --gui_list->selected_item; | 261 | if( gui_list->selected_item == 0 ) |
265 | if( gui_list->selected_item < 0 ) | ||
266 | { | 262 | { |
263 | if(gui_list->limit_scroll) | ||
264 | return; | ||
265 | --gui_list->selected_item; | ||
267 | /* we have aleady reached the top of the list */ | 266 | /* we have aleady reached the top of the list */ |
268 | int start; | 267 | int start; |
269 | gui_list->selected_item = gui_list->nb_items-1; | 268 | gui_list->selected_item = gui_list->nb_items-1; |
@@ -275,6 +274,7 @@ void gui_list_select_previous(struct gui_list * gui_list) | |||
275 | } | 274 | } |
276 | else | 275 | else |
277 | { | 276 | { |
277 | --gui_list->selected_item; | ||
278 | item_pos = gui_list->selected_item - gui_list->start_item; | 278 | item_pos = gui_list->selected_item - gui_list->start_item; |
279 | if( item_pos < SCROLL_LIMIT-1 && gui_list->start_item > 0 ) | 279 | if( item_pos < SCROLL_LIMIT-1 && gui_list->start_item > 0 ) |
280 | --gui_list->start_item; | 280 | --gui_list->start_item; |
@@ -284,7 +284,11 @@ void gui_list_select_previous(struct gui_list * gui_list) | |||
284 | void gui_list_select_next_page(struct gui_list * gui_list, int nb_lines) | 284 | void gui_list_select_next_page(struct gui_list * gui_list, int nb_lines) |
285 | { | 285 | { |
286 | if(gui_list->selected_item == gui_list->nb_items-1) | 286 | if(gui_list->selected_item == gui_list->nb_items-1) |
287 | { | ||
288 | if(gui_list->limit_scroll) | ||
289 | return; | ||
287 | gui_list->selected_item = 0; | 290 | gui_list->selected_item = 0; |
291 | } | ||
288 | else | 292 | else |
289 | { | 293 | { |
290 | gui_list->selected_item += nb_lines; | 294 | gui_list->selected_item += nb_lines; |
@@ -297,7 +301,11 @@ void gui_list_select_next_page(struct gui_list * gui_list, int nb_lines) | |||
297 | void gui_list_select_previous_page(struct gui_list * gui_list, int nb_lines) | 301 | void gui_list_select_previous_page(struct gui_list * gui_list, int nb_lines) |
298 | { | 302 | { |
299 | if(gui_list->selected_item == 0) | 303 | if(gui_list->selected_item == 0) |
304 | { | ||
305 | if(gui_list->limit_scroll) | ||
306 | return; | ||
300 | gui_list->selected_item = gui_list->nb_items - 1; | 307 | gui_list->selected_item = gui_list->nb_items - 1; |
308 | } | ||
301 | else | 309 | else |
302 | { | 310 | { |
303 | gui_list->selected_item -= nb_lines; | 311 | gui_list->selected_item -= nb_lines; |
@@ -332,13 +340,17 @@ void gui_list_del_item(struct gui_list * gui_list) | |||
332 | --gui_list->selected_item; | 340 | --gui_list->selected_item; |
333 | } | 341 | } |
334 | --gui_list->nb_items; | 342 | --gui_list->nb_items; |
335 | 343 | ||
336 | /* scroll the list if needed */ | 344 | /* scroll the list if needed */ |
337 | if( (dist_start_from_end < nb_lines) && (gui_list->start_item != 0) ) | 345 | if( (dist_start_from_end < nb_lines) && (gui_list->start_item != 0) ) |
338 | --gui_list->start_item; | 346 | --gui_list->start_item; |
339 | } | 347 | } |
340 | } | 348 | } |
341 | 349 | ||
350 | inline void gui_list_limit_scroll(struct gui_list * gui_list, bool scroll) | ||
351 | { | ||
352 | gui_list->limit_scroll=scroll; | ||
353 | } | ||
342 | /* | 354 | /* |
343 | * Synchronized lists stuffs | 355 | * Synchronized lists stuffs |
344 | */ | 356 | */ |
@@ -366,15 +378,9 @@ void gui_synclist_set_nb_items(struct gui_synclist * lists, int nb_items) | |||
366 | } | 378 | } |
367 | } | 379 | } |
368 | 380 | ||
369 | void gui_synclist_get_selected_item_name(struct gui_synclist * lists, | 381 | int gui_synclist_get_sel_pos(struct gui_synclist * lists) |
370 | char *buffer) | ||
371 | { | ||
372 | gui_list_get_selected_item_name(&(lists->gui_list[0]), buffer); | ||
373 | } | ||
374 | |||
375 | int gui_synclist_get_selected_item_position(struct gui_synclist * lists) | ||
376 | { | 382 | { |
377 | return gui_list_get_selected_item_position(&(lists->gui_list[0])); | 383 | return gui_list_get_sel_pos(&(lists->gui_list[0])); |
378 | } | 384 | } |
379 | 385 | ||
380 | void gui_synclist_draw(struct gui_synclist * lists) | 386 | void gui_synclist_draw(struct gui_synclist * lists) |
@@ -437,14 +443,26 @@ void gui_synclist_del_item(struct gui_synclist * lists) | |||
437 | gui_list_del_item(&(lists->gui_list[i])); | 443 | gui_list_del_item(&(lists->gui_list[i])); |
438 | } | 444 | } |
439 | 445 | ||
446 | void gui_synclist_limit_scroll(struct gui_synclist * lists, bool scroll) | ||
447 | { | ||
448 | int i; | ||
449 | for(i = 0;i < NB_SCREENS;i++) | ||
450 | gui_list_limit_scroll(&(lists->gui_list[i]), scroll); | ||
451 | } | ||
452 | |||
440 | bool gui_synclist_do_button(struct gui_synclist * lists, unsigned button) | 453 | bool gui_synclist_do_button(struct gui_synclist * lists, unsigned button) |
441 | { | 454 | { |
455 | gui_synclist_limit_scroll(lists, true); | ||
442 | switch(button) | 456 | switch(button) |
443 | { | 457 | { |
444 | case LIST_PREV: | 458 | case LIST_PREV: |
445 | case LIST_PREV | BUTTON_REPEAT: | ||
446 | #ifdef LIST_RC_PREV | 459 | #ifdef LIST_RC_PREV |
447 | case LIST_RC_PREV: | 460 | case LIST_RC_PREV: |
461 | #endif | ||
462 | gui_synclist_limit_scroll(lists, false); | ||
463 | |||
464 | case LIST_PREV | BUTTON_REPEAT: | ||
465 | #ifdef LIST_RC_PREV | ||
448 | case LIST_RC_PREV | BUTTON_REPEAT: | 466 | case LIST_RC_PREV | BUTTON_REPEAT: |
449 | #endif | 467 | #endif |
450 | gui_synclist_select_previous(lists); | 468 | gui_synclist_select_previous(lists); |
@@ -452,9 +470,14 @@ bool gui_synclist_do_button(struct gui_synclist * lists, unsigned button) | |||
452 | return true; | 470 | return true; |
453 | 471 | ||
454 | case LIST_NEXT: | 472 | case LIST_NEXT: |
455 | case LIST_NEXT | BUTTON_REPEAT: | ||
456 | #ifdef LIST_RC_NEXT | 473 | #ifdef LIST_RC_NEXT |
457 | case LIST_RC_NEXT: | 474 | case LIST_RC_NEXT: |
475 | #endif | ||
476 | gui_synclist_limit_scroll(lists, false); | ||
477 | |||
478 | case LIST_NEXT | BUTTON_REPEAT: | ||
479 | #ifdef LIST_RC_NEXT | ||
480 | |||
458 | case LIST_RC_NEXT | BUTTON_REPEAT: | 481 | case LIST_RC_NEXT | BUTTON_REPEAT: |
459 | #endif | 482 | #endif |
460 | gui_synclist_select_next(lists); | 483 | gui_synclist_select_next(lists); |
@@ -465,6 +488,7 @@ bool gui_synclist_do_button(struct gui_synclist * lists, unsigned button) | |||
465 | * have the same number of lines*/ | 488 | * have the same number of lines*/ |
466 | #ifdef LIST_PGUP | 489 | #ifdef LIST_PGUP |
467 | case LIST_PGUP: | 490 | case LIST_PGUP: |
491 | gui_synclist_limit_scroll(lists, false); | ||
468 | case LIST_PGUP | BUTTON_REPEAT: | 492 | case LIST_PGUP | BUTTON_REPEAT: |
469 | gui_synclist_select_previous_page(lists, SCREEN_MAIN); | 493 | gui_synclist_select_previous_page(lists, SCREEN_MAIN); |
470 | gui_synclist_draw(lists); | 494 | gui_synclist_draw(lists); |
@@ -473,6 +497,7 @@ bool gui_synclist_do_button(struct gui_synclist * lists, unsigned button) | |||
473 | 497 | ||
474 | #ifdef LIST_RC_PGUP | 498 | #ifdef LIST_RC_PGUP |
475 | case LIST_RC_PGUP: | 499 | case LIST_RC_PGUP: |
500 | gui_synclist_limit_scroll(lists, false); | ||
476 | case LIST_RC_PGUP | BUTTON_REPEAT: | 501 | case LIST_RC_PGUP | BUTTON_REPEAT: |
477 | gui_synclist_select_previous_page(lists, SCREEN_REMOTE); | 502 | gui_synclist_select_previous_page(lists, SCREEN_REMOTE); |
478 | gui_synclist_draw(lists); | 503 | gui_synclist_draw(lists); |
@@ -481,6 +506,7 @@ bool gui_synclist_do_button(struct gui_synclist * lists, unsigned button) | |||
481 | 506 | ||
482 | #ifdef LIST_PGDN | 507 | #ifdef LIST_PGDN |
483 | case LIST_PGDN: | 508 | case LIST_PGDN: |
509 | gui_synclist_limit_scroll(lists, false); | ||
484 | case LIST_PGDN | BUTTON_REPEAT: | 510 | case LIST_PGDN | BUTTON_REPEAT: |
485 | gui_synclist_select_next_page(lists, SCREEN_MAIN); | 511 | gui_synclist_select_next_page(lists, SCREEN_MAIN); |
486 | gui_synclist_draw(lists); | 512 | gui_synclist_draw(lists); |
@@ -489,6 +515,7 @@ bool gui_synclist_do_button(struct gui_synclist * lists, unsigned button) | |||
489 | 515 | ||
490 | #ifdef LIST_RC_PGDN | 516 | #ifdef LIST_RC_PGDN |
491 | case LIST_RC_PGDN: | 517 | case LIST_RC_PGDN: |
518 | gui_synclist_limit_scroll(lists, false); | ||
492 | case LIST_RC_PGDN | BUTTON_REPEAT: | 519 | case LIST_RC_PGDN | BUTTON_REPEAT: |
493 | gui_synclist_select_next_page(lists, SCREEN_REMOTE); | 520 | gui_synclist_select_next_page(lists, SCREEN_REMOTE); |
494 | gui_synclist_draw(lists); | 521 | gui_synclist_draw(lists); |
diff --git a/apps/gui/list.h b/apps/gui/list.h index fd553f381c..e47f260a1b 100644 --- a/apps/gui/list.h +++ b/apps/gui/list.h | |||
@@ -7,7 +7,7 @@ | |||
7 | * \/ \/ \/ \/ \/ | 7 | * \/ \/ \/ \/ \/ |
8 | * $Id$ | 8 | * $Id$ |
9 | * | 9 | * |
10 | * Copyright (C) 2005 by Kévin FERRARE | 10 | * Copyright (C) 2005 by Kevin FERRARE |
11 | * | 11 | * |
12 | * All files in this archive are subject to the GNU General Public License. | 12 | * All files in this archive are subject to the GNU General Public License. |
13 | * See the file COPYING in the source tree root for full license agreement. | 13 | * See the file COPYING in the source tree root for full license agreement. |
@@ -75,6 +75,9 @@ struct gui_list | |||
75 | 75 | ||
76 | struct screen * display; | 76 | struct screen * display; |
77 | int line_scroll_limit; | 77 | int line_scroll_limit; |
78 | /* defines wether the list should stop when reaching the top/bottom | ||
79 | * or should continue (by going to bottom/top) */ | ||
80 | bool limit_scroll; | ||
78 | }; | 81 | }; |
79 | 82 | ||
80 | /* | 83 | /* |
@@ -91,12 +94,12 @@ extern void gui_list_init(struct gui_list * gui_list, | |||
91 | ); | 94 | ); |
92 | 95 | ||
93 | /* | 96 | /* |
94 | * Sets the numburs of items the list can currently display | 97 | * Sets the numbers of items the list can currently display |
95 | * note that the list's context like the currently pointed item is resetted | 98 | * note that the list's context like the currently pointed item is resetted |
96 | * - gui_list : the list structure to initialize | 99 | * - gui_list : the list structure to initialize |
97 | * - nb_items : the numbers of items you want | 100 | * - nb_items : the numbers of items you want |
98 | */ | 101 | */ |
99 | extern void gui_list_set_nb_items(struct gui_list * gui_list, int nb_items); | 102 | extern inline void gui_list_set_nb_items(struct gui_list * gui_list, int nb_items); |
100 | 103 | ||
101 | /* | 104 | /* |
102 | * Puts the selection in the screen | 105 | * Puts the selection in the screen |
@@ -118,19 +121,11 @@ extern void gui_list_set_display(struct gui_list * gui_list, | |||
118 | struct screen * display); | 121 | struct screen * display); |
119 | 122 | ||
120 | /* | 123 | /* |
121 | * Gives the name of the selected object | ||
122 | * - gui_list : the list structure | ||
123 | * - buffer : a buffer which is filled with the name | ||
124 | */ | ||
125 | extern void gui_list_get_selected_item_name(struct gui_list * gui_list, | ||
126 | char *buffer); | ||
127 | |||
128 | /* | ||
129 | * Gives the position of the selected item | 124 | * Gives the position of the selected item |
130 | * - gui_list : the list structure | 125 | * - gui_list : the list structure |
131 | * Returns the position | 126 | * Returns the position |
132 | */ | 127 | */ |
133 | extern int gui_list_get_selected_item_position(struct gui_list * gui_list); | 128 | extern inline int gui_list_get_sel_pos(struct gui_list * gui_list); |
134 | 129 | ||
135 | /* | 130 | /* |
136 | * Selects an item in the list | 131 | * Selects an item in the list |
@@ -187,6 +182,15 @@ extern void gui_list_add_item(struct gui_list * gui_list); | |||
187 | */ | 182 | */ |
188 | extern void gui_list_del_item(struct gui_list * gui_list); | 183 | extern void gui_list_del_item(struct gui_list * gui_list); |
189 | 184 | ||
185 | /* | ||
186 | * Tells the list wether it should stop when reaching the top/bottom | ||
187 | * or should continue (by going to bottom/top) | ||
188 | * - gui_list : the list structure | ||
189 | * - scroll : | ||
190 | * - true : stops when reaching top/bottom | ||
191 | * - false : continues to go to bottom/top when reaching top/bottom | ||
192 | */ | ||
193 | extern inline void gui_list_limit_scroll(struct gui_list * gui_list, bool scroll); | ||
190 | 194 | ||
191 | /* | 195 | /* |
192 | * This part handles as many lists as there are connected screens | 196 | * This part handles as many lists as there are connected screens |
@@ -207,9 +211,8 @@ extern void gui_synclist_init(struct gui_synclist * lists, | |||
207 | char * (*callback_get_item_name)(int selected_item, char *buffer) | 211 | char * (*callback_get_item_name)(int selected_item, char *buffer) |
208 | ); | 212 | ); |
209 | extern void gui_synclist_set_nb_items(struct gui_synclist * lists, int nb_items); | 213 | extern void gui_synclist_set_nb_items(struct gui_synclist * lists, int nb_items); |
210 | extern void gui_synclist_get_selected_item_name(struct gui_synclist * lists, | 214 | |
211 | char *buffer); | 215 | extern int gui_synclist_get_sel_pos(struct gui_synclist * lists); |
212 | extern int gui_synclist_get_selected_item_position(struct gui_synclist * lists); | ||
213 | extern void gui_synclist_draw(struct gui_synclist * lists); | 216 | extern void gui_synclist_draw(struct gui_synclist * lists); |
214 | extern void gui_synclist_select_item(struct gui_synclist * lists, | 217 | extern void gui_synclist_select_item(struct gui_synclist * lists, |
215 | int item_number); | 218 | int item_number); |
@@ -221,6 +224,8 @@ extern void gui_synclist_select_previous_page(struct gui_synclist * lists, | |||
221 | enum screen_type screen); | 224 | enum screen_type screen); |
222 | extern void gui_synclist_add_item(struct gui_synclist * lists); | 225 | extern void gui_synclist_add_item(struct gui_synclist * lists); |
223 | extern void gui_synclist_del_item(struct gui_synclist * lists); | 226 | extern void gui_synclist_del_item(struct gui_synclist * lists); |
227 | extern void gui_synclist_limit_scroll(struct gui_synclist * lists, bool scroll); | ||
228 | |||
224 | /* | 229 | /* |
225 | * Do the action implied by the given button, | 230 | * Do the action implied by the given button, |
226 | * returns true if something has been done, false otherwise | 231 | * returns true if something has been done, false otherwise |
diff --git a/apps/gui/scrollbar.c b/apps/gui/scrollbar.c index 9d5717f1a7..da6e18ca91 100644 --- a/apps/gui/scrollbar.c +++ b/apps/gui/scrollbar.c | |||
@@ -7,7 +7,7 @@ | |||
7 | * \/ \/ \/ \/ \/ | 7 | * \/ \/ \/ \/ \/ |
8 | * $Id$ | 8 | * $Id$ |
9 | * | 9 | * |
10 | * Copyright (C) Markus Braun (2002), Kévin FERRARE (2005) | 10 | * Copyright (C) Markus Braun (2002), Kevin FERRARE (2005) |
11 | * | 11 | * |
12 | * All files in this archive are subject to the GNU General Public License. | 12 | * All files in this archive are subject to the GNU General Public License. |
13 | * See the file COPYING in the source tree root for full license agreement. | 13 | * See the file COPYING in the source tree root for full license agreement. |
diff --git a/apps/gui/scrollbar.h b/apps/gui/scrollbar.h index 51c08352ba..c8ce694caa 100644 --- a/apps/gui/scrollbar.h +++ b/apps/gui/scrollbar.h | |||
@@ -7,7 +7,7 @@ | |||
7 | * \/ \/ \/ \/ \/ | 7 | * \/ \/ \/ \/ \/ |
8 | * $Id$ | 8 | * $Id$ |
9 | * | 9 | * |
10 | * Copyright (C) 2005 Kévin FERRARE | 10 | * Copyright (C) 2005 Kevin FERRARE |
11 | * | 11 | * |
12 | * All files in this archive are subject to the GNU General Public License. | 12 | * All files in this archive are subject to the GNU General Public License. |
13 | * See the file COPYING in the source tree root for full license agreement. | 13 | * See the file COPYING in the source tree root for full license agreement. |
diff --git a/apps/gui/splash.c b/apps/gui/splash.c index a3cbb198df..9d1cf75732 100644 --- a/apps/gui/splash.c +++ b/apps/gui/splash.c | |||
@@ -7,7 +7,7 @@ | |||
7 | * \/ \/ \/ \/ \/ | 7 | * \/ \/ \/ \/ \/ |
8 | * $Id$ | 8 | * $Id$ |
9 | * | 9 | * |
10 | * Copyright (C) Daniel Stenberg (2002), Kévin FERRARE (2005) | 10 | * Copyright (C) Daniel Stenberg (2002), Kevin FERRARE (2005) |
11 | * | 11 | * |
12 | * All files in this archive are subject to the GNU General Public License. | 12 | * All files in this archive are subject to the GNU General Public License. |
13 | * See the file COPYING in the source tree root for full license agreement. | 13 | * See the file COPYING in the source tree root for full license agreement. |
@@ -207,7 +207,7 @@ void gui_syncsplash(int ticks, bool center, const char *fmt, ...) | |||
207 | va_list ap; | 207 | va_list ap; |
208 | int i; | 208 | int i; |
209 | va_start( ap, fmt ); | 209 | va_start( ap, fmt ); |
210 | for(i=0;i<NB_SCREENS;++i) | 210 | for(i=0;i<NB_SCREENS;i++) |
211 | internal_splash(&(screens[i]), center, fmt, ap); | 211 | internal_splash(&(screens[i]), center, fmt, ap); |
212 | va_end( ap ); | 212 | va_end( ap ); |
213 | 213 | ||
diff --git a/apps/gui/splash.h b/apps/gui/splash.h index b0d55db890..3758c9bb23 100644 --- a/apps/gui/splash.h +++ b/apps/gui/splash.h | |||
@@ -7,7 +7,7 @@ | |||
7 | * \/ \/ \/ \/ \/ | 7 | * \/ \/ \/ \/ \/ |
8 | * $Id$ | 8 | * $Id$ |
9 | * | 9 | * |
10 | * Copyright (C) 2005 by Kévin FERRARE | 10 | * Copyright (C) 2005 by Kevin FERRARE |
11 | * | 11 | * |
12 | * All files in this archive are subject to the GNU General Public License. | 12 | * All files in this archive are subject to the GNU General Public License. |
13 | * See the file COPYING in the source tree root for full license agreement. | 13 | * See the file COPYING in the source tree root for full license agreement. |
diff --git a/apps/gui/statusbar.c b/apps/gui/statusbar.c index 52b93a4385..0e7210218e 100644 --- a/apps/gui/statusbar.c +++ b/apps/gui/statusbar.c | |||
@@ -7,7 +7,7 @@ | |||
7 | * \/ \/ \/ \/ \/ | 7 | * \/ \/ \/ \/ \/ |
8 | * $Id$ | 8 | * $Id$ |
9 | * | 9 | * |
10 | * Copyright (C) Robert E. Hak (2002), Linus Nielsen Feltzing (2002), Kévin FERRARE (2005) | 10 | * Copyright (C) Robert E. Hak (2002), Linus Nielsen Feltzing (2002), Kevin FERRARE (2005) |
11 | * | 11 | * |
12 | * All files in this archive are subject to the GNU General Public License. | 12 | * All files in this archive are subject to the GNU General Public License. |
13 | * See the file COPYING in the source tree root for full license agreement. | 13 | * See the file COPYING in the source tree root for full license agreement. |
@@ -111,9 +111,11 @@ void gui_statusbar_draw(struct gui_statusbar * bar, bool force_redraw) | |||
111 | 111 | ||
112 | struct screen * display = bar->display; | 112 | struct screen * display = bar->display; |
113 | 113 | ||
114 | #ifdef HAVE_LCD_BITMAP | 114 | #ifdef HAVE_RTC |
115 | struct tm* tm; /* For Time */ | 115 | struct tm* tm; /* For Time */ |
116 | #else | 116 | #endif |
117 | |||
118 | #ifndef HAVE_LCD_BITMAP | ||
117 | (void)force_redraw; /* players always "redraw" */ | 119 | (void)force_redraw; /* players always "redraw" */ |
118 | #endif | 120 | #endif |
119 | 121 | ||
@@ -123,9 +125,12 @@ void gui_statusbar_draw(struct gui_statusbar * bar, bool force_redraw) | |||
123 | bar->info.battery_safe = battery_level_safe(); | 125 | bar->info.battery_safe = battery_level_safe(); |
124 | 126 | ||
125 | #ifdef HAVE_LCD_BITMAP | 127 | #ifdef HAVE_LCD_BITMAP |
128 | #ifdef HAVE_RTC | ||
126 | tm = get_time(); | 129 | tm = get_time(); |
127 | bar->info.hour = tm->tm_hour; | 130 | bar->info.hour = tm->tm_hour; |
128 | bar->info.minute = tm->tm_min; | 131 | bar->info.minute = tm->tm_min; |
132 | #endif | ||
133 | |||
129 | bar->info.shuffle = global_settings.playlist_shuffle; | 134 | bar->info.shuffle = global_settings.playlist_shuffle; |
130 | #if CONFIG_KEYPAD == IRIVER_H100_PAD | 135 | #if CONFIG_KEYPAD == IRIVER_H100_PAD |
131 | bar->info.keylock = button_hold(); | 136 | bar->info.keylock = button_hold(); |
@@ -495,7 +500,7 @@ void gui_statusbar_time(struct screen * display, int hour, int minute) | |||
495 | void gui_syncstatusbar_init(struct gui_syncstatusbar * bars) | 500 | void gui_syncstatusbar_init(struct gui_syncstatusbar * bars) |
496 | { | 501 | { |
497 | int i; | 502 | int i; |
498 | for(i = 0;i < NB_SCREENS;++i) { | 503 | for(i = 0;i < NB_SCREENS;i++) { |
499 | gui_statusbar_init( &(bars->statusbars[i]) ); | 504 | gui_statusbar_init( &(bars->statusbars[i]) ); |
500 | gui_statusbar_set_screen( &(bars->statusbars[i]), &(screens[i]) ); | 505 | gui_statusbar_set_screen( &(bars->statusbars[i]), &(screens[i]) ); |
501 | } | 506 | } |
@@ -505,7 +510,7 @@ void gui_syncstatusbar_draw(struct gui_syncstatusbar * bars, | |||
505 | bool force_redraw) | 510 | bool force_redraw) |
506 | { | 511 | { |
507 | int i; | 512 | int i; |
508 | for(i = 0;i < NB_SCREENS;++i) { | 513 | for(i = 0;i < NB_SCREENS;i++) { |
509 | gui_statusbar_draw( &(bars->statusbars[i]), force_redraw ); | 514 | gui_statusbar_draw( &(bars->statusbars[i]), force_redraw ); |
510 | } | 515 | } |
511 | } | 516 | } |
diff --git a/apps/gui/statusbar.h b/apps/gui/statusbar.h index 483652d67d..d3acbec8e5 100644 --- a/apps/gui/statusbar.h +++ b/apps/gui/statusbar.h | |||
@@ -7,7 +7,7 @@ | |||
7 | * \/ \/ \/ \/ \/ | 7 | * \/ \/ \/ \/ \/ |
8 | * $Id$ | 8 | * $Id$ |
9 | * | 9 | * |
10 | * Copyright (C) 2005 by Kévin FERRARE | 10 | * Copyright (C) 2005 by Kevin FERRARE |
11 | * | 11 | * |
12 | * All files in this archive are subject to the GNU General Public License. | 12 | * All files in this archive are subject to the GNU General Public License. |
13 | * See the file COPYING in the source tree root for full license agreement. | 13 | * See the file COPYING in the source tree root for full license agreement. |
@@ -26,8 +26,10 @@ | |||
26 | struct status_info { | 26 | struct status_info { |
27 | int battlevel; | 27 | int battlevel; |
28 | int volume; | 28 | int volume; |
29 | #ifdef HAVE_RTC | ||
29 | int hour; | 30 | int hour; |
30 | int minute; | 31 | int minute; |
32 | #endif | ||
31 | int playmode; | 33 | int playmode; |
32 | int repeat; | 34 | int repeat; |
33 | bool inserted; | 35 | bool inserted; |
diff --git a/apps/screen_access.c b/apps/screen_access.c index a4f87de80e..e56a75dcce 100644 --- a/apps/screen_access.c +++ b/apps/screen_access.c | |||
@@ -7,7 +7,7 @@ | |||
7 | * \/ \/ \/ \/ \/ | 7 | * \/ \/ \/ \/ \/ |
8 | * $Id$ | 8 | * $Id$ |
9 | * | 9 | * |
10 | * Copyright (C) 2005 by Kévin FERRARE | 10 | * Copyright (C) 2005 by Kevin FERRARE |
11 | * | 11 | * |
12 | * All files in this archive are subject to the GNU General Public License. | 12 | * All files in this archive are subject to the GNU General Public License. |
13 | * See the file COPYING in the source tree root for full license agreement. | 13 | * See the file COPYING in the source tree root for full license agreement. |
diff --git a/apps/tree.c b/apps/tree.c index b26221a0fe..33fb92259c 100644 --- a/apps/tree.c +++ b/apps/tree.c | |||
@@ -939,7 +939,7 @@ static bool dirbrowse(void) | |||
939 | reload_dir = false; | 939 | reload_dir = false; |
940 | } | 940 | } |
941 | if(need_update) { | 941 | if(need_update) { |
942 | tc.selected_item = gui_synclist_get_selected_item_position(&tree_lists); | 942 | tc.selected_item = gui_synclist_get_sel_pos(&tree_lists); |
943 | need_update=false; | 943 | need_update=false; |
944 | if ( numentries > 0 ) { | 944 | if ( numentries > 0 ) { |
945 | /* Voice the file if changed */ | 945 | /* Voice the file if changed */ |