From d9e5b67b71cf246c11da8a9083af21752ac7bd15 Mon Sep 17 00:00:00 2001 From: Dave Chapman Date: Thu, 2 Feb 2006 20:42:56 +0000 Subject: Patch #1421422 - Backdrop image patch started by Linus, finished by me. Adds ability to set backdrop images for file browser and menus (store full-screen bitmaps in /.rockbox/backdrops/) and also the ability to set a full-screen background image in a WPS using the %X|filename.bmp| WPS tag. Currently only implemented for targets with colour LCDs. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@8536 a1c6a512-1295-4272-9138-f99709370657 --- apps/recorder/backdrop.c | 45 +++++++++++++++++++++++++++++++++++++++++++++ apps/recorder/backdrop.h | 38 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 83 insertions(+) create mode 100644 apps/recorder/backdrop.c create mode 100644 apps/recorder/backdrop.h (limited to 'apps/recorder') diff --git a/apps/recorder/backdrop.c b/apps/recorder/backdrop.c new file mode 100644 index 0000000000..6fc5e24118 --- /dev/null +++ b/apps/recorder/backdrop.c @@ -0,0 +1,45 @@ +/*************************************************************************** + * __________ __ ___. + * Open \______ \ ____ ____ | | _\_ |__ _______ ___ + * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / + * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < + * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ + * \/ \/ \/ \/ \/ + * $Id$ + * + * Copyright (C) 2006 Dave Chapman + * + * 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 +#include "config.h" +#include "lcd.h" +#include "backdrop.h" + +fb_data main_backdrop[LCD_HEIGHT][LCD_WIDTH]; +fb_data wps_backdrop[LCD_HEIGHT][LCD_WIDTH]; + +bool load_main_backdrop(char* filename) +{ + struct bitmap bm; + int ret; + + /* load the image */ + bm.data=(char*)&main_backdrop[0][0]; + ret = read_bmp_file(filename, &bm, sizeof(main_backdrop), FORMAT_NATIVE); + + if ((ret > 0) && (bm.width == LCD_WIDTH) + && (bm.height == LCD_HEIGHT)) { + lcd_set_backdrop(&main_backdrop[0][0]); + return true; + } else { + lcd_set_backdrop(NULL); + return false; + } +} diff --git a/apps/recorder/backdrop.h b/apps/recorder/backdrop.h new file mode 100644 index 0000000000..d77985cf28 --- /dev/null +++ b/apps/recorder/backdrop.h @@ -0,0 +1,38 @@ +/*************************************************************************** + * __________ __ ___. + * Open \______ \ ____ ____ | | _\_ |__ _______ ___ + * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / + * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < + * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ + * \/ \/ \/ \/ \/ + * $Id$ + * + * Copyright (C) 2006 Dave Chapman + * + * 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 _BACKDROP_H +#define _BACKDROP_H + +#ifdef HAVE_LCD_COLOR + +#include "lcd.h" +#include "bmp.h" +#include "backdrop.h" + +#ifdef HAVE_LCD_COLOR +extern fb_data main_backdrop[LCD_HEIGHT][LCD_WIDTH]; +extern fb_data wps_backdrop[LCD_HEIGHT][LCD_WIDTH]; +#endif + +bool load_main_backdrop(char* filename); + +#endif + +#endif -- cgit v1.2.3