From 1d4effc0d6da7c8ea2634993521ad24c93c15cb3 Mon Sep 17 00:00:00 2001 From: Doyoun Kang Date: Wed, 17 Aug 2016 19:05:06 +0900 Subject: [PATCH] applied API Deprecation Policy Change-Id: Ie6477ae03199e9724bbe7b9418c4b208aef9b9f6 --- CMakeLists.txt | 2 +- include/efl_util.h.in | 16 ++++++++-------- src/efl_util.c | 36 ++++++++++++++++++++++++++++++++++++ 3 files changed, 45 insertions(+), 9 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index ab41c1a..5ae9076 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -25,7 +25,7 @@ FOREACH(flag ${${fw_name}_CFLAGS}) SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}") ENDFOREACH(flag) -SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS} -fPIC -Wall -Werror") +SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS} -fPIC -Wall -Werror -Wno-error=deprecated-declarations") SET(CMAKE_C_FLAGS_DEBUG "-O0 -g") IF("${ARCH}" STREQUAL "arm") diff --git a/include/efl_util.h.in b/include/efl_util.h.in index 2508d67..b705e43 100644 --- a/include/efl_util.h.in +++ b/include/efl_util.h.in @@ -134,7 +134,7 @@ API int efl_util_get_notification_window_level(Evas_Object *window, efl_util_not typedef void (*efl_util_notification_window_level_error_cb)(Evas_Object *window, int error_code, void *user_data); /** - * @deprecated Deprecated since 3.0. + * @deprecated Deprecated since 3.0. Use the return value of efl_util_set_notification_window_level() instead. * @brief Registers a callback function to be invoked when an error which set the notification level occurs. * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif * @remarks An application can check error by the return value of efl_util_set_notification_window_level since 3.0. @@ -149,10 +149,10 @@ typedef void (*efl_util_notification_window_level_error_cb)(Evas_Object *window, * @see efl_util_unset_notification_window_level_error_cb() * @see efl_util_notification_window_level_error_cb() */ -API int efl_util_set_notification_window_level_error_cb(Evas_Object *window, efl_util_notification_window_level_error_cb callback, void *user_data); +API int efl_util_set_notification_window_level_error_cb(Evas_Object *window, efl_util_notification_window_level_error_cb callback, void *user_data) TIZEN_DEPRECATED_API; /** - * @deprecated Deprecated since 3.0. + * @deprecated Deprecated since 3.0. Use the return value of efl_util_set_notification_window_level() instead. * @brief Unregisters the callback function. * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif * @remarks An application can check error by the return value of efl_util_set_notification_window_level since 3.0. @@ -162,7 +162,7 @@ API int efl_util_set_notification_window_level_error_cb(Evas_Object *window, efl * @retval #EFL_UTIL_ERROR_INVALID_PARAMETER Invalid parameter * @see efl_util_set_notification_window_level_error_cb() */ -API int efl_util_unset_notification_window_level_error_cb(Evas_Object *window); +API int efl_util_unset_notification_window_level_error_cb(Evas_Object *window) TIZEN_DEPRECATED_API; /** * @brief Sets the alpha window's visual state to opaque state @@ -229,7 +229,7 @@ $TZ_CFG_KEEP_BEGIN$ typedef void (*efl_util_window_screen_mode_error_cb)(Evas_Object *window, int error_code, void *user_data); /** - * @deprecated Deprecated since 3.0. + * @deprecated Deprecated since 3.0. Use the return value of efl_util_set_window_screen_mode() instead. * @brief Registers a callback function to be invoked when an error which set the screen mode. * @since_tizen 2.4 * @remarks An application can check error by the return value of efl_util_set_window_screen_mode since 3.0. @@ -244,10 +244,10 @@ typedef void (*efl_util_window_screen_mode_error_cb)(Evas_Object *window, int er * @see efl_util_unset_window_screen_mode_error_cb() * @see efl_util_window_screen_mode_error_cb() */ -API int efl_util_set_window_screen_mode_error_cb(Evas_Object *window, efl_util_window_screen_mode_error_cb callback, void *user_data); +API int efl_util_set_window_screen_mode_error_cb(Evas_Object *window, efl_util_window_screen_mode_error_cb callback, void *user_data) TIZEN_DEPRECATED_API; /** - * @deprecated Deprecated since 3.0. + * @deprecated Deprecated since 3.0. Use the return value of efl_util_set_window_screen_mode() instead. * @brief Unregisters the callback function. * @since_tizen 2.4 * @remarks An application can check error by the return value of efl_util_set_window_screen_mode since 3.0. @@ -257,7 +257,7 @@ API int efl_util_set_window_screen_mode_error_cb(Evas_Object *window, efl_util_w * @retval #EFL_UTIL_ERROR_INVALID_PARAMETER Invalid parameter * @see efl_util_set_window_screen_mode_error_cb() */ -API int efl_util_unset_window_screen_mode_error_cb(Evas_Object *window); +API int efl_util_unset_window_screen_mode_error_cb(Evas_Object *window) TIZEN_DEPRECATED_API; $TZ_CFG_KEEP_END$ /** diff --git a/src/efl_util.c b/src/efl_util.c index 9b7d4f2..fd15f7e 100644 --- a/src/efl_util.c +++ b/src/efl_util.c @@ -37,6 +37,14 @@ #include #include +#include +#ifdef LOG_TAG +#undef LOG_TAG +#endif + +#define LOG_TAG "TIZEN_N_EFL_UTIL" + + /* callback handler index */ #define CBH_NOTI_LEV 0 #define CBH_SCR_MODE 1 @@ -584,6 +592,22 @@ efl_util_set_notification_window_level(Evas_Object *window, (level <= EFL_UTIL_NOTIFICATION_LEVEL_TOP), EFL_UTIL_ERROR_INVALID_PARAMETER); + if (level == EFL_UTIL_NOTIFICATION_LEVEL_1) + { + dlog_print(DLOG_WARN, LOG_TAG, + "DEPRECATION WARNING: EFL_UTIL_NOTIFICATION_LEVEL_1 is deprecated and will be removed from next release. Use EFL_UTIL_NOTIFICATION_LEVEL_DEFAULT instead."); + } + else if (level == EFL_UTIL_NOTIFICATION_LEVEL_2) + { + dlog_print(DLOG_WARN, LOG_TAG, + "DEPRECATION WARNING: EFL_UTIL_NOTIFICATION_LEVEL_2 is deprecated and will be removed from next release. Use EFL_UTIL_NOTIFICATION_LEVEL_MEDIUM instead."); + } + else if (level == EFL_UTIL_NOTIFICATION_LEVEL_3) + { + dlog_print(DLOG_WARN, LOG_TAG, + "DEPRECATION WARNING: EFL_UTIL_NOTIFICATION_LEVEL_3 is deprecated and will be removed from next release. Use EFL_UTIL_NOTIFICATION_LEVEL_TOP instead."); + } + Elm_Win_Type type; Ecore_Wl_Window *wlwin; struct wl_surface *surface; @@ -747,6 +771,9 @@ efl_util_set_notification_window_level_error_cb(Evas_Object *window, efl_util_notification_window_level_error_cb callback, void *user_data) { + dlog_print(DLOG_WARN, LOG_TAG, + "DEPRECATION WARNING: efl_util_set_notification_window_level_error_cb() is deprecated and will be removed from next release. Use the return value of efl_util_set_notification_window_level() instead."); + Eina_Bool ret = EINA_FALSE; EINA_SAFETY_ON_NULL_RETURN_VAL(window, EFL_UTIL_ERROR_INVALID_PARAMETER); @@ -764,6 +791,9 @@ efl_util_set_notification_window_level_error_cb(Evas_Object *window, API int efl_util_unset_notification_window_level_error_cb(Evas_Object *window) { + dlog_print(DLOG_WARN, LOG_TAG, + "DEPRECATION WARNING: efl_util_unset_notification_window_level_error_cb() is deprecated and will be removed from next release. Use the return value of efl_util_set_notification_window_level() instead."); + Eina_Bool ret = EINA_FALSE; EINA_SAFETY_ON_NULL_RETURN_VAL(window, EFL_UTIL_ERROR_INVALID_PARAMETER); @@ -955,6 +985,9 @@ efl_util_set_window_screen_mode_error_cb(Evas_Object *window, efl_util_window_screen_mode_error_cb callback, void *user_data) { + dlog_print(DLOG_WARN, LOG_TAG, + "DEPRECATION WARNING: efl_util_set_window_screen_mode_error_cb() is deprecated and will be removed from next release. Use the return value of efl_util_set_window_screen_mode() instead."); + Eina_Bool ret = EINA_FALSE; EINA_SAFETY_ON_NULL_RETURN_VAL(window, EFL_UTIL_ERROR_INVALID_PARAMETER); @@ -972,6 +1005,9 @@ efl_util_set_window_screen_mode_error_cb(Evas_Object *window, API int efl_util_unset_window_screen_mode_error_cb(Evas_Object *window) { + dlog_print(DLOG_WARN, LOG_TAG, + "DEPRECATION WARNING: efl_util_unset_window_screen_mode_error_cb() is deprecated and will be removed from next release. Use the return value of efl_util_set_window_screen_mode() instead."); + Eina_Bool ret = EINA_FALSE; EINA_SAFETY_ON_NULL_RETURN_VAL(window, EFL_UTIL_ERROR_INVALID_PARAMETER); -- 2.7.4