dix: improve the driver interface to predictable pointer acceleration
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
parent
87aa529857
commit
c184b91d9a
|
@ -616,22 +616,32 @@ SetAccelerationProfile(
|
||||||
*/
|
*/
|
||||||
extern void
|
extern void
|
||||||
SetDeviceSpecificAccelerationProfile(
|
SetDeviceSpecificAccelerationProfile(
|
||||||
DeviceIntPtr pDev,
|
DeviceVelocityPtr s,
|
||||||
PointerAccelerationProfileFunc profile)
|
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*/
|
/*sanity check*/
|
||||||
if( pDev->valuator &&
|
if( pDev->valuator &&
|
||||||
pDev->valuator->accelScheme.AccelSchemeProc ==
|
pDev->valuator->accelScheme.AccelSchemeProc ==
|
||||||
acceleratePointerPredictable &&
|
acceleratePointerPredictable &&
|
||||||
pDev->valuator->accelScheme.accelData != NULL){
|
pDev->valuator->accelScheme.accelData != NULL){
|
||||||
((DeviceVelocityPtr)
|
|
||||||
(pDev->valuator->accelScheme.accelData))->deviceSpecificProfile
|
return (DeviceVelocityPtr)pDev->valuator->accelScheme.accelData;
|
||||||
= profile;
|
|
||||||
}
|
}
|
||||||
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/********************************
|
/********************************
|
||||||
* acceleration schemes
|
* acceleration schemes
|
||||||
*******************************/
|
*******************************/
|
||||||
|
|
|
@ -104,8 +104,11 @@ InitFilterChain(DeviceVelocityPtr s, float rdecay, float degression,
|
||||||
extern int
|
extern int
|
||||||
SetAccelerationProfile(DeviceVelocityPtr s, int profile_num);
|
SetAccelerationProfile(DeviceVelocityPtr s, int profile_num);
|
||||||
|
|
||||||
|
extern DeviceVelocityPtr
|
||||||
|
GetDevicePredictableAccelData(DeviceIntPtr pDev);
|
||||||
|
|
||||||
extern void
|
extern void
|
||||||
SetDeviceSpecificAccelerationProfile(DeviceIntPtr s,
|
SetDeviceSpecificAccelerationProfile(DeviceVelocityPtr s,
|
||||||
PointerAccelerationProfileFunc profile);
|
PointerAccelerationProfileFunc profile);
|
||||||
|
|
||||||
extern void
|
extern void
|
||||||
|
|
Loading…
Reference in New Issue
Block a user