diff options
| author | Jens Arnold <amiconn@rockbox.org> | 2004-10-22 00:22:07 +0000 |
|---|---|---|
| committer | Jens Arnold <amiconn@rockbox.org> | 2004-10-22 00:22:07 +0000 |
| commit | 2afdf95401e243373050b9bda554e8f216664fd0 (patch) | |
| tree | a0ce4423108d03d7c556ded59604dbb6cdf54de2 /apps/plugins/euroconverter.c | |
| parent | 3a931c113f88009ba8b468f11bd6ebe3d02a4b70 (diff) | |
| download | rockbox-2afdf95401e243373050b9bda554e8f216664fd0.zip rockbox-2afdf95401e243373050b9bda554e8f216664fd0.tar.gz rockbox-2afdf95401e243373050b9bda554e8f216664fd0.tar.bz2 rockbox-2afdf95401e243373050b9bda554e8f216664fd0.tar.xz | |
Plugin rework 5: (all) Now using the default event handler, standard placement is in switch() default case. (splitedit,star,vu_meter) Compile-time keyboard configuration, for Ondio adaption. (splitedit) Timing kludge for MMC. (star) Completed USB support.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@5321 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/plugins/euroconverter.c')
| -rw-r--r-- | apps/plugins/euroconverter.c | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/apps/plugins/euroconverter.c b/apps/plugins/euroconverter.c index ccf37ae..a417015 100644 --- a/apps/plugins/euroconverter.c +++ b/apps/plugins/euroconverter.c @@ -381,8 +381,10 @@ static int euro_menu(void) /* Call when the program end */ -static void euro_exit(void) +static void euro_exit(void *parameter) { + (void)parameter; + //Restore the old pattern (i don't find another way to do this. An idea?) rb->lcd_unlock_pattern(heuro); rb->lcd_unlock_pattern(hhome); @@ -397,6 +399,7 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter) { bool end, pos; long long e,h,old_e,old_h; + int button; /* this macro should be called as the first thing you do in the plugin. it test that the api version and model the plugin was compiled for @@ -439,7 +442,8 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter) /*Main loop*/ while(end!=true) { - switch (rb->button_get(true)) + button = rb->button_get(true); + switch (button) { case BUTTON_MENU|BUTTON_REL: switch (euro_menu()) @@ -586,10 +590,11 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter) } break; - case SYS_USB_CONNECTED: - rb->usb_screen(); - euro_exit(); - return PLUGIN_USB_CONNECTED; + default: + if (rb->default_event_handler_ex(button, euro_exit, NULL) + == SYS_USB_CONNECTED) + return PLUGIN_USB_CONNECTED; + break; } /*Display*/ if (!pos) /*Euro>home*/ @@ -598,7 +603,7 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter) e=mydiv(h,currency[country]); display(e,h,pos); } - euro_exit(); + euro_exit(NULL); return PLUGIN_OK; } |