libei  1.2.0
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 
124 struct eis;
128 struct eis_client;
132 struct eis_device;
136 struct eis_seat;
140 struct eis_event;
144 struct eis_keymap;
148 struct eis_touch;
149 
178 struct eis_region;
179 
205 };
206 
218 };
219 
226 };
227 
244 
251 
257 
269 
291 
292  /* These events are only generated on a receiving EIS context */
293 
326 
331 
349 };
350 
356 const char*
358 
362 struct eis *
363 eis_new(void *user_data);
364 
373 };
374 
378 struct eis_log_context;
379 
384 unsigned int
385 eis_log_context_get_line(struct eis_log_context *ctx);
386 
391 const char *
392 eis_log_context_get_file(struct eis_log_context *ctx);
393 
398 const char *
399 eis_log_context_get_func(struct eis_log_context *ctx);
400 
413 typedef void (*eis_log_handler)(struct eis *eis,
414  enum eis_log_priority priority,
415  const char *message,
416  struct eis_log_context *ctx);
427 void
428 eis_log_set_handler(struct eis *eis, eis_log_handler log_handler);
429 
433 void
434 eis_log_set_priority(struct eis *eis, enum eis_log_priority priority);
435 
439 enum eis_log_priority
440 eis_log_get_priority(const struct eis *eis);
441 
450 typedef uint64_t (*eis_clock_now_func)(struct eis *eis);
451 
457 void
458 eis_clock_set_now_func(struct eis *, eis_clock_now_func func);
459 
460 struct eis *
461 eis_ref(struct eis *eis);
462 
463 struct eis *
464 eis_unref(struct eis *eis);
465 
466 void *
467 eis_get_user_data(struct eis *eis);
468 
469 void
470 eis_set_user_data(struct eis *eis, void *user_data);
471 
476 int
477 eis_setup_backend_socket(struct eis *ctx, const char *path);
478 
482 int
483 eis_setup_backend_fd(struct eis *ctx);
484 
490 int
491 eis_backend_fd_add_client(struct eis *ctx);
492 
499 int
500 eis_get_fd(struct eis *eis);
501 
511 void
512 eis_dispatch(struct eis *eis);
513 
524 struct eis_event *
525 eis_get_event(struct eis *eis);
526 
543 struct eis_event *
544 eis_peek_event(struct eis *eis);
545 
555 struct eis_event *
556 eis_event_unref(struct eis_event *event);
557 
558 enum eis_event_type
559 eis_event_get_type(struct eis_event *event);
560 
561 struct eis_client *
562 eis_event_get_client(struct eis_event *event);
563 
564 struct eis_seat *
565 eis_event_get_seat(struct eis_event *event);
566 
574 bool
576 
583 struct eis_device *
584 eis_event_get_device(struct eis_event *event);
585 
595 uint64_t
596 eis_event_get_time(struct eis_event *event);
597 
598 
599 
600 struct eis_client *
601 eis_client_ref(struct eis_client *client);
602 
603 struct eis_client *
604 eis_client_unref(struct eis_client *client);
605 
606 void *
608 
609 void
610 eis_client_set_user_data(struct eis_client *eis_client, void *user_data);
611 
612 struct eis*
613 eis_client_get_context(struct eis_client *client);
614 
620 bool
621 eis_client_is_sender(struct eis_client *client);
622 
627 const char *
628 eis_client_get_name(struct eis_client *client);
629 
639 void
640 eis_client_connect(struct eis_client *client);
641 
650 void
651 eis_client_disconnect(struct eis_client *client);
652 
665 struct eis_seat *
666 eis_client_new_seat(struct eis_client *client, const char *name);
667 
671 struct eis_seat *
672 eis_seat_ref(struct eis_seat *seat);
673 
677 struct eis_seat *
678 eis_seat_unref(struct eis_seat *seat);
679 
683 struct eis_client *
685 
689 const char *
691 
695 void *
697 
701 void
702 eis_seat_set_user_data(struct eis_seat *eis_seat, void *user_data);
703 
707 bool
708 eis_seat_has_capability(struct eis_seat *seat,
709  enum eis_device_capability cap);
710 
723 void
725  enum eis_device_capability cap);
726 
733 void
734 eis_seat_add(struct eis_seat *seat);
735 
741 void
742 eis_seat_remove(struct eis_seat *seat);
743 
747 struct eis *
748 eis_seat_get_context(struct eis_seat *seat);
749 
753 struct eis *
754 eis_device_get_context(struct eis_device *device);
755 
759 struct eis_client *
760 eis_device_get_client(struct eis_device *device);
761 
765 struct eis_seat *
766 eis_device_get_seat(struct eis_device *device);
767 
771 struct eis_device *
772 eis_device_ref(struct eis_device *device);
773 
777 struct eis_device *
778 eis_device_unref(struct eis_device *device);
779 
783 void *
785 
789 void
790 eis_device_set_user_data(struct eis_device *eis_device, void *user_data);
791 
799 const char *
800 eis_device_get_name(struct eis_device *device);
801 
805 bool
807  enum eis_device_capability cap);
808 
815 uint32_t
816 eis_device_get_width(struct eis_device *device);
817 
824 uint32_t
825 eis_device_get_height(struct eis_device *device);
826 
846 struct eis_device *
847 eis_seat_new_device(struct eis_seat *seat);
848 
857 void
858 eis_device_configure_type(struct eis_device *device, enum eis_device_type type);
859 
863 enum eis_device_type
864 eis_device_get_type(struct eis_device *device);
865 
869 void
870 eis_device_configure_name(struct eis_device *device, const char *name);
871 
875 void
877 
892 void
893 eis_device_configure_size(struct eis_device *device, uint32_t width, uint32_t height);
894 
907 struct eis_region *
908 eis_device_new_region(struct eis_device *device);
909 
915 void
916 eis_region_set_size(struct eis_region *region, uint32_t w, uint32_t h);
917 
923 void
924 eis_region_set_offset(struct eis_region *region, uint32_t x, uint32_t y);
925 
938 void
939 eis_region_set_physical_scale(struct eis_region *region, double scale);
940 
964 void
965 eis_region_set_mapping_id(struct eis_region *region, const char *mapping_id);
966 
985 const char *
986 eis_region_get_mapping_id(struct eis_region *region);
987 
996 void
997 eis_region_add(struct eis_region *region);
998 
1018 struct eis_region *
1019 eis_device_get_region(struct eis_device *device, size_t index);
1020 
1029 struct eis_region *
1030 eis_device_get_region_at(struct eis_device *device, double x, double y);
1031 
1035 struct eis_region *
1036 eis_region_ref(struct eis_region *region);
1037 
1041 struct eis_region *
1042 eis_region_unref(struct eis_region *region);
1043 
1047 void *
1048 eis_region_get_user_data(struct eis_region *region);
1049 
1053 void
1054 eis_region_set_user_data(struct eis_region *region, void *user_data);
1055 
1059 uint32_t
1060 eis_region_get_x(struct eis_region *region);
1061 
1065 uint32_t
1066 eis_region_get_y(struct eis_region *region);
1067 
1071 uint32_t
1072 eis_region_get_width(struct eis_region *region);
1073 
1077 uint32_t
1078 eis_region_get_height(struct eis_region *region);
1079 
1083 double
1085 
1091 bool
1092 eis_region_contains(struct eis_region *region, double x, double y);
1093 
1103 void
1104 eis_device_add(struct eis_device *device);
1105 
1113 void
1114 eis_device_remove(struct eis_device *device);
1115 
1136 void
1137 eis_device_pause(struct eis_device *device);
1138 
1147 void
1148 eis_device_resume(struct eis_device *device);
1149 
1169 struct eis_keymap *
1170 eis_device_new_keymap(struct eis_device *device,
1171  enum eis_keymap_type type, int fd, size_t size);
1172 
1188 void
1189 eis_keymap_add(struct eis_keymap *keymap);
1190 
1195 size_t
1196 eis_keymap_get_size(struct eis_keymap *keymap);
1197 
1204 enum eis_keymap_type
1205 eis_keymap_get_type(struct eis_keymap *keymap);
1206 
1214 int
1215 eis_keymap_get_fd(struct eis_keymap *keymap);
1216 
1220 struct eis_keymap *
1221 eis_keymap_ref(struct eis_keymap *keymap);
1222 
1226 struct eis_keymap *
1227 eis_keymap_unref(struct eis_keymap *keymap);
1228 
1232 void *
1234 
1238 void
1239 eis_keymap_set_user_data(struct eis_keymap *eis_keymap, void *user_data);
1240 
1246 struct eis_device *
1247 eis_keymap_get_device(struct eis_keymap *keymap);
1248 
1256 struct eis_keymap *
1258 
1264 void
1266  uint32_t depressed,
1267  uint32_t latched,
1268  uint32_t locked,
1269  uint32_t group);
1270 
1276 void
1277 eis_device_start_emulating(struct eis_device *device, uint32_t sequence);
1278 
1284 void
1285 eis_device_stop_emulating(struct eis_device *device);
1286 
1292 void
1293 eis_device_frame(struct eis_device *device, uint64_t time);
1294 
1300 void
1301 eis_device_pointer_motion(struct eis_device *device, double x, double y);
1302 
1308 void
1310  double x, double y);
1311 
1317 void
1318 eis_device_button_button(struct eis_device *device,
1319  uint32_t button, bool is_press);
1320 
1326 void
1327 eis_device_scroll_delta(struct eis_device *device, double x, double y);
1328 
1334 void
1335 eis_device_scroll_discrete(struct eis_device *device, int32_t x, int32_t y);
1336 
1342 void
1343 eis_device_scroll_stop(struct eis_device *device, bool stop_x, bool stop_y);
1344 
1350 void
1351 eis_device_scroll_cancel(struct eis_device *device, bool cancel_x, bool cancel_y);
1352 
1358 void
1359 eis_device_keyboard_key(struct eis_device *device, uint32_t keycode, bool is_press);
1360 
1366 struct eis_touch *
1367 eis_device_touch_new(struct eis_device *device);
1368 
1374 void
1375 eis_touch_down(struct eis_touch *touch, double x, double y);
1376 
1382 void
1383 eis_touch_motion(struct eis_touch *touch, double x, double y);
1384 
1390 void
1391 eis_touch_up(struct eis_touch *touch);
1392 
1398 struct eis_touch *
1399 eis_touch_ref(struct eis_touch *touch);
1400 
1406 struct eis_touch *
1407 eis_touch_unref(struct eis_touch *touch);
1408 
1414 void
1415 eis_touch_set_user_data(struct eis_touch *touch, void *user_data);
1416 
1422 void *
1423 eis_touch_get_user_data(struct eis_touch *touch);
1424 
1430 struct eis_device *
1431 eis_touch_get_device(struct eis_touch *touch);
1432 
1441 uint32_t
1443 
1450 double
1451 eis_event_pointer_get_dx(struct eis_event *event);
1452 
1459 double
1460 eis_event_pointer_get_dy(struct eis_event *event);
1461 
1468 double
1470 
1477 double
1479 
1486 uint32_t
1487 eis_event_button_get_button(struct eis_event *event);
1488 
1495 bool
1497 
1504 double
1505 eis_event_scroll_get_dx(struct eis_event *event);
1506 
1513 double
1514 eis_event_scroll_get_dy(struct eis_event *event);
1515 
1525 bool
1526 eis_event_scroll_get_stop_x(struct eis_event *event);
1527 
1537 bool
1538 eis_event_scroll_get_stop_y(struct eis_event *event);
1539 
1546 int32_t
1548 
1555 int32_t
1557 
1564 uint32_t
1565 eis_event_keyboard_get_key(struct eis_event *event);
1566 
1573 bool
1575 
1588 uint32_t
1589 eis_event_touch_get_id(struct eis_event *event);
1590 
1598 double
1599 eis_event_touch_get_x(struct eis_event *event);
1600 
1608 double
1609 eis_event_touch_get_y(struct eis_event *event);
1610 
1618 uint64_t
1619 eis_now(struct eis *eis);
1620 
1625 #ifdef __cplusplus
1626 }
1627 #endif
void eis_touch_up(struct eis_touch *touch)
see ei_touch_up
An ongoing scroll sequence was cancelled.
Definition: libeis.h:320
A relative motion event with delta coordinates in logical pixels or mm, depending on the device type...
Definition: libeis.h:298
The client is about to send events for a device.
Definition: libeis.h:286
void * eis_region_get_user_data(struct eis_region *region)
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...
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...
struct eis_keymap * eis_keymap_ref(struct eis_keymap *keymap)
int32_t eis_event_scroll_get_discrete_dy(struct eis_event *event)
For an event of type EIS_EVENT_SCROLL_DISCRETE return the y scroll distance in fractions or multiples...
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, false for a release.
double eis_event_scroll_get_dx(struct eis_event *event)
For an event of type EIS_EVENT_SCROLL_DELTA return the x scroll distance in logical pixels or mm...
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.
void eis_device_configure_type(struct eis_device *device, enum eis_device_type type)
Set the device type for this device.
void eis_device_keyboard_key(struct eis_device *device, uint32_t keycode, bool is_press)
see ei_device_keyboard_key
void eis_touch_down(struct eis_touch *touch, double x, double y)
see ei_touch_down
struct eis_touch * eis_touch_unref(struct eis_touch *touch)
see ei_touch_unref
void eis_device_scroll_cancel(struct eis_device *device, bool cancel_x, bool cancel_y)
see ei_device_scroll_cancel
struct eis * eis_seat_get_context(struct eis_seat *seat)
enum eis_device_type eis_device_get_type(struct eis_device *device)
void eis_client_connect(struct eis_client *client)
Allow connection from the client.
eis_keymap_type
Definition: libeis.h:224
The client wants to bind or unbind a capability on this seat.
Definition: libeis.h:250
void eis_seat_configure_capability(struct eis_seat *seat, enum eis_device_capability cap)
Allow a capability on the seat.
void eis_device_scroll_stop(struct eis_device *device, bool stop_x, bool stop_y)
see ei_device_scroll_stop
bool eis_event_scroll_get_stop_x(struct eis_event *event)
For an event of type EIS_EVENT_SCROLL_STOP return whether the x axis has stopped scrolling.
struct eis_client * eis_client_ref(struct eis_client *client)
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 ...
void eis_keymap_set_user_data(struct eis_keymap *eis_keymap, void *user_data)
struct eis_seat * eis_seat_ref(struct eis_seat *seat)
bool eis_client_is_sender(struct eis_client *client)
Returns true if the client is a sender, false otherwise.
struct eis_seat * eis_client_new_seat(struct eis_client *client, const char *name)
Create a new logical seat with a given name.
int eis_backend_fd_add_client(struct eis *ctx)
Add a new client to a context set up with eis_setup_backend_fd().
void eis_log_set_handler(struct eis *eis, eis_log_handler log_handler)
Change the log handler for this context.
struct eis * eis_new(void *user_data)
Create a new libeis context with a refcount of 1.
Definition: libeis.h:370
bool eis_seat_has_capability(struct eis_seat *seat, enum eis_device_capability cap)
void eis_device_frame(struct eis_device *device, uint64_t time)
see ei_device_frame
struct eis_region * eis_device_get_region(struct eis_device *device, size_t index)
Obtain a region from the device.
struct eis_device * eis_device_ref(struct eis_device *device)
void(* eis_log_handler)(struct eis *eis, enum eis_log_priority priority, const char *message, struct eis_log_context *ctx)
The log handler for library logging.
Definition: libeis.h:413
void eis_region_set_mapping_id(struct eis_region *region, const char *mapping_id)
Attach a unique identifier representing an external resource to this region.
struct eis_region * eis_region_ref(struct eis_region *region)
struct eis_touch * eis_device_touch_new(struct eis_device *device)
see ei_device_touch_new
struct eis_device * eis_event_get_device(struct eis_event *event)
Return the device from this event.
bool eis_event_button_get_is_press(struct eis_event *event)
For an event of type EIS_EVENT_BUTTON_BUTTON return true if the event is a button press...
struct eis_seat * eis_device_get_seat(struct eis_device *device)
Definition: libeis.h:214
void eis_region_set_user_data(struct eis_region *region, void *user_data)
Definition: libeis.h:216
void * eis_keymap_get_user_data(struct eis_keymap *eis_keymap)
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.
struct eis * eis_unref(struct eis *eis)
const char * eis_seat_get_name(struct eis_seat *eis_seat)
void eis_device_button_button(struct eis_device *device, uint32_t button, bool is_press)
see ei_device_button_button
Definition: libeis.h:372
uint32_t eis_event_emulating_get_sequence(struct eis_event *event)
For an event of type EIS_EVENT_DEVICE_START_EMULATING, return the sequence number set by the ei clien...
void eis_device_configure_capability(struct eis_device *device, enum eis_device_capability cap)
Event for a single touch set down on the device's logical surface.
Definition: libeis.h:338
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...
Event for a single currently-down touch changing position (or other properties).
Definition: libeis.h:348
void eis_device_scroll_discrete(struct eis_device *device, int32_t x, int32_t y)
see ei_device_scroll_discrete
enum eis_keymap_type eis_keymap_get_type(struct eis_keymap *keymap)
Returns the type for this keymap.
void eis_device_configure_name(struct eis_device *device, const char *name)
struct eis_device * eis_device_unref(struct eis_device *device)
Definition: libeis.h:369
void eis_clock_set_now_func(struct eis *, eis_clock_now_func func)
Override the function that returns the current time eis_now().
struct eis * eis_device_get_context(struct eis_device *device)
A vertical and/or horizontal scroll event with a discrete range in logical scroll steps...
Definition: libeis.h:325
struct eis_event * eis_event_unref(struct eis_event *event)
Release resources associated with this event.
enum eis_log_priority eis_log_get_priority(const struct eis *eis)
void eis_device_remove(struct eis_device *device)
Remove the device.
uint64_t eis_event_get_time(struct eis_event *event)
Return the time for the event of type EIS_EVENT_FRAME in microseconds.
Definition: libeis.h:140
void eis_region_set_physical_scale(struct eis_region *region, double scale)
Set the physical scale for this region.
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...
void eis_device_start_emulating(struct eis_device *device, uint32_t sequence)
see ei_device_start_emulating
void eis_seat_add(struct eis_seat *seat)
Add this seat to its client and notify the client of the seat's availability.
A vertical and/or horizontal scroll event with logical-pixels or mm precision, depending on the devic...
Definition: libeis.h:312
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_touch * eis_touch_ref(struct eis_touch *touch)
see ei_touch_ref
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...
eis_device_capability
Definition: libeis.h:211
An ongoing scroll sequence stopped.
Definition: libeis.h:316
int eis_setup_backend_fd(struct eis *ctx)
Initialize the context that can take pre-configured sockets.
void eis_device_set_user_data(struct eis_device *eis_device, void *user_data)
Definition: libeis.h:203
Definition: libeis.h:136
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...
double eis_event_scroll_get_dy(struct eis_event *event)
For an event of type EIS_EVENT_SCROLL_DELTA return the y scroll distance in logical pixels or mm...
struct eis_region * eis_device_get_region_at(struct eis_device *device, double x, double y)
Return the region that contains the given point x/y (in desktop-wide coordinates) or NULL if the coor...
A button press or release event.
Definition: libeis.h:307
Definition: libeis.h:213
enum eis_event_type eis_event_get_type(struct eis_event *event)
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 ...
Definition: libeis.h:128
Definition: libeis.h:225
struct eis * eis_client_get_context(struct eis_client *client)
struct eis_device * eis_keymap_get_device(struct eis_keymap *keymap)
Return the device this keymap belongs to.
bool eis_device_has_capability(struct eis_device *device, enum eis_device_capability cap)
struct eis_device * eis_touch_get_device(struct eis_touch *touch)
see ei_touch_get_device
void eis_device_pointer_motion_absolute(struct eis_device *device, double x, double y)
see ei_device_pointer_motion_absolute
struct eis * eis_ref(struct eis *eis)
struct eis_device * eis_seat_new_device(struct eis_seat *seat)
Create a new device on the seat.
Definition: libeis.h:371
int eis_keymap_get_fd(struct eis_keymap *keymap)
Return a memmap-able file descriptor pointing to the keymap used by the device.
Definition: libeis.h:212
void * eis_get_user_data(struct eis *eis)
unsigned int eis_log_context_get_line(struct eis_log_context *ctx)
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_resume(struct eis_device *device)
Notify the client that the capabilities are resumed and that events from the device will be processed...
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()
void eis_device_pointer_motion(struct eis_device *device, double x, double y)
see ei_device_pointer_motion
bool eis_region_contains(struct eis_region *region, double x, double y)
const char * eis_event_type_to_string(enum eis_event_type)
This is a debugging helper to return a string of the name of the event type, or NULL if the event typ...
bool eis_event_scroll_get_stop_y(struct eis_event *event)
For an event of type EIS_EVENT_SCROLL_STOP return whether the y axis has stopped scrolling.
void eis_device_stop_emulating(struct eis_device *device)
see ei_device_stop_emulating
struct eis_client * eis_device_get_client(struct eis_device *device)
uint32_t eis_event_button_get_button(struct eis_event *event)
For an event of type EIS_EVENT_BUTTON_BUTTON return the button code as defined in linux/input-event-c...
eis_device_type
The device type determines what the device represents.
Definition: libeis.h:202
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_region * eis_region_unref(struct eis_region *region)
void eis_set_user_data(struct eis *eis, void *user_data)
void eis_device_scroll_delta(struct eis_device *device, double x, double y)
see ei_device_scroll_delta
struct eis_client * eis_client_unref(struct eis_client *client)
Definition: libeis.h:132
Regions are only available on devices of type EIS_DEVICE_TYPE_VIRTUAL.
Definition: libeis.h:148
Definition: libeis.h:144
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, return the tracking ID of the touch.
void eis_seat_set_user_data(struct eis_seat *eis_seat, void *user_data)
The client no longer listens to events from this device.
Definition: libeis.h:256
void * eis_device_get_user_data(struct eis_device *eis_device)
void * eis_client_get_user_data(struct eis_client *eis_client)
struct eis_keymap * eis_device_keyboard_get_keymap(struct eis_device *device)
Return the keymap assigned to this device.
void eis_touch_set_user_data(struct eis_touch *touch, void *user_data)
see ei_touch_set_user_data
void * eis_seat_get_user_data(struct eis_seat *eis_seat)
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.
uint64_t(* eis_clock_now_func)(struct eis *eis)
Optional override function for eis_now().
Definition: libeis.h:450
void * eis_touch_get_user_data(struct eis_touch *touch)
see ei_touch_get_user_data
A client has connected.
Definition: libeis.h:238
uint64_t eis_now(struct eis *eis)
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_dispatch(struct eis *eis)
Main event dispatching function.
size_t eis_keymap_get_size(struct eis_keymap *keymap)
Definition: libeis.h:215
Event for a single touch released from the device's logical surface.
Definition: libeis.h:343
int eis_get_fd(struct eis *eis)
libeis keeps a single file descriptor for all events.
Definition: libeis.h:124
Stop emulating events on this device, see EIS_EVENT_DEVICE_START_EMULATING.
Definition: libeis.h:290
struct eis_seat * eis_event_get_seat(struct eis_event *event)
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...
uint32_t eis_region_get_height(struct eis_region *region)
eis_log_priority
Definition: libeis.h:368
int eis_setup_backend_socket(struct eis *ctx, const char *path)
Initialize the context with a UNIX socket name.
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...
void eis_seat_remove(struct eis_seat *seat)
Remove this seat and all its remaining devices.
struct eis_keymap * eis_keymap_unref(struct eis_keymap *keymap)
const char * eis_log_context_get_func(struct eis_log_context *ctx)
const char * eis_device_get_name(struct eis_device *device)
Return the name of the device.
uint32_t eis_region_get_width(struct eis_region *region)
void eis_touch_motion(struct eis_touch *touch, double x, double y)
see ei_touch_motion
struct eis_client * eis_seat_get_client(struct eis_seat *eis_seat)
"Hardware" frame event.
Definition: libeis.h:268
void eis_client_set_user_data(struct eis_client *eis_client, void *user_data)
double eis_region_get_physical_scale(struct eis_region *region)
int32_t eis_event_scroll_get_discrete_dx(struct eis_event *event)
For an event of type EIS_EVENT_SCROLL_DISCRETE return the x scroll distance in fractions or multiples...
A key press or release event.
Definition: libeis.h:330
void eis_log_set_priority(struct eis *eis, enum eis_log_priority priority)
The client has disconnected, any pending requests for this client should be discarded.
Definition: libeis.h:243
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...
uint32_t eis_region_get_y(struct eis_region *region)
void eis_region_add(struct eis_region *region)
Add the given region to its device.
void eis_device_add(struct eis_device *device)
Add this device to its seat and notify the client of the device's availability.
struct eis_seat * eis_seat_unref(struct eis_seat *seat)
const char * eis_client_get_name(struct eis_client *client)
Return the name set by this client.
uint32_t eis_region_get_x(struct eis_region *region)
const char * eis_log_context_get_file(struct eis_log_context *ctx)
struct eis_client * eis_event_get_client(struct eis_event *event)
Definition: libeis.h:204
const char * eis_region_get_mapping_id(struct eis_region *region)
Get the unique ID for this region previously set by this caller, if any, or NULL if the client does n...
void eis_keymap_add(struct eis_keymap *keymap)
Set the keymap on the device.
eis_event_type
Definition: libeis.h:231
void eis_client_disconnect(struct eis_client *client)
Disconnect this client.
An absolute motion event with absolute position within the device's regions or size, depending on the device type.
Definition: libeis.h:303
Definition: libeis.h:217