dix: rename classic accel _scheme_ to lightweight to avoid confusion with

classic accel _profile_

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
Simon Thum 2008-07-23 11:10:22 +02:00 committed by Peter Hutterer
parent d40183c665
commit 4e32e6fb38
4 changed files with 18 additions and 7 deletions

View File

@ -1269,10 +1269,14 @@ InitValuatorClassDeviceStruct(DeviceIntPtr dev, int numAxes,
ValuatorAccelerationRec pointerAccelerationScheme[] = { ValuatorAccelerationRec pointerAccelerationScheme[] = {
{PtrAccelNoOp, NULL, NULL, NULL}, {PtrAccelNoOp, NULL, NULL, NULL},
{PtrAccelPredictable, acceleratePointerPredictable, NULL, AccelerationDefaultCleanup}, {PtrAccelPredictable, acceleratePointerPredictable, NULL, AccelerationDefaultCleanup},
{PtrAccelClassic, acceleratePointerClassic, NULL, NULL}, {PtrAccelLightweight, acceleratePointerLightweight, NULL, NULL},
{-1, NULL, NULL, NULL} /* terminator */ {-1, NULL, NULL, NULL} /* terminator */
}; };
/**
* install an acceleration scheme. retrns TRUE on success, and should not
* change anything if unsuccessful.
*/
_X_EXPORT Bool _X_EXPORT Bool
InitPointerAccelerationScheme(DeviceIntPtr dev, InitPointerAccelerationScheme(DeviceIntPtr dev,
int scheme) int scheme)
@ -1281,7 +1285,9 @@ InitPointerAccelerationScheme(DeviceIntPtr dev,
void* data = NULL; void* data = NULL;
ValuatorClassPtr val; ValuatorClassPtr val;
if(dev->isMaster) /* bail out if called for master devs */ val = dev->valuator;
if(!val || dev->isMaster) /* bail out if called for master devs */
return FALSE; return FALSE;
for(x = 0; pointerAccelerationScheme[x].number >= 0; x++) { for(x = 0; pointerAccelerationScheme[x].number >= 0; x++) {
@ -1301,6 +1307,8 @@ InitPointerAccelerationScheme(DeviceIntPtr dev,
{ {
DeviceVelocityPtr s; DeviceVelocityPtr s;
s = (DeviceVelocityPtr)xalloc(sizeof(DeviceVelocityRec)); s = (DeviceVelocityPtr)xalloc(sizeof(DeviceVelocityRec));
if(!s)
return FALSE;
InitVelocityData(s); InitVelocityData(s);
data = s; data = s;
break; break;
@ -1309,7 +1317,6 @@ InitPointerAccelerationScheme(DeviceIntPtr dev,
break; break;
} }
val = dev->valuator;
val->accelScheme = pointerAccelerationScheme[i]; val->accelScheme = pointerAccelerationScheme[i];
val->accelScheme.accelData = data; val->accelScheme.accelData = data;

View File

@ -722,8 +722,12 @@ acceleratePointerPredictable(DeviceIntPtr pDev, int first_valuator,
* in-place. Retained mostly for embedded scenarios. * in-place. Retained mostly for embedded scenarios.
*/ */
void void
acceleratePointerClassic(DeviceIntPtr pDev, int first_valuator, acceleratePointerLightweight(
int num_valuators, int *valuators, int ignored) DeviceIntPtr pDev,
int first_valuator,
int num_valuators,
int *valuators,
int ignored)
{ {
float mult = 0.0; float mult = 0.0;
int dx = 0, dy = 0; int dx = 0, dy = 0;

View File

@ -66,7 +66,7 @@ SOFTWARE.
/*int constants for pointer acceleration schemes*/ /*int constants for pointer acceleration schemes*/
#define PtrAccelNoOp 0 #define PtrAccelNoOp 0
#define PtrAccelPredictable 1 #define PtrAccelPredictable 1
#define PtrAccelClassic 2 #define PtrAccelLightweight 2
#define PtrAccelDefault PtrAccelPredictable #define PtrAccelDefault PtrAccelPredictable
#define MAX_VALUATORS 36 /* XXX from comment in dix/getevents.c */ #define MAX_VALUATORS 36 /* XXX from comment in dix/getevents.c */

View File

@ -103,7 +103,7 @@ acceleratePointerPredictable(DeviceIntPtr pDev, int first_valuator,
int num_valuators, int *valuators, int evtime); int num_valuators, int *valuators, int evtime);
extern void extern void
acceleratePointerClassic(DeviceIntPtr pDev, int first_valuator, acceleratePointerLightweight(DeviceIntPtr pDev, int first_valuator,
int num_valuators, int *valuators, int ignore); int num_valuators, int *valuators, int ignore);
#endif /* POINTERVELOCITY_H */ #endif /* POINTERVELOCITY_H */