From 95ab4b99554ca3d64568a1be251b736eb33e00e9 Mon Sep 17 00:00:00 2001 From: Jiwoong Im Date: Wed, 14 Jan 2015 14:01:24 +0900 Subject: [PATCH] change service_cb to app_control_cb in ui_app_lifecycle_s. JIRA ticket : TC-2314 Change-Id: Icd443dac75bf84ffea81364b5645ccb62e3dd5e7 Signed-off-by: Jiwoong Im --- include/app.h | 32 ++++++++++++++++++++++++++++---- src/app_main.c | 15 ++++++++------- 2 files changed, 36 insertions(+), 11 deletions(-) diff --git a/include/app.h b/include/app.h index 35d2939..bd8d68e 100755 --- a/include/app.h +++ b/include/app.h @@ -140,6 +140,30 @@ typedef void (*app_service_cb) (service_h service, void *user_data); /** + * @brief Called when other application send the launch request to the application. + * + * @details When the application is launched, this callback function is called after the main loop of application starts up. + * The passed app_control handle describes the launch request and contains the information about why the application is launched. + * If the launch request is sent to the application on running or pause state, + * this callback function can be called again to notify that the application is asked to be launched. + * + * The application could be explicitly launched by the user from the application launcher or be launched to perform the specific operation by the other application. + * The application is responsible for handling each launch request and responding accordingly. + * Using the app_control API, the application can get the information it needs to perform. + * If the application is launched from the application launcher or explicitly launched by other application, + * the passed app_control handle may include only the default operation (#APP_CONTROL_OPERATION_DEFAULT) without any data + * For more information, see The @ref CAPI_APP_CONTROL_MODULE API description. + * + * @param[in] app_control_h The handle to the app_control + * @param[in] user_data The user data passed from the callback registration function + * @see app_efl_main() + * @see #app_event_callback_s + * @see @ref CAPI_APP_CONTROL_MODULE API + */ +typedef void (*app_control_cb) (app_control_h app_control, void *user_data); + + +/** * @brief Called when the system memory is running low. * * @details @@ -234,7 +258,7 @@ typedef struct * @see app_pause_cb() * @see app_resume_cb() * @see app_terminate_cb() - * @see service_cb() + * @see app_control_cb() */ typedef struct { @@ -242,7 +266,7 @@ typedef struct app_terminate_cb terminate; /**< This callback function is called once after the main loop of the application exits. */ app_pause_cb pause; /**< This callback function is called each time the application is completely obscured by another application and becomes invisible to the user. */ app_resume_cb resume; /**< This callback function is called each time the application becomes visible to the user. */ - app_service_cb service; /**< This callback function is called when another application sends the launch request to the application. */ + app_control_cb app_control; /**< This callback function is called when another application sends the launch request to the application. */ } ui_app_lifecycle_callback_s; @@ -683,7 +707,7 @@ void app_set_reclaiming_system_cache_on_pause(bool enable); * * @details This function is the main entry point of the Tizen application. * The app_create_cb() callback function is called to initialize the application before the main loop of application starts up. - * After the app_create_cb() callback function returns true, the main loop starts up and the service_cb() callback function is subsequently called. + * After the app_create_cb() callback function returns true, the main loop starts up and the app_control_cb() callback function is subsequently called. * If the app_create_cb() callback function returns false, the main loop doesn't start up and app_terminate_cb() callback function is called. * This main loop supports event handling for the Ecore Main Loop. * @@ -702,7 +726,7 @@ void app_set_reclaiming_system_cache_on_pause(bool enable); * @see app_terminate_cb() * @see app_pause_cb() * @see app_resume_cb() - * @see app_service_cb() + * @see app_control_cb() * @see ui_app_exit() * @see #ui_app_lifecycle_callback_s */ diff --git a/src/app_main.c b/src/app_main.c index 24079a2..46ab839 100755 --- a/src/app_main.c +++ b/src/app_main.c @@ -33,6 +33,7 @@ #include #include +#include #ifdef LOG_TAG #undef LOG_TAG @@ -627,21 +628,21 @@ static int _ui_app_appcore_reset(bundle *appcore_bundle, void *data) { LOGI("app_appcore_reset"); struct ui_app_context *app_context = data; - app_service_cb callback; - service_h service; + app_control_cb callback; + app_control_h app_control; if (app_context == NULL) return app_error(APP_ERROR_INVALID_CONTEXT, __FUNCTION__, NULL); - if (service_create_event(appcore_bundle, &service) != APP_ERROR_NONE) - return app_error(APP_ERROR_INVALID_PARAMETER, __FUNCTION__, "failed to create a service handle from the bundle"); + if (app_control_create_event(appcore_bundle, &app_control) != APP_ERROR_NONE) + return app_error(APP_ERROR_INVALID_PARAMETER, __FUNCTION__, "failed to create an app_control handle from the bundle"); - callback = app_context->callback->service; + callback = app_context->callback->app_control; if (callback != NULL) - callback(service, app_context->data); + callback(app_control, app_context->data); - service_destroy(service); + app_control_destroy(app_control); return APP_ERROR_NONE; } -- 2.7.4