diff options
Diffstat (limited to 'apps/plugins/test_greylib_bitmap_scale.c')
-rw-r--r-- | apps/plugins/test_greylib_bitmap_scale.c | 29 |
1 files changed, 11 insertions, 18 deletions
diff --git a/apps/plugins/test_greylib_bitmap_scale.c b/apps/plugins/test_greylib_bitmap_scale.c index 5d08253997..6362aa766e 100644 --- a/apps/plugins/test_greylib_bitmap_scale.c +++ b/apps/plugins/test_greylib_bitmap_scale.c | |||
@@ -22,23 +22,11 @@ | |||
22 | #include "plugin.h" | 22 | #include "plugin.h" |
23 | #include "lib/grey.h" | 23 | #include "lib/grey.h" |
24 | #include "lib/pluginlib_bmp.h" | 24 | #include "lib/pluginlib_bmp.h" |
25 | 25 | #include "lib/pluginlib_actions.h" | |
26 | #if (CONFIG_KEYPAD == IPOD_4G_PAD) || (CONFIG_KEYPAD == IPOD_3G_PAD) || \ | 26 | /* this set the context to use with PLA */ |
27 | (CONFIG_KEYPAD == IPOD_1G2G_PAD) | 27 | static const struct button_mapping *plugin_contexts[] = { pla_main_ctx }; |
28 | #define GBS_QUIT BUTTON_MENU | 28 | #define GBS_QUIT PLA_EXIT |
29 | #elif CONFIG_KEYPAD == IAUDIO_M3_PAD | 29 | #define GBS_QUIT2 PLA_CANCEL |
30 | #define GBS_QUIT BUTTON_RC_REC | ||
31 | #elif CONFIG_KEYPAD == SAMSUNG_YH_PAD | ||
32 | #define GBS_QUIT BUTTON_PLAY | ||
33 | #elif CONFIG_KEYPAD == MPIO_HD200_PAD | ||
34 | #define GBS_QUIT (BUTTON_REC|BUTTON_PLAY) | ||
35 | #elif CONFIG_KEYPAD == MPIO_HD300_PAD | ||
36 | #define GBS_QUIT (BUTTON_REC|BUTTON_REPEAT) | ||
37 | #elif defined(BUTTON_OFF) | ||
38 | #define GBS_QUIT BUTTON_OFF | ||
39 | #else | ||
40 | #define GBS_QUIT BUTTON_POWER | ||
41 | #endif | ||
42 | 30 | ||
43 | #if LCD_DEPTH == 1 | 31 | #if LCD_DEPTH == 1 |
44 | #define BMP_LOAD read_bmp_file | 32 | #define BMP_LOAD read_bmp_file |
@@ -63,6 +51,7 @@ enum plugin_status plugin_start(const void* parameter) | |||
63 | .data = grey_bm_buf | 51 | .data = grey_bm_buf |
64 | }; | 52 | }; |
65 | int ret, x, y; | 53 | int ret, x, y; |
54 | int button = 0; | ||
66 | 55 | ||
67 | if(!parameter) return PLUGIN_ERROR; | 56 | if(!parameter) return PLUGIN_ERROR; |
68 | 57 | ||
@@ -92,7 +81,11 @@ enum plugin_status plugin_start(const void* parameter) | |||
92 | grey_show(true); | 81 | grey_show(true); |
93 | 82 | ||
94 | /* wait until user closes plugin */ | 83 | /* wait until user closes plugin */ |
95 | while (rb->button_get(true) != GBS_QUIT); | 84 | while ((button != GBS_QUIT) && (button != GBS_QUIT2)) |
85 | { | ||
86 | button = pluginlib_getaction(TIMEOUT_BLOCK, plugin_contexts, | ||
87 | ARRAYLEN(plugin_contexts)); | ||
88 | } | ||
96 | 89 | ||
97 | grey_release(); | 90 | grey_release(); |
98 | 91 | ||