summaryrefslogtreecommitdiff
path: root/include/inpututils.h
AgeCommit message (Collapse)AuthorFilesLines
2015-11-24Input: Add DeviceEventSource enumDaniel Stone1-1/+3
Add a flag to DeviceEvents, giving the source of the event. Currently this only supports a 'normal' flag, but will be used later to add a 'focus-in' flag, noting events synthesised from key/button arrays on focus-in notifications. Signed-off-by: Daniel Stone <daniels@collabora.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-05-20dix: Add unaccelerated valuators to the ValuatorMaskPeter Hutterer1-0/+2
Allows a mask to carry both accelerated and unaccelerated motion at the same time. This is required for xf86-input-libinput where the pointer acceleration happens in libinput already, but parts of the server, specifically raw events and DGA rely on device-specific unaccelerated data. To ease integration add this as a second set to the ValuatorMask rather than extending all APIs to carry a second, possibly NULL set of valuators. Note that a valuator mask should only be used in either accel/unaccel or standard mode at any time. Switching requires either a valuator_mask_zero() call or unsetting all valuators one-by-one. Trying to mix the two will produce a warning. The server has a shortcut for changing a mask with the valuator_mask_drop_unaccelerated() call. This saves us from having to loop through all valuators on every event, we can just drop the bits we know we don't want. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Hans de Goede <hdegoede@redhat.com>
2012-12-12dix: split xi2_mask_isset into a per-device functionPeter Hutterer1-0/+1
For touch selection conflicts, we need to check not only if the mask is set for the device, but if it is set for only that specific device (regardless of XIAll*Devices) Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2012-03-21Introduce a consistent coding styleKeith Packard1-11/+12
This is strictly the application of the script 'x-indent-all.sh' from util/modular. Compared to the patch that Daniel posted in January, I've added a few indent flags: -bap -psl -T PrivatePtr -T pmWait -T _XFUNCPROTOBEGIN -T _XFUNCPROTOEND -T _X_EXPORT The typedefs were needed to make the output of sdksyms.sh match the previous output, otherwise, the code is formatted badly enough that sdksyms.sh generates incorrect output. The generated code was compared with the previous version and found to be essentially identical -- "assert" line numbers and BUILD_TIME were the only differences found. The comparison was done with this script: dir1=$1 dir2=$2 for dir in $dir1 $dir2; do (cd $dir && find . -name '*.o' | while read file; do dir=`dirname $file` base=`basename $file .o` dump=$dir/$base.dump objdump -d $file > $dump done) done find $dir1 -name '*.dump' | while read dump; do otherdump=`echo $dump | sed "s;$dir1;$dir2;"` diff -u $dump $otherdump done Signed-off-by: Keith Packard <keithp@keithp.com> Acked-by: Daniel Stone <daniel@fooishbar.org> Acked-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2011-12-13dix: add a MAXEVENTS define for the number of core + extension eventsPeter Hutterer1-1/+1
Not including GenericEvents Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Walter Harms <wharms@bfs.de> Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
2011-12-13dix: move event filter retrieval helpers to inpututils.cPeter Hutterer1-0/+4
No functional changes Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
2011-12-13dix: split out core state and event state setting into helper functionsPeter Hutterer1-0/+2
no functional changes. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
2011-12-09Add a new XI2Mask struct and a few helper functions.Peter Hutterer1-0/+12
The current XI2 mask handling is handy for copying (fixed size arrays) but a pain to deal with otherwise. Add a struct for XI2 masks and the required accessors. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
2011-10-15dix: add utility functions for double to/fro FP1616/FP3232 conversionJeremy Huddleston1-0/+6
Co-authored-by: Jeremy Huddleston <jeremyhu@apple.com> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com> Reviewed-by: Mark Kettenis <kettenis@openbsd.org>
2011-09-29Input: Convert ValuatorMask to double-precision internallyDaniel Stone1-1/+1
Switch the ValuatorMask struct to using doubles instead of ints for the actual values. Preserve the old int API, and (attempt to) round towards zero for values we return. Signed-off-by: Daniel Stone <daniel@fooishbar.org> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2011-08-22input: provide a single function to init DeviceEvents to 0Peter Hutterer1-0/+1
getevents.c already had that function, but XKB was manually initializing it, causing bugs when the event structure was updated in one place but not the other. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2011-05-06input: change CHECKEVENT macro to verify_internal_event functionPeter Hutterer1-0/+2
The macro is sufficient if called during a development cycle, but not sufficient information when triggered by a user (e.g. https://bugzilla.redhat.com/show_bug.cgi?id=688693). Expand what this does to print the event content and a backtrace, so at least we know where we're coming from. Only the first 32 bytes are printed since if something goes wrong, the event we have is almost certainly an xEvent or xError, both restricted to 32 bytes. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Daniel Stone <daniel@fooishbar.org>
2010-12-31Export all valuator_mask_* functionsChase Douglas1-8/+0
Input drivers may use valuator masks for internal state. Having all the valuator_mask_* functions available will help. Signed-off-by: Chase Douglas <chase.douglas@canonical.com> Reviewed-by: Daniel Stone <daniel@fooishbar.org> Bump ABI_XINPUT_VERSION minor. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2010-10-22dix: remove valuator_mask_copy_valuators, not needed anymore.Peter Hutterer1-1/+0
With the switch to masks internally, this isn't needed anymore. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
2010-10-22Abstract valuator masks through a set of APIs.Peter Hutterer1-0/+49
This commit introduces an abstraction API for handling masked valuators. The intent is that drivers just allocate a mask, set the data and pass the mask to the server. The actual storage type of the mask is hidden from the drivers. The new calls for drivers are: valuator_mask_new() /* to allocate a valuator mask */ valuator_mask_zero() /* to reset a mask to zero */ valuator_mask_set() /* to set a valuator value */ The new interface to the server is xf86PostMotionEventM() xf86PostButtonEventM() xf86PostKeyboardEventM() xf86PostProximityEventM() all taking a mask instead of the valuator array. The ValuatorMask is currently defined for MAX_VALUATORS fixed size due to memory allocation restrictions in SIGIO handlers. For easier review, a lot of the code still uses separate valuator arrays. This will be fixed in a later patch. This patch was initially written by Chase Douglas. Signed-off-by: Chase Douglas <chase.douglas@canonical.com> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Chase Douglas <chase.douglas@canonical.com>