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.zip rockbox-7da9477bc3401cbd90b2984f625f96f451ecaf6b.tar.gz rockbox-7da9477bc3401cbd90b2984f625f96f451ecaf6b.tar.bz2 rockbox-7da9477bc3401cbd90b2984f625f96f451ecaf6b.tar.xz | |
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 0000000..4d174d3 --- /dev/null +++ b/apps/gui/icon.c @@ -0,0 +1,49 @@ +/*************************************************************************** + * __________ __ ___. + * Open \______ \ ____ ____ | | _\_ |__ _______ ___ + * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / + * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < + * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ + * \/ \/ \/ \/ \/ + * $Id$ + * + * Copyright (C) Robert E. Hak(2002), Kévin FERRARE (2005) + * + * 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 "config.h" +#include "icon.h" +#include "screen_access.h" +#include "icons.h" + +/* Count in letter positions, NOT pixels */ +void screen_put_iconxy(struct screen * display, int x, int y, ICON icon) +{ +#ifdef HAVE_LCD_BITMAP + if(icon==0)/* Don't display invalid icons */ + return; + int xpos, ypos; + xpos = x*CURSOR_WIDTH; + ypos = y*display->char_height + display->getymargin(); + if ( display->char_height > CURSOR_HEIGHT )/* center the cursor */ + ypos += (display->char_height - CURSOR_HEIGHT) / 2; + display->mono_bitmap(icon, xpos, ypos, CURSOR_WIDTH, CURSOR_HEIGHT); +#else + display->putc(x, y, icon); +#endif +} + +void screen_put_cursorxy(struct screen * display, int x, int y) +{ +#ifdef HAVE_LCD_BITMAP + screen_put_iconxy(display, x, y, bitmap_icons_6x8[Icon_Cursor]); +#else + screen_put_iconxy(display, x, y, CURSOR_CHAR); +#endif +} |