Commit graph

16 commits

Author SHA1 Message Date
Peter Hutterer
d557a649fd Add a public plugin system to libinput
This patch adds a new API for enabling public "plugins" in libinput, in
addition to the exisitng internal ones. The API is currently limited to
specifying which paths should be loaded and whether to load them.
Public plugins are static, they are loaded before the context is initialized
and do not update after that.

If plugins are to be loaded, libinput will then run through those paths,
look up files and pass them to (future) plugins to load the actual
files.

Our debugging tools have an --enable-plugins and
--disable-plugins option that load from the default data paths
(/etc/libinput/plugins and /usr/lib{64}/libinput/plugins) and from
the $builddir/plugins directory.

Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1192>
2025-08-01 15:38:39 +10:00
Peter Hutterer
e8d24f818b util: add two macros for clearing a line
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1280>
2025-07-28 23:40:33 +00:00
Peter Hutterer
2a1095924b Run clang-format over the code
This uses the .clang-format file in the follow-up commit, but committed
prior to that to ease review of said file and various integrations.

Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1246>
2025-07-01 16:42:44 +10:00
Peter Hutterer
546debe926 Remove empty lines between closing braces
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1190>
2025-04-16 11:44:09 +10:00
Peter Hutterer
4548a37511 tools: actually parse options in libinput-debug-tablets
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1009>
2024-06-10 15:09:19 +00:00
Peter Hutterer
1725b7d606 Add support for --set-pressure-range to the debugging tools
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1009>
2024-06-10 15:09:19 +00:00
Peter Hutterer
4effe6b1b9 evdev: add a helper macro for the absinfo range
The range is (max - min + 1) because the kernel range is inclusive min
and max. Let's fix that once and for all with a helper function.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2023-08-29 17:07:38 +00:00
Peter Hutterer
395d12d634 util: auto-declare the element variable in ARRAY_FOR_EACH
All cases we have in our code base have an otherwise unused variable to
loop through the array. Let's auto-declare this as part of the loop.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2022-03-09 10:16:07 +10:00
Peter Hutterer
9564b3c1e2 Mark some functions as printf-like to silence some compiler warnings
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2021-07-22 23:14:43 +00:00
weizhixiang
cce5921015 use ARRAY_FOR_EACH when traverse array
Signed-off-by: weizhixiang <weizhixiang@uniontech.com>
2021-05-24 04:11:32 +00:00
Peter Hutterer
7244e36b50 tools: only call libinput_dispatch() once per poll
This is a closer approximation of all callers anyway, and it makes it easier
to debug which events are handled per libinput_dispatch() call.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2020-10-06 16:12:17 +10:00
Peter Hutterer
20cf83789d tools: constify the optarg handling of seats
This shuts up scan-build complaining about memory leaks in libinput
debug-events (needs the right combination of --device option and eventually
triggering usage()) and saves us a bunch of unnecessary allocations.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2020-02-24 01:53:21 +00:00
Peter Hutterer
490131ff61 tools: make debug-events accept multiple device nodes
For interaction between devices it's necessary to look at more than one device
at a time.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-11-26 00:34:08 +00:00
Peter Hutterer
f87a6203ee tools: print the tip state in the tablet debugging tool 2019-11-19 09:56:14 +10:00
Peter Hutterer
c9e9ea3840 tools: add stylus button support
For the evdev events only a few hand-selected ones, all other ones are ignored
for now.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-11-19 09:56:14 +10:00
Peter Hutterer
733eb07eda tools: add a tablet debugging tool
Nothing sophisticated but easier to debug certain tablet oddities.
It shows a bar for each axis on the tablet (and the evdev axis) and prints
that relative to the axis range. This makes it easy to check if we do hit the
full range (especially for distance/pressure/tilt) and whether that matches
with what the device gives us.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-11-19 09:56:14 +10:00