diff options
author | Thomas Martitz <kugel@rockbox.org> | 2010-05-20 17:41:28 +0000 |
---|---|---|
committer | Thomas Martitz <kugel@rockbox.org> | 2010-05-20 17:41:28 +0000 |
commit | 20e9d56ba5507021bdde898f4b0a0eb14f2af861 (patch) | |
tree | 20a1ff36d0cc0f530bc7c7648b1bca2f9127a5c8 /apps/plugins/rocklife.c | |
parent | 97365803d390e44155fc41657bd03a7b121956aa (diff) | |
download | rockbox-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/rocklife.c')
-rw-r--r-- | apps/plugins/rocklife.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/apps/plugins/rocklife.c b/apps/plugins/rocklife.c index 35c848de1d..210cffa78d 100644 --- a/apps/plugins/rocklife.c +++ b/apps/plugins/rocklife.c | |||
@@ -66,11 +66,11 @@ | |||
66 | 66 | ||
67 | PLUGIN_HEADER | 67 | PLUGIN_HEADER |
68 | 68 | ||
69 | #define ROCKLIFE_PLAY_PAUSE PLA_FIRE | 69 | #define ROCKLIFE_PLAY_PAUSE PLA_SELECT |
70 | #define ROCKLIFE_INIT PLA_DOWN | 70 | #define ROCKLIFE_INIT PLA_DOWN |
71 | #define ROCKLIFE_NEXT PLA_RIGHT | 71 | #define ROCKLIFE_NEXT PLA_RIGHT |
72 | #define ROCKLIFE_NEXT_REP PLA_RIGHT_REPEAT | 72 | #define ROCKLIFE_NEXT_REP PLA_RIGHT_REPEAT |
73 | #define ROCKLIFE_QUIT PLA_QUIT | 73 | #define ROCKLIFE_QUIT PLA_CANCEL |
74 | #define ROCKLIFE_STATUS PLA_LEFT | 74 | #define ROCKLIFE_STATUS PLA_LEFT |
75 | 75 | ||
76 | #define PATTERN_RANDOM 0 | 76 | #define PATTERN_RANDOM 0 |
@@ -80,7 +80,7 @@ PLUGIN_HEADER | |||
80 | #define PATTERN_GLIDER_GUN 4 | 80 | #define PATTERN_GLIDER_GUN 4 |
81 | 81 | ||
82 | const struct button_mapping *plugin_contexts[] | 82 | const struct button_mapping *plugin_contexts[] |
83 | = {generic_directions, generic_actions}; | 83 | = {pla_main_ctx}; |
84 | 84 | ||
85 | #define GRID_W LCD_WIDTH | 85 | #define GRID_W LCD_WIDTH |
86 | #define GRID_H LCD_HEIGHT | 86 | #define GRID_H LCD_HEIGHT |
@@ -512,7 +512,7 @@ enum plugin_status plugin_start(const void* parameter) | |||
512 | show_grid(pgrid); | 512 | show_grid(pgrid); |
513 | 513 | ||
514 | while(!quit) { | 514 | while(!quit) { |
515 | button = pluginlib_getaction(TIMEOUT_BLOCK, plugin_contexts, 2); | 515 | button = pluginlib_getaction(TIMEOUT_BLOCK, plugin_contexts, ARRAYLEN(plugin_contexts)); |
516 | switch(button) { | 516 | switch(button) { |
517 | case ROCKLIFE_NEXT: | 517 | case ROCKLIFE_NEXT: |
518 | case ROCKLIFE_NEXT_REP: | 518 | case ROCKLIFE_NEXT_REP: |
@@ -537,7 +537,7 @@ enum plugin_status plugin_start(const void* parameter) | |||
537 | /* show new generation */ | 537 | /* show new generation */ |
538 | rb->yield(); | 538 | rb->yield(); |
539 | show_grid(pgrid); | 539 | show_grid(pgrid); |
540 | button = pluginlib_getaction(0, plugin_contexts, 2); | 540 | button = pluginlib_getaction(0, plugin_contexts, ARRAYLEN(plugin_contexts)); |
541 | switch(button) { | 541 | switch(button) { |
542 | case ROCKLIFE_PLAY_PAUSE: | 542 | case ROCKLIFE_PLAY_PAUSE: |
543 | case ROCKLIFE_QUIT: | 543 | case ROCKLIFE_QUIT: |