Commit graph

11 commits

Author SHA1 Message Date
Peter Hutterer
2e944450a0 tools: change the default socket to $XDG_RUNTIME_DIR/eis-0
This matches the future portal implementation

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2020-08-13 16:17:51 +10:00
Peter Hutterer
cb976a2f95 tools: fix a few memleaks on errors
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2020-08-06 15:12:19 +10:00
Peter Hutterer
48cbc48a38 tools: stop immediately on a disconnect event
We shouldn't get any events after this anyway, so the real-world impact here
is limited.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2020-08-06 15:12:19 +10:00
Peter Hutterer
311bc6b4fc libei: rename to ei_setup_backend_socket()
Now that the backend is more of an implementation detail, namespace for
ei_setup_backend_foo()

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2020-08-06 14:52:54 +10:00
Peter Hutterer
283cc87416 libei: switch to a single ei_new() function
The main reason for having different functions to create the initial context
was so we can nest the ei struct inside the context-specific struct. That
shouldn't leak into the API though and our use-case is probably one where we
create one context, then iterate through possible backends until one succeds -
having different contexts here doesn't help then.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2020-08-06 14:47:40 +10:00
Peter Hutterer
39fcf16ec8 tools: add key events to the example client
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2020-08-03 12:04:00 +10:00
Peter Hutterer
a9f07368a5 Implement pointer button and keyboard key events
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2020-08-03 12:00:31 +10:00
Peter Hutterer
40682a0420 Use send() instead of write() to prevent SIGPIPE
We're in a library here, so expecting the caller to handle SIGPIPE just in
case we get it is a bit demanding. Let's use send() instead so we can just
prevent that altogether.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2020-07-31 14:27:18 +10:00
Peter Hutterer
1817071b5a tools: default to the LIBEI_SOCKET if present
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2020-07-30 15:38:40 +10:00
Peter Hutterer
b1231dfa1f libei: add a hook to configure the client name
Better than the current "myclient". Lacks safety and whatnot so long-term it
will have to get replaced with something else.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2020-07-30 15:38:40 +10:00
Peter Hutterer
802dfd4ca6 Add the minimal implementation for a UNIX socket libei client
This is the minimum framework to support connecting to a libeis server, adding
a device and sending relative pointer motion events.It's missing a bunch of
checks and verifications, many of the hooks are still missing, etc.

See the tools/ directory for an example. The protocol is as outlined in
commit f7a24b2fbd.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2020-07-29 16:18:24 +10:00