summaryrefslogtreecommitdiff
path: root/include/ptrveloc.h
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2012-03-21 12:55:09 -0700
committerKeith Packard <keithp@keithp.com>2012-03-21 13:54:42 -0700
commit9838b7032ea9792bec21af424c53c07078636d21 (patch)
treeb72d0827dac50f0f3b8eab29b3b7639546d735d7 /include/ptrveloc.h
parent75199129c603fc8567185ac31866c9518193cb78 (diff)
Introduce a consistent coding style
This is strictly the application of the script 'x-indent-all.sh' from util/modular. Compared to the patch that Daniel posted in January, I've added a few indent flags: -bap -psl -T PrivatePtr -T pmWait -T _XFUNCPROTOBEGIN -T _XFUNCPROTOEND -T _X_EXPORT The typedefs were needed to make the output of sdksyms.sh match the previous output, otherwise, the code is formatted badly enough that sdksyms.sh generates incorrect output. The generated code was compared with the previous version and found to be essentially identical -- "assert" line numbers and BUILD_TIME were the only differences found. The comparison was done with this script: dir1=$1 dir2=$2 for dir in $dir1 $dir2; do (cd $dir && find . -name '*.o' | while read file; do dir=`dirname $file` base=`basename $file .o` dump=$dir/$base.dump objdump -d $file > $dump done) done find $dir1 -name '*.dump' | while read dump; do otherdump=`echo $dump | sed "s;$dir1;$dir2;"` diff -u $dump $otherdump done Signed-off-by: Keith Packard <keithp@keithp.com> Acked-by: Daniel Stone <daniel@fooishbar.org> Acked-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Diffstat (limited to 'include/ptrveloc.h')
-rw-r--r--include/ptrveloc.h71
1 files changed, 38 insertions, 33 deletions
diff --git a/include/ptrveloc.h b/include/ptrveloc.h
index 4f76b0094..8778646f5 100644
--- a/include/ptrveloc.h
+++ b/include/ptrveloc.h
@@ -48,8 +48,8 @@ struct _DeviceVelocityRec;
* returns actual acceleration depending on velocity, acceleration control,...
*/
typedef double (*PointerAccelerationProfileFunc)
- (DeviceIntPtr dev, struct _DeviceVelocityRec* vel,
- double velocity, double threshold, double accelCoeff);
+ (DeviceIntPtr dev, struct _DeviceVelocityRec * vel,
+ double velocity, double threshold, double accelCoeff);
/**
* a motion history, with just enough information to
@@ -57,9 +57,9 @@ typedef double (*PointerAccelerationProfileFunc)
* 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 */
+ double dx, dy; /* accumulated delta for each axis */
+ int time; /* time of creation */
+ int dir; /* initial direction bitfield */
} MotionTracker, *MotionTrackerPtr;
/**
@@ -68,25 +68,25 @@ typedef struct _MotionTracker {
typedef struct _DeviceVelocityRec {
MotionTrackerPtr tracker;
int num_tracker;
- int cur_tracker; /* current index */
- double velocity; /* velocity as guessed by algorithm */
- double last_velocity; /* previous velocity estimate */
- double last_dx; /* last time-difference */
- double last_dy; /* phase of last/current estimate */
- double corr_mul; /* config: multiply this into velocity */
- double const_acceleration; /* config: (recipr.) const deceleration */
- double min_acceleration; /* config: minimum acceleration */
- short reset_time; /* config: reset non-visible state after # ms */
- short use_softening; /* config: use softening of mouse values */
- double max_rel_diff; /* config: max. relative difference */
- double max_diff; /* config: max. difference */
- int initial_range; /* config: max. offset used as initial velocity */
- Bool average_accel; /* config: average acceleration over velocity */
+ int cur_tracker; /* current index */
+ double velocity; /* velocity as guessed by algorithm */
+ double last_velocity; /* previous velocity estimate */
+ double last_dx; /* last time-difference */
+ double last_dy; /* phase of last/current estimate */
+ double corr_mul; /* config: multiply this into velocity */
+ double const_acceleration; /* config: (recipr.) const deceleration */
+ double min_acceleration; /* config: minimum acceleration */
+ short reset_time; /* config: reset non-visible state after # ms */
+ short use_softening; /* config: use softening of mouse values */
+ double max_rel_diff; /* config: max. relative difference */
+ double max_diff; /* config: max. difference */
+ int initial_range; /* config: max. offset used as initial velocity */
+ Bool average_accel; /* config: average acceleration over velocity */
PointerAccelerationProfileFunc Profile;
PointerAccelerationProfileFunc deviceSpecificProfile;
- void* profile_private;/* extended data, see SetAccelerationProfile() */
- struct { /* to be able to query this information */
- int profile_number;
+ void *profile_private; /* extended data, see SetAccelerationProfile() */
+ struct { /* to be able to query this information */
+ int profile_number;
} statistics;
} DeviceVelocityRec, *DeviceVelocityPtr;
@@ -96,49 +96,54 @@ typedef struct _DeviceVelocityRec {
*/
typedef struct _PredictableAccelSchemeRec {
DeviceVelocityPtr vel;
- long* prop_handlers;
+ long *prop_handlers;
int num_prop_handlers;
} PredictableAccelSchemeRec, *PredictableAccelSchemePtr;
extern _X_EXPORT void
-InitVelocityData(DeviceVelocityPtr vel);
+ InitVelocityData(DeviceVelocityPtr vel);
extern _X_EXPORT void
-InitTrackers(DeviceVelocityPtr vel, int ntracker);
+ InitTrackers(DeviceVelocityPtr vel, int ntracker);
extern _X_EXPORT BOOL
ProcessVelocityData2D(DeviceVelocityPtr vel, double dx, double dy, int time);
extern _X_EXPORT double
+
BasicComputeAcceleration(DeviceIntPtr dev, DeviceVelocityPtr vel,
- double velocity, double threshold, double acc);
+ double velocity, double threshold, double acc);
extern _X_EXPORT void
-FreeVelocityData(DeviceVelocityPtr vel);
+ FreeVelocityData(DeviceVelocityPtr vel);
extern _X_EXPORT int
-SetAccelerationProfile(DeviceVelocityPtr vel, int profile_num);
+ 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);
+ AccelerationDefaultCleanup(DeviceIntPtr dev);
extern _X_INTERNAL Bool
+
InitPredictableAccelerationScheme(DeviceIntPtr dev,
- struct _ValuatorAccelerationRec* protoScheme);
+ struct _ValuatorAccelerationRec *protoScheme);
extern _X_INTERNAL void
-acceleratePointerPredictable(DeviceIntPtr dev, ValuatorMask* val,
+
+acceleratePointerPredictable(DeviceIntPtr dev, ValuatorMask *val,
CARD32 evtime);
extern _X_INTERNAL void
-acceleratePointerLightweight(DeviceIntPtr dev, ValuatorMask* val,
+
+acceleratePointerLightweight(DeviceIntPtr dev, ValuatorMask *val,
CARD32 evtime);
-#endif /* POINTERVELOCITY_H */
+#endif /* POINTERVELOCITY_H */