summaryrefslogtreecommitdiff
path: root/src/lib/elput/elput_manager.c
diff options
context:
space:
mode:
authorChris Michael <cpmichael@osg.samsung.com>2016-03-31 12:34:32 -0400
committerChris Michael <cpmichael@osg.samsung.com>2016-04-13 14:16:17 -0400
commited3a1f39587187c8acf305fd793f92218995c486 (patch)
treeaf2655dafed5e019d6e5085a50e9f1fbc51532aa /src/lib/elput/elput_manager.c
parent08482e1ca4feaff2c631a125b58fda7e57084b97 (diff)
elput: Add input manager interface and APIs to connect & disconnect
This commit adds the start of the Elput Manager & Interface code. This will be used as an inteface to various backend methods of session & device control (ie: systemd, direct interface, etc). This will provide various abstractions for working with libinput when opening/closing input devices. Signed-off-by: Chris Michael <cpmichael@osg.samsung.com>
Diffstat (limited to 'src/lib/elput/elput_manager.c')
-rw-r--r--src/lib/elput/elput_manager.c39
1 files changed, 39 insertions, 0 deletions
diff --git a/src/lib/elput/elput_manager.c b/src/lib/elput/elput_manager.c
new file mode 100644
index 0000000000..2073ff78f9
--- /dev/null
+++ b/src/lib/elput/elput_manager.c
@@ -0,0 +1,39 @@
1#include "elput_private.h"
2
3static Elput_Interface *_ifaces[] =
4{
5#ifdef HAVE_SYSTEMD
6 &_logind_interface,
7#endif
8 NULL, // launcher
9 NULL, // direct
10 NULL,
11};
12
13EAPI Elput_Manager *
14elput_manager_connect(const char *seat, unsigned int tty, Eina_Bool sync)
15{
16 Elput_Interface **it;
17
18 for (it = _ifaces; *it != NULL; it++)
19 {
20 Elput_Interface *iface;
21 Elput_Manager *em;
22
23 iface = *it;
24 if (iface->connect(&em, seat, tty, sync))
25 return em;
26 }
27
28 return NULL;
29}
30
31EAPI void
32elput_manager_disconnect(Elput_Manager *manager)
33{
34 EINA_SAFETY_ON_NULL_RETURN(manager);
35 EINA_SAFETY_ON_NULL_RETURN(manager->interface);
36
37 if (manager->interface->disconnect)
38 manager->interface->disconnect(manager);
39}