summaryrefslogtreecommitdiff
path: root/apps
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2006-01-27 13:30:57 +0000
committerDaniel Stenberg <daniel@haxx.se>2006-01-27 13:30:57 +0000
commit1ca465ae77f4cb6d3e7b63fc8502aa2fd59ede3d (patch)
tree7f8b5d2a293130cabc49aaa8b4cd7e04ecd80900 /apps
parent39d2d8bd687f0d280d9df57974f028207624f5e1 (diff)
downloadrockbox-1ca465ae77f4cb6d3e7b63fc8502aa2fd59ede3d.tar.gz
rockbox-1ca465ae77f4cb6d3e7b63fc8502aa2fd59ede3d.zip
Made lots of keys' code depend on the actual definition of the key instead
of the target keypad define. Makes the code more readable and it makes it easier to enable/disable certain features. Killed the warning for X5 at the same time. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@8467 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps')
-rw-r--r--apps/plugins/viewer.c21
1 files changed, 14 insertions, 7 deletions
diff --git a/apps/plugins/viewer.c b/apps/plugins/viewer.c
index 79ee3d3f78..6c440c5a5d 100644
--- a/apps/plugins/viewer.c
+++ b/apps/plugins/viewer.c
@@ -191,17 +191,25 @@ enum {
191 SB_ON, 191 SB_ON,
192 SCROLLBAR_MODES 192 SCROLLBAR_MODES
193} scrollbar_mode[VIEW_MODES] = {SB_OFF, SB_ON}; 193} scrollbar_mode[VIEW_MODES] = {SB_OFF, SB_ON};
194#ifdef VIEWER_MODE_SCROLLBAR
194static unsigned char *scrollbar_mode_str[] = {"off", "on", "scrollbar"}; 195static unsigned char *scrollbar_mode_str[] = {"off", "on", "scrollbar"};
196#endif
197
195static bool need_scrollbar; 198static bool need_scrollbar;
196 199
200
197enum { 201enum {
198 NO_OVERLAP=0, 202 NO_OVERLAP=0,
199 OVERLAP, 203 OVERLAP,
200 PAGE_MODES 204 PAGE_MODES
201} page_mode = 0; 205} page_mode = 0;
206
207#ifdef VIEWER_MODE_PAGE
202static unsigned char *page_mode_str[] = {"don't overlap", "overlap", "pages"}; 208static unsigned char *page_mode_str[] = {"don't overlap", "overlap", "pages"};
203#endif 209#endif
204 210
211#endif
212
205static unsigned char buffer[BUFFER_SIZE + 1]; 213static unsigned char buffer[BUFFER_SIZE + 1];
206static unsigned char line_break[] = {0,0x20,'-',9,0xB,0xC}; 214static unsigned char line_break[] = {0,0x20,'-',9,0xB,0xC};
207static int display_columns; /* number of (pixel) columns on the display */ 215static int display_columns; /* number of (pixel) columns on the display */
@@ -1184,9 +1192,7 @@ enum plugin_status plugin_start(struct plugin_api* api, void* file)
1184 viewer_draw(col); 1192 viewer_draw(col);
1185 break; 1193 break;
1186 1194
1187#if (CONFIG_KEYPAD == RECORDER_PAD) || (CONFIG_KEYPAD == ONDIO_PAD) \ 1195#ifdef VIEWER_MODE_PAGE
1188 || (CONFIG_KEYPAD == IRIVER_H100_PAD) || (CONFIG_KEYPAD == IRIVER_H300_PAD) \
1189 || (CONFIG_KEYPAD == IPOD_4G_PAD)
1190 case VIEWER_MODE_PAGE: 1196 case VIEWER_MODE_PAGE:
1191 /* Page-overlap mode */ 1197 /* Page-overlap mode */
1192 if (++page_mode == PAGE_MODES) 1198 if (++page_mode == PAGE_MODES)
@@ -1198,7 +1204,8 @@ enum plugin_status plugin_start(struct plugin_api* api, void* file)
1198 1204
1199 viewer_draw(col); 1205 viewer_draw(col);
1200 break; 1206 break;
1201 1207#endif
1208#ifdef VIEWER_MODE_SCROLLBAR
1202 case VIEWER_MODE_SCROLLBAR: 1209 case VIEWER_MODE_SCROLLBAR:
1203 /* Show-scrollbar mode for current view-width mode */ 1210 /* Show-scrollbar mode for current view-width mode */
1204 if (!(ONE_SCREEN_FITS_ALL())) { 1211 if (!(ONE_SCREEN_FITS_ALL())) {
@@ -1218,8 +1225,7 @@ enum plugin_status plugin_start(struct plugin_api* api, void* file)
1218 break; 1225 break;
1219#endif 1226#endif
1220 1227
1221#if (CONFIG_KEYPAD == RECORDER_PAD) || (CONFIG_KEYPAD == IRIVER_H100_PAD) \ 1228#ifdef VIEWER_LINE_UP
1222 || (CONFIG_KEYPAD == IRIVER_H300_PAD)
1223 case VIEWER_LINE_UP: 1229 case VIEWER_LINE_UP:
1224 case VIEWER_LINE_UP | BUTTON_REPEAT: 1230 case VIEWER_LINE_UP | BUTTON_REPEAT:
1225 /* Scroll up one line */ 1231 /* Scroll up one line */
@@ -1235,7 +1241,8 @@ enum plugin_status plugin_start(struct plugin_api* api, void* file)
1235 1241
1236 viewer_draw(col); 1242 viewer_draw(col);
1237 break; 1243 break;
1238 1244#endif
1245#ifdef VIEWER_COLUMN_LEFT
1239 case VIEWER_COLUMN_LEFT: 1246 case VIEWER_COLUMN_LEFT:
1240 case VIEWER_COLUMN_LEFT | BUTTON_REPEAT: 1247 case VIEWER_COLUMN_LEFT | BUTTON_REPEAT:
1241 /* Scroll left one column */ 1248 /* Scroll left one column */