} efl_util_screen_mode_e;
/**
- * @brief Sets the priority level for the specified notification window, asynchronously.
+ * @brief Sets the priority level for the specified notification window.
* @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
* @privlevel public
* @privilege %http://tizen.org/privilege/window.priority.set
* @retval #EFL_UTIL_ERROR_NONE Successful
* @retval #EFL_UTIL_ERROR_INVALID_PARAMETER Invalid parameter
* @retval #EFL_UTIL_ERROR_NOT_SUPPORTED_WINDOW_TYPE Window type not supported
+ * @retval #EFL_UTIL_ERROR_PERMISSION_DENIED Unprevilige access
*/
API int efl_util_set_notification_window_level(Evas_Object *window, efl_util_notification_level_e level);
/**
- * @brief Gets the priority level for the specified notification window, asynchronously.
+ * @brief Gets the priority level for the specified notification window.
* @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
*
* @remarks This API can be used for a notification type window only.
API int efl_util_get_notification_window_level(Evas_Object *window, efl_util_notification_level_e *level);
/**
+ * @deprecated Deprecated since_tizen 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
* @param[in] window The EFL window
typedef void (*efl_util_notification_window_level_error_cb)(Evas_Object *window, int error_code, void *user_data);
/**
+ * @deprecated Deprecated since_tizen 3.0
* @brief Registers a callback function to be invoked when an error which set the notification level occurs.
+ * @details An application can check error by the return value of efl_util_set_notification_window_level.
* @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
* @param[in] window The EFL window
* @param[in] callback The callback function to register
API int efl_util_set_notification_window_level_error_cb(Evas_Object *window, efl_util_notification_window_level_error_cb callback, void *user_data);
/**
+ * @deprecated Deprecated since_tizen 3.0
* @brief Unregisters the callback function.
+ * @details An application can check error by the return value of efl_util_set_notification_window_level.
* @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
* @param[in] window The EFL window
* @return @c 0 on success, otherwise a negative error value
* @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_PERMISSION_DENIED Unprevilige access
*/
API int efl_util_set_window_screen_mode(Evas_Object *window, efl_util_screen_mode_e mode);
API int efl_util_get_window_screen_mode(Evas_Object *window, efl_util_screen_mode_e *mode);
/**
+ * @deprecated Deprecated since_tizen 3.0
* @brief Called when an error occurs for setting window's screen mode
* @since_tizen 2.4
* @param[in] window The EFL window
typedef void (*efl_util_window_screen_mode_error_cb)(Evas_Object *window, int error_code, void *user_data);
/**
+ * @deprecated Deprecated since_tizen 3.0
* @brief Registers a callback function to be invoked when an error which set the screen mode.
+ * @details An application can check error by the return value of efl_util_set_window_screen_mode.
* @since_tizen 2.4
* @param[in] window The EFL window
* @param[in] callback The callback function to register
API int efl_util_set_window_screen_mode_error_cb(Evas_Object *window, efl_util_window_screen_mode_error_cb callback, void *user_data);
/**
+ * @deprecated Deprecated since_tizen 3.0
* @brief Unregisters the callback function.
+ * @details An application can check error by the return value of efl_util_set_window_screen_mode.
* @since_tizen 2.4
* @param[in] window The EFL window
* @return @c 0 on success, otherwise a negative error value
void *surface; /* wl_surface */
int level;
Eina_Bool wait_for_done;
+ uint32_t state;
} Efl_Util_Wl_Surface_Lv_Info;
typedef struct _Efl_Util_Wl_Surface_Scr_Mode_Info
void *surface; /* wl_surface */
unsigned int mode;
Eina_Bool wait_for_done;
+ uint32_t state;
} Efl_Util_Wl_Surface_Scr_Mode_Info;
typedef struct _Efl_Util_Wl_Output_Info
{
lv_info->level = level;
lv_info->wait_for_done = EINA_FALSE;
+ lv_info->state = state;
}
if (state != TIZEN_POLICY_ERROR_STATE_PERMISSION_DENIED) return;
{
scr_mode_info->mode = mode;
scr_mode_info->wait_for_done = EINA_FALSE;
+ scr_mode_info->state = state;
}
if (state != TIZEN_POLICY_ERROR_STATE_PERMISSION_DENIED) return;
lv_info->surface = surface;
lv_info->level = (int)level;
lv_info->wait_for_done = EINA_TRUE;
-
+ lv_info->state = TIZEN_POLICY_ERROR_STATE_NONE;
eina_hash_add(_eflutil.wl.policy.hash_noti_lv,
&surface,
lv_info);
{
lv_info->level = (int)level;
lv_info->wait_for_done = EINA_TRUE;
+ lv_info->state = TIZEN_POLICY_ERROR_STATE_NONE;
}
tizen_policy_set_notification_level(_eflutil.wl.policy.proto,
surface, (int)level);
+ if (lv_info->wait_for_done)
+ {
+ int count = 0;
+ while (lv_info->wait_for_done && (count < 3))
+ {
+ ecore_wl_flush();
+ wl_display_dispatch_queue(_eflutil.wl.dpy, _eflutil.wl.queue);
+ count++;
+ }
+
+ if (lv_info->wait_for_done)
+ {
+ return EFL_UTIL_ERROR_INVALID_PARAMETER;
+ }
+ else
+ {
+ if (lv_info->state == TIZEN_POLICY_ERROR_STATE_PERMISSION_DENIED)
+ {
+ return EFL_UTIL_ERROR_PERMISSION_DENIED;
+ }
+ }
+ }
+
return EFL_UTIL_ERROR_NONE;
#endif /* end of WAYLAND */
}
scr_mode_info->surface = surface;
scr_mode_info->mode = (unsigned int)mode;
scr_mode_info->wait_for_done = EINA_TRUE;
+ scr_mode_info->state = TIZEN_POLICY_ERROR_STATE_NONE;
eina_hash_add(_eflutil.wl.policy.hash_scr_mode,
&surface,
{
scr_mode_info->mode = (unsigned int)mode;
scr_mode_info->wait_for_done = EINA_TRUE;
+ scr_mode_info->state = TIZEN_POLICY_ERROR_STATE_NONE;
}
tizen_policy_set_window_screen_mode(_eflutil.wl.policy.proto,
surface, (unsigned int)mode);
+ if (scr_mode_info->wait_for_done)
+ {
+ int count = 0;
+ while (scr_mode_info->wait_for_done && (count < 3))
+ {
+ ecore_wl_flush();
+ wl_display_dispatch_queue(_eflutil.wl.dpy, _eflutil.wl.queue);
+ count++;
+ }
+
+ if (scr_mode_info->wait_for_done)
+ {
+ return EFL_UTIL_ERROR_INVALID_PARAMETER;
+ }
+ else
+ {
+ if (scr_mode_info->state == TIZEN_POLICY_ERROR_STATE_PERMISSION_DENIED)
+ {
+ return EFL_UTIL_ERROR_PERMISSION_DENIED;
+ }
+ }
+ }
return EFL_UTIL_ERROR_NONE;
}