2005-10-28 00:00:00 +00:00
|
|
|
/***************************************************************************
|
|
|
|
* __________ __ ___.
|
|
|
|
* Open \______ \ ____ ____ | | _\_ |__ _______ ___
|
|
|
|
* Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
|
|
|
|
* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
|
|
|
|
* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
|
|
|
|
* \/ \/ \/ \/ \/
|
|
|
|
* $Id$
|
|
|
|
*
|
2005-10-30 01:24:35 +00:00
|
|
|
* Copyright (C) 2005 by Kevin Ferrare
|
2005-10-28 00:00:00 +00:00
|
|
|
*
|
2008-06-28 18:10:04 +00:00
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License
|
|
|
|
* as published by the Free Software Foundation; either version 2
|
|
|
|
* of the License, or (at your option) any later version.
|
2005-10-28 00:00:00 +00:00
|
|
|
*
|
|
|
|
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
|
|
|
* KIND, either express or implied.
|
|
|
|
*
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
#ifndef _GUI_ICON_H_
|
|
|
|
#define _GUI_ICON_H_
|
|
|
|
#include "screen_access.h"
|
|
|
|
/* Defines a type for the icons since it's not the same thing on
|
|
|
|
* char-based displays and bitmap displays */
|
|
|
|
#ifdef HAVE_LCD_BITMAP
|
2006-08-23 20:02:06 +00:00
|
|
|
typedef const unsigned char * ICON;
|
2005-10-28 00:00:00 +00:00
|
|
|
#else
|
2007-03-26 07:52:13 +00:00
|
|
|
typedef long ICON;
|
2005-10-28 00:00:00 +00:00
|
|
|
#endif
|
|
|
|
|
2007-04-16 09:14:36 +00:00
|
|
|
/* Don't #ifdef icon values, or we wont be able to use the same
|
2007-04-16 14:33:29 +00:00
|
|
|
bmp for every target. */
|
2007-04-16 09:14:36 +00:00
|
|
|
enum themable_icons {
|
2011-06-20 19:32:48 +00:00
|
|
|
NOICON = -1,
|
|
|
|
Icon_NOICON = NOICON, /* Dont put this in a .bmp */
|
2007-04-16 09:14:36 +00:00
|
|
|
Icon_Audio,
|
|
|
|
Icon_Folder,
|
|
|
|
Icon_Playlist,
|
|
|
|
Icon_Cursor,
|
|
|
|
Icon_Wps,
|
|
|
|
Icon_Firmware,
|
|
|
|
Icon_Font,
|
|
|
|
Icon_Language,
|
|
|
|
Icon_Config,
|
|
|
|
Icon_Plugin,
|
|
|
|
Icon_Bookmark,
|
|
|
|
Icon_Preset,
|
|
|
|
Icon_Queued,
|
|
|
|
Icon_Moving,
|
|
|
|
Icon_Keyboard,
|
|
|
|
Icon_Reverse_Cursor,
|
|
|
|
Icon_Questionmark,
|
|
|
|
Icon_Menu_setting,
|
|
|
|
Icon_Menu_functioncall,
|
|
|
|
Icon_Submenu,
|
|
|
|
Icon_Submenu_Entered,
|
|
|
|
Icon_Recording,
|
|
|
|
Icon_Voice,
|
|
|
|
Icon_General_settings_menu,
|
|
|
|
Icon_System_menu,
|
|
|
|
Icon_Playback_menu,
|
|
|
|
Icon_Display_menu,
|
|
|
|
Icon_Remote_Display_menu,
|
|
|
|
Icon_Radio_screen,
|
|
|
|
Icon_file_view_menu,
|
|
|
|
Icon_EQ,
|
|
|
|
Icon_Rockbox,
|
|
|
|
Icon_Last_Themeable,
|
|
|
|
};
|
2005-11-16 02:12:25 +00:00
|
|
|
|
2005-10-28 00:00:00 +00:00
|
|
|
/*
|
2005-11-16 02:12:25 +00:00
|
|
|
* Draws a cursor at a given position, if th
|
2005-10-28 00:00:00 +00:00
|
|
|
* - screen : the screen where we put the cursor
|
|
|
|
* - x, y : the position, in character, not in pixel !!
|
2005-11-16 02:12:25 +00:00
|
|
|
* - on : true if the cursor must be shown, false if it must be erased
|
2005-10-28 00:00:00 +00:00
|
|
|
*/
|
2005-11-16 02:12:25 +00:00
|
|
|
extern void screen_put_cursorxy(struct screen * screen, int x, int y, bool on);
|
2005-10-28 00:00:00 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Put an icon on a screen at a given position
|
|
|
|
* (the position is given in characters)
|
2007-04-16 09:14:36 +00:00
|
|
|
* If the given icon is Icon_blank, the icon
|
2005-11-16 02:12:25 +00:00
|
|
|
* at the given position will be erased
|
2005-10-28 00:00:00 +00:00
|
|
|
* - screen : the screen where we put our icon
|
2007-04-16 09:14:36 +00:00
|
|
|
* - x, y : the position, pixel value !!
|
2005-10-28 00:00:00 +00:00
|
|
|
* - icon : the icon to put
|
|
|
|
*/
|
2007-04-16 09:14:36 +00:00
|
|
|
extern void screen_put_iconxy(struct screen * screen,
|
|
|
|
int x, int y, enum themable_icons icon);
|
|
|
|
#ifdef HAVE_LCD_CHARCELLS
|
|
|
|
# define screen_put_icon(s, x, y, i) screen_put_iconxy(s, x, y, i)
|
|
|
|
# define screen_put_icon_with_offset(s, x, y, w, h, i) screen_put_icon(s, x, y, i)
|
|
|
|
#else
|
|
|
|
/* For both of these, the icon will be placed in the center of the rectangle */
|
|
|
|
/* as above, but x,y are letter position, NOT PIXEL */
|
|
|
|
extern void screen_put_icon(struct screen * screen,
|
|
|
|
int x, int y, enum themable_icons icon);
|
|
|
|
/* as above (x,y are letter pos), but with a pxiel offset for both */
|
|
|
|
extern void screen_put_icon_with_offset(struct screen * display,
|
|
|
|
int x, int y, int off_x, int off_y,
|
|
|
|
enum themable_icons icon);
|
|
|
|
#endif
|
|
|
|
|
|
|
|
void icons_init(void);
|
|
|
|
|
|
|
|
|
|
|
|
#ifdef HAVE_LCD_CHARCELLS
|
|
|
|
# define CURSOR_CHAR 0xe10c
|
2013-12-23 23:52:18 +00:00
|
|
|
# define get_icon_width(a) 1
|
2011-10-17 17:38:10 +00:00
|
|
|
# define get_icon_height(a) 1 /* needs to be verified */
|
2007-04-16 09:14:36 +00:00
|
|
|
#else
|
|
|
|
int get_icon_width(enum screen_type screen_type);
|
2011-10-17 17:38:10 +00:00
|
|
|
int get_icon_height(enum screen_type screen_type);
|
2013-12-28 14:10:46 +00:00
|
|
|
int get_icon_format(enum screen_type screen_type);
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#if (LCD_DEPTH > 1) || defined(HAVE_REMOTE_LCD) && (LCD_REMOTE_DEPTH > 1) \
|
|
|
|
&& !defined(HAVE_LCD_CHARCELLS)
|
|
|
|
int get_icon_format(enum screen_type screen_type);
|
|
|
|
#else
|
|
|
|
# define get_icon_format(a) FORMAT_MONO
|
2007-04-16 09:14:36 +00:00
|
|
|
#endif
|
2005-10-28 00:00:00 +00:00
|
|
|
|
2011-10-17 17:38:10 +00:00
|
|
|
|
2005-10-28 00:00:00 +00:00
|
|
|
#endif /*_GUI_ICON_H_*/
|