From: JengHyun Kang Date: Wed, 31 May 2017 05:12:27 +0000 (+0900) Subject: call key events hook functions X-Git-Tag: submit/tizen/20170605.022315^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=56ac184d7ea1a4d3bea0d26b8bcc98a950377ece;p=platform%2Fcore%2Fuifw%2Fe-mod-tizen-keyrouter.git call key events hook functions - move keyrouter's structures to e_keyrouter in enlightenment core Change-Id: I2cb22f1785f2aabed52f56cb09f8cf4a18ab3bf9 --- diff --git a/src/e_mod_keyrouter_events.c b/src/e_mod_keyrouter_events.c index 61d4631..4341912 100644 --- a/src/e_mod_keyrouter_events.c +++ b/src/e_mod_keyrouter_events.c @@ -91,6 +91,11 @@ e_keyrouter_process_key_event(void *event, int type) if (!krt->HardKeys[ev->keycode].keycode) goto finish; + if (!e_keyrouter_intercept_hook_call(E_KEYROUTER_INTERCEPT_HOOK_BEFORE_KEYROUTING, type, ev)) + { + goto finish; + } + if ((ECORE_EVENT_KEY_UP == type) && (!krt->HardKeys[ev->keycode].press_ptr)) { KLDBG("The release key(%d) isn't a processed by keyrouter!", ev->keycode); @@ -358,6 +363,16 @@ _e_keyrouter_send_key_events_focus(int type, struct wl_resource *surface_focus, int pid = 0; char *pname = NULL, *cmd = NULL; + if (!e_keyrouter_intercept_hook_call(E_KEYROUTER_INTERCEPT_HOOK_DELIVER_FOCUS, type, ev)) + { + if (ev->data) + { + *delivered_surface = ev->data; + ev->data = wl_resource_get_client(ev->data); + } + return res; + } + ec_top = e_client_top_get(); ec_focus = e_client_focused_get(); diff --git a/src/e_mod_main_wl.c b/src/e_mod_main_wl.c index bfefbd2..868a516 100644 --- a/src/e_mod_main_wl.c +++ b/src/e_mod_main_wl.c @@ -1123,6 +1123,19 @@ static Eina_Bool _e_keyrouter_cb_idler(void *data) return ECORE_CALLBACK_CANCEL; } +static void * +_e_keyrouter_keygrab_list_get(void) +{ + EINA_SAFETY_ON_NULL_RETURN_VAL(krt, NULL); + return krt->HardKeys; +} + +static int +_e_keyrouter_max_keycode_get(void) +{ + EINA_SAFETY_ON_NULL_RETURN_VAL(krt, 0); + return krt->max_tizen_hwkeys; +} static E_Keyrouter_Config_Data * _e_keyrouter_init(E_Module *m) @@ -1183,6 +1196,9 @@ _e_keyrouter_init(E_Module *m) goto err; } + e_keyrouter.keygrab_list_get = _e_keyrouter_keygrab_list_get; + e_keyrouter.max_keycode_get = _e_keyrouter_max_keycode_get; + #ifdef ENABLE_CYNARA ret = cynara_initialize(&krt->p_cynara, NULL); if (EINA_UNLIKELY(CYNARA_API_SUCCESS != ret)) diff --git a/src/e_mod_main_wl.h b/src/e_mod_main_wl.h index a3d315d..48024a5 100644 --- a/src/e_mod_main_wl.h +++ b/src/e_mod_main_wl.h @@ -53,13 +53,9 @@ extern int _keyrouter_log_dom; typedef struct _E_Keyrouter E_Keyrouter; typedef struct _E_Keyrouter* E_KeyrouterPtr; -typedef struct _E_Keyrouter_Key_List_Node E_Keyrouter_Key_List_Node; -typedef struct _E_Keyrouter_Key_List_Node* E_Keyrouter_Key_List_NodePtr; -typedef struct _E_Keyrouter_Tizen_HWKey E_Keyrouter_Tizen_HWKey; -typedef struct _E_Keyrouter_Grabbed_Key E_Keyrouter_Grabbed_Key; typedef struct _E_Keyrouter_Grab_Request E_Keyrouter_Grab_Request; typedef struct _E_Keyrouter_Ungrab_Request E_Keyrouter_Ungrab_Request; -typedef struct _E_Keyrouter_Registered_Window_Info E_Keyrouter_Registered_Window_Info; + typedef struct _E_Keyrouter_Conf_Edd E_Keyrouter_Conf_Edd; typedef struct _E_Keyrouter_Config_Data E_Keyrouter_Config_Data; @@ -67,13 +63,6 @@ typedef struct _E_Keyrouter_Config_Data E_Keyrouter_Config_Data; #define TIZEN_KEYROUTER_MODE_PRESSED TIZEN_KEYROUTER_MODE_REGISTERED+1 #define TIZEN_KEYROUTER_MODE_PICTURE_OFF TIZEN_KEYROUTER_MODE_REGISTERED+2 -typedef enum _E_Keyrouter_Client_Status -{ - E_KRT_CSTAT_DEAD = 0, - E_KRT_CSTAT_ALIVE, - E_KRT_CSTAT_UNGRAB -} E_Keyrouter_Client_Status; - typedef unsigned long Time; extern E_KeyrouterPtr krt; @@ -94,44 +83,6 @@ struct _E_Keyrouter_Config_Data E_Keyrouter_Conf_Edd *conf; }; -struct _E_Keyrouter_Registered_Window_Info -{ - struct wl_resource *surface; - Eina_List *keys; -}; - -struct _E_Keyrouter_Key_List_Node -{ - struct wl_resource *surface; - struct wl_client *wc; - Eina_Bool focused; - E_Keyrouter_Client_Status status; -}; - -struct _E_Keyrouter_Tizen_HWKey -{ - char *name; - int keycode; - int no_privcheck; - int repeat; -}; - -struct _E_Keyrouter_Grabbed_Key -{ - int keycode; - char* keyname; - Eina_Bool no_privcheck; - Eina_Bool repeat; - - Eina_List *excl_ptr; - Eina_List *or_excl_ptr; - Eina_List *top_ptr; - Eina_List *shared_ptr; - Eina_List *press_ptr; - E_Keyrouter_Key_List_Node *registered_ptr; - Eina_List *pic_off_ptr; -}; - struct _E_Keyrouter { struct wl_global *global;