summaryrefslogtreecommitdiff
path: root/apps/plugins/jpeg/jpeg.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/plugins/jpeg/jpeg.c')
-rw-r--r--apps/plugins/jpeg/jpeg.c23
1 files changed, 8 insertions, 15 deletions
diff --git a/apps/plugins/jpeg/jpeg.c b/apps/plugins/jpeg/jpeg.c
index d8775dd176..82d9186298 100644
--- a/apps/plugins/jpeg/jpeg.c
+++ b/apps/plugins/jpeg/jpeg.c
@@ -76,9 +76,7 @@ GREY_INFO_STRUCT
76 76
77/******************************* Globals ***********************************/ 77/******************************* Globals ***********************************/
78 78
79const struct plugin_api* rb; /* Exported to other .c files in this plugin */ 79MEM_FUNCTION_WRAPPERS;
80
81MEM_FUNCTION_WRAPPERS(rb);
82 80
83static int slideshow_enabled = false; /* run slideshow */ 81static int slideshow_enabled = false; /* run slideshow */
84static int running_slideshow = false; /* loading image because of slideshw */ 82static int running_slideshow = false; /* loading image because of slideshw */
@@ -334,7 +332,7 @@ static void display_options(void)
334 { "Dithering", set_option_dithering }, 332 { "Dithering", set_option_dithering },
335 }; 333 };
336 334
337 int m = menu_init(rb, items, ARRAYLEN(items), 335 int m = menu_init(items, ARRAYLEN(items),
338 NULL, NULL, NULL, NULL); 336 NULL, NULL, NULL, NULL);
339 menu_run(m); 337 menu_run(m);
340 menu_exit(m); 338 menu_exit(m);
@@ -394,7 +392,7 @@ int show_menu(void) /* return 1 to quit */
394 { "Enable", -1 }, 392 { "Enable", -1 },
395 }; 393 };
396 394
397 m = menu_init(rb, items, sizeof(items) / sizeof(*items), 395 m = menu_init(items, sizeof(items) / sizeof(*items),
398 NULL, NULL, NULL, NULL); 396 NULL, NULL, NULL, NULL);
399 result=menu_show(m); 397 result=menu_show(m);
400 398
@@ -418,7 +416,7 @@ int show_menu(void) /* return 1 to quit */
418 case MIID_SHOW_PLAYBACK_MENU: 416 case MIID_SHOW_PLAYBACK_MENU:
419 if (plug_buf) 417 if (plug_buf)
420 { 418 {
421 playback_control(rb, NULL); 419 playback_control(NULL);
422 } 420 }
423 else 421 else
424 { 422 {
@@ -1183,10 +1181,8 @@ int load_and_show(char* filename)
1183 1181
1184/******************** Plugin entry point *********************/ 1182/******************** Plugin entry point *********************/
1185 1183
1186enum plugin_status plugin_start(const struct plugin_api* api, const void* parameter) 1184enum plugin_status plugin_start(const void* parameter)
1187{ 1185{
1188 rb = api;
1189
1190 int condition; 1186 int condition;
1191#ifdef USEGSLIB 1187#ifdef USEGSLIB
1192 long greysize; /* helper */ 1188 long greysize; /* helper */
@@ -1219,7 +1215,7 @@ enum plugin_status plugin_start(const struct plugin_api* api, const void* parame
1219#endif 1215#endif
1220 1216
1221#ifdef USEGSLIB 1217#ifdef USEGSLIB
1222 if (!grey_init(rb, buf, buf_size, GREY_ON_COP, 1218 if (!grey_init(buf, buf_size, GREY_ON_COP,
1223 LCD_WIDTH, LCD_HEIGHT, &greysize)) 1219 LCD_WIDTH, LCD_HEIGHT, &greysize))
1224 { 1220 {
1225 rb->splash(HZ, "grey buf error"); 1221 rb->splash(HZ, "grey buf error");
@@ -1227,13 +1223,10 @@ enum plugin_status plugin_start(const struct plugin_api* api, const void* parame
1227 } 1223 }
1228 buf += greysize; 1224 buf += greysize;
1229 buf_size -= greysize; 1225 buf_size -= greysize;
1230#else
1231 xlcd_init(rb);
1232#endif 1226#endif
1233 1227
1234 /* should be ok to just load settings since the plugin itself has 1228 /* should be ok to just load settings since the plugin itself has
1235 just been loaded from disk and the drive should be spinning */ 1229 just been loaded from disk and the drive should be spinning */
1236 configfile_init(rb);
1237 configfile_load(JPEG_CONFIGFILE, jpeg_config, 1230 configfile_load(JPEG_CONFIGFILE, jpeg_config,
1238 ARRAYLEN(jpeg_config), JPEG_SETTINGS_MINVERSION); 1231 ARRAYLEN(jpeg_config), JPEG_SETTINGS_MINVERSION);
1239 old_settings = jpeg_settings; 1232 old_settings = jpeg_settings;
@@ -1241,7 +1234,7 @@ enum plugin_status plugin_start(const struct plugin_api* api, const void* parame
1241 buf_images = buf; buf_images_size = buf_size; 1234 buf_images = buf; buf_images_size = buf_size;
1242 1235
1243 /* Turn off backlight timeout */ 1236 /* Turn off backlight timeout */
1244 backlight_force_on(rb); /* backlight control in lib/helper.c */ 1237 backlight_force_on(); /* backlight control in lib/helper.c */
1245 1238
1246 do 1239 do
1247 { 1240 {
@@ -1263,7 +1256,7 @@ enum plugin_status plugin_start(const struct plugin_api* api, const void* parame
1263#endif 1256#endif
1264 1257
1265 /* Turn on backlight timeout (revert to settings) */ 1258 /* Turn on backlight timeout (revert to settings) */
1266 backlight_use_settings(rb); /* backlight control in lib/helper.c */ 1259 backlight_use_settings(); /* backlight control in lib/helper.c */
1267 1260
1268#ifdef USEGSLIB 1261#ifdef USEGSLIB
1269 grey_release(); /* deinitialize */ 1262 grey_release(); /* deinitialize */