diff options
| author | Andrew Mahone <andrew.mahone@gmail.com> | 2009-01-16 10:34:40 +0000 |
|---|---|---|
| committer | Andrew Mahone <andrew.mahone@gmail.com> | 2009-01-16 10:34:40 +0000 |
| commit | 23d9812273d9c74af72ccdc3aa4cfea971f220a4 (patch) | |
| tree | 8e60c3a2a41879f8b2a52516fa416b3ab906e239 /apps/plugins/jpeg | |
| parent | 35677cbc54bbe400ebbff59b489dda7ca7f04916 (diff) | |
| download | rockbox-23d9812273d9c74af72ccdc3aa4cfea971f220a4.zip rockbox-23d9812273d9c74af72ccdc3aa4cfea971f220a4.tar.gz rockbox-23d9812273d9c74af72ccdc3aa4cfea971f220a4.tar.bz2 rockbox-23d9812273d9c74af72ccdc3aa4cfea971f220a4.tar.xz | |
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
Diffstat (limited to 'apps/plugins/jpeg')
| -rw-r--r-- | apps/plugins/jpeg/jpeg.c | 23 | ||||
| -rw-r--r-- | apps/plugins/jpeg/jpeg_decoder.c | 2 | ||||
| -rw-r--r-- | apps/plugins/jpeg/yuv2rgb.c | 3 |
3 files changed, 8 insertions, 20 deletions
diff --git a/apps/plugins/jpeg/jpeg.c b/apps/plugins/jpeg/jpeg.c index d8775dd..82d9186 100644 --- a/apps/plugins/jpeg/jpeg.c +++ b/apps/plugins/jpeg/jpeg.c @@ -76,9 +76,7 @@ GREY_INFO_STRUCT /******************************* Globals ***********************************/ -const struct plugin_api* rb; /* Exported to other .c files in this plugin */ - -MEM_FUNCTION_WRAPPERS(rb); +MEM_FUNCTION_WRAPPERS; static int slideshow_enabled = false; /* run slideshow */ static int running_slideshow = false; /* loading image because of slideshw */ @@ -334,7 +332,7 @@ static void display_options(void) { "Dithering", set_option_dithering }, }; - int m = menu_init(rb, items, ARRAYLEN(items), + int m = menu_init(items, ARRAYLEN(items), NULL, NULL, NULL, NULL); menu_run(m); menu_exit(m); @@ -394,7 +392,7 @@ int show_menu(void) /* return 1 to quit */ { "Enable", -1 }, }; - m = menu_init(rb, items, sizeof(items) / sizeof(*items), + m = menu_init(items, sizeof(items) / sizeof(*items), NULL, NULL, NULL, NULL); result=menu_show(m); @@ -418,7 +416,7 @@ int show_menu(void) /* return 1 to quit */ case MIID_SHOW_PLAYBACK_MENU: if (plug_buf) { - playback_control(rb, NULL); + playback_control(NULL); } else { @@ -1183,10 +1181,8 @@ int load_and_show(char* filename) /******************** Plugin entry point *********************/ -enum plugin_status plugin_start(const struct plugin_api* api, const void* parameter) +enum plugin_status plugin_start(const void* parameter) { - rb = api; - int condition; #ifdef USEGSLIB long greysize; /* helper */ @@ -1219,7 +1215,7 @@ enum plugin_status plugin_start(const struct plugin_api* api, const void* parame #endif #ifdef USEGSLIB - if (!grey_init(rb, buf, buf_size, GREY_ON_COP, + if (!grey_init(buf, buf_size, GREY_ON_COP, LCD_WIDTH, LCD_HEIGHT, &greysize)) { rb->splash(HZ, "grey buf error"); @@ -1227,13 +1223,10 @@ enum plugin_status plugin_start(const struct plugin_api* api, const void* parame } buf += greysize; buf_size -= greysize; -#else - xlcd_init(rb); #endif /* should be ok to just load settings since the plugin itself has just been loaded from disk and the drive should be spinning */ - configfile_init(rb); configfile_load(JPEG_CONFIGFILE, jpeg_config, ARRAYLEN(jpeg_config), JPEG_SETTINGS_MINVERSION); old_settings = jpeg_settings; @@ -1241,7 +1234,7 @@ enum plugin_status plugin_start(const struct plugin_api* api, const void* parame buf_images = buf; buf_images_size = buf_size; /* Turn off backlight timeout */ - backlight_force_on(rb); /* backlight control in lib/helper.c */ + backlight_force_on(); /* backlight control in lib/helper.c */ do { @@ -1263,7 +1256,7 @@ enum plugin_status plugin_start(const struct plugin_api* api, const void* parame #endif /* Turn on backlight timeout (revert to settings) */ - backlight_use_settings(rb); /* backlight control in lib/helper.c */ + backlight_use_settings(); /* backlight control in lib/helper.c */ #ifdef USEGSLIB grey_release(); /* deinitialize */ diff --git a/apps/plugins/jpeg/jpeg_decoder.c b/apps/plugins/jpeg/jpeg_decoder.c index ffd71a1..71d5088 100644 --- a/apps/plugins/jpeg/jpeg_decoder.c +++ b/apps/plugins/jpeg/jpeg_decoder.c @@ -29,8 +29,6 @@ #include "jpeg_decoder.h" -extern const struct plugin_api* rb; - /* for portability of below JPEG code */ #define MEMSET(p,v,c) rb->memset(p,v,c) #define MEMCPY(d,s,c) rb->memcpy(d,s,c) diff --git a/apps/plugins/jpeg/yuv2rgb.c b/apps/plugins/jpeg/yuv2rgb.c index 1130f03..c246492 100644 --- a/apps/plugins/jpeg/yuv2rgb.c +++ b/apps/plugins/jpeg/yuv2rgb.c @@ -28,9 +28,6 @@ #include "plugin.h" #include "yuv2rgb.h" -/* Needed for memset and rb->lcd_framebuffer */ -extern const struct plugin_api* rb; - /* * Conversion of full 0-255 range YCrCb to RGB: * |R| |1.000000 -0.000001 1.402000| |Y'| |