From 20e9d56ba5507021bdde898f4b0a0eb14f2af861 Mon Sep 17 00:00:00 2001 From: Thomas Martitz Date: Thu, 20 May 2010 17:41:28 +0000 Subject: 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 --- apps/plugins/test_resize.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'apps/plugins/test_resize.c') 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 const struct button_mapping *plugin_contexts[] = {generic_actions, generic_directions}; -#define NB_ACTION_CONTEXTS sizeof(plugin_contexts)/sizeof(plugin_contexts[0]) /* Key assignement */ #define SIZE_INCREASE PLA_UP @@ -46,8 +45,8 @@ const struct button_mapping *plugin_contexts[] #define WIDTH_DECREASE PLA_LEFT #define WIDTH_DECREASE_REPEAT PLA_LEFT_REPEAT -#define BUTTON_QUIT PLA_QUIT -#define CHANGE_MODE PLA_MENU +#define BUTTON_QUIT PLA_CANCEL +#define CHANGE_MODE PLA_SELECT #define MAX_OUTPUT_WIDTH LCD_WIDTH #define MAX_OUTPUT_HEIGHT LCD_HEIGHT @@ -110,8 +109,8 @@ enum plugin_status plugin_start(const void* parameter) output_bmp.height); rb->lcd_update(); - button = pluginlib_getaction(HZ, - plugin_contexts, NB_ACTION_CONTEXTS); + button = pluginlib_getaction(HZ, plugin_contexts, + ARRAYLEN(plugin_contexts)); switch (button) { case BUTTON_QUIT: return PLUGIN_OK; -- cgit v1.2.3