summaryrefslogtreecommitdiff
path: root/Xi
diff options
context:
space:
mode:
authorPeter Hutterer <peter@cs.unisa.edu.au>2008-04-30 11:45:19 +0930
committerPeter Hutterer <peter@cs.unisa.edu.au>2008-04-30 11:49:11 +0930
commitffaccc2dc91f4ca4ea10da010206a0a7d2b5540c (patch)
treee43860833bbf53bf98ade1f81edae679cc2dbc93 /Xi
parent00acb40f2bc5bb4a1977b9b08db75630677ff787 (diff)
input: replace -1 as default axis limit with NO_AXIS_LIMIT define.
This allows easier refacturing of the coordinate limit handling. Grepping for -1 is boring.
Diffstat (limited to 'Xi')
-rw-r--r--Xi/exevents.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/Xi/exevents.c b/Xi/exevents.c
index 761950ead..d0c10d9da 100644
--- a/Xi/exevents.c
+++ b/Xi/exevents.c
@@ -1153,13 +1153,22 @@ InitProximityClassDeviceStruct(DeviceIntPtr dev)
return TRUE;
}
+/**
+ * Initialise the device's valuators. The memory must already be allocated,
+ * this function merely inits the matching axis (specified through axnum) to
+ * sane values.
+ *
+ * It is a condition that (minval < maxval).
+ *
+ * @see InitValuatorClassDeviceStruct
+ */
_X_EXPORT void
InitValuatorAxisStruct(DeviceIntPtr dev, int axnum, int minval, int maxval,
int resolution, int min_res, int max_res)
{
AxisInfoPtr ax;
-
- if (!dev || !dev->valuator)
+
+ if (!dev || !dev->valuator || minval > maxval)
return;
ax = dev->valuator->axes + axnum;