Add APIs to control visibility 61/129261/4
authorJunghoon Park <jh9216.park@samsung.com>
Tue, 16 May 2017 01:12:55 +0000 (10:12 +0900)
committerJunghoon Park <jh9216.park@samsung.com>
Wed, 17 May 2017 01:34:40 +0000 (01:34 +0000)
Require
 - https://review.tizen.org/gerrit/#/c/129272/

Change-Id: Iadc5142d032d628ae15f97207fef53639aa34e01
Signed-off-by: Junghoon Park <jh9216.park@samsung.com>
watch-control/include/watch_control.h
watch-control/src/control.c

index 6e825177ff6b84b81c8ffe0362807b754daf2588..7beb51405b254584aa5fe2ee5f25195782772523 100644 (file)
@@ -69,6 +69,33 @@ extern int watch_manager_get_opr(float *opr);
  */
 extern int watch_manager_cancel_click_event(Evas_Object *watch);
 
+/**
+ * @brief Changes the policy for sending visibilities
+ * @details If you turn off, the framework will not send visibility events automatically.
+ * @since_tizen 4.0
+ * @remarks By default, it is enabled
+ * @param[in] enable Whether it should be enabled or not
+ * @return @c 0 on success, otherwise a negative error value
+ */
+extern int watch_manager_change_auto_visibility(bool enable);
+
+/**
+ * @brief Sends a paused event to the display server.
+ * @details It sends a paused event to the display server so that it can pass on the watch application.
+ * @since_tizen 4.0
+ * @return @c 0 on success, otherwise a negative error value
+ */
+extern int watch_manager_pause(void);
+
+/**
+ * @brief Sends a resumed event to the display server.
+ * @details It sends a resumed event to the display server so that it can pass on the watch application.
+ * @since_tizen 4.0
+ * @return @c 0 on success, otherwise a negative error value
+ */
+extern int watch_manager_resume(void);
+
+
 #ifdef __cplusplus
 }
 #endif
index e875b38db6d4c1a16faccbac84aa2871d36dddfd..8868e8ad5aa4ea0e36c787a033b2dbf45964d871 100644 (file)
@@ -396,4 +396,45 @@ API int watch_manager_get_setup_appid(const char *app_id, char **setup_appid)
 API int watch_manager_cancel_click_event(Evas_Object *watch)
 {
        return screen_connector_toolkit_evas_send_touch_cancel(watch);
-}
\ No newline at end of file
+}
+
+API int watch_manager_change_auto_visibility(bool enable)
+{
+       if (!enable)
+               screen_connector_toolkit_evas_stop_visibility_notify();
+       else
+               screen_connector_toolkit_evas_start_visibility_notify();
+
+       return 0;
+}
+
+static int __change_visibility(bool visible)
+{
+       Evas_Object *image;
+
+       image = evas_object_data_get(__win, "tbm,watch");
+       if (image == NULL) {
+               _E("Failed to get image");
+               return -1;
+       }
+
+       if (visible) {
+               return screen_connector_toolkit_evas_send_visibility(image,
+                       VISIBILITY_TYPE_UNOBSCURED);
+       } else {
+               return screen_connector_toolkit_evas_send_visibility(image,
+                       VISIBILITY_TYPE_FULLY_OBSCURED);
+       }
+}
+
+API int watch_manager_pause(void)
+{
+       return __change_visibility(false);
+}
+
+API int watch_manager_resume(void)
+{
+       return __change_visibility(true);
+}
+
+