From 3f19af577e76093efffe6868223044f80f55c56f Mon Sep 17 00:00:00 2001 From: Duna Oh Date: Tue, 22 Sep 2015 16:43:56 +0900 Subject: [PATCH] e_comp_wl: add aux_hint to E_Comp_Wl_Client_Data Change-Id: Ib4f3aca1d4df081877bd20161415c5f84acc2aa3 Signed-off-by: Duna Oh --- src/bin/e_comp_wl.c | 12 ++++++++++++ src/bin/e_comp_wl.h | 13 +++++++++++++ src/bin/e_hints.c | 42 ++++++++++++++++++++++++++++++++++++++++++ src/bin/e_hints.h | 5 +++-- 4 files changed, 70 insertions(+), 2 deletions(-) diff --git a/src/bin/e_comp_wl.c b/src/bin/e_comp_wl.c index d06e544..c081fe7 100755 --- a/src/bin/e_comp_wl.c +++ b/src/bin/e_comp_wl.c @@ -3005,6 +3005,7 @@ _e_comp_wl_client_cb_new(void *data EINA_UNUSED, E_Client *ec) EINA_SAFETY_ON_NULL_RETURN(p_cdata); ec->comp_data->accepts_focus = p_cdata->accepts_focus; ec->comp_data->conformant = p_cdata->conformant; + ec->comp_data->aux_hint.hints = p_cdata->aux_hint.hints; /* add this client to the hash */ /* eina_hash_add(clients_win_hash, &win, ec); */ @@ -3078,6 +3079,17 @@ _e_comp_wl_client_cb_del(void *data EINA_UNUSED, E_Client *ec) if (ec->comp_data->surface) wl_resource_set_user_data(ec->comp_data->surface, NULL); + if (ec->comp_data->aux_hint.hints) + { + E_Comp_Wl_Aux_Hint *hint; + EINA_LIST_FREE(ec->comp_data->aux_hint.hints, hint) + { + eina_stringshare_del(hint->hint); + eina_stringshare_del(hint->val); + E_FREE(hint); + } + } + e_pixmap_cdata_set(ec->pixmap, NULL); E_FREE(ec->comp_data); diff --git a/src/bin/e_comp_wl.h b/src/bin/e_comp_wl.h index e57d09f..2085d92 100755 --- a/src/bin/e_comp_wl.h +++ b/src/bin/e_comp_wl.h @@ -38,6 +38,7 @@ #include +typedef struct _E_Comp_Wl_Aux_Hint E_Comp_Wl_Aux_Hint; typedef struct _E_Comp_Wl_Buffer E_Comp_Wl_Buffer; typedef struct _E_Comp_Wl_Buffer_Ref E_Comp_Wl_Buffer_Ref; typedef struct _E_Comp_Wl_Buffer_Viewport E_Comp_Wl_Buffer_Viewport; @@ -55,6 +56,13 @@ typedef enum _E_Comp_Wl_Buffer_Type E_COMP_WL_BUFFER_TYPE_TBM = 3 } E_Comp_Wl_Buffer_Type; +struct _E_Comp_Wl_Aux_Hint +{ + unsigned int id; + const char *hint; + const char *val; +}; + struct _E_Comp_Wl_Buffer { E_Comp_Wl_Buffer_Type type; @@ -327,6 +335,11 @@ struct _E_Comp_Wl_Client_Data int prev_degree, cur_degree; } transform; + struct + { + Eina_List *hints; + } aux_hint; + /* before applying viewport */ int width_from_buffer; int height_from_buffer; diff --git a/src/bin/e_hints.c b/src/bin/e_hints.c index 5fd73cb..00bad88 100644 --- a/src/bin/e_hints.c +++ b/src/bin/e_hints.c @@ -17,6 +17,8 @@ EAPI Ecore_X_Atom ATM_NETWM_SHOW_WINDOW_MENU = 0; EAPI Ecore_X_Atom ATM_NETWM_PERFORM_BUTTON_ACTION = 0; #endif +static Eina_List *aux_hints_supported = NULL; + EINTERN void e_hints_init(Ecore_Window root, Ecore_Window propwin) { @@ -1730,3 +1732,43 @@ e_hints_scale_update(void) #endif } +EAPI const Eina_List * +e_hints_aux_hint_supported_add(const char *hint) +{ + Eina_List *l; + const char *supported; + + EINA_LIST_FOREACH(aux_hints_supported, l, supported) + { + if (!strcmp(supported, hint)) + return aux_hints_supported; + } + + aux_hints_supported = eina_list_append(aux_hints_supported, hint); + + return aux_hints_supported; +} + +EAPI const Eina_List * +e_hints_aux_hint_supported_del(const char *hint) +{ + Eina_List *l; + const char *supported; + + EINA_LIST_FOREACH(aux_hints_supported, l, supported) + { + if (!strcmp(supported, hint)) + { + aux_hints_supported = eina_list_remove(aux_hints_supported, hint); + break; + } + } + + return aux_hints_supported; +} + +EAPI const Eina_List * +e_hints_aux_hint_supported_get(void) +{ + return aux_hints_supported; +} diff --git a/src/bin/e_hints.h b/src/bin/e_hints.h index 8e3c9c7..d10d96f 100644 --- a/src/bin/e_hints.h +++ b/src/bin/e_hints.h @@ -45,9 +45,10 @@ EAPI void e_hints_window_qtopia_soft_menus_get(E_Client *ec); EAPI void e_hints_window_virtual_keyboard_state_get(E_Client *ec); EAPI void e_hints_window_virtual_keyboard_get(E_Client *ec); - EAPI void e_hints_scale_update(void); - +EAPI const Eina_List * e_hints_aux_hint_supported_add(const char *hint); +EAPI const Eina_List * e_hints_aux_hint_supported_del(const char *hint); +EAPI const Eina_List * e_hints_aux_hint_supported_get(void); #ifdef E_COMP_X_H EAPI void e_hints_window_state_update(E_Client *ec, int state, int action); -- 2.7.4