mirror of
https://gitlab.freedesktop.org/libinput/libei.git
synced 2026-01-26 09:40:23 +01:00
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:
parent
1175595acf
commit
ed1acbbd7c
4 changed files with 19 additions and 2 deletions
|
|
@ -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));
|
||||
|
|
|
|||
|
|
@ -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 *);
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
{
|
||||
|
|
|
|||
12
src/libeis.h
12
src/libeis.h
|
|
@ -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
|
||||
*/
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue