diff --git a/dix/devices.c b/dix/devices.c index 84a6406d1..0011be77c 100644 --- a/dix/devices.c +++ b/dix/devices.c @@ -49,6 +49,9 @@ SOFTWARE. #endif #include + +#include "dix/ptrveloc_priv.h" + #include "misc.h" #include "resource.h" #include diff --git a/dix/ptrveloc.c b/dix/ptrveloc.c index 632971ed9..fce97c3fe 100644 --- a/dix/ptrveloc.c +++ b/dix/ptrveloc.c @@ -27,6 +27,9 @@ #endif #include + +#include "dix/ptrveloc_priv.h" + #include #include #include diff --git a/dix/ptrveloc_priv.h b/dix/ptrveloc_priv.h new file mode 100644 index 000000000..a4118cf65 --- /dev/null +++ b/dix/ptrveloc_priv.h @@ -0,0 +1,56 @@ +/* SPDX-License-Identifier: MIT OR X11 + * + * Copyright © 2024 Enrico Weigelt, metux IT consult + * Copyright © 2006-2011 Simon Thum simon dot thum at gmx dot de + */ +#ifndef _XSERVER_POINTERVELOCITY_PRIV_H +#define _XSERVER_POINTERVELOCITY_PRIV_H + +#include + +#include "ptrveloc.h" + +/* fwd */ +struct _DeviceVelocityRec; + +/** + * profile + * returns actual acceleration depending on velocity, acceleration control,... + */ +typedef double (*PointerAccelerationProfileFunc) + (DeviceIntPtr dev, struct _DeviceVelocityRec * vel, + double velocity, double threshold, double accelCoeff); + +/** + * a motion history, with just enough information to + * calc mean velocity and decide which motion was along + * a more or less straight line + */ +typedef struct _MotionTracker { + double dx, dy; /* accumulated delta for each axis */ + int time; /* time of creation */ + int dir; /* initial direction bitfield */ +} MotionTracker, *MotionTrackerPtr; + +/** + * contains the run-time data for the predictable scheme, that is, a + * DeviceVelocityPtr and the property handlers. + */ +typedef struct _PredictableAccelSchemeRec { + DeviceVelocityPtr vel; + long *prop_handlers; + int num_prop_handlers; +} PredictableAccelSchemeRec, *PredictableAccelSchemePtr; + +void AccelerationDefaultCleanup(DeviceIntPtr dev); + +Bool InitPredictableAccelerationScheme(DeviceIntPtr dev, + struct _ValuatorAccelerationRec *protoScheme); + +void acceleratePointerPredictable(DeviceIntPtr dev, ValuatorMask *val, + CARD32 evtime); + +void acceleratePointerLightweight(DeviceIntPtr dev, ValuatorMask *val, + CARD32 evtime); + +#endif /* _XSERVER_POINTERVELOCITY_PRIV_H */ diff --git a/include/ptrveloc.h b/include/ptrveloc.h index 3bd982a90..a99416ee7 100644 --- a/include/ptrveloc.h +++ b/include/ptrveloc.h @@ -51,16 +51,7 @@ typedef double (*PointerAccelerationProfileFunc) (DeviceIntPtr dev, struct _DeviceVelocityRec * vel, double velocity, double threshold, double accelCoeff); -/** - * a motion history, with just enough information to - * calc mean velocity and decide which motion was along - * a more or less straight line - */ -typedef struct _MotionTracker { - double dx, dy; /* accumulated delta for each axis */ - int time; /* time of creation */ - int dir; /* initial direction bitfield */ -} MotionTracker, *MotionTrackerPtr; +typedef struct _MotionTracker MotionTracker, *MotionTrackerPtr; /** * Contains all data needed to implement mouse ballistics @@ -90,16 +81,6 @@ typedef struct _DeviceVelocityRec { } statistics; } DeviceVelocityRec, *DeviceVelocityPtr; -/** - * contains the run-time data for the predictable scheme, that is, a - * DeviceVelocityPtr and the property handlers. - */ -typedef struct _PredictableAccelSchemeRec { - DeviceVelocityPtr vel; - long *prop_handlers; - int num_prop_handlers; -} PredictableAccelSchemeRec, *PredictableAccelSchemePtr; - extern _X_EXPORT void InitVelocityData(DeviceVelocityPtr vel); @@ -126,19 +107,4 @@ extern _X_EXPORT void SetDeviceSpecificAccelerationProfile(DeviceVelocityPtr vel, PointerAccelerationProfileFunc profile); -extern _X_INTERNAL void -AccelerationDefaultCleanup(DeviceIntPtr dev); - -extern _X_INTERNAL Bool -InitPredictableAccelerationScheme(DeviceIntPtr dev, - struct _ValuatorAccelerationRec *protoScheme); - -extern _X_INTERNAL void -acceleratePointerPredictable(DeviceIntPtr dev, ValuatorMask *val, - CARD32 evtime); - -extern _X_INTERNAL void -acceleratePointerLightweight(DeviceIntPtr dev, ValuatorMask *val, - CARD32 evtime); - #endif /* POINTERVELOCITY_H */