1
0
Fork 0
forked from len0rd/rockbox

loader-initialized global plugin API:

struct plugin_api *rb is declared in PLUGIN_HEADER, and pointed to by
__header.api

the loader uses this pointer to initialize rb before calling entry_point

entry_point is no longer passed a pointer to the plugin API

all plugins, and pluginlib functions, are modified to refer to the
global rb

pluginlib functions which only served to copy the API pointer are
removed

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19776 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Andrew Mahone 2009-01-16 10:34:40 +00:00
parent 35677cbc54
commit 23d9812273
179 changed files with 586 additions and 1183 deletions

View file

@ -323,8 +323,6 @@ PLUGIN_HEADER
#define MYXLCD(fn) xlcd_ ## fn
#endif
static const struct plugin_api* rb;
/* Fixed point format s5.26: sign, 5 bits integer part, 26 bits fractional part */
static long x_min;
static long x_max;
@ -711,13 +709,12 @@ void cleanup(void *parameter)
#define REDRAW_PARTIAL 1
#define REDRAW_FULL 2
enum plugin_status plugin_start(const struct plugin_api* api, const void* parameter)
enum plugin_status plugin_start(const void* parameter)
{
int button;
int lastbutton = BUTTON_NONE;
int redraw = REDRAW_FULL;
rb = api;
(void)parameter;
#ifdef USEGSLIB
@ -725,15 +722,13 @@ enum plugin_status plugin_start(const struct plugin_api* api, const void* parame
gbuf = (unsigned char *) rb->plugin_get_buffer(&gbuf_size);
/* initialize the greyscale buffer.*/
if (!grey_init(rb, gbuf, gbuf_size, GREY_ON_COP,
if (!grey_init(gbuf, gbuf_size, GREY_ON_COP,
LCD_WIDTH, LCD_HEIGHT, NULL))
{
rb->splash(HZ, "Couldn't init greyscale display");
return 0;
}
grey_show(true); /* switch on greyscale overlay */
#else
xlcd_init(rb);
#endif
#if LCD_DEPTH > 1