Delay resuming time 60/127060/5
authorJunghoon Park <jh9216.park@samsung.com>
Wed, 26 Apr 2017 05:19:27 +0000 (14:19 +0900)
committerJunghoon Park <jh9216.park@samsung.com>
Wed, 26 Apr 2017 09:14:30 +0000 (18:14 +0900)
- This patch allows some widgets to postpone getting resuming callback
- Require
    https://review.tizen.org/gerrit/#/c/127059/

Change-Id: Ib89c18f9fe2ae5961df79616b52ef4dd50b6d876
Signed-off-by: Junghoon Park <jh9216.park@samsung.com>
packaging/libwidget_viewer.spec
widget_viewer_evas/CMakeLists.txt
widget_viewer_evas/include/widget_viewer_evas_extension.h [new file with mode: 0644]
widget_viewer_evas/src/widget_viewer_evas.c

index b3a6b94..e38a57c 100644 (file)
@@ -170,6 +170,7 @@ Header & package configuration of watch-control
 
 %files -n %{name}_evas-devel
 %{_includedir}/widget_viewer_evas/widget_viewer_evas.h
+%{_includedir}/widget_viewer_evas/widget_viewer_evas_extension.h
 %{_libdir}/pkgconfig/widget_viewer_evas.pc
 
 %files -n %{name}_dali
index de40b33..a691284 100644 (file)
@@ -58,5 +58,6 @@ SET_DIRECTORY_PROPERTIES(PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES "${PROJECT_NAME}
 INSTALL(TARGETS ${PROJECT_NAME} DESTINATION ${LIB_INSTALL_DIR})
 INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}.pc DESTINATION ${LIB_INSTALL_DIR}/pkgconfig)
 INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/include/${PROJECT_NAME}.h DESTINATION include/${PROJECT_NAME})
+INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/include/${PROJECT_NAME}_extension.h DESTINATION include/${PROJECT_NAME})
 
 ADD_SUBDIRECTORY(res)
diff --git a/widget_viewer_evas/include/widget_viewer_evas_extension.h b/widget_viewer_evas/include/widget_viewer_evas_extension.h
new file mode 100644 (file)
index 0000000..2fdd91e
--- /dev/null
@@ -0,0 +1,62 @@
+/*
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Flora License, Version 1.1 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://floralicense.org/license/
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef __WIDGET_VIEWER_EVAS_H
+#define __WIDGET_VIEWER_EVAS_H
+
+#include <tizen_type.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+/**
+ * @file widget_viewer_evas_extension.h
+ */
+
+/**
+ * @addtogroup CAPI_WIDGET_VIEWER_EVAS_MODULE
+ * @{
+ */
+
+/**
+ * @brief Sets delayed resuming time.
+ * @details The resuming event for widget applications will be postponed
+ * @since_tizen 4.0
+ * @param[in] time The time for being postponed, in milliseconds
+ *            The time should be between 0 and 10000
+ * @return @c 0 on success,
+ *         otherwise a negative error value
+ * @retval #WIDGET_ERROR_NONE If success
+ * @retval #WIDGET_ERROR_INVALID_PARAMETER Invalid argument
+ * @remark Delayed resuming will work only if the option is set by widget_viewer_evas_set_option()
+ * @see widget_viewer_evas_set_option()
+ * @see #WIDGET_VIEWER_EVAS_DELAYED_RESUME
+ * */
+int widget_viewer_evas_set_delayed_resuming_time(int time);
+
+/**
+ * @}
+ */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
+
+/* End of a file */
index 2407047..911ea1c 100644 (file)
@@ -175,6 +175,8 @@ struct widget_info {
 
 static void __flush_event_queue(struct widget_info *info);
 static void __destroy_widget_info(gpointer data);
+static int __default_delayed_resuming_time = 100;
+static bool __is_delayed_resuming_mode;
 
 static inline bool __is_widget_feature_enabled(void)
 {
@@ -1009,6 +1011,14 @@ EAPI int widget_viewer_evas_set_option(widget_evas_conf_e type, int value)
                        screen_connector_toolkit_evas_stop_visibility_notify();
                else
                        screen_connector_toolkit_evas_start_visibility_notify();
+       } else if (type == WIDGET_VIEWER_EVAS_DELAYED_RESUME) {
+               if (value) {
+                       __is_delayed_resuming_mode = true;
+                       screen_connector_toolkit_evas_set_delayed_resuming_time(__default_delayed_resuming_time);
+               } else {
+                       __is_delayed_resuming_mode = false;
+                       screen_connector_toolkit_evas_set_delayed_resuming_time(0);
+               }
        }
 
        return WIDGET_ERROR_NONE;
@@ -1733,4 +1743,16 @@ EAPI const char *widget_viewer_evas_get_widget_instance_id(Evas_Object *widget)
        return (const char *)info->instance_id;
 }
 
+EAPI int widget_viewer_evas_set_delayed_resuming_time(int time)
+{
+       if (time < 0 || time > 10000)
+               return WIDGET_ERROR_INVALID_PARAMETER;
+
+       __default_delayed_resuming_time = time;
+       if (__is_delayed_resuming_mode)
+               screen_connector_toolkit_evas_set_delayed_resuming_time(time);
+
+       return WIDGET_ERROR_NONE;
+}
+
 /* End of a file */