diff options
Diffstat (limited to 'src/main.c')
-rw-r--r-- | src/main.c | 38 |
1 files changed, 20 insertions, 18 deletions
@@ -192,11 +192,11 @@ static void _resume(void *data) * This callback is invoked after _create callback (just after app enters main loop) * or after "re-launch". * -* @param service [in] The launching arguments. +* @param app_control [in] The launching arguments. * @param data [in] The function specific data passed by app_efl_main. * @return void. */ -static void _service(service_h service, void *data) +static void _app_control(app_control_h app_control, void *data) { struct _appdata *ad; struct setting_mgr *mgr; @@ -211,7 +211,7 @@ static void _service(service_h service, void *data) param = NULL; if (ad->service) { - service_get_extra_data(service, PARAM_SETTINGS_ITEM, ¶m); + app_control_get_extra_data(app_control, PARAM_SETTINGS_ITEM, ¶m); if ((!param && !ad->item) || (param && ad->item && !strcmp(ad->item, param))) { @@ -236,8 +236,8 @@ static void _service(service_h service, void *data) if (!mgr) app_efl_exit(); - r = service_get_extra_data(service, PARAM_SETTINGS_ITEM, ¶m); - if (r == SERVICE_ERROR_NONE && param) { + r = app_control_get_extra_data(app_control, PARAM_SETTINGS_ITEM, ¶m); + if (r == APP_CONTROL_ERROR_NONE && param) { r = settingmgr_launch_item(mgr, param); if (r != 0) { _ERR("the item is not exist."); @@ -300,25 +300,27 @@ static void _region_changed(void *data) int main(int argc, char **argv) { struct _appdata ad; - app_event_callback_s cbs = { - .create = _create, - .terminate = _terminate, - .pause = _pause, - .resume = _resume, - .service = _service, - .low_memory = NULL, - .low_battery = NULL, - .device_orientation = NULL, - .language_changed = _lang_changed, - .region_format_changed = _region_changed, - }; + + ui_app_lifecycle_callback_s event_callback = { 0, }; + app_event_handler_h handlers[5] = { NULL, }; + + event_callback.create = _create; + event_callback.terminate = _terminate; + event_callback.pause = _pause; + event_callback.resume = _resume; + event_callback.app_control = _app_control; + + ui_app_add_event_handler(&handlers[APP_EVENT_LANGUAGE_CHANGED], + APP_EVENT_LANGUAGE_CHANGED, _lang_changed, &ad); + ui_app_add_event_handler(&handlers[APP_EVENT_REGION_FORMAT_CHANGED], + APP_EVENT_REGION_FORMAT_CHANGED, _region_changed, &ad); memset(&ad, 0x00, sizeof(ad)); ad.name = PACKAGE; i18n_init(); - app_efl_main(&argc, &argv, &cbs, &ad); + ui_app_main(argc, argv, &event_callback, &ad); return 0; } |