libei: The seat API

libei 1.4.0 A library for Emulated Input

Functions
The seat API
🥚 EI - The client API

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 capabilitiy 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, terminatd by `NULL`.
struct ei_seat * | ei_seat_ref (struct ei_seat *seat)
struct ei_seat * | ei_seat_unref (struct ei_seat *seat)
struct ei * | ei_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 capabilitiy 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_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, terminatd 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 | ) |