diff options
Diffstat (limited to 'apps/plugin.h')
-rw-r--r-- | apps/plugin.h | 71 |
1 files changed, 35 insertions, 36 deletions
diff --git a/apps/plugin.h b/apps/plugin.h index f504bacf22..7cda354808 100644 --- a/apps/plugin.h +++ b/apps/plugin.h | |||
@@ -48,6 +48,7 @@ | |||
48 | #include "pcm_playback.h" | 48 | #include "pcm_playback.h" |
49 | #endif | 49 | #endif |
50 | #include "settings.h" | 50 | #include "settings.h" |
51 | #include "timer.h" | ||
51 | #include "thread.h" | 52 | #include "thread.h" |
52 | #include "playlist.h" | 53 | #include "playlist.h" |
53 | #ifdef HAVE_LCD_BITMAP | 54 | #ifdef HAVE_LCD_BITMAP |
@@ -87,12 +88,12 @@ | |||
87 | #endif | 88 | #endif |
88 | 89 | ||
89 | /* increase this every time the api struct changes */ | 90 | /* increase this every time the api struct changes */ |
90 | #define PLUGIN_API_VERSION 46 | 91 | #define PLUGIN_API_VERSION 47 |
91 | 92 | ||
92 | /* update this to latest version if a change to the api struct breaks | 93 | /* update this to latest version if a change to the api struct breaks |
93 | backwards compatibility (and please take the opportunity to sort in any | 94 | backwards compatibility (and please take the opportunity to sort in any |
94 | new function which are "waiting" at the end of the function table) */ | 95 | new function which are "waiting" at the end of the function table) */ |
95 | #define PLUGIN_MIN_API_VERSION 42 | 96 | #define PLUGIN_MIN_API_VERSION 47 |
96 | 97 | ||
97 | /* plugin return codes */ | 98 | /* plugin return codes */ |
98 | enum plugin_status { | 99 | enum plugin_status { |
@@ -168,6 +169,23 @@ struct plugin_api { | |||
168 | int stride, int x, int y, int width, int height); | 169 | int stride, int x, int y, int width, int height); |
169 | void (*lcd_mono_bitmap)(const unsigned char *src, int x, int y, | 170 | void (*lcd_mono_bitmap)(const unsigned char *src, int x, int y, |
170 | int width, int height); | 171 | int width, int height); |
172 | #if LCD_DEPTH > 1 | ||
173 | #ifdef HAVE_LCD_COLOR | ||
174 | void (*lcd_set_foreground)(struct rgb color); | ||
175 | struct rgb (*lcd_get_foreground)(void); | ||
176 | void (*lcd_set_background)(struct rgb color); | ||
177 | struct rgb (*lcd_get_background)(void); | ||
178 | #else | ||
179 | void (*lcd_set_foreground)(int brightness); | ||
180 | int (*lcd_get_foreground)(void); | ||
181 | void (*lcd_set_background)(int brightness); | ||
182 | int (*lcd_get_background)(void); | ||
183 | #endif | ||
184 | void (*lcd_bitmap_part)(const unsigned char *src, int src_x, int src_y, | ||
185 | int stride, int x, int y, int width, int height); | ||
186 | void (*lcd_bitmap)(const unsigned char *src, int x, int y, int width, | ||
187 | int height); | ||
188 | #endif | ||
171 | void (*lcd_putsxy)(int x, int y, const unsigned char *string); | 189 | void (*lcd_putsxy)(int x, int y, const unsigned char *string); |
172 | void (*lcd_puts_style)(int x, int y, const unsigned char *str, int style); | 190 | void (*lcd_puts_style)(int x, int y, const unsigned char *str, int style); |
173 | void (*lcd_puts_scroll_style)(int x, int y, const unsigned char* string, | 191 | void (*lcd_puts_scroll_style)(int x, int y, const unsigned char* string, |
@@ -181,6 +199,8 @@ struct plugin_api { | |||
181 | int min_shown, int max_shown, int orientation); | 199 | int min_shown, int max_shown, int orientation); |
182 | void (*checkbox)(int x, int y, int width, int height, bool checked); | 200 | void (*checkbox)(int x, int y, int width, int height, bool checked); |
183 | struct font* (*font_get)(int font); | 201 | struct font* (*font_get)(int font); |
202 | int (*font_getstringsize)(const unsigned char *str, int *w, int *h, | ||
203 | int fontnumber); | ||
184 | #endif | 204 | #endif |
185 | void (*backlight_on)(void); | 205 | void (*backlight_on)(void); |
186 | void (*backlight_off)(void); | 206 | void (*backlight_off)(void); |
@@ -272,6 +292,11 @@ struct plugin_api { | |||
272 | #ifdef HAVE_ADJUSTABLE_CPU_FREQ | 292 | #ifdef HAVE_ADJUSTABLE_CPU_FREQ |
273 | void (*cpu_boost)(bool on_off); | 293 | void (*cpu_boost)(bool on_off); |
274 | #endif | 294 | #endif |
295 | bool (*timer_register)(int reg_prio, void (*unregister_callback)(void), | ||
296 | long cycles, int int_prio, | ||
297 | void (*timer_callback)(void)); | ||
298 | void (*timer_unregister)(void); | ||
299 | bool (*timer_set_period)(long count); | ||
275 | #endif | 300 | #endif |
276 | 301 | ||
277 | /* strings and memory */ | 302 | /* strings and memory */ |
@@ -281,6 +306,7 @@ struct plugin_api { | |||
281 | size_t (*strlen)(const char *str); | 306 | size_t (*strlen)(const char *str); |
282 | char * (*strrchr)(const char *s, int c); | 307 | char * (*strrchr)(const char *s, int c); |
283 | int (*strcmp)(const char *, const char *); | 308 | int (*strcmp)(const char *, const char *); |
309 | int (*strncmp)(const char *, const char *, size_t); | ||
284 | int (*strcasecmp)(const char *, const char *); | 310 | int (*strcasecmp)(const char *, const char *); |
285 | int (*strncasecmp)(const char *s1, const char *s2, size_t n); | 311 | int (*strncasecmp)(const char *s1, const char *s2, size_t n); |
286 | void* (*memset)(void *dst, int c, size_t length); | 312 | void* (*memset)(void *dst, int c, size_t length); |
@@ -350,6 +376,10 @@ struct plugin_api { | |||
350 | int *tagdb_fd; | 376 | int *tagdb_fd; |
351 | int *tagdb_initialized; | 377 | int *tagdb_initialized; |
352 | int (*tagdb_init) (void); | 378 | int (*tagdb_init) (void); |
379 | /* runtime database */ | ||
380 | struct rundb_header *rundbheader; | ||
381 | int *rundb_fd; | ||
382 | int *rundb_initialized; | ||
353 | 383 | ||
354 | /* misc */ | 384 | /* misc */ |
355 | void (*srand)(unsigned int seed); | 385 | void (*srand)(unsigned int seed); |
@@ -361,14 +391,13 @@ struct plugin_api { | |||
361 | int (*set_time)(const struct tm *tm); | 391 | int (*set_time)(const struct tm *tm); |
362 | void* (*plugin_get_buffer)(int* buffer_size); | 392 | void* (*plugin_get_buffer)(int* buffer_size); |
363 | void* (*plugin_get_audio_buffer)(int* buffer_size); | 393 | void* (*plugin_get_audio_buffer)(int* buffer_size); |
364 | #ifndef SIMULATOR | ||
365 | int (*plugin_register_timer)(int cycles, int prio, void (*timer_callback)(void)); | ||
366 | void (*plugin_unregister_timer)(void); | ||
367 | #endif | ||
368 | void (*plugin_tsr)(void (*exit_callback)(void)); | 394 | void (*plugin_tsr)(void (*exit_callback)(void)); |
369 | #if defined(DEBUG) || defined(SIMULATOR) | 395 | #if defined(DEBUG) || defined(SIMULATOR) |
370 | void (*debugf)(const char *fmt, ...); | 396 | void (*debugf)(const char *fmt, ...); |
371 | #endif | 397 | #endif |
398 | #ifdef ROCKBOX_HAS_LOGF | ||
399 | void (*logf)(const char *fmt, ...); | ||
400 | #endif | ||
372 | struct user_settings* global_settings; | 401 | struct user_settings* global_settings; |
373 | bool (*mp3info)(struct mp3entry *entry, const char *filename, bool v1first); | 402 | bool (*mp3info)(struct mp3entry *entry, const char *filename, bool v1first); |
374 | int (*count_mp3_frames)(int fd, int startpos, int filesize, | 403 | int (*count_mp3_frames)(int fd, int startpos, int filesize, |
@@ -395,41 +424,11 @@ struct plugin_api { | |||
395 | /* new stuff at the end, sort into place next time | 424 | /* new stuff at the end, sort into place next time |
396 | the API gets incompatible */ | 425 | the API gets incompatible */ |
397 | 426 | ||
398 | #ifdef ROCKBOX_HAS_LOGF | ||
399 | void (*logf)(const char *fmt, ...); | ||
400 | #endif | ||
401 | struct rundb_header *rundbheader; | ||
402 | int *rundb_fd; | ||
403 | int *rundb_initialized; | ||
404 | int (*strncmp)(const char *, const char *, size_t); | ||
405 | #if LCD_DEPTH > 1 | ||
406 | #ifdef HAVE_LCD_COLOR | ||
407 | void (*lcd_set_foreground)(struct rgb color); | ||
408 | struct rgb (*lcd_get_foreground)(void); | ||
409 | void (*lcd_set_background)(struct rgb color); | ||
410 | struct rgb (*lcd_get_background)(void); | ||
411 | #else | ||
412 | void (*lcd_set_foreground)(int brightness); | ||
413 | int (*lcd_get_foreground)(void); | ||
414 | void (*lcd_set_background)(int brightness); | ||
415 | int (*lcd_get_background)(void); | ||
416 | #endif | ||
417 | void (*lcd_bitmap_part)(const unsigned char *src, int src_x, int src_y, | ||
418 | int stride, int x, int y, int width, int height); | ||
419 | void (*lcd_bitmap)(const unsigned char *src, int x, int y, int width, | ||
420 | int height); | ||
421 | #endif | ||
422 | #ifdef HAVE_LCD_BITMAP | ||
423 | int (*font_getstringsize)(const unsigned char *str, int *w, int *h, | ||
424 | int fontnumber); | ||
425 | #endif | ||
426 | }; | 427 | }; |
427 | 428 | ||
428 | int plugin_load(const char* plugin, void* parameter); | 429 | int plugin_load(const char* plugin, void* parameter); |
429 | void* plugin_get_buffer(int *buffer_size); | 430 | void* plugin_get_buffer(int *buffer_size); |
430 | void* plugin_get_audio_buffer(int *buffer_size); | 431 | void* plugin_get_audio_buffer(int *buffer_size); |
431 | int plugin_register_timer(int cycles, int prio, void (*timer_callback)(void)); | ||
432 | void plugin_unregister_timer(void); | ||
433 | void plugin_tsr(void (*exit_callback)(void)); | 432 | void plugin_tsr(void (*exit_callback)(void)); |
434 | 433 | ||
435 | /* defined by the plugin */ | 434 | /* defined by the plugin */ |