1
0
Fork 0
forked from len0rd/rockbox

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
This commit is contained in:
Thomas Martitz 2009-08-03 15:09:41 +00:00
parent 3b75c86d74
commit 2287dd9daa
4 changed files with 14 additions and 21 deletions

View file

@ -367,6 +367,9 @@ static const struct plugin_api rockbox_api = {
queue_reply, queue_reply,
#endif #endif
usb_acknowledge, usb_acknowledge,
#if defined(HAVE_USBSTACK) && defined(USB_ENABLE_HID)
usb_hid_send,
#endif
#ifdef RB_PROFILE #ifdef RB_PROFILE
profile_thread, profile_thread,
profstop, profstop,
@ -651,7 +654,6 @@ static const struct plugin_api rockbox_api = {
#endif #endif
#ifdef HAVE_ALBUMART #ifdef HAVE_ALBUMART
find_albumart,
search_albumart_files, search_albumart_files,
#endif #endif
@ -665,11 +667,6 @@ static const struct plugin_api rockbox_api = {
/* new stuff at the end, sort into place next time /* new stuff at the end, sort into place next time
the API gets incompatible */ the API gets incompatible */
#if defined(HAVE_USBSTACK) && defined(USB_ENABLE_HID)
usb_hid_send,
#endif
lcd_set_viewport,
}; };
int plugin_load(const char* plugin, const void* parameter) int plugin_load(const char* plugin, const void* parameter)

View file

@ -133,12 +133,12 @@ void* plugin_get_buffer(size_t *buffer_size);
#define PLUGIN_MAGIC 0x526F634B /* RocK */ #define PLUGIN_MAGIC 0x526F634B /* RocK */
/* increase this every time the api struct changes */ /* increase this every time the api struct changes */
#define PLUGIN_API_VERSION 165 #define PLUGIN_API_VERSION 166
/* update this to latest version if a change to the api struct breaks /* update this to latest version if a change to the api struct breaks
backwards compatibility (and please take the opportunity to sort in any backwards compatibility (and please take the opportunity to sort in any
new function which are "waiting" at the end of the function table) */ new function which are "waiting" at the end of the function table) */
#define PLUGIN_MIN_API_VERSION 164 #define PLUGIN_MIN_API_VERSION 166
/* plugin return codes */ /* plugin return codes */
enum plugin_status { enum plugin_status {
@ -491,6 +491,9 @@ struct plugin_api {
#endif /* CONFIG_CODEC == SWCODEC */ #endif /* CONFIG_CODEC == SWCODEC */
void (*usb_acknowledge)(long id); void (*usb_acknowledge)(long id);
#if defined(HAVE_USBSTACK) && defined(USB_ENABLE_HID)
void (*usb_hid_send)(usage_page_t usage_page, int id);
#endif
#ifdef RB_PROFILE #ifdef RB_PROFILE
void (*profile_thread)(void); void (*profile_thread)(void);
void (*profstop)(void); void (*profstop)(void);
@ -818,7 +821,6 @@ struct plugin_api {
#endif #endif
#ifdef HAVE_ALBUMART #ifdef HAVE_ALBUMART
bool (*find_albumart)(const struct mp3entry *id3, char *buf, int buflen);
bool (*search_albumart_files)(const struct mp3entry *id3, const char *size_string, bool (*search_albumart_files)(const struct mp3entry *id3, const char *size_string,
char *buf, int buflen); char *buf, int buflen);
#endif #endif
@ -832,12 +834,6 @@ struct plugin_api {
const char *appsversion; const char *appsversion;
/* new stuff at the end, sort into place next time /* new stuff at the end, sort into place next time
the API gets incompatible */ the API gets incompatible */
#if defined(HAVE_USBSTACK) && defined(USB_ENABLE_HID)
void (*usb_hid_send)(usage_page_t usage_page, int id);
#endif
void (*lcd_set_viewport)(struct viewport* vp);
}; };
/* plugin header */ /* plugin header */

View file

@ -98,7 +98,7 @@ void touchbutton_draw(struct touchbutton *data, int num_buttons) {
/* Set the current viewport to the button so that all drawing /* Set the current viewport to the button so that all drawing
* operations are within the button location. * operations are within the button location.
*/ */
rb->lcd_set_viewport(&data[i].vp); rb->screens[SCREEN_MAIN]->set_viewport(&data[i].vp);
/* Get the string size so that the title can be centered. */ /* Get the string size so that the title can be centered. */
rb->lcd_getstringsize(data[i].title, &title_width, &title_height); rb->lcd_getstringsize(data[i].title, &title_width, &title_height);
@ -132,7 +132,7 @@ void touchbutton_draw(struct touchbutton *data, int num_buttons) {
rb->lcd_drawrect( 0, 0, data[i].vp.width, data[i].vp.height); rb->lcd_drawrect( 0, 0, data[i].vp.width, data[i].vp.height);
} }
} }
rb->lcd_set_viewport(NULL); /* Go back to the default viewport */ rb->screens[SCREEN_MAIN]->set_viewport(NULL); /* Go back to the default viewport */
} }
/******************************************************************************* /*******************************************************************************

View file

@ -336,9 +336,9 @@ static void reversi_gui_display_board(void) {
#endif #endif
#endif #endif
rb->lcd_set_viewport(&tempvp); rb->screens[SCREEN_MAIN]->set_viewport(&tempvp);
rb->lcd_puts_scroll(0, 0, buf); rb->lcd_puts_scroll(0, 0, buf);
rb->lcd_set_viewport(NULL); rb->screens[SCREEN_MAIN]->set_viewport(NULL);
y = LEGEND_Y(1); y = LEGEND_Y(1);
@ -346,9 +346,9 @@ static void reversi_gui_display_board(void) {
rb->snprintf(buf, sizeof(buf), "%01d", r); rb->snprintf(buf, sizeof(buf), "%01d", r);
tempvp.y=y; tempvp.y=y;
rb->lcd_set_viewport(&tempvp); rb->screens[SCREEN_MAIN]->set_viewport(&tempvp);
rb->lcd_puts_scroll(0, 0, buf); rb->lcd_puts_scroll(0, 0, buf);
rb->lcd_set_viewport(NULL); rb->screens[SCREEN_MAIN]->set_viewport(NULL);
/* Draw the box around the current player */ /* Draw the box around the current player */
r = (cur_player == BLACK ? 0 : 1); r = (cur_player == BLACK ? 0 : 1);