summaryrefslogtreecommitdiff
path: root/apps/gui
diff options
context:
space:
mode:
authorJonathan Gordon <rockbox@jdgordon.info>2007-04-16 14:33:29 +0000
committerJonathan Gordon <rockbox@jdgordon.info>2007-04-16 14:33:29 +0000
commita9c1df40014ebe548ab111fd28d854f22e231b5f (patch)
treeb663992bcc82b56095900dd378cc1eb8dfa81a6a /apps/gui
parentb6658bbeef45b3b2db730bb8ca2bf0309d2ca917 (diff)
downloadrockbox-a9c1df40014ebe548ab111fd28d854f22e231b5f.tar.gz
rockbox-a9c1df40014ebe548ab111fd28d854f22e231b5f.zip
* its name[rows][columns] you drongo!
* make custom viewer icons work slightly better * minor nit-picks to keep crop happy * create a /.rockbox/themes/default_rockbox_icons.cfg to restore the default icons easily git-svn-id: svn://svn.rockbox.org/rockbox/trunk@13183 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/gui')
-rw-r--r--apps/gui/icon.c16
-rw-r--r--apps/gui/icon.h5
2 files changed, 12 insertions, 9 deletions
diff --git a/apps/gui/icon.c b/apps/gui/icon.c
index b844b4bb5b..6e4cd59059 100644
--- a/apps/gui/icon.c
+++ b/apps/gui/icon.c
@@ -74,11 +74,11 @@ static const int default_height[NB_SCREENS] = {
74 74
75#define IMG_BUFSIZE (MAX_ICON_HEIGHT * MAX_ICON_WIDTH * \ 75#define IMG_BUFSIZE (MAX_ICON_HEIGHT * MAX_ICON_WIDTH * \
76 Icon_Last_Themeable *LCD_DEPTH/8) 76 Icon_Last_Themeable *LCD_DEPTH/8)
77static unsigned char icon_buffer[IMG_BUFSIZE][NB_SCREENS]; 77static unsigned char icon_buffer[NB_SCREENS][IMG_BUFSIZE];
78static bool custom_icons_loaded[NB_SCREENS] = {false}; 78static bool custom_icons_loaded[NB_SCREENS] = {false};
79static struct bitmap user_iconset[NB_SCREENS]; 79static struct bitmap user_iconset[NB_SCREENS];
80 80
81static unsigned char viewer_icon_buffer[IMG_BUFSIZE][NB_SCREENS]; 81static unsigned char viewer_icon_buffer[NB_SCREENS][IMG_BUFSIZE];
82static bool viewer_icons_loaded[NB_SCREENS] = {false}; 82static bool viewer_icons_loaded[NB_SCREENS] = {false};
83static struct bitmap viewer_iconset[NB_SCREENS]; 83static struct bitmap viewer_iconset[NB_SCREENS];
84 84
@@ -252,13 +252,15 @@ void icons_init(void)
252 { 252 {
253 snprintf(path, MAX_PATH, "%s/%s.bmp", 253 snprintf(path, MAX_PATH, "%s/%s.bmp",
254 ICON_DIR, global_settings.icon_file); 254 ICON_DIR, global_settings.icon_file);
255 load_icons(path, Iconset_Mainscreen); 255 load_icons((global_settings.icon_file[0] == '-')?NULL:path,
256 Iconset_Mainscreen);
256 } 257 }
257 if (global_settings.viewers_icon_file[0]) 258 if (global_settings.viewers_icon_file[0])
258 { 259 {
259 snprintf(path, MAX_PATH, "%s/%s.bmp", 260 snprintf(path, MAX_PATH, "%s/%s.bmp",
260 ICON_DIR, global_settings.viewers_icon_file); 261 ICON_DIR, global_settings.viewers_icon_file);
261 load_icons(path, Iconset_Mainscreen_viewers); 262 load_icons((global_settings.viewers_icon_file[0] == '-')?NULL:path,
263 Iconset_Mainscreen_viewers);
262 read_viewer_theme_file(); 264 read_viewer_theme_file();
263 } 265 }
264 else 266 else
@@ -268,13 +270,15 @@ void icons_init(void)
268 { 270 {
269 snprintf(path, MAX_PATH, "%s/%s.bmp", 271 snprintf(path, MAX_PATH, "%s/%s.bmp",
270 ICON_DIR, global_settings.remote_icon_file); 272 ICON_DIR, global_settings.remote_icon_file);
271 load_icons(path, Iconset_Remotescreen); 273 load_icons((global_settings.remote_icon_file[0] == '-')?NULL:path,
274 Iconset_Remotescreen);
272 } 275 }
273 if (global_settings.remote_viewers_icon_file[0]) 276 if (global_settings.remote_viewers_icon_file[0])
274 { 277 {
275 snprintf(path, MAX_PATH, "%s/%s.bmp", 278 snprintf(path, MAX_PATH, "%s/%s.bmp",
276 ICON_DIR, global_settings.remote_viewers_icon_file); 279 ICON_DIR, global_settings.remote_viewers_icon_file);
277 load_icons(path, Iconset_Remotescreen_viewers); 280 load_icons((global_settings.remote_viewers_icon_file[0] == '-')?NULL:path,
281 Iconset_Remotescreen_viewers);
278 } 282 }
279 else 283 else
280 load_icons(DEFAULT_REMOTE_VIEWER_BMP, Iconset_Remotescreen_viewers); 284 load_icons(DEFAULT_REMOTE_VIEWER_BMP, Iconset_Remotescreen_viewers);
diff --git a/apps/gui/icon.h b/apps/gui/icon.h
index fa6919030f..8408ed46b0 100644
--- a/apps/gui/icon.h
+++ b/apps/gui/icon.h
@@ -24,15 +24,14 @@
24 * char-based displays and bitmap displays */ 24 * char-based displays and bitmap displays */
25#ifdef HAVE_LCD_BITMAP 25#ifdef HAVE_LCD_BITMAP
26typedef const unsigned char * ICON; 26typedef const unsigned char * ICON;
27#define NOICON Icon_NOICON
28#else 27#else
29typedef long ICON; 28typedef long ICON;
30#define NOICON Icon_NOICON
31#endif 29#endif
32 30
31#define NOICON Icon_NOICON
33#define FORCE_INBUILT_ICON 0x80000000 32#define FORCE_INBUILT_ICON 0x80000000
34/* Don't #ifdef icon values, or we wont be able to use the same 33/* Don't #ifdef icon values, or we wont be able to use the same
35 cmp for every target. */ 34 bmp for every target. */
36enum themable_icons { 35enum themable_icons {
37 Icon_NOICON = -1, /* Dont put this in a .bmp */ 36 Icon_NOICON = -1, /* Dont put this in a .bmp */
38 Icon_Audio, 37 Icon_Audio,