skin rework (FS#10922) notable changes:
[kugel-rb.git] / apps / gui / backdrop.c
blobe460b87108dea7d84e60ef3215329e4e31abfabd
1 /***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
10 * Copyright (C) 2006 Dave Chapman
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.
17 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
18 * KIND, either express or implied.
20 ****************************************************************************/
22 #include <stdio.h>
23 #include "config.h"
24 #include "lcd.h"
25 #ifdef HAVE_REMOTE_LCD
26 #include "lcd-remote.h"
27 #endif
28 #include "backdrop.h"
30 bool backdrop_load(const char* filename, char *backdrop_buffer)
32 struct bitmap bm;
33 int ret;
35 /* load the image */
36 bm.data = backdrop_buffer;
37 ret = read_bmp_file(filename, &bm, LCD_BACKDROP_BYTES,
38 FORMAT_NATIVE | FORMAT_DITHER, NULL);
40 return ((ret > 0)
41 && (bm.width == LCD_WIDTH) && (bm.height == LCD_HEIGHT));
45 void backdrop_show(char *backdrop_buffer)
47 lcd_set_backdrop((fb_data*)backdrop_buffer);
51 #if defined(HAVE_REMOTE_LCD)
53 #if LCD_REMOTE_DEPTH > 1
54 /* api functions */
55 bool remote_backdrop_load(const char *filename, char* backdrop_buffer)
57 struct bitmap bm;
58 int ret;
60 /* load the image */
61 bm.data = backdrop_buffer;
62 ret = read_bmp_file(filename, &bm, REMOTE_LCD_BACKDROP_BYTES,
63 FORMAT_NATIVE | FORMAT_DITHER | FORMAT_REMOTE, NULL);
64 return ((ret > 0)
65 && (bm.width == REMOTE_LCD_WIDTH) && (bm.height == REMOTE_LCD_HEIGHT));
67 #else /* needs stubs */
69 bool remote_backdrop_load(const char *filename, char* backdrop_buffer)
71 (void)filename; (void) backdrop_buffer;
72 return false;
74 void remote_backdrop_show(char* backdrop_buffer)
76 (void)backdrop_buffer;
78 #endif
79 #endif