summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--apps/gui/list.c172
-rw-r--r--apps/gui/list.h45
-rw-r--r--apps/screen_access.c21
-rw-r--r--apps/screen_access.h16
-rw-r--r--apps/settings.h6
-rw-r--r--apps/settings_menu.c6
-rw-r--r--firmware/drivers/lcd-h100-remote.c16
-rw-r--r--firmware/drivers/lcd-h100.c44
-rw-r--r--firmware/drivers/lcd-recorder.c58
-rw-r--r--firmware/export/lcd-remote.h4
10 files changed, 191 insertions, 197 deletions
diff --git a/apps/gui/list.c b/apps/gui/list.c
index 2ae5f995f4..ce2a3354e4 100644
--- a/apps/gui/list.c
+++ b/apps/gui/list.c
@@ -37,8 +37,13 @@
37#define SCROLL_LIMIT 2 37#define SCROLL_LIMIT 2
38#endif 38#endif
39 39
40static int offset_step = 15; 40#ifdef HAVE_LCD_BITMAP
41static bool offset_outof_view = false; 41static int offset_step = 16; /* pixels per screen scroll step */
42/* should lines scroll out of the screen */
43static bool offset_out_of_view = false;
44#endif
45
46
42 47
43void gui_list_init(struct gui_list * gui_list, 48void gui_list_init(struct gui_list * gui_list,
44 list_get_name callback_get_item_name, 49 list_get_name callback_get_item_name,
@@ -54,7 +59,9 @@ void gui_list_init(struct gui_list * gui_list,
54 gui_list->limit_scroll = false; 59 gui_list->limit_scroll = false;
55 gui_list->data=data; 60 gui_list->data=data;
56 gui_list->cursor_flash_state=false; 61 gui_list->cursor_flash_state=false;
57 gui_list->offsetval = 0; 62#ifdef HAVE_LCD_BITMAP
63 gui_list->offset_position = 0;
64#endif
58} 65}
59 66
60void gui_list_set_display(struct gui_list * gui_list, struct screen * display) 67void gui_list_set_display(struct gui_list * gui_list, struct screen * display)
@@ -181,47 +188,43 @@ void gui_list_draw(struct gui_list * gui_list)
181 entry_name = gui_list->callback_get_item_name(current_item, 188 entry_name = gui_list->callback_get_item_name(current_item,
182 gui_list->data, 189 gui_list->data,
183 entry_buffer); 190 entry_buffer);
184
185#ifdef HAVE_LCD_BITMAP 191#ifdef HAVE_LCD_BITMAP
186 /* position the string at the right offset place */ 192 /* position the string at the correct offset place */
187 int item_offset; 193 int item_offset;
188 int str_width,h; 194 int item_width,h;
189 display->getstringsize(entry_name, &str_width, &h); 195 display->getstringsize(entry_name, &item_width, &h);
190 196
191 if (offset_outof_view) 197 if (offset_out_of_view)
192 item_offset = gui_list->offsetval; 198 item_offset = gui_list->offset_position;
193 else
194 /* if text is smaller then view */
195 if (str_width <= display->width - text_pos)
196 item_offset = 0;
197 else 199 else
198 /* if text got out of view */ 200 /* if text is smaller then view */
199 if (gui_list->offsetval > str_width - (display->width - text_pos)) 201 if (item_width <= display->width - text_pos)
200 item_offset = str_width - (display->width - text_pos); 202 item_offset = 0;
201 else 203 else
202 item_offset = gui_list->offsetval; 204 /* if text got out of view */
203 205 if (gui_list->offset_position >
204#endif 206 item_width - (display->width - text_pos))
207 item_offset = item_width - (display->width - text_pos);
208 else
209 item_offset = gui_list->offset_position;
205 210
211#endif
206 if(current_item == gui_list->selected_item) { 212 if(current_item == gui_list->selected_item) {
207 /* The selected item must be displayed scrolling */ 213 /* The selected item must be displayed scrolling */
208#ifdef HAVE_LCD_BITMAP 214#ifdef HAVE_LCD_BITMAP
209 if (global_settings.invert_cursor) /* Display inverted-line-style*/ 215 if (global_settings.invert_cursor)/* Display inverted-line-style*/
210
211 /* if text got out of view */ 216 /* if text got out of view */
212 if (item_offset > str_width - (display->width - text_pos)) 217 if (item_offset > item_width - (display->width - text_pos))
213 /* don't scroll */ 218 /* don't scroll */
214 display->puts_style_offset(0, i, entry_name, STYLE_INVERT,item_offset); 219 display->puts_style_offset(0, i, entry_name, STYLE_INVERT,item_offset);
215 else 220 else
216 display->puts_scroll_style_offset(0, i, entry_name, STYLE_INVERT,item_offset); 221 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 222
223 else /* if (!global_settings.invert_cursor) */
224 if (item_offset > item_width - (display->width - text_pos))
225 display->puts_offset(0, i, entry_name,item_offset);
226 else
227 display->puts_scroll_offset(0, i, entry_name,item_offset);
225#else 228#else
226 display->puts_scroll(text_pos, i, entry_name); 229 display->puts_scroll(text_pos, i, entry_name);
227#endif 230#endif
@@ -264,40 +267,6 @@ void gui_list_draw(struct gui_list * gui_list)
264 gui_textarea_update(display); 267 gui_textarea_update(display);
265} 268}
266 269
267#ifdef HAVE_LCD_BITMAP
268void gui_list_screen_scroll_step(int ofs)
269{
270 offset_step = ofs;
271}
272
273void 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
281void 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
292void 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
301void gui_list_select_item(struct gui_list * gui_list, int item_number) 270void gui_list_select_item(struct gui_list * gui_list, int item_number)
302{ 271{
303 if( item_number > gui_list->nb_items-1 || item_number < 0 ) 272 if( item_number > gui_list->nb_items-1 || item_number < 0 )
@@ -428,6 +397,37 @@ void gui_list_del_item(struct gui_list * gui_list)
428 } 397 }
429} 398}
430 399
400#ifdef HAVE_LCD_BITMAP
401void gui_list_scroll_right(struct gui_list * gui_list)
402{
403 /* FIXME: This is a fake right boundry limiter. there should be some
404 * callback function to find the longest item on the list in pixels,
405 * to stop the list from scrolling past that point */
406 gui_list->offset_position+=offset_step;
407 if (gui_list->offset_position > 1000)
408 gui_list->offset_position = 1000;
409}
410
411void gui_list_scroll_left(struct gui_list * gui_list)
412{
413 gui_list->offset_position-=offset_step;
414 if (gui_list->offset_position < 0)
415 gui_list->offset_position = 0;
416}
417void gui_list_screen_scroll_step(int ofs)
418{
419 offset_step = ofs;
420}
421
422void gui_list_screen_scroll_out_of_view(bool enable)
423{
424 if (enable)
425 offset_out_of_view = true;
426 else
427 offset_out_of_view = false;
428}
429#endif /* HAVE_LCD_BITMAP */
430
431/* 431/*
432 * Synchronized lists stuffs 432 * Synchronized lists stuffs
433 */ 433 */
@@ -453,7 +453,9 @@ void gui_synclist_set_nb_items(struct gui_synclist * lists, int nb_items)
453 FOR_NB_SCREENS(i) 453 FOR_NB_SCREENS(i)
454 { 454 {
455 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; 456#ifdef HAVE_LCD_BITMAP
457 lists->gui_list[i].offset_position = 0;
458#endif
457 } 459 }
458} 460}
459void gui_synclist_set_icon_callback(struct gui_synclist * lists, list_get_icon icon_callback) 461void gui_synclist_set_icon_callback(struct gui_synclist * lists, list_get_icon icon_callback)
@@ -502,22 +504,6 @@ void gui_synclist_select_next_page(struct gui_synclist * lists,
502 screens[screen].nb_lines); 504 screens[screen].nb_lines);
503} 505}
504 506
505#ifdef HAVE_LCD_BITMAP
506void 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
513void 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
521void gui_synclist_select_previous_page(struct gui_synclist * lists, 507void gui_synclist_select_previous_page(struct gui_synclist * lists,
522 enum screen_type screen) 508 enum screen_type screen)
523{ 509{
@@ -555,6 +541,22 @@ void gui_synclist_flash(struct gui_synclist * lists)
555 gui_list_flash(&(lists->gui_list[i])); 541 gui_list_flash(&(lists->gui_list[i]));
556} 542}
557 543
544#ifdef HAVE_LCD_BITMAP
545void gui_synclist_scroll_right(struct gui_synclist * lists)
546{
547 int i;
548 FOR_NB_SCREENS(i)
549 gui_list_scroll_right(&(lists->gui_list[i]));
550}
551
552void gui_synclist_scroll_left(struct gui_synclist * lists)
553{
554 int i;
555 FOR_NB_SCREENS(i)
556 gui_list_scroll_left(&(lists->gui_list[i]));
557}
558#endif /* HAVE_LCD_BITMAP */
559
558unsigned gui_synclist_do_button(struct gui_synclist * lists, unsigned button) 560unsigned gui_synclist_do_button(struct gui_synclist * lists, unsigned button)
559{ 561{
560 gui_synclist_limit_scroll(lists, true); 562 gui_synclist_limit_scroll(lists, true);
@@ -588,7 +590,7 @@ unsigned gui_synclist_do_button(struct gui_synclist * lists, unsigned button)
588 gui_synclist_select_next(lists); 590 gui_synclist_select_next(lists);
589 gui_synclist_draw(lists); 591 gui_synclist_draw(lists);
590 return LIST_NEXT; 592 return LIST_NEXT;
591 593
592#ifdef LIST_PGRIGHT 594#ifdef LIST_PGRIGHT
593 case LIST_PGRIGHT: 595 case LIST_PGRIGHT:
594 case LIST_PGRIGHT | BUTTON_REPEAT: 596 case LIST_PGRIGHT | BUTTON_REPEAT:
@@ -596,7 +598,7 @@ unsigned gui_synclist_do_button(struct gui_synclist * lists, unsigned button)
596 case LIST_RC_PGRIGHT: 598 case LIST_RC_PGRIGHT:
597 case LIST_RC_PGRIGHT | BUTTON_REPEAT: 599 case LIST_RC_PGRIGHT | BUTTON_REPEAT:
598#endif 600#endif
599 gui_synclist_offset_right(lists); 601 gui_synclist_scroll_right(lists);
600 gui_synclist_draw(lists); 602 gui_synclist_draw(lists);
601 return true; 603 return true;
602#endif 604#endif
@@ -608,7 +610,7 @@ unsigned gui_synclist_do_button(struct gui_synclist * lists, unsigned button)
608 case LIST_RC_PGLEFT: 610 case LIST_RC_PGLEFT:
609 case LIST_RC_PGLEFT | BUTTON_REPEAT: 611 case LIST_RC_PGLEFT | BUTTON_REPEAT:
610#endif 612#endif
611 gui_synclist_offset_left(lists); 613 gui_synclist_scroll_left(lists);
612 gui_synclist_draw(lists); 614 gui_synclist_draw(lists);
613 return true; 615 return true;
614#endif 616#endif
diff --git a/apps/gui/list.h b/apps/gui/list.h
index e177f5ef75..8643c4d047 100644
--- a/apps/gui/list.h
+++ b/apps/gui/list.h
@@ -126,19 +126,20 @@ typedef void list_get_icon(int selected_item,
126 * a buffer when it's not necessary) 126 * a buffer when it's not necessary)
127 * 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
128 */ 128 */
129
130typedef char * list_get_name(int selected_item, 129typedef char * list_get_name(int selected_item,
131 void * data, 130 void * data,
132 char *buffer); 131 char *buffer);
133 132
134struct gui_list 133struct gui_list
135{ 134{
136 int offsetval; /* value of screen offset */
137 int nb_items; 135 int nb_items;
138 int selected_item; 136 int selected_item;
139 bool cursor_flash_state; 137 bool cursor_flash_state;
140 int start_item; /* the item that is displayed at the top of the screen */ 138 int start_item; /* the item that is displayed at the top of the screen */
141 139
140#ifdef HAVE_LCD_BITMAP
141 int offset_position; /* the list's screen scroll placement in pixels */
142#endif
142 list_get_icon *callback_get_item_icon; 143 list_get_icon *callback_get_item_icon;
143 list_get_name *callback_get_item_name; 144 list_get_name *callback_get_item_name;
144 145
@@ -234,13 +235,6 @@ extern void gui_list_draw(struct gui_list * gui_list);
234 * (Item 0 gets selected if the end of the list is reached) 235 * (Item 0 gets selected if the end of the list is reached)
235 * - gui_list : the list structure 236 * - gui_list : the list structure
236 */ 237 */
237
238extern void gui_list_screen_scroll_step(int ofs);
239/* parse global setting to static int */
240
241extern void gui_list_screen_scroll_out_of_view(bool enable);
242/* parse global setting to static bool */
243
244extern void gui_list_select_next(struct gui_list * gui_list); 238extern void gui_list_select_next(struct gui_list * gui_list);
245 239
246/* 240/*
@@ -250,27 +244,32 @@ extern void gui_list_select_next(struct gui_list * gui_list);
250 */ 244 */
251extern void gui_list_select_previous(struct gui_list * gui_list); 245extern void gui_list_select_previous(struct gui_list * gui_list);
252 246
253/* 247#ifdef HAVE_LCD_BITMAP
254 * Go to next page if any, else selects the last item in the list
255 * - gui_list : the list structure
256 * - nb_lines : the number of lines to try to move the cursor
257 */
258
259extern void gui_list_offset_right(struct gui_list * gui_list);
260
261/* 248/*
262 * Makes all the item in the list scroll by one step to the right. 249 * 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 250 * Should stop increasing the value when reaching the widest item value
264 * in the list. 251 * in the list.
265 */ 252 */
266 253void gui_list_scroll_right(struct gui_list * gui_list);
267extern void gui_list_offset_left(struct gui_list * gui_list);
268 254
269/* 255/*
270 * Makes all the item in the list scroll by one step to the left. 256 * Makes all the item in the list scroll by one step to the left.
271 * stops at starting position. 257 * stops at starting position.
272 */ 258 */
273 259void gui_list_scroll_left(struct gui_list * gui_list);
260
261/* parse global setting to static int */
262extern void gui_list_screen_scroll_step(int ofs);
263
264/* parse global setting to static bool */
265extern void gui_list_screen_scroll_out_of_view(bool enable);
266#endif /* HAVE_LCD_BITMAP */
267
268/*
269 * Go to next page if any, else selects the last item in the list
270 * - gui_list : the list structure
271 * - nb_lines : the number of lines to try to move the cursor
272 */
274extern void gui_list_select_next_page(struct gui_list * gui_list, 273extern void gui_list_select_next_page(struct gui_list * gui_list,
275 int nb_lines); 274 int nb_lines);
276 275
@@ -347,8 +346,6 @@ extern void gui_synclist_select_item(struct gui_synclist * lists,
347 int item_number); 346 int item_number);
348extern void gui_synclist_select_next(struct gui_synclist * lists); 347extern void gui_synclist_select_next(struct gui_synclist * lists);
349extern void gui_synclist_select_previous(struct gui_synclist * lists); 348extern void gui_synclist_select_previous(struct gui_synclist * lists);
350extern void gui_synclist_offset_right(struct gui_synclist * lists);
351extern void gui_synclist_offset_left(struct gui_synclist * lists);
352extern void gui_synclist_select_next_page(struct gui_synclist * lists, 349extern void gui_synclist_select_next_page(struct gui_synclist * lists,
353 enum screen_type screen); 350 enum screen_type screen);
354extern void gui_synclist_select_previous_page(struct gui_synclist * lists, 351extern void gui_synclist_select_previous_page(struct gui_synclist * lists,
@@ -357,6 +354,8 @@ extern void gui_synclist_add_item(struct gui_synclist * lists);
357extern void gui_synclist_del_item(struct gui_synclist * lists); 354extern void gui_synclist_del_item(struct gui_synclist * lists);
358extern void gui_synclist_limit_scroll(struct gui_synclist * lists, bool scroll); 355extern void gui_synclist_limit_scroll(struct gui_synclist * lists, bool scroll);
359extern void gui_synclist_flash(struct gui_synclist * lists); 356extern void gui_synclist_flash(struct gui_synclist * lists);
357void gui_synclist_scroll_right(struct gui_synclist * lists);
358void gui_synclist_scroll_left(struct gui_synclist * lists);
360 359
361/* 360/*
362 * Do the action implied by the given button, 361 * Do the action implied by the given button,
diff --git a/apps/screen_access.c b/apps/screen_access.c
index b47bd10122..dfe2b13a46 100644
--- a/apps/screen_access.c
+++ b/apps/screen_access.c
@@ -67,15 +67,13 @@ void screen_init(struct screen * screen, enum screen_type screen_type)
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->invertscroll=&lcd_remote_invertscroll; 69 screen->invertscroll=&lcd_remote_invertscroll;
70 70#endif /* LCD_REMOTE_DEPTH > 1 */
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; 71 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; 72 screen->puts_style_offset=&lcd_remote_puts_style_offset;
78#endif /* LCD_REMOTE_DEPTH > 1 */ 73 screen->puts_scroll_style=&lcd_remote_puts_scroll_style;
74 screen->puts_scroll_offset=&lcd_remote_puts_scroll_offset;
75 screen->puts_scroll_style_offset=&lcd_remote_puts_scroll_style_offset;
76
79#if 0 /* no charcell remote LCDs so far */ 77#if 0 /* no charcell remote LCDs so far */
80 screen->width=11; 78 screen->width=11;
81 screen->height=2; 79 screen->height=2;
@@ -99,7 +97,6 @@ void screen_init(struct screen * screen, enum screen_type screen_type)
99 screen->backlight_on=&remote_backlight_on; 97 screen->backlight_on=&remote_backlight_on;
100 screen->backlight_off=&remote_backlight_off; 98 screen->backlight_off=&remote_backlight_off;
101 break; 99 break;
102
103#endif /* HAVE_REMOTE_LCD */ 100#endif /* HAVE_REMOTE_LCD */
104 101
105 case SCREEN_MAIN: 102 case SCREEN_MAIN:
@@ -136,13 +133,11 @@ void screen_init(struct screen * screen, enum screen_type screen_type)
136 screen->scroll_delay=&lcd_scroll_delay; 133 screen->scroll_delay=&lcd_scroll_delay;
137 screen->scroll_step=&lcd_scroll_step; 134 screen->scroll_step=&lcd_scroll_step;
138 screen->invertscroll=&lcd_invertscroll; 135 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; 136 screen->puts_offset=&lcd_puts_offset;
144 screen->puts_style_offset=&lcd_puts_style_offset; 137 screen->puts_style_offset=&lcd_puts_style_offset;
145 screen->puts_style=&lcd_puts_style; 138 screen->puts_scroll_style=&lcd_puts_scroll_offset;
139 screen->puts_scroll_offset=&lcd_puts_scroll_style;
140 screen->puts_scroll_style_offset=&lcd_puts_scroll_style_offset;
146#endif /* HAVE_LCD_BITMAP */ 141#endif /* HAVE_LCD_BITMAP */
147 142
148#ifdef HAVE_LCD_CHARCELLS 143#ifdef HAVE_LCD_CHARCELLS
diff --git a/apps/screen_access.h b/apps/screen_access.h
index 81d0675d83..1c694e8d31 100644
--- a/apps/screen_access.h
+++ b/apps/screen_access.h
@@ -69,23 +69,17 @@ 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 void (*scroll_step)(int pixels);
73
74 72
73 void (*scroll_step)(int pixels);
74 void (*puts_offset)(int x, int y, const unsigned char *str, int offset);
75 void (*puts_style_offset)(int x, int y, const unsigned char *str,
76 int style, int offset);
75 void (*puts_scroll_style)(int x, int y, const unsigned char *string, 77 void (*puts_scroll_style)(int x, int y, const unsigned char *string,
76 int style); 78 int style);
77 void (*puts_scroll_offset)(int x, int y, const unsigned char *string, 79 void (*puts_scroll_offset)(int x, int y, const unsigned char *string,
78 int offset); 80 int offset);
79 void (*puts_scroll_style_offset)(int x, int y, const unsigned char *string, 81 void (*puts_scroll_style_offset)(int x, int y, const unsigned char *string,
80 int style, int offset); 82 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
89 void (*mono_bitmap)(const unsigned char *src, 83 void (*mono_bitmap)(const unsigned char *src,
90 int x, int y, int width, int height); 84 int x, int y, int width, int height);
91 void (*set_drawmode)(int mode); 85 void (*set_drawmode)(int mode);
diff --git a/apps/settings.h b/apps/settings.h
index 97e608d3bc..ebd3ec35b0 100644
--- a/apps/settings.h
+++ b/apps/settings.h
@@ -319,8 +319,10 @@ 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 */ 322#ifdef HAVE_LCD_BITMAP
323 int screen_scroll_step; /* pixels to advance screen view*/ 323 bool offset_out_of_view;
324 int screen_scroll_step;
325#endif
324 326
325 /* auto bookmark settings */ 327 /* auto bookmark settings */
326 int autoloadbookmark; /* auto load option: 0=off, 1=ask, 2=on */ 328 int autoloadbookmark; /* auto load option: 0=off, 1=ask, 2=on */
diff --git a/apps/settings_menu.c b/apps/settings_menu.c
index 85d898674c..2de6d93c5c 100644
--- a/apps/settings_menu.c
+++ b/apps/settings_menu.c
@@ -1515,9 +1515,9 @@ static bool scroll_settings_menu(void)
1515 1515
1516 static const struct menu_item items[] = { 1516 static const struct menu_item items[] = {
1517 { ID2P(LANG_SCROLL_SPEED), scroll_speed }, 1517 { ID2P(LANG_SCROLL_SPEED), scroll_speed },
1518 { ID2P(LANG_SCROLL_DELAY), scroll_delay }, 1518 { ID2P(LANG_SCROLL_DELAY), scroll_delay },
1519#ifdef HAVE_LCD_BITMAP 1519#ifdef HAVE_LCD_BITMAP
1520 { ID2P(LANG_SCROLL_STEP), scroll_step }, 1520 { ID2P(LANG_SCROLL_STEP), scroll_step },
1521#endif 1521#endif
1522 { ID2P(LANG_BIDIR_SCROLL), bidir_limit }, 1522 { ID2P(LANG_BIDIR_SCROLL), bidir_limit },
1523#ifdef HAVE_LCD_CHARCELLS 1523#ifdef HAVE_LCD_CHARCELLS
@@ -1526,7 +1526,7 @@ static bool scroll_settings_menu(void)
1526#endif 1526#endif
1527#ifdef HAVE_LCD_BITMAP 1527#ifdef HAVE_LCD_BITMAP
1528 { ID2P(LANG_SCREEN_SCROLL_VIEW), screen_scroll }, 1528 { ID2P(LANG_SCREEN_SCROLL_VIEW), screen_scroll },
1529 { ID2P(LANG_SCREEN_SCROLL_STEP), screen_scroll_step }, 1529 { ID2P(LANG_SCREEN_SCROLL_STEP), screen_scroll_step },
1530#endif 1530#endif
1531 }; 1531 };
1532 1532
diff --git a/firmware/drivers/lcd-h100-remote.c b/firmware/drivers/lcd-h100-remote.c
index a28cd2f4e5..3be907a574 100644
--- a/firmware/drivers/lcd-h100-remote.c
+++ b/firmware/drivers/lcd-h100-remote.c
@@ -1138,7 +1138,7 @@ void lcd_remote_putsxy(int x, int y, const unsigned char *str)
1138/* put a string at a given char position */ 1138/* put a string at a given char position */
1139void lcd_remote_puts(int x, int y, const unsigned char *str) 1139void lcd_remote_puts(int x, int y, const unsigned char *str)
1140{ 1140{
1141 lcd_remote_puts_style(x, y, str, STYLE_DEFAULT); 1141 lcd_remote_puts_style_offset(x, y, str, STYLE_DEFAULT, 0);
1142} 1142}
1143 1143
1144void lcd_remote_puts_style(int x, int y, const unsigned char *str, int style) 1144void lcd_remote_puts_style(int x, int y, const unsigned char *str, int style)
@@ -1151,7 +1151,8 @@ void lcd_remote_puts_offset(int x, int y, const unsigned char *str, int offset)
1151 lcd_remote_puts_style_offset(x, y, str, STYLE_DEFAULT, offset); 1151 lcd_remote_puts_style_offset(x, y, str, STYLE_DEFAULT, offset);
1152} 1152}
1153 1153
1154/* put a string at a given char position at a given style and with a given offset */ 1154/* put a string at a given char position, style, and pixel position,
1155 * skipping first offset pixel columns */
1155void lcd_remote_puts_style_offset(int x, int y, const unsigned char *str, int style, int offset) 1156void lcd_remote_puts_style_offset(int x, int y, const unsigned char *str, int style, int offset)
1156{ 1157{
1157 int xpos,ypos,w,h; 1158 int xpos,ypos,w,h;
@@ -1223,16 +1224,16 @@ void lcd_remote_puts_scroll(int x, int y, const unsigned char *string)
1223 1224
1224void lcd_remote_puts_scroll_style(int x, int y, const unsigned char *string, int style) 1225void lcd_remote_puts_scroll_style(int x, int y, const unsigned char *string, int style)
1225{ 1226{
1226 lcd_remote_puts_scroll_style_offset(x, y, string, style, 0); 1227 lcd_remote_puts_scroll_style_offset(x, y, string, style, 0);
1227} 1228}
1228 1229
1229void lcd_remote_puts_scroll_offset(int x, int y, const unsigned char *string, int offset) 1230void lcd_remote_puts_scroll_offset(int x, int y, const unsigned char *string, int offset)
1230{ 1231{
1231 lcd_remote_puts_scroll_style_offset(x, y, string, STYLE_DEFAULT, offset); 1232 lcd_remote_puts_scroll_style_offset(x, y, string, STYLE_DEFAULT, offset);
1232} 1233}
1233 1234
1234void lcd_remote_puts_scroll_style_offset(int x, int y, const unsigned char *string, 1235void lcd_remote_puts_scroll_style_offset(int x, int y, const unsigned char *string,
1235 int style, int offset) 1236 int style, int offset)
1236{ 1237{
1237 struct scrollinfo* s; 1238 struct scrollinfo* s;
1238 int w, h; 1239 int w, h;
@@ -1289,7 +1290,6 @@ void lcd_remote_puts_scroll_style_offset(int x, int y, const unsigned char *stri
1289 scrolling_lines &= ~(1<<y); 1290 scrolling_lines &= ~(1<<y);
1290} 1291}
1291 1292
1292
1293static void scroll_thread(void) 1293static void scroll_thread(void)
1294{ 1294{
1295 struct font* pf; 1295 struct font* pf;
diff --git a/firmware/drivers/lcd-h100.c b/firmware/drivers/lcd-h100.c
index 0df1a3c71a..685984522d 100644
--- a/firmware/drivers/lcd-h100.c
+++ b/firmware/drivers/lcd-h100.c
@@ -1057,9 +1057,26 @@ void lcd_putsxy(int x, int y, const unsigned char *str)
1057 1057
1058/*** line oriented text output ***/ 1058/*** line oriented text output ***/
1059 1059
1060/* put a string at a given char position at a given style and with a given pixel position */ 1060/* put a string at a given char position */
1061void lcd_puts_style_offset(int x, int y, const unsigned char *str, int style, 1061void lcd_puts(int x, int y, const unsigned char *str)
1062 int offset) 1062{
1063 lcd_puts_style_offset(x, y, str, STYLE_DEFAULT, 0);
1064}
1065
1066void lcd_puts_style(int x, int y, const unsigned char *str, int style)
1067{
1068 lcd_puts_style_offset(x, y, str, style, 0);
1069}
1070
1071void lcd_puts_offset(int x, int y, const unsigned char *str, int offset)
1072{
1073 lcd_puts_style_offset(x, y, str, STYLE_DEFAULT, offset);
1074}
1075
1076/* put a string at a given char position, style, and pixel position,
1077 * skipping first offset pixel columns */
1078void lcd_puts_style_offset(int x, int y, const unsigned char *str,
1079 int style, int offset)
1063{ 1080{
1064 int xpos,ypos,w,h; 1081 int xpos,ypos,w,h;
1065 int lastmode = drawmode; 1082 int lastmode = drawmode;
@@ -1083,22 +1100,6 @@ void lcd_puts_style_offset(int x, int y, const unsigned char *str, int style,
1083 } 1100 }
1084 drawmode = lastmode; 1101 drawmode = lastmode;
1085} 1102}
1086void lcd_puts_style(int x, int y, const unsigned char *str, int style)
1087{
1088 lcd_puts_style_offset(x, y, str, style, 0);
1089}
1090
1091/* put a string at a given char position at a given offset mark */
1092void lcd_puts_offset(int x, int y, const unsigned char *str, int offset)
1093{
1094 lcd_puts_style_offset(x, y, str, STYLE_DEFAULT, offset);
1095}
1096
1097/* put a string at a given char position */
1098void lcd_puts(int x, int y, const unsigned char *str)
1099{
1100 lcd_puts_style(x, y, str, STYLE_DEFAULT);
1101}
1102 1103
1103/*** scrolling ***/ 1104/*** scrolling ***/
1104 1105
@@ -1226,7 +1227,7 @@ static void scroll_thread(void)
1226 while ( 1 ) { 1227 while ( 1 ) {
1227 for ( index = 0; index < SCROLLABLE_LINES; index++ ) { 1228 for ( index = 0; index < SCROLLABLE_LINES; index++ ) {
1228 /* really scroll? */ 1229 /* really scroll? */
1229 if ( !(scrolling_lines&(1<<index))) 1230 if ( !(scrolling_lines&(1<<index)) )
1230 continue; 1231 continue;
1231 1232
1232 s = &scroll[index]; 1233 s = &scroll[index];
@@ -1269,7 +1270,8 @@ static void scroll_thread(void)
1269 lcd_fillrect(xpos, ypos, LCD_WIDTH - xpos, pf->height); 1270 lcd_fillrect(xpos, ypos, LCD_WIDTH - xpos, pf->height);
1270 drawmode = DRMODE_SOLID; 1271 drawmode = DRMODE_SOLID;
1271 lcd_putsxyofs(xpos, ypos, s->offset, (unsigned char *)s->line); 1272 lcd_putsxyofs(xpos, ypos, s->offset, (unsigned char *)s->line);
1272 if (s->invert) { 1273 if (s->invert)
1274 {
1273 drawmode = DRMODE_COMPLEMENT; 1275 drawmode = DRMODE_COMPLEMENT;
1274 lcd_fillrect(xpos, ypos, LCD_WIDTH - xpos, pf->height); 1276 lcd_fillrect(xpos, ypos, LCD_WIDTH - xpos, pf->height);
1275 } 1277 }
diff --git a/firmware/drivers/lcd-recorder.c b/firmware/drivers/lcd-recorder.c
index 9f8a2b6568..b7bcd02cec 100644
--- a/firmware/drivers/lcd-recorder.c
+++ b/firmware/drivers/lcd-recorder.c
@@ -917,9 +917,26 @@ void lcd_putsxy(int x, int y, const unsigned char *str)
917 917
918/*** Line oriented text output ***/ 918/*** Line oriented text output ***/
919 919
920/* put a string at a given char position at a given style and with a given pixel position */ 920/* put a string at a given char position */
921void lcd_puts_style_offset(int x, int y, const unsigned char *str, int style, 921void lcd_puts(int x, int y, const unsigned char *str)
922 int offset) 922{
923 lcd_puts_style_offset(x, y, str, STYLE_DEFAULT, 0);
924}
925
926void lcd_puts_style(int x, int y, const unsigned char *str, int style)
927{
928 lcd_puts_style_offset(x, y, str, style, 0);
929}
930
931void lcd_puts_offset(int x, int y, const unsigned char *str, int offset)
932{
933 lcd_puts_style_offset(x, y, str, STYLE_DEFAULT, offset);
934}
935
936/* put a string at a given char position, style, and pixel position,
937 * skipping first offset pixel columns */
938void lcd_puts_style_offset(int x, int y, const unsigned char *str,
939 int style, int offset)
923{ 940{
924 int xpos,ypos,w,h; 941 int xpos,ypos,w,h;
925 int lastmode = drawmode; 942 int lastmode = drawmode;
@@ -944,23 +961,6 @@ void lcd_puts_style_offset(int x, int y, const unsigned char *str, int style,
944 drawmode = lastmode; 961 drawmode = lastmode;
945} 962}
946 963
947void lcd_puts_style(int x, int y, const unsigned char *str, int style)
948{
949 lcd_puts_style_offset(x, y, str, style, 0);
950}
951
952/* put a string at a given char position at a given offset mark */
953void lcd_puts_offset(int x, int y, const unsigned char *str, int offset)
954{
955 lcd_puts_style_offset(x, y, str, STYLE_DEFAULT, offset);
956}
957
958/* put a string at a given char position */
959void lcd_puts(int x, int y, const unsigned char *str)
960{
961 lcd_puts_style_offset(x, y, str, STYLE_DEFAULT, 0);
962}
963
964/*** scrolling ***/ 964/*** scrolling ***/
965 965
966/* Reverse the invert setting of the scrolling line (if any) at given char 966/* Reverse the invert setting of the scrolling line (if any) at given char
@@ -1002,20 +1002,21 @@ void lcd_bidir_scroll(int percent)
1002 1002
1003void lcd_puts_scroll(int x, int y, const unsigned char *string) 1003void lcd_puts_scroll(int x, int y, const unsigned char *string)
1004{ 1004{
1005 lcd_puts_scroll_style_offset(x, y, string, STYLE_DEFAULT, 0); 1005 lcd_puts_scroll_style(x, y, string, STYLE_DEFAULT);
1006} 1006}
1007 1007
1008void lcd_puts_scroll_offset(int x, int y, const unsigned char *string, int offset)
1009{
1010 lcd_puts_scroll_style_offset(x, y, string, STYLE_DEFAULT, offset);
1011}
1012
1013void lcd_puts_scroll_style(int x, int y, const unsigned char *string, int style) 1008void lcd_puts_scroll_style(int x, int y, const unsigned char *string, int style)
1014{ 1009{
1015 lcd_puts_scroll_style_offset(x, y, string, style, 0); 1010 lcd_puts_scroll_style_offset(x, y, string, style, 0);
1016} 1011}
1017 1012
1018void lcd_puts_scroll_style_offset(int x, int y, const unsigned char *string, 1013void lcd_puts_scroll_offset(int x, int y, const unsigned char *string,
1014 int offset)
1015{
1016 lcd_puts_scroll_style_offset(x, y, string, STYLE_DEFAULT, offset);
1017}
1018
1019void lcd_puts_scroll_style_offset(int x, int y, const unsigned char *string,
1019 int style, int offset) 1020 int style, int offset)
1020{ 1021{
1021 struct scrollinfo* s; 1022 struct scrollinfo* s;
@@ -1130,7 +1131,8 @@ static void scroll_thread(void)
1130 lcd_fillrect(xpos, ypos, LCD_WIDTH - xpos, pf->height); 1131 lcd_fillrect(xpos, ypos, LCD_WIDTH - xpos, pf->height);
1131 drawmode = DRMODE_SOLID; 1132 drawmode = DRMODE_SOLID;
1132 lcd_putsxyofs(xpos, ypos, s->offset, s->line); 1133 lcd_putsxyofs(xpos, ypos, s->offset, s->line);
1133 if (s->invert) { 1134 if (s->invert)
1135 {
1134 drawmode = DRMODE_COMPLEMENT; 1136 drawmode = DRMODE_COMPLEMENT;
1135 lcd_fillrect(xpos, ypos, LCD_WIDTH - xpos, pf->height); 1137 lcd_fillrect(xpos, ypos, LCD_WIDTH - xpos, pf->height);
1136 } 1138 }
diff --git a/firmware/export/lcd-remote.h b/firmware/export/lcd-remote.h
index 2795c7b90d..8e5fa950b1 100644
--- a/firmware/export/lcd-remote.h
+++ b/firmware/export/lcd-remote.h
@@ -37,13 +37,11 @@ extern void lcd_remote_emireduce(bool state);
37extern void lcd_remote_clear_display(void); 37extern void lcd_remote_clear_display(void);
38extern void lcd_remote_puts(int x, int y, const unsigned char *string); 38extern void lcd_remote_puts(int x, int y, const unsigned char *string);
39extern void lcd_remote_puts_style(int x, int y, const unsigned char *string, 39extern void lcd_remote_puts_style(int x, int y, const unsigned char *string,
40 int style); 40 int style);
41extern void lcd_remote_puts_offset(int x, int y, const unsigned char *str, int offset); 41extern void lcd_remote_puts_offset(int x, int y, const unsigned char *str, int offset);
42extern void lcd_remote_puts_style_offset(int x, int y, const unsigned char *str, int style, int offset); 42extern void lcd_remote_puts_style_offset(int x, int y, const unsigned char *str, int style, int offset);
43
44extern void lcd_remote_putc(int x, int y, unsigned short ch); 43extern void lcd_remote_putc(int x, int y, unsigned short ch);
45extern void lcd_remote_stop_scroll(void); 44extern void lcd_remote_stop_scroll(void);
46
47extern void lcd_remote_scroll_speed(int speed); 45extern void lcd_remote_scroll_speed(int speed);
48extern void lcd_remote_scroll_delay(int ms); 46extern void lcd_remote_scroll_delay(int ms);
49extern void lcd_remote_puts_scroll(int x, int y, const unsigned char* string); 47extern void lcd_remote_puts_scroll(int x, int y, const unsigned char* string);