Add APIs to control visibility 42/129642/2 accepted/tizen/3.0/common/20170524.125802 accepted/tizen/3.0/ivi/20170523.234925 accepted/tizen/3.0/mobile/20170523.234913 accepted/tizen/3.0/tv/20170523.234917 accepted/tizen/3.0/wearable/20170523.234921 submit/tizen_3.0/20170519.072211
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 08:55:30 +0000 (17:55 +0900)
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 72433d2..0f82505 100644 (file)
@@ -59,6 +59,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 e0d2e82..ae7e94c 100644 (file)
@@ -374,3 +374,44 @@ API int watch_manager_cancel_click_event(Evas_Object *watch)
 {
        return screen_connector_toolkit_evas_send_touch_cancel(watch);
 }
+
+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);
+}
+
+