summaryrefslogtreecommitdiff
path: root/apps
diff options
context:
space:
mode:
authorDave Chapman <dave@dchapman.com>2006-10-12 20:45:31 +0000
committerDave Chapman <dave@dchapman.com>2006-10-12 20:45:31 +0000
commitfc865cb5a85d2c465159b64e459fbf4e02a8e987 (patch)
treeed764aba712679e22b782535db26db8af3276de9 /apps
parent00d218257be50f7f572deeed49f2ba9b2e235834 (diff)
downloadrockbox-fc865cb5a85d2c465159b64e459fbf4e02a8e987.tar.gz
rockbox-fc865cb5a85d2c465159b64e459fbf4e02a8e987.zip
Revert change to screen_access.c (adding the native-bitmap drawing function) that caused warnings on the H3x0. We now draw the USB logo using the normal lcd_bitmap() and lcd_remote_bitmap() functions instead of the screens API, which doesn't handle the differing bitmaps types well. Remove apps/gui/logo.[ch] as they are now longer used.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@11208 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps')
-rw-r--r--apps/SOURCES1
-rw-r--r--apps/gui/logo.c63
-rw-r--r--apps/gui/logo.h43
-rw-r--r--apps/screen_access.c9
-rw-r--r--apps/screens.c38
5 files changed, 35 insertions, 119 deletions
diff --git a/apps/SOURCES b/apps/SOURCES
index 77f86e50bf..dccb6f95ac 100644
--- a/apps/SOURCES
+++ b/apps/SOURCES
@@ -36,7 +36,6 @@ gui/gwps.c
36gui/gwps-common.c 36gui/gwps-common.c
37gui/icon.c 37gui/icon.c
38gui/list.c 38gui/list.c
39gui/logo.c
40gui/option_select.c 39gui/option_select.c
41gui/quickscreen.c 40gui/quickscreen.c
42gui/scrollbar.c 41gui/scrollbar.c
diff --git a/apps/gui/logo.c b/apps/gui/logo.c
deleted file mode 100644
index f1a4786137..0000000000
--- a/apps/gui/logo.c
+++ /dev/null
@@ -1,63 +0,0 @@
1/***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
9 *
10 * Copyright (C) 2002 Björn Stenberg
11 *
12 * All files in this archive are subject to the GNU General Public License.
13 * See the file COPYING in the source tree root for full license agreement.
14 *
15 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
16 * KIND, either express or implied.
17 *
18 ****************************************************************************/
19
20#include "logo.h"
21
22#ifdef HAVE_LCD_BITMAP
23
24#include <bitmaps/usblogo.h>
25#if NB_SCREENS==2
26#include <bitmaps/remote_usblogo.h>
27#endif
28
29struct logo usb_logos[]=
30{
31 [SCREEN_MAIN]={usblogo, BMPWIDTH_usblogo, BMPHEIGHT_usblogo},
32#if NB_SCREENS==2
33 [SCREEN_REMOTE]={remote_usblogo, BMPWIDTH_remote_usblogo, BMPHEIGHT_remote_usblogo}
34#endif
35
36};
37#else
38struct logo usb_logos[]=
39{
40 [SCREEN_MAIN]={"[USB Mode]"}
41};
42#endif
43
44void gui_logo_draw(struct logo * logo, struct screen * display)
45{
46 display->clear_display();
47
48#ifdef HAVE_LCD_BITMAP
49 /* Center bitmap on screen */
50 display->bitmap(logo->bitmap,
51 display->width/2-logo->width/2,
52 display->height/2-logo->height/2,
53 logo->width,
54 logo->height);
55 display->update();
56#else
57 display->double_height(false);
58 display->puts_scroll(0, 0, logo->text);
59#ifdef SIMULATOR
60 display->update();
61#endif /* SIMULATOR */
62#endif /* HAVE_LCD_BITMAP */
63}
diff --git a/apps/gui/logo.h b/apps/gui/logo.h
deleted file mode 100644
index 6bd6e20b19..0000000000
--- a/apps/gui/logo.h
+++ /dev/null
@@ -1,43 +0,0 @@
1/***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
9 *
10 * Copyright (C) 2005 by Kevin Ferrare
11 *
12 * All files in this archive are subject to the GNU General Public License.
13 * See the file COPYING in the source tree root for full license agreement.
14 *
15 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
16 * KIND, either express or implied.
17 *
18 ****************************************************************************/
19
20#ifndef _GUI_LOGO_H_
21#define _GUI_LOGO_H_
22#include "screen_access.h"
23
24struct logo{
25#ifdef HAVE_LCD_BITMAP
26 const fb_data* bitmap;
27 int width;
28 int height;
29#else
30 const char * text;
31#endif
32};
33
34extern struct logo usb_logos[];
35
36/*
37 * Draws the given logo at the center of the given screen
38 * - logo : the logo
39 * - display : the screen to draw on
40 */
41void gui_logo_draw(struct logo * logo, struct screen * display);
42
43#endif /* _GUI_LOGO_H_ */
diff --git a/apps/screen_access.c b/apps/screen_access.c
index cac0b862ca..704cab1a37 100644
--- a/apps/screen_access.c
+++ b/apps/screen_access.c
@@ -54,12 +54,7 @@ void screen_init(struct screen * screen, enum screen_type screen_type)
54 screen->mono_bitmap=&lcd_remote_mono_bitmap; 54 screen->mono_bitmap=&lcd_remote_mono_bitmap;
55 screen->mono_bitmap_part=&lcd_remote_mono_bitmap_part; 55 screen->mono_bitmap_part=&lcd_remote_mono_bitmap_part;
56 screen->set_drawmode=&lcd_remote_set_drawmode; 56 screen->set_drawmode=&lcd_remote_set_drawmode;
57#if LCD_REMOTE_DEPTH == 1 57#if LCD_REMOTE_DEPTH > 1
58 screen->bitmap=&lcd_remote_mono_bitmap;
59 screen->bitmap_part=&lcd_remote_mono_bitmap_part;
60#else
61 screen->bitmap=&lcd_remote_bitmap;
62 screen->bitmap_part=&lcd_remote_bitmap_part;
63 screen->get_background=&lcd_remote_get_background; 58 screen->get_background=&lcd_remote_get_background;
64 screen->get_foreground=&lcd_remote_get_foreground; 59 screen->get_foreground=&lcd_remote_get_foreground;
65 screen->set_background=&lcd_remote_set_background; 60 screen->set_background=&lcd_remote_set_background;
@@ -131,9 +126,9 @@ void screen_init(struct screen * screen, enum screen_type screen_type)
131 screen->mono_bitmap=&lcd_mono_bitmap; 126 screen->mono_bitmap=&lcd_mono_bitmap;
132 screen->mono_bitmap_part=&lcd_mono_bitmap_part; 127 screen->mono_bitmap_part=&lcd_mono_bitmap_part;
133 screen->set_drawmode=&lcd_set_drawmode; 128 screen->set_drawmode=&lcd_set_drawmode;
129#if LCD_DEPTH > 1
134 screen->bitmap=&lcd_bitmap; 130 screen->bitmap=&lcd_bitmap;
135 screen->bitmap_part=&lcd_bitmap_part; 131 screen->bitmap_part=&lcd_bitmap_part;
136#if LCD_DEPTH > 1
137#if LCD_DEPTH == 2 132#if LCD_DEPTH == 2
138 /* No transparency yet for grayscale lcd */ 133 /* No transparency yet for grayscale lcd */
139 screen->transparent_bitmap=&lcd_bitmap; 134 screen->transparent_bitmap=&lcd_bitmap;
diff --git a/apps/screens.c b/apps/screens.c
index b27dae1916..811b0b3df0 100644
--- a/apps/screens.c
+++ b/apps/screens.c
@@ -23,6 +23,9 @@
23#include "backlight.h" 23#include "backlight.h"
24#include "action.h" 24#include "action.h"
25#include "lcd.h" 25#include "lcd.h"
26#ifdef HAVE_REMOTE_LCD
27#include "lcd-remote.h"
28#endif
26#include "lang.h" 29#include "lang.h"
27#include "icons.h" 30#include "icons.h"
28#include "font.h" 31#include "font.h"
@@ -51,10 +54,17 @@
51#include "statusbar.h" 54#include "statusbar.h"
52#include "screen_access.h" 55#include "screen_access.h"
53#include "quickscreen.h" 56#include "quickscreen.h"
54#include "logo.h"
55#include "pcmbuf.h" 57#include "pcmbuf.h"
56#include "list.h" 58#include "list.h"
57 59
60#ifdef HAVE_LCD_BITMAP
61#include <bitmaps/usblogo.h>
62#endif
63
64#ifdef HAVE_REMOTE_LCD
65#include <bitmaps/remote_usblogo.h>
66#endif
67
58#if defined(HAVE_LCD_BITMAP) 68#if defined(HAVE_LCD_BITMAP)
59#include "widgets.h" 69#include "widgets.h"
60#endif 70#endif
@@ -82,15 +92,33 @@ void usb_screen(void)
82#ifdef HAVE_LCD_COLOR 92#ifdef HAVE_LCD_COLOR
83 show_main_backdrop(); 93 show_main_backdrop();
84#endif 94#endif
85 FOR_NB_SCREENS(i) { 95
96 FOR_NB_SCREENS(i)
86 screens[i].backlight_on(); 97 screens[i].backlight_on();
87 gui_logo_draw(&usb_logos[i], &screens[i]); 98
88 } 99#ifdef HAVE_REMOTE_LCD
89#ifdef HAVE_LCD_CHARCELLS 100 lcd_remote_clear_display();
101 lcd_remote_bitmap(remote_usblogo,
102 (LCD_REMOTE_WIDTH-BMPWIDTH_remote_usblogo)/2,
103 (LCD_REMOTE_HEIGHT-BMPHEIGHT_remote_usblogo)/2,
104 BMPWIDTH_remote_usblogo, BMPHEIGHT_remote_usblogo);
105 lcd_remote_update();
106#endif
107
108#ifdef HAVE_LCD_BITMAP
109 lcd_clear_display();
110 lcd_bitmap(usblogo, (LCD_WIDTH-BMPWIDTH_usblogo)/2,
111 (LCD_HEIGHT-BMPHEIGHT_usblogo)/2,
112 BMPWIDTH_usblogo, BMPHEIGHT_usblogo);
113 lcd_update();
114#else
115 lcd_double_height(false);
116 lcd_puts_scroll(0, 0, "[USB Mode]");
90 status_set_param(false); 117 status_set_param(false);
91 status_set_audio(false); 118 status_set_audio(false);
92 status_set_usb(true); 119 status_set_usb(true);
93#endif /* HAVE_LCD_BITMAP */ 120#endif /* HAVE_LCD_BITMAP */
121
94 gui_syncstatusbar_draw(&statusbars, true); 122 gui_syncstatusbar_draw(&statusbars, true);
95#ifdef SIMULATOR 123#ifdef SIMULATOR
96 while (button_get(true) & BUTTON_REL); 124 while (button_get(true) & BUTTON_REL);