From 39ecf5e2c2f0930146c7c822285ece5dd5443710 Mon Sep 17 00:00:00 2001 From: Doyoun Kang Date: Tue, 26 Jun 2018 16:01:29 +0900 Subject: [PATCH] remove deprecated APIs and Enums Removed APIs - efl_util_notification_window_level_error_cb - efl_util_set_notification_window_level_error_cb - efl_util_unset_notification_window_level_error_cb - efl_util_window_screen_mode_error_cb - efl_util_set_window_screen_mode_error_cb - efl_util_unset_window_screen_mode_error_cb Removed Enums - EFL_UTIL_NOTIFICATION_LEVEL_1 - EFL_UTIL_NOTIFICATION_LEVEL_2 - EFL_UTIL_NOTIFICATION_LEVEL_3 Change-Id: I5f3023c2906a8cf4099af518b3ca43cea91d1f9b --- include/efl_util.h.in | 91 ------------------- src/efl_util.c | 246 -------------------------------------------------- 2 files changed, 337 deletions(-) diff --git a/include/efl_util.h.in b/include/efl_util.h.in index dfa14cd..e8c82d9 100644 --- a/include/efl_util.h.in +++ b/include/efl_util.h.in @@ -67,9 +67,6 @@ typedef enum */ typedef enum { - EFL_UTIL_NOTIFICATION_LEVEL_1, /**< Default notification level. (Deprecated since $TZ_CFG_VER_24_OR_30$. Use EFL_UTIL_NOTIFICATION_LEVEL_DEFAULT instead.) */ - EFL_UTIL_NOTIFICATION_LEVEL_2, /**< Higher notification level than default. (Deprecated since $TZ_CFG_VER_24_OR_30$. Use EFL_UTIL_NOTIFICATION_LEVEL_MEDIUM instead.) */ - EFL_UTIL_NOTIFICATION_LEVEL_3, /**< The highest notification level. (Deprecated since $TZ_CFG_VER_24_OR_30$. Use EFL_UTIL_NOTIFICATION_LEVEL_TOP instead.) */ EFL_UTIL_NOTIFICATION_LEVEL_NONE = -1, /**< No (reset) notification level. This value makes the window place in normal layer. (@b Since: $TZ_CFG_VER_24_OR_30$) */ EFL_UTIL_NOTIFICATION_LEVEL_DEFAULT = 10, /**< Default notification level. (@b Since: $TZ_CFG_VER_24_OR_30$) */ EFL_UTIL_NOTIFICATION_LEVEL_MEDIUM = 20, /**< Higher notification level than default. (@b Since: $TZ_CFG_VER_24_OR_30$) */ @@ -122,50 +119,6 @@ API int efl_util_set_notification_window_level(Evas_Object *window, efl_util_not API int efl_util_get_notification_window_level(Evas_Object *window, efl_util_notification_level_e *level); /** - * @deprecated Deprecated since 3.0. - * @brief Called when an error occurs for setting notification window level - * @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. - * @param[in] window The EFL window - * @param[in] error_code The error code (#EFL_UTIL_ERROR_PERMISSION_DENIED) - * @param[in] user_data The user data passed from the callback registration function - * @see efl_util_set_notification_window_level_error_cb() - * @see efl_util_unset_notification_window_level_error_cb() - */ -typedef void (*efl_util_notification_window_level_error_cb)(Evas_Object *window, int error_code, void *user_data); - -/** - * @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. - * @param[in] window The EFL window - * @param[in] callback The callback function to register - * @param[in] user_data The user data to be passed to the callback function - * @return @c 0 on success, otherwise a negative error value - * @retval #EFL_UTIL_ERROR_NONE Successful - * @retval #EFL_UTIL_ERROR_INVALID_PARAMETER Invalid parameter - * @retval #EFL_UTIL_ERROR_OUT_OF_MEMORY Out of memory - * @post efl_util_notification_window_level_error_cb() will be invoked. - * @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) TIZEN_DEPRECATED_API; - -/** - * @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. - * @param[in] window The EFL window - * @return @c 0 on success, otherwise a negative error value - * @retval #EFL_UTIL_ERROR_NONE Successful - * @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) TIZEN_DEPRECATED_API; - -/** * @brief Sets the alpha window's visual state to opaque state * @details This API sets the alpha window's visual state to opaque state. * If the alpha window sets the visual state to the opaque, @@ -213,50 +166,6 @@ API int efl_util_set_window_screen_mode(Evas_Object *window, efl_util_screen_mod API int efl_util_get_window_screen_mode(Evas_Object *window, efl_util_screen_mode_e *mode); /** - * @deprecated Deprecated since 3.0. - * @brief Called when an error occurs for setting window's 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. - * @param[in] window The EFL window - * @param[in] error_code The error code (#EFL_UTIL_ERROR_PERMISSION_DENIED) - * @param[in] user_data The user data passed from the callback registration function - * @see efl_util_set_window_screen_mode_error_cb() - * @see efl_util_unset_window_screen_mode_error_cb() - */ -typedef void (*efl_util_window_screen_mode_error_cb)(Evas_Object *window, int error_code, void *user_data); - -/** - * @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. - * @param[in] window The EFL window - * @param[in] callback The callback function to register - * @param[in] user_data The user data to be passed to the callback function - * @return @c 0 on success, otherwise a negative error value - * @retval #EFL_UTIL_ERROR_NONE Successful - * @retval #EFL_UTIL_ERROR_INVALID_PARAMETER Invalid parameter - * @retval #EFL_UTIL_ERROR_OUT_OF_MEMORY Out of memory - * @post efl_util_window_screen_mode_error_cb() will be invoked. - * @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) TIZEN_DEPRECATED_API; - -/** - * @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. - * @param[in] window The EFL window - * @return @c 0 on success, otherwise a negative error value - * @retval #EFL_UTIL_ERROR_NONE Successful - * @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) TIZEN_DEPRECATED_API; - -/** * @brief Sets the user's preferred brightness of the specified window. * @details This API is useful when the application need to change the brightness of the screen when it is appeared on the screen. * If the application sets the brightness 0 to 100 to its window and the application window is shown wholly or partially, diff --git a/src/efl_util.c b/src/efl_util.c index 652aa1a..ae65099 100644 --- a/src/efl_util.c +++ b/src/efl_util.c @@ -94,21 +94,6 @@ static inline tizen_profile_t get_tizen_profile() #define LOG_TAG "TIZEN_N_EFL_UTIL" - -/* callback handler index */ -#define CBH_NOTI_LEV 0 -#define CBH_SCR_MODE 1 -#define CBH_MAX 2 - -typedef void (*Efl_Util_Cb)(Evas_Object *, int, void *); - -typedef struct _Efl_Util_Callback_Info -{ - Evas_Object *win; - Efl_Util_Cb cb; - void *data; -} Efl_Util_Callback_Info; - typedef struct _Efl_Util_Wl_Surface_Lv_Info { void *surface; /* wl_surface */ @@ -225,12 +210,6 @@ typedef struct _Efl_Util_Data int event_init; } gesture; } wl; - - struct - { - Eina_List *info_list; /* list of callback info */ - unsigned int atom; /* x11 atom */ - } cb_handler[CBH_MAX]; } Efl_Util_Data; static Efl_Util_Data _eflutil = @@ -245,22 +224,13 @@ static Efl_Util_Data _eflutil = { 0, NULL, NULL }, /* display_policy protocol */ { NULL, -1, EINA_FALSE } /* tizen_gesture protocol */ }, - { - { NULL, 0 }, /* handler for notification level */ - { NULL, 0 } /* handler for screen mode */ - }, }; -static Eina_Bool _cb_info_add(Evas_Object *win, Efl_Util_Cb cb, void *data, int idx); -static Eina_Bool _cb_info_del_by_win(Evas_Object *win, int idx); -static Eina_List *_cb_info_list_get(int idx); -static Efl_Util_Callback_Info *_cb_info_find_by_win(Evas_Object *win, int idx); static Eina_Bool _wl_init(void); static void _cb_wl_reg_global(void *data, struct wl_registry *reg, unsigned int name, const char *interface, unsigned int version); static void _cb_wl_reg_global_remove(void *data, struct wl_registry *reg, unsigned int name); static void _cb_wl_reg_screenshooter_global(void *data, struct wl_registry *reg, unsigned int name, const char *interface, unsigned int version); static void _cb_wl_reg_screenshooter_global_remove(void *data, struct wl_registry *reg, unsigned int name); -static Efl_Util_Callback_Info *_cb_info_find_by_wlsurf(void *wlsurf, int idx); static void _cb_wl_tz_policy_conformant(void *data, struct tizen_policy *tizen_policy, struct wl_surface *surface, uint32_t is_conformant); static void _cb_wl_tz_policy_conformant_area(void *data, struct tizen_policy *tizen_policy, struct wl_surface *surface, uint32_t conformant_part, uint32_t state, int32_t x, int32_t y, int32_t w, int32_t h); static void _cb_wl_tz_policy_notification_done(void *data, struct tizen_policy *tizen_policy, struct wl_surface *surface, int32_t level, uint32_t state); @@ -343,76 +313,6 @@ struct tizen_gesture_listener _wl_tz_gesture_listener = }; static Eina_Bool -_cb_info_add(Evas_Object *win, - Efl_Util_Cb cb, - void *data, - int idx) -{ - Efl_Util_Callback_Info *info; - - info = _cb_info_find_by_win(win, idx); - if (info) - { - _eflutil.cb_handler[idx].info_list - = eina_list_remove(_eflutil.cb_handler[idx].info_list, - info); - free(info); - } - - info = (Efl_Util_Callback_Info *)calloc(1, sizeof(Efl_Util_Callback_Info)); - if (!info) return EINA_FALSE; - - info->win = win; - info->cb = cb; - info->data = data; - - _eflutil.cb_handler[idx].info_list - = eina_list_append(_eflutil.cb_handler[idx].info_list, - info); - - return EINA_TRUE; -} - -static Eina_Bool -_cb_info_del_by_win(Evas_Object *win, - int idx) -{ - Efl_Util_Callback_Info *info; - - info = _cb_info_find_by_win(win, idx); - if (!info) return EINA_FALSE; - - _eflutil.cb_handler[idx].info_list - = eina_list_remove(_eflutil.cb_handler[idx].info_list, - info); - free(info); - - return EINA_TRUE; -} - -static Eina_List * -_cb_info_list_get(int idx) -{ - return _eflutil.cb_handler[idx].info_list; -} - -static Efl_Util_Callback_Info * -_cb_info_find_by_win(Evas_Object *win, - int idx) -{ - Eina_List *l, *ll; - Efl_Util_Callback_Info *info; - - l = _cb_info_list_get(idx); - EINA_LIST_FOREACH(l, ll, info) - { - if (info->win == win) return info; - } - - return NULL; -} - -static Eina_Bool _wl_init(void) { struct wl_display *display_wrapper = NULL; @@ -644,26 +544,6 @@ _cb_wl_reg_screenshooter_global_remove(void *data, { } -static Efl_Util_Callback_Info * -_cb_info_find_by_wlsurf(void *wlsurf, - int idx) -{ - Eina_List *l, *ll; - Efl_Util_Callback_Info *info; - Ecore_Wl2_Window *wlwin2 = NULL; - void *wlsurf2 = NULL; - - l = _cb_info_list_get(idx); - EINA_LIST_FOREACH(l, ll, info) - { - wlwin2 = (Ecore_Wl2_Window *)elm_win_wl_window_get(info->win); - wlsurf2 = ecore_wl2_window_surface_get(wlwin2); - if (wlsurf== wlsurf2) return info; - } - - return NULL; -} - static void _cb_wl_tz_policy_conformant(void *data, struct tizen_policy *tizen_policy, struct wl_surface *surface, uint32_t is_conformant) @@ -686,7 +566,6 @@ _cb_wl_tz_policy_notification_done(void *data, uint32_t state) { Efl_Util_Wl_Surface_Lv_Info *lv_info; - Efl_Util_Callback_Info *cb_info; lv_info = eina_hash_find(_eflutil.wl.policy.hash_noti_lv, &surface); if (lv_info) @@ -695,16 +574,6 @@ _cb_wl_tz_policy_notification_done(void *data, lv_info->wait_for_done = EINA_FALSE; lv_info->state = state; } - - if (state != TIZEN_POLICY_ERROR_STATE_PERMISSION_DENIED) return; - - cb_info = _cb_info_find_by_wlsurf((void *)surface, CBH_NOTI_LEV); - if (!cb_info) return; - if (!cb_info->cb) return; - - cb_info->cb(cb_info->win, - EFL_UTIL_ERROR_PERMISSION_DENIED, - cb_info->data); } /* LCOV_EXCL_START */ @@ -721,9 +590,7 @@ _cb_wl_tz_policy_scr_mode_done(void *data, uint32_t mode, uint32_t state) { - Efl_Util_Wl_Surface_Scr_Mode_Info *scr_mode_info; - Efl_Util_Callback_Info *cb_info; scr_mode_info = eina_hash_find(_eflutil.wl.policy.hash_scr_mode, &surface); if (scr_mode_info) @@ -732,16 +599,6 @@ _cb_wl_tz_policy_scr_mode_done(void *data, scr_mode_info->wait_for_done = EINA_FALSE; scr_mode_info->state = state; } - - if (state != TIZEN_POLICY_ERROR_STATE_PERMISSION_DENIED) return; - - cb_info = _cb_info_find_by_wlsurf((void *)surface, CBH_SCR_MODE); - if (!cb_info) return; - if (!cb_info->cb) return; - - cb_info->cb(cb_info->win, - EFL_UTIL_ERROR_PERMISSION_DENIED, - cb_info->data); } /* LCOV_EXCL_START */ @@ -806,22 +663,6 @@ 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_Wl2_Window *wlwin; struct wl_surface *surface; @@ -961,9 +802,6 @@ efl_util_get_notification_window_level(Evas_Object *window, switch (lv_info->level) { - case TIZEN_POLICY_LEVEL_1: *level = EFL_UTIL_NOTIFICATION_LEVEL_1; break; - case TIZEN_POLICY_LEVEL_2: *level = EFL_UTIL_NOTIFICATION_LEVEL_2; break; - case TIZEN_POLICY_LEVEL_3: *level = EFL_UTIL_NOTIFICATION_LEVEL_3; break; case TIZEN_POLICY_LEVEL_NONE: *level = EFL_UTIL_NOTIFICATION_LEVEL_NONE; break; case TIZEN_POLICY_LEVEL_DEFAULT: *level = EFL_UTIL_NOTIFICATION_LEVEL_DEFAULT; break; case TIZEN_POLICY_LEVEL_MEDIUM: *level = EFL_UTIL_NOTIFICATION_LEVEL_MEDIUM; break; @@ -981,44 +819,6 @@ efl_util_get_notification_window_level(Evas_Object *window, } API int -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); - EINA_SAFETY_ON_NULL_RETURN_VAL(callback, EFL_UTIL_ERROR_INVALID_PARAMETER); - - ret = _cb_info_add(window, - (Efl_Util_Cb)callback, - user_data, - CBH_NOTI_LEV); - if (!ret) return EFL_UTIL_ERROR_OUT_OF_MEMORY; - - return EFL_UTIL_ERROR_NONE; -} - -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); - - ret = _cb_info_del_by_win(window, CBH_NOTI_LEV); - if (!ret) return EFL_UTIL_ERROR_INVALID_PARAMETER; - - return EFL_UTIL_ERROR_NONE; -} - -API int efl_util_set_window_opaque_state(Evas_Object *window, int opaque) { @@ -1194,52 +994,6 @@ efl_util_get_window_screen_mode(Evas_Object *window, } API int -efl_util_set_window_screen_mode_error_cb(Evas_Object *window, - efl_util_window_screen_mode_error_cb callback, - void *user_data) -{ - /* Wearable device cannot use this. */ - if (get_tizen_profile() == TIZEN_PROFILE_WEARABLE) - return EFL_UTIL_ERROR_NO_SUCH_DEVICE; - - 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); - EINA_SAFETY_ON_NULL_RETURN_VAL(callback, EFL_UTIL_ERROR_INVALID_PARAMETER); - - ret = _cb_info_add(window, - (Efl_Util_Cb)callback, - user_data, - CBH_SCR_MODE); - if (!ret) return EFL_UTIL_ERROR_OUT_OF_MEMORY; - - return EFL_UTIL_ERROR_NONE; -} - -API int -efl_util_unset_window_screen_mode_error_cb(Evas_Object *window) -{ - /* Wearable device cannot use this. */ - if (get_tizen_profile() == TIZEN_PROFILE_WEARABLE) - return EFL_UTIL_ERROR_NO_SUCH_DEVICE; - - 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); - - ret = _cb_info_del_by_win(window, CBH_SCR_MODE); - if (!ret) return EFL_UTIL_ERROR_INVALID_PARAMETER; - - return EFL_UTIL_ERROR_NONE; -} - -API int efl_util_set_window_brightness(Evas_Object *window, int brightness) { Ecore_Wl2_Window *wlwin; -- 2.7.4