summaryrefslogtreecommitdiff
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.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)
112 } 112 }
113} 113}
114 114
115const struct button_mapping* plugin_contexts[]={generic_actions}; 115const struct button_mapping* plugin_contexts[]={pla_main_ctx};
116 116
117void wait_for_key() 117void wait_for_key()
118{ 118{
@@ -126,11 +126,11 @@ void wait_for_key()
126 plugin_contexts, 1); 126 plugin_contexts, 1);
127 switch (action) 127 switch (action)
128 { 128 {
129 case PLA_QUIT: 129 case PLA_EXIT:
130 hot_key_quit(); 130 hot_key_quit();
131 break; 131 break;
132 132
133 case PLA_FIRE: 133 case PLA_SELECT:
134 return; 134 return;
135 } 135 }
136 } 136 }
@@ -154,24 +154,24 @@ zchar do_input(int timeout, bool show_cursor)
154 154
155 for (;;) 155 for (;;)
156 { 156 {
157 action = pluginlib_getaction(timeout, 157 action = pluginlib_getaction(timeout, plugin_contexts,
158 plugin_contexts, 1); 158 ARRAYLEN(plugin_contexts));
159 switch (action) 159 switch (action)
160 { 160 {
161 case PLA_QUIT: 161 case PLA_EXIT:
162 return ZC_HKEY_QUIT; 162 return ZC_HKEY_QUIT;
163 163
164 case PLA_MENU: 164 case PLA_CANCEL:
165 menu_ret = menu(); 165 menu_ret = menu();
166 if (menu_ret != ZC_BAD) 166 if (menu_ret != ZC_BAD)
167 return menu_ret; 167 return menu_ret;
168 timeout_at = *rb->current_tick + timeout; 168 timeout_at = *rb->current_tick + timeout;
169 break; 169 break;
170 170
171 case PLA_FIRE: 171 case PLA_SELECT:
172 return ZC_RETURN; 172 return ZC_RETURN;
173 173
174 case PLA_START: 174 case PLA_SELECT_REPEAT:
175 return ZC_BAD; 175 return ZC_BAD;
176 176
177 default: 177 default: