e_input: Remove eeze dependency 62/308162/1
authorduna.oh <duna.oh@samsung.com>
Mon, 18 Mar 2024 09:05:37 +0000 (18:05 +0900)
committerTizen Window System <tizen.windowsystem@gmail.com>
Tue, 19 Mar 2024 02:23:27 +0000 (11:23 +0900)
replace eeze APIs with udev APIs

Change-Id: I7349b971c2f08dcfc507b8142239ec308b339bb8

configure.ac
packaging/enlightenment.spec
src/bin/e_comp_screen.c
src/bin/e_input.c
src/bin/e_input_device.c
src/bin/e_input_evdev.c

index d22de9d..f8ef224 100755 (executable)
@@ -282,7 +282,6 @@ e_requires="\
   eldbus >= $efl_version \
   eio >= $efl_version \
   eo >= $efl_version \
-  eeze >= $efl_version \
   libinput \
   libudev \
   libtbm \
@@ -601,7 +600,6 @@ eina >= ${efl_version} \
 eldbus >= ${efl_version} \
 eio >= ${efl_version} \
 eo >= ${efl_version} \
-eeze >= ${efl_version} \
 gobject-2.0 \
 glib-2.0 \
 "
index 0edff23..a5148d6 100644 (file)
@@ -30,7 +30,6 @@ BuildRequires:  pkgconfig(eet)
 BuildRequires:  pkgconfig(eina)
 BuildRequires:  pkgconfig(eio)
 BuildRequires:  pkgconfig(evas)
-BuildRequires:  pkgconfig(eeze)
 BuildRequires:  pkgconfig(libtbm)
 BuildRequires:  pkgconfig(ttrace)
 BuildRequires:  pkgconfig(wayland-server)
index 8280792..a528350 100644 (file)
@@ -21,7 +21,6 @@
 #include "e_main_intern.h"
 #include "e_hwc_planes_intern.h"
 
-#include "Eeze.h"
 #include <tizen-extension-server-protocol.h>
 #include <device/board-internal.h>
 #include <tbm_drm_helper.h>
index 7ffb9e4..409ae72 100644 (file)
@@ -8,7 +8,6 @@
 #include <Ecore_Input_Evas.h>
 #include <cpu-boosting.h>
 #include <pthread.h>
-#include <Eeze.h>
 
 static int _e_input_hooks_delete = 0;
 static int _e_input_hooks_walking = 0;
@@ -144,7 +143,6 @@ e_input_init(Ecore_Evas *ee)
 
    if (++_e_input_init_count != 1) return _e_input_init_count;
    if (!ecore_event_evas_init()) goto ecore_event_evas_err;
-   if (!eeze_init()) goto eeze_err;
 
    _e_input_log_dom = eina_log_domain_register("e_input", EINA_COLOR_GREEN);
    if (!_e_input_log_dom)
@@ -276,9 +274,6 @@ log_err:
         e_input->input_base_dir = NULL;
      }
 
-   eeze_shutdown();
-
-eeze_err:
    ecore_event_evas_shutdown();
 
 ecore_event_evas_err:
@@ -312,7 +307,6 @@ e_input_shutdown(void)
    free(e_input);
 
    ecore_event_evas_shutdown();
-   eeze_shutdown();
    ecore_event_shutdown();
    ecore_shutdown();
    eina_shutdown();
index 4adbf8a..e044e2b 100644 (file)
@@ -4,7 +4,6 @@
 #include "e_output_intern.h"
 #include "e_utils_intern.h"
 
