From 868585eee50f355dc8dd38fca5d5f6c570c5523f Mon Sep 17 00:00:00 2001 From: Junghoon Park Date: Thu, 11 May 2017 12:43:11 +0900 Subject: [PATCH] Add APIs for binding and unbinding window Change-Id: Ic5b6db44bc4270f9cb9d94d93563e67e9766e8a5 Signed-off-by: Junghoon Park --- watch-control/include/watch_control.h | 16 ++++++++++++++++ watch-control/src/control.c | 18 +++++++++++++++++- 2 files changed, 33 insertions(+), 1 deletion(-) diff --git a/watch-control/include/watch_control.h b/watch-control/include/watch_control.h index 7beb5140..b06592bf 100644 --- a/watch-control/include/watch_control.h +++ b/watch-control/include/watch_control.h @@ -95,6 +95,22 @@ extern int watch_manager_pause(void); */ extern int watch_manager_resume(void); +/** + * @brief Binds watch's window with the window. + * @details Watch's window will be shown with the viewer window automatically. + * @since_tizen 4.0 + * @param[in] win Window for the viewer app + * @return @c 0 on success, otherwise a negative error value + */ +extern int watch_manager_window_bind(Evas_Object *win); + +/** + * @brief Unbinds watch's window + * @details Watch's window will be updated as an image object. + * @since_tizen 4.0 + * @return @c 0 on success, otherwise a negative error value + */ +extern int watch_manager_window_unbind(void); #ifdef __cplusplus } diff --git a/watch-control/src/control.c b/watch-control/src/control.c index 8868e8ad..082b9438 100644 --- a/watch-control/src/control.c +++ b/watch-control/src/control.c @@ -48,6 +48,7 @@ static int __watch_size_policy = WATCH_POLICY_HINT_EXPAND; static int __default_width; static int __default_height; +static screen_connector_toolkit_evas_h __toolkit; static Evas_Object *__win; static char *viewer_appid; @@ -221,7 +222,7 @@ API int watch_manager_get_app_control(const char *app_id, app_control_h *app_con ops.added_cb = __screen_connector_toolkit_evas_added_cb; ops.removed_cb = __screen_connector_toolkit_evas_removed_cb; ops.updated_cb = __screen_connector_toolkit_evas_updated_cb; - screen_connector_toolkit_evas_add(&ops, (char *)app_id, SCREEN_CONNECTOR_SCREEEN_TYPE_WATCH, NULL); + __toolkit = screen_connector_toolkit_evas_add(&ops, (char *)app_id, SCREEN_CONNECTOR_SCREEEN_TYPE_WATCH, NULL); app_control_to_bundle(*app_control, &b); if (b) { @@ -437,4 +438,19 @@ API int watch_manager_resume(void) return __change_visibility(true); } +API int watch_manager_window_bind(Evas_Object *win) +{ + if (!__toolkit || !win) + return -1; + + return screen_connector_toolkit_evas_bind(__toolkit, win); +} + +API int watch_manager_window_unbind(void) +{ + if (!__toolkit) + return -1; + + return screen_connector_toolkit_evas_unbind(__toolkit); +} -- 2.34.1