summaryrefslogtreecommitdiffstats
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
parent39d2d8bd687f0d280d9df57974f028207624f5e1 (diff)
downloadrockbox-1ca465ae77f4cb6d3e7b63fc8502aa2fd59ede3d.tar.gz
rockbox-1ca465ae77f4cb6d3e7b63fc8502aa2fd59ede3d.tar.bz2
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
-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 {
SB_ON,
SCROLLBAR_MODES
} scrollbar_mode[VIEW_MODES] = {SB_OFF, SB_ON};
+#ifdef VIEWER_MODE_SCROLLBAR
static unsigned char *scrollbar_mode_str[] = {"off", "on", "scrollbar"};
+#endif
+
static bool need_scrollbar;
+
enum {
NO_OVERLAP=0,
OVERLAP,
PAGE_MODES
} page_mode = 0;
+
+#ifdef VIEWER_MODE_PAGE
static unsigned char *page_mode_str[] = {"don't overlap", "overlap", "pages"};
#endif
+#endif
+
static unsigned char buffer[BUFFER_SIZE + 1];
static unsigned char line_break[] = {0,0x20,'-',9,0xB,0xC};
static 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)
viewer_draw(col);
break;
-#if (CONFIG_KEYPAD == RECORDER_PAD) || (CONFIG_KEYPAD == ONDIO_PAD) \
- || (CONFIG_KEYPAD == IRIVER_H100_PAD) || (CONFIG_KEYPAD == IRIVER_H300_PAD) \
- || (CONFIG_KEYPAD == IPOD_4G_PAD)
+#ifdef VIEWER_MODE_PAGE
case VIEWER_MODE_PAGE:
/* Page-overlap mode */
if (++page_mode == PAGE_MODES)
@@ -1198,7 +1204,8 @@ enum plugin_status plugin_start(struct plugin_api* api, void* file)
viewer_draw(col);
break;
-
+#endif
+#ifdef VIEWER_MODE_SCROLLBAR
case VIEWER_MODE_SCROLLBAR:
/* Show-scrollbar mode for current view-width mode */
if (!(ONE_SCREEN_FITS_ALL())) {
@@ -1218,8 +1225,7 @@ enum plugin_status plugin_start(struct plugin_api* api, void* file)
break;
#endif
-#if (CONFIG_KEYPAD == RECORDER_PAD) || (CONFIG_KEYPAD == IRIVER_H100_PAD) \
- || (CONFIG_KEYPAD == IRIVER_H300_PAD)
+#ifdef VIEWER_LINE_UP
case VIEWER_LINE_UP:
case VIEWER_LINE_UP | BUTTON_REPEAT:
/* Scroll up one line */
@@ -1235,7 +1241,8 @@ enum plugin_status plugin_start(struct plugin_api* api, void* file)
viewer_draw(col);
break;
-
+#endif
+#ifdef VIEWER_COLUMN_LEFT
case VIEWER_COLUMN_LEFT:
case VIEWER_COLUMN_LEFT | BUTTON_REPEAT:
/* Scroll left one column */