libei 1.5.0
A library for Emulated Input

The API to query and interact with a struct ei_seat. More...

Functions

void ei_seat_set_user_data (struct ei_seat *seat, void *user_data)
 Set a custom data pointer for this context.
void * ei_seat_get_user_data (struct ei_seat *seat)
 Return the custom data pointer for this context.
const char * ei_seat_get_name (struct ei_seat *seat)
bool ei_seat_has_capability (struct ei_seat *seat, enum ei_device_capability cap)
 Return true if the capability is available on this seat or false otherwise.
void ei_seat_bind_capabilities (struct ei_seat *seat,...) __attribute__((sentinel))
 Bind this client to the given seat capabilities, terminated by NULL.
void ei_seat_unbind_capabilities (struct ei_seat *seat,...) __attribute__((sentinel))
 Unbind a seat's capabilities, terminated by NULL.
void ei_seat_request_device_with_capabilities (struct ei_seat *seat,...) __attribute__((sentinel))
 Request a new device with (a subset of) the given capabilities from the EIS implementation.
struct ei_seatei_seat_ref (struct ei_seat *seat)
struct ei_seatei_seat_unref (struct ei_seat *seat)
struct eiei_seat_get_context (struct ei_seat *seat)
 Return the struct ei context this seat is associated with.

Detailed Description

The API to query and interact with a struct ei_seat.

Function Documentation

◆ ei_seat_bind_capabilities()

void ei_seat_bind_capabilities ( struct ei_seat * seat,
... )

Bind this client to the given seat capabilities, terminated by NULL.

Once bound, the server may create devices for the requested capability and send the respective EI_EVENT_DEVICE_ADDED events. To undo, call ei_seat_unbind_capabilities().

Note that binding to a capability does not guarantee a device for that capability becomes available. Devices may be added and removed at any time.

It is an application bug to call this function for a capability already bound - call ei_seat_unbind_capabilities() first.

Calling this function for a capability that does not exist on the seat is permitted (but obviously a noop)

◆ ei_seat_get_context()

struct ei * ei_seat_get_context ( struct ei_seat * seat)

Return the struct ei context this seat is associated with.

◆ ei_seat_get_name()

const char * ei_seat_get_name ( struct ei_seat * seat)

◆ ei_seat_get_user_data()

void * ei_seat_get_user_data ( struct ei_seat * seat)

Return the custom data pointer for this context.

libei will not look at or modify the pointer. Use ei_seat_get_user_data() to change the user data.

◆ ei_seat_has_capability()

bool ei_seat_has_capability ( struct ei_seat * seat,
enum ei_device_capability cap )

Return true if the capability is available on this seat or false otherwise.

The return value of this function is not affected by ei_seat_confirm_capability().

◆ ei_seat_ref()

struct ei_seat * ei_seat_ref ( struct ei_seat * seat)

◆ ei_seat_request_device_with_capabilities()

void ei_seat_request_device_with_capabilities ( struct ei_seat * seat,
... )

Request a new device with (a subset of) the given capabilities from the EIS implementation.

If the EIS implementation creates a device in response to this request the device will arrive via an event of type EI_EVENT_DEVICE_ADDED.

The device's capabilities may not match the requested capabilities. For example requesting a pointer + keyboard device may result in the creation of a pointer-only device or it may result in the creation of a pointer + keyboard + touch device. It is up to the caller to handle capability mismatches.

This function should be used by a caller when the current set of devices is insufficient for the functionality the client requires. For example a client that has previously called ei_device_close() on a device may need a device again with similar capabilities.

The capabilities must be a subset of the capabilities requested in ei_seat_bind_capabilities().

◆ ei_seat_set_user_data()

void ei_seat_set_user_data ( struct ei_seat * seat,
void * user_data )

Set a custom data pointer for this context.

libei will not look at or modify the pointer. Use ei_seat_get_user_data() to retrieve a previously set user data.

◆ ei_seat_unbind_capabilities()

void ei_seat_unbind_capabilities ( struct ei_seat * seat,
... )

Unbind a seat's capabilities, terminated by NULL.

This function indicates the the application is no longer interested in devices with the given capability.

If any devices with the given capability are present, libei automatically calls ei_device_close() on those devices (and thus the server will send EI_EVENT_DEVICE_REMOVED for those devices).

◆ ei_seat_unref()

struct ei_seat * ei_seat_unref ( struct ei_seat * seat)