forked from len0rd/rockbox
Replace use of CONTEXT_CUSTOM by get_custom_action with new CONTEXT_PLUGIN, to prevent conflicts with core contexts using CONTEXT_CUSTOM, and use CONTEXT_TREE as the base context for PictureFlow's custom contexts.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21149 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
c69331ef32
commit
29d7db4a46
4 changed files with 16 additions and 12 deletions
|
@ -197,7 +197,7 @@ static int get_action_worker(int context, int timeout,
|
|||
if (button & BUTTON_REMOTE)
|
||||
context |= CONTEXT_REMOTE;
|
||||
#endif
|
||||
if ((context & CONTEXT_CUSTOM) && get_context_map)
|
||||
if ((context & CONTEXT_PLUGIN) && get_context_map)
|
||||
items = get_context_map(context);
|
||||
else
|
||||
items = get_context_mapping(context);
|
||||
|
|
|
@ -30,6 +30,7 @@
|
|||
#define CONTEXT_REMOTE 0x80000000 /* | this against another context to get remote buttons for that context */
|
||||
#define CONTEXT_CUSTOM 0x40000000 /* | this against anything to get your context number */
|
||||
#define CONTEXT_CUSTOM2 0x20000000 /* as above */
|
||||
#define CONTEXT_PLUGIN 0x10000000 /* for plugins using get_custom_action */
|
||||
|
||||
#define LAST_ITEM_IN_LIST { CONTEXT_STOPSEARCHING, BUTTON_NONE, BUTTON_NONE }
|
||||
#define LAST_ITEM_IN_LIST__NEXTLIST(a) { a, BUTTON_NONE, BUTTON_NONE }
|
||||
|
|
|
@ -71,7 +71,7 @@ const struct button_mapping remote_directions[] =
|
|||
#else
|
||||
#error pluginlib_actions: Unsupported remote keypad
|
||||
#endif
|
||||
{CONTEXT_CUSTOM,BUTTON_NONE,BUTTON_NONE}
|
||||
{CONTEXT_PLUGIN,BUTTON_NONE,BUTTON_NONE}
|
||||
};
|
||||
#endif /* HAVE_REMOTE_LCD */
|
||||
|
||||
|
@ -174,7 +174,7 @@ const struct button_mapping generic_directions[] =
|
|||
#else
|
||||
#error pluginlib_actions: Unsupported keypad
|
||||
#endif
|
||||
{CONTEXT_CUSTOM,BUTTON_NONE,BUTTON_NONE}
|
||||
{CONTEXT_PLUGIN,BUTTON_NONE,BUTTON_NONE}
|
||||
};
|
||||
|
||||
const struct button_mapping generic_left_right_fire[] =
|
||||
|
@ -296,7 +296,7 @@ const struct button_mapping generic_left_right_fire[] =
|
|||
#else
|
||||
#error pluginlib_actions: Unsupported keypad
|
||||
#endif
|
||||
{CONTEXT_CUSTOM,BUTTON_NONE,BUTTON_NONE}
|
||||
{CONTEXT_PLUGIN,BUTTON_NONE,BUTTON_NONE}
|
||||
};
|
||||
|
||||
/* these were taken from the bubbles plugin, so may need tweaking */
|
||||
|
@ -457,7 +457,7 @@ const struct button_mapping generic_actions[] =
|
|||
#else
|
||||
#error pluginlib_actions: Unsupported keypad
|
||||
#endif
|
||||
{CONTEXT_CUSTOM,BUTTON_NONE,BUTTON_NONE}
|
||||
{CONTEXT_PLUGIN,BUTTON_NONE,BUTTON_NONE}
|
||||
};
|
||||
|
||||
const struct button_mapping generic_increase_decrease[] =
|
||||
|
@ -537,7 +537,7 @@ const struct button_mapping generic_increase_decrease[] =
|
|||
#else
|
||||
#error pluginlib_actions: Unsupported keypad
|
||||
#endif
|
||||
{CONTEXT_CUSTOM,BUTTON_NONE,BUTTON_NONE}
|
||||
{CONTEXT_PLUGIN,BUTTON_NONE,BUTTON_NONE}
|
||||
};
|
||||
|
||||
static struct button_mapping **plugin_context_order;
|
||||
|
@ -560,5 +560,5 @@ int pluginlib_getaction(int timeout,
|
|||
plugin_context_order = (struct button_mapping **)plugin_contexts;
|
||||
plugin_context_count = count;
|
||||
last_context = 0;
|
||||
return rb->get_custom_action(CONTEXT_CUSTOM,timeout,get_context_map);
|
||||
return rb->get_custom_action(CONTEXT_PLUGIN,timeout,get_context_map);
|
||||
}
|
||||
|
|
|
@ -70,6 +70,10 @@ const struct button_mapping pf_context_album_scroll[] =
|
|||
{PF_PREV_REPEAT, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_NONE},
|
||||
{PF_NEXT, BUTTON_RIGHT, BUTTON_NONE},
|
||||
{PF_NEXT_REPEAT, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_NONE},
|
||||
{ACTION_NONE, BUTTON_LEFT|BUTTON_REL, BUTTON_LEFT},
|
||||
{ACTION_NONE, BUTTON_RIGHT|BUTTON_REL, BUTTON_RIGHT},
|
||||
{ACTION_NONE, BUTTON_LEFT|BUTTON_REPEAT, BUTTON_LEFT},
|
||||
{ACTION_NONE, BUTTON_RIGHT|BUTTON_REPEAT, BUTTON_RIGHT},
|
||||
#endif
|
||||
#if CONFIG_KEYPAD == ONDIO_PAD
|
||||
{PF_SELECT, BUTTON_UP|BUTTON_REL, BUTTON_UP},
|
||||
|
@ -77,9 +81,8 @@ const struct button_mapping pf_context_album_scroll[] =
|
|||
{ACTION_NONE, BUTTON_UP, BUTTON_NONE},
|
||||
{ACTION_NONE, BUTTON_DOWN, BUTTON_NONE},
|
||||
{ACTION_NONE, BUTTON_DOWN|BUTTON_REPEAT, BUTTON_NONE},
|
||||
{ACTION_NONE, BUTTON_RIGHT|BUTTON_REL, BUTTON_RIGHT},
|
||||
#endif
|
||||
LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_CUSTOM|1)
|
||||
LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_PLUGIN|1)
|
||||
};
|
||||
#endif /* !defined(HAVE_SCROLLWHEEL) */
|
||||
|
||||
|
@ -132,7 +135,7 @@ const struct button_mapping pf_context_buttons[] =
|
|||
#if CONFIG_KEYPAD == IAUDIO_M3_PAD
|
||||
LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD|CONTEXT_REMOTE)
|
||||
#else
|
||||
LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD)
|
||||
LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_TREE)
|
||||
#endif
|
||||
};
|
||||
const struct button_mapping *pf_contexts[] =
|
||||
|
@ -681,7 +684,7 @@ const struct custom_format format_transposed = {
|
|||
|
||||
static const struct button_mapping* get_context_map(int context)
|
||||
{
|
||||
return pf_contexts[context & ~CONTEXT_CUSTOM];
|
||||
return pf_contexts[context & ~CONTEXT_PLUGIN];
|
||||
}
|
||||
|
||||
/* Create the lookup table with the scaling values for the reflections */
|
||||
|
@ -2596,7 +2599,7 @@ int main(void)
|
|||
rb->yield();
|
||||
|
||||
/*/ Handle buttons */
|
||||
button = rb->get_custom_action(CONTEXT_CUSTOM
|
||||
button = rb->get_custom_action(CONTEXT_PLUGIN
|
||||
#if !defined(HAVE_SCROLLWHEEL)
|
||||
|(pf_state == pf_show_tracks ? 1 : 0)
|
||||
#endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue