From: Mun, Gwan-gyeong Date: Mon, 9 Feb 2015 11:18:30 +0000 (+0900) Subject: Added client_type config and E_CLIENT_PROPERTY_CLIENT_TYPE. X-Git-Tag: submit/tizen/20150216.114433~2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=1df182f41a27d6875b78cee98a5b8ae62758d6ea;p=platform%2Fupstream%2Fenlightenment.git Added client_type config and E_CLIENT_PROPERTY_CLIENT_TYPE. Change-Id: I6aafc020437c7aaec500a8c1a4db378f9ed87dcf --- diff --git a/src/bin/e_client.c b/src/bin/e_client.c index 6624032adb..b647af2588 100644 --- a/src/bin/e_client.c +++ b/src/bin/e_client.c @@ -2236,6 +2236,50 @@ _e_client_frame_update(E_Client *ec) e_client_border_set(ec, bordername); } +static Eina_Bool +_e_client_type_match(E_Client *ec, E_Config_Client_Type *m) +{ + if (!ec || !m) return EINA_FALSE; + if (e_object_is_del(E_OBJECT(ec))) return EINA_FALSE; + + if ((int)ec->netwm.type != m->window_type) + return EINA_FALSE; + + if (((m->clas) && (!ec->icccm.class)) || + ((ec->icccm.class) && (m->clas) && (!e_util_glob_match(ec->icccm.class, m->clas)))) + return EINA_FALSE; + + if (((m->name) && (!ec->icccm.name)) || + ((ec->icccm.name) && (m->name) && (!e_util_glob_match(ec->icccm.name, m->name)))) + return EINA_FALSE; + + return EINA_TRUE; +} + +static int +_e_client_type_get(E_Client *ec) +{ + E_Config_Client_Type *m; + Eina_List *l; + int type = 0; + + if (!e_config->client_types) return 0; + + EINA_LIST_FOREACH(e_config->client_types, l, m) + { + if (!_e_client_type_match(ec, m)) continue; + else + { + type = m->client_type; + break; + } + } + + ec->client_type = type; + + return ec->client_type; +} + //////////////////////////////////////////////// EINTERN void e_client_idler_before(void) @@ -2253,6 +2297,7 @@ e_client_idler_before(void) EINA_LIST_FOREACH(c->clients, ll, ec) { Eina_Stringshare *title; + int client_type; // pass 1 - eval0. fetch properties on new or on change and // call hooks to decide what to do - maybe move/resize if (!ec->changed) continue; @@ -2263,6 +2308,10 @@ e_client_idler_before(void) if (!_e_client_hook_call(E_CLIENT_HOOK_EVAL_FETCH, ec)) continue; if (title != e_client_util_name_get(ec)) _e_client_event_property(ec, E_CLIENT_PROPERTY_TITLE); + client_type = ec->client_type; + if (client_type != _e_client_type_get(ec)) + _e_client_event_property(ec, E_CLIENT_PROPERTY_CLIENT_TYPE); + /* PRE_POST_FETCH calls e_remember apply for new client */ if (!_e_client_hook_call(E_CLIENT_HOOK_EVAL_PRE_POST_FETCH, ec)) continue; if (!_e_client_hook_call(E_CLIENT_HOOK_EVAL_POST_FETCH, ec)) continue; diff --git a/src/bin/e_client.h b/src/bin/e_client.h index ef56da98c2..040efe57c4 100644 --- a/src/bin/e_client.h +++ b/src/bin/e_client.h @@ -129,6 +129,7 @@ typedef enum E_Client_Property E_CLIENT_PROPERTY_GRAVITY = (1 << 5), E_CLIENT_PROPERTY_NETWM_STATE = (1 << 6), E_CLIENT_PROPERTY_STICKY = (1 << 7), + E_CLIENT_PROPERTY_CLIENT_TYPE = (1 << 8), } E_Client_Property; #ifdef _F_E_VIRTUAL_KEYBOARD_TYPE_ @@ -767,6 +768,8 @@ struct E_Client #if defined(HAVE_WAYLAND_CLIENTS) || defined(HAVE_WAYLAND_ONLY) uuid_t uuid; #endif + + int client_type; //e_client_type }; #define e_client_focus_policy_click(ec) \ diff --git a/src/bin/e_config.c b/src/bin/e_config.c index ddc1ddf140..460dcf22e6 100644 --- a/src/bin/e_config.c +++ b/src/bin/e_config.c @@ -50,6 +50,7 @@ static E_Config_DD *_e_config_syscon_action_edd = NULL; static E_Config_DD *_e_config_env_var_edd = NULL; static E_Config_DD *_e_config_xkb_layout_edd = NULL; static E_Config_DD *_e_config_xkb_option_edd = NULL; +static E_Config_DD *_e_config_client_type_edd = NULL; EAPI int E_EVENT_CONFIG_ICON_THEME = 0; EAPI int E_EVENT_CONFIG_MODE_CHANGED = 0; @@ -127,6 +128,7 @@ _e_config_edd_shutdown(void) E_CONFIG_DD_FREE(_e_config_env_var_edd); E_CONFIG_DD_FREE(_e_config_xkb_layout_edd); E_CONFIG_DD_FREE(_e_config_xkb_option_edd); + E_CONFIG_DD_FREE(_e_config_client_type_edd); } static void @@ -422,6 +424,17 @@ _e_config_edd_init(Eina_Bool old) #define D _e_config_xkb_option_edd E_CONFIG_VAL(D, T, name, STR); + _e_config_client_type_edd = E_CONFIG_DD_NEW("E_Config_Client_Type", + E_Config_Client_Type); +#undef T +#undef D +#define T E_Config_Client_Type +#define D _e_config_client_type_edd + E_CONFIG_VAL(D, T, name, STR); + E_CONFIG_VAL(D, T, clas, STR); + E_CONFIG_VAL(D, T, window_type, INT); + E_CONFIG_VAL(D, T, client_type, INT); + _e_config_edd = E_CONFIG_DD_NEW("E_Config", E_Config); #undef T #undef D @@ -767,6 +780,7 @@ _e_config_edd_init(Eina_Bool old) #ifdef _F_ZONE_WINDOW_ROTATION_ E_CONFIG_VAL(D, T, wm_win_rotation, UCHAR); #endif + E_CONFIG_LIST(D, T, client_types, _e_config_client_type_edd); } /* externally accessible functions */ diff --git a/src/bin/e_config.h b/src/bin/e_config.h index ad712451a1..0f1c7dcef8 100644 --- a/src/bin/e_config.h +++ b/src/bin/e_config.h @@ -23,6 +23,7 @@ typedef struct _E_Config_Syscon_Action E_Config_Syscon_Action; typedef struct _E_Config_Env_Var E_Config_Env_Var; typedef struct _E_Config_XKB_Layout E_Config_XKB_Layout; typedef struct _E_Config_XKB_Option E_Config_XKB_Option; +typedef struct _E_Config_Client_Type E_Config_Client_Type; typedef struct _E_Event_Config_Icon_Theme E_Event_Config_Icon_Theme; @@ -439,6 +440,7 @@ struct _E_Config #ifdef _F_ZONE_WINDOW_ROTATION_ unsigned char wm_win_rotation; #endif + Eina_List *client_types; }; struct E_Config_Bindings @@ -646,6 +648,14 @@ struct _E_Config_XKB_Option const char *name; }; +struct _E_Config_Client_Type +{ + const char *name; /* icccm.class_name */ + const char *clas; /* icccm.class */ + E_Window_Type window_type; /* Ecore_X_Window_Type / E_Window_Type */ + int client_type; /* E_Client_Type */ +}; + EINTERN int e_config_init(void); EINTERN int e_config_shutdown(void);