From ecccf52b112e975f1867b8fe55ed7c2bf697577e Mon Sep 17 00:00:00 2001 From: Hwankyu Jhun Date: Fri, 31 Mar 2017 14:03:41 +0900 Subject: [PATCH] Add APIs for attaching and detaching window Requires: - https://review.tizen.org/gerrit/#/c/120646/ - https://review.tizen.org/gerrit/#/c/120647/ Change-Id: I57eb261395c98a0dc3644dc00570753c6d90a619 Signed-off-by: Hwankyu Jhun --- include/app_manager_extension.h | 29 +++++++++++++++++++++++++++++ src/app_manager.c | 28 ++++++++++++++++++++++++++++ 2 files changed, 57 insertions(+) diff --git a/include/app_manager_extension.h b/include/app_manager_extension.h index c77e354..2abe3e5 100644 --- a/include/app_manager_extension.h +++ b/include/app_manager_extension.h @@ -138,6 +138,35 @@ int app_manager_get_app_context_by_instance_id(const char *app_id, const char *i int app_manager_get_focused_app_context(app_context_h *app_context); /** + * @brief Attaches the window of the child application to the window of the parent application. + * @since_tizen 3.0 + * @privlevel platform + * @privilege %http://tizen.org/privilege/internal/default/platform + * @param[in] parent_app_id The ID of the parent application + * @param[in] child_app_id The ID of the child applicatio + * @return @c 0 on success, + * otherwise a negative error value + * @retval #APP_MANAGER_ERROR_NONE Successful + * @retval #APP_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter + * @retval #APP_MANAGER_ERROR_IO_ERROR Internal I/O error + */ +int app_manager_attach_window(const char *parent_app_id, const char *child_app_id); + +/** + * @brief Detaches the window of the application from its parent window. + * @since_tizen 3.0 + * @privlevel platform + * @privilege %http://tizen.org/privilege/internal/default/platform + * @param[in] app_id The ID of the application + * @return @c 0 on success, + * otherwise a negative error value + * @retval #APP_MANAGER_ERROR_NONE Successful + * @retval #APP_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter + * @retval #APP_MANAGER_ERROR_IO_ERROR Internal I/O error + */ +int app_manager_detach_window(const char *app_id); + +/** * @} */ diff --git a/src/app_manager.c b/src/app_manager.c index fa9cc01..335fe7e 100644 --- a/src/app_manager.c +++ b/src/app_manager.c @@ -590,3 +590,31 @@ API int app_manager_get_focused_app_context(app_context_h *app_context) return APP_MANAGER_ERROR_NONE; } + +API int app_manager_attach_window(const char *parent_app_id, const char *child_app_id) +{ + int ret; + + if (parent_app_id == NULL || child_app_id == NULL) + return app_manager_error(APP_MANAGER_ERROR_INVALID_PARAMETER, __FUNCTION__, NULL); + + ret = aul_window_attach(parent_app_id, child_app_id); + if (ret != 0) + return app_manager_error(APP_MANAGER_ERROR_IO_ERROR, __FUNCTION__, NULL); + + return APP_MANAGER_ERROR_NONE; +} + +API int app_manager_detach_window(const char *app_id) +{ + int ret; + + if (app_id == NULL) + return app_manager_error(APP_MANAGER_ERROR_INVALID_PARAMETER, __FUNCTION__, NULL); + + ret = aul_window_detach(app_id); + if (ret != 0) + return app_manager_error(APP_MANAGER_ERROR_IO_ERROR, __FUNCTION__, NULL); + + return APP_MANAGER_ERROR_NONE; +} -- 2.7.4