diff options
author | Thomas Martitz <kugel@rockbox.org> | 2010-05-20 17:41:28 +0000 |
---|---|---|
committer | Thomas Martitz <kugel@rockbox.org> | 2010-05-20 17:41:28 +0000 |
commit | 20e9d56ba5507021bdde898f4b0a0eb14f2af861 (patch) | |
tree | 20a1ff36d0cc0f530bc7c7648b1bca2f9127a5c8 /apps/plugins/test_resize.c | |
parent | 97365803d390e44155fc41657bd03a7b121956aa (diff) | |
download | rockbox-20e9d56ba5507021bdde898f4b0a0eb14f2af861.tar.gz rockbox-20e9d56ba5507021bdde898f4b0a0eb14f2af861.zip |
S#10387 - Rework pluginlib actions
It changes pluginlib actions to contain only a single and simple context (and
other one for remote directional buttons),
consisting of 7(9) buttons: up/down/left/right, select OR short select and long
select, exit and cancel (plus 2 for scrollwheel targets).
This ensures contexts don't clash with other contexts and simplifies them, at
the expense of reduced versatility. However, the versatility made it largely unusable
due to the great number of targets.
This should allow for using pluginlib actions safely for the most simple plugins (e.g. almost all demos).
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26202 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/plugins/test_resize.c')
-rw-r--r-- | apps/plugins/test_resize.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/apps/plugins/test_resize.c b/apps/plugins/test_resize.c index a6a183a54b..8ad8cdee38 100644 --- a/apps/plugins/test_resize.c +++ b/apps/plugins/test_resize.c | |||
@@ -33,7 +33,6 @@ PLUGIN_HEADER | |||
33 | const struct button_mapping *plugin_contexts[] | 33 | const struct button_mapping *plugin_contexts[] |
34 | = {generic_actions, generic_directions}; | 34 | = {generic_actions, generic_directions}; |
35 | 35 | ||
36 | #define NB_ACTION_CONTEXTS sizeof(plugin_contexts)/sizeof(plugin_contexts[0]) | ||
37 | 36 | ||
38 | /* Key assignement */ | 37 | /* Key assignement */ |
39 | #define SIZE_INCREASE PLA_UP | 38 | #define SIZE_INCREASE PLA_UP |
@@ -46,8 +45,8 @@ const struct button_mapping *plugin_contexts[] | |||
46 | #define WIDTH_DECREASE PLA_LEFT | 45 | #define WIDTH_DECREASE PLA_LEFT |
47 | #define WIDTH_DECREASE_REPEAT PLA_LEFT_REPEAT | 46 | #define WIDTH_DECREASE_REPEAT PLA_LEFT_REPEAT |
48 | 47 | ||
49 | #define BUTTON_QUIT PLA_QUIT | 48 | #define BUTTON_QUIT PLA_CANCEL |
50 | #define CHANGE_MODE PLA_MENU | 49 | #define CHANGE_MODE PLA_SELECT |
51 | 50 | ||
52 | #define MAX_OUTPUT_WIDTH LCD_WIDTH | 51 | #define MAX_OUTPUT_WIDTH LCD_WIDTH |
53 | #define MAX_OUTPUT_HEIGHT LCD_HEIGHT | 52 | #define MAX_OUTPUT_HEIGHT LCD_HEIGHT |
@@ -110,8 +109,8 @@ enum plugin_status plugin_start(const void* parameter) | |||
110 | output_bmp.height); | 109 | output_bmp.height); |
111 | 110 | ||
112 | rb->lcd_update(); | 111 | rb->lcd_update(); |
113 | button = pluginlib_getaction(HZ, | 112 | button = pluginlib_getaction(HZ, plugin_contexts, |
114 | plugin_contexts, NB_ACTION_CONTEXTS); | 113 | ARRAYLEN(plugin_contexts)); |
115 | switch (button) { | 114 | switch (button) { |
116 | case BUTTON_QUIT: | 115 | case BUTTON_QUIT: |
117 | return PLUGIN_OK; | 116 | return PLUGIN_OK; |