diff options
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 | } | ||