From ebfc353a8a70e3a2dd971874584074179c8a9ea3 Mon Sep 17 00:00:00 2001 From: Junghoon Park Date: Fri, 19 May 2017 15:49:23 +0900 Subject: [PATCH] Add API to get window notification level - This API is dependent on dbus method interface which will be provided by window manager Change-Id: I72f3898498ec28c2fb6316a898bc7cba88d4d4d5 Signed-off-by: Junghoon Park --- include/aul_window.h | 21 +++++++++++++++++++++ src/aul_window.c | 21 ++++++++++++++++++--- 2 files changed, 39 insertions(+), 3 deletions(-) diff --git a/include/aul_window.h b/include/aul_window.h index dd7f507..83cf4bc 100755 --- a/include/aul_window.h +++ b/include/aul_window.h @@ -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. diff --git a/src/aul_window.c b/src/aul_window.c index fad56d9..82d8c48 100644 --- a/src/aul_window.c +++ b/src/aul_window.c @@ -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; -- 2.7.4