Add API to get window notification level 10/130110/4
authorJunghoon Park <jh9216.park@samsung.com>
Fri, 19 May 2017 06:49:23 +0000 (15:49 +0900)
committerHwanKyu Jhun <h.jhun@samsung.com>
Tue, 23 May 2017 23:56:39 +0000 (23:56 +0000)
- This API is dependent on dbus method interface which will be provided by window manager

Change-Id: I72f3898498ec28c2fb6316a898bc7cba88d4d4d5
Signed-off-by: Junghoon Park <jh9216.park@samsung.com>
include/aul_window.h
src/aul_window.c

index dd7f507..83cf4bc 100755 (executable)
@@ -160,6 +160,27 @@ int aul_window_info_has_alpha(aul_window_info_h info, bool *alpha);
 */
 int aul_window_info_is_focused(aul_window_info_h info, bool *focused);
 
+typedef enum _aul_window_notification_level_e {
+       AUL_WINDOW_NOTIFICATION_LEVEL_NONE = 0,
+       AUL_WINDOW_NOTIFICATION_LEVEL_DEFAULT = 10,
+       AUL_WINDOW_NOTIFICATION_LEVEL_MEDIUM = 20,
+       AUL_WINDOW_NOTIFICATION_LEVEL_HIGH = 30,
+       AUL_WINDOW_NOTIFICATION_LEVEL_TOP = 40,
+       AUL_WINDOW_NOTIFICATION_LEVEL_PRIVILEGE = 99,
+} aul_window_notification_level_e;
+
+/**
+ * @par Description:
+ *     This API gets the window notification level from the window handle.
+ *
+ * @param[in]  info    Handle for the window
+ * @param[out] level   Notification level
+ * @return     0 if success, negative value(<0) if fail
+ *
+*/
+int aul_window_info_get_notification_level(aul_window_info_h info,
+               aul_window_notification_level_e *level);
+
 /**
  * @par Description:
  *     This API gets the location and the size from window handle.
index fad56d9..82d8c48 100644 (file)
@@ -50,6 +50,7 @@ typedef struct _window_info {
        int pid;
        int ppid;
        int apid;
+       int noti_level;
 } window_info;
 
 API int aul_window_stack_get(aul_window_stack_h *handle)
@@ -108,8 +109,8 @@ API int aul_window_stack_get(aul_window_stack_h *handle)
                goto out;
        }
 
-       g_variant_get(body, "(a(uiiiibibiii))", &iter);
-       while (g_variant_iter_loop(iter, "(uiiiibibiii)",
+       g_variant_get(body, "(a(uiiiibibiiii))", &iter);
+       while (g_variant_iter_loop(iter, "(uiiiibibiiii)",
                        &wi->gid,
                        &wi->x,
                        &wi->y,
@@ -120,7 +121,8 @@ API int aul_window_stack_get(aul_window_stack_h *handle)
                        &wi->focused,
                        &wi->pid,
                        &wi->ppid,
-                       &wi->apid)) {
+                       &wi->apid,
+                       &wi->noti_level)) {
                list = g_list_append(list, wi);
                wi = malloc(sizeof(window_info));
        }
@@ -259,6 +261,19 @@ API int aul_window_info_get_geometry(aul_window_info_h info, int *x, int *y, int
        return 0;
 }
 
+API int aul_window_info_get_notification_level(aul_window_info_h info,
+               aul_window_notification_level_e *level)
+{
+       window_info *wi = info;
+
+       if (!info || !level)
+               return -1;
+
+       *level = (aul_window_notification_level_e)wi->noti_level;
+
+       return 0;
+}
+
 API int aul_window_get_focused_pid(pid_t *pid)
 {
        GError *err = NULL;