dix: improve the driver interface to predictable pointer acceleration

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
Simon Thum 2008-07-23 11:33:25 +02:00 committed by Peter Hutterer
parent 87aa529857
commit c184b91d9a
2 changed files with 20 additions and 7 deletions

View File

@ -616,22 +616,32 @@ SetAccelerationProfile(
*/
extern void
SetDeviceSpecificAccelerationProfile(
DeviceIntPtr pDev,
DeviceVelocityPtr s,
PointerAccelerationProfileFunc profile)
{
if(s)
s->deviceSpecificProfile = profile;
}
/**
* Use this function to obtain a DeviceVelocityPtr for a device. Will return NULL if
* the predictable acceleration scheme is not in effect.
*/
DeviceVelocityPtr
GetDevicePredictableAccelData(
DeviceIntPtr pDev)
{
/*sanity check*/
if( pDev->valuator &&
pDev->valuator->accelScheme.AccelSchemeProc ==
acceleratePointerPredictable &&
pDev->valuator->accelScheme.accelData != NULL){
((DeviceVelocityPtr)
(pDev->valuator->accelScheme.accelData))->deviceSpecificProfile
= profile;
return (DeviceVelocityPtr)pDev->valuator->accelScheme.accelData;
}
return NULL;
}
/********************************
* acceleration schemes
*******************************/

View File

@ -104,8 +104,11 @@ InitFilterChain(DeviceVelocityPtr s, float rdecay, float degression,
extern int
SetAccelerationProfile(DeviceVelocityPtr s, int profile_num);
extern DeviceVelocityPtr
GetDevicePredictableAccelData(DeviceIntPtr pDev);
extern void
SetDeviceSpecificAccelerationProfile(DeviceIntPtr s,
SetDeviceSpecificAccelerationProfile(DeviceVelocityPtr s,
PointerAccelerationProfileFunc profile);
extern void