call key events hook functions 50/131850/3 accepted/tizen/unified/20170605.151602 submit/tizen/20170605.022315 submit/tizen/20170605.040707 submit/tizen/20170605.072005
authorJengHyun Kang <jhyuni.kang@samsung.com>
Wed, 31 May 2017 05:12:27 +0000 (14:12 +0900)
committerJengHyun Kang <jhyuni.kang@samsung.com>
Fri, 2 Jun 2017 04:13:45 +0000 (13:13 +0900)
 - move keyrouter's structures to e_keyrouter in enlightenment core

Change-Id: I2cb22f1785f2aabed52f56cb09f8cf4a18ab3bf9

src/e_mod_keyrouter_events.c
src/e_mod_main_wl.c
src/e_mod_main_wl.h

index 61d46313427bb9fbd042a3db7e62676b75e3903d..43419121ceec5e521be5ecdfab919e2fec8449a2 100644 (file)
@@ -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();
 
index bfefbd2bffe4eeb8d42dd67eedc37884978bbdbf..868a5169ff7accb98f1de8e38e08db11833570ae 100644 (file)
@@ -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))
index a3d315d7ae11482bcf66a5f8fc9da48c2e44b534..48024a5cee0f7b691e610127cfd03227658f282e 100644 (file)
@@ -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;