diff options
author | Peter Hutterer <peter.hutterer@who-t.net> | 2015-05-05 14:18:54 +1000 |
---|---|---|
committer | Peter Hutterer <peter.hutterer@who-t.net> | 2015-05-20 12:44:58 +1000 |
commit | 4c2f2cb4c8ca1ab894a65828fdd39aea9b014f69 (patch) | |
tree | 80ed79529f84cbcaebfaae08c482df59fbcf2342 /include/input.h | |
parent | 3f0d3201f38ef9d1651fcaf94e45c640786edcc0 (diff) |
dix: Add unaccelerated valuators to the ValuatorMask
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>
Diffstat (limited to 'include/input.h')
-rw-r--r-- | include/input.h | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/include/input.h b/include/input.h index 00a9cbd6d..d8bd9c602 100644 --- a/include/input.h +++ b/include/input.h @@ -673,6 +673,21 @@ extern _X_EXPORT Bool valuator_mask_fetch(const ValuatorMask *mask, extern _X_EXPORT Bool valuator_mask_fetch_double(const ValuatorMask *mask, int valnum, double *val); +extern _X_EXPORT Bool valuator_mask_has_unaccelerated(const ValuatorMask *mask); +extern _X_EXPORT void valuator_mask_set_unaccelerated(ValuatorMask *mask, + int valuator, + double accel, + double unaccel); +extern _X_EXPORT double valuator_mask_get_accelerated(const ValuatorMask *mask, + int valuator); +extern _X_EXPORT double valuator_mask_get_unaccelerated(const ValuatorMask *mask, + int valuator); +extern _X_EXPORT Bool valuator_mask_fetch_unaccelerated(const ValuatorMask *mask, + int valuator, + double *accel, + double *unaccel); +extern _X_HIDDEN void valuator_mask_drop_unaccelerated(ValuatorMask *mask); + /* InputOption handling interface */ extern _X_EXPORT InputOption *input_option_new(InputOption *list, const char *key, |