EAPI Eina_Bool ecore_drm_evdev_key_remap_set(Ecore_Drm_Evdev *edev, int *from_keys, int *to_keys, int num);
EAPI int ecore_drm_evdev_wheel_click_angle_get(Ecore_Drm_Evdev *dev);
EAPI Ecore_Device *ecore_drm_evdev_get_ecore_device(const char *path, Ecore_Device_Class clas);
+EAPI Eina_Bool ecore_drm_evdev_touch_calibration_set(Ecore_Drm_Evdev *edev, float matrix[6]);
typedef void (*Ecore_Drm_VBlank_Cb)(void *data);
EAPI Eina_Bool ecore_drm_output_wait_vblank(Ecore_Drm_Output *output, int interval, Ecore_Drm_VBlank_Cb func, void *data);
EAPI void ecore_drm_display_fb_hal_buffer_destroy(Ecore_Drm_Fb *fb);
EAPI Eina_Bool ecore_drm_device_pointer_rotation_set(Ecore_Drm_Device *dev, int rotation);
+EAPI Eina_Bool ecore_drm_evdev_device_rotate_set(Ecore_Drm_Device *dev, unsigned int rotation);
+EAPI Eina_Bool ecore_drm_device_touch_rotation_set(Ecore_Drm_Device *dev, unsigned int rotation);
# ifdef __cplusplus
}
}
return EINA_TRUE;
}
+
+EAPI Eina_Bool
+ecore_drm_device_touch_rotation_set(Ecore_Drm_Device *dev, unsigned int rotation)
+{
+ Ecore_Drm_Seat *seat = NULL;
+ Ecore_Drm_Evdev *edev = NULL;
+ Eina_List *l = NULL, *l2 = NULL;
+ float matrix[6] = {0, };
+ float w = 0.0, h = 0.0;
+ Eina_Bool res = EINA_TRUE;
+
+ EINA_SAFETY_ON_NULL_RETURN_VAL(dev, EINA_FALSE);
+ EINA_SAFETY_ON_NULL_RETURN_VAL(dev->seats, EINA_FALSE);
+
+ EINA_LIST_FOREACH(dev->seats, l, seat)
+ {
+ EINA_LIST_FOREACH(ecore_drm_seat_evdev_list_get(seat), l2, edev)
+ {
+ if (edev->seat_caps & EVDEV_SEAT_TOUCH)
+ {
+ w = (float)edev->output->current_mode->width;
+ h = (float)edev->output->current_mode->height;
+ if (w == 0.0) w = 1.0;
+ if (h == 0.0) h = 1.0;
+
+ switch (rotation)
+ {
+ case 90:
+ matrix[1] = -h/w;
+ matrix[2] = h/w;
+ matrix[3] = w/h;
+ break;
+ case 180:
+ matrix[0] = -1.0;
+ matrix[2] = 1.0;
+ matrix[4] = -1.0;
+ matrix[5] = 1.0;
+ break;
+ case 270:
+ matrix[1] = h/w;
+ matrix[3] = -w/h;
+ matrix[5] = w/h;
+ break;
+ case 0:
+ matrix[0] = 1.0;
+ matrix[4] = 1.0;
+ break;
+ default:
+ WRN("Please input valid angle(%d)\n", rotation);
+ return;
+ }
+
+ if (!ecore_drm_evdev_touch_calibration_set(edev, matrix))
+ {
+ res = EINA_FALSE;
+ }
+ else
+ {
+ edev->touch.transform.rotation = rotation;
+ }
+ }
+ }
+ }
+
+ return res;
+}
+
EINA_SAFETY_ON_NULL_RETURN_VAL(dev, -1);
return libinput_device_config_scroll_get_wheel_click_angle(dev->device);
}
+
+EAPI Eina_Bool
+ecore_drm_evdev_touch_calibration_set(Ecore_Drm_Evdev *edev, float matrix[6])
+{
+ EINA_SAFETY_ON_NULL_RETURN_VAL(edev, EINA_FALSE);
+ EINA_SAFETY_ON_NULL_RETURN_VAL(edev->device, EINA_FALSE);
+
+ if (!libinput_device_config_calibration_has_matrix(edev->device) ||
+ !libinput_device_has_capability(edev->device, LIBINPUT_DEVICE_CAP_TOUCH))
+ return EINA_FALSE;
+
+ if (libinput_device_config_calibration_set_matrix(edev->device, matrix) !=
+ LIBINPUT_CONFIG_STATUS_SUCCESS)
+ {
+ WRN("Failed to set input transformation about device: %s\n",
+ libinput_device_get_name(edev->device));
+ return EINA_FALSE;
+ }
+
+ return EINA_TRUE;
+}
/* Ecore_Drm_Evdev_Capabilities caps; */
Ecore_Drm_Seat_Capabilities seat_caps;
+
+ struct
+ {
+ struct
+ {
+ int rotation;
+ int x, y;
+ int w, h;
+ } transform;
+ } touch;
};
struct _Ecore_Drm_Sprite