The current implementation of that portal has two methods: EmulateInput to
authenticate and Connect to get the fd to the EIS implementation. The portal
implementation is in charge of finding EIS and restricting it if need be.
This uses libsystemd because we can integrate that with epoll and our
libei_dispatch() method. GDBus requires a glib mainloop, so it's not really
suitable here. Given how simple this is anyway, it's easy to just do the DBus
bits in the caller and then hand the fd to ei_setup_backend_fd().
A eis-fake-portal is provided for testing, this "portal" can use the custom
portal bus name and connect the eis-demo-client to the eis-demo-server.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
And add the tests for the list and string helpers as a first use-case, copied
from the libinput tests.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Re-ordering commands in buildtype=release means recvfd may not be set by the
time _cleanup_ is called (due to the goto outs). Replace those with return
statements, it's more logical here anyway.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Initial implementation only handled this correctly if the fds were over
multiple message headers, not multiple fds in the same message header.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This is the proto parser and it'll know when we need an fd on the message, so
let's make sure we have everything in place to fetch the fd.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This is the proto parser and it'll know when we need an fd on the message, so
let's make sure we have everything in place to fetch the fd.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This was intentional here but valgrind doesn't like it, so let's just set it
to something that should look odd.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Building with a releaes build reshuffles things so this ends causing potential
issues. Initialize to NULL to avoid around this.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
The logger utilities are useful for quick prototyping, but we've reached the
point where we need the "proper" implementation of a log handler.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
The logger utilities are useful for quick prototyping, but we've reached the
point where we need the "proper" implementation of a log handler.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Make the default set an enum with an array to access the codes. Additionally
provide a true RBG escape sequence, all modern terminals support that anyway.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Where the server connects a device after the client has already removed it, we
need to ignore that message silently.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This was already spelled out in the documentation but just not yet
implemented. New starting state for any device added by EIS is "suspended",
the server needs to explicitly resume it before events are accepted.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
These were added originally to illustrate how the diffent backends could work
but they're not going to be implemented this way anyway. So let's just drop
them.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
If a client calls ei_device_remove(), it should consider that as the last
interaction with this device (short of unref). There is no need for the server
to confirm this, no further events must reach the client for this device.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
If we get disconnected after calling ei_device_add() but before EIS saw and
processed the event, we need to emulate a removed event ourselves.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This de-duplicates a bunch of things that we don't need to duplicate,
specifically the protocol part that splits the data up into parseable chunks.
That we have Frames in between messages is an implementation detail, this way
neither libei nor libeis have to care about it.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
The goal here is to separate any state checking and other processing from the
actual bits writing onto the wire so we can test those separately.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Same as already done for libei. There's relatively little benefit here since
we won't have a lot of different events and any caller will do the switch
based on the event type anyway. So let's just export a single event type and
have everything contained in that.
Since this required rewriting all getters, let's move the lot to a new file
and streamline things a bit that way.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>