summaryrefslogtreecommitdiff
path: root/apps/gui
diff options
context:
space:
mode:
Diffstat (limited to 'apps/gui')
-rw-r--r--apps/gui/charcell/list.c112
-rw-r--r--apps/gui/icon.h15
-rw-r--r--apps/gui/line.c4
-rw-r--r--apps/gui/list.c5
-rw-r--r--apps/gui/skin_engine/skin_display.c1
-rw-r--r--apps/gui/skin_engine/skin_parser.c8
-rw-r--r--apps/gui/skin_engine/skin_render.c12
-rw-r--r--apps/gui/skin_engine/skin_tokens.c173
-rw-r--r--apps/gui/skin_engine/wps_internals.h3
-rw-r--r--apps/gui/splash.c17
-rw-r--r--apps/gui/statusbar.c38
-rw-r--r--apps/gui/usb_screen.c9
-rw-r--r--apps/gui/viewport.h4
-rw-r--r--apps/gui/wps.c22
-rw-r--r--apps/gui/yesno.c5
15 files changed, 1 insertions, 427 deletions
diff --git a/apps/gui/charcell/list.c b/apps/gui/charcell/list.c
deleted file mode 100644
index cbee8b0d9d..0000000000
--- a/apps/gui/charcell/list.c
+++ /dev/null
@@ -1,112 +0,0 @@
1/***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
9 *
10 * Copyright (C) 2007 by Jonathan Gordon
11 *
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License
14 * as published by the Free Software Foundation; either version 2
15 * of the License, or (at your option) any later version.
16 *
17 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
18 * KIND, either express or implied.
19 *
20 ****************************************************************************/
21
22/* This file contains the code to draw the list widget on BITMAP LCDs. */
23
24#include "config.h"
25#include "lcd.h"
26#include "font.h"
27#include "button.h"
28#include "string.h"
29#include "settings.h"
30#include "kernel.h"
31#include "system.h"
32#include "file.h"
33
34#include "list.h"
35#include "screen_access.h"
36#include "scrollbar.h"
37#include "lang.h"
38#include "sound.h"
39#include "misc.h"
40
41void gui_synclist_scroll_stop(struct gui_synclist *lists)
42{
43 (void)lists;
44 FOR_NB_SCREENS(i)
45 {
46 screens[i].scroll_stop();
47 }
48}
49
50void list_draw(struct screen *display, struct gui_synclist *gui_list)
51{
52 bool draw_icons = (gui_list->callback_get_item_icon != NULL);
53 bool selected;
54 int i;
55 int start, end;
56
57 display->set_viewport(NULL);
58
59 display->clear_display();
60 start = 0;
61 end = display->getnblines();
62
63 struct line_desc desc = {
64 .height = -1,
65 .text_color = 1,
66 .line_color = 1,
67 .line_end_color = 1,
68 .style = STYLE_DEFAULT
69 };
70
71 for (i = start; i < end; i++)
72 {
73 unsigned const char *s;
74 char entry_buffer[MAX_PATH];
75 unsigned char *entry_name;
76 int current_item = gui_list->start_item[display->screen_type] + i;
77
78 /* When there are less items to display than the
79 * current available space on the screen, we stop*/
80 if(current_item >= gui_list->nb_items)
81 break;
82 s = gui_list->callback_get_item_name(current_item,
83 gui_list->data,
84 entry_buffer,
85 sizeof(entry_buffer));
86 entry_name = P2STR(s);
87
88 if (gui_list->show_selection_marker &&
89 current_item >= gui_list->selected_item &&
90 current_item < gui_list->selected_item + gui_list->selected_size)
91 selected = true; /* The selected item must be displayed scrolling */
92 else
93 selected = false;
94
95 desc.nlines = gui_list->selected_size,
96 desc.line = gui_list->selected_size > 1 ? i : 0,
97 desc.scroll = selected ? true : gui_list->scroll_all;
98
99 if (draw_icons)
100 put_line(display, 0, i, &desc, "$i$i$t",
101 selected ? Icon_Cursor : Icon_NOICON,
102 gui_list->callback_get_item_icon(current_item, gui_list->data),
103 entry_name);
104 else
105 put_line(display, 0, i, &desc, "$i$t",
106 selected ? Icon_Cursor : Icon_NOICON,
107 entry_name);
108 }
109
110 display->update_viewport();
111 display->update();
112}
diff --git a/apps/gui/icon.h b/apps/gui/icon.h
index e095ccfc4c..88449c61ca 100644
--- a/apps/gui/icon.h
+++ b/apps/gui/icon.h
@@ -89,10 +89,6 @@ extern void screen_put_cursorxy(struct screen * screen, int x, int y, bool on);
89 */ 89 */
90extern void screen_put_iconxy(struct screen * screen, 90extern void screen_put_iconxy(struct screen * screen,
91 int x, int y, enum themable_icons icon); 91 int x, int y, enum themable_icons icon);
92#ifdef HAVE_LCD_CHARCELLS
93# define screen_put_icon(s, x, y, i) screen_put_iconxy(s, x, y, i)
94# define screen_put_icon_with_offset(s, x, y, w, h, i) screen_put_icon(s, x, y, i)
95#else
96/* For both of these, the icon will be placed in the center of the rectangle */ 92/* For both of these, the icon will be placed in the center of the rectangle */
97/* as above, but x,y are letter position, NOT PIXEL */ 93/* as above, but x,y are letter position, NOT PIXEL */
98extern void screen_put_icon(struct screen * screen, 94extern void screen_put_icon(struct screen * screen,
@@ -101,23 +97,14 @@ extern void screen_put_icon(struct screen * screen,
101extern void screen_put_icon_with_offset(struct screen * display, 97extern void screen_put_icon_with_offset(struct screen * display,
102 int x, int y, int off_x, int off_y, 98 int x, int y, int off_x, int off_y,
103 enum themable_icons icon); 99 enum themable_icons icon);
104#endif
105
106void icons_init(void); 100void icons_init(void);
107 101
108 102
109#ifdef HAVE_LCD_CHARCELLS
110# define CURSOR_CHAR 0xe10c
111# define get_icon_width(a) 1
112# define get_icon_height(a) 1 /* needs to be verified */
113#else
114int get_icon_width(enum screen_type screen_type); 103int get_icon_width(enum screen_type screen_type);
115int get_icon_height(enum screen_type screen_type); 104int get_icon_height(enum screen_type screen_type);
116int get_icon_format(enum screen_type screen_type); 105int get_icon_format(enum screen_type screen_type);
117#endif
118 106
119#if (LCD_DEPTH > 1) || defined(HAVE_REMOTE_LCD) && (LCD_REMOTE_DEPTH > 1) \ 107#if (LCD_DEPTH > 1) || defined(HAVE_REMOTE_LCD) && (LCD_REMOTE_DEPTH > 1)
120 && !defined(HAVE_LCD_CHARCELLS)
121int get_icon_format(enum screen_type screen_type); 108int get_icon_format(enum screen_type screen_type);
122#else 109#else
123# define get_icon_format(a) FORMAT_MONO 110# define get_icon_format(a) FORMAT_MONO
diff --git a/apps/gui/line.c b/apps/gui/line.c
index 2b1bec2c6b..ea6bcea93b 100644
--- a/apps/gui/line.c
+++ b/apps/gui/line.c
@@ -41,11 +41,7 @@
41#endif 41#endif
42 42
43 43
44#ifdef HAVE_LCD_CHARCELLS
45#define style_line(d, x, y, l)
46#else
47static void style_line(struct screen *display, int x, int y, struct line_desc *line); 44static void style_line(struct screen *display, int x, int y, struct line_desc *line);
48#endif
49 45
50static void put_text(struct screen *display, int x, int y, struct line_desc *line, 46static void put_text(struct screen *display, int x, int y, struct line_desc *line,
51 const char *text, bool prevent_scroll, int text_skip_pixels); 47 const char *text, bool prevent_scroll, int text_skip_pixels);
diff --git a/apps/gui/list.c b/apps/gui/list.c
index 8533f93275..ce444cc9c2 100644
--- a/apps/gui/list.c
+++ b/apps/gui/list.c
@@ -279,13 +279,8 @@ static void gui_list_put_selection_on_screen(struct gui_synclist * gui_list,
279 int bottom = MAX(0, gui_list->nb_items - nb_lines); 279 int bottom = MAX(0, gui_list->nb_items - nb_lines);
280 int new_start_item = gui_list->start_item[screen]; 280 int new_start_item = gui_list->start_item[screen];
281 int difference = gui_list->selected_item - gui_list->start_item[screen]; 281 int difference = gui_list->selected_item - gui_list->start_item[screen];
282#ifdef HAVE_LCD_CHARCELLS
283 const int scroll_limit_up = 0;
284 const int scroll_limit_down = 1;
285#else
286 const int scroll_limit_up = (nb_lines < gui_list->selected_size+2 ? 0:1); 282 const int scroll_limit_up = (nb_lines < gui_list->selected_size+2 ? 0:1);
287 const int scroll_limit_down = (scroll_limit_up+gui_list->selected_size); 283 const int scroll_limit_down = (scroll_limit_up+gui_list->selected_size);
288#endif
289 284
290 if (gui_list->show_selection_marker == false) 285 if (gui_list->show_selection_marker == false)
291 { 286 {
diff --git a/apps/gui/skin_engine/skin_display.c b/apps/gui/skin_engine/skin_display.c
index 501d3a305a..7ee349b346 100644
--- a/apps/gui/skin_engine/skin_display.c
+++ b/apps/gui/skin_engine/skin_display.c
@@ -662,7 +662,6 @@ bool skin_has_sbs(enum screen_type screen, struct wps_data *data)
662 */ 662 */
663int skin_wait_for_action(enum skinnable_screens skin, int context, int timeout) 663int skin_wait_for_action(enum skinnable_screens skin, int context, int timeout)
664{ 664{
665 (void)skin; /* silence charcell warning */
666 int button = ACTION_NONE; 665 int button = ACTION_NONE;
667#ifdef HAVE_LCD_BITMAP 666#ifdef HAVE_LCD_BITMAP
668 /* when the peak meter is enabled we want to have a 667 /* when the peak meter is enabled we want to have a
diff --git a/apps/gui/skin_engine/skin_parser.c b/apps/gui/skin_engine/skin_parser.c
index dce88e9c58..de7c1db372 100644
--- a/apps/gui/skin_engine/skin_parser.c
+++ b/apps/gui/skin_engine/skin_parser.c
@@ -1815,14 +1815,6 @@ static void skin_data_reset(struct wps_data *wps_data)
1815 wps_data->peak_meter_enabled = false; 1815 wps_data->peak_meter_enabled = false;
1816 wps_data->wps_sb_tag = false; 1816 wps_data->wps_sb_tag = false;
1817 wps_data->show_sb_on_wps = false; 1817 wps_data->show_sb_on_wps = false;
1818#else /* HAVE_LCD_CHARCELLS */
1819 /* progress bars */
1820 int i;
1821 for (i = 0; i < 8; i++)
1822 {
1823 wps_data->wps_progress_pat[i] = 0;
1824 }
1825 wps_data->full_line_progressbar = false;
1826#endif 1818#endif
1827 wps_data->wps_loaded = false; 1819 wps_data->wps_loaded = false;
1828} 1820}
diff --git a/apps/gui/skin_engine/skin_render.c b/apps/gui/skin_engine/skin_render.c
index 4415619b7e..e14c882dd9 100644
--- a/apps/gui/skin_engine/skin_render.c
+++ b/apps/gui/skin_engine/skin_render.c
@@ -97,10 +97,6 @@ get_child(OFFSETTYPE(struct skin_element**) children, int child)
97static bool do_non_text_tags(struct gui_wps *gwps, struct skin_draw_info *info, 97static bool do_non_text_tags(struct gui_wps *gwps, struct skin_draw_info *info,
98 struct skin_element *element, struct skin_viewport* skin_vp) 98 struct skin_element *element, struct skin_viewport* skin_vp)
99{ 99{
100#ifndef HAVE_LCD_BITMAP
101 (void)skin_vp; /* silence warnings */
102 (void)info;
103#endif
104 struct wps_token *token = (struct wps_token *)SKINOFFSETTOPTR(skin_buffer, element->data); 100 struct wps_token *token = (struct wps_token *)SKINOFFSETTOPTR(skin_buffer, element->data);
105 101
106#ifdef HAVE_LCD_BITMAP 102#ifdef HAVE_LCD_BITMAP
@@ -832,14 +828,6 @@ void skin_render(struct gui_wps *gwps, unsigned refresh_mode)
832 int old_refresh_mode = refresh_mode; 828 int old_refresh_mode = refresh_mode;
833 skin_buffer = get_skin_buffer(gwps->data); 829 skin_buffer = get_skin_buffer(gwps->data);
834 830
835#ifdef HAVE_LCD_CHARCELLS
836 int i;
837 for (i = 0; i < 8; i++)
838 {
839 if (data->wps_progress_pat[i] == 0)
840 data->wps_progress_pat[i] = display->get_locked_pattern();
841 }
842#endif
843 831
844 viewport = SKINOFFSETTOPTR(skin_buffer, data->tree); 832 viewport = SKINOFFSETTOPTR(skin_buffer, data->tree);
845 skin_viewport = SKINOFFSETTOPTR(skin_buffer, viewport->data); 833 skin_viewport = SKINOFFSETTOPTR(skin_buffer, viewport->data);
diff --git a/apps/gui/skin_engine/skin_tokens.c b/apps/gui/skin_engine/skin_tokens.c
index 75c3203066..50704fd66e 100644
--- a/apps/gui/skin_engine/skin_tokens.c
+++ b/apps/gui/skin_engine/skin_tokens.c
@@ -37,9 +37,6 @@
37#include "cuesheet.h" 37#include "cuesheet.h"
38#include "replaygain.h" 38#include "replaygain.h"
39#include "core_alloc.h" 39#include "core_alloc.h"
40#ifdef HAVE_LCD_CHARCELLS
41#include "hwcompat.h"
42#endif
43#include "abrepeat.h" 40#include "abrepeat.h"
44#include "lang.h" 41#include "lang.h"
45#include "misc.h" 42#include "misc.h"
@@ -577,148 +574,6 @@ static struct mp3entry* get_mp3entry_from_offset(int offset, char **filename)
577 return pid3; 574 return pid3;
578} 575}
579 576
580#ifdef HAVE_LCD_CHARCELLS
581static void format_player_progress(struct gui_wps *gwps)
582{
583 struct wps_state *state = skin_get_global_state();
584 struct screen *display = gwps->display;
585 unsigned char progress_pattern[7];
586 int pos = 0;
587 int i;
588
589 int elapsed, length;
590 if (LIKELY(state->id3))
591 {
592 elapsed = state->id3->elapsed;
593 length = state->id3->length;
594 }
595 else
596 {
597 elapsed = 0;
598 length = 0;
599 }
600
601 if (length)
602 pos = 36 * (elapsed + state->ff_rewind_count) / length;
603
604 for (i = 0; i < 7; i++, pos -= 5)
605 {
606 if (pos <= 0)
607 progress_pattern[i] = 0x1fu;
608 else if (pos >= 5)
609 progress_pattern[i] = 0x00u;
610 else
611 progress_pattern[i] = 0x1fu >> pos;
612 }
613
614 display->define_pattern(gwps->data->wps_progress_pat[0], progress_pattern);
615}
616
617static void format_player_fullbar(struct gui_wps *gwps, char* buf, int buf_size)
618{
619 static const unsigned char numbers[10][4] = {
620 {0x0e, 0x0a, 0x0a, 0x0e}, /* 0 */
621 {0x04, 0x0c, 0x04, 0x04}, /* 1 */
622 {0x0e, 0x02, 0x04, 0x0e}, /* 2 */
623 {0x0e, 0x02, 0x06, 0x0e}, /* 3 */
624 {0x08, 0x0c, 0x0e, 0x04}, /* 4 */
625 {0x0e, 0x0c, 0x02, 0x0c}, /* 5 */
626 {0x0e, 0x08, 0x0e, 0x0e}, /* 6 */
627 {0x0e, 0x02, 0x04, 0x08}, /* 7 */
628 {0x0e, 0x0e, 0x0a, 0x0e}, /* 8 */
629 {0x0e, 0x0e, 0x02, 0x0e} /* 9 */
630 };
631
632 struct wps_state *state = skin_get_global_state();
633 struct screen *display = gwps->display;
634 struct wps_data *data = gwps->data;
635 unsigned char progress_pattern[7];
636 char timestr[10];
637 int time;
638 int time_idx = 0;
639 int pos = 0;
640 int pat_idx = 1;
641 int digit, i, j;
642 bool softchar;
643
644 int elapsed, length;
645 if (LIKELY(state->id3))
646 {
647 elapsed = state->id3->elapsed;
648 length = state->id3->length;
649 }
650 else
651 {
652 elapsed = 0;
653 length = 0;
654 }
655
656 if (buf_size < 34) /* worst case: 11x UTF-8 char + \0 */
657 return;
658
659 time = elapsed + state->ff_rewind_count;
660 if (length)
661 pos = 55 * time / length;
662
663 memset(timestr, 0, sizeof(timestr));
664 format_time(timestr, sizeof(timestr)-2, time);
665 timestr[strlen(timestr)] = ':'; /* always safe */
666
667 for (i = 0; i < 11; i++, pos -= 5)
668 {
669 softchar = false;
670 memset(progress_pattern, 0, sizeof(progress_pattern));
671
672 if ((digit = timestr[time_idx]))
673 {
674 softchar = true;
675 digit -= '0';
676
677 if (timestr[time_idx + 1] == ':') /* ones, left aligned */
678 {
679 memcpy(progress_pattern, numbers[digit], 4);
680 time_idx += 2;
681 }
682 else /* tens, shifted right */
683 {
684 for (j = 0; j < 4; j++)
685 progress_pattern[j] = numbers[digit][j] >> 1;
686
687 if (time_idx > 0) /* not the first group, add colon in front */
688 {
689 progress_pattern[1] |= 0x10u;
690 progress_pattern[3] |= 0x10u;
691 }
692 time_idx++;
693 }
694
695 if (pos >= 5)
696 progress_pattern[5] = progress_pattern[6] = 0x1fu;
697 }
698
699 if (pos > 0 && pos < 5)
700 {
701 softchar = true;
702 progress_pattern[5] = progress_pattern[6] = (~0x1fu >> pos) & 0x1fu;
703 }
704
705 if (softchar && pat_idx < 8)
706 {
707 display->define_pattern(data->wps_progress_pat[pat_idx],
708 progress_pattern);
709 buf = utf8encode(data->wps_progress_pat[pat_idx], buf);
710 pat_idx++;
711 }
712 else if (pos <= 0)
713 buf = utf8encode(' ', buf);
714 else
715 buf = utf8encode(0xe115, buf); /* 2/7 _ */
716 }
717 *buf = '\0';
718}
719
720#endif /* HAVE_LCD_CHARCELLS */
721
722/* Don't inline this; it was broken out of get_token_value to reduce stack 577/* Don't inline this; it was broken out of get_token_value to reduce stack
723 * usage. 578 * usage.
724 */ 579 */
@@ -1351,34 +1206,6 @@ const char *get_token_value(struct gui_wps *gwps,
1351 return "-"; 1206 return "-";
1352#endif 1207#endif
1353 1208
1354#ifdef HAVE_LCD_CHARCELLS
1355 case SKIN_TOKEN_PROGRESSBAR:
1356 {
1357 char *end;
1358 format_player_progress(gwps);
1359 end = utf8encode(data->wps_progress_pat[0], buf);
1360 *end = '\0';
1361 return buf;
1362 }
1363
1364 case SKIN_TOKEN_PLAYER_PROGRESSBAR:
1365 if(is_new_player())
1366 {
1367 /* we need 11 characters (full line) for
1368 progress-bar */
1369 strlcpy(buf, " ", buf_size);
1370 format_player_fullbar(gwps,buf,buf_size);
1371 DEBUGF("bar='%s'\n",buf);
1372 }
1373 else
1374 {
1375 /* Tell the user if we have an OldPlayer */
1376 strlcpy(buf, " <Old LCD> ", buf_size);
1377 }
1378 return buf;
1379#endif
1380
1381
1382#ifdef HAVE_LCD_BITMAP 1209#ifdef HAVE_LCD_BITMAP
1383 /* peakmeter */ 1210 /* peakmeter */
1384 case SKIN_TOKEN_PEAKMETER_LEFT: 1211 case SKIN_TOKEN_PEAKMETER_LEFT:
diff --git a/apps/gui/skin_engine/wps_internals.h b/apps/gui/skin_engine/wps_internals.h
index e7996b0530..caf43b21cb 100644
--- a/apps/gui/skin_engine/wps_internals.h
+++ b/apps/gui/skin_engine/wps_internals.h
@@ -374,9 +374,6 @@ struct wps_data
374 bool peak_meter_enabled; 374 bool peak_meter_enabled;
375 bool wps_sb_tag; 375 bool wps_sb_tag;
376 bool show_sb_on_wps; 376 bool show_sb_on_wps;
377#else /*HAVE_LCD_CHARCELLS */
378 unsigned short wps_progress_pat[8];
379 bool full_line_progressbar;
380#endif 377#endif
381 bool wps_loaded; 378 bool wps_loaded;
382}; 379};
diff --git a/apps/gui/splash.c b/apps/gui/splash.c
index 2608a2e02e..56df77d57a 100644
--- a/apps/gui/splash.c
+++ b/apps/gui/splash.c
@@ -38,12 +38,6 @@
38#define RECT_SPACING 2 38#define RECT_SPACING 2
39#define SPLASH_MEMORY_INTERVAL (HZ) 39#define SPLASH_MEMORY_INTERVAL (HZ)
40 40
41#else /* HAVE_LCD_CHARCELLS */
42
43#define MAXLINES 2
44#define MAXBUFFER 64
45#define RECT_SPACING 0
46
47#endif 41#endif
48 42
49 43
@@ -68,12 +62,6 @@ static void splash_internal(struct screen * screen, const char *fmt, va_list ap)
68 screen->set_viewport(&vp); 62 screen->set_viewport(&vp);
69 63
70 screen->getstringsize(" ", &space_w, &h); 64 screen->getstringsize(" ", &space_w, &h);
71#else /* HAVE_LCD_CHARCELLS */
72 vp.width = screen->lcdwidth;
73 vp.height = screen->lcdheight;
74
75 space_w = h = 1;
76 screen->double_height (false);
77#endif 65#endif
78 y = h; 66 y = h;
79 67
@@ -178,9 +166,6 @@ static void splash_internal(struct screen * screen, const char *fmt, va_list ap)
178 166
179 /* prepare putting the text */ 167 /* prepare putting the text */
180 y = RECT_SPACING; 168 y = RECT_SPACING;
181#else /* HAVE_LCD_CHARCELLS */
182 y = 0; /* vertical centering on 2 lines would be silly */
183 screen->clear_display();
184#endif 169#endif
185 170
186 /* print the message to screen */ 171 /* print the message to screen */
@@ -188,8 +173,6 @@ static void splash_internal(struct screen * screen, const char *fmt, va_list ap)
188 { 173 {
189#ifdef HAVE_LCD_BITMAP 174#ifdef HAVE_LCD_BITMAP
190 screen->putsxy(0, y, lines[i]); 175 screen->putsxy(0, y, lines[i]);
191#else
192 screen->puts(0, y, lines[i]);
193#endif 176#endif
194 } 177 }
195 screen->update_viewport(); 178 screen->update_viewport();
diff --git a/apps/gui/statusbar.c b/apps/gui/statusbar.c
index 30dad95509..90d04a7930 100644
--- a/apps/gui/statusbar.c
+++ b/apps/gui/statusbar.c
@@ -191,12 +191,6 @@ void gui_statusbar_draw(struct gui_statusbar * bar, bool force_redraw, struct vi
191 if (!display) 191 if (!display)
192 return; 192 return;
193 193
194#ifdef HAVE_LCD_CHARCELLS
195 int val;
196 (void)force_redraw; /* The Player always has "redraw" */
197 (void)vp;
198#endif /* HAVE_LCD_CHARCELLS */
199
200 bar->info.battlevel = battery_level(); 194 bar->info.battlevel = battery_level();
201#ifdef HAVE_USB_POWER 195#ifdef HAVE_USB_POWER
202 bar->info.usb_inserted = usb_inserted(); 196 bar->info.usb_inserted = usb_inserted();
@@ -359,38 +353,6 @@ void gui_statusbar_draw(struct gui_statusbar * bar, bool force_redraw, struct vi
359 } 353 }
360#endif /* HAVE_LCD_BITMAP */ 354#endif /* HAVE_LCD_BITMAP */
361 355
362
363#ifdef HAVE_LCD_CHARCELLS
364 display->icon(ICON_BATTERY, bar->info.battery_state);
365
366 if (bar->info.batt_charge_step > -1)
367 val = bar->info.batt_charge_step;
368 else
369 val = (bar->info.battlevel * 3 + 50) / 100;
370 display->icon(ICON_BATTERY_1, val >= 1);
371 display->icon(ICON_BATTERY_2, val >= 2);
372 display->icon(ICON_BATTERY_3, val >= 3);
373
374 val = 10 * (bar->info.volume - sound_min(SOUND_VOLUME))
375 / (sound_max(SOUND_VOLUME) - sound_min(SOUND_VOLUME));
376 display->icon(ICON_VOLUME, true);
377 display->icon(ICON_VOLUME_1, val >= 1);
378 display->icon(ICON_VOLUME_2, val >= 3);
379 display->icon(ICON_VOLUME_3, val >= 5);
380 display->icon(ICON_VOLUME_4, val >= 7);
381 display->icon(ICON_VOLUME_5, val >= 9);
382
383 display->icon(ICON_PLAY, current_playmode() == STATUS_PLAY);
384 display->icon(ICON_PAUSE, current_playmode() == STATUS_PAUSE);
385
386 display->icon(ICON_REPEAT, global_settings.repeat_mode != REPEAT_OFF);
387 display->icon(ICON_1, global_settings.repeat_mode == REPEAT_ONE);
388
389 display->icon(ICON_RECORD, record);
390 display->icon(ICON_AUDIO, audio);
391 display->icon(ICON_PARAM, param);
392 display->icon(ICON_USB, usb);
393#endif /* HAVE_LCD_CHARCELLS */
394} 356}
395 357
396#ifdef HAVE_LCD_BITMAP 358#ifdef HAVE_LCD_BITMAP
diff --git a/apps/gui/usb_screen.c b/apps/gui/usb_screen.c
index 1b6f9c3b2a..dd1d97df3c 100644
--- a/apps/gui/usb_screen.c
+++ b/apps/gui/usb_screen.c
@@ -269,12 +269,7 @@ void gui_usb_screen_run(bool early_usb)
269 * generic cleanup here */ 269 * generic cleanup here */
270 screen->set_viewport(NULL); 270 screen->set_viewport(NULL);
271 screen->scroll_stop(); 271 screen->scroll_stop();
272#ifdef HAVE_LCD_CHARCELLS
273 /* Quick fix. Viewports should really be enabled proper for charcell */
274 viewport_set_defaults(&usb_screen_vps_ar[i].parent, i);
275#else
276 usb_screen_fix_viewports(screen, &usb_screen_vps_ar[i]); 272 usb_screen_fix_viewports(screen, &usb_screen_vps_ar[i]);
277#endif
278 } 273 }
279 274
280 /* update the UI before disabling fonts, this maximizes the propability 275 /* update the UI before disabling fonts, this maximizes the propability
@@ -327,10 +322,6 @@ void gui_usb_screen_run(bool early_usb)
327 touchscreen_set_mode(old_mode); 322 touchscreen_set_mode(old_mode);
328#endif 323#endif
329 324
330#ifdef HAVE_LCD_CHARCELLS
331 status_set_usb(false);
332#endif /* HAVE_LCD_CHARCELLS */
333
334#ifdef HAVE_LCD_BITMAP 325#ifdef HAVE_LCD_BITMAP
335 if(!early_usb) 326 if(!early_usb)
336 { 327 {
diff --git a/apps/gui/viewport.h b/apps/gui/viewport.h
index ecbd325946..c4b90aa64c 100644
--- a/apps/gui/viewport.h
+++ b/apps/gui/viewport.h
@@ -69,10 +69,6 @@ bool viewport_point_within_vp(const struct viewport *vp,
69 const int x, const int y); 69 const int x, const int y);
70#endif 70#endif
71 71
72#else /* HAVE_LCD_CHARCELL */
73#define viewportmanager_theme_changed(a)
74#define viewportmanager_theme_enable(...)
75#define viewportmanager_theme_undo(...)
76#endif 72#endif
77 73
78#endif /* __PCTOOL__ */ 74#endif /* __PCTOOL__ */
diff --git a/apps/gui/wps.c b/apps/gui/wps.c
index a930edaded..b417f82922 100644
--- a/apps/gui/wps.c
+++ b/apps/gui/wps.c
@@ -232,11 +232,6 @@ static bool update_onvol_change(enum screen_type screen)
232{ 232{
233 skin_update(WPS, screen, SKIN_REFRESH_NON_STATIC); 233 skin_update(WPS, screen, SKIN_REFRESH_NON_STATIC);
234 234
235#ifdef HAVE_LCD_CHARCELLS
236 splashf(0, "Vol: %3d dB",
237 sound_val2phys(SOUND_VOLUME, global_settings.volume));
238 return true;
239#endif
240 return false; 235 return false;
241} 236}
242 237
@@ -402,10 +397,6 @@ bool ffwd_rew(int button)
402 if (!skin_get_global_state()->paused) 397 if (!skin_get_global_state()->paused)
403 audio_resume(); 398 audio_resume();
404#endif 399#endif
405#ifdef HAVE_LCD_CHARCELLS
406 FOR_NB_SCREENS(i)
407 skin_update(WPS, i, SKIN_REFRESH_ALL);
408#endif
409 exit = true; 400 exit = true;
410 break; 401 break;
411 402
@@ -741,11 +732,6 @@ long gui_wps_show(void)
741 long last_left = 0, last_right = 0; 732 long last_left = 0, last_right = 0;
742 struct wps_state *state = skin_get_global_state(); 733 struct wps_state *state = skin_get_global_state();
743 734
744#ifdef HAVE_LCD_CHARCELLS
745 status_set_audio(true);
746 status_set_param(false);
747#endif
748
749#ifdef AB_REPEAT_ENABLE 735#ifdef AB_REPEAT_ENABLE
750 ab_repeat_init(); 736 ab_repeat_init();
751 ab_reset_markers(); 737 ab_reset_markers();
@@ -833,10 +819,6 @@ long gui_wps_show(void)
833 break; 819 break;
834 820
835 case ACTION_WPS_BROWSE: 821 case ACTION_WPS_BROWSE:
836#ifdef HAVE_LCD_CHARCELLS
837 status_set_record(false);
838 status_set_audio(false);
839#endif
840 gwps_leave_wps(); 822 gwps_leave_wps();
841 return GO_TO_PREVIOUS_BROWSER; 823 return GO_TO_PREVIOUS_BROWSER;
842 break; 824 break;
@@ -1146,10 +1128,6 @@ long gui_wps_show(void)
1146 } 1128 }
1147 1129
1148 if (exit) { 1130 if (exit) {
1149#ifdef HAVE_LCD_CHARCELLS
1150 status_set_record(false);
1151 status_set_audio(false);
1152#endif
1153#if CONFIG_CODEC != SWCODEC 1131#if CONFIG_CODEC != SWCODEC
1154 if (global_settings.fade_on_stop) 1132 if (global_settings.fade_on_stop)
1155 fade(false, true); 1133 fade(false, true);
diff --git a/apps/gui/yesno.c b/apps/gui/yesno.c
index b754d5e477..45638b7076 100644
--- a/apps/gui/yesno.c
+++ b/apps/gui/yesno.c
@@ -160,12 +160,7 @@ enum yesno_res gui_syncyesno_run(const struct text_message * main_message,
160 yn[i].result_message[YESNO_NO]=no_message; 160 yn[i].result_message[YESNO_NO]=no_message;
161 yn[i].display=&screens[i]; 161 yn[i].display=&screens[i];
162 yn[i].vp = &vp[i]; 162 yn[i].vp = &vp[i];
163#ifdef HAVE_LCD_CHARCELLS
164 /* Quick fix. Viewports should really be enabled proper for charcell */
165 viewport_set_defaults(yn[i].vp, i);
166#else
167 viewportmanager_theme_enable(i, true, yn[i].vp); 163 viewportmanager_theme_enable(i, true, yn[i].vp);
168#endif
169 screens[i].scroll_stop(); 164 screens[i].scroll_stop();
170 gui_yesno_draw(&(yn[i])); 165 gui_yesno_draw(&(yn[i]));
171 } 166 }