diff options
Diffstat (limited to 'apps')
-rw-r--r-- | apps/gui/list.c | 127 | ||||
-rw-r--r-- | apps/gui/list.h | 37 | ||||
-rw-r--r-- | apps/lang/english.lang | 11 | ||||
-rw-r--r-- | apps/screen_access.c | 19 | ||||
-rw-r--r-- | apps/screen_access.h | 19 | ||||
-rw-r--r-- | apps/settings.c | 12 | ||||
-rw-r--r-- | apps/settings.h | 2 | ||||
-rw-r--r-- | apps/settings_menu.c | 32 |
8 files changed, 238 insertions, 21 deletions
diff --git a/apps/gui/list.c b/apps/gui/list.c index 83a1fbfb22..2ae5f995f4 100644 --- a/apps/gui/list.c +++ b/apps/gui/list.c | |||
@@ -37,7 +37,8 @@ | |||
37 | #define SCROLL_LIMIT 2 | 37 | #define SCROLL_LIMIT 2 |
38 | #endif | 38 | #endif |
39 | 39 | ||
40 | 40 | static int offset_step = 15; | |
41 | static bool offset_outof_view = false; | ||
41 | 42 | ||
42 | void gui_list_init(struct gui_list * gui_list, | 43 | void gui_list_init(struct gui_list * gui_list, |
43 | list_get_name callback_get_item_name, | 44 | list_get_name callback_get_item_name, |
@@ -53,6 +54,7 @@ void gui_list_init(struct gui_list * gui_list, | |||
53 | gui_list->limit_scroll = false; | 54 | gui_list->limit_scroll = false; |
54 | gui_list->data=data; | 55 | gui_list->data=data; |
55 | gui_list->cursor_flash_state=false; | 56 | gui_list->cursor_flash_state=false; |
57 | gui_list->offsetval = 0; | ||
56 | } | 58 | } |
57 | 59 | ||
58 | void gui_list_set_display(struct gui_list * gui_list, struct screen * display) | 60 | void gui_list_set_display(struct gui_list * gui_list, struct screen * display) |
@@ -179,14 +181,47 @@ void gui_list_draw(struct gui_list * gui_list) | |||
179 | entry_name = gui_list->callback_get_item_name(current_item, | 181 | entry_name = gui_list->callback_get_item_name(current_item, |
180 | gui_list->data, | 182 | gui_list->data, |
181 | entry_buffer); | 183 | entry_buffer); |
182 | if(current_item == gui_list->selected_item) | 184 | |
183 | { | ||
184 | /* The selected item must be displayed scrolling */ | ||
185 | #ifdef HAVE_LCD_BITMAP | 185 | #ifdef HAVE_LCD_BITMAP |
186 | if (global_settings.invert_cursor)/* Display inverted-line-style*/ | 186 | /* position the string at the right offset place */ |
187 | display->puts_scroll_style(0, i, entry_name, STYLE_INVERT); | 187 | int item_offset; |
188 | int str_width,h; | ||
189 | display->getstringsize(entry_name, &str_width, &h); | ||
190 | |||
191 | if (offset_outof_view) | ||
192 | item_offset = gui_list->offsetval; | ||
193 | else | ||
194 | /* if text is smaller then view */ | ||
195 | if (str_width <= display->width - text_pos) | ||
196 | item_offset = 0; | ||
197 | else | ||
198 | /* if text got out of view */ | ||
199 | if (gui_list->offsetval > str_width - (display->width - text_pos)) | ||
200 | item_offset = str_width - (display->width - text_pos); | ||
188 | else | 201 | else |
189 | display->puts_scroll(0, i, entry_name); | 202 | item_offset = gui_list->offsetval; |
203 | |||
204 | #endif | ||
205 | |||
206 | if(current_item == gui_list->selected_item) { | ||
207 | /* The selected item must be displayed scrolling */ | ||
208 | #ifdef HAVE_LCD_BITMAP | ||
209 | if (global_settings.invert_cursor) /* Display inverted-line-style*/ | ||
210 | |||
211 | /* if text got out of view */ | ||
212 | if (item_offset > str_width - (display->width - text_pos)) | ||
213 | /* don't scroll */ | ||
214 | display->puts_style_offset(0, i, entry_name, STYLE_INVERT,item_offset); | ||
215 | else | ||
216 | display->puts_scroll_style_offset(0, i, entry_name, STYLE_INVERT,item_offset); | ||
217 | |||
218 | else /* if (global_settings.invert_cursor) */ | ||
219 | |||
220 | if (item_offset > str_width - (display->width - text_pos)) | ||
221 | display->puts_offset(0, i, entry_name,item_offset); | ||
222 | else | ||
223 | display->puts_scroll_offset(0, i, entry_name,item_offset); | ||
224 | |||
190 | #else | 225 | #else |
191 | display->puts_scroll(text_pos, i, entry_name); | 226 | display->puts_scroll(text_pos, i, entry_name); |
192 | #endif | 227 | #endif |
@@ -197,7 +232,7 @@ void gui_list_draw(struct gui_list * gui_list) | |||
197 | else | 232 | else |
198 | {/* normal item */ | 233 | {/* normal item */ |
199 | #ifdef HAVE_LCD_BITMAP | 234 | #ifdef HAVE_LCD_BITMAP |
200 | display->puts(0, i, entry_name); | 235 | display->puts_offset(0, i, entry_name,item_offset); |
201 | #else | 236 | #else |
202 | display->puts(text_pos, i, entry_name); | 237 | display->puts(text_pos, i, entry_name); |
203 | #endif | 238 | #endif |
@@ -229,6 +264,40 @@ void gui_list_draw(struct gui_list * gui_list) | |||
229 | gui_textarea_update(display); | 264 | gui_textarea_update(display); |
230 | } | 265 | } |
231 | 266 | ||
267 | #ifdef HAVE_LCD_BITMAP | ||
268 | void gui_list_screen_scroll_step(int ofs) | ||
269 | { | ||
270 | offset_step = ofs; | ||
271 | } | ||
272 | |||
273 | void gui_list_screen_scroll_out_of_view(bool enable) | ||
274 | { | ||
275 | if (enable) | ||
276 | offset_outof_view = true; | ||
277 | else | ||
278 | offset_outof_view = false; | ||
279 | } | ||
280 | |||
281 | void gui_list_offset_right(struct gui_list * gui_list) | ||
282 | { | ||
283 | /* there should be a callback to find out what's the longest item on the list, | ||
284 | * and then, by finding out the width with get_stringsize, we would stop the | ||
285 | * list from scrolling at that point */ | ||
286 | |||
287 | gui_list->offsetval+=offset_step; | ||
288 | if (gui_list->offsetval > 1000) | ||
289 | gui_list->offsetval = 1000; | ||
290 | } | ||
291 | |||
292 | void gui_list_offset_left(struct gui_list * gui_list) | ||
293 | { | ||
294 | gui_list->offsetval-=offset_step; | ||
295 | if (gui_list->offsetval < 0) | ||
296 | gui_list->offsetval = 0; | ||
297 | |||
298 | } | ||
299 | #endif /* HAVE_LCD_BITMAP */ | ||
300 | |||
232 | void gui_list_select_item(struct gui_list * gui_list, int item_number) | 301 | void gui_list_select_item(struct gui_list * gui_list, int item_number) |
233 | { | 302 | { |
234 | if( item_number > gui_list->nb_items-1 || item_number < 0 ) | 303 | if( item_number > gui_list->nb_items-1 || item_number < 0 ) |
@@ -384,6 +453,7 @@ void gui_synclist_set_nb_items(struct gui_synclist * lists, int nb_items) | |||
384 | FOR_NB_SCREENS(i) | 453 | FOR_NB_SCREENS(i) |
385 | { | 454 | { |
386 | gui_list_set_nb_items(&(lists->gui_list[i]), nb_items); | 455 | gui_list_set_nb_items(&(lists->gui_list[i]), nb_items); |
456 | lists->gui_list[i].offsetval = 0; | ||
387 | } | 457 | } |
388 | } | 458 | } |
389 | void gui_synclist_set_icon_callback(struct gui_synclist * lists, list_get_icon icon_callback) | 459 | void gui_synclist_set_icon_callback(struct gui_synclist * lists, list_get_icon icon_callback) |
@@ -432,6 +502,22 @@ void gui_synclist_select_next_page(struct gui_synclist * lists, | |||
432 | screens[screen].nb_lines); | 502 | screens[screen].nb_lines); |
433 | } | 503 | } |
434 | 504 | ||
505 | #ifdef HAVE_LCD_BITMAP | ||
506 | void gui_synclist_offset_right(struct gui_synclist * lists) | ||
507 | { | ||
508 | int i; | ||
509 | FOR_NB_SCREENS(i) | ||
510 | gui_list_offset_right(&(lists->gui_list[i])); | ||
511 | } | ||
512 | |||
513 | void gui_synclist_offset_left(struct gui_synclist * lists) | ||
514 | { | ||
515 | int i; | ||
516 | FOR_NB_SCREENS(i) | ||
517 | gui_list_offset_left(&(lists->gui_list[i])); | ||
518 | } | ||
519 | #endif /* HAVE_LCD_BITMAP */ | ||
520 | |||
435 | void gui_synclist_select_previous_page(struct gui_synclist * lists, | 521 | void gui_synclist_select_previous_page(struct gui_synclist * lists, |
436 | enum screen_type screen) | 522 | enum screen_type screen) |
437 | { | 523 | { |
@@ -502,6 +588,31 @@ unsigned gui_synclist_do_button(struct gui_synclist * lists, unsigned button) | |||
502 | gui_synclist_select_next(lists); | 588 | gui_synclist_select_next(lists); |
503 | gui_synclist_draw(lists); | 589 | gui_synclist_draw(lists); |
504 | return LIST_NEXT; | 590 | return LIST_NEXT; |
591 | |||
592 | #ifdef LIST_PGRIGHT | ||
593 | case LIST_PGRIGHT: | ||
594 | case LIST_PGRIGHT | BUTTON_REPEAT: | ||
595 | #ifdef LIST_RC_PGRIGHT | ||
596 | case LIST_RC_PGRIGHT: | ||
597 | case LIST_RC_PGRIGHT | BUTTON_REPEAT: | ||
598 | #endif | ||
599 | gui_synclist_offset_right(lists); | ||
600 | gui_synclist_draw(lists); | ||
601 | return true; | ||
602 | #endif | ||
603 | |||
604 | #ifdef LIST_PGLEFT | ||
605 | case LIST_PGLEFT: | ||
606 | case LIST_PGLEFT | BUTTON_REPEAT: | ||
607 | #ifdef LIST_RC_PGLEFT | ||
608 | case LIST_RC_PGLEFT: | ||
609 | case LIST_RC_PGLEFT | BUTTON_REPEAT: | ||
610 | #endif | ||
611 | gui_synclist_offset_left(lists); | ||
612 | gui_synclist_draw(lists); | ||
613 | return true; | ||
614 | #endif | ||
615 | |||
505 | /* for pgup / pgdown, we are obliged to have a different behaviour depending on the screen | 616 | /* for pgup / pgdown, we are obliged to have a different behaviour depending on the screen |
506 | * for which the user pressed the key since for example, remote and main screen doesn't | 617 | * for which the user pressed the key since for example, remote and main screen doesn't |
507 | * have the same number of lines*/ | 618 | * have the same number of lines*/ |
diff --git a/apps/gui/list.h b/apps/gui/list.h index 25fb07d7c4..e177f5ef75 100644 --- a/apps/gui/list.h +++ b/apps/gui/list.h | |||
@@ -33,12 +33,16 @@ | |||
33 | #define LIST_PREV BUTTON_UP | 33 | #define LIST_PREV BUTTON_UP |
34 | #define LIST_PGUP (BUTTON_ON | BUTTON_UP) | 34 | #define LIST_PGUP (BUTTON_ON | BUTTON_UP) |
35 | #define LIST_PGDN (BUTTON_ON | BUTTON_DOWN) | 35 | #define LIST_PGDN (BUTTON_ON | BUTTON_DOWN) |
36 | #define LIST_PGRIGHT (BUTTON_ON | BUTTON_RIGHT) | ||
37 | #define LIST_PGLEFT (BUTTON_ON | BUTTON_LEFT) | ||
36 | 38 | ||
37 | #ifdef CONFIG_REMOTE_KEYPAD | 39 | #ifdef CONFIG_REMOTE_KEYPAD |
38 | #define LIST_RC_NEXT BUTTON_RC_FF | 40 | #define LIST_RC_NEXT BUTTON_RC_FF |
39 | #define LIST_RC_PREV BUTTON_RC_REW | 41 | #define LIST_RC_PREV BUTTON_RC_REW |
40 | #define LIST_RC_PGUP BUTTON_RC_SOURCE | 42 | #define LIST_RC_PGUP BUTTON_RC_SOURCE |
41 | #define LIST_RC_PGDN BUTTON_RC_BITRATE | 43 | #define LIST_RC_PGDN BUTTON_RC_BITRATE |
44 | #define LIST_RC_PGRIGHT (BUTTON_RC_VOL_UP) | ||
45 | #define LIST_RC_PGLEFT (BUTTON_RC_VOL_DOWN) | ||
42 | #endif /* CONFIG_REMOTE_KEYPAD */ | 46 | #endif /* CONFIG_REMOTE_KEYPAD */ |
43 | 47 | ||
44 | #elif CONFIG_KEYPAD == RECORDER_PAD | 48 | #elif CONFIG_KEYPAD == RECORDER_PAD |
@@ -46,6 +50,8 @@ | |||
46 | #define LIST_PREV BUTTON_UP | 50 | #define LIST_PREV BUTTON_UP |
47 | #define LIST_PGUP (BUTTON_ON | BUTTON_UP) | 51 | #define LIST_PGUP (BUTTON_ON | BUTTON_UP) |
48 | #define LIST_PGDN (BUTTON_ON | BUTTON_DOWN) | 52 | #define LIST_PGDN (BUTTON_ON | BUTTON_DOWN) |
53 | #define LIST_PGRIGHT (BUTTON_ON | BUTTON_RIGHT) | ||
54 | #define LIST_PGLEFT (BUTTON_ON | BUTTON_LEFT) | ||
49 | 55 | ||
50 | #ifdef CONFIG_REMOTE_KEYPAD | 56 | #ifdef CONFIG_REMOTE_KEYPAD |
51 | #define LIST_RC_NEXT BUTTON_RC_RIGHT | 57 | #define LIST_RC_NEXT BUTTON_RC_RIGHT |
@@ -64,6 +70,8 @@ | |||
64 | #elif CONFIG_KEYPAD == ONDIO_PAD | 70 | #elif CONFIG_KEYPAD == ONDIO_PAD |
65 | #define LIST_NEXT BUTTON_DOWN | 71 | #define LIST_NEXT BUTTON_DOWN |
66 | #define LIST_PREV BUTTON_UP | 72 | #define LIST_PREV BUTTON_UP |
73 | #define LIST_PGRIGHT (BUTTON_MENU | BUTTON_RIGHT) | ||
74 | #define LIST_PGLEFT (BUTTON_MENU | BUTTON_LEFT) | ||
67 | 75 | ||
68 | #elif (CONFIG_KEYPAD == IPOD_4G_PAD) | 76 | #elif (CONFIG_KEYPAD == IPOD_4G_PAD) |
69 | #define LIST_NEXT BUTTON_SCROLL_FWD | 77 | #define LIST_NEXT BUTTON_SCROLL_FWD |
@@ -78,6 +86,8 @@ | |||
78 | #define LIST_PREV BUTTON_UP | 86 | #define LIST_PREV BUTTON_UP |
79 | #define LIST_PGUP (BUTTON_ON | BUTTON_UP) | 87 | #define LIST_PGUP (BUTTON_ON | BUTTON_UP) |
80 | #define LIST_PGDN (BUTTON_ON | BUTTON_DOWN) | 88 | #define LIST_PGDN (BUTTON_ON | BUTTON_DOWN) |
89 | #define LIST_PGRIGHT (BUTTON_ON | BUTTON_RIGHT) | ||
90 | #define LIST_PGLEFT (BUTTON_ON | BUTTON_LEFT) | ||
81 | 91 | ||
82 | #elif CONFIG_KEYPAD == IAUDIO_X5_PAD | 92 | #elif CONFIG_KEYPAD == IAUDIO_X5_PAD |
83 | #define LIST_NEXT BUTTON_DOWN | 93 | #define LIST_NEXT BUTTON_DOWN |
@@ -116,12 +126,14 @@ typedef void list_get_icon(int selected_item, | |||
116 | * a buffer when it's not necessary) | 126 | * a buffer when it's not necessary) |
117 | * Returns a pointer to a string that contains the text to display | 127 | * Returns a pointer to a string that contains the text to display |
118 | */ | 128 | */ |
129 | |||
119 | typedef char * list_get_name(int selected_item, | 130 | typedef char * list_get_name(int selected_item, |
120 | void * data, | 131 | void * data, |
121 | char *buffer); | 132 | char *buffer); |
122 | 133 | ||
123 | struct gui_list | 134 | struct gui_list |
124 | { | 135 | { |
136 | int offsetval; /* value of screen offset */ | ||
125 | int nb_items; | 137 | int nb_items; |
126 | int selected_item; | 138 | int selected_item; |
127 | bool cursor_flash_state; | 139 | bool cursor_flash_state; |
@@ -222,6 +234,13 @@ extern void gui_list_draw(struct gui_list * gui_list); | |||
222 | * (Item 0 gets selected if the end of the list is reached) | 234 | * (Item 0 gets selected if the end of the list is reached) |
223 | * - gui_list : the list structure | 235 | * - gui_list : the list structure |
224 | */ | 236 | */ |
237 | |||
238 | extern void gui_list_screen_scroll_step(int ofs); | ||
239 | /* parse global setting to static int */ | ||
240 | |||
241 | extern void gui_list_screen_scroll_out_of_view(bool enable); | ||
242 | /* parse global setting to static bool */ | ||
243 | |||
225 | extern void gui_list_select_next(struct gui_list * gui_list); | 244 | extern void gui_list_select_next(struct gui_list * gui_list); |
226 | 245 | ||
227 | /* | 246 | /* |
@@ -236,6 +255,22 @@ extern void gui_list_select_previous(struct gui_list * gui_list); | |||
236 | * - gui_list : the list structure | 255 | * - gui_list : the list structure |
237 | * - nb_lines : the number of lines to try to move the cursor | 256 | * - nb_lines : the number of lines to try to move the cursor |
238 | */ | 257 | */ |
258 | |||
259 | extern void gui_list_offset_right(struct gui_list * gui_list); | ||
260 | |||
261 | /* | ||
262 | * Makes all the item in the list scroll by one step to the right. | ||
263 | * Should stop increasing the value when reaching the widest item value | ||
264 | * in the list. | ||
265 | */ | ||
266 | |||
267 | extern void gui_list_offset_left(struct gui_list * gui_list); | ||
268 | |||
269 | /* | ||
270 | * Makes all the item in the list scroll by one step to the left. | ||
271 | * stops at starting position. | ||
272 | */ | ||
273 | |||
239 | extern void gui_list_select_next_page(struct gui_list * gui_list, | 274 | extern void gui_list_select_next_page(struct gui_list * gui_list, |
240 | int nb_lines); | 275 | int nb_lines); |
241 | 276 | ||
@@ -312,6 +347,8 @@ extern void gui_synclist_select_item(struct gui_synclist * lists, | |||
312 | int item_number); | 347 | int item_number); |
313 | extern void gui_synclist_select_next(struct gui_synclist * lists); | 348 | extern void gui_synclist_select_next(struct gui_synclist * lists); |
314 | extern void gui_synclist_select_previous(struct gui_synclist * lists); | 349 | extern void gui_synclist_select_previous(struct gui_synclist * lists); |
350 | extern void gui_synclist_offset_right(struct gui_synclist * lists); | ||
351 | extern void gui_synclist_offset_left(struct gui_synclist * lists); | ||
315 | extern void gui_synclist_select_next_page(struct gui_synclist * lists, | 352 | extern void gui_synclist_select_next_page(struct gui_synclist * lists, |
316 | enum screen_type screen); | 353 | enum screen_type screen); |
317 | extern void gui_synclist_select_previous_page(struct gui_synclist * lists, | 354 | extern void gui_synclist_select_previous_page(struct gui_synclist * lists, |
diff --git a/apps/lang/english.lang b/apps/lang/english.lang index 8feccef0ff..008f0161be 100644 --- a/apps/lang/english.lang +++ b/apps/lang/english.lang | |||
@@ -3557,3 +3557,14 @@ eng: "Brightness" | |||
3557 | voice: "Brightness" | 3557 | voice: "Brightness" |
3558 | new: | 3558 | new: |
3559 | 3559 | ||
3560 | id: LANG_SCREEN_SCROLL_VIEW | ||
3561 | desc: should lines scroll out of the screen | ||
3562 | eng: "Screen Scrolls Out Of View" | ||
3563 | voice: "Screen Scrolls Out Of View" | ||
3564 | new: | ||
3565 | |||
3566 | id: LANG_SCREEN_SCROLL_STEP | ||
3567 | desc: Pixels to advance per Screen scroll | ||
3568 | eng: "Screen Scroll Step Size" | ||
3569 | voice: "Screen Scroll Step Size" | ||
3570 | new: | ||
diff --git a/apps/screen_access.c b/apps/screen_access.c index 56fe131869..b47bd10122 100644 --- a/apps/screen_access.c +++ b/apps/screen_access.c | |||
@@ -66,10 +66,16 @@ void screen_init(struct screen * screen, enum screen_type screen_type) | |||
66 | screen->scroll_speed=&lcd_remote_scroll_speed; | 66 | screen->scroll_speed=&lcd_remote_scroll_speed; |
67 | screen->scroll_delay=&lcd_remote_scroll_delay; | 67 | screen->scroll_delay=&lcd_remote_scroll_delay; |
68 | screen->scroll_step=&lcd_remote_scroll_step; | 68 | screen->scroll_step=&lcd_remote_scroll_step; |
69 | screen->puts_scroll_style=&lcd_remote_puts_scroll_style; | ||
70 | screen->invertscroll=&lcd_remote_invertscroll; | 69 | screen->invertscroll=&lcd_remote_invertscroll; |
71 | #endif /* LCD_REMOTE_DEPTH > 1 */ | ||
72 | 70 | ||
71 | screen->puts_scroll_style=&lcd_remote_puts_scroll_style; | ||
72 | screen->puts_scroll_offset=&lcd_remote_puts_scroll_offset; | ||
73 | screen->puts_scroll_style_offset=&lcd_remote_puts_scroll_style_offset; | ||
74 | |||
75 | screen->puts_offset=&lcd_remote_puts_offset; | ||
76 | screen->puts_style=&lcd_remote_puts_style; | ||
77 | screen->puts_style_offset=&lcd_remote_puts_style_offset; | ||
78 | #endif /* LCD_REMOTE_DEPTH > 1 */ | ||
73 | #if 0 /* no charcell remote LCDs so far */ | 79 | #if 0 /* no charcell remote LCDs so far */ |
74 | screen->width=11; | 80 | screen->width=11; |
75 | screen->height=2; | 81 | screen->height=2; |
@@ -93,6 +99,7 @@ void screen_init(struct screen * screen, enum screen_type screen_type) | |||
93 | screen->backlight_on=&remote_backlight_on; | 99 | screen->backlight_on=&remote_backlight_on; |
94 | screen->backlight_off=&remote_backlight_off; | 100 | screen->backlight_off=&remote_backlight_off; |
95 | break; | 101 | break; |
102 | |||
96 | #endif /* HAVE_REMOTE_LCD */ | 103 | #endif /* HAVE_REMOTE_LCD */ |
97 | 104 | ||
98 | case SCREEN_MAIN: | 105 | case SCREEN_MAIN: |
@@ -128,8 +135,14 @@ void screen_init(struct screen * screen, enum screen_type screen_type) | |||
128 | screen->scroll_speed=&lcd_scroll_speed; | 135 | screen->scroll_speed=&lcd_scroll_speed; |
129 | screen->scroll_delay=&lcd_scroll_delay; | 136 | screen->scroll_delay=&lcd_scroll_delay; |
130 | screen->scroll_step=&lcd_scroll_step; | 137 | screen->scroll_step=&lcd_scroll_step; |
131 | screen->puts_scroll_style=&lcd_puts_scroll_style; | ||
132 | screen->invertscroll=&lcd_invertscroll; | 138 | screen->invertscroll=&lcd_invertscroll; |
139 | |||
140 | screen->puts_scroll_offset=&lcd_puts_scroll_offset; | ||
141 | screen->puts_scroll_style_offset=&lcd_puts_scroll_style_offset; | ||
142 | |||
143 | screen->puts_offset=&lcd_puts_offset; | ||
144 | screen->puts_style_offset=&lcd_puts_style_offset; | ||
145 | screen->puts_style=&lcd_puts_style; | ||
133 | #endif /* HAVE_LCD_BITMAP */ | 146 | #endif /* HAVE_LCD_BITMAP */ |
134 | 147 | ||
135 | #ifdef HAVE_LCD_CHARCELLS | 148 | #ifdef HAVE_LCD_CHARCELLS |
diff --git a/apps/screen_access.h b/apps/screen_access.h index 8eb89152aa..81d0675d83 100644 --- a/apps/screen_access.h +++ b/apps/screen_access.h | |||
@@ -69,10 +69,23 @@ struct screen | |||
69 | void (*setfont)(int newfont); | 69 | void (*setfont)(int newfont); |
70 | int (*getstringsize)(const unsigned char *str, int *w, int *h); | 70 | int (*getstringsize)(const unsigned char *str, int *w, int *h); |
71 | void (*putsxy)(int x, int y, const unsigned char *str); | 71 | void (*putsxy)(int x, int y, const unsigned char *str); |
72 | |||
73 | void (*scroll_step)(int pixels); | 72 | void (*scroll_step)(int pixels); |
74 | void (*puts_scroll_style)(int x, int y, | 73 | |
75 | const unsigned char *string, int style); | 74 | |
75 | void (*puts_scroll_style)(int x, int y, const unsigned char *string, | ||
76 | int style); | ||
77 | void (*puts_scroll_offset)(int x, int y, const unsigned char *string, | ||
78 | int offset); | ||
79 | void (*puts_scroll_style_offset)(int x, int y, const unsigned char *string, | ||
80 | int style, int offset); | ||
81 | |||
82 | void (*puts_offset)(int x, int y, const unsigned char *str, int offset); | ||
83 | void (*puts_style)(int x, int y, const unsigned char *string, int style); | ||
84 | void (*puts_style_offset)(int x, int y, const unsigned char *str, | ||
85 | int style, int offset); | ||
86 | |||
87 | |||
88 | |||
76 | void (*mono_bitmap)(const unsigned char *src, | 89 | void (*mono_bitmap)(const unsigned char *src, |
77 | int x, int y, int width, int height); | 90 | int x, int y, int width, int height); |
78 | void (*set_drawmode)(int mode); | 91 | void (*set_drawmode)(int mode); |
diff --git a/apps/settings.c b/apps/settings.c index 7088cee950..ad812076a9 100644 --- a/apps/settings.c +++ b/apps/settings.c | |||
@@ -71,6 +71,7 @@ | |||
71 | #include "select.h" | 71 | #include "select.h" |
72 | #include "statusbar.h" | 72 | #include "statusbar.h" |
73 | #include "splash.h" | 73 | #include "splash.h" |
74 | #include "list.h" | ||
74 | 75 | ||
75 | #if CONFIG_CODEC == MAS3507D | 76 | #if CONFIG_CODEC == MAS3507D |
76 | void dac_line_in(bool enable); | 77 | void dac_line_in(bool enable); |
@@ -492,6 +493,15 @@ static const struct bit_entry hd_bits[] = | |||
492 | {4, S_O(brightness), 9, "brightness", NULL }, | 493 | {4, S_O(brightness), 9, "brightness", NULL }, |
493 | #endif | 494 | #endif |
494 | 495 | ||
496 | #ifdef HAVE_LCD_BITMAP | ||
497 | {1, S_O(offset_out_of_view), false, "Screen Scrolls Out Of View", off_on }, | ||
498 | #if LCD_WIDTH > 127 | ||
499 | {8, S_O(screen_scroll_step), 16, "screen scroll step", NULL }, /* 1...160 */ | ||
500 | #else | ||
501 | {7, S_O(screen_scroll_step), 16, "screen scroll step", NULL }, /* 1...112 */ | ||
502 | #endif | ||
503 | #endif /* HAVE_LCD_BITMAP */ | ||
504 | |||
495 | /* If values are just added to the end, no need to bump the version. */ | 505 | /* If values are just added to the end, no need to bump the version. */ |
496 | /* new stuff to be added at the end */ | 506 | /* new stuff to be added at the end */ |
497 | 507 | ||
@@ -957,6 +967,8 @@ void settings_apply(void) | |||
957 | font_reset(); | 967 | font_reset(); |
958 | 968 | ||
959 | lcd_scroll_step(global_settings.scroll_step); | 969 | lcd_scroll_step(global_settings.scroll_step); |
970 | gui_list_screen_scroll_step(global_settings.screen_scroll_step); | ||
971 | gui_list_screen_scroll_out_of_view(global_settings.offset_out_of_view); | ||
960 | #else | 972 | #else |
961 | lcd_jump_scroll(global_settings.jump_scroll); | 973 | lcd_jump_scroll(global_settings.jump_scroll); |
962 | lcd_jump_scroll_delay(global_settings.jump_scroll_delay * (HZ/10)); | 974 | lcd_jump_scroll_delay(global_settings.jump_scroll_delay * (HZ/10)); |
diff --git a/apps/settings.h b/apps/settings.h index d60c39f6e0..97e608d3bc 100644 --- a/apps/settings.h +++ b/apps/settings.h | |||
@@ -319,6 +319,8 @@ struct user_settings | |||
319 | int bidir_limit; /* bidir scroll length limit */ | 319 | int bidir_limit; /* bidir scroll length limit */ |
320 | int scroll_delay; /* delay (in 1/10s) before starting scroll */ | 320 | int scroll_delay; /* delay (in 1/10s) before starting scroll */ |
321 | int scroll_step; /* pixels to advance per update */ | 321 | int scroll_step; /* pixels to advance per update */ |
322 | bool offset_out_of_view; /* should lines scroll out of the screen */ | ||
323 | int screen_scroll_step; /* pixels to advance screen view*/ | ||
322 | 324 | ||
323 | /* auto bookmark settings */ | 325 | /* auto bookmark settings */ |
324 | int autoloadbookmark; /* auto load option: 0=off, 1=ask, 2=on */ | 326 | int autoloadbookmark; /* auto load option: 0=off, 1=ask, 2=on */ |
diff --git a/apps/settings_menu.c b/apps/settings_menu.c index 35b4d8772d..85d898674c 100644 --- a/apps/settings_menu.c +++ b/apps/settings_menu.c | |||
@@ -53,6 +53,7 @@ | |||
53 | #include "rbunicode.h" | 53 | #include "rbunicode.h" |
54 | #include "splash.h" | 54 | #include "splash.h" |
55 | #include "yesno.h" | 55 | #include "yesno.h" |
56 | #include "list.h" | ||
56 | 57 | ||
57 | #ifdef HAVE_LCD_BITMAP | 58 | #ifdef HAVE_LCD_BITMAP |
58 | #include "peakmeter.h" | 59 | #include "peakmeter.h" |
@@ -747,7 +748,6 @@ static bool scroll_speed(void) | |||
747 | &lcd_scroll_speed, 1, 0, 15, NULL ); | 748 | &lcd_scroll_speed, 1, 0, 15, NULL ); |
748 | } | 749 | } |
749 | 750 | ||
750 | |||
751 | static bool scroll_delay(void) | 751 | static bool scroll_delay(void) |
752 | { | 752 | { |
753 | int dummy = global_settings.scroll_delay * (HZ/10); | 753 | int dummy = global_settings.scroll_delay * (HZ/10); |
@@ -759,6 +759,20 @@ static bool scroll_delay(void) | |||
759 | } | 759 | } |
760 | 760 | ||
761 | #ifdef HAVE_LCD_BITMAP | 761 | #ifdef HAVE_LCD_BITMAP |
762 | static bool screen_scroll(void) | ||
763 | { | ||
764 | bool rc = set_bool( str(LANG_SCREEN_SCROLL_VIEW), &global_settings.offset_out_of_view); | ||
765 | gui_list_screen_scroll_out_of_view(global_settings.offset_out_of_view); | ||
766 | return rc; | ||
767 | } | ||
768 | |||
769 | static bool screen_scroll_step(void) | ||
770 | { | ||
771 | return set_int(str(LANG_SCREEN_SCROLL_STEP), "pixels", UNIT_PIXEL, | ||
772 | &global_settings.screen_scroll_step, | ||
773 | &gui_list_screen_scroll_step, 1, 1, LCD_WIDTH, NULL ); | ||
774 | } | ||
775 | |||
762 | static bool scroll_step(void) | 776 | static bool scroll_step(void) |
763 | { | 777 | { |
764 | return set_int(str(LANG_SCROLL_STEP_EXAMPLE), "pixels", UNIT_PIXEL, | 778 | return set_int(str(LANG_SCROLL_STEP_EXAMPLE), "pixels", UNIT_PIXEL, |
@@ -1500,15 +1514,19 @@ static bool scroll_settings_menu(void) | |||
1500 | bool result; | 1514 | bool result; |
1501 | 1515 | ||
1502 | static const struct menu_item items[] = { | 1516 | static const struct menu_item items[] = { |
1503 | { ID2P(LANG_SCROLL_SPEED), scroll_speed }, | 1517 | { ID2P(LANG_SCROLL_SPEED), scroll_speed }, |
1504 | { ID2P(LANG_SCROLL_DELAY), scroll_delay }, | 1518 | { ID2P(LANG_SCROLL_DELAY), scroll_delay }, |
1505 | #ifdef HAVE_LCD_BITMAP | 1519 | #ifdef HAVE_LCD_BITMAP |
1506 | { ID2P(LANG_SCROLL_STEP), scroll_step }, | 1520 | { ID2P(LANG_SCROLL_STEP), scroll_step }, |
1507 | #endif | 1521 | #endif |
1508 | { ID2P(LANG_BIDIR_SCROLL), bidir_limit }, | 1522 | { ID2P(LANG_BIDIR_SCROLL), bidir_limit }, |
1509 | #ifdef HAVE_LCD_CHARCELLS | 1523 | #ifdef HAVE_LCD_CHARCELLS |
1510 | { ID2P(LANG_JUMP_SCROLL), jump_scroll }, | 1524 | { ID2P(LANG_JUMP_SCROLL), jump_scroll }, |
1511 | { ID2P(LANG_JUMP_SCROLL_DELAY), jump_scroll_delay }, | 1525 | { ID2P(LANG_JUMP_SCROLL_DELAY), jump_scroll_delay }, |
1526 | #endif | ||
1527 | #ifdef HAVE_LCD_BITMAP | ||
1528 | { ID2P(LANG_SCREEN_SCROLL_VIEW), screen_scroll }, | ||
1529 | { ID2P(LANG_SCREEN_SCROLL_STEP), screen_scroll_step }, | ||
1512 | #endif | 1530 | #endif |
1513 | }; | 1531 | }; |
1514 | 1532 | ||