diff options
author | Linus Nielsen Feltzing <linus@haxx.se> | 2005-10-28 00:00:00 +0000 |
---|---|---|
committer | Linus Nielsen Feltzing <linus@haxx.se> | 2005-10-28 00:00:00 +0000 |
commit | 7da9477bc3401cbd90b2984f625f96f451ecaf6b (patch) | |
tree | 8aea2c154ad0f666f57c4752fa541fa539de757c /apps/gui/icon.c | |
parent | 3efa91ed03797dd533c0add6db750ade67499587 (diff) | |
download | rockbox-7da9477bc3401cbd90b2984f625f96f451ecaf6b.tar.gz rockbox-7da9477bc3401cbd90b2984f625f96f451ecaf6b.zip |
Initial multi screen support by Kévin Ferrare (Patch #1318081)
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@7666 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/gui/icon.c')
-rw-r--r-- | apps/gui/icon.c | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/apps/gui/icon.c b/apps/gui/icon.c new file mode 100644 index 0000000000..4d174d3427 --- /dev/null +++ b/apps/gui/icon.c | |||
@@ -0,0 +1,49 @@ | |||
1 | /*************************************************************************** | ||
2 | * __________ __ ___. | ||
3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
7 | * \/ \/ \/ \/ \/ | ||
8 | * $Id$ | ||
9 | * | ||
10 | * Copyright (C) Robert E. Hak(2002), Kévin FERRARE (2005) | ||
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 "config.h" | ||
21 | #include "icon.h" | ||
22 | #include "screen_access.h" | ||
23 | #include "icons.h" | ||
24 | |||
25 | /* Count in letter positions, NOT pixels */ | ||
26 | void screen_put_iconxy(struct screen * display, int x, int y, ICON icon) | ||
27 | { | ||
28 | #ifdef HAVE_LCD_BITMAP | ||
29 | if(icon==0)/* Don't display invalid icons */ | ||
30 | return; | ||
31 | int xpos, ypos; | ||
32 | xpos = x*CURSOR_WIDTH; | ||
33 | ypos = y*display->char_height + display->getymargin(); | ||
34 | if ( display->char_height > CURSOR_HEIGHT )/* center the cursor */ | ||
35 | ypos += (display->char_height - CURSOR_HEIGHT) / 2; | ||
36 | display->mono_bitmap(icon, xpos, ypos, CURSOR_WIDTH, CURSOR_HEIGHT); | ||
37 | #else | ||
38 | display->putc(x, y, icon); | ||
39 | #endif | ||
40 | } | ||
41 | |||
42 | void screen_put_cursorxy(struct screen * display, int x, int y) | ||
43 | { | ||
44 | #ifdef HAVE_LCD_BITMAP | ||
45 | screen_put_iconxy(display, x, y, bitmap_icons_6x8[Icon_Cursor]); | ||
46 | #else | ||
47 | screen_put_iconxy(display, x, y, CURSOR_CHAR); | ||
48 | #endif | ||
49 | } | ||