dix: export driver-side functions for acceleration
also add additional safety for accel driver api Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
parent
18e9fd69fe
commit
d762c08aeb
|
@ -695,7 +695,7 @@ LinearProfile(
|
||||||
* would be a good place, since FreeVelocityData() also calls this with -1.
|
* would be a good place, since FreeVelocityData() also calls this with -1.
|
||||||
* returns FALSE (0) if profile number is unavailable.
|
* returns FALSE (0) if profile number is unavailable.
|
||||||
*/
|
*/
|
||||||
int
|
_X_EXPORT int
|
||||||
SetAccelerationProfile(
|
SetAccelerationProfile(
|
||||||
DeviceVelocityPtr s,
|
DeviceVelocityPtr s,
|
||||||
int profile_num)
|
int profile_num)
|
||||||
|
@ -744,6 +744,11 @@ SetAccelerationProfile(
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**********************************************
|
||||||
|
* driver interaction
|
||||||
|
**********************************************/
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* device-specific profile
|
* device-specific profile
|
||||||
*
|
*
|
||||||
|
@ -753,7 +758,7 @@ SetAccelerationProfile(
|
||||||
* it should do init/uninit in the driver (ie. with DEVICE_INIT and friends).
|
* it should do init/uninit in the driver (ie. with DEVICE_INIT and friends).
|
||||||
* Users may override or choose it.
|
* Users may override or choose it.
|
||||||
*/
|
*/
|
||||||
extern void
|
_X_EXPORT void
|
||||||
SetDeviceSpecificAccelerationProfile(
|
SetDeviceSpecificAccelerationProfile(
|
||||||
DeviceVelocityPtr s,
|
DeviceVelocityPtr s,
|
||||||
PointerAccelerationProfileFunc profile)
|
PointerAccelerationProfileFunc profile)
|
||||||
|
@ -766,11 +771,15 @@ SetDeviceSpecificAccelerationProfile(
|
||||||
* Use this function to obtain a DeviceVelocityPtr for a device. Will return NULL if
|
* Use this function to obtain a DeviceVelocityPtr for a device. Will return NULL if
|
||||||
* the predictable acceleration scheme is not in effect.
|
* the predictable acceleration scheme is not in effect.
|
||||||
*/
|
*/
|
||||||
DeviceVelocityPtr
|
_X_EXPORT DeviceVelocityPtr
|
||||||
GetDevicePredictableAccelData(
|
GetDevicePredictableAccelData(
|
||||||
DeviceIntPtr pDev)
|
DeviceIntPtr pDev)
|
||||||
{
|
{
|
||||||
/*sanity check*/
|
/*sanity check*/
|
||||||
|
if(!pDev){
|
||||||
|
ErrorF("[dix] accel: DeviceIntPtr was NULL");
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
if( pDev->valuator &&
|
if( pDev->valuator &&
|
||||||
pDev->valuator->accelScheme.AccelSchemeProc ==
|
pDev->valuator->accelScheme.AccelSchemeProc ==
|
||||||
acceleratePointerPredictable &&
|
acceleratePointerPredictable &&
|
||||||
|
|
Loading…
Reference in New Issue