From f57d0220dd216937a210a18f8ab8394091bb6a08 Mon Sep 17 00:00:00 2001 From: Kevin Ferrare Date: Tue, 22 Nov 2005 21:55:05 +0000 Subject: Adapted and commited Markus Kaufhold's remote hold icon on statusbar patch for iriver ; generic logo handler (now it's possible to have a different USB logo on main screen and on remote), made the quickscreen behave as it was before git-svn-id: svn://svn.rockbox.org/rockbox/trunk@8044 a1c6a512-1295-4272-9138-f99709370657 --- apps/SOURCES | 1 + apps/gui/gwps.c | 4 +-- apps/gui/logo.c | 94 ++++++++++++++++++++++++++++++++++++++++++++++++++ apps/gui/logo.h | 43 +++++++++++++++++++++++ apps/gui/quickscreen.c | 28 +++++++++------ apps/gui/quickscreen.h | 11 +++--- apps/gui/statusbar.c | 61 ++++++++++++++++++++++++-------- apps/gui/statusbar.h | 5 +++ apps/recorder/icons.c | 6 ++-- apps/recorder/icons.h | 14 ++++---- apps/screens.c | 70 ++++--------------------------------- apps/screens.h | 4 +-- apps/tree.c | 4 +-- 13 files changed, 236 insertions(+), 109 deletions(-) create mode 100644 apps/gui/logo.c create mode 100644 apps/gui/logo.h (limited to 'apps') diff --git a/apps/SOURCES b/apps/SOURCES index c4eee62714..c811dd2757 100644 --- a/apps/SOURCES +++ b/apps/SOURCES @@ -36,6 +36,7 @@ gui/gwps.c gui/gwps-common.c gui/icon.c gui/list.c +gui/logo.c gui/option_select.c gui/quickscreen.c gui/scrollbar.c diff --git a/apps/gui/gwps.c b/apps/gui/gwps.c index 52340e6547..aec3a1401d 100644 --- a/apps/gui/gwps.c +++ b/apps/gui/gwps.c @@ -509,7 +509,7 @@ long gui_wps_show(void) #ifdef WPS_RC_QUICK case WPS_RC_QUICK: #endif - if (quick_screen_quick()) + if (quick_screen_quick(button)) return SYS_USB_CONNECTED; restore = true; lastbutton = 0; @@ -518,7 +518,7 @@ long gui_wps_show(void) /* screen settings */ #ifdef BUTTON_F3 case BUTTON_F3: - if (quick_screen_f3()) + if (quick_screen_f3(button)) return SYS_USB_CONNECTED; restore = true; break; diff --git a/apps/gui/logo.c b/apps/gui/logo.c new file mode 100644 index 0000000000..9e2945a216 --- /dev/null +++ b/apps/gui/logo.c @@ -0,0 +1,94 @@ +/*************************************************************************** + * __________ __ ___. + * Open \______ \ ____ ____ | | _\_ |__ _______ ___ + * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / + * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < + * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ + * \/ \/ \/ \/ \/ + * $Id$ + * + * Copyright (C) 2002 Björn Stenberg + * + * All files in this archive are subject to the GNU General Public License. + * See the file COPYING in the source tree root for full license agreement. + * + * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY + * KIND, either express or implied. + * + ****************************************************************************/ + +#include "logo.h" + +#ifdef HAVE_LCD_BITMAP +#define BMPHEIGHT_usb_logo_main 32 +#define BMPWIDTH_usb_logo_main 100 +static const unsigned char usb_logo_main[] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x40, 0x20, 0x10, 0x08, + 0x04, 0x04, 0x02, 0x02, 0x02, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x81, 0x81, 0x81, 0x81, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x01, 0x01, 0xf1, 0x4f, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, + 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0xc0, + 0x00, 0x00, 0xe0, 0x1c, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, + 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, + 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x06, 0x81, 0xc0, 0xe0, 0xe0, 0xe0, 0xe0, + 0xc0, 0x80, 0x00, 0x00, 0x00, 0x00, 0x80, 0xc0, 0xe0, 0x70, 0x38, 0x1c, 0x1c, + 0x0c, 0x0e, 0x0e, 0x06, 0x06, 0x06, 0x06, 0x06, 0x0f, 0x1f, 0x1f, 0x1f, 0x1f, + 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xc0, 0xc0, 0x80, 0x80, 0x00, 0x00, + 0x00, 0x00, 0xe0, 0x1f, 0x00, 0xf8, 0x06, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, + 0x02, 0x02, 0x02, 0x82, 0x7e, 0x00, 0xc0, 0x3e, 0x01, + 0x70, 0x4f, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, + 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, + 0x40, 0x40, 0x40, 0x40, 0x40, 0x80, 0x00, 0x07, 0x0f, 0x1f, 0x1f, 0x1f, 0x1f, + 0x0f, 0x07, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x07, 0x0f, + 0x1f, 0x3f, 0x7b, 0xf3, 0xe3, 0xc3, 0x83, 0x83, 0x83, 0x83, 0xe3, 0xe3, 0xe3, + 0xe3, 0xe3, 0xe3, 0x03, 0x03, 0x03, 0x3f, 0x1f, 0x1f, 0x0f, 0x0f, 0x07, 0x02, + 0xc0, 0x3e, 0x01, 0xe0, 0x9f, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, + 0x80, 0x80, 0xf0, 0x0f, 0x80, 0x78, 0x07, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x0c, 0x10, 0x20, 0x40, 0x40, 0x80, 0x80, + 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, + 0x80, 0x80, 0x80, 0x80, 0x80, 0x81, 0x81, 0x81, 0x81, 0x81, 0x87, 0x87, 0x87, + 0x87, 0x87, 0x87, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0xf0, + 0x0f, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, + 0x04, 0x04, 0x04, 0x04, 0x07, 0x00, 0x00, 0x00, 0x00, +}; + +struct logo usb_logos[]= +{ + [SCREEN_MAIN]={usb_logo_main, BMPWIDTH_usb_logo_main, BMPHEIGHT_usb_logo_main}, +#if NB_SCREENS==2 + [SCREEN_REMOTE]={usb_logo_main, BMPWIDTH_usb_logo_main, BMPHEIGHT_usb_logo_main} +#endif + +}; +#else +struct logo usb_logos[]= +{ + [SCREEN_MAIN]={"[USB Mode]"} +}; +#endif + +void gui_logo_draw(struct logo * logo, struct screen * display) +{ + display->clear_display(); + +#ifdef HAVE_LCD_BITMAP + /* Center bitmap on screen */ + display->mono_bitmap(logo->bitmap, + display->width/2-logo->width/2, + display->height/2-logo->height/2, + logo->width, + logo->height); + display->update(); +#else + display->double_height(false); + display->puts_scroll(0, 0, logo->text); +#ifdef SIMULATOR + display->update(); +#endif /* SIMULATOR */ +#endif /* HAVE_LCD_BITMAP */ +} diff --git a/apps/gui/logo.h b/apps/gui/logo.h new file mode 100644 index 0000000000..38eafeaef2 --- /dev/null +++ b/apps/gui/logo.h @@ -0,0 +1,43 @@ +/*************************************************************************** + * __________ __ ___. + * Open \______ \ ____ ____ | | _\_ |__ _______ ___ + * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / + * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < + * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ + * \/ \/ \/ \/ \/ + * $Id$ + * + * Copyright (C) 2005 by Kevin Ferrare + * + * All files in this archive are subject to the GNU General Public License. + * See the file COPYING in the source tree root for full license agreement. + * + * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY + * KIND, either express or implied. + * + ****************************************************************************/ + +#ifndef _GUI_LOGO_H_ +#define _GUI_LOGO_H_ +#include "screen_access.h" + +struct logo{ +#ifdef HAVE_LCD_BITMAP + const unsigned char * bitmap; + int width; + int height; +#else + const char * text; +#endif +}; + +extern struct logo usb_logos[]; + +/* + * Draws the given logo at the center of the given screen + * - logo : the logo + * - display : the screen to draw on + */ +void gui_logo_draw(struct logo * logo, struct screen * display); + +#endif /* _GUI_LOGO_H_ */ diff --git a/apps/gui/quickscreen.c b/apps/gui/quickscreen.c index a11107cb51..7d94d4a0dc 100644 --- a/apps/gui/quickscreen.c +++ b/apps/gui/quickscreen.c @@ -51,6 +51,7 @@ void gui_quickscreen_draw(struct gui_quickscreen * qs, struct screen * display) display->has_buttonbar=false; #endif gui_textarea_clear(display); + display->setfont(FONT_SYSFIXED); display->getstringsize("M",&w,&h); /* Displays the icons */ display->mono_bitmap(bitmap_icons_7x8[Icon_FastBackward], @@ -62,7 +63,6 @@ void gui_quickscreen_draw(struct gui_quickscreen * qs, struct screen * display) display->mono_bitmap(bitmap_icons_7x8[Icon_FastForward], display->width/2 + 8, display->height/2 - 4, 7, 8); - display->setfont(FONT_SYSFIXED); /* Displays the left's text */ title=option_select_get_title(qs->left_option); @@ -90,7 +90,7 @@ void gui_quickscreen_draw(struct gui_quickscreen * qs, struct screen * display) display->putsxy(display->width - w, display->height/2, option); gui_textarea_update(display); - lcd_setfont(FONT_UI); + display->setfont(FONT_UI); } void gui_syncquickscreen_draw(struct gui_quickscreen * qs) @@ -102,6 +102,7 @@ void gui_syncquickscreen_draw(struct gui_quickscreen * qs) bool gui_quickscreen_do_button(struct gui_quickscreen * qs, int button) { + switch(button) { case QUICKSCREEN_LEFT : @@ -143,24 +144,32 @@ bool gui_quickscreen_do_button(struct gui_quickscreen * qs, int button) return(false); } -bool gui_syncquickscreen_run(struct gui_quickscreen * qs) +bool gui_syncquickscreen_run(struct gui_quickscreen * qs, int button_enter) { int key; + /* To quit we need either : + * - a second press on the button that made us enter + * - an action taken while pressing the enter button, + * then release the enter button*/ + bool can_quit=false; gui_syncquickscreen_draw(qs); while (true) { key = button_get(true); - if(default_event_handler(key) == SYS_USB_CONNECTED) + if(default_event_handler(key & ~button_enter) == SYS_USB_CONNECTED) return(true); - if(gui_quickscreen_do_button(qs, key)) + if(gui_quickscreen_do_button(qs, key & ~button_enter)) { + can_quit=true; if(qs->callback) qs->callback(qs); gui_syncquickscreen_draw(qs); } - else if(key==QUICKSCREEN_QUIT + else if(key==button_enter) + can_quit=true; + if(key==(button_enter | BUTTON_REL) && can_quit) + return(false); #ifdef QUICKSCREEN_QUIT - || key==QUICKSCREEN_QUIT -#endif + if(key==QUICKSCREEN_QUIT #ifdef QUICKSCREEN_QUIT2 || key==QUICKSCREEN_QUIT2 #endif @@ -168,9 +177,8 @@ bool gui_syncquickscreen_run(struct gui_quickscreen * qs) || key==QUICKSCREEN_RC_QUIT #endif ) - { return(false); - } +#endif /* QUICKSCREEN_QUIT */ gui_syncstatusbar_draw(&statusbars, false); } } diff --git a/apps/gui/quickscreen.h b/apps/gui/quickscreen.h index 09a0390d93..fdbe4db386 100644 --- a/apps/gui/quickscreen.h +++ b/apps/gui/quickscreen.h @@ -34,10 +34,8 @@ #define QUICKSCREEN_BOTTOM_INV BUTTON_UP #define QUICKSCREEN_RIGHT BUTTON_RIGHT -#if CONFIG_KEYPAD == RECORDER_PAD -#define QUICKSCREEN_QUIT BUTTON_F2 -#define QUICKSCREEN_QUIT2 BUTTON_F3 -#elif (CONFIG_KEYPAD == IRIVER_H100_PAD) || (CONFIG_KEYPAD == IRIVER_H300_PAD) + +#if (CONFIG_KEYPAD == IRIVER_H100_PAD) || (CONFIG_KEYPAD == IRIVER_H300_PAD) #define QUICKSCREEN_QUIT BUTTON_MODE #define QUICKSCREEN_QUIT2 BUTTON_OFF #define QUICKSCREEN_RC_QUIT BUTTON_RC_MODE @@ -104,11 +102,12 @@ bool gui_quickscreen_do_button(struct gui_quickscreen * qs, int button); void gui_syncquickscreen_draw(struct gui_quickscreen * qs); /* - * Runs the quickscreen on all available screens + * Runs the quickscreen on all available screens, if button_enter is released, quits * - qs : the quickscreen + * - button_enter : button pressed at the same time the quickscreen is displayed * returns : true if usb was connected, false otherwise */ -bool gui_syncquickscreen_run(struct gui_quickscreen * qs); +bool gui_syncquickscreen_run(struct gui_quickscreen * qs, int button_enter); #endif /*_GUI_QUICK_SCREEN_H_*/ #endif /* CONFIG_KEYPAD */ diff --git a/apps/gui/statusbar.c b/apps/gui/statusbar.c index eec031fa93..945013e4b9 100644 --- a/apps/gui/statusbar.c +++ b/apps/gui/statusbar.c @@ -40,27 +40,30 @@ /* FIXME: should be removed from icon.h to avoid redefinition, but still needed for compatibility with old system */ - -#define STATUSBAR_BATTERY_X_POS 0 +#define ICONS_SPACING 2 +#define STATUSBAR_BATTERY_X_POS 0*ICONS_SPACING #define STATUSBAR_BATTERY_WIDTH 18 #define STATUSBAR_PLUG_X_POS STATUSBAR_X_POS + \ - STATUSBAR_BATTERY_WIDTH +2 + STATUSBAR_BATTERY_WIDTH + \ + ICONS_SPACING #define STATUSBAR_PLUG_WIDTH 7 #define STATUSBAR_VOLUME_X_POS STATUSBAR_X_POS + \ STATUSBAR_BATTERY_WIDTH + \ - STATUSBAR_PLUG_WIDTH +2+2 + STATUSBAR_PLUG_WIDTH + \ + 2*ICONS_SPACING #define STATUSBAR_VOLUME_WIDTH 16 #define STATUSBAR_PLAY_STATE_X_POS STATUSBAR_X_POS + \ STATUSBAR_BATTERY_WIDTH + \ STATUSBAR_PLUG_WIDTH + \ - STATUSBAR_VOLUME_WIDTH+2+2+2 + STATUSBAR_VOLUME_WIDTH + \ + 3*ICONS_SPACING #define STATUSBAR_PLAY_STATE_WIDTH 7 #define STATUSBAR_PLAY_MODE_X_POS STATUSBAR_X_POS + \ STATUSBAR_BATTERY_WIDTH + \ STATUSBAR_PLUG_WIDTH + \ STATUSBAR_VOLUME_WIDTH + \ STATUSBAR_PLAY_STATE_WIDTH + \ - 2+2+2+2 + 4*ICONS_SPACING #define STATUSBAR_PLAY_MODE_WIDTH 7 #define STATUSBAR_SHUFFLE_X_POS STATUSBAR_X_POS + \ STATUSBAR_BATTERY_WIDTH + \ @@ -68,17 +71,28 @@ STATUSBAR_VOLUME_WIDTH + \ STATUSBAR_PLAY_STATE_WIDTH + \ STATUSBAR_PLAY_MODE_WIDTH + \ - 2+2+2+2+2 + 5*ICONS_SPACING #define STATUSBAR_SHUFFLE_WIDTH 7 -#define STATUSBAR_LOCK_X_POS STATUSBAR_X_POS + \ +#define STATUSBAR_LOCKM_X_POS STATUSBAR_X_POS + \ + STATUSBAR_BATTERY_WIDTH + \ + STATUSBAR_PLUG_WIDTH + \ + STATUSBAR_VOLUME_WIDTH + \ + STATUSBAR_PLAY_STATE_WIDTH + \ + STATUSBAR_PLAY_MODE_WIDTH + \ + STATUSBAR_SHUFFLE_WIDTH + \ + 6*ICONS_SPACING +#define STATUSBAR_LOCKM_WIDTH 5 +#define STATUSBAR_LOCKR_X_POS STATUSBAR_X_POS + \ STATUSBAR_BATTERY_WIDTH + \ STATUSBAR_PLUG_WIDTH + \ STATUSBAR_VOLUME_WIDTH + \ STATUSBAR_PLAY_STATE_WIDTH + \ STATUSBAR_PLAY_MODE_WIDTH + \ STATUSBAR_SHUFFLE_WIDTH + \ - 2+2+2+2+2+2 -#define STATUSBAR_LOCK_WIDTH 5 + STATUSBAR_LOCKM_WIDTH + \ + 7*ICONS_SPACING +#define STATUSBAR_LOCKR_WIDTH 5 + #define STATUSBAR_DISK_WIDTH 12 #define STATUSBAR_DISK_X_POS(statusbar_width) statusbar_width - \ STATUSBAR_DISK_WIDTH @@ -98,7 +112,6 @@ void gui_statusbar_init(struct gui_statusbar * bar) void gui_statusbar_draw(struct gui_statusbar * bar, bool force_redraw) { struct screen * display = bar->display; - #ifdef HAVE_RTC struct tm* tm; /* For Time */ #endif /* HAVE_RTC */ @@ -120,11 +133,14 @@ void gui_statusbar_draw(struct gui_statusbar * bar, bool force_redraw) #endif /* HAVE_RTC */ bar->info.shuffle = global_settings.playlist_shuffle; -#if CONFIG_KEYPAD == IRIVER_H100_PAD +#ifdef HAS_BUTTON_HOLD bar->info.keylock = button_hold(); #else bar->info.keylock = keys_locked; -#endif /* CONFIG_KEYPAD == IRIVER_H100_PAD */ +#endif /* HAS_BUTTON_HOLD */ +#ifdef HAS_REMOTE_BUTTON_HOLD + bar->info.keylockremote = remote_button_hold(); +#endif bar->info.repeat = global_settings.repeat_mode; bar->info.playmode = current_playmode(); if(!display->has_disk_led) @@ -235,6 +251,10 @@ void gui_statusbar_draw(struct gui_statusbar * bar, bool force_redraw) gui_statusbar_icon_shuffle(display); if (bar->info.keylock) gui_statusbar_icon_lock(display); +#ifdef HAS_REMOTE_BUTTON_HOLD + if (bar->info.keylockremote) + gui_statusbar_icon_lock_remote(display); +#endif #ifdef HAVE_RTC gui_statusbar_time(display, bar->info.hour, bar->info.minute); #endif /* HAVE_RTC */ @@ -430,8 +450,19 @@ void gui_statusbar_icon_shuffle(struct screen * display) */ void gui_statusbar_icon_lock(struct screen * display) { - display->mono_bitmap(bitmap_icons_5x8[Icon_Lock], STATUSBAR_LOCK_X_POS, - STATUSBAR_Y_POS, 5, 8); + display->mono_bitmap(bitmap_icons_5x8[Icon_Lock_Main], + STATUSBAR_LOCKM_X_POS, STATUSBAR_Y_POS, + STATUSBAR_LOCKM_WIDTH, STATUSBAR_HEIGHT); +} + +/* + * Print remote lock when remote hold is enabled + */ +void gui_statusbar_icon_lock_remote(struct screen * display) +{ + display->mono_bitmap(bitmap_icons_5x8[Icon_Lock_Remote], + STATUSBAR_LOCKR_X_POS, STATUSBAR_Y_POS, + STATUSBAR_LOCKR_WIDTH, STATUSBAR_HEIGHT); } /* diff --git a/apps/gui/statusbar.h b/apps/gui/statusbar.h index 816205e2b4..88dfd4c4a2 100644 --- a/apps/gui/statusbar.h +++ b/apps/gui/statusbar.h @@ -23,6 +23,7 @@ #include "config.h" #include "status.h" #include "screen_access.h" +#include "button.h" #define STATUSBAR_X_POS 0 #define STATUSBAR_Y_POS 0 /* MUST be a multiple of 8 */ @@ -40,6 +41,9 @@ struct status_info { bool inserted; bool shuffle; bool keylock; +#ifdef HAS_REMOTE_BUTTON_HOLD + bool keylockremote; +#endif bool battery_safe; bool redraw_volume; /* true if the volume gauge needs updating */ bool led; /* disk LED simulation in the status bar */ @@ -101,6 +105,7 @@ void gui_statusbar_icon_play_state(struct screen * display, int state); void gui_statusbar_icon_play_mode(struct screen * display, int mode); void gui_statusbar_icon_shuffle(struct screen * display); void gui_statusbar_icon_lock(struct screen * display); +void gui_statusbar_icon_lock_remote(struct screen * display); void gui_statusbar_led(struct screen * display); diff --git a/apps/recorder/icons.c b/apps/recorder/icons.c index 1306a1d770..68985c2028 100644 --- a/apps/recorder/icons.c +++ b/apps/recorder/icons.c @@ -30,11 +30,11 @@ const unsigned char bitmap_icons_5x8[][5] = { - /* Lock */ - {0x78,0x7f,0x49,0x7f,0x78} + [Icon_Lock_Main] ={0x78,0x7f,0x49,0x7f,0x78}, /* Lock Main */ + [Icon_Lock_Remote]={0x78,0x7f,0x49,0x7f,0x78} /* Lock Remote */ }; -const unsigned char bitmap_icons_6x8[LastIcon][6] = +const unsigned char bitmap_icons_6x8[][6] = { { 0x60, 0x7f, 0x03, 0x33, 0x3f, 0x00 }, /* Musical note */ { 0x7e, 0x41, 0x41, 0x42, 0x7e, 0x00 }, /* Folder */ diff --git a/apps/recorder/icons.h b/apps/recorder/icons.h index c996fd92aa..a21b801cb9 100644 --- a/apps/recorder/icons.h +++ b/apps/recorder/icons.h @@ -29,7 +29,9 @@ /* Symbolic names for icons */ enum icons_5x8 { - Icon_Lock + Icon_Lock_Main, + Icon_Lock_Remote, + Icon5x8Last }; enum icons_6x8 { @@ -46,7 +48,7 @@ enum icons_6x8 { Icon_Bookmark, Icon_Queued, Icon_Moving, - LastIcon + Icon6x8Last }; enum icons_7x8 { @@ -68,12 +70,12 @@ enum icons_7x8 { Icon_DownArrow, Icon_UpArrow, Icon_RepeatAB, - Icon_Last + Icon7x8Last }; -extern const unsigned char bitmap_icons_5x8[1][5]; -extern const unsigned char bitmap_icons_6x8[LastIcon][6]; -extern const unsigned char bitmap_icons_7x8[Icon_Last][7]; +extern const unsigned char bitmap_icons_5x8[Icon5x8Last][5]; +extern const unsigned char bitmap_icons_6x8[Icon6x8Last][6]; +extern const unsigned char bitmap_icons_7x8[Icon7x8Last][7]; extern const unsigned char bitmap_icon_disk[]; #if LCD_WIDTH == 112 || LCD_WIDTH == 128 || (defined(HAVE_REMOTE_LCD) && LCD_REMOTE_WIDTH == 128) 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 @@ * KIND, either express or implied. * ****************************************************************************/ + #include #include #include @@ -51,6 +52,7 @@ #include "statusbar.h" #include "screen_access.h" #include "quickscreen.h" +#include "logo.h" #if defined(HAVE_LCD_BITMAP) #include "widgets.h" @@ -64,66 +66,8 @@ #ifdef HAVE_LCD_BITMAP #define SCROLLBAR_WIDTH 6 - -#define BMPHEIGHT_usb_logo 32 -#define BMPWIDTH_usb_logo 100 -static const unsigned char usb_logo[] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x40, 0x20, 0x10, 0x08, - 0x04, 0x04, 0x02, 0x02, 0x02, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, - 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x81, 0x81, 0x81, 0x81, - 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, - 0x01, 0x01, 0x01, 0x01, 0xf1, 0x4f, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, - 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0xc0, - 0x00, 0x00, 0xe0, 0x1c, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, - 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, - 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x06, 0x81, 0xc0, 0xe0, 0xe0, 0xe0, 0xe0, - 0xc0, 0x80, 0x00, 0x00, 0x00, 0x00, 0x80, 0xc0, 0xe0, 0x70, 0x38, 0x1c, 0x1c, - 0x0c, 0x0e, 0x0e, 0x06, 0x06, 0x06, 0x06, 0x06, 0x0f, 0x1f, 0x1f, 0x1f, 0x1f, - 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xc0, 0xc0, 0x80, 0x80, 0x00, 0x00, - 0x00, 0x00, 0xe0, 0x1f, 0x00, 0xf8, 0x06, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, - 0x02, 0x02, 0x02, 0x82, 0x7e, 0x00, 0xc0, 0x3e, 0x01, - 0x70, 0x4f, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, - 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, - 0x40, 0x40, 0x40, 0x40, 0x40, 0x80, 0x00, 0x07, 0x0f, 0x1f, 0x1f, 0x1f, 0x1f, - 0x0f, 0x07, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x07, 0x0f, - 0x1f, 0x3f, 0x7b, 0xf3, 0xe3, 0xc3, 0x83, 0x83, 0x83, 0x83, 0xe3, 0xe3, 0xe3, - 0xe3, 0xe3, 0xe3, 0x03, 0x03, 0x03, 0x3f, 0x1f, 0x1f, 0x0f, 0x0f, 0x07, 0x02, - 0xc0, 0x3e, 0x01, 0xe0, 0x9f, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, - 0x80, 0x80, 0xf0, 0x0f, 0x80, 0x78, 0x07, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x0c, 0x10, 0x20, 0x40, 0x40, 0x80, 0x80, - 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, - 0x80, 0x80, 0x80, 0x80, 0x80, 0x81, 0x81, 0x81, 0x81, 0x81, 0x87, 0x87, 0x87, - 0x87, 0x87, 0x87, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0xf0, - 0x0f, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, - 0x04, 0x04, 0x04, 0x04, 0x07, 0x00, 0x00, 0x00, 0x00, -}; #endif -void usb_display_info(struct screen * display) -{ - display->clear_display(); - -#ifdef HAVE_LCD_BITMAP - /* Center bitmap on screen */ - display->mono_bitmap(usb_logo, - display->width/2-BMPWIDTH_usb_logo/2, - display->height/2-BMPHEIGHT_usb_logo/2, - BMPWIDTH_usb_logo, - BMPHEIGHT_usb_logo); - display->update(); -#else - display->double_height(false); - display->puts(0, 0, "[USB Mode]"); -#ifdef SIMULATOR - display->update(); -#endif /* SIMULATOR */ -#endif /* HAVE_LCD_BITMAP */ -} - void usb_screen(void) { #ifdef USB_NONE @@ -132,7 +76,7 @@ void usb_screen(void) int i; FOR_NB_SCREENS(i) { screens[i].backlight_on(); - usb_display_info(&screens[i]); + gui_logo_draw(&usb_logos[i], &screens[i]); } #ifdef HAVE_LCD_CHARCELLS status_set_param(false); @@ -542,7 +486,7 @@ void quick_screen_quick_apply(struct gui_quickscreen *qs) global_settings.repeat_mode=option_select_get_selected(qs->right_option); } -bool quick_screen_quick(void) +bool quick_screen_quick(int button_enter) { bool res, oldrepeat; struct option_select left_option; @@ -589,7 +533,7 @@ bool quick_screen_quick(void) gui_quickscreen_init(&qs, &left_option, &bottom_option, &right_option, str(LANG_F2_MODE), &quick_screen_quick_apply); oldrepeat=global_settings.repeat_mode; - res=gui_syncquickscreen_run(&qs); + res=gui_syncquickscreen_run(&qs, button_enter); if(!res) { if ( oldrepeat != global_settings.repeat_mode && @@ -624,7 +568,7 @@ void quick_screen_f3_apply(struct gui_quickscreen *qs) gui_syncstatusbar_draw(&statusbars, true); } -bool quick_screen_f3(void) +bool quick_screen_f3(int button_enter) { bool res; struct option_select left_option; @@ -658,7 +602,7 @@ bool quick_screen_f3(void) 2); gui_quickscreen_init(&qs, &left_option, &bottom_option, &right_option, str(LANG_F3_BAR), &quick_screen_f3_apply); - res=gui_syncquickscreen_run(&qs); + res=gui_syncquickscreen_run(&qs, button_enter); if(!res) settings_save(); return(res); diff --git a/apps/screens.h b/apps/screens.h index 3de66582ee..f879da264c 100644 --- a/apps/screens.h +++ b/apps/screens.h @@ -35,9 +35,9 @@ int mmc_remove_request(void); #if CONFIG_KEYPAD == RECORDER_PAD int pitch_screen(void); -extern bool quick_screen_f3(void); +extern bool quick_screen_f3(int button_enter); #endif -extern bool quick_screen_quick(void); +extern bool quick_screen_quick(int button_enter); #ifdef HAVE_RTC bool set_time_screen(const char* string, struct tm *tm); diff --git a/apps/tree.c b/apps/tree.c index 33b482b3d7..1a419c74d2 100644 --- a/apps/tree.c +++ b/apps/tree.c @@ -718,7 +718,7 @@ static bool dirbrowse(void) /* don't enter f2 from plugin browser */ if (*tc.dirfilter < NUM_FILTER_MODES) { - if (quick_screen_quick()) + if (quick_screen_quick(button)) reload_dir = true; restore = true; @@ -733,7 +733,7 @@ static bool dirbrowse(void) /* don't enter f3 from plugin browser */ if (*tc.dirfilter < NUM_FILTER_MODES) { - if (quick_screen_f3()) + if (quick_screen_f3(button)) reload_dir = true; restore = true; } -- cgit v1.2.3