libei.h
@ EI_KEYMAP_SOURCE_SERVER
The keymap is provided by the server.
Definition: libei.h:149
struct ei * ei_seat_get_context(struct ei_seat *seat)
Return the struct EI - the client implementation context this seat is associated with.
void ei_device_keyboard_key(struct ei_device *device, uint32_t keycode, bool is_press)
Generate a key event on a device with the EI_DEVICE_CAP_KEYBOARD capability.
void * ei_get_user_data(struct ei *ei)
Return the custom data pointer for this context.
bool ei_device_configure_capability(struct ei_device *device, enum ei_device_capability cap)
Enable the given capability on this device.
int ei_keymap_get_fd(struct ei_keymap *keymap)
Return a memmap-able file descriptor pointing to the keymap used by the device.
void ei_device_pointer_scroll(struct ei_device *device, double x, double y)
Generate a scroll event on a device with the EI_DEVICE_CAP_POINTER_ABSOLUTE or EI_DEVICE_CAP_POINTER ...
struct ei_device * ei_event_get_device(struct ei_event *event)
Return the device from this event.
void ei_log_set_priority(struct ei *ei, enum ei_log_priority priority)
struct ei_keymap * ei_device_keyboard_get_keymap(struct ei_device *device)
Return the keymap for this device or NULL.
void ei_configure_name(struct ei *ei, const char *name)
Set the name for this client.
struct ei_seat * ei_seat_unref(struct ei_seat *seat)
uint32_t ei_device_touch_get_height(struct ei_device *device)
Return the requested height for an EI_DEVICE_CAP_TOUCH device.
@ EI_EVENT_SEAT_ADDED
The server has added a seat available to this client.
Definition: libei.h:189
void ei_device_pointer_button(struct ei_device *device, uint32_t button, bool is_press)
Generate a button event on a device with the EI_DEVICE_CAP_POINTER_ABSOLUTE or EI_DEVICE_CAP_POINTER ...
struct ei_event * ei_peek_event(struct ei *ei)
Returns the next event in the internal event queue (or NULL) without removing that event from the que...
int ei_setup_backend_portal_busname(struct ei *ei, const char *busname)
Connect to an org.freedesktop.portal.Desktop implementation on the given busname.
void ei_touch_down(struct ei_touch *touch, double x, double y)
This function can only be called once on an ei_touch object.
void ei_device_remove(struct ei_device *device)
Notify the server that the device should be removed.
struct ei_seat * ei_device_get_seat(struct ei_device *device)
struct ei_device * ei_device_new(struct ei_seat *ei_seat)
Create a new device in the given seat.
int ei_setup_backend_socket(struct ei *ei, const char *socketpath)
Set this ei context to use the socket backend.
int ei_setup_backend_portal(struct ei *ei)
Connect to the org.freedesktop.portal.Desktop portal.
void ei_log_set_handler(struct ei *ei, ei_log_handler log_handler)
Change the log handler for this context.
@ EI_EVENT_DEVICE_ADDED
The server has added a device for this client.
Definition: libei.h:216
void ei_device_add(struct ei_device *device)
Request that the device be added to the server.
uint64_t ei_event_get_time(struct ei_event *event)
@ EI_EVENT_DISCONNECT
The server has disconnected this client - all resources left to reference this server are now obsolet...
Definition: libei.h:178
const char * ei_device_get_name(struct ei_device *device)
Return the name of this device.
struct ei_touch * ei_device_touch_new(struct ei_device *device)
Initiate a new touch on a device with the EI_DEVICE_CAP_TOUCH capability.
size_t ei_keymap_get_size(struct ei_keymap *keymap)
void * ei_seat_get_user_data(struct ei_seat *seat)
Return the custom data pointer for this context.
void ei_device_pointer_scroll_discrete(struct ei_device *device, int32_t x, int32_t y)
Generate a discrete scroll event on a device with the EI_DEVICE_CAP_POINTER_ABSOLUTE or EI_DEVICE_CAP...
struct ei_keymap * ei_keymap_ref(struct ei_keymap *keymap)
Increase the refcount of this struct by one.
@ EI_EVENT_SEAT_REMOVED
The server has removed a seat previously available to this client.
Definition: libei.h:201
struct ei_touch * ei_touch_ref(struct ei_touch *touch)
Increase the refcount of this struct by one.
bool ei_seat_has_capability(struct ei_seat *seat, enum ei_device_capability cap)
void * ei_device_get_user_data(struct ei_device *device)
Return the custom data pointer for this context.
enum ei_keymap_type ei_keymap_get_type(struct ei_keymap *keymap)
Returns the type for this keymap.
int ei_setup_backend_fd(struct ei *ei, int fd)
Initialize the ei context on the given socket.
void ei_device_set_user_data(struct ei_device *device, void *user_data)
Set a custom data pointer for this context.
struct ei_device * ei_touch_get_device(struct ei_touch *touch)
@ EI_EVENT_DEVICE_REMOVED
The server has removed a device belonging to this client.
Definition: libei.h:228
void ei_device_pointer_configure_range(struct ei_device *device, uint32_t width, uint32_t height)
Set the range of the absolute pointer device in logical pixels.
enum ei_log_priority ei_log_get_priority(const struct ei *ei)
void ei_set_user_data(struct ei *ei, void *user_data)
Set a custom data pointer for this context.
bool ei_device_has_capability(struct ei_device *device, enum ei_device_capability cap)
Return true if the device has the requested capability.
void * ei_touch_get_user_data(struct ei_touch *touch)
Set a custom data pointer for this context.
struct ei_event * ei_get_event(struct ei *ei)
Return the next event from the event queue, removing it from the queue.
const char * ei_seat_get_name(struct ei_seat *seat)
void ei_touch_motion(struct ei_touch *touch, double x, double y)
Move this touch to the new coordinates.
void ei_seat_set_user_data(struct ei_seat *seat, void *user_data)
Set a custom data pointer for this context.
struct ei_device * ei_device_unref(struct ei_device *device)
Decrease the refcount of this struct by one.
The main context to interact with libei.
void ei_device_keyboard_configure_keymap(struct ei_device *device, struct ei_keymap *keymap)
Request this keymap for this device with the EI_DEVICE_CAP_KEYBOARD capability.
struct ei_keymap * ei_keymap_new(enum ei_keymap_type type, int fd, size_t size)
Create a new keymap of the given type.
struct ei_device * ei_keymap_get_context(struct ei_keymap *keymap)
Return the struct ei_device this keymap is associated with.
struct ei_seat * ei_seat_ref(struct ei_seat *seat)
void(* ei_log_handler)(struct ei *ei, enum ei_log_priority priority, const char *message, bool is_continuation)
The log handler for library logging.
Definition: libei.h:274
@ EI_KEYMAP_SOURCE_CLIENT
The keymap is the one provided by the client.
Definition: libei.h:145
struct ei_device * ei_keymap_get_device(struct ei_keymap *keymap)
Return the device this keymap belongs to, or NULL if it has not yet been assigned to a device.
void ei_touch_set_user_data(struct ei_touch *touch, void *user_data)
Return the custom data pointer for this context.
uint32_t ei_device_touch_get_width(struct ei_device *device)
Return the requested width for an EI_DEVICE_CAP_TOUCH device.
@ EI_EVENT_CONNECT
The server has approved the connection to this client.
Definition: libei.h:165
struct ei_device * ei_device_ref(struct ei_device *device)
Increase the refcount of this struct by one.
void ei_device_touch_configure_range(struct ei_device *device, uint32_t width, uint32_t height)
Set the range of the touch device in logical pixels.
@ EI_EVENT_DEVICE_SUSPENDED
Any events sent from this device will be discarded until the next resume.
Definition: libei.h:234
uint32_t ei_device_pointer_get_height(struct ei_device *device)
Return the requested height for an EI_DEVICE_CAP_POINTER_ABSOLUTE device.
struct ei_keymap * ei_keymap_unref(struct ei_keymap *keymap)
Decrease the refcount of this struct by one.
struct ei * ei_device_get_context(struct ei_device *device)
Return the struct EI - the client implementation context this device is associated with.
void ei_device_configure_name(struct ei_device *device, const char *name)
Set the name for this device.
struct ei_touch * ei_touch_unref(struct ei_touch *touch)
Decrease the refcount of this struct by one.
void ei_device_pointer_motion_absolute(struct ei_device *device, double x, double y)
Generate an absolute motion event on a device with the EI_DEVICE_CAP_POINTER_ABSOLUTE capability.
struct ei_event * ei_event_unref(struct ei_event *event)
Release resources associated with this event.
ei_keymap_type
The set of supported keymap types for a struct ei_keymap.
Definition: libei.h:129
uint32_t ei_device_pointer_get_width(struct ei_device *device)
Return the requested width for an EI_DEVICE_CAP_POINTER_ABSOLUTE device.
struct ei_seat * ei_event_get_seat(struct ei_event *event)
Return the seat from this event.
enum ei_event_type ei_event_get_type(struct ei_event *event)
enum ei_keymap_source ei_keymap_get_source(struct ei_keymap *keymap)
Returns the source for the keymap on this device, if any.
void ei_device_pointer_motion(struct ei_device *device, double x, double y)
Generate a relative motion event on a device with the EI_DEVICE_CAP_POINTER capability.