summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Thum <simon.thum@gmx.de>2008-07-23 11:28:09 +0200
committerPeter Hutterer <peter.hutterer@who-t.net>2008-07-28 18:13:18 +0930
commit87aa5298576ed335ac31347e14fb30430288157a (patch)
treeab395c5081ecd66f9b282d4d1e7ac057eaa0c51a
parent4e32e6fb38d19c9993de86188e4f7e7916a028e2 (diff)
dix: introduce defines for accel profile numbers
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
-rw-r--r--dix/ptrveloc.c26
-rw-r--r--include/ptrveloc.h13
2 files changed, 27 insertions, 12 deletions
diff --git a/dix/ptrveloc.c b/dix/ptrveloc.c
index 92e737da8..8a0959b09 100644
--- a/dix/ptrveloc.c
+++ b/dix/ptrveloc.c
@@ -98,7 +98,7 @@ InitVelocityData(DeviceVelocityPtr s)
s->profile_private = NULL;
memset(&s->statistics, 0, sizeof(s->statistics));
memset(&s->filters, 0, sizeof(s->filters));
- SetAccelerationProfile(s, 0);
+ SetAccelerationProfile(s, AccelProfileClassic);
InitFilterChain(s, (float)1.0/20.0, 1, 1, 40);
}
@@ -551,10 +551,10 @@ LinearProfile(
/**
* Set the profile by number.
* Intended to make profiles exchangeable at runtime.
- * If you created a profile, give it a number here to make it selectable.
- * In case some profile-specific init is needed, here would be a good place,
- * since FreeVelocityData() also calls this with -1.
- * returns FALSE (0) if profile number is unknown.
+ * If you created a profile, give it a number here and in the header to
+ * make it selectable. In case some profile-specific init is needed, here
+ * would be a good place, since FreeVelocityData() also calls this with -1.
+ * returns FALSE (0) if profile number is unavailable.
*/
int
SetAccelerationProfile(
@@ -566,29 +566,31 @@ SetAccelerationProfile(
case -1:
profile = NULL; /* Special case to uninit properly */
break;
- case 0:
+ case AccelProfileClassic:
profile = ClassicProfile;
break;
- case 1:
+ case AccelProfileDeviceSpecific:
if(NULL == s->deviceSpecificProfile)
return FALSE;
profile = s->deviceSpecificProfile;
break;
- case 2:
+ case AccelProfilePolynomial:
profile = PolynomialAccelerationProfile;
break;
- case 3:
+ case AccelProfileSmoothLinear:
profile = SmoothLinearProfile;
break;
- case 4:
+ case AccelProfileSimple:
profile = SimpleSmoothProfile;
break;
- case 5:
+ case AccelProfilePower:
profile = PowerProfile;
break;
- case 6:
+ case AccelProfileLinear:
profile = LinearProfile;
break;
+ case AccelProfileReserved:
+ /* reserved for future use, e.g. a user-defined profile */
default:
return FALSE;
}
diff --git a/include/ptrveloc.h b/include/ptrveloc.h
index 30a22bc33..1b92a07be 100644
--- a/include/ptrveloc.h
+++ b/include/ptrveloc.h
@@ -29,6 +29,19 @@
#define MAX_VELOCITY_FILTERS 8
+/* constants for acceleration profiles;
+ * see */
+
+#define AccelProfileClassic 0
+#define AccelProfileDeviceSpecific 1
+#define AccelProfilePolynomial 2
+#define AccelProfileSmoothLinear 3
+#define AccelProfileSimple 4
+#define AccelProfilePower 5
+#define AccelProfileLinear 6
+#define AccelProfileReserved 7
+
+/* fwd */
struct _DeviceVelocityRec;
/**