e_comp_screen: substitute e_input APIs and data structures for ecore drm dependent... 27/153127/2
authorSung-Jin Park <sj76.park@samsung.com>
Wed, 27 Sep 2017 11:26:59 +0000 (20:26 +0900)
committerSung-Jin Park <sj76.park@samsung.com>
Thu, 28 Sep 2017 05:44:42 +0000 (05:44 +0000)
Change-Id: If21351c8743d48b5b5b035551e40dc5685173bad
Signed-off-by: Sung-Jin Park <sj76.park@samsung.com>
src/bin/e_comp_screen.c

index 73f89d3..f5d662e 100644 (file)
@@ -1,5 +1,6 @@
 #include "e.h"
 #include <Ecore_Drm.h>
+#include "Eeze.h"
 
 #define PATH "/org/enlightenment/wm"
 #define IFACE "org.enlightenment.wm.screen_rotation"
@@ -10,7 +11,7 @@ static Eldbus_Service_Interface *e_comp_screen_iface;
 static Eina_List *event_handlers = NULL;
 static Eina_Bool session_state = EINA_FALSE;
 
-static Eina_Bool dont_set_ecore_drm_keymap = EINA_FALSE;
+static Eina_Bool dont_set_e_input_keymap = EINA_FALSE;
 static Eina_Bool dont_use_xkb_cache = EINA_FALSE;
 
 E_API int              E_EVENT_SCREEN_CHANGE = 0;
@@ -331,12 +332,12 @@ end:
 static Eina_Bool
 _e_comp_screen_cb_input_device_add(void *data, int type, void *event)
 {
-   Ecore_Drm_Event_Input_Device_Add *e;
+   E_Input_Event_Input_Device_Add *e;
    E_Comp *comp = data;
 
    if (!(e = event)) goto end;
 
-   if (e->caps & EVDEV_SEAT_POINTER)
+   if (e->caps & E_INPUT_SEAT_POINTER)
      {
         if (comp->wl_comp_data->ptr.num_devices == 0)
           {
@@ -345,12 +346,12 @@ _e_comp_screen_cb_input_device_add(void *data, int type, void *event)
           }
         comp->wl_comp_data->ptr.num_devices++;
      }
-   if (e->caps & EVDEV_SEAT_KEYBOARD)
+   if (e->caps & E_INPUT_SEAT_KEYBOARD)
      {
         comp->wl_comp_data->kbd.num_devices++;
         e_comp_wl_input_keyboard_enabled_set(EINA_TRUE);
      }
-   if (e->caps & EVDEV_SEAT_TOUCH)
+   if (e->caps & E_INPUT_SEAT_TOUCH)
      {
         e_comp_wl_input_touch_enabled_set(EINA_TRUE);
         comp->wl_comp_data->touch.num_devices++;
@@ -363,12 +364,12 @@ end:
 static Eina_Bool
 _e_comp_screen_cb_input_device_del(void *data, int type, void *event)
 {
-   Ecore_Drm_Event_Input_Device_Del *e;
+   E_Input_Event_Input_Device_Del *e;
    E_Comp *comp = data;
 
    if (!(e = event)) goto end;
 
-   if (e->caps & EVDEV_SEAT_POINTER)
+   if (e->caps & E_INPUT_SEAT_POINTER)
      {
         comp->wl_comp_data->ptr.num_devices--;
         if (comp->wl_comp_data->ptr.num_devices == 0)
@@ -378,7 +379,7 @@ _e_comp_screen_cb_input_device_del(void *data, int type, void *event)
              e_pointer_hide(e_comp->pointer);
           }
      }
-   if (e->caps & EVDEV_SEAT_KEYBOARD)
+   if (e->caps & E_INPUT_SEAT_KEYBOARD)
      {
         comp->wl_comp_data->kbd.num_devices--;
         if (comp->wl_comp_data->kbd.num_devices == 0)
@@ -386,7 +387,7 @@ _e_comp_screen_cb_input_device_del(void *data, int type, void *event)
              e_comp_wl_input_keyboard_enabled_set(EINA_FALSE);
           }
      }
-   if (e->caps & EVDEV_SEAT_TOUCH)
+   if (e->caps & E_INPUT_SEAT_TOUCH)
      {
         comp->wl_comp_data->touch.num_devices--;
         if (comp->wl_comp_data->touch.num_devices == 0)
@@ -627,10 +628,10 @@ _e_comp_screen_keymap_set(struct xkb_context **ctx, struct xkb_keymap **map)
    *ctx = context;
    *map = keymap;
 
-   if (dont_set_ecore_drm_keymap == EINA_FALSE)
+   if (dont_set_e_input_keymap == EINA_FALSE)
      {
-        ecore_drm_device_keyboard_cached_context_set(*ctx);
-        ecore_drm_device_keyboard_cached_keymap_set(*map);
+        e_input_device_keyboard_cached_context_set(*ctx);
+        e_input_device_keyboard_cached_keymap_set(*map);
      }
 
 cleanup:
@@ -1002,7 +1003,7 @@ e_comp_screen_init()
      }
 
    /* keymap */
-   dont_set_ecore_drm_keymap = getenv("NO_ECORE_DRM_KEYMAP_CACHE") ? EINA_TRUE : EINA_FALSE;
+   dont_set_e_input_keymap = getenv("NO_E_INPUT_KEYMAP_CACHE") ? EINA_TRUE : EINA_FALSE;
    dont_use_xkb_cache = getenv("NO_KEYMAP_CACHE") ? EINA_TRUE : EINA_FALSE;
 
    if (e_config->xkb.use_cache && !dont_use_xkb_cache)
@@ -1018,7 +1019,13 @@ e_comp_screen_init()
         goto failed_comp_screen;
      }
 
