summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Martitz <kugel@rockbox.org>2009-08-03 15:09:41 +0000
committerThomas Martitz <kugel@rockbox.org>2009-08-03 15:09:41 +0000
commit2287dd9daaf62e8624755c41f2a0571c5b9d3357 (patch)
tree4cc9346e7430a667cb8521b8d2ee285470efff73
parent3b75c86d74937a6bffcb371bb08bdfb182db9d2b (diff)
downloadrockbox-2287dd9daaf62e8624755c41f2a0571c5b9d3357.tar.gz
rockbox-2287dd9daaf62e8624755c41f2a0571c5b9d3357.zip
Remove find_albumart() from the plugin API as it doesn't exist for them.
Remove lcd_set_viewport() too, and replace the calls with the appropriate multi-screen api calls as calling lcd_* functions should be avoided in favor of the api. Bump API version and sort a bit. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@22140 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--apps/plugin.c9
-rw-r--r--apps/plugin.h14
-rw-r--r--apps/plugins/lib/pluginlib_touchscreen.c4
-rw-r--r--apps/plugins/reversi/reversi-gui.c8
4 files changed, 14 insertions, 21 deletions
diff --git a/apps/plugin.c b/apps/plugin.c
index 52565b82cc..d66cccbc85 100644
--- a/apps/plugin.c
+++ b/apps/plugin.c
@@ -367,6 +367,9 @@ static const struct plugin_api rockbox_api = {
367 queue_reply, 367 queue_reply,
368#endif 368#endif
369 usb_acknowledge, 369 usb_acknowledge,
370#if defined(HAVE_USBSTACK) && defined(USB_ENABLE_HID)
371 usb_hid_send,
372#endif
370#ifdef RB_PROFILE 373#ifdef RB_PROFILE
371 profile_thread, 374 profile_thread,
372 profstop, 375 profstop,
@@ -651,7 +654,6 @@ static const struct plugin_api rockbox_api = {
651#endif 654#endif
652 655
653#ifdef HAVE_ALBUMART 656#ifdef HAVE_ALBUMART
654 find_albumart,
655 search_albumart_files, 657 search_albumart_files,
656#endif 658#endif
657 659
@@ -665,11 +667,6 @@ static const struct plugin_api rockbox_api = {
665 /* new stuff at the end, sort into place next time 667 /* new stuff at the end, sort into place next time
666 the API gets incompatible */ 668 the API gets incompatible */
667 669
668#if defined(HAVE_USBSTACK) && defined(USB_ENABLE_HID)
669 usb_hid_send,
670#endif
671
672 lcd_set_viewport,
673}; 670};
674 671
675int plugin_load(const char* plugin, const void* parameter) 672int plugin_load(const char* plugin, const void* parameter)
diff --git a/apps/plugin.h b/apps/plugin.h
index d2130f48df..9413a38553 100644
--- a/apps/plugin.h
+++ b/apps/plugin.h
@@ -133,12 +133,12 @@ void* plugin_get_buffer(size_t *buffer_size);
133#define PLUGIN_MAGIC 0x526F634B /* RocK */ 133#define PLUGIN_MAGIC 0x526F634B /* RocK */
134 134
135/* increase this every time the api struct changes */ 135/* increase this every time the api struct changes */
136#define PLUGIN_API_VERSION 165 136#define PLUGIN_API_VERSION 166
137 137
138/* update this to latest version if a change to the api struct breaks 138/* update this to latest version if a change to the api struct breaks
139 backwards compatibility (and please take the opportunity to sort in any 139 backwards compatibility (and please take the opportunity to sort in any
140 new function which are "waiting" at the end of the function table) */ 140 new function which are "waiting" at the end of the function table) */
141#define PLUGIN_MIN_API_VERSION 164 141#define PLUGIN_MIN_API_VERSION 166
142 142
143/* plugin return codes */ 143/* plugin return codes */
144enum plugin_status { 144enum plugin_status {
@@ -491,6 +491,9 @@ struct plugin_api {
491#endif /* CONFIG_CODEC == SWCODEC */ 491#endif /* CONFIG_CODEC == SWCODEC */
492 492
493 void (*usb_acknowledge)(long id); 493 void (*usb_acknowledge)(long id);
494#if defined(HAVE_USBSTACK) && defined(USB_ENABLE_HID)
495 void (*usb_hid_send)(usage_page_t usage_page, int id);
496#endif
494#ifdef RB_PROFILE 497#ifdef RB_PROFILE
495 void (*profile_thread)(void); 498 void (*profile_thread)(void);
496 void (*profstop)(void); 499 void (*profstop)(void);
@@ -818,7 +821,6 @@ struct plugin_api {
818#endif 821#endif
819 822
820#ifdef HAVE_ALBUMART 823#ifdef HAVE_ALBUMART
821 bool (*find_albumart)(const struct mp3entry *id3, char *buf, int buflen);
822 bool (*search_albumart_files)(const struct mp3entry *id3, const char *size_string, 824 bool (*search_albumart_files)(const struct mp3entry *id3, const char *size_string,
823 char *buf, int buflen); 825 char *buf, int buflen);
824#endif 826#endif
@@ -832,12 +834,6 @@ struct plugin_api {
832 const char *appsversion; 834 const char *appsversion;
833 /* new stuff at the end, sort into place next time 835 /* new stuff at the end, sort into place next time
834 the API gets incompatible */ 836 the API gets incompatible */
835
836#if defined(HAVE_USBSTACK) && defined(USB_ENABLE_HID)
837 void (*usb_hid_send)(usage_page_t usage_page, int id);
838#endif
839
840 void (*lcd_set_viewport)(struct viewport* vp);
841}; 837};
842 838
843/* plugin header */ 839/* plugin header */
diff --git a/apps/plugins/lib/pluginlib_touchscreen.c b/apps/plugins/lib/pluginlib_touchscreen.c
index eb023b064c..3168b46ac8 100644
--- a/apps/plugins/lib/pluginlib_touchscreen.c
+++ b/apps/plugins/lib/pluginlib_touchscreen.c
@@ -98,7 +98,7 @@ void touchbutton_draw(struct touchbutton *data, int num_buttons) {
98 /* Set the current viewport to the button so that all drawing 98 /* Set the current viewport to the button so that all drawing
99 * operations are within the button location. 99 * operations are within the button location.
100 */ 100 */
101 rb->lcd_set_viewport(&data[i].vp); 101 rb->screens[SCREEN_MAIN]->set_viewport(&data[i].vp);
102 102
103 /* Get the string size so that the title can be centered. */ 103 /* Get the string size so that the title can be centered. */
104 rb->lcd_getstringsize(data[i].title, &title_width, &title_height); 104 rb->lcd_getstringsize(data[i].title, &title_width, &title_height);
@@ -132,7 +132,7 @@ void touchbutton_draw(struct touchbutton *data, int num_buttons) {
132 rb->lcd_drawrect( 0, 0, data[i].vp.width, data[i].vp.height); 132 rb->lcd_drawrect( 0, 0, data[i].vp.width, data[i].vp.height);
133 } 133 }
134 } 134 }
135 rb->lcd_set_viewport(NULL); /* Go back to the default viewport */ 135 rb->screens[SCREEN_MAIN]->set_viewport(NULL); /* Go back to the default viewport */
136} 136}
137 137
138/******************************************************************************* 138/*******************************************************************************
diff --git a/apps/plugins/reversi/reversi-gui.c b/apps/plugins/reversi/reversi-gui.c
index 630ea5a0e1..c006965bd3 100644
--- a/apps/plugins/reversi/reversi-gui.c
+++ b/apps/plugins/reversi/reversi-gui.c
@@ -336,9 +336,9 @@ static void reversi_gui_display_board(void) {
336#endif 336#endif
337#endif 337#endif
338 338
339 rb->lcd_set_viewport(&tempvp); 339 rb->screens[SCREEN_MAIN]->set_viewport(&tempvp);
340 rb->lcd_puts_scroll(0, 0, buf); 340 rb->lcd_puts_scroll(0, 0, buf);
341 rb->lcd_set_viewport(NULL); 341 rb->screens[SCREEN_MAIN]->set_viewport(NULL);
342 342
343 y = LEGEND_Y(1); 343 y = LEGEND_Y(1);
344 344
@@ -346,9 +346,9 @@ static void reversi_gui_display_board(void) {
346 rb->snprintf(buf, sizeof(buf), "%01d", r); 346 rb->snprintf(buf, sizeof(buf), "%01d", r);
347 347
348 tempvp.y=y; 348 tempvp.y=y;
349 rb->lcd_set_viewport(&tempvp); 349 rb->screens[SCREEN_MAIN]->set_viewport(&tempvp);
350 rb->lcd_puts_scroll(0, 0, buf); 350 rb->lcd_puts_scroll(0, 0, buf);
351 rb->lcd_set_viewport(NULL); 351 rb->screens[SCREEN_MAIN]->set_viewport(NULL);
352 352
353 /* Draw the box around the current player */ 353 /* Draw the box around the current player */
354 r = (cur_player == BLACK ? 0 : 1); 354 r = (cur_player == BLACK ? 0 : 1);