forked from len0rd/rockbox
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
This commit is contained in:
parent
97365803d3
commit
20e9d56ba5
18 changed files with 477 additions and 860 deletions
|
@ -33,7 +33,6 @@ PLUGIN_HEADER
|
|||
const struct button_mapping *plugin_contexts[]
|
||||
= {generic_actions, generic_directions};
|
||||
|
||||
#define NB_ACTION_CONTEXTS sizeof(plugin_contexts)/sizeof(plugin_contexts[0])
|
||||
|
||||
/* Key assignement */
|
||||
#define SIZE_INCREASE PLA_UP
|
||||
|
@ -46,8 +45,8 @@ const struct button_mapping *plugin_contexts[]
|
|||
#define WIDTH_DECREASE PLA_LEFT
|
||||
#define WIDTH_DECREASE_REPEAT PLA_LEFT_REPEAT
|
||||
|
||||
#define BUTTON_QUIT PLA_QUIT
|
||||
#define CHANGE_MODE PLA_MENU
|
||||
#define BUTTON_QUIT PLA_CANCEL
|
||||
#define CHANGE_MODE PLA_SELECT
|
||||
|
||||
#define MAX_OUTPUT_WIDTH LCD_WIDTH
|
||||
#define MAX_OUTPUT_HEIGHT LCD_HEIGHT
|
||||
|
@ -110,8 +109,8 @@ enum plugin_status plugin_start(const void* parameter)
|
|||
output_bmp.height);
|
||||
|
||||
rb->lcd_update();
|
||||
button = pluginlib_getaction(HZ,
|
||||
plugin_contexts, NB_ACTION_CONTEXTS);
|
||||
button = pluginlib_getaction(HZ, plugin_contexts,
|
||||
ARRAYLEN(plugin_contexts));
|
||||
switch (button) {
|
||||
case BUTTON_QUIT:
|
||||
return PLUGIN_OK;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue