diff options
author | Jonathan Gordon <rockbox@jdgordon.info> | 2007-04-16 09:14:36 +0000 |
---|---|---|
committer | Jonathan Gordon <rockbox@jdgordon.info> | 2007-04-16 09:14:36 +0000 |
commit | 6a5cc0bd25bd468c79e453fa49f353edd824141a (patch) | |
tree | 8b406e8390550ff8b87eae3214309867574657f0 /apps/gui/icon.h | |
parent | 7afe2e86931313653d4dedb6d5167c79c2822aba (diff) | |
download | rockbox-6a5cc0bd25bd468c79e453fa49f353edd824141a.tar.gz rockbox-6a5cc0bd25bd468c79e453fa49f353edd824141a.zip |
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
Diffstat (limited to 'apps/gui/icon.h')
-rw-r--r-- | apps/gui/icon.h | 80 |
1 files changed, 68 insertions, 12 deletions
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 @@ | |||
24 | * char-based displays and bitmap displays */ | 24 | * char-based displays and bitmap displays */ |
25 | #ifdef HAVE_LCD_BITMAP | 25 | #ifdef HAVE_LCD_BITMAP |
26 | typedef const unsigned char * ICON; | 26 | typedef const unsigned char * ICON; |
27 | typedef unsigned char * ICON_NO_CONST; | 27 | #define NOICON Icon_NOICON |
28 | #define NOICON NULL | ||
29 | #else | 28 | #else |
30 | typedef long ICON; | 29 | typedef long ICON; |
31 | #define ICON_NO_CONST ICON | 30 | #define NOICON Icon_NOICON |
32 | #define NOICON -1 | ||
33 | #endif | 31 | #endif |
34 | 32 | ||
35 | #define Icon_NOICON -1 | 33 | #define FORCE_INBUILT_ICON 0x80000000 |
36 | 34 | /* Don't #ifdef icon values, or we wont be able to use the same | |
37 | #define CURSOR_CHAR 0xe10c | 35 | cmp for every target. */ |
38 | #define CURSOR_WIDTH 6 | 36 | enum themable_icons { |
39 | #define CURSOR_HEIGHT 8 | 37 | Icon_NOICON = -1, /* Dont put this in a .bmp */ |
38 | Icon_Audio, | ||
39 | Icon_Folder, | ||
40 | Icon_Playlist, | ||
41 | Icon_Cursor, | ||
42 | Icon_Wps, | ||
43 | Icon_Firmware, | ||
44 | Icon_Font, | ||
45 | Icon_Language, | ||
46 | Icon_Config, | ||
47 | Icon_Plugin, | ||
48 | Icon_Bookmark, | ||
49 | Icon_Preset, | ||
50 | Icon_Queued, | ||
51 | Icon_Moving, | ||
52 | Icon_Keyboard, | ||
53 | Icon_Reverse_Cursor, | ||
54 | Icon_Questionmark, | ||
55 | Icon_Menu_setting, | ||
56 | Icon_Menu_functioncall, | ||
57 | Icon_Submenu, | ||
58 | Icon_Submenu_Entered, | ||
59 | Icon_Recording, | ||
60 | Icon_Voice, | ||
61 | Icon_General_settings_menu, | ||
62 | Icon_System_menu, | ||
63 | Icon_Playback_menu, | ||
64 | Icon_Display_menu, | ||
65 | Icon_Remote_Display_menu, | ||
66 | Icon_Radio_screen, | ||
67 | Icon_file_view_menu, | ||
68 | Icon_EQ, | ||
69 | Icon_Rockbox, | ||
70 | Icon_Last_Themeable, | ||
71 | }; | ||
40 | 72 | ||
41 | /* | 73 | /* |
42 | * Draws a cursor at a given position, if th | 74 | * 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); | |||
49 | /* | 81 | /* |
50 | * Put an icon on a screen at a given position | 82 | * Put an icon on a screen at a given position |
51 | * (the position is given in characters) | 83 | * (the position is given in characters) |
52 | * If the given icon is null (HAVE_LCD_BITMAP) or -1 otherwise, the icon | 84 | * If the given icon is Icon_blank, the icon |
53 | * at the given position will be erased | 85 | * at the given position will be erased |
54 | * - screen : the screen where we put our icon | 86 | * - screen : the screen where we put our icon |
55 | * - x, y : the position, in character, not in pixel !! | 87 | * - x, y : the position, pixel value !! |
56 | * - icon : the icon to put | 88 | * - icon : the icon to put |
57 | */ | 89 | */ |
58 | extern void screen_put_iconxy(struct screen * screen, int x, int y, ICON icon); | 90 | extern void screen_put_iconxy(struct screen * screen, |
91 | int x, int y, enum themable_icons icon); | ||
92 | #ifdef HAVE_LCD_CHARCELLS | ||
93 | # define screen_put_icon(s, x, y, i) screen_put_iconxy(s, x, y, i) | ||
94 | # define screen_put_icon_with_offset(s, x, y, w, h, i) screen_put_icon(s, x, y, i) | ||
95 | #else | ||
96 | /* For both of these, the icon will be placed in the center of the rectangle */ | ||
97 | /* as above, but x,y are letter position, NOT PIXEL */ | ||
98 | extern void screen_put_icon(struct screen * screen, | ||
99 | int x, int y, enum themable_icons icon); | ||
100 | /* as above (x,y are letter pos), but with a pxiel offset for both */ | ||
101 | extern void screen_put_icon_with_offset(struct screen * display, | ||
102 | int x, int y, int off_x, int off_y, | ||
103 | enum themable_icons icon); | ||
104 | #endif | ||
105 | |||
106 | void icons_init(void); | ||
107 | |||
108 | |||
109 | #ifdef HAVE_LCD_CHARCELLS | ||
110 | # define CURSOR_CHAR 0xe10c | ||
111 | # define get_icon_width(a) 6 | ||
112 | #else | ||
113 | int get_icon_width(enum screen_type screen_type); | ||
114 | #endif | ||
59 | 115 | ||
60 | #endif /*_GUI_ICON_H_*/ | 116 | #endif /*_GUI_ICON_H_*/ |