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/frotz/frotz.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'apps/plugins/frotz/frotz.c') diff --git a/apps/plugins/frotz/frotz.c b/apps/plugins/frotz/frotz.c index f64431f14e..a12faf90aa 100644 --- a/apps/plugins/frotz/frotz.c +++ b/apps/plugins/frotz/frotz.c @@ -112,7 +112,7 @@ zchar menu(void) } } -const struct button_mapping* plugin_contexts[]={generic_actions}; +const struct button_mapping* plugin_contexts[]={pla_main_ctx}; void wait_for_key() { @@ -126,11 +126,11 @@ void wait_for_key() plugin_contexts, 1); switch (action) { - case PLA_QUIT: + case PLA_EXIT: hot_key_quit(); break; - case PLA_FIRE: + case PLA_SELECT: return; } } @@ -154,24 +154,24 @@ zchar do_input(int timeout, bool show_cursor) for (;;) { - action = pluginlib_getaction(timeout, - plugin_contexts, 1); + action = pluginlib_getaction(timeout, plugin_contexts, + ARRAYLEN(plugin_contexts)); switch (action) { - case PLA_QUIT: + case PLA_EXIT: return ZC_HKEY_QUIT; - case PLA_MENU: + case PLA_CANCEL: menu_ret = menu(); if (menu_ret != ZC_BAD) return menu_ret; timeout_at = *rb->current_tick + timeout; break; - case PLA_FIRE: + case PLA_SELECT: return ZC_RETURN; - case PLA_START: + case PLA_SELECT_REPEAT: return ZC_BAD; default: -- cgit v1.2.3