diff options
Diffstat (limited to 'apps/plugins')
-rw-r--r-- | apps/plugins/imageviewer/imageviewer.c | 20 | ||||
-rw-r--r-- | apps/plugins/imageviewer/imageviewer.h | 10 |
2 files changed, 24 insertions, 6 deletions
diff --git a/apps/plugins/imageviewer/imageviewer.c b/apps/plugins/imageviewer/imageviewer.c index 5c6bcc918f..f82ba771a9 100644 --- a/apps/plugins/imageviewer/imageviewer.c +++ b/apps/plugins/imageviewer/imageviewer.c | |||
@@ -352,6 +352,9 @@ static int ask_and_get_audio_buffer(const char *filename) | |||
352 | #ifdef IMGVIEW_RC_MENU | 352 | #ifdef IMGVIEW_RC_MENU |
353 | case IMGVIEW_RC_MENU: | 353 | case IMGVIEW_RC_MENU: |
354 | #endif | 354 | #endif |
355 | #ifdef IMGVIEW_QUIT | ||
356 | case IMGVIEW_QUIT: | ||
357 | #endif | ||
355 | case IMGVIEW_MENU: | 358 | case IMGVIEW_MENU: |
356 | return PLUGIN_OK; | 359 | return PLUGIN_OK; |
357 | 360 | ||
@@ -374,7 +377,6 @@ static int ask_and_get_audio_buffer(const char *filename) | |||
374 | if(rb->default_event_handler_ex(button, cleanup, NULL) | 377 | if(rb->default_event_handler_ex(button, cleanup, NULL) |
375 | == SYS_USB_CONNECTED) | 378 | == SYS_USB_CONNECTED) |
376 | return PLUGIN_USB_CONNECTED; | 379 | return PLUGIN_USB_CONNECTED; |
377 | |||
378 | } | 380 | } |
379 | } | 381 | } |
380 | } | 382 | } |
@@ -594,6 +596,10 @@ static int scroll_bmp(struct image_info *info) | |||
594 | case IMGVIEW_RC_MENU: | 596 | case IMGVIEW_RC_MENU: |
595 | #endif | 597 | #endif |
596 | case IMGVIEW_MENU: | 598 | case IMGVIEW_MENU: |
599 | #ifdef IMGVIEW_MENU_PRE | ||
600 | if (lastbutton != IMGVIEW_MENU_PRE) | ||
601 | break; | ||
602 | #endif | ||
597 | #ifdef USEGSLIB | 603 | #ifdef USEGSLIB |
598 | grey_show(false); /* switch off greyscale overlay */ | 604 | grey_show(false); /* switch off greyscale overlay */ |
599 | #endif | 605 | #endif |
@@ -609,6 +615,12 @@ static int scroll_bmp(struct image_info *info) | |||
609 | #endif | 615 | #endif |
610 | break; | 616 | break; |
611 | 617 | ||
618 | #ifdef IMGVIEW_QUIT | ||
619 | case IMGVIEW_QUIT: | ||
620 | return PLUGIN_OK; | ||
621 | break; | ||
622 | #endif | ||
623 | |||
612 | default: | 624 | default: |
613 | if (rb->default_event_handler_ex(button, cleanup, NULL) | 625 | if (rb->default_event_handler_ex(button, cleanup, NULL) |
614 | == SYS_USB_CONNECTED) | 626 | == SYS_USB_CONNECTED) |
@@ -835,8 +847,7 @@ static int load_and_show(char* filename, struct image_info *info) | |||
835 | #endif | 847 | #endif |
836 | rb->lcd_clear_display(); | 848 | rb->lcd_clear_display(); |
837 | } | 849 | } |
838 | while (status != PLUGIN_OK && status != PLUGIN_USB_CONNECTED | 850 | while (status > PLUGIN_OTHER); |
839 | && status != PLUGIN_OTHER); | ||
840 | #ifdef USEGSLIB | 851 | #ifdef USEGSLIB |
841 | rb->lcd_update(); | 852 | rb->lcd_update(); |
842 | #endif | 853 | #endif |
@@ -902,8 +913,7 @@ enum plugin_status plugin_start(const void* parameter) | |||
902 | do | 913 | do |
903 | { | 914 | { |
904 | condition = load_and_show(np_file, &image_info); | 915 | condition = load_and_show(np_file, &image_info); |
905 | } while (condition != PLUGIN_OK && condition != PLUGIN_USB_CONNECTED | 916 | } while (condition >= PLUGIN_OTHER); |
906 | && condition != PLUGIN_ERROR); | ||
907 | 917 | ||
908 | if (rb->memcmp(&settings, &old_settings, sizeof (settings))) | 918 | if (rb->memcmp(&settings, &old_settings, sizeof (settings))) |
909 | { | 919 | { |
diff --git a/apps/plugins/imageviewer/imageviewer.h b/apps/plugins/imageviewer/imageviewer.h index 694056ed8a..2f63792726 100644 --- a/apps/plugins/imageviewer/imageviewer.h +++ b/apps/plugins/imageviewer/imageviewer.h | |||
@@ -88,6 +88,7 @@ | |||
88 | #define IMGVIEW_NEXT (BUTTON_SELECT | BUTTON_RIGHT) | 88 | #define IMGVIEW_NEXT (BUTTON_SELECT | BUTTON_RIGHT) |
89 | #define IMGVIEW_PREVIOUS (BUTTON_SELECT | BUTTON_LEFT) | 89 | #define IMGVIEW_PREVIOUS (BUTTON_SELECT | BUTTON_LEFT) |
90 | #define IMGVIEW_MENU (BUTTON_SELECT | BUTTON_MENU) | 90 | #define IMGVIEW_MENU (BUTTON_SELECT | BUTTON_MENU) |
91 | #define IMGVIEW_QUIT (BUTTON_SELECT | BUTTON_PLAY) | ||
91 | 92 | ||
92 | #elif CONFIG_KEYPAD == IAUDIO_X5M5_PAD | 93 | #elif CONFIG_KEYPAD == IAUDIO_X5M5_PAD |
93 | #define IMGVIEW_ZOOM_PRE BUTTON_SELECT | 94 | #define IMGVIEW_ZOOM_PRE BUTTON_SELECT |
@@ -111,6 +112,7 @@ | |||
111 | #define IMGVIEW_NEXT (BUTTON_A | BUTTON_RIGHT) | 112 | #define IMGVIEW_NEXT (BUTTON_A | BUTTON_RIGHT) |
112 | #define IMGVIEW_PREVIOUS (BUTTON_A | BUTTON_LEFT) | 113 | #define IMGVIEW_PREVIOUS (BUTTON_A | BUTTON_LEFT) |
113 | #define IMGVIEW_MENU BUTTON_MENU | 114 | #define IMGVIEW_MENU BUTTON_MENU |
115 | #define IMGVIEW_QUIT BUTTON_POWER | ||
114 | 116 | ||
115 | #elif CONFIG_KEYPAD == SANSA_E200_PAD | 117 | #elif CONFIG_KEYPAD == SANSA_E200_PAD |
116 | #define IMGVIEW_ZOOM_PRE BUTTON_SELECT | 118 | #define IMGVIEW_ZOOM_PRE BUTTON_SELECT |
@@ -211,6 +213,7 @@ | |||
211 | #define IMGVIEW_NEXT BUTTON_NEXT | 213 | #define IMGVIEW_NEXT BUTTON_NEXT |
212 | #define IMGVIEW_PREVIOUS BUTTON_PREV | 214 | #define IMGVIEW_PREVIOUS BUTTON_PREV |
213 | #define IMGVIEW_MENU BUTTON_MENU | 215 | #define IMGVIEW_MENU BUTTON_MENU |
216 | #define IMGVIEW_QUIT BUTTON_BACK | ||
214 | 217 | ||
215 | #elif CONFIG_KEYPAD == MROBE100_PAD | 218 | #elif CONFIG_KEYPAD == MROBE100_PAD |
216 | #define IMGVIEW_ZOOM_IN BUTTON_SELECT | 219 | #define IMGVIEW_ZOOM_IN BUTTON_SELECT |
@@ -222,6 +225,7 @@ | |||
222 | #define IMGVIEW_NEXT (BUTTON_DISPLAY | BUTTON_RIGHT) | 225 | #define IMGVIEW_NEXT (BUTTON_DISPLAY | BUTTON_RIGHT) |
223 | #define IMGVIEW_PREVIOUS (BUTTON_DISPLAY | BUTTON_LEFT) | 226 | #define IMGVIEW_PREVIOUS (BUTTON_DISPLAY | BUTTON_LEFT) |
224 | #define IMGVIEW_MENU BUTTON_MENU | 227 | #define IMGVIEW_MENU BUTTON_MENU |
228 | #define IMGVIEW_QUIT BUTTON_POWER | ||
225 | 229 | ||
226 | #elif CONFIG_KEYPAD == IAUDIO_M3_PAD | 230 | #elif CONFIG_KEYPAD == IAUDIO_M3_PAD |
227 | #define IMGVIEW_ZOOM_PRE BUTTON_RC_PLAY | 231 | #define IMGVIEW_ZOOM_PRE BUTTON_RC_PLAY |
@@ -270,6 +274,7 @@ | |||
270 | #define IMGVIEW_NEXT BUTTON_VIEW | 274 | #define IMGVIEW_NEXT BUTTON_VIEW |
271 | #define IMGVIEW_PREVIOUS BUTTON_PLAYLIST | 275 | #define IMGVIEW_PREVIOUS BUTTON_PLAYLIST |
272 | #define IMGVIEW_MENU BUTTON_MENU | 276 | #define IMGVIEW_MENU BUTTON_MENU |
277 | #define IMGVIEW_QUIT BUTTON_POWER | ||
273 | 278 | ||
274 | #elif CONFIG_KEYPAD == PHILIPS_SA9200_PAD | 279 | #elif CONFIG_KEYPAD == PHILIPS_SA9200_PAD |
275 | #define IMGVIEW_ZOOM_IN BUTTON_VOL_UP | 280 | #define IMGVIEW_ZOOM_IN BUTTON_VOL_UP |
@@ -281,6 +286,7 @@ | |||
281 | #define IMGVIEW_NEXT BUTTON_RIGHT | 286 | #define IMGVIEW_NEXT BUTTON_RIGHT |
282 | #define IMGVIEW_PREVIOUS BUTTON_LEFT | 287 | #define IMGVIEW_PREVIOUS BUTTON_LEFT |
283 | #define IMGVIEW_MENU BUTTON_MENU | 288 | #define IMGVIEW_MENU BUTTON_MENU |
289 | #define IMGVIEW_QUIT BUTTON_POWER | ||
284 | 290 | ||
285 | #elif CONFIG_KEYPAD == ONDAVX747_PAD | 291 | #elif CONFIG_KEYPAD == ONDAVX747_PAD |
286 | #elif CONFIG_KEYPAD == ONDAVX777_PAD | 292 | #elif CONFIG_KEYPAD == ONDAVX777_PAD |
@@ -294,7 +300,9 @@ | |||
294 | #define IMGVIEW_RIGHT BUTTON_RIGHT | 300 | #define IMGVIEW_RIGHT BUTTON_RIGHT |
295 | #define IMGVIEW_NEXT BUTTON_FFWD | 301 | #define IMGVIEW_NEXT BUTTON_FFWD |
296 | #define IMGVIEW_PREVIOUS BUTTON_REW | 302 | #define IMGVIEW_PREVIOUS BUTTON_REW |
297 | #define IMGVIEW_MENU BUTTON_PLAY | 303 | #define IMGVIEW_MENU_PRE BUTTON_PLAY |
304 | #define IMGVIEW_MENU (BUTTON_PLAY|BUTTON_REL) | ||
305 | #define IMGVIEW_QUIT BUTTON_REC | ||
298 | 306 | ||
299 | #elif CONFIG_KEYPAD == PBELL_VIBE500_PAD | 307 | #elif CONFIG_KEYPAD == PBELL_VIBE500_PAD |
300 | #define IMGVIEW_ZOOM_IN (BUTTON_REC | BUTTON_UP) | 308 | #define IMGVIEW_ZOOM_IN (BUTTON_REC | BUTTON_UP) |