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
This commit is contained in:
parent
39d2d8bd68
commit
1ca465ae77
1 changed files with 14 additions and 7 deletions
|
@ -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 */
|
||||
|
|
Loading…
Reference in a new issue