libei  0.2
A library for Emulated Input
libeis.h
Go to the documentation of this file.
1 /* SPDX-License-Identifier: MIT */
2 /*
3  * Copyright © 2020 Red Hat, Inc.
4  *
5  * Permission is hereby granted, free of charge, to any person obtaining a
6  * copy of this software and associated documentation files (the "Software"),
7  * to deal in the Software without restriction, including without limitation
8  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
9  * and/or sell copies of the Software, and to permit persons to whom the
10  * Software is furnished to do so, subject to the following conditions:
11  *
12  * The above copyright notice and this permission notice (including the next
13  * paragraph) shall be included in all copies or substantial portions of the
14  * Software.
15  *
16  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
19  * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
22  * DEALINGS IN THE SOFTWARE.
23  */
24 
25 
26 #pragma once
27 
28 #ifdef __cplusplus
29 extern "C" {
30 #endif
31 
32 #include <stddef.h>
33 #include <stdbool.h>
34 #include <stdint.h>
35 
58 struct eis;
59 struct eis_client;
60 struct eis_device;
61 struct eis_seat;
62 struct eis_event;
63 struct eis_keymap;
64 struct eis_touch;
65 
93 struct eis_region;
94 
119 };
120 
126 };
127 
140 
142 };
143 
146 };
147 
161 
166 
173 
179 
191 
213 
214  /* These events are only generated on a receiving EIS context */
215 
248 
253 
271 };
272 
276 struct eis *
277 eis_new(void *user_data);
278 
284 };
285 
300 typedef void (*eis_log_handler)(struct eis *eis,
301  enum eis_log_priority priority,
302  const char *file, int lineno, const char *func,
303  const char *message,
304  bool is_continuation);
313 void
314 eis_log_set_handler(struct eis *eis, eis_log_handler log_handler);
315 
316 void
317 eis_log_set_priority(struct eis *eis, enum eis_log_priority priority);
318 
319 enum eis_log_priority
320 eis_log_get_priority(const struct eis *eis);
321 
322 struct eis *
323 eis_ref(struct eis *eis);
324 
325 struct eis *
326 eis_unref(struct eis *eis);
327 
328 void *
329 eis_get_user_data(struct eis *eis);
330 
331 void
332 eis_set_user_data(struct eis *eis, void *user_data);
333 
339 bool
340 eis_client_is_sender(struct eis_client *client);
341 
347 void
348 eis_client_property_set(struct eis_client *client, const char *property, const char *value);
349 
367 void
369  const char *property, const char *value,
370  uint32_t permission);
371 
376 uint32_t
377 eis_client_property_get_permissions(struct eis_client *client, const char *propert);
378 
388 const char *
389 eis_client_property_get(struct eis_client *client, const char *property);
390 
391 
396 int
397 eis_setup_backend_socket(struct eis *ctx, const char *path);
398 
402 int
403 eis_setup_backend_fd(struct eis *ctx);
404 
410 int
411 eis_backend_fd_add_client(struct eis *ctx);
412 
419 int
420 eis_get_fd(struct eis *eis);
421 
431 void
432 eis_dispatch(struct eis *eis);
433 
444 struct eis_event *
445 eis_get_event(struct eis *eis);
446 
463 struct eis_event *
464 eis_peek_event(struct eis *eis);
465 
475 struct eis_event *
476 eis_event_unref(struct eis_event *event);
477 
478 struct eis_client *
479 eis_client_ref(struct eis_client *client);
480 
481 struct eis_client *
482 eis_client_unref(struct eis_client *client);
483 
484 void *
485 eis_client_get_user_data(struct eis_client *eis_client);
486 
487 void
488 eis_client_set_user_data(struct eis_client *eis_client, void *user_data);
489 
494 const char *
495 eis_client_get_name(struct eis_client *client);
496 
506 void
507 eis_client_connect(struct eis_client *client);
508 
517 void
518 eis_client_disconnect(struct eis_client *client);
519 
532 struct eis_seat *
533 eis_client_new_seat(struct eis_client *client, const char *name);
534 
535 struct eis_seat *
536 eis_seat_ref(struct eis_seat *seat);
537 
538 struct eis_seat *
539 eis_seat_unref(struct eis_seat *seat);
540 
541 struct eis_client *
542 eis_seat_get_client(struct eis_seat *eis_seat);
543 
544 const char *
545 eis_seat_get_name(struct eis_seat *eis_seat);
546 
547 void *
548 eis_seat_get_user_data(struct eis_seat *eis_seat);
549 
550 bool
551 eis_seat_has_capability(struct eis_seat *seat,
552  enum eis_device_capability cap);
553 
554 void
555 eis_seat_set_user_data(struct eis_seat *eis_seat, void *user_data);
556 
567 void
568 eis_seat_configure_capability(struct eis_seat *seat,
569  enum eis_device_capability cap);
570 
575 void
576 eis_seat_add(struct eis_seat *seat);
577 
581 void
582 eis_seat_remove(struct eis_seat *seat);
583 
584 enum eis_event_type
585 eis_event_get_type(struct eis_event *event);
586 
587 struct eis_client *
588 eis_event_get_client(struct eis_event *event);
589 
594 const char *
595 eis_event_property_get_name(struct eis_event *event);
596 
603 const char *
604 eis_event_property_get_value(struct eis_event *event);
605 
610 uint32_t
611 eis_event_property_get_permissions(struct eis_event *event);
612 
613 struct eis_seat *
614 eis_event_get_seat(struct eis_event *event);
615 
616 struct eis_client *
617 eis_device_get_client(struct eis_device *device);
618 
619 struct eis_seat *
620 eis_device_get_seat(struct eis_device *device);
621 
622 struct eis_device *
623 eis_device_ref(struct eis_device *device);
624 
625 struct eis_device *
626 eis_device_unref(struct eis_device *device);
627 
628 void *
629 eis_device_get_user_data(struct eis_device *eis_device);
630 
631 void
632 eis_device_set_user_data(struct eis_device *eis_device, void *user_data);
633 
639 const char *
640 eis_device_get_name(struct eis_device *device);
641 
642 bool
643 eis_device_has_capability(struct eis_device *device,
644  enum eis_device_capability cap);
645 
650 uint32_t
651 eis_device_get_width(struct eis_device *device);
652 
657 uint32_t
658 eis_device_get_height(struct eis_device *device);
659 
677 struct eis_device *
678 eis_seat_new_device(struct eis_seat *seat);
679 
686 void
687 eis_device_configure_type(struct eis_device *device, enum eis_device_type type);
688 
689 enum eis_device_type
690 eis_device_get_type(struct eis_device *device);
691 
692 void
693 eis_device_configure_name(struct eis_device *device, const char *name);
694 
695 void
696 eis_device_configure_capability(struct eis_device *device, enum eis_device_capability cap);
697 
710 void
711 eis_device_configure_size(struct eis_device *device, uint32_t width, uint32_t height);
712 
723 struct eis_region *
724 eis_device_new_region(struct eis_device *device);
725 
729 void
730 eis_region_set_size(struct eis_region *region, uint32_t w, uint32_t h);
731 
735 void
736 eis_region_set_offset(struct eis_region *region, uint32_t x, uint32_t y);
737 
748 void
749 eis_region_set_physical_scale(struct eis_region *region, double scale);
750 
757 void
758 eis_region_add(struct eis_region *region);
759 
777 struct eis_region *
778 eis_device_get_region(struct eis_device *device, size_t index);
779 
780 struct eis_region *
781 eis_region_ref(struct eis_region *region);
782 
783 struct eis_region *
784 eis_region_unref(struct eis_region *region);
785 
786 void *
788 
789 void
790 eis_region_set_user_data(struct eis_region *region, void *user_data);
791 
792 uint32_t
793 eis_region_get_x(struct eis_region *region);
794 
795 uint32_t
796 eis_region_get_y(struct eis_region *region);
797 
798 uint32_t
800 
801 uint32_t
803 
811 void
812 eis_device_add(struct eis_device *device);
813 
819 void
820 eis_device_remove(struct eis_device *device);
821 
840 void
841 eis_device_pause(struct eis_device *device);
842 
849 void
850 eis_device_resume(struct eis_device *device);
851 
869 struct eis_keymap *
870 eis_device_new_keymap(struct eis_device *device,
871  enum eis_keymap_type type, int fd, size_t size);
872 
886 void
887 eis_keymap_add(struct eis_keymap *keymap);
888 
892 size_t
893 eis_keymap_get_size(struct eis_keymap *keymap);
894 
899 enum eis_keymap_type
900 eis_keymap_get_type(struct eis_keymap *keymap);
901 
907 int
908 eis_keymap_get_fd(struct eis_keymap *keymap);
909 
910 struct eis_keymap *
911 eis_keymap_ref(struct eis_keymap *keymap);
912 
913 struct eis_keymap *
914 eis_keymap_unref(struct eis_keymap *keymap);
915 
916 void *
917 eis_keymap_get_user_data(struct eis_keymap *eis_keymap);
918 
919 void
920 eis_keymap_set_user_data(struct eis_keymap *eis_keymap, void *user_data);
921 
925 struct eis_device *
926 eis_keymap_get_device(struct eis_keymap *keymap);
927 
933 struct eis_keymap *
934 eis_device_keyboard_get_keymap(struct eis_device *device);
935 
939 void
940 eis_device_keyboard_send_xkb_modifiers(struct eis_device *device,
941  uint32_t depressed,
942  uint32_t latched,
943  uint32_t locked,
944  uint32_t group);
945 
947 void
948 eis_device_start_emulating(struct eis_device *device);
949 
951 void
952 eis_device_stop_emulating(struct eis_device *device);
953 
955 void
956 eis_device_frame(struct eis_device *device);
957 
959 void
960 eis_device_pointer_motion(struct eis_device *device, double x, double y);
961 
963 void
964 eis_device_pointer_motion_absolute(struct eis_device *device,
965  double x, double y);
966 
968 void
969 eis_device_pointer_button(struct eis_device *device,
970  uint32_t button, bool is_press);
971 
973 void
974 eis_device_pointer_scroll(struct eis_device *device, double x, double y);
975 
977 void
978 eis_device_pointer_scroll_discrete(struct eis_device *device, int32_t x, int32_t y);
979 
981 void
982 eis_device_pointer_scroll_stop(struct eis_device *device, bool stop_x, bool stop_y);
983 
985 void
986 eis_device_pointer_scroll_cancel(struct eis_device *device, bool cancel_x, bool cancel_y);
987 
989 void
990 eis_device_keyboard_key(struct eis_device *device, uint32_t keycode, bool is_press);
991 
993 struct eis_touch *
994 eis_device_touch_new(struct eis_device *device);
995 
997 void
998 eis_touch_down(struct eis_touch *touch, double x, double y);
999 
1001 void
1002 eis_touch_motion(struct eis_touch *touch, double x, double y);
1003 
1005 void
1006 eis_touch_up(struct eis_touch *touch);
1007 
1009 struct eis_touch *
1010 eis_touch_ref(struct eis_touch *touch);
1011 
1013 struct eis_touch *
1014 eis_touch_unref(struct eis_touch *touch);
1015 
1017 void
1018 eis_touch_set_user_data(struct eis_touch *touch, void *user_data);
1019 
1021 void *
1022 eis_touch_get_user_data(struct eis_touch *touch);
1023 
1025 struct eis_device *
1026 eis_touch_get_device(struct eis_touch *touch);
1027 
1035 bool
1036 eis_event_seat_has_capability(struct eis_event *event, enum eis_device_capability cap);
1037 
1044 struct eis_device *
1045 eis_event_get_device(struct eis_event *event);
1046 
1051 double
1052 eis_event_pointer_get_dx(struct eis_event *event);
1053 
1058 double
1059 eis_event_pointer_get_dy(struct eis_event *event);
1060 
1065 double
1066 eis_event_pointer_get_absolute_x(struct eis_event *event);
1067 
1072 double
1073 eis_event_pointer_get_absolute_y(struct eis_event *event);
1074 
1079 uint32_t
1080 eis_event_pointer_get_button(struct eis_event *event);
1081 
1086 bool
1087 eis_event_pointer_get_button_is_press(struct eis_event *event);
1088 
1093 double
1094 eis_event_pointer_get_scroll_x(struct eis_event *event);
1095 
1100 double
1101 eis_event_pointer_get_scroll_y(struct eis_event *event);
1102 
1110 bool
1111 eis_event_pointer_get_scroll_stop_x(struct eis_event *event);
1112 
1120 bool
1121 eis_event_pointer_get_scroll_stop_y(struct eis_event *event);
1122 
1127 int32_t
1129 
1134 int32_t
1136 
1141 uint32_t
1142 eis_event_keyboard_get_key(struct eis_event *event);
1143 
1148 bool
1149 eis_event_keyboard_get_key_is_press(struct eis_event *event);
1150 
1161 uint32_t
1162 eis_event_touch_get_id(struct eis_event *event);
1163 
1169 double
1170 eis_event_touch_get_x(struct eis_event *event);
1171 
1177 double
1178 eis_event_touch_get_y(struct eis_event *event);
1179 
1184 #ifdef __cplusplus
1185 }
1186 #endif
void eis_region_set_size(struct eis_region *region, uint32_t w, uint32_t h)
This call has no effect if called after eis_region_add()
void eis_device_configure_type(struct eis_device *device, enum eis_device_type type)
Set the device type for this device.
struct eis_event * eis_event_unref(struct eis_event *event)
Release resources associated with this event.
bool eis_device_has_capability(struct eis_device *device, enum eis_device_capability cap)
int eis_backend_fd_add_client(struct eis *ctx)
Add a new client to a context set up with eis_setup_backend_fd().
struct eis_touch * eis_touch_unref(struct eis_touch *touch)
see ei_touch_unref
void eis_device_pointer_scroll_discrete(struct eis_device *device, int32_t x, int32_t y)
see ei_device_pointer_scroll_discrete
double eis_event_pointer_get_scroll_y(struct eis_event *event)
For an event of type EIS_EVENT_POINTER_SCROLL return the y scroll distance in logical pixels or mm,...
eis_device_type
The device type determines what the device represents.
Definition: libeis.h:116
void eis_device_remove(struct eis_device *device)
Remove the device.
void eis_client_property_set(struct eis_client *client, const char *property, const char *value)
See eis_client_property_set_with_permissions(), but the permissions are left as-is.
uint32_t eis_device_get_height(struct eis_device *device)
Return the height in mm of a device of type EIS_DEVICE_TYPE_PHYSICAL, or zero otherwise.
void eis_client_set_user_data(struct eis_client *eis_client, void *user_data)
struct eis_device * eis_device_ref(struct eis_device *device)
eis_device_capability
Definition: libeis.h:121
struct eis_region * eis_region_ref(struct eis_region *region)
void eis_device_pointer_motion_absolute(struct eis_device *device, double x, double y)
see ei_device_pointer_motion_absolute
double eis_event_pointer_get_scroll_x(struct eis_event *event)
For an event of type EIS_EVENT_POINTER_SCROLL return the x scroll distance in logical pixels or mm,...
void eis_device_frame(struct eis_device *device)
see ei_device_frame
uint32_t eis_event_keyboard_get_key(struct eis_event *event)
For an event of type EIS_EVENT_KEYBOARD_KEY return the key code (as defined in include/linux/input-ev...
size_t eis_keymap_get_size(struct eis_keymap *keymap)
void eis_touch_set_user_data(struct eis_touch *touch, void *user_data)
see ei_touch_set_user_data
void eis_region_add(struct eis_region *region)
Add the given region to its device.
struct eis * eis_ref(struct eis *eis)
struct eis_region * eis_device_get_region(struct eis_device *device, size_t index)
Obtain a region from the device.
void * eis_keymap_get_user_data(struct eis_keymap *eis_keymap)
void eis_region_set_offset(struct eis_region *region, uint32_t x, uint32_t y)
This call has no effect if called after eis_region_add()
struct eis_touch * eis_touch_ref(struct eis_touch *touch)
see ei_touch_ref
void * eis_client_get_user_data(struct eis_client *eis_client)
struct eis_event * eis_get_event(struct eis *eis)
Returns the next event in the internal event queue (or NULL) and removes it from the queue.
eis_event_type
Definition: libeis.h:148
uint32_t eis_event_touch_get_id(struct eis_event *event)
For an event of type EIS_EVENT_TOUCH_DOWN, EIS_EVENT_TOUCH_MOTION, or EIS_EVENT_TOUCH_UP,...
struct eis_device * eis_device_unref(struct eis_device *device)
void eis_device_start_emulating(struct eis_device *device)
see ei_device_start_emulating
eis_keymap_type
Definition: libeis.h:144
void eis_device_pointer_motion(struct eis_device *device, double x, double y)
see ei_device_pointer_motion
void eis_device_set_user_data(struct eis_device *eis_device, void *user_data)
struct eis * eis_new(void *user_data)
Create a new libeis context with a refcount of 1.
eis_log_priority
Definition: libeis.h:279
struct eis_client * eis_device_get_client(struct eis_device *device)
void eis_device_configure_size(struct eis_device *device, uint32_t width, uint32_t height)
Configure the size in mm of a device of type EIS_DEVICE_TYPE_PHYSICAL.
void eis_client_connect(struct eis_client *client)
Allow connection from the client.
void eis_device_pointer_scroll_stop(struct eis_device *device, bool stop_x, bool stop_y)
see ei_device_pointer_scroll_stop
const char * eis_seat_get_name(struct eis_seat *eis_seat)
bool eis_client_is_sender(struct eis_client *client)
Returns true if the client is a sender, false otherwise.
uint32_t eis_event_pointer_get_button(struct eis_event *event)
For an event of type EIS_EVENT_POINTER_BUTTON return the button code as defined in linux/input-event-...
void eis_seat_remove(struct eis_seat *seat)
Remove this seat and all its remaining devices.
uint32_t eis_region_get_y(struct eis_region *region)
struct eis_seat * eis_seat_ref(struct eis_seat *seat)
void eis_seat_add(struct eis_seat *seat)
Add this seat to its client and notify the client of the seat's availability.
struct eis_seat * eis_device_get_seat(struct eis_device *device)
void eis_device_resume(struct eis_device *device)
Notify the client that the capabilities are resumed and that events from the device will be processed...
void * eis_device_get_user_data(struct eis_device *eis_device)
struct eis_keymap * eis_keymap_ref(struct eis_keymap *keymap)
double eis_event_touch_get_x(struct eis_event *event)
For an event of type EIS_EVENT_TOUCH_DOWN, or EIS_EVENT_TOUCH_MOTION, return the x coordinate of the ...
enum eis_event_type eis_event_get_type(struct eis_event *event)
struct eis_client * eis_seat_get_client(struct eis_seat *eis_seat)
void eis_log_set_handler(struct eis *eis, eis_log_handler log_handler)
Change the log handler for this context.
uint32_t eis_event_property_get_permissions(struct eis_event *event)
For an event of type EIS_EVENT_CLIENT_PROPERTY, get the permissions of the property (at the time of t...
int eis_get_fd(struct eis *eis)
libeis keeps a single file descriptor for all events.
int32_t eis_event_pointer_get_scroll_discrete_y(struct eis_event *event)
For an event of type EIS_EVENT_POINTER_SCROLL_DISCRETE return the y scroll distance in fractions or m...
const char * eis_client_property_get(struct eis_client *client, const char *property)
Return the value of the given property or NULL if the property is not set.
void eis_device_keyboard_send_xkb_modifiers(struct eis_device *device, uint32_t depressed, uint32_t latched, uint32_t locked, uint32_t group)
Notify the client of the current XKB modifier state.
struct eis_device * eis_touch_get_device(struct eis_touch *touch)
see ei_touch_get_device
void eis_client_property_set_with_permissions(struct eis_client *client, const char *property, const char *value, uint32_t permission)
Change, create or delete a property.
struct eis_device * eis_keymap_get_device(struct eis_keymap *keymap)
Return the device this keymap belongs to.
void * eis_touch_get_user_data(struct eis_touch *touch)
see ei_touch_get_user_data
void eis_touch_up(struct eis_touch *touch)
see ei_touch_up
struct eis_keymap * eis_device_new_keymap(struct eis_device *device, enum eis_keymap_type type, int fd, size_t size)
Create a new keymap of the given type.
int32_t eis_event_pointer_get_scroll_discrete_x(struct eis_event *event)
For an event of type EIS_EVENT_POINTER_SCROLL_DISCRETE return the x scroll distance in fractions or m...
uint32_t eis_region_get_height(struct eis_region *region)
struct eis_seat * eis_event_get_seat(struct eis_event *event)
enum eis_keymap_type eis_keymap_get_type(struct eis_keymap *keymap)
Returns the type for this keymap.
void eis_touch_motion(struct eis_touch *touch, double x, double y)
see ei_touch_motion
void eis_device_pause(struct eis_device *device)
Notify the client that the device is paused and that no events from the client will be processed.
void eis_region_set_user_data(struct eis_region *region, void *user_data)
bool eis_event_keyboard_get_key_is_press(struct eis_event *event)
For an event of type EIS_EVENT_KEYBOARD_KEY return true if the event is a key down,...
struct eis_keymap * eis_device_keyboard_get_keymap(struct eis_device *device)
Return the keymap assigned to this device.
const char * eis_device_get_name(struct eis_device *device)
Return the name of the device.
struct eis_touch * eis_device_touch_new(struct eis_device *device)
see ei_device_touch_new
void eis_log_set_priority(struct eis *eis, enum eis_log_priority priority)
void eis_region_set_physical_scale(struct eis_region *region, double scale)
Set the physical scale for this region.
void * eis_get_user_data(struct eis *eis)
struct eis_client * eis_client_ref(struct eis_client *client)
void eis_set_user_data(struct eis *eis, void *user_data)
void eis_device_configure_name(struct eis_device *device, const char *name)
uint32_t eis_region_get_width(struct eis_region *region)
enum eis_device_type eis_device_get_type(struct eis_device *device)
void eis_client_disconnect(struct eis_client *client)
Disconnect this client.
struct eis_client * eis_event_get_client(struct eis_event *event)
struct eis * eis_unref(struct eis *eis)
void eis_device_configure_capability(struct eis_device *device, enum eis_device_capability cap)
struct eis_region * eis_device_new_region(struct eis_device *device)
Create a new region on the device of type EIS_DEVICE_TYPE_VIRTUAL with an initial refcount of 1.
eis_property_permission
A set of masks for operations permitted on properties.
Definition: libeis.h:135
const char * eis_event_property_get_value(struct eis_event *event)
For an event of type EIS_EVENT_CLIENT_PROPERTY, get the new property value (at the time of the event)...
uint32_t eis_region_get_x(struct eis_region *region)
const char * eis_event_property_get_name(struct eis_event *event)
For an event of type EIS_EVENT_CLIENT_PROPERTY, get the property name that has changed.
struct eis_device * eis_seat_new_device(struct eis_seat *seat)
Create a new device on the seat.
void eis_device_pointer_scroll_cancel(struct eis_device *device, bool cancel_x, bool cancel_y)
see ei_device_pointer_scroll_cancel
void eis_device_stop_emulating(struct eis_device *device)
see ei_device_stop_emulating
void eis_device_pointer_button(struct eis_device *device, uint32_t button, bool is_press)
see ei_device_pointer_button
double eis_event_touch_get_y(struct eis_event *event)
For an event of type EIS_EVENT_TOUCH_DOWN, or EIS_EVENT_TOUCH_MOTION, return the y coordinate of the ...
void eis_touch_down(struct eis_touch *touch, double x, double y)
see ei_touch_down
struct eis_keymap * eis_keymap_unref(struct eis_keymap *keymap)
void eis_device_keyboard_key(struct eis_device *device, uint32_t keycode, bool is_press)
see ei_device_keyboard_key
bool eis_event_pointer_get_button_is_press(struct eis_event *event)
For an event of type EIS_EVENT_POINTER_BUTTON return true if the event is a button press,...
struct eis_seat * eis_seat_unref(struct eis_seat *seat)
uint32_t eis_client_property_get_permissions(struct eis_client *client, const char *propert)
Return the permissions mask for the given property.
double eis_event_pointer_get_dy(struct eis_event *event)
For an event of type EIS_EVENT_POINTER_MOTION return the relative y movement in logical pixels or mm,...
struct eis_client * eis_client_unref(struct eis_client *client)
bool eis_event_pointer_get_scroll_stop_y(struct eis_event *event)
For an event of type EIS_EVENT_POINTER_SCROLL_STOP return whether the y axis has stopped scrolling.
void * eis_region_get_user_data(struct eis_region *region)
int eis_keymap_get_fd(struct eis_keymap *keymap)
Return a memmap-able file descriptor pointing to the keymap used by the device.
void * eis_seat_get_user_data(struct eis_seat *eis_seat)
struct eis_device * eis_event_get_device(struct eis_event *event)
Return the device from this event.
int eis_setup_backend_socket(struct eis *ctx, const char *path)
Initialize the context with a UNIX socket name.
double eis_event_pointer_get_absolute_y(struct eis_event *event)
For an event of type EIS_EVENT_POINTER_MOTION_ABSOLUTE return the y position in logical pixels or mm,...
void eis_device_pointer_scroll(struct eis_device *device, double x, double y)
see ei_device_pointer_scroll
double eis_event_pointer_get_absolute_x(struct eis_event *event)
For an event of type EIS_EVENT_POINTER_MOTION_ABSOLUTE return the x position in logical pixels or mm,...
int eis_setup_backend_fd(struct eis *ctx)
Initialize the context that can take pre-configured sockets.
struct eis_region * eis_region_unref(struct eis_region *region)
uint32_t eis_device_get_width(struct eis_device *device)
Return the width in mm of a device of type EIS_DEVICE_TYPE_PHYSICAL, or zero otherwise.
bool eis_event_pointer_get_scroll_stop_x(struct eis_event *event)
For an event of type EIS_EVENT_POINTER_SCROLL_STOP return whether the x axis has stopped scrolling.
bool eis_seat_has_capability(struct eis_seat *seat, enum eis_device_capability cap)
void eis_dispatch(struct eis *eis)
Main event dispatching function.
void eis_keymap_set_user_data(struct eis_keymap *eis_keymap, void *user_data)
void eis_seat_configure_capability(struct eis_seat *seat, enum eis_device_capability cap)
Allow a capability on the seat.
enum eis_log_priority eis_log_get_priority(const struct eis *eis)
void eis_seat_set_user_data(struct eis_seat *eis_seat, void *user_data)
struct eis_event * eis_peek_event(struct eis *eis)
Returns the next event in the internal event queue (or NULL) without removing that event from the que...
struct eis_seat * eis_client_new_seat(struct eis_client *client, const char *name)
Create a new logical seat with a given name.
void eis_device_add(struct eis_device *device)
Add this device to its seat and notify the client of the device's availability.
const char * eis_client_get_name(struct eis_client *client)
Return the name set by this client.
double eis_event_pointer_get_dx(struct eis_event *event)
For an event of type EIS_EVENT_POINTER_MOTION return the relative x movement in logical pixels or mm,...
void(* eis_log_handler)(struct eis *eis, enum eis_log_priority priority, const char *file, int lineno, const char *func, const char *message, bool is_continuation)
The log handler for library logging.
Definition: libeis.h:300
bool eis_event_seat_has_capability(struct eis_event *event, enum eis_device_capability cap)
For an event of type EIS_EVENT_SEAT_BIND, return the capabilities requested by the client.
void eis_keymap_add(struct eis_keymap *keymap)
Set the keymap on the device.
@ EIS_DEVICE_TYPE_VIRTUAL
Definition: libeis.h:117
@ EIS_DEVICE_TYPE_PHYSICAL
Definition: libeis.h:118
@ EIS_DEVICE_CAP_POINTER
Definition: libeis.h:122
@ EIS_DEVICE_CAP_TOUCH
Definition: libeis.h:125
@ EIS_DEVICE_CAP_KEYBOARD
Definition: libeis.h:124
@ EIS_DEVICE_CAP_POINTER_ABSOLUTE
Definition: libeis.h:123
@ EIS_EVENT_TOUCH_UP
Event for a single touch released from the device's logical surface.
Definition: libeis.h:265
@ EIS_EVENT_POINTER_SCROLL_CANCEL
An ongoing scroll sequence was cancelled.
Definition: libeis.h:242
@ EIS_EVENT_DEVICE_START_EMULATING
The client is about to send events for a device.
Definition: libeis.h:208
@ EIS_EVENT_CLIENT_DISCONNECT
The client has disconnected, any pending requests for this client should be discarded.
Definition: libeis.h:160
@ EIS_EVENT_DEVICE_CLOSED
The client no longer listens to events from this device.
Definition: libeis.h:178
@ EIS_EVENT_TOUCH_DOWN
Event for a single touch set down on the device's logical surface.
Definition: libeis.h:260
@ EIS_EVENT_POINTER_MOTION
A relative motion event with delta coordinates in logical pixels or mm, depending on the device type.
Definition: libeis.h:220
@ EIS_EVENT_POINTER_SCROLL_DISCRETE
A vertical and/or horizontal scroll event with a discrete range in logical scroll steps,...
Definition: libeis.h:247
@ EIS_EVENT_CLIENT_PROPERTY
A client property has been added, changed, or deleted.
Definition: libeis.h:165
@ EIS_EVENT_FRAME
"Hardware" frame event.
Definition: libeis.h:190
@ EIS_EVENT_DEVICE_STOP_EMULATING
Stop emulating events on this device.
Definition: libeis.h:212
@ EIS_EVENT_TOUCH_MOTION
Event for a single currently-down touch changing position (or other properties).
Definition: libeis.h:270
@ EIS_EVENT_CLIENT_CONNECT
A client has connected.
Definition: libeis.h:155
@ EIS_EVENT_KEYBOARD_KEY
A key press or release event.
Definition: libeis.h:252
@ EIS_EVENT_POINTER_SCROLL_STOP
An ongoing scroll sequence stopped.
Definition: libeis.h:238
@ EIS_EVENT_POINTER_SCROLL
A vertical and/or horizontal scroll event with logical-pixels or mm precision, depending on the devic...
Definition: libeis.h:234
@ EIS_EVENT_SEAT_BIND
The client wants to bind or unbind a capability on this seat.
Definition: libeis.h:172
@ EIS_EVENT_POINTER_MOTION_ABSOLUTE
An absolute motion event with absolute position within the device's regions or size,...
Definition: libeis.h:225
@ EIS_EVENT_POINTER_BUTTON
A button press or release event.
Definition: libeis.h:229
@ EIS_KEYMAP_TYPE_XKB
Definition: libeis.h:145
@ EIS_LOG_PRIORITY_INFO
Definition: libeis.h:281
@ EIS_LOG_PRIORITY_WARNING
Definition: libeis.h:282
@ EIS_LOG_PRIORITY_ERROR
Definition: libeis.h:283
@ EIS_LOG_PRIORITY_DEBUG
Definition: libeis.h:280
@ EIS_PROPERTY_PERM_DELETE
Definition: libeis.h:139
@ EIS_PROPERTY_PERM_ALL
Definition: libeis.h:141
@ EIS_PROPERTY_PERM_READ
Definition: libeis.h:137
@ EIS_PROPERTY_PERM_WRITE
Definition: libeis.h:138
@ EIS_PROPERTY_PERM_NONE
Definition: libeis.h:136
Regions are only available on devices of type EIS_DEVICE_TYPE_VIRTUAL.
Definition: libeis.h:64