diff options
Diffstat (limited to 'apps/plugin.h')
-rw-r--r-- | apps/plugin.h | 90 |
1 files changed, 47 insertions, 43 deletions
diff --git a/apps/plugin.h b/apps/plugin.h index 3d9161a456..286ca4087f 100644 --- a/apps/plugin.h +++ b/apps/plugin.h | |||
@@ -97,12 +97,12 @@ | |||
97 | #define PLUGIN_MAGIC 0x526F634B /* RocK */ | 97 | #define PLUGIN_MAGIC 0x526F634B /* RocK */ |
98 | 98 | ||
99 | /* increase this every time the api struct changes */ | 99 | /* increase this every time the api struct changes */ |
100 | #define PLUGIN_API_VERSION 6 | 100 | #define PLUGIN_API_VERSION 7 |
101 | 101 | ||
102 | /* update this to latest version if a change to the api struct breaks | 102 | /* update this to latest version if a change to the api struct breaks |
103 | backwards compatibility (and please take the opportunity to sort in any | 103 | backwards compatibility (and please take the opportunity to sort in any |
104 | new function which are "waiting" at the end of the function table) */ | 104 | new function which are "waiting" at the end of the function table) */ |
105 | #define PLUGIN_MIN_API_VERSION 2 | 105 | #define PLUGIN_MIN_API_VERSION 7 |
106 | 106 | ||
107 | /* plugin return codes */ | 107 | /* plugin return codes */ |
108 | enum plugin_status { | 108 | enum plugin_status { |
@@ -162,6 +162,13 @@ struct plugin_api { | |||
162 | void (*lcd_bitmap)(const fb_data *src, int x, int y, int width, | 162 | void (*lcd_bitmap)(const fb_data *src, int x, int y, int width, |
163 | int height); | 163 | int height); |
164 | #endif | 164 | #endif |
165 | #if LCD_DEPTH == 16 | ||
166 | void (*lcd_bitmap_transparent_part)(const fb_data *src, | ||
167 | int src_x, int src_y, int stride, | ||
168 | int x, int y, int width, int height); | ||
169 | void (*lcd_bitmap_transparent)(const fb_data *src, int x, int y, | ||
170 | int width, int height); | ||
171 | #endif | ||
165 | void (*lcd_putsxy)(int x, int y, const unsigned char *string); | 172 | void (*lcd_putsxy)(int x, int y, const unsigned char *string); |
166 | void (*lcd_puts_style)(int x, int y, const unsigned char *str, int style); | 173 | void (*lcd_puts_style)(int x, int y, const unsigned char *str, int style); |
167 | void (*lcd_puts_scroll_style)(int x, int y, const unsigned char* string, | 174 | void (*lcd_puts_scroll_style)(int x, int y, const unsigned char* string, |
@@ -246,6 +253,7 @@ struct plugin_api { | |||
246 | bool (*settings_parseline)(char* line, char** name, char** value); | 253 | bool (*settings_parseline)(char* line, char** name, char** value); |
247 | #ifndef SIMULATOR | 254 | #ifndef SIMULATOR |
248 | void (*ata_sleep)(void); | 255 | void (*ata_sleep)(void); |
256 | bool (*ata_disk_is_active)(void); | ||
249 | #endif | 257 | #endif |
250 | 258 | ||
251 | /* dir */ | 259 | /* dir */ |
@@ -275,6 +283,18 @@ struct plugin_api { | |||
275 | void (*timer_unregister)(void); | 283 | void (*timer_unregister)(void); |
276 | bool (*timer_set_period)(long count); | 284 | bool (*timer_set_period)(long count); |
277 | #endif | 285 | #endif |
286 | void (*queue_init)(struct event_queue *q); | ||
287 | void (*queue_delete)(struct event_queue *q); | ||
288 | void (*queue_post)(struct event_queue *q, long id, void *data); | ||
289 | void (*queue_wait_w_tmo)(struct event_queue *q, struct event *ev, | ||
290 | int ticks); | ||
291 | void (*usb_acknowledge)(long id); | ||
292 | #ifdef RB_PROFILE | ||
293 | void (*profile_thread)(void); | ||
294 | void (*profstop)(void); | ||
295 | void (*profile_func_enter)(void *this_fn, void *call_site); | ||
296 | void (*profile_func_exit)(void *this_fn, void *call_site); | ||
297 | #endif | ||
278 | 298 | ||
279 | /* strings and memory */ | 299 | /* strings and memory */ |
280 | int (*snprintf)(char *buf, size_t size, const char *fmt, ...); | 300 | int (*snprintf)(char *buf, size_t size, const char *fmt, ...); |
@@ -288,6 +308,7 @@ struct plugin_api { | |||
288 | int (*strncasecmp)(const char *s1, const char *s2, size_t n); | 308 | int (*strncasecmp)(const char *s1, const char *s2, size_t n); |
289 | void* (*memset)(void *dst, int c, size_t length); | 309 | void* (*memset)(void *dst, int c, size_t length); |
290 | void* (*memcpy)(void *out, const void *in, size_t n); | 310 | void* (*memcpy)(void *out, const void *in, size_t n); |
311 | void* (*memmove)(void *out, const void *in, size_t n); | ||
291 | const unsigned char *_ctype_; | 312 | const unsigned char *_ctype_; |
292 | int (*atoi)(const char *str); | 313 | int (*atoi)(const char *str); |
293 | char *(*strchr)(const char *s, int c); | 314 | char *(*strchr)(const char *s, int c); |
@@ -315,7 +336,8 @@ struct plugin_api { | |||
315 | void (*bitswap)(unsigned char *data, int length); | 336 | void (*bitswap)(unsigned char *data, int length); |
316 | #endif | 337 | #endif |
317 | #if CONFIG_CODEC == SWCODEC | 338 | #if CONFIG_CODEC == SWCODEC |
318 | void (*pcm_play_data)(void (*get_more)(unsigned char** start, long*size)); | 339 | void (*pcm_play_data)(void (*get_more)(unsigned char** start, size_t*size), |
340 | unsigned char* start, size_t size); | ||
319 | void (*pcm_play_stop)(void); | 341 | void (*pcm_play_stop)(void); |
320 | void (*pcm_set_frequency)(unsigned int frequency); | 342 | void (*pcm_set_frequency)(unsigned int frequency); |
321 | bool (*pcm_is_playing)(void); | 343 | bool (*pcm_is_playing)(void); |
@@ -384,6 +406,23 @@ struct plugin_api { | |||
384 | void (*menu_insert)(int menu, int position, char *desc, bool (*function) (void)); | 406 | void (*menu_insert)(int menu, int position, char *desc, bool (*function) (void)); |
385 | void (*menu_set_cursor)(int menu, int position); | 407 | void (*menu_set_cursor)(int menu, int position); |
386 | 408 | ||
409 | /* power */ | ||
410 | int (*battery_level)(void); | ||
411 | bool (*battery_level_safe)(void); | ||
412 | int (*battery_time)(void); | ||
413 | #ifndef SIMULATOR | ||
414 | unsigned int (*battery_voltage)(void); | ||
415 | #endif | ||
416 | #ifdef HAVE_CHARGING | ||
417 | bool (*charger_inserted)(void); | ||
418 | # ifdef HAVE_CHARGE_STATE | ||
419 | bool (*charging_state)(void); | ||
420 | # endif | ||
421 | #endif | ||
422 | #ifdef HAVE_USB_POWER | ||
423 | bool (*usb_powered)(void); | ||
424 | #endif | ||
425 | |||
387 | /* misc */ | 426 | /* misc */ |
388 | void (*srand)(unsigned int seed); | 427 | void (*srand)(unsigned int seed); |
389 | int (*rand)(void); | 428 | int (*rand)(void); |
@@ -406,13 +445,12 @@ struct plugin_api { | |||
406 | int (*count_mp3_frames)(int fd, int startpos, int filesize, | 445 | int (*count_mp3_frames)(int fd, int startpos, int filesize, |
407 | void (*progressfunc)(int)); | 446 | void (*progressfunc)(int)); |
408 | int (*create_xing_header)(int fd, long startpos, long filesize, | 447 | int (*create_xing_header)(int fd, long startpos, long filesize, |
409 | unsigned char *buf, unsigned long num_frames, | 448 | unsigned char *buf, unsigned long num_frames, |
410 | unsigned long rec_time, unsigned long header_template, | 449 | unsigned long rec_time, unsigned long header_template, |
411 | void (*progressfunc)(int), bool generate_toc); | 450 | void (*progressfunc)(int), bool generate_toc); |
412 | unsigned long (*find_next_frame)(int fd, long *offset, | 451 | unsigned long (*find_next_frame)(int fd, long *offset, |
413 | long max_offset, unsigned long last_header); | 452 | long max_offset, unsigned long last_header); |
414 | int (*battery_level)(void); | 453 | |
415 | bool (*battery_level_safe)(void); | ||
416 | #if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F) | 454 | #if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F) |
417 | unsigned short (*peak_meter_scale_value)(unsigned short val, | 455 | unsigned short (*peak_meter_scale_value)(unsigned short val, |
418 | int meterwidth); | 456 | int meterwidth); |
@@ -429,40 +467,6 @@ struct plugin_api { | |||
429 | /* new stuff at the end, sort into place next time | 467 | /* new stuff at the end, sort into place next time |
430 | the API gets incompatible */ | 468 | the API gets incompatible */ |
431 | 469 | ||
432 | #ifdef RB_PROFILE | ||
433 | void (*profile_thread)(void); | ||
434 | void (*profstop)(void); | ||
435 | void (*profile_func_enter)(void *this_fn, void *call_site); | ||
436 | void (*profile_func_exit)(void *this_fn, void *call_site); | ||
437 | #endif | ||
438 | int (*battery_time)(void); | ||
439 | #ifndef SIMULATOR | ||
440 | bool (*ata_disk_is_active)(void); | ||
441 | unsigned int (*battery_voltage)(void); | ||
442 | #endif | ||
443 | void (*queue_init)(struct event_queue *q); | ||
444 | void (*queue_delete)(struct event_queue *q); | ||
445 | void (*queue_post)(struct event_queue *q, long id, void *data); | ||
446 | void (*queue_wait_w_tmo)(struct event_queue *q, struct event *ev, int ticks); | ||
447 | void (*usb_acknowledge)(long id); | ||
448 | #if LCD_DEPTH == 16 | ||
449 | void (*lcd_bitmap_transparent_part)(const fb_data *src, int src_x, int src_y, | ||
450 | int stride, int x, int y, int width, int height); | ||
451 | void (*lcd_bitmap_transparent)(const fb_data *src, int x, int y, | ||
452 | int width, int height); | ||
453 | #endif | ||
454 | void* (*memmove)(void *out, const void *in, size_t n); | ||
455 | |||
456 | #ifdef HAVE_CHARGING | ||
457 | bool (*charger_inserted)(void); | ||
458 | # ifdef HAVE_CHARGE_STATE | ||
459 | bool (*charging_state)(void); | ||
460 | # endif | ||
461 | #endif | ||
462 | #ifdef HAVE_USB_POWER | ||
463 | bool (*usb_powered)(void); | ||
464 | #endif | ||
465 | |||
466 | }; | 470 | }; |
467 | 471 | ||
468 | /* plugin header */ | 472 | /* plugin header */ |