-   e_main_ts_begin("\tE_Comp_Wl Init");
+   if (!e_input_init(e_comp->ee))
+     {
+        ERR("Could not initialize the e_input.");
+        goto failed_comp_screen;
+     }
+
+   e_main_ts("\tE_Comp_Wl Init");
    if (!e_comp_wl_init())
      {
         goto failed_comp_screen_with_ts;
@@ -1096,8 +1103,8 @@ e_comp_screen_init()
    tzsr_client_hook_del = e_client_hook_add(E_CLIENT_HOOK_DEL, _tz_screen_rotation_cb_client_del, NULL);
 
    E_LIST_HANDLER_APPEND(event_handlers, ECORE_DRM_EVENT_ACTIVATE,         _e_comp_screen_cb_activate,         comp);
-   E_LIST_HANDLER_APPEND(event_handlers, ECORE_DRM_EVENT_INPUT_DEVICE_ADD, _e_comp_screen_cb_input_device_add, comp);
-   E_LIST_HANDLER_APPEND(event_handlers, ECORE_DRM_EVENT_INPUT_DEVICE_DEL, _e_comp_screen_cb_input_device_del, comp);
+   E_LIST_HANDLER_APPEND(event_handlers, E_INPUT_EVENT_INPUT_DEVICE_ADD, _e_comp_screen_cb_input_device_add, comp);
+   E_LIST_HANDLER_APPEND(event_handlers, E_INPUT_EVENT_INPUT_DEVICE_DEL, _e_comp_screen_cb_input_device_del, comp);
 
    TRACE_DS_END();
 
@@ -1107,6 +1114,7 @@ failed_comp_screen_with_ts:
    e_main_ts_end("\tE_Comp_Screen init failed");
 failed_comp_screen:
 
+   e_input_shutdown();
    _e_comp_screen_engine_deinit();
 
    TRACE_DS_END();
@@ -1142,7 +1150,7 @@ e_comp_screen_shutdown()
    e_client_hook_del(tzsr_client_hook_del);
    tzsr_client_hook_del = NULL;
 
-   dont_set_ecore_drm_keymap = EINA_FALSE;
+   dont_set_e_input_keymap = EINA_FALSE;
    dont_use_xkb_cache = EINA_FALSE;
    E_FREE_LIST(event_handlers, ecore_event_handler_del);