diff options
author | Jens Arnold <amiconn@rockbox.org> | 2004-10-23 09:59:53 +0000 |
---|---|---|
committer | Jens Arnold <amiconn@rockbox.org> | 2004-10-23 09:59:53 +0000 |
commit | 1c841b8c403b5ed9398e20f03c4983c386ceaca9 (patch) | |
tree | c661704c03fec3609cd96d2c923ac32e956a0dd3 /apps/plugin.h | |
parent | 957cffad8d8e51e51d51d5c7e81b40519774d584 (diff) | |
download | rockbox-1c841b8c403b5ed9398e20f03c4983c386ceaca9.tar.gz rockbox-1c841b8c403b5ed9398e20f03c4983c386ceaca9.zip |
Removed usb_screen() from the api. All plugins should use the default event handlers instead. Added battery_level_safe(). Sorted api & bumped versions.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@5328 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/plugin.h')
-rw-r--r-- | apps/plugin.h | 65 |
1 files changed, 32 insertions, 33 deletions
diff --git a/apps/plugin.h b/apps/plugin.h index 96c4f6fe55..89b9d290d5 100644 --- a/apps/plugin.h +++ b/apps/plugin.h | |||
@@ -60,12 +60,12 @@ | |||
60 | #endif | 60 | #endif |
61 | 61 | ||
62 | /* increase this every time the api struct changes */ | 62 | /* increase this every time the api struct changes */ |
63 | #define PLUGIN_API_VERSION 28 | 63 | #define PLUGIN_API_VERSION 29 |
64 | 64 | ||
65 | /* update this to latest version if a change to the api struct breaks | 65 | /* update this to latest version if a change to the api struct breaks |
66 | backwards compatibility (and please take the opportunity to sort in any | 66 | backwards compatibility (and please take the opportunity to sort in any |
67 | new function which are "waiting" at the end of the function table) */ | 67 | new function which are "waiting" at the end of the function table) */ |
68 | #define PLUGIN_MIN_API_VERSION 25 | 68 | #define PLUGIN_MIN_API_VERSION 29 |
69 | 69 | ||
70 | /* plugin return codes */ | 70 | /* plugin return codes */ |
71 | enum plugin_status { | 71 | enum plugin_status { |
@@ -126,6 +126,8 @@ struct plugin_api { | |||
126 | #else | 126 | #else |
127 | void (*lcd_putsxy)(int x, int y, const unsigned char *string); | 127 | void (*lcd_putsxy)(int x, int y, const unsigned char *string); |
128 | void (*lcd_puts_style)(int x, int y, const unsigned char *str, int style); | 128 | void (*lcd_puts_style)(int x, int y, const unsigned char *str, int style); |
129 | void (*lcd_puts_scroll_style)(int x, int y, const unsigned char* string, | ||
130 | int style); | ||
129 | void (*lcd_bitmap)(const unsigned char *src, int x, int y, | 131 | void (*lcd_bitmap)(const unsigned char *src, int x, int y, |
130 | int nx, int ny, bool clear); | 132 | int nx, int ny, bool clear); |
131 | void (*lcd_drawline)(int x1, int y1, int x2, int y2); | 133 | void (*lcd_drawline)(int x1, int y1, int x2, int y2); |
@@ -153,6 +155,7 @@ struct plugin_api { | |||
153 | #endif | 155 | #endif |
154 | void (*backlight_on)(void); | 156 | void (*backlight_on)(void); |
155 | void (*backlight_off)(void); | 157 | void (*backlight_off)(void); |
158 | void (*backlight_set_timeout)(int index); | ||
156 | void (*splash)(int ticks, bool center, const char *fmt, ...); | 159 | void (*splash)(int ticks, bool center, const char *fmt, ...); |
157 | 160 | ||
158 | /* button */ | 161 | /* button */ |
@@ -184,26 +187,30 @@ struct plugin_api { | |||
184 | int (*closedir)(DIR* dir); | 187 | int (*closedir)(DIR* dir); |
185 | struct dirent* (*readdir)(DIR* dir); | 188 | struct dirent* (*readdir)(DIR* dir); |
186 | 189 | ||
187 | /* kernel */ | 190 | /* kernel/ system */ |
188 | void (*sleep)(int ticks); | 191 | void (*sleep)(int ticks); |
189 | void (*yield)(void); | 192 | void (*yield)(void); |
190 | void (*usb_screen)(void); | ||
191 | long* current_tick; | 193 | long* current_tick; |
192 | int (*default_event_handler)(int event); | 194 | int (*default_event_handler)(int event); |
195 | int (*default_event_handler_ex)(int event, void (*callback)(void *), void *parameter); | ||
193 | int (*create_thread)(void* function, void* stack, int stack_size, const char *name); | 196 | int (*create_thread)(void* function, void* stack, int stack_size, const char *name); |
194 | void (*remove_thread)(int threadnum); | 197 | void (*remove_thread)(int threadnum); |
195 | void (*reset_poweroff_timer)(void); | 198 | void (*reset_poweroff_timer)(void); |
199 | #ifndef SIMULATOR | ||
200 | int (*system_memory_guard)(int newmode); | ||
201 | #endif | ||
196 | 202 | ||
197 | /* strings and memory */ | 203 | /* strings and memory */ |
198 | int (*snprintf)(char *buf, size_t size, const char *fmt, ...); | 204 | int (*snprintf)(char *buf, size_t size, const char *fmt, ...); |
199 | char* (*strcpy)(char *dst, const char *src); | 205 | char* (*strcpy)(char *dst, const char *src); |
200 | char *(*strncpy)(char *dst, const char *src, size_t length); | 206 | char* (*strncpy)(char *dst, const char *src, size_t length); |
201 | size_t (*strlen)(const char *str); | 207 | size_t (*strlen)(const char *str); |
202 | char * (*strrchr)(const char *s, int c); | 208 | char * (*strrchr)(const char *s, int c); |
203 | int (*strcmp)(const char *, const char *); | 209 | int (*strcmp)(const char *, const char *); |
204 | int (*strcasecmp)(const char *, const char *); | 210 | int (*strcasecmp)(const char *, const char *); |
205 | void* (*memset)(void *dst, int c, size_t length); | 211 | int (*strncasecmp)(const char *s1, const char *s2, size_t n); |
206 | void* (*memcpy)(void *out, const void *in, size_t n); | 212 | void* (*memset)(void *dst, int c, size_t length); |
213 | void* (*memcpy)(void *out, const void *in, size_t n); | ||
207 | #ifndef SIMULATOR | 214 | #ifndef SIMULATOR |
208 | const char *_ctype_; | 215 | const char *_ctype_; |
209 | #endif | 216 | #endif |
@@ -232,6 +239,12 @@ struct plugin_api { | |||
232 | int (*mpeg_status)(void); | 239 | int (*mpeg_status)(void); |
233 | bool (*mpeg_has_changed_track)(void); | 240 | bool (*mpeg_has_changed_track)(void); |
234 | struct mp3entry* (*mpeg_current_track)(void); | 241 | struct mp3entry* (*mpeg_current_track)(void); |
242 | void (*mpeg_flush_and_reload_tracks)(void); | ||
243 | int (*mpeg_get_file_pos)(void); | ||
244 | unsigned long (*mpeg_get_last_header)(void); | ||
245 | #if (CONFIG_HWCODEC == MAS3587F) || (CONFIG_HWCODEC == MAS3539F) | ||
246 | void (*mpeg_set_pitch)(int pitch); | ||
247 | #endif | ||
235 | 248 | ||
236 | /* MAS communication */ | 249 | /* MAS communication */ |
237 | #ifndef SIMULATOR | 250 | #ifndef SIMULATOR |
@@ -244,7 +257,7 @@ struct plugin_api { | |||
244 | int (*mas_codec_readreg)(int reg); | 257 | int (*mas_codec_readreg)(int reg); |
245 | #endif | 258 | #endif |
246 | #endif | 259 | #endif |
247 | 260 | ||
248 | /* misc */ | 261 | /* misc */ |
249 | void (*srand)(unsigned int seed); | 262 | void (*srand)(unsigned int seed); |
250 | int (*rand)(void); | 263 | int (*rand)(void); |
@@ -264,7 +277,6 @@ struct plugin_api { | |||
264 | void (*debugf)(const char *fmt, ...); | 277 | void (*debugf)(const char *fmt, ...); |
265 | #endif | 278 | #endif |
266 | struct user_settings* global_settings; | 279 | struct user_settings* global_settings; |
267 | void (*backlight_set_timeout)(int index); | ||
268 | bool (*mp3info)(struct mp3entry *entry, const char *filename, bool v1first); | 280 | bool (*mp3info)(struct mp3entry *entry, const char *filename, bool v1first); |
269 | int (*count_mp3_frames)(int fd, int startpos, int filesize, | 281 | int (*count_mp3_frames)(int fd, int startpos, int filesize, |
270 | void (*progressfunc)(int)); | 282 | void (*progressfunc)(int)); |
@@ -272,33 +284,20 @@ struct plugin_api { | |||
272 | unsigned char *buf, int num_frames, | 284 | unsigned char *buf, int num_frames, |
273 | unsigned long header_template, | 285 | unsigned long header_template, |
274 | void (*progressfunc)(int), bool generate_toc); | 286 | void (*progressfunc)(int), bool generate_toc); |
275 | int (*battery_level)(void); | 287 | unsigned long (*find_next_frame)(int fd, int *offset, |
276 | 288 | int max_offset, unsigned long last_header); | |
277 | /* new stuff at the end, sort into place next time | 289 | int (*battery_level)(void); |
278 | the API gets incompatible */ | 290 | bool (*battery_level_safe)(void); |
279 | |||
280 | #if (CONFIG_HWCODEC == MAS3587F) || (CONFIG_HWCODEC == MAS3539F) | 291 | #if (CONFIG_HWCODEC == MAS3587F) || (CONFIG_HWCODEC == MAS3539F) |
281 | void (*mpeg_set_pitch)(int pitch); | ||
282 | |||
283 | unsigned short (*peak_meter_scale_value)(unsigned short val, | 292 | unsigned short (*peak_meter_scale_value)(unsigned short val, |
284 | int meterwidth); | 293 | int meterwidth); |
285 | void (*peak_meter_set_use_dbfs)(int use); | 294 | void (*peak_meter_set_use_dbfs)(int use); |
286 | int (*peak_meter_get_use_dbfs)(void); | 295 | int (*peak_meter_get_use_dbfs)(void); |
287 | #endif | ||
288 | #ifdef HAVE_LCD_BITMAP | ||
289 | void (*lcd_puts_scroll_style)(int x, int y, const unsigned char* string, | ||
290 | int style); | ||
291 | #endif | ||
292 | void (*mpeg_flush_and_reload_tracks)(void); | ||
293 | int (*strncasecmp)(const char *s1, const char *s2, size_t n); | ||
294 | int (*mpeg_get_file_pos)(void); | ||
295 | unsigned long (*find_next_frame)(int fd, int *offset, | ||
296 | int max_offset, unsigned long last_header); | ||
297 | unsigned long (*mpeg_get_last_header)(void); | ||
298 | #ifndef SIMULATOR | ||
299 | int (*system_memory_guard)(int newmode); | ||
300 | #endif | 296 | #endif |
301 | int (*default_event_handler_ex)(int event, void (*callback)(void *), void *parameter); | 297 | |
298 | /* new stuff at the end, sort into place next time | ||
299 | the API gets incompatible */ | ||
300 | |||
302 | }; | 301 | }; |
303 | 302 | ||
304 | /* defined by the plugin loader (plugin.c) */ | 303 | /* defined by the plugin loader (plugin.c) */ |