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/codebuster.c | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) (limited to 'apps/plugins/codebuster.c') diff --git a/apps/plugins/codebuster.c b/apps/plugins/codebuster.c index bfcc25f9b5..0fd1234b29 100644 --- a/apps/plugins/codebuster.c +++ b/apps/plugins/codebuster.c @@ -31,8 +31,12 @@ PLUGIN_HEADER #define MAX_COLORS_COUNT 8 #define MAX_GUESSES_COUNT 10 -const struct button_mapping *plugin_contexts[] = - {generic_directions, generic_actions}; +const struct button_mapping *plugin_contexts[] = { + pla_main_ctx, +#ifdef HAVE_REMOTE_LCD + pla_remote_ctx, +#endif +}; /* * Screen structure: @@ -427,14 +431,14 @@ enum plugin_status plugin_start(const void* parameter) { draw_board(guess, piece); button = get_button(); - if (button == PLA_FIRE || button == PLA_START) + if (button == PLA_SELECT) break; switch (button) { /* Exit */ - case PLA_QUIT: - case PLA_MENU: + case PLA_EXIT: + case PLA_CANCEL: resume = true; main_menu(); break; @@ -452,6 +456,10 @@ enum plugin_status plugin_start(const void* parameter) { break; /* Next color */ +#ifdef HAVE_SCROLLWHEEL + case PLA_SCROLL_FWD: + case PLA_SCROLL_FWD_REPEAT: +#endif case PLA_DOWN: case PLA_DOWN_REPEAT: guesses[guess].pieces[piece] = @@ -460,6 +468,10 @@ enum plugin_status plugin_start(const void* parameter) { break; /* Previous color */ +#ifdef HAVE_SCROLLWHEEL + case PLA_SCROLL_BACK: + case PLA_SCROLL_BACK_REPEAT: +#endif case PLA_UP: case PLA_UP_REPEAT: guesses[guess].pieces[piece] = -- cgit v1.2.3