summaryrefslogtreecommitdiff
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* adjust for 64bit time_t for 32bit architecturesKhem Raj2020-01-261-1/+7
| | | | | | | | | | libc that has support for 32 bit applications to use 64 bit time_t supplies __USE_TIME_BITS64 define [1] [1] https://sourceware.org/glibc/wiki/Y2038ProofnessDesign Signed-off-by: Khem Raj <raj.khem@gmail.com> Signed-off-by: Henrik Rydberg <rydberg@bitmath.se>
* Use a macro for `nlongs` so it can be used in constant expressionMichael Forney2020-01-261-8/+4
| | | | | | | | | | | | | This way, it can be used to specify the `absbits` array size (in `mtdev_configure`) without making it a VLA. VLAs are an optional feature in C11, and in this case we can determine the array size statically. This also matches the macros used in libevdev and libinput. Signed-off-by: Michael Forney <mforney@mforney.org> Signed-off-by: Henrik Rydberg <rydberg@bitmath.se>
* caps.c: declare mtdev_set_slots() staticMartin Kepplinger2017-11-291-1/+1
| | | | | | mtdev_set_slots() is only used internally, so it should be static. Signed-off-by: Martin Kepplinger <martink@posteo.de>
* build: Fix srcdir != builddir from gitColin Walters2014-02-281-1/+1
| | | | | | | | | Make it possible to build the source out-of-tree. The gnome-continuous build system does this by default. Signed-off-by: Colin Walters <walters@verbum.org> [rydberg@euromail.se: Resolve merge conflict] Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
* Fix compiler warning - implicit declaration of function 'abs'Peter Hutterer2013-07-311-0/+1
| | | | | | | | match_four.c:80:4: warning: implicit declaration of function 'abs' [-Wimplicit-function-declaration] *dist++ = abs(q->x - p->x) + abs(q->y - p->y); Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
* Replace hardcoded 11 with a definePeter Hutterer2013-07-313-10/+18
| | | | | | | The 11 comes from the legacy API that we need to be binary compatible with. Make this clear with a define and a comment. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
* Rename INCLUDES to AM_CPPFLAGSPeter Hutterer2013-07-241-1/+1
| | | | | | src/Makefile.am:22: warning: 'INCLUDES' is the old name for 'AM_CPPFLAGS' (or '*_CPPFLAGS') Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
* Add support for kernel MT slot state retrievalHenrik Rydberg2012-02-161-0/+25
| | | | | | | | From kernel 3.4, extraction of the MT slot state is supported via the EVIOGMTSLOTS ioctl. This patch initializes the slots using that information. Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
* Add the missing distance event to the internal slot representationv1.1.1Henrik Rydberg2012-01-121-0/+1
| | | | | | | | The new distance value was missing from the internal representation, leading to memory corruption for devices supporting the event. Fixed with this patch. Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
* Return EINVAL for invalid parameters on mtdev_init.Peter Hutterer2011-04-191-1/+4
| | | | | | [rydberg@euromail.se: minor cleanup] Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
* mtdev_close should ignore NULL devices.Peter Hutterer2011-04-191-5/+7
| | | | | | | Saves us one goto label in mtdev_init. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
* Add support for ABS_MT_DISTANCEHenrik Rydberg2010-12-221-3/+3
| | | | | | | | | In the upcoming 2.6.38 kernel, support for hovering is introduced. Add the ABS_MT_DISTANCE to the extended set of handled ABS_MT events. The change is binary compatible with existing libraries. Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
* Introduce a stable ABIHenrik Rydberg2010-12-225-82/+295
| | | | | | | | | | | | The current mtdev is not ABI stable, and the upcoming additions to the kernel api will break ABI. This patch starts the process of keeping binary compatibility with old programs, by moving the abi-specific parts under a special flag, MTDEV_NO_LEGACY_API, and makes sure the internal parts compiles with MTDEV_NO_LEGACY_API set. This way, older programs will still work, old programs will still compile, and new programs will be able to use the additions. Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
* Add and test a simple kernel matcherHenrik Rydberg2010-11-073-1/+139
| | | | | | | | | | This matcher is for up to four fingers, and has these properties: * Approximately 1.4 times faster at 4 fingers * Approximately 4.0 times faster at 2 fingers * Roughly 100 lines of code Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
* Fall back to single-touch position and pressure dimensionsHenrik Rydberg2010-09-071-0/+7
| | | | | | | | In case mtdev is driving a non-MT device, basic dimensions are not set properly. Fall back on ABS_X/Y and ABS_PRESSURE, such that basic pointer operations can be supported through mtdev. Signed-off-by: Henrik Rydberg <rydberg@bitmath.org>
* Install mapping and plumbing header filesHenrik Rydberg2010-09-071-1/+4
| | | | | | | Applications may need to know the property mapping, and the plumbing interface is actually supported, so install both headers. Signed-off-by: Henrik Rydberg <rydberg@bitmath.org>
* Correct logic for kernel MT slots devicesHenrik Rydberg2010-08-181-3/+3
| | | | | | | This patch fixes the broken logic to detect the kernel MT slots protocol, such that MT slots devices may pass through mtdev properly. Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
* Add missing header files to sources directiveHenrik Rydberg2010-07-151-0/+7
| | | | | | | | In order for make dist-gzip to work properly, all files needed to build the system need to be listed. This patch adds the missing header files to the sources directive. Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
* Update defuzz() creditsHenrik Rydberg2010-06-221-1/+1
| | | | | | | Correct the credits for the defuzz() function. Used under the MIT license with permission from Vojtech Pavlik. Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
* Apply new package title to all filesHenrik Rydberg2010-06-229-9/+9
| | | | | | | This patch changes the package description title in all relevant files, and touches up the README. All systems go. Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
* janitor: fix compiler warningsHenrik Rydberg2010-06-224-2/+4
| | | | Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
* Move to autotoolsChase Douglas2010-06-221-0/+16
| | | | | | [rydberg@euromail.se: minor fixups] Signed-off-by: Chase Douglas <chase.douglas@canonical.com> Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
* match: conform to mtdev namespaceHenrik Rydberg2010-06-223-6/+4
| | | | Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
* Unused slot is denoted by MT_TRACKING_ID == -1Henrik Rydberg2010-06-222-9/+14
| | | | | | | | | | | The current MT slot protocol allows any tracking id outside the range specified by the device to denote an unused slot. This is difficult to handle in userspace, since the valid range is unknown. This patch tightens the definition of a valid tracking id to always lie in the range [0, MT_ID_MAX], and uses the value -1 to denote an unused slot. Acked-by: Chase Douglas <chase.douglas@canonical.com> Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
* mtdev_get: return number of retrieved events if error occursChase Douglas2010-06-221-4/+2
| | | | | | | | Otherwise, we pull events, but return -1. We should send the events we were able to retrieve for now. Signed-off-by: Chase Douglas <chase.douglas@canonical.com> Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
* Restructure mtdev apiHenrik Rydberg2010-06-194-30/+25
| | | | | | | | | | | | | Split the api into plumbing and porcelain layers and move the plumbing part to its own optional header file. The main usecase is to fetch events from the device, route them through the converter and extract the processed events. To simplify the API, replace the intermediate mtdev_pull() function by the higher-level mtdev_get(). This function does all the required steps, and has the same semantics as read(). Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
* Change the matching code to the MIT licenseHenrik Rydberg2010-06-181-1/+1
| | | | Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
* Correct semantic error in mtdev_idleHenrik Rydberg2010-06-181-6/+2
| | | | | | | | | The current semantics, that a non-empty conversion pipe means the device is not idle, is not very useful. This patch changes the semantics to simply checking if the fetch buffer is empty, and if there are no events to fetch from the device. Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
* Allow max_events to be zero in mtdev_pull()Henrik Rydberg2010-06-181-0/+2
| | | | | | | When reading from non-blocking devices, it makes sense to read all events available. This patch lets a zero max_events achieve that. Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
* Rectify argument order in mtdev_fetchHenrik Rydberg2010-06-181-2/+2
| | | | | | | The argument order in mtdev_fetch() differs from all other usages involved the file descriptor. Fixed with this patch. Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
* Add idle functionHenrik Rydberg2010-06-171-0/+12
| | | | | | | This patch adds the mtdev_idle() function, which checks the kernel device for activity. Useful when implementing timing logic. Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
* Initial load of mtdev projectHenrik Rydberg2010-06-179-0/+1255
Signed-off-by: Henrik Rydberg <rydberg@euromail.se>