forked from len0rd/rockbox
button.h cleanup, with the future "button action" thing in mind:
1) Main unit's button defines are from the LSB to the MSB (currently bits 0-9, 0x00000200), remote ones are from the 20th bit (0x00100000) downards to 10th(0x00000400); 2) Removed the BUTTON_REMOTE modifier, replaced with a bitmask of all of the remote buttons (where applicable, otherwise with 0), added a complementary BUTTON_MAIN bitmask; 3) Moved button modifiers: - BUTTON_REPEAT: to bit 26 (0x04000000) - BUTTON_REL: to bit 25 (0x02000000) There are at least 4 bits free on all targets now: 21-24. If we really need more free bits, it's possible to SHR remote buttons 1 bit more (freeing bit 20 too), and to change the SYS_EVENT bit with a bitmask (+2 bits). 4) Bumped up the min. plugin ver. (and sorted the plugin api struct), because the binary plugins with key input won't understand the new values git-svn-id: svn://svn.rockbox.org/rockbox/trunk@9149 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
16f7aa76d0
commit
f53f64a615
3 changed files with 257 additions and 149 deletions
|
@ -99,12 +99,12 @@
|
|||
#define PLUGIN_MAGIC 0x526F634B /* RocK */
|
||||
|
||||
/* increase this every time the api struct changes */
|
||||
#define PLUGIN_API_VERSION 12
|
||||
#define PLUGIN_API_VERSION 13
|
||||
|
||||
/* update this to latest version if a change to the api struct breaks
|
||||
backwards compatibility (and please take the opportunity to sort in any
|
||||
new function which are "waiting" at the end of the function table) */
|
||||
#define PLUGIN_MIN_API_VERSION 11
|
||||
#define PLUGIN_MIN_API_VERSION 13
|
||||
|
||||
/* plugin return codes */
|
||||
enum plugin_status {
|
||||
|
@ -229,7 +229,7 @@ struct plugin_api {
|
|||
long (*button_get_w_tmo)(int ticks);
|
||||
int (*button_status)(void);
|
||||
void (*button_clear_queue)(void);
|
||||
#if CONFIG_KEYPAD == IRIVER_H100_PAD
|
||||
#ifdef HAS_BUTTON_HOLD
|
||||
bool (*button_hold)(void);
|
||||
#endif
|
||||
|
||||
|
@ -414,6 +414,11 @@ struct plugin_api {
|
|||
void (*menu_insert)(int menu, int position, char *desc, bool (*function) (void));
|
||||
void (*menu_set_cursor)(int menu, int position);
|
||||
|
||||
bool (*set_option)(const char* string, void* variable,
|
||||
enum optiontype type, const struct opt_items* options,
|
||||
int numoptions, void (*function)(int));
|
||||
|
||||
|
||||
/* power */
|
||||
int (*battery_level)(void);
|
||||
bool (*battery_level_safe)(void);
|
||||
|
@ -476,16 +481,6 @@ struct plugin_api {
|
|||
/* new stuff at the end, sort into place next time
|
||||
the API gets incompatible */
|
||||
|
||||
#if CONFIG_KEYPAD == IRIVER_H300_PAD || CONFIG_KEYPAD == IPOD_4G_PAD
|
||||
/* NOTE: This is already in the plugin api for the H100 - but we put it
|
||||
at the end for other targets to keep the plugin api compatible */
|
||||
bool (*button_hold)(void);
|
||||
#endif
|
||||
/* options */
|
||||
bool (*set_option)(const char* string, void* variable,
|
||||
enum optiontype type, const struct opt_items* options,
|
||||
int numoptions, void (*function)(int));
|
||||
|
||||
};
|
||||
|
||||
/* plugin header */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue