summaryrefslogtreecommitdiff
path: root/apps/screens.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/screens.c')
-rw-r--r--apps/screens.c70
1 files changed, 7 insertions, 63 deletions
diff --git a/apps/screens.c b/apps/screens.c
index 9ff2e1b952..368a185073 100644
--- a/apps/screens.c
+++ b/apps/screens.c
@@ -16,6 +16,7 @@
16 * KIND, either express or implied. 16 * KIND, either express or implied.
17 * 17 *
18 ****************************************************************************/ 18 ****************************************************************************/
19
19#include <stdbool.h> 20#include <stdbool.h>
20#include <string.h> 21#include <string.h>
21#include <stdio.h> 22#include <stdio.h>
@@ -51,6 +52,7 @@
51#include "statusbar.h" 52#include "statusbar.h"
52#include "screen_access.h" 53#include "screen_access.h"
53#include "quickscreen.h" 54#include "quickscreen.h"
55#include "logo.h"
54 56
55#if defined(HAVE_LCD_BITMAP) 57#if defined(HAVE_LCD_BITMAP)
56#include "widgets.h" 58#include "widgets.h"
@@ -64,66 +66,8 @@
64 66
65#ifdef HAVE_LCD_BITMAP 67#ifdef HAVE_LCD_BITMAP
66#define SCROLLBAR_WIDTH 6 68#define SCROLLBAR_WIDTH 6
67
68#define BMPHEIGHT_usb_logo 32
69#define BMPWIDTH_usb_logo 100
70static const unsigned char usb_logo[] = {
71 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
72 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
73 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x40, 0x20, 0x10, 0x08,
74 0x04, 0x04, 0x02, 0x02, 0x02, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
75 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x81, 0x81, 0x81, 0x81,
76 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
77 0x01, 0x01, 0x01, 0x01, 0xf1, 0x4f, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40,
78 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0xc0,
79 0x00, 0x00, 0xe0, 0x1c, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04,
80 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04,
81 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x06, 0x81, 0xc0, 0xe0, 0xe0, 0xe0, 0xe0,
82 0xc0, 0x80, 0x00, 0x00, 0x00, 0x00, 0x80, 0xc0, 0xe0, 0x70, 0x38, 0x1c, 0x1c,
83 0x0c, 0x0e, 0x0e, 0x06, 0x06, 0x06, 0x06, 0x06, 0x0f, 0x1f, 0x1f, 0x1f, 0x1f,
84 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xc0, 0xc0, 0x80, 0x80, 0x00, 0x00,
85 0x00, 0x00, 0xe0, 0x1f, 0x00, 0xf8, 0x06, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02,
86 0x02, 0x02, 0x02, 0x82, 0x7e, 0x00, 0xc0, 0x3e, 0x01,
87 0x70, 0x4f, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40,
88 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40,
89 0x40, 0x40, 0x40, 0x40, 0x40, 0x80, 0x00, 0x07, 0x0f, 0x1f, 0x1f, 0x1f, 0x1f,
90 0x0f, 0x07, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x07, 0x0f,
91 0x1f, 0x3f, 0x7b, 0xf3, 0xe3, 0xc3, 0x83, 0x83, 0x83, 0x83, 0xe3, 0xe3, 0xe3,
92 0xe3, 0xe3, 0xe3, 0x03, 0x03, 0x03, 0x3f, 0x1f, 0x1f, 0x0f, 0x0f, 0x07, 0x02,
93 0xc0, 0x3e, 0x01, 0xe0, 0x9f, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80,
94 0x80, 0x80, 0xf0, 0x0f, 0x80, 0x78, 0x07, 0x00, 0x00,
95 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
96 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
97 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x0c, 0x10, 0x20, 0x40, 0x40, 0x80, 0x80,
98 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80,
99 0x80, 0x80, 0x80, 0x80, 0x80, 0x81, 0x81, 0x81, 0x81, 0x81, 0x87, 0x87, 0x87,
100 0x87, 0x87, 0x87, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0xf0,
101 0x0f, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04,
102 0x04, 0x04, 0x04, 0x04, 0x07, 0x00, 0x00, 0x00, 0x00,
103};
104#endif 69#endif
105 70
106void usb_display_info(struct screen * display)
107{
108 display->clear_display();
109
110#ifdef HAVE_LCD_BITMAP
111 /* Center bitmap on screen */
112 display->mono_bitmap(usb_logo,
113 display->width/2-BMPWIDTH_usb_logo/2,
114 display->height/2-BMPHEIGHT_usb_logo/2,
115 BMPWIDTH_usb_logo,
116 BMPHEIGHT_usb_logo);
117 display->update();
118#else
119 display->double_height(false);
120 display->puts(0, 0, "[USB Mode]");
121#ifdef SIMULATOR
122 display->update();
123#endif /* SIMULATOR */
124#endif /* HAVE_LCD_BITMAP */
125}
126
127void usb_screen(void) 71void usb_screen(void)
128{ 72{
129#ifdef USB_NONE 73#ifdef USB_NONE
@@ -132,7 +76,7 @@ void usb_screen(void)
132 int i; 76 int i;
133 FOR_NB_SCREENS(i) { 77 FOR_NB_SCREENS(i) {
134 screens[i].backlight_on(); 78 screens[i].backlight_on();
135 usb_display_info(&screens[i]); 79 gui_logo_draw(&usb_logos[i], &screens[i]);
136 } 80 }
137#ifdef HAVE_LCD_CHARCELLS 81#ifdef HAVE_LCD_CHARCELLS
138 status_set_param(false); 82 status_set_param(false);
@@ -542,7 +486,7 @@ void quick_screen_quick_apply(struct gui_quickscreen *qs)
542 global_settings.repeat_mode=option_select_get_selected(qs->right_option); 486 global_settings.repeat_mode=option_select_get_selected(qs->right_option);
543} 487}
544 488
545bool quick_screen_quick(void) 489bool quick_screen_quick(int button_enter)
546{ 490{
547 bool res, oldrepeat; 491 bool res, oldrepeat;
548 struct option_select left_option; 492 struct option_select left_option;
@@ -589,7 +533,7 @@ bool quick_screen_quick(void)
589 gui_quickscreen_init(&qs, &left_option, &bottom_option, &right_option, 533 gui_quickscreen_init(&qs, &left_option, &bottom_option, &right_option,
590 str(LANG_F2_MODE), &quick_screen_quick_apply); 534 str(LANG_F2_MODE), &quick_screen_quick_apply);
591 oldrepeat=global_settings.repeat_mode; 535 oldrepeat=global_settings.repeat_mode;
592 res=gui_syncquickscreen_run(&qs); 536 res=gui_syncquickscreen_run(&qs, button_enter);
593 if(!res) 537 if(!res)
594 { 538 {
595 if ( oldrepeat != global_settings.repeat_mode && 539 if ( oldrepeat != global_settings.repeat_mode &&
@@ -624,7 +568,7 @@ void quick_screen_f3_apply(struct gui_quickscreen *qs)
624 gui_syncstatusbar_draw(&statusbars, true); 568 gui_syncstatusbar_draw(&statusbars, true);
625} 569}
626 570
627bool quick_screen_f3(void) 571bool quick_screen_f3(int button_enter)
628{ 572{
629 bool res; 573 bool res;
630 struct option_select left_option; 574 struct option_select left_option;
@@ -658,7 +602,7 @@ bool quick_screen_f3(void)
658 2); 602 2);
659 gui_quickscreen_init(&qs, &left_option, &bottom_option, &right_option, 603 gui_quickscreen_init(&qs, &left_option, &bottom_option, &right_option,
660 str(LANG_F3_BAR), &quick_screen_f3_apply); 604 str(LANG_F3_BAR), &quick_screen_f3_apply);
661 res=gui_syncquickscreen_run(&qs); 605 res=gui_syncquickscreen_run(&qs, button_enter);
662 if(!res) 606 if(!res)
663 settings_save(); 607 settings_save();
664 return(res); 608 return(res);