libinput.h
Go to the documentation of this file.
1 /*
2  * Copyright © 2013 Jonas Ådahl
3  * Copyright © 2013-2015 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 #ifndef LIBINPUT_H
26 #define LIBINPUT_H
27 
28 #ifdef __cplusplus
29 extern "C" {
30 #endif
31 
32 #include <stdlib.h>
33 #include <stdint.h>
34 #include <stdarg.h>
35 #include <libudev.h>
36 
37 #define LIBINPUT_ATTRIBUTE_PRINTF(_format, _args) \
38  __attribute__ ((format (printf, _format, _args)))
39 #define LIBINPUT_ATTRIBUTE_DEPRECATED __attribute__ ((deprecated))
40 
48 struct libinput;
49 
58 
68 
77 
97 
109 
117 
125 
134 
146 
160 
173 
183 };
184 
199 };
200 
210 };
211 
221 };
222 
232 };
233 
249 };
250 
277 };
278 
294 };
295 
311 };
312 
347 };
348 
368 };
369 
384 };
385 
414 
430 int
432 
457  unsigned int index);
458 
471 unsigned int
473 
491 unsigned int
493 
513 unsigned int
515 
528 int
530  unsigned int button);
531 
544 int
546  unsigned int ring);
547 
560 int
562  unsigned int strip);
563 
582 int
584  unsigned int button);
585 
599  struct libinput_tablet_pad_mode_group *group);
600 
614  struct libinput_tablet_pad_mode_group *group);
615 
629 void
631  struct libinput_tablet_pad_mode_group *group,
632  void *user_data);
633 
645 void *
647  struct libinput_tablet_pad_mode_group *group);
648 
663 };
664 
679 
695 };
696 
705 struct libinput_event_switch;
706 
719 
729 
735 
737 
742 
752 
843 
867 
875 
888 
895 
900 };
901 
918 void
920 
930 
939 struct libinput *
941 
955 struct libinput_device *
957 
968 struct libinput_event_pointer *
970 
983 
994 struct libinput_event_touch *
996 
1014 struct libinput_event_gesture *
1016 
1031 
1044 
1057 struct libinput_event_switch *
1059 
1073 
1079 struct libinput_event *
1081 
1097 uint32_t
1099 
1108 uint64_t
1110 
1116 uint32_t
1118 
1124 enum libinput_key_state
1126 
1132 struct libinput_event *
1134 
1147 uint32_t
1149  struct libinput_event_keyboard *event);
1150 
1166 uint32_t
1168 
1177 uint64_t
1179 
1198 double
1200 
1219 double
1221 
1243 double
1245  struct libinput_event_pointer *event);
1246 
1268 double
1270  struct libinput_event_pointer *event);
1271 
1287 double
1289 
1305 double
1307 
1325 double
1327  struct libinput_event_pointer *event,
1328  uint32_t width);
1329 
1347 double
1349  struct libinput_event_pointer *event,
1350  uint32_t height);
1351 
1364 uint32_t
1366 
1381 
1395 uint32_t
1397  struct libinput_event_pointer *event);
1398 
1416 int
1418  enum libinput_pointer_axis axis);
1419 
1444 double
1446  enum libinput_pointer_axis axis);
1447 
1494 
1511 double
1513  enum libinput_pointer_axis axis);
1514 
1520 struct libinput_event *
1522 
1537 uint32_t
1539 
1548 uint64_t
1550 
1570 int32_t
1572 
1592 int32_t
1594 
1612 double
1614 
1632 double
1634 
1652 double
1654  uint32_t width);
1655 
1673 double
1675  uint32_t height);
1676 
1682 struct libinput_event *
1684 
1707 uint32_t
1708 libinput_event_gesture_get_time(struct libinput_event_gesture *event);
1709 
1718 uint64_t
1719 libinput_event_gesture_get_time_usec(struct libinput_event_gesture *event);
1720 
1726 struct libinput_event *
1727 libinput_event_gesture_get_base_event(struct libinput_event_gesture *event);
1728 
1744 int
1745 libinput_event_gesture_get_finger_count(struct libinput_event_gesture *event);
1746 
1761 int
1762 libinput_event_gesture_get_cancelled(struct libinput_event_gesture *event);
1763 
1779 double
1780 libinput_event_gesture_get_dx(struct libinput_event_gesture *event);
1781 
1797 double
1798 libinput_event_gesture_get_dy(struct libinput_event_gesture *event);
1799 
1818 double
1820  struct libinput_event_gesture *event);
1821 
1840 double
1842  struct libinput_event_gesture *event);
1843 
1870 double
1871 libinput_event_gesture_get_scale(struct libinput_event_gesture *event);
1872 
1894 double
1895 libinput_event_gesture_get_angle_delta(struct libinput_event_gesture *event);
1896 
1921 struct libinput_event *
1923 
1943 int
1945  struct libinput_event_tablet_tool *event);
1946 
1966 int
1968  struct libinput_event_tablet_tool *event);
1969 
1989 int
1991  struct libinput_event_tablet_tool *event);
1992 
2014 int
2016  struct libinput_event_tablet_tool *event);
2017 
2037 int
2039  struct libinput_event_tablet_tool *event);
2040 
2060 int
2062  struct libinput_event_tablet_tool *event);
2082 int
2084  struct libinput_event_tablet_tool *event);
2104 int
2106  struct libinput_event_tablet_tool *event);
2107 
2125 int
2127  struct libinput_event_tablet_tool *event);
2128 
2146 int
2148  struct libinput_event_tablet_tool *event);
2149 
2169 int
2171  struct libinput_event_tablet_tool *event);
2172 
2189 double
2191 
2208 double
2210 
2227 double
2229 
2246 double
2248 
2262 double
2264 
2278 double
2280 
2298 double
2300 
2318 double
2320 
2340 double
2342 
2358 double
2360 
2376 double
2378 
2394 double
2396 
2407 double
2409  struct libinput_event_tablet_tool *event);
2410 
2423 int
2425  struct libinput_event_tablet_tool *event);
2426 
2446 double
2448  uint32_t width);
2449 
2469 double
2471  uint32_t height);
2472 
2495 struct libinput_tablet_tool *
2497 
2526 
2542 
2557 uint32_t
2559 
2575 
2591 uint32_t
2593 
2605 uint32_t
2607 
2619 uint64_t
2621 
2647 
2667 uint64_t
2669 
2683 struct libinput_tablet_tool *
2685 
2700 struct libinput_tablet_tool *
2702 
2713 int
2715 
2726 int
2728 
2739 int
2741 
2752 int
2754 
2765 int
2767 
2779 int
2781 
2792 int
2794 
2808 int
2810  uint32_t code);
2811 
2828 int
2830 
2867 uint64_t
2869 
2882 void *
2884 
2895 void
2897  void *user_data);
2898 
2915 struct libinput_event *
2917 
2940 double
2942 
2959 unsigned int
2961 
2980 
3003 double
3005 
3022 unsigned int
3024 
3043 
3064 uint32_t
3066 
3083 
3102 uint32_t
3104 
3119 enum libinput_key_state
3121 
3154 unsigned int
3156 
3182 
3194 uint32_t
3196 
3208 uint64_t
3210 
3232 enum libinput_switch
3234 
3252 
3260 struct libinput_event *
3262 
3274 uint32_t
3276 
3288 uint64_t
3290 
3318  int (*open_restricted)(const char *path, int flags, void *user_data);
3326  void (*close_restricted)(int fd, void *user_data);
3327 };
3328 
3342 struct libinput *
3343 libinput_udev_create_context(const struct libinput_interface *interface,
3344  void *user_data,
3345  struct udev *udev);
3346 
3368 int
3370  const char *seat_id);
3371 
3391 struct libinput *
3392 libinput_path_create_context(const struct libinput_interface *interface,
3393  void *user_data);
3394 
3415 struct libinput_device *
3417  const char *path);
3418 
3437 void
3439 
3448 int
3450 
3468 int
3470 
3482 struct libinput_event *
3484 
3498 
3510 void
3512  void *user_data);
3513 
3524 void *
3526 
3538 int
3540 
3550 void
3552 
3562 struct libinput *
3563 libinput_ref(struct libinput *libinput);
3564 
3596 struct libinput *
3598 
3614 void
3616  enum libinput_log_priority priority);
3617 
3634 
3649 typedef void (*libinput_log_handler)(struct libinput *libinput,
3650  enum libinput_log_priority priority,
3651  const char *format, va_list args)
3653 
3669 void
3670 libinput_log_set_handler(struct libinput *libinput,
3671  libinput_log_handler log_handler);
3672 
3694 struct libinput_seat *
3695 libinput_seat_ref(struct libinput_seat *seat);
3696 
3708 struct libinput_seat *
3709 libinput_seat_unref(struct libinput_seat *seat);
3710 
3722 void
3723 libinput_seat_set_user_data(struct libinput_seat *seat, void *user_data);
3724 
3734 void *
3736 
3745 struct libinput *
3747 
3764 const char *
3766 
3776 const char *
3778 
3794 struct libinput_device *
3795 libinput_device_ref(struct libinput_device *device);
3796 
3808 struct libinput_device *
3809 libinput_device_unref(struct libinput_device *device);
3810 
3822 void
3823 libinput_device_set_user_data(struct libinput_device *device, void *user_data);
3824 
3834 void *
3836 
3845 struct libinput *
3847 
3908 struct libinput_device_group *
3910 
3922 const char *
3924 
3938 const char *
3940 
3949 unsigned int
3951 
3960 unsigned int
3962 
3982 const char *
3984 
4005 struct libinput_seat *
4007 
4033 int
4035  const char *name);
4036 
4056 struct udev_device *
4058 
4069 void
4071  enum libinput_led leds);
4072 
4080 int
4082  enum libinput_device_capability capability);
4083 
4098 int
4100  double *width,
4101  double *height);
4102 
4115 int
4116 libinput_device_pointer_has_button(struct libinput_device *device, uint32_t code);
4117 
4130 int
4132  uint32_t code);
4133 
4147 int
4149 
4164 int
4166  enum libinput_switch sw);
4167 
4182 int
4184 
4199 int
4201 
4216 int
4218 
4233 int
4235  uint32_t code);
4236 
4249 struct libinput_device_group *
4251 
4265 struct libinput_device_group *
4267 
4279 void
4281  void *user_data);
4282 
4293 void *
4295 
4347 };
4348 
4358 const char *
4360 
4369 };
4370 
4386 int
4388 
4411  enum libinput_config_tap_state enable);
4412 
4431 
4448 
4459 };
4460 
4494 
4516 
4538 
4559 };
4560 
4581  enum libinput_config_drag_state enable);
4582 
4600 
4620 
4629 };
4630 
4655  enum libinput_config_drag_lock_state enable);
4656 
4676 
4699 
4712 int
4714 
4766  const float matrix[6]);
4767 
4784 int
4786  float matrix[6]);
4787 
4808 int
4810  float matrix[6]);
4811 
4845 };
4846 
4861 uint32_t
4863 
4894  uint32_t mode);
4895 
4915 uint32_t
4917 
4931 uint32_t
4933 
4947 int
4949 
4972  double speed);
4973 
4989 double
4991 
5006 double
5008 
5028 
5034 };
5035 
5048 uint32_t
5050 
5066  enum libinput_config_accel_profile mode);
5067 
5081 
5095 
5125 int
5127 
5144  int enable);
5158 int
5160 
5174 int
5176 
5190 int
5192 
5218  int left_handed);
5219 
5233 int
5235 
5249 int
5251 
5273 };
5274 
5290 uint32_t
5292 
5315  enum libinput_config_click_method method);
5333 
5351 
5366 };
5367 
5388 int
5390  struct libinput_device *device);
5391 
5416  struct libinput_device *device,
5418 
5444  struct libinput_device *device);
5445 
5472  struct libinput_device *device);
5473 
5501 };
5502 
5520 uint32_t
5522 
5549  enum libinput_config_scroll_method method);
5550 
5569 
5588 
5626  uint32_t button);
5627 
5652 uint32_t
5654 
5675 uint32_t
5677 
5681 };
5682 
5707 
5732 
5752 
5761 };
5762 
5778 int
5780 
5804  enum libinput_config_dwt_state enable);
5805 
5823 
5841 
5856 int
5858 
5893  unsigned int degrees_cw);
5894 
5911 unsigned int
5913 
5930 unsigned int
5932 
5933 #ifdef __cplusplus
5934 }
5935 #endif
5936 #endif /* LIBINPUT_H */