summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--[-rwxr-xr-x]AUTHORS2
-rw-r--r--[-rwxr-xr-x]CMakeLists.txt0
-rw-r--r--[-rwxr-xr-x]TC/testcase/Makefile0
-rw-r--r--[-rwxr-xr-x]TC/testcase/tslist0
-rw-r--r--[-rwxr-xr-x]TC/testcase/utc_efl_util_set_notification_window_level.c75
-rw-r--r--[-rwxr-xr-x]TC/tetbuild.cfg0
-rw-r--r--[-rwxr-xr-x]TC/tetclean.cfg0
-rw-r--r--[-rwxr-xr-x]TC/tetexec.cfg0
-rw-r--r--[-rwxr-xr-x]capi-ui-efl-util.pc.in0
-rw-r--r--doc/ui_efl_util_doc.h41
-rw-r--r--[-rwxr-xr-x]include/efl_util.h94
-rw-r--r--packaging/capi-ui-efl-util.spec13
-rw-r--r--[-rwxr-xr-x]src/efl_util.c195
13 files changed, 391 insertions, 29 deletions
diff --git a/AUTHORS b/AUTHORS
index 5b0ed9c..0e57832 100755..100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -1 +1,3 @@
+Doyoun Kang <doyoun.kang@samsung.com>
+Gwanglim Lee <gl77.lee@samsung.com>
Kyuhun Jung <kyuhun.jung@samsung.com>
diff --git a/CMakeLists.txt b/CMakeLists.txt
index c0b9e7b..c0b9e7b 100755..100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
diff --git a/TC/testcase/Makefile b/TC/testcase/Makefile
index 0d15f65..0d15f65 100755..100644
--- a/TC/testcase/Makefile
+++ b/TC/testcase/Makefile
diff --git a/TC/testcase/tslist b/TC/testcase/tslist
index 48142ea..48142ea 100755..100644
--- a/TC/testcase/tslist
+++ b/TC/testcase/tslist
diff --git a/TC/testcase/utc_efl_util_set_notification_window_level.c b/TC/testcase/utc_efl_util_set_notification_window_level.c
index 0c9ab66..d468318 100755..100644
--- a/TC/testcase/utc_efl_util_set_notification_window_level.c
+++ b/TC/testcase/utc_efl_util_set_notification_window_level.c
@@ -38,9 +38,11 @@ static void utc_efl_util_get_notification_window_level_negative_2(void);
static void utc_efl_util_set_notification_window_level_positive_1(void);
static void utc_efl_util_set_notification_window_level_positive_2(void);
+static void utc_efl_util_set_notification_window_level_positive_3(void);
static void utc_efl_util_get_notification_window_level_positive_1(void);
static void utc_efl_util_get_notification_window_level_positive_2(void);
+static void utc_efl_util_get_notification_window_level_positive_3(void);
struct tet_testlist tet_testlist[] = {
@@ -51,8 +53,10 @@ struct tet_testlist tet_testlist[] = {
{ utc_efl_util_get_notification_window_level_negative_2, 1 },
{ utc_efl_util_set_notification_window_level_positive_1, 1 },
{ utc_efl_util_set_notification_window_level_positive_2, 1 },
+ { utc_efl_util_set_notification_window_level_positive_3, 1 },
{ utc_efl_util_get_notification_window_level_positive_1, 1 },
{ utc_efl_util_get_notification_window_level_positive_2, 1 },
+ { utc_efl_util_get_notification_window_level_positive_3, 1 },
{ NULL, 0 },
};
@@ -88,7 +92,7 @@ static Evas_Object* create_normal_win(const char *name)
elm_win_borderless_set(eo, EINA_TRUE);
evas_object_smart_callback_add(eo, "delete,request",
win_del, NULL);
- elm_win_indicator_state_set(eo, EINA_TRUE);
+ elm_win_indicator_mode_set(eo, ELM_WIN_INDICATOR_SHOW);
}
return eo;
@@ -106,7 +110,7 @@ static Evas_Object* create_notification_win(const char *name)
elm_win_borderless_set(eo, EINA_TRUE);
evas_object_smart_callback_add(eo, "delete,request",
win_del, NULL);
- elm_win_indicator_state_set(eo, EINA_TRUE);
+ elm_win_indicator_mode_set(eo, ELM_WIN_INDICATOR_SHOW);
}
return eo;
@@ -294,6 +298,35 @@ static void utc_efl_util_set_notification_window_level_positive_2(void)
/**
* @brief Positive test case of efl_util_set_notification_window_level()
*/
+static void utc_efl_util_set_notification_window_level_positive_3(void)
+{
+ Evas_Object *win;
+ int ret1, ret2, ret3;
+
+ win = create_notification_win("Notification Type Window");
+ if (!win)
+ {
+ dts_fail(API_SET_NOTIFICATION_WINDOW_LEVEL, "failed to create window");
+ }
+
+ ret1 = efl_util_set_notification_window_level(win, EFL_UTIL_NOTIFICATION_LEVEL_1);
+ ret2 = efl_util_set_notification_window_level(win, EFL_UTIL_NOTIFICATION_LEVEL_2);
+ ret3 = efl_util_set_notification_window_level(win, EFL_UTIL_NOTIFICATION_LEVEL_3);
+
+ if (ret3 == EFL_UTIL_ERROR_NONE)
+ {
+ dts_pass(API_SET_NOTIFICATION_WINDOW_LEVEL, "passed");
+ }
+ else
+ {
+ dts_fail(API_SET_NOTIFICATION_WINDOW_LEVEL, "failed");
+ }
+}
+
+
+/**
+ * @brief Positive test case of efl_util_set_notification_window_level()
+ */
static void utc_efl_util_get_notification_window_level_positive_1(void)
{
Evas_Object *win;
@@ -365,3 +398,41 @@ static void utc_efl_util_get_notification_window_level_positive_2(void)
}
}
+
+/**
+ * @brief Positive test case of efl_util_set_notification_window_level()
+ */
+static void utc_efl_util_get_notification_window_level_positive_3(void)
+{
+ Evas_Object *win;
+ int ret;
+ int level;
+
+ win = create_notification_win("Notification Type Window");
+ if (!win)
+ {
+ dts_fail(API_GET_NOTIFICATION_WINDOW_LEVEL, "failed to create window");
+ }
+ efl_util_set_notification_window_level(win, EFL_UTIL_NOTIFICATION_LEVEL_1);
+ efl_util_set_notification_window_level(win, EFL_UTIL_NOTIFICATION_LEVEL_3);
+
+ level = -1;
+ ret = efl_util_get_notification_window_level(win, &level);
+
+ if (ret == EFL_UTIL_ERROR_NONE)
+ {
+ if (level == EFL_UTIL_NOTIFICATION_LEVEL_3)
+ {
+ dts_pass(API_GET_NOTIFICATION_WINDOW_LEVEL, "passed");
+ }
+ else
+ {
+ dts_fail(API_GET_NOTIFICATION_WINDOW_LEVEL, "failed - level is wrong");
+ }
+ }
+ else
+ {
+ dts_fail(API_GET_NOTIFICATION_WINDOW_LEVEL, "failed - return value is wrong");
+ }
+}
+
diff --git a/TC/tetbuild.cfg b/TC/tetbuild.cfg
index f7eda55..f7eda55 100755..100644
--- a/TC/tetbuild.cfg
+++ b/TC/tetbuild.cfg
diff --git a/TC/tetclean.cfg b/TC/tetclean.cfg
index 02d7030..02d7030 100755..100644
--- a/TC/tetclean.cfg
+++ b/TC/tetclean.cfg
diff --git a/TC/tetexec.cfg b/TC/tetexec.cfg
index ef3e452..ef3e452 100755..100644
--- a/TC/tetexec.cfg
+++ b/TC/tetexec.cfg
diff --git a/capi-ui-efl-util.pc.in b/capi-ui-efl-util.pc.in
index a73c2bd..a73c2bd 100755..100644
--- a/capi-ui-efl-util.pc.in
+++ b/capi-ui-efl-util.pc.in
diff --git a/doc/ui_efl_util_doc.h b/doc/ui_efl_util_doc.h
new file mode 100644
index 0000000..64de8d0
--- /dev/null
+++ b/doc/ui_efl_util_doc.h
@@ -0,0 +1,41 @@
+/*
+ * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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 __TIZEN_UI_EFL_UTIL_DOC_H__
+#define __TIZEN_UI_EFL_UTIL_DOC_H__
+
+/**
+ * @ingroup CAPI_UI_FRAMEWORK
+ * @defgroup CAPI_EFL_UTIL_MODULE EFL UTIL
+ * @brief
+ *
+ * @section CAPI_EFL_UTIL_MODULE_HEADER Required Header
+ * \#include <efl_util.h>
+ *
+ * @section CAPI_EFL_UTIL_MODULE_OVERVIEW Overview
+ * The EFL UTIL API provides functions to get the level of given notification windows
+ * and to change the notification window levels with the given values.
+ *
+ * The notification window level is used in ordering the notification windows.
+ * The notification window which is set to #EFL_UTIL_NOTIFICATION_LEVEL_2 will be
+ * placed above the window which is set to #EFL_UTIL_NOTIFICATION_LEVEL_1.
+ * If there are notification windows that have the same levels, the latest created
+ * notification window is placed on top of the other window.
+ *
+ */
+
+#endif /* __TIZEN_UI_EFL_UTIL_DOC_H__ */
diff --git a/include/efl_util.h b/include/efl_util.h
index 309df42..fe01c53 100755..100644
--- a/include/efl_util.h
+++ b/include/efl_util.h
@@ -26,6 +26,10 @@ extern "C" {
#endif
/**
+ * @file efl_util.h
+ */
+
+/**
* @addtogroup CAPI_EFL_UTIL_MODULE
* @{
*/
@@ -154,13 +158,17 @@ typedef enum _Efl_Util_Notification_Level
} Efl_Util_Notification_Level;
/**
- * @brief Enumerations of error code for EFL UTIL
+ * @brief Enumeration for EFL UTIL ERROR.
+ * @since_tizen 2.3
*/
typedef enum
{
EFL_UTIL_ERROR_NONE = TIZEN_ERROR_NONE, /**< Successful */
EFL_UTIL_ERROR_INVALID_PARAMETER = TIZEN_ERROR_INVALID_PARAMETER, /**< Invalid parameter */
- EFL_UTIL_ERROR_NOT_SUPPORTED_WINDOW_TYPE = TIZEN_ERROR_APPLICATION_CLASS | 0x08 /**< Not supported window type */
+ EFL_UTIL_ERROR_OUT_OF_MEMORY = TIZEN_ERROR_OUT_OF_MEMORY, /**< Out of memory */
+ EFL_UTIL_ERROR_PERMISSION_DENIED = TIZEN_ERROR_PERMISSION_DENIED, /**< Permisson denied */
+ EFL_UTIL_ERROR_NOT_SUPPORTED_WINDOW_TYPE = -0x02800000 | 0x01 /**< Window type not supported */
+ //EFL_UTIL_ERROR_NOT_SUPPORTED_WINDOW_TYPE = TIZEN_ERROR_EFL_UTIL | 0x01 /**< Window type not supported */
} efl_util_error_e;
// TODO: are we going to have more states than on/off shouldn't we move it to a bool in the API's
@@ -170,14 +178,15 @@ typedef enum _Efl_Util_Opaque_State
EFL_UTIL_OPAQUE_STATE_ON = 1, /**< Opaque state */
} Efl_Util_Opaque_State;
-/**
- * @brief Enumeration of notification window's priority level
- *
+/**
+ * @brief Enumeration of notification window's priority level.
+ * @since_tizen 2.3
*/
typedef enum
{
- EFL_UTIL_NOTIFICATION_LEVEL_1, /**< Default notification level*/
- EFL_UTIL_NOTIFICATION_LEVEL_2, /**< Higher notification level than default*/
+ EFL_UTIL_NOTIFICATION_LEVEL_1, /**< Default notification level */
+ EFL_UTIL_NOTIFICATION_LEVEL_2, /**< Higher notification level than default */
+ EFL_UTIL_NOTIFICATION_LEVEL_3, /**< The highest notification level */
} efl_util_notification_level_e;
typedef enum _Efl_Util_Effect_Type
@@ -208,31 +217,80 @@ typedef enum _Efl_Util_Effect_Style
/**
* @brief Sets the priority level for the specified notification window, asynchronously.
- *
- * @remark This API can be used for notification type window only
- * @param [in] window EFL window
- * @param [in] level The notification window level
- * @return 0 on success, otherwise a negative error value.
+ * @since_tizen 2.3
+ * @privlevel public
+ * @privilege %http://tizen.org/privilege/window.priority.set
+ * @remarks This API can be used for a notification type window only.
+ * @param[in] window The EFL window
+ * @param[in] level The notification window level
+ * @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_NOT_SUPPORTED_WINDOW_TYPE Not supported window type
+ * @retval #EFL_UTIL_ERROR_NOT_SUPPORTED_WINDOW_TYPE Window type not supported
*/
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.
+ * @since_tizen 2.3
*
- * @remark This API can be used for notification type window only
- * @param [in] window EFL window
- * @param [out] level The notification window level
- * @return 0 on success, otherwise a negative error value.
+ * @remarks This API can be used for a notification type window only.
+ * @param[in] window The EFL window
+ * @param[out] level The notification window level
+ * @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_NOT_SUPPORTED_WINDOW_TYPE Not supported window type
+ * @retval #EFL_UTIL_ERROR_NOT_SUPPORTED_WINDOW_TYPE Window type not supported
*/
int efl_util_get_notification_window_level (Evas_Object *window, efl_util_notification_level_e* level);
+
+/**
+ * @brief Called when an error occurs for setting notification window level
+ * @since_tizen 2.3
+ * @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);
+
+
+/**
+ * @brief Registers a callback function to be invoked when an error which set the notification level occurs.
+ * @since_tizen 2.3
+ * @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()
+ */
+int efl_util_set_notification_window_level_error_cb(Evas_Object *window, efl_util_notification_window_level_error_cb callback, void *user_data);
+
+
+/**
+ * @brief Unregisters the callback function.
+ * @since_tizen 2.3
+ * @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()
+ */
+int efl_util_unset_notification_window_level_error_cb(Evas_Object *window);
+
+
/**
* @brief Grabs a key specfied by key_name for obj in grab_mode.
*
diff --git a/packaging/capi-ui-efl-util.spec b/packaging/capi-ui-efl-util.spec
index a1f6aba..60028ec 100644
--- a/packaging/capi-ui-efl-util.spec
+++ b/packaging/capi-ui-efl-util.spec
@@ -1,7 +1,7 @@
%bcond_with x
Name: capi-ui-efl-util
Summary: An EFL utility library in SLP C API
-Version: 0.1.0
+Version: 0.1.1
Release: 1
Group: Graphics & UI Framework/API
License: Apache-2.0
@@ -12,6 +12,7 @@ BuildRequires: pkgconfig(dlog)
%if %{with x}
BuildRequires: pkgconfig(x11)
BuildRequires: pkgconfig(utilX)
+BuildRequires: pkgconfig(ecore-x)
%endif
BuildRequires: pkgconfig(elementary)
BuildRequires: pkgconfig(capi-base-common)
@@ -40,6 +41,10 @@ make %{?jobs:-j%jobs}
%install
%make_install
+# for license notification
+mkdir -p %{buildroot}/usr/share/license
+cp -a LICENSE.APLv2 %{buildroot}/usr/share/license/%{name}
+
%post -p /sbin/ldconfig
%postun -p /sbin/ldconfig
@@ -49,11 +54,11 @@ make %{?jobs:-j%jobs}
%manifest %{name}.manifest
%license LICENSE.APLv2
%{_libdir}/libcapi-ui-efl-util.so.*
+/usr/share/license/%{name}
%files devel
%manifest %{name}.manifest
-%{_includedir}/ui/*.h
+%{_includedir}/ui/efl_util.h
%{_libdir}/pkgconfig/*.pc
%{_libdir}/libcapi-ui-efl-util.so
-
-
+%exclude %{_includedir}/ui/config.h
diff --git a/src/efl_util.c b/src/efl_util.c
index d3408bc..7307448 100755..100644
--- a/src/efl_util.c
+++ b/src/efl_util.c
@@ -29,12 +29,31 @@
#include <utilX.h>
#endif
+typedef struct _notification_error_cb_info
+{
+ Evas_Object *window;
+ efl_util_notification_window_level_error_cb err_cb;
+ void *user_data;
+} notification_error_cb_info;
+
+Eina_List *_g_notification_error_cb_info_list;
+static Ecore_Event_Handler* _noti_level_access_result_handler = NULL;
+static int _noti_handler_count = 0;
+static unsigned int _noti_level_access_result_atom = 0;
+
+static Eina_Bool _efl_util_client_message(void *data, int type, void *event);
+static notification_error_cb_info *_notification_error_cb_info_find(Evas_Object *window);
+static notification_error_cb_info *_notification_error_cb_info_find_by_xwin(unsigned int xwin);
+static Eina_Bool _efl_util_notification_info_add(Evas_Object *window, efl_util_notification_window_level_error_cb callback, void *user_data);
+static Eina_Bool _efl_util_notification_info_del(Evas_Object *window);
+
+
int efl_util_set_notification_window_level (Evas_Object* window, efl_util_notification_level_e level)
{
- EINA_SAFETY_ON_NULL_RETURN_VAL(window, EFL_UTIL_ERROR_NOT_SUPPORTED_WINDOW_TYPE);
+ EINA_SAFETY_ON_NULL_RETURN_VAL(window, EFL_UTIL_ERROR_INVALID_PARAMETER);
EINA_SAFETY_ON_FALSE_RETURN_VAL(level >= EFL_UTIL_NOTIFICATION_LEVEL_1 &&
- level <= EFL_UTIL_NOTIFICATION_LEVEL_2,
- EFL_UTIL_ERROR_NOT_SUPPORTED_WINDOW_TYPE);
+ level <= EFL_UTIL_NOTIFICATION_LEVEL_3,
+ EFL_UTIL_ERROR_INVALID_PARAMETER);
#if ECORE_X_FOUND
Ecore_X_Window xwin = elm_win_xwindow_get(window);
@@ -77,7 +96,9 @@ int efl_util_get_notification_window_level (Evas_Object* window, efl_util_notifi
{
EINA_SAFETY_ON_NULL_RETURN_VAL(window,
- EFL_UTIL_ERROR_NOT_SUPPORTED_WINDOW_TYPE);
+ EFL_UTIL_ERROR_INVALID_PARAMETER);
+ EINA_SAFETY_ON_NULL_RETURN_VAL(level,
+ EFL_UTIL_ERROR_INVALID_PARAMETER);
#if ECORE_X_FOUND
Ecore_X_Window_Type window_type;
@@ -106,7 +127,7 @@ int efl_util_get_notification_window_level (Evas_Object* window, efl_util_notifi
}
else if(utilx_level == UTILX_NOTIFICATION_LEVEL_HIGH)
{
- *level = EFL_UTIL_NOTIFICATION_LEVEL_2;
+ *level = EFL_UTIL_NOTIFICATION_LEVEL_3;
}
else
{
@@ -135,6 +156,62 @@ int efl_util_get_notification_window_level (Evas_Object* window, efl_util_notifi
return EFL_UTIL_ERROR_NOT_SUPPORTED_WINDOW_TYPE;
}
+int efl_util_set_notification_window_level_error_cb(Evas_Object *window, efl_util_notification_window_level_error_cb callback, void *user_data)
+{
+ 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 = _efl_util_notification_info_add(window, callback, user_data);
+ if (ret)
+ {
+#if ECORE_X_FOUND
+ if (!_noti_level_access_result_atom)
+ _noti_level_access_result_atom = ecore_x_atom_get("_E_NOTIFICATION_LEVEL_ACCESS_RESULT");
+
+ if (!_noti_level_access_result_handler)
+ _noti_level_access_result_handler = ecore_event_handler_add(ECORE_X_EVENT_CLIENT_MESSAGE, _efl_util_client_message, NULL);
+ _noti_handler_count++;
+
+ return EFL_UTIL_ERROR_NONE;
+#endif
+
+#if ECORE_WAYLAND_FOUND
+ printf("not implemented for wayland yet\n");
+ return EFL_UTIL_ERROR_NOT_SUPPORTED_WINDOW_TYPE;
+#endif
+ }
+
+ return EFL_UTIL_ERROR_OUT_OF_MEMORY;
+}
+
+int efl_util_unset_notification_window_level_error_cb(Evas_Object *window)
+{
+ Eina_Bool ret = EINA_FALSE;
+
+ EINA_SAFETY_ON_NULL_RETURN_VAL(window, EFL_UTIL_ERROR_INVALID_PARAMETER);
+
+ ret = _efl_util_notification_info_del(window);
+ if (ret)
+ {
+ _noti_handler_count--;
+ if (_noti_handler_count == 0)
+ {
+ if (_noti_level_access_result_handler)
+ {
+ ecore_event_handler_del(_noti_level_access_result_handler);
+ _noti_level_access_result_handler = NULL;
+ }
+ }
+ return EFL_UTIL_ERROR_NONE;
+ }
+
+ return EFL_UTIL_ERROR_INVALID_PARAMETER;
+}
+
int efl_util_grab_key (Evas_Object *obj, const char* key, int grab_mode)
{
EINA_SAFETY_ON_NULL_RETURN_VAL(obj, 0);
@@ -323,3 +400,111 @@ int efl_util_set_window_opaque_state (Evas_Object *win, Efl_Util_Opaque_State st
return 0;
}
+
+static Eina_Bool _efl_util_client_message(void *data, int type, void *event)
+{
+#if ECORE_X_FOUND
+ Ecore_X_Event_Client_Message *ev;
+
+ ev = event;
+ if (!ev) return ECORE_CALLBACK_PASS_ON;
+
+ if (ev->message_type == _noti_level_access_result_atom)
+ {
+ Ecore_X_Window xwin;
+ xwin = ev->win;
+
+ notification_error_cb_info *cb_info = NULL;
+ cb_info = _notification_error_cb_info_find_by_xwin(xwin);
+ if (cb_info)
+ {
+ int access = ev->data.l[1];
+ if (access == 0) // permission denied
+ {
+ if (cb_info->err_cb)
+ {
+ cb_info->err_cb(cb_info->window, EFL_UTIL_ERROR_PERMISSION_DENIED, cb_info->user_data);
+ }
+ }
+ }
+ }
+#endif
+
+ return ECORE_CALLBACK_PASS_ON;
+}
+
+static notification_error_cb_info *_notification_error_cb_info_find_by_xwin(unsigned int xwin)
+{
+ Eina_List *l;
+ notification_error_cb_info* temp;
+ unsigned int temp_xwin;
+
+ EINA_LIST_FOREACH(_g_notification_error_cb_info_list, l, temp)
+ {
+ if (temp->window)
+ {
+ temp_xwin = elm_win_xwindow_get(temp->window);
+ if (xwin == temp_xwin)
+ {
+ return temp;
+ }
+ }
+ }
+
+ return NULL;
+}
+
+static notification_error_cb_info *_notification_error_cb_info_find(Evas_Object *window)
+{
+ Eina_List *l;
+ notification_error_cb_info* temp;
+
+ EINA_LIST_FOREACH(_g_notification_error_cb_info_list, l, temp)
+ {
+ if (temp->window == window)
+ {
+ return temp;
+ }
+ }
+
+ return NULL;
+}
+
+static Eina_Bool _efl_util_notification_info_add(Evas_Object *window, efl_util_notification_window_level_error_cb callback, void *user_data)
+{
+ notification_error_cb_info* _err_info = _notification_error_cb_info_find(window);
+
+ if (_err_info)
+ {
+ _g_notification_error_cb_info_list = eina_list_remove(_g_notification_error_cb_info_list, _err_info);
+ free(_err_info);
+ _err_info = NULL;
+ }
+
+ _err_info = (notification_error_cb_info*)calloc(1, sizeof(notification_error_cb_info));
+ if (!_err_info)
+ {
+ return EINA_FALSE;
+ }
+ _err_info->window = window;
+ _err_info->err_cb = callback;
+ _err_info->user_data = user_data;
+
+ _g_notification_error_cb_info_list = eina_list_append(_g_notification_error_cb_info_list, _err_info);
+
+ return EINA_TRUE;
+}
+
+static Eina_Bool _efl_util_notification_info_del(Evas_Object *window)
+{
+ notification_error_cb_info* _err_info = _notification_error_cb_info_find(window);
+ if (!_err_info)
+ {
+ return EINA_FALSE;
+ }
+
+ _g_notification_error_cb_info_list = eina_list_remove(_g_notification_error_cb_info_list, _err_info);
+ free(_err_info);
+
+ return EINA_TRUE;
+}