Add APIs for binding and unbinding window 80/128680/7
authorJunghoon Park <jh9216.park@samsung.com>
Thu, 11 May 2017 03:43:11 +0000 (12:43 +0900)
committerHwanKyu Jhun <h.jhun@samsung.com>
Fri, 19 May 2017 02:01:41 +0000 (02:01 +0000)
Change-Id: Ic5b6db44bc4270f9cb9d94d93563e67e9766e8a5
Signed-off-by: Junghoon Park <jh9216.park@samsung.com>
watch-control/include/watch_control.h
watch-control/src/control.c

index 7beb514..b06592b 100644 (file)
@@ -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
 }
index 8868e8a..082b943 100644 (file)
@@ -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);
+}