summaryrefslogtreecommitdiffstats
path: root/apps/plugins/frotz
diff options
context:
space:
mode:
authorThomas Martitz <kugel@rockbox.org>2010-05-20 17:41:28 +0000
committerThomas Martitz <kugel@rockbox.org>2010-05-20 17:41:28 +0000
commit20e9d56ba5507021bdde898f4b0a0eb14f2af861 (patch)
tree20a1ff36d0cc0f530bc7c7648b1bca2f9127a5c8 /apps/plugins/frotz
parent97365803d390e44155fc41657bd03a7b121956aa (diff)
downloadrockbox-20e9d56ba5507021bdde898f4b0a0eb14f2af861.tar.gz
rockbox-20e9d56ba5507021bdde898f4b0a0eb14f2af861.tar.bz2
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/frotz')
-rw-r--r--apps/plugins/frotz/frotz.c18
1 files changed, 9 insertions, 9 deletions
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: