Commit 3b02e7fd authored by Peter Hutterer's avatar Peter Hutterer
Browse files

Drop circular pad support



Do such devices still exist?
Signed-off-by: Peter Hutterer's avatarPeter Hutterer <peter.hutterer@who-t.net>
Acked-by: default avatarChase Douglas <chase.douglas@canonical.com>
parent 0903d99a
......@@ -115,9 +115,6 @@
* left, left, left + top */
#define SYNAPTICS_PROP_CIRCULAR_SCROLLING_TRIGGER "Synaptics Circular Scrolling Trigger"
/* 8 bit (BOOL) */
#define SYNAPTICS_PROP_CIRCULAR_PAD "Synaptics Circular Pad"
/* 8 bit (BOOL) */
#define SYNAPTICS_PROP_PALM_DETECT "Synaptics Palm Detection"
......
......@@ -316,13 +316,6 @@ l l.
.TE
Property: "Synaptics Circular Scrolling Trigger"
.TP
.BI "Option \*qCircularPad\*q \*q" boolean \*q
.
Instead of being a rectangle, the edge is the ellipse enclosed by the
Left/Right/Top/BottomEdge parameters.
.
For circular touchpads. Property: "Synaptics Circular Pad"
.TP
.BI "Option \*qPalmDetect\*q \*q" boolean \*q
If palm detection should be enabled.
.
......@@ -908,7 +901,8 @@ The following options are no longer part of the driver configuration:
.BI "Option \*qLeftRightScrollRepeat\*q \*q" boolean \*q
.TP
.BI "Option \*qScrollButtonRepeat\*q \*q" integer \*q
.TP
.BI "Option \*qCircularPad\*q \*q" boolean \*q
.SH "AUTHORS"
.LP
......
......@@ -277,9 +277,6 @@ InitDeviceProperties(InputInfoPtr pInfo)
prop_circscroll_trigger =
InitAtom(pInfo->dev, SYNAPTICS_PROP_CIRCULAR_SCROLLING_TRIGGER, 8, 1,
&para->circular_trigger);
prop_circpad =
InitAtom(pInfo->dev, SYNAPTICS_PROP_CIRCULAR_PAD, 8, 1,
&para->circular_pad);
prop_palm =
InitAtom(pInfo->dev, SYNAPTICS_PROP_PALM_DETECT, 8, 1,
&para->palm_detect);
......@@ -612,12 +609,6 @@ SetProperty(DeviceIntPtr dev, Atom property, XIPropertyValuePtr prop,
para->circular_trigger = trigger;
}
else if (property == prop_circpad) {
if (prop->size != 1 || prop->format != 8 || prop->type != XA_INTEGER)
return BadMatch;
para->circular_pad = *(BOOL *) prop->data;
}
else if (property == prop_palm) {
if (prop->size != 1 || prop->format != 8 || prop->type != XA_INTEGER)
return BadMatch;
......
......@@ -680,7 +680,6 @@ set_default_parameters(InputInfoPtr pInfo)
pars->circular_scrolling =
xf86SetBoolOption(opts, "CircularScrolling", FALSE);
pars->circular_trigger = xf86SetIntOption(opts, "CircScrollTrigger", 0);
pars->circular_pad = xf86SetBoolOption(opts, "CircularPad", FALSE);
pars->palm_detect = xf86SetBoolOption(opts, "PalmDetect", FALSE);
pars->palm_min_width = xf86SetIntOption(opts, "PalmMinWidth", palmMinWidth);
pars->palm_min_z = xf86SetIntOption(opts, "PalmMinZ", palmMinZ);
......@@ -1375,32 +1374,6 @@ DeviceInit(DeviceIntPtr dev)
return !Success;
}
/*
* Convert from absolute X/Y coordinates to a coordinate system where
* -1 corresponds to the left/upper edge and +1 corresponds to the
* right/lower edge.
*/
static void
relative_coords(SynapticsPrivate * priv, int x, int y,
double *relX, double *relY)
{
int minX = priv->synpara.left_edge;
int maxX = priv->synpara.right_edge;
int minY = priv->synpara.top_edge;
int maxY = priv->synpara.bottom_edge;
double xCenter = (minX + maxX) / 2.0;
double yCenter = (minY + maxY) / 2.0;
if ((maxX - xCenter > 0) && (maxY - yCenter > 0)) {
*relX = (x - xCenter) / (maxX - xCenter);
*relY = (y - yCenter) / (maxY - yCenter);
}
else {
*relX = 0;
*relY = 0;
}
}
/* return angle of point relative to center */
static double
angle(SynapticsPrivate * priv, int x, int y)
......@@ -1424,39 +1397,11 @@ diffa(double a1, double a2)
return da;
}
static edge_type
circular_edge_detection(SynapticsPrivate * priv, int x, int y)
{
edge_type edge = 0;
double relX, relY, relR;
relative_coords(priv, x, y, &relX, &relY);
relR = SQR(relX) + SQR(relY);
if (relR > 1) {
/* we are outside the ellipse enclosed by the edge parameters */
if (relX > M_SQRT1_2)
edge |= RIGHT_EDGE;
else if (relX < -M_SQRT1_2)
edge |= LEFT_EDGE;
if (relY < -M_SQRT1_2)
edge |= TOP_EDGE;
else if (relY > M_SQRT1_2)
edge |= BOTTOM_EDGE;
}
return edge;
}
static edge_type
edge_detection(SynapticsPrivate * priv, int x, int y)
{
edge_type edge = NO_EDGE;
if (priv->synpara.circular_pad)
return circular_edge_detection(priv, x, y);
if (x > priv->synpara.right_edge)
edge |= RIGHT_EDGE;
else if (x < priv->synpara.left_edge)
......
......@@ -150,7 +150,6 @@ typedef struct _SynapticsParameters {
Bool circular_scrolling; /* Enable circular scrolling */
double scroll_dist_circ; /* Scrolling angle radians */
int circular_trigger; /* Trigger area for circular scrolling */
Bool circular_pad; /* Edge has an oval or circular shape */
Bool palm_detect; /* Enable Palm Detection */
int palm_min_width; /* Palm detection width */
int palm_min_z; /* Palm detection depth */
......
......@@ -113,7 +113,6 @@ static struct Parameter params[] = {
{"CircularScrolling", PT_BOOL, 0, 1, SYNAPTICS_PROP_CIRCULAR_SCROLLING, 8, 0},
{"CircScrollDelta", PT_DOUBLE, .01, 3, SYNAPTICS_PROP_CIRCULAR_SCROLLING_DIST, 0 /* float */, 0},
{"CircScrollTrigger", PT_INT, 0, 8, SYNAPTICS_PROP_CIRCULAR_SCROLLING_TRIGGER, 8, 0},
{"CircularPad", PT_BOOL, 0, 1, SYNAPTICS_PROP_CIRCULAR_PAD, 8, 0},
{"PalmDetect", PT_BOOL, 0, 1, SYNAPTICS_PROP_PALM_DETECT, 8, 0},
{"PalmMinWidth", PT_INT, 0, 15, SYNAPTICS_PROP_PALM_DIMENSIONS, 32, 0},
{"PalmMinZ", PT_INT, 0, 255, SYNAPTICS_PROP_PALM_DIMENSIONS, 32, 1},
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment