#include "e_output_intern.h"
#include "e_utils_intern.h"
-#include <Eeze.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
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)
{
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");
#include "e_comp_screen_intern.h"
#include "e_output_intern.h"
-#include <Eeze.h>
#include <glib.h>
#include <ctype.h>
//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
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));
(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 *