elput: rename and make public Elput_Device_Caps enum

This commit is contained in:
Mike Blumenkrantz 2017-05-26 16:34:10 -04:00
parent e8fe0bcc47
commit e34088d74e
4 changed files with 29 additions and 28 deletions

View File

@ -29,6 +29,17 @@
# ifdef EFL_BETA_API_SUPPORT
typedef enum
{
ELPUT_DEVICE_CAPS_POINTER = (1 << 0),
ELPUT_DEVICE_CAPS_KEYBOARD = (1 << 1),
ELPUT_DEVICE_CAPS_TOUCH = (1 << 2),
ELPUT_DEVICE_CAPS_TABLET_TOOL = (1 << 3),
ELPUT_DEVICE_CAPS_TABLET_PAD = (1 << 4),
ELPUT_DEVICE_CAPS_GESTURE = (1 << 5),
} Elput_Device_Caps;
/* opaque structure to represent an input manager */
typedef struct _Elput_Manager Elput_Manager;

View File

@ -1563,27 +1563,27 @@ _evdev_device_create(Elput_Seat *seat, struct libinput_device *device)
(libinput_device_keyboard_has_key(device, KEY_ENTER)))
{
_keyboard_init(seat, seat->manager->cached.keymap);
edev->caps |= EVDEV_SEAT_KEYBOARD;
edev->caps |= ELPUT_DEVICE_CAPS_KEYBOARD;
}
if ((libinput_device_has_capability(device, LIBINPUT_DEVICE_CAP_POINTER) &&
(libinput_device_pointer_has_button(device, BTN_LEFT))))
edev->caps |= EVDEV_SEAT_POINTER;
edev->caps |= ELPUT_DEVICE_CAPS_POINTER;
if (libinput_device_has_capability(device, LIBINPUT_DEVICE_CAP_TABLET_TOOL))
edev->caps |= EVDEV_SEAT_POINTER | EVDEV_SEAT_TABLET_TOOL;
edev->caps |= ELPUT_DEVICE_CAPS_POINTER | ELPUT_DEVICE_CAPS_TABLET_TOOL;
if (libinput_device_has_capability(device, LIBINPUT_DEVICE_CAP_TABLET_PAD))
edev->caps |= EVDEV_SEAT_POINTER | EVDEV_SEAT_TABLET_PAD;
if (edev->caps & EVDEV_SEAT_POINTER)
edev->caps |= ELPUT_DEVICE_CAPS_POINTER | ELPUT_DEVICE_CAPS_TABLET_PAD;
if (edev->caps & ELPUT_DEVICE_CAPS_POINTER)
{
_pointer_init(seat);
edev->caps |= EVDEV_SEAT_POINTER;
edev->caps |= ELPUT_DEVICE_CAPS_POINTER;
}
if (libinput_device_has_capability(device, LIBINPUT_DEVICE_CAP_TOUCH))
edev->caps |= EVDEV_SEAT_TOUCH;
edev->caps |= ELPUT_DEVICE_CAPS_TOUCH;
if (libinput_device_has_capability(device, LIBINPUT_DEVICE_CAP_GESTURE))
edev->caps |= EVDEV_SEAT_TOUCH | EVDEV_SEAT_GESTURE;
if (edev->caps & EVDEV_SEAT_TOUCH)
edev->caps |= ELPUT_DEVICE_CAPS_TOUCH | ELPUT_DEVICE_CAPS_GESTURE;
if (edev->caps & ELPUT_DEVICE_CAPS_TOUCH)
_touch_init(seat);
if (!edev->caps) goto err;
@ -1612,11 +1612,11 @@ _evdev_device_destroy(Elput_Device *edev)
{
if (!edev) return;
if (edev->caps & EVDEV_SEAT_POINTER)
if (edev->caps & ELPUT_DEVICE_CAPS_POINTER)
_pointer_release(edev->seat);
if (edev->caps & EVDEV_SEAT_KEYBOARD)
if (edev->caps & ELPUT_DEVICE_CAPS_KEYBOARD)
_keyboard_release(edev->seat);
if (edev->caps & EVDEV_SEAT_TOUCH)
if (edev->caps & ELPUT_DEVICE_CAPS_TOUCH)
_touch_release(edev->seat);
libinput_device_unref(edev->device);

View File

@ -205,11 +205,11 @@ _device_add(Elput_Manager *em, struct libinput_device *dev)
eseat->devices = eina_list_append(eseat->devices, edev);
DBG("Input Device Added: %s", libinput_device_get_name(dev));
if (edev->caps & EVDEV_SEAT_KEYBOARD)
if (edev->caps & ELPUT_DEVICE_CAPS_KEYBOARD)
DBG("\tDevice added as Keyboard device");
if (edev->caps & EVDEV_SEAT_POINTER)
if (edev->caps & ELPUT_DEVICE_CAPS_POINTER)
DBG("\tDevice added as Pointer device");
if (edev->caps & EVDEV_SEAT_TOUCH)
if (edev->caps & ELPUT_DEVICE_CAPS_TOUCH)
DBG("\tDevice added as Touch device");
_device_event_send(edev, ELPUT_DEVICE_ADDED);
@ -600,7 +600,7 @@ elput_input_key_remap_enable(Elput_Manager *manager, Eina_Bool enable)
{
EINA_LIST_FOREACH(eseat->devices, ll, edev)
{
if (!(edev->caps & EVDEV_SEAT_KEYBOARD)) continue;
if (!(edev->caps & ELPUT_DEVICE_CAPS_KEYBOARD)) continue;
edev->key_remap = enable;
if ((!enable) && (edev->key_remap_hash))
@ -631,7 +631,7 @@ elput_input_key_remap_set(Elput_Manager *manager, int *from_keys, int *to_keys,
{
EINA_LIST_FOREACH(eseat->devices, ll, edev)
{
if (!(edev->caps & EVDEV_SEAT_KEYBOARD)) continue;
if (!(edev->caps & ELPUT_DEVICE_CAPS_KEYBOARD)) continue;
if (!edev->key_remap) continue;
if (!edev->key_remap_hash)

View File

@ -60,16 +60,6 @@ extern int _elput_log_dom;
# endif
# define CRIT(...) EINA_LOG_DOM_CRIT(_elput_log_dom, __VA_ARGS__)
typedef enum _Elput_Device_Capability
{
EVDEV_SEAT_POINTER = (1 << 0),
EVDEV_SEAT_KEYBOARD = (1 << 1),
EVDEV_SEAT_TOUCH = (1 << 2),
EVDEV_SEAT_TABLET_TOOL = (1 << 3),
EVDEV_SEAT_TABLET_PAD = (1 << 4),
EVDEV_SEAT_GESTURE = (1 << 5),
} Elput_Device_Capability;
typedef struct _Elput_Interface
{
Eina_Bool (*connect)(Elput_Manager **manager, const char *seat, unsigned int tty);
@ -225,7 +215,7 @@ struct _Elput_Device
const char *output_name;
struct libinput_device *device;
Elput_Device_Capability caps;
Elput_Device_Caps caps;
Eina_Hash *key_remap_hash;