#ifndef POINTERVELOCITY_H
#define POINTERVELOCITY_H
#include <input.h>
#define AccelProfileNone -1
#define AccelProfileClassic 0
#define AccelProfileDeviceSpecific 1
#define AccelProfilePolynomial 2
#define AccelProfileSmoothLinear 3
#define AccelProfileSimple 4
#define AccelProfilePower 5
#define AccelProfileLinear 6
#define AccelProfileSmoothLimited 7
#define AccelProfileLAST AccelProfileSmoothLimited
struct _DeviceVelocityRec;
typedef float (*PointerAccelerationProfileFunc)
(DeviceIntPtr dev, struct _DeviceVelocityRec* vel,
float velocity, float threshold, float accelCoeff);
typedef struct _MotionTracker {
int dx, dy;
int time;
int dir;
} MotionTracker, *MotionTrackerPtr;
#define NPROPS_PREDICTABLE_ACCEL 4
typedef struct _DeviceVelocityRec {
MotionTrackerPtr tracker;
int num_tracker;
int cur_tracker;
float velocity;
float last_velocity;
int last_dx;
int last_dy ;
float corr_mul;
float const_acceleration;
float min_acceleration;
short reset_time;
short use_softening;
float max_rel_diff;
float max_diff;
int initial_range;
Bool average_accel;
PointerAccelerationProfileFunc Profile;
PointerAccelerationProfileFunc deviceSpecificProfile;
void* profile_private;
struct {
int profile_number;
} statistics;
long prop_handlers[NPROPS_PREDICTABLE_ACCEL];
} DeviceVelocityRec, *DeviceVelocityPtr;
extern _X_EXPORT void
InitVelocityData(DeviceVelocityPtr vel);
extern _X_EXPORT void
InitTrackers(DeviceVelocityPtr vel, int ntracker);
extern _X_EXPORT short
ProcessVelocityData2D(DeviceVelocityPtr vel, int dx, int dy, int time);
extern _X_EXPORT float
BasicComputeAcceleration(DeviceIntPtr dev, DeviceVelocityPtr vel,
float velocity, float threshold, float acc);
extern _X_EXPORT void
FreeVelocityData(DeviceVelocityPtr vel);
extern _X_INTERNAL BOOL
InitializePredictableAccelerationProperties(DeviceIntPtr dev);
extern _X_INTERNAL BOOL
DeletePredictableAccelerationProperties(DeviceIntPtr dev);
extern _X_EXPORT int
SetAccelerationProfile(DeviceVelocityPtr vel, int profile_num);
extern _X_EXPORT DeviceVelocityPtr
GetDevicePredictableAccelData(DeviceIntPtr dev);
extern _X_EXPORT void
SetDeviceSpecificAccelerationProfile(DeviceVelocityPtr vel,
PointerAccelerationProfileFunc profile);
extern _X_INTERNAL void
AccelerationDefaultCleanup(DeviceIntPtr dev);
extern _X_INTERNAL void
acceleratePointerPredictable(DeviceIntPtr dev, int first_valuator,
int num_valuators, int *valuators, int evtime);
extern _X_INTERNAL void
acceleratePointerLightweight(DeviceIntPtr dev, int first_valuator,
int num_valuators, int *valuators, int ignored);
#endif