summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMike Blumenkrantz <zmike@osg.samsung.com>2017-05-26 16:34:10 -0400
committerMike Blumenkrantz <zmike@osg.samsung.com>2017-05-26 16:27:43 -0400
commite34088d74e22ddc4bd41dcbd52db07015a29f9e0 (patch)
tree8746e79276e27a5c65f0fc76fe1ad04cc65e0356 /src
parente8fe0bcc47ff44a5afaf8442407248887f716b89 (diff)
elput: rename and make public Elput_Device_Caps enum
Diffstat (limited to 'src')
-rw-r--r--src/lib/elput/Elput.h11
-rw-r--r--src/lib/elput/elput_evdev.c24
-rw-r--r--src/lib/elput/elput_input.c10
-rw-r--r--src/lib/elput/elput_private.h12
4 files changed, 29 insertions, 28 deletions
diff --git a/src/lib/elput/Elput.h b/src/lib/elput/Elput.h
index f9e950c821..eefcd7b340 100644
--- a/src/lib/elput/Elput.h
+++ b/src/lib/elput/Elput.h
@@ -29,6 +29,17 @@
29 29
30# ifdef EFL_BETA_API_SUPPORT 30# ifdef EFL_BETA_API_SUPPORT
31 31
32
33typedef enum
34{
35 ELPUT_DEVICE_CAPS_POINTER = (1 << 0),
36 ELPUT_DEVICE_CAPS_KEYBOARD = (1 << 1),
37 ELPUT_DEVICE_CAPS_TOUCH = (1 << 2),
38 ELPUT_DEVICE_CAPS_TABLET_TOOL = (1 << 3),
39 ELPUT_DEVICE_CAPS_TABLET_PAD = (1 << 4),
40 ELPUT_DEVICE_CAPS_GESTURE = (1 << 5),
41} Elput_Device_Caps;
42
32/* opaque structure to represent an input manager */ 43/* opaque structure to represent an input manager */
33typedef struct _Elput_Manager Elput_Manager; 44typedef struct _Elput_Manager Elput_Manager;
34 45
diff --git a/src/lib/elput/elput_evdev.c b/src/lib/elput/elput_evdev.c
index 46f8068f79..b4118fe82f 100644
--- a/src/lib/elput/elput_evdev.c
+++ b/src/lib/elput/elput_evdev.c
@@ -1563,27 +1563,27 @@ _evdev_device_create(Elput_Seat *seat, struct libinput_device *device)
1563 (libinput_device_keyboard_has_key(device, KEY_ENTER))) 1563 (libinput_device_keyboard_has_key(device, KEY_ENTER)))
1564 { 1564 {
1565 _keyboard_init(seat, seat->manager->cached.keymap); 1565 _keyboard_init(seat, seat->manager->cached.keymap);
1566 edev->caps |= EVDEV_SEAT_KEYBOARD; 1566 edev->caps |= ELPUT_DEVICE_CAPS_KEYBOARD;
1567 } 1567 }
1568 1568
1569 if ((libinput_device_has_capability(device, LIBINPUT_DEVICE_CAP_POINTER) && 1569 if ((libinput_device_has_capability(device, LIBINPUT_DEVICE_CAP_POINTER) &&
1570 (libinput_device_pointer_has_button(device, BTN_LEFT)))) 1570 (libinput_device_pointer_has_button(device, BTN_LEFT))))
1571 edev->caps |= EVDEV_SEAT_POINTER; 1571 edev->caps |= ELPUT_DEVICE_CAPS_POINTER;
1572 if (libinput_device_has_capability(device, LIBINPUT_DEVICE_CAP_TABLET_TOOL)) 1572 if (libinput_device_has_capability(device, LIBINPUT_DEVICE_CAP_TABLET_TOOL))
1573 edev->caps |= EVDEV_SEAT_POINTER | EVDEV_SEAT_TABLET_TOOL; 1573 edev->caps |= ELPUT_DEVICE_CAPS_POINTER | ELPUT_DEVICE_CAPS_TABLET_TOOL;
1574 if (libinput_device_has_capability(device, LIBINPUT_DEVICE_CAP_TABLET_PAD)) 1574 if (libinput_device_has_capability(device, LIBINPUT_DEVICE_CAP_TABLET_PAD))
1575 edev->caps |= EVDEV_SEAT_POINTER | EVDEV_SEAT_TABLET_PAD; 1575 edev->caps |= ELPUT_DEVICE_CAPS_POINTER | ELPUT_DEVICE_CAPS_TABLET_PAD;
1576 if (edev->caps & EVDEV_SEAT_POINTER) 1576 if (edev->caps & ELPUT_DEVICE_CAPS_POINTER)
1577 { 1577 {
1578 _pointer_init(seat); 1578 _pointer_init(seat);
1579 edev->caps |= EVDEV_SEAT_POINTER; 1579 edev->caps |= ELPUT_DEVICE_CAPS_POINTER;
1580 } 1580 }
1581 1581
1582 if (libinput_device_has_capability(device, LIBINPUT_DEVICE_CAP_TOUCH)) 1582 if (libinput_device_has_capability(device, LIBINPUT_DEVICE_CAP_TOUCH))
1583 edev->caps |= EVDEV_SEAT_TOUCH; 1583 edev->caps |= ELPUT_DEVICE_CAPS_TOUCH;
1584 if (libinput_device_has_capability(device, LIBINPUT_DEVICE_CAP_GESTURE)) 1584 if (libinput_device_has_capability(device, LIBINPUT_DEVICE_CAP_GESTURE))
1585 edev->caps |= EVDEV_SEAT_TOUCH | EVDEV_SEAT_GESTURE; 1585 edev->caps |= ELPUT_DEVICE_CAPS_TOUCH | ELPUT_DEVICE_CAPS_GESTURE;
1586 if (edev->caps & EVDEV_SEAT_TOUCH) 1586 if (edev->caps & ELPUT_DEVICE_CAPS_TOUCH)
1587 _touch_init(seat); 1587 _touch_init(seat);
1588 1588
1589 if (!edev->caps) goto err; 1589 if (!edev->caps) goto err;
@@ -1612,11 +1612,11 @@ _evdev_device_destroy(Elput_Device *edev)
1612{ 1612{
1613 if (!edev) return; 1613 if (!edev) return;
1614 1614
1615 if (edev->caps & EVDEV_SEAT_POINTER) 1615 if (edev->caps & ELPUT_DEVICE_CAPS_POINTER)
1616 _pointer_release(edev->seat); 1616 _pointer_release(edev->seat);
1617 if (edev->caps & EVDEV_SEAT_KEYBOARD) 1617 if (edev->caps & ELPUT_DEVICE_CAPS_KEYBOARD)
1618 _keyboard_release(edev->seat); 1618 _keyboard_release(edev->seat);
1619 if (edev->caps & EVDEV_SEAT_TOUCH) 1619 if (edev->caps & ELPUT_DEVICE_CAPS_TOUCH)
1620 _touch_release(edev->seat); 1620 _touch_release(edev->seat);
1621 1621
1622 libinput_device_unref(edev->device); 1622 libinput_device_unref(edev->device);
diff --git a/src/lib/elput/elput_input.c b/src/lib/elput/elput_input.c
index a5afe74fd9..ec38413bc9 100644
--- a/src/lib/elput/elput_input.c
+++ b/src/lib/elput/elput_input.c
@@ -205,11 +205,11 @@ _device_add(Elput_Manager *em, struct libinput_device *dev)
205 eseat->devices = eina_list_append(eseat->devices, edev); 205 eseat->devices = eina_list_append(eseat->devices, edev);
206 206
207 DBG("Input Device Added: %s", libinput_device_get_name(dev)); 207 DBG("Input Device Added: %s", libinput_device_get_name(dev));
208 if (edev->caps & EVDEV_SEAT_KEYBOARD) 208 if (edev->caps & ELPUT_DEVICE_CAPS_KEYBOARD)
209 DBG("\tDevice added as Keyboard device"); 209 DBG("\tDevice added as Keyboard device");
210 if (edev->caps & EVDEV_SEAT_POINTER) 210 if (edev->caps & ELPUT_DEVICE_CAPS_POINTER)
211 DBG("\tDevice added as Pointer device"); 211 DBG("\tDevice added as Pointer device");
212 if (edev->caps & EVDEV_SEAT_TOUCH) 212 if (edev->caps & ELPUT_DEVICE_CAPS_TOUCH)
213 DBG("\tDevice added as Touch device"); 213 DBG("\tDevice added as Touch device");
214 214
215 _device_event_send(edev, ELPUT_DEVICE_ADDED); 215 _device_event_send(edev, ELPUT_DEVICE_ADDED);
@@ -600,7 +600,7 @@ elput_input_key_remap_enable(Elput_Manager *manager, Eina_Bool enable)
600 { 600 {
601 EINA_LIST_FOREACH(eseat->devices, ll, edev) 601 EINA_LIST_FOREACH(eseat->devices, ll, edev)
602 { 602 {
603 if (!(edev->caps & EVDEV_SEAT_KEYBOARD)) continue; 603 if (!(edev->caps & ELPUT_DEVICE_CAPS_KEYBOARD)) continue;
604 604
605 edev->key_remap = enable; 605 edev->key_remap = enable;
606 if ((!enable) && (edev->key_remap_hash)) 606 if ((!enable) && (edev->key_remap_hash))
@@ -631,7 +631,7 @@ elput_input_key_remap_set(Elput_Manager *manager, int *from_keys, int *to_keys,
631 { 631 {
632 EINA_LIST_FOREACH(eseat->devices, ll, edev) 632 EINA_LIST_FOREACH(eseat->devices, ll, edev)
633 { 633 {
634 if (!(edev->caps & EVDEV_SEAT_KEYBOARD)) continue; 634 if (!(edev->caps & ELPUT_DEVICE_CAPS_KEYBOARD)) continue;
635 635
636 if (!edev->key_remap) continue; 636 if (!edev->key_remap) continue;
637 if (!edev->key_remap_hash) 637 if (!edev->key_remap_hash)
diff --git a/src/lib/elput/elput_private.h b/src/lib/elput/elput_private.h
index 4c7881e0ef..25d820e48d 100644
--- a/src/lib/elput/elput_private.h
+++ b/src/lib/elput/elput_private.h
@@ -60,16 +60,6 @@ extern int _elput_log_dom;
60# endif 60# endif
61# define CRIT(...) EINA_LOG_DOM_CRIT(_elput_log_dom, __VA_ARGS__) 61# define CRIT(...) EINA_LOG_DOM_CRIT(_elput_log_dom, __VA_ARGS__)
62 62
63typedef enum _Elput_Device_Capability
64{
65 EVDEV_SEAT_POINTER = (1 << 0),
66 EVDEV_SEAT_KEYBOARD = (1 << 1),
67 EVDEV_SEAT_TOUCH = (1 << 2),
68 EVDEV_SEAT_TABLET_TOOL = (1 << 3),
69 EVDEV_SEAT_TABLET_PAD = (1 << 4),
70 EVDEV_SEAT_GESTURE = (1 << 5),
71} Elput_Device_Capability;
72
73typedef struct _Elput_Interface 63typedef struct _Elput_Interface
74{ 64{
75 Eina_Bool (*connect)(Elput_Manager **manager, const char *seat, unsigned int tty); 65 Eina_Bool (*connect)(Elput_Manager **manager, const char *seat, unsigned int tty);
@@ -225,7 +215,7 @@ struct _Elput_Device
225 const char *output_name; 215 const char *output_name;
226 struct libinput_device *device; 216 struct libinput_device *device;
227 217
228 Elput_Device_Capability caps; 218 Elput_Device_Caps caps;
229 219
230 Eina_Hash *key_remap_hash; 220 Eina_Hash *key_remap_hash;
231 221