From 6a5cc0bd25bd468c79e453fa49f353edd824141a Mon Sep 17 00:00:00 2001 From: Jonathan Gordon Date: Mon, 16 Apr 2007 09:14:36 +0000 Subject: Customizable icons for all bitmap targets. (FS#7013) http://www.rockbox.org/twiki/bin/view/Main/CustomIcons for info on format and how to load them git-svn-id: svn://svn.rockbox.org/rockbox/trunk@13177 a1c6a512-1295-4272-9138-f99709370657 --- apps/gui/icon.h | 80 ++++++++++++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 68 insertions(+), 12 deletions(-) (limited to 'apps/gui/icon.h') diff --git a/apps/gui/icon.h b/apps/gui/icon.h index c717bbc6ea..fa6919030f 100644 --- a/apps/gui/icon.h +++ b/apps/gui/icon.h @@ -24,19 +24,51 @@ * char-based displays and bitmap displays */ #ifdef HAVE_LCD_BITMAP typedef const unsigned char * ICON; -typedef unsigned char * ICON_NO_CONST; -#define NOICON NULL +#define NOICON Icon_NOICON #else typedef long ICON; -#define ICON_NO_CONST ICON -#define NOICON -1 +#define NOICON Icon_NOICON #endif -#define Icon_NOICON -1 - -#define CURSOR_CHAR 0xe10c -#define CURSOR_WIDTH 6 -#define CURSOR_HEIGHT 8 +#define FORCE_INBUILT_ICON 0x80000000 +/* Don't #ifdef icon values, or we wont be able to use the same + cmp for every target. */ +enum themable_icons { + Icon_NOICON = -1, /* Dont put this in a .bmp */ + 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, +}; /* * Draws a cursor at a given position, if th @@ -49,12 +81,36 @@ extern void screen_put_cursorxy(struct screen * screen, int x, int y, bool on); /* * Put an icon on a screen at a given position * (the position is given in characters) - * If the given icon is null (HAVE_LCD_BITMAP) or -1 otherwise, the icon + * If the given icon is Icon_blank, the icon * at the given position will be erased * - screen : the screen where we put our icon - * - x, y : the position, in character, not in pixel !! + * - x, y : the position, pixel value !! * - icon : the icon to put */ -extern void screen_put_iconxy(struct screen * screen, int x, int y, ICON icon); +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 +# define get_icon_width(a) 6 +#else +int get_icon_width(enum screen_type screen_type); +#endif #endif /*_GUI_ICON_H_*/ -- cgit v1.2.3