eis: expose eis_device_get_context() and eis_seat_get_context()

For frame events on a device it's likely that we want to use eis_now()
which takes the context. So let's make this easy enough to access
without having to carry extra variables in the caller. And the same for
the seat as well.
This commit is contained in:
Peter Hutterer 2023-06-01 14:58:40 +10:00
parent 1175595acf
commit ed1acbbd7c
4 changed files with 19 additions and 2 deletions

View file

@ -92,7 +92,7 @@ eis_device_new_keymap(struct eis_device *device,
return keymap;
}
struct eis *
_public_ struct eis *
eis_device_get_context(struct eis_device *device)
{
return eis_client_get_context(eis_device_get_client(device));

View file

@ -108,7 +108,6 @@ struct eis_xkb_modifiers {
};
OBJECT_DECLARE_GETTER(eis_device, id, object_id_t);
OBJECT_DECLARE_GETTER(eis_device, context, struct eis *);
OBJECT_DECLARE_GETTER(eis_device, proto_object, const struct brei_object *);
OBJECT_DECLARE_GETTER(eis_device, interface, const struct eis_device_interface *);
OBJECT_DECLARE_GETTER(eis_device, pointer_interface, const struct eis_pointer_interface *);

View file

@ -125,6 +125,12 @@ eis_seat_get_interface(struct eis_seat *seat)
return &interface;
}
_public_ struct eis *
eis_seat_get_context(struct eis_seat *seat)
{
return eis_client_get_context(eis_seat_get_client(seat));
}
_public_ struct eis_seat *
eis_client_new_seat(struct eis_client *client, const char *name)
{

View file

@ -723,6 +723,18 @@ eis_seat_add(struct eis_seat *seat);
void
eis_seat_remove(struct eis_seat *seat);
/**
* @ingroup libeis-seat
*/
struct eis *
eis_seat_get_context(struct eis_seat *seat);
/**
* @ingroup libeis-device
*/
struct eis *
eis_device_get_context(struct eis_device *device);
/**
* @ingroup libeis-device
*/