-#include <Eeze.h>
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <fcntl.h>
@@ -749,8 +748,11 @@ _einput_device_input_thread_udev_backend_heavy(void *data, Ecore_Thread *th, voi
    EINA_SAFETY_ON_NULL_RETURN(input->dev->seat);
 
    /* try to create libinput context */
+   struct udev *udev = udev_new();
+
    input->libinput =
-     libinput_udev_create_context(&_input_interface, input, eeze_udev_get());
+     libinput_udev_create_context(&_input_interface, input, udev);
+   udev_unref(udev);
 
    if (!input->libinput)
      {
@@ -941,8 +943,12 @@ EINTERN Eina_Bool
 e_input_libinput_context_create(E_Input_Backend *input)
 {
    /* try to create libinput context */
+   struct udev *udev = udev_new();
+
    input->libinput =
-     libinput_udev_create_context(&_input_interface, input, eeze_udev_get());
+     libinput_udev_create_context(&_input_interface, input, udev);
+   udev_unref(udev);
+
    if (!input->libinput)
      {
         ERR("Could not create libinput context: %m");
index 51ac5cc..1de3a80 100644 (file)
@@ -7,7 +7,6 @@
 #include "e_comp_screen_intern.h"
 #include "e_output_intern.h"
 
-#include <Eeze.h>
 #include <glib.h>
 #include <ctype.h>
 
@@ -68,45 +67,40 @@ _device_calibration_set(E_Input_Evdev *edev)
 
 //LCOV_EXCL_START
 #ifdef _F_E_INPUT_ENABLE_DEVICE_CALIBRATION_
-   const char *sysname;
    float cal[6];
-   const char *device;
-   Eina_List *devices;
 
    if ((!libinput_device_config_calibration_has_matrix(edev->device)) ||
        (libinput_device_config_calibration_get_default_matrix(edev->device, cal) != 0))
      return;
 
-   sysname = libinput_device_get_sysname(edev->device);
-
-   devices = eeze_udev_find_by_subsystem_sysname("input", sysname);
-   if (eina_list_count(devices) < 1) return;
-
 #ifdef _F_E_INPUT_USE_WL_CALIBRATION_
    const char *vals;
    enum libinput_config_status status;
+   struct udev_device *udev_device = NULL;
 
-   EINA_LIST_FREE(devices, device)
+   udev_device = libinput_device_get_udev_device(edev->device);
+   if (!udev_device)
      {
-        vals = eeze_udev_syspath_get_property(device, "WL_CALIBRATION");
-        if ((!vals) ||
-            (sscanf(vals, "%f %f %f %f %f %f",
-                    &cal[0], &cal[1], &cal[2], &cal[3], &cal[4], &cal[5]) != 6))
-          goto cont;
+        ERR("no udev_device");
+        return;
+     }
 
-        cal[2] /= w;
-        cal[5] /= h;
+   vals = udev_device_get_property_value(udev_device, "WL_CALIBRATION");
+   if ((!vals) ||
+       (sscanf(vals, "%f %f %f %f %f %f",
+               &cal[0], &cal[1], &cal[2], &cal[3], &cal[4], &cal[5]) != 6))
+     return;
 
-        status =
-          libinput_device_config_calibration_set_matrix(edev->device, cal);
+   ELOGF("E_INPUT_EVDEV", "calibration_set cal[%lf %lf %lf %lf %lf %lf] (%d x %d)",
+         NULL, cal[0], cal[1], cal[2], cal[3], cal[4], cal[5], w, h);
+   cal[2] /= w;
+   cal[5] /= h;
 
-        if (status != LIBINPUT_CONFIG_STATUS_SUCCESS)
-          ERR("Failed to apply calibration");
+   status =
+     libinput_device_config_calibration_set_matrix(edev->device, cal);
 
-cont:
-        eina_stringshare_del(device);
-        continue;
-     }
+   if (status != LIBINPUT_CONFIG_STATUS_SUCCESS)
+     ERR("Failed to apply calibration");
 #endif//_F_E_INPUT_USE_WL_CALIBRATION_
 #endif//_F_E_INPUT_ENABLE_DEVICE_CALIBRATION_
 //LCOV_EXCL_STOP
@@ -2475,12 +2469,10 @@ _e_input_evdev_event_process(struct libinput_event *event)
 EINTERN void
 e_input_evdev_axis_size_set(E_Input_Evdev *edev, int w, int h)
 {
-   const char *sysname;
    float cal[6];
-   const char *device;
-   Eina_List *devices;
    const char *vals;
    enum libinput_config_status status;
+   struct udev_device *udev_device = NULL;
 
    EINA_SAFETY_ON_NULL_RETURN(edev);
    EINA_SAFETY_ON_TRUE_RETURN((w == 0) || (h == 0));
@@ -2489,32 +2481,30 @@ e_input_evdev_axis_size_set(E_Input_Evdev *edev, int w, int h)
        (libinput_device_config_calibration_get_default_matrix(edev->device, cal) != 0))
      return;
 
-   sysname = libinput_device_get_sysname(edev->device);
-
-   devices = eeze_udev_find_by_subsystem_sysname("input", sysname);
-   if (eina_list_count(devices) < 1) return;
-
-   EINA_LIST_FREE(devices, device)
+   udev_device = libinput_device_get_udev_device(edev->device);
+   if (!udev_device)
      {
-        vals = eeze_udev_syspath_get_property(device, "WL_CALIBRATION");
-       if ((!vals) ||
-            (sscanf(vals, "%f %f %f %f %f %f",
-                    &cal[0], &cal[1], &cal[2], &cal[3], &cal[4], &cal[5]) != 6))
-          goto cont;
+        ERR("no udev_device");
+        return;
+     }
 
-        cal[2] /= w;
-        cal[5] /= h;
+   vals = udev_device_get_property_value(udev_device, "WL_CALIBRATION");
+   if ((!vals) ||
+       (sscanf(vals, "%f %f %f %f %f %f",
+               &cal[0], &cal[1], &cal[2], &cal[3], &cal[4], &cal[5]) != 6))
+     return;
 
-        status =
-          libinput_device_config_calibration_set_matrix(edev->device, cal);
+   ELOGF("E_INPUT_EVDEV", "axis_size_set cal[%lf %lf %lf %lf %lf %lf] (%d x %d)",
+         NULL, cal[0], cal[1], cal[2], cal[3], cal[4], cal[5], w, h);
 
-        if (status != LIBINPUT_CONFIG_STATUS_SUCCESS)
-          ERR("Failed to apply calibration");
+   cal[2] /= w;
+   cal[5] /= h;
 
-cont:
-        eina_stringshare_del(device);
-        continue;
-     }
+   status =
+     libinput_device_config_calibration_set_matrix(edev->device, cal);
+
+   if (status != LIBINPUT_CONFIG_STATUS_SUCCESS)
+     ERR("Failed to apply calibration");
 }
 
 EINTERN const char *