summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@redhat.com>2008-10-14 10:11:11 +1030
committerPeter Hutterer <peter.hutterer@redhat.com>2008-10-14 10:11:11 +1030
commitd0aa1083c0130861a2c78509b72847fc3f7ee5f3 (patch)
treec22ae32b3fa3069ec88a00f29abf58eae1c7857d
parentbf0e1bf915cb679bd425712300f5dc5c80ed190a (diff)
Add Option "Model" to supported list of options.
Some touchscreens supported by this driver need special handling, hence the explicit specification of the model. Note that this commit does not actually do anything with the information, it just sets some internal state. Signed-off-by: Peter Hutterer <peter.hutterer@redhat.com>
-rw-r--r--man/elographics.man3
-rw-r--r--src/xf86Elo.c31
2 files changed, 34 insertions, 0 deletions
diff --git a/man/elographics.man b/man/elographics.man
index 8dac6b5..9f59941 100644
--- a/man/elographics.man
+++ b/man/elographics.man
@@ -71,6 +71,9 @@ event to occur. Default: 5 (50ms).
.TP
.BI "Option \*qReportDelay\*q \*q" integer \*q
Delay between report packets. Default: 1 (10ms).
+.TP
+.BI "Option \*qModel\*q \*q" string \*q
+The touchscreen model. Default: unset.
.SH "SEE ALSO"
__xservername__(__appmansuffix__), __xconfigfile__(__filemansuffix__), xorgconfig(__appmansuffix__), Xserver(__appmansuffix__), X(__miscmansuffix__).
.SH AUTHORS
diff --git a/src/xf86Elo.c b/src/xf86Elo.c
index dfb05d1..d1c89e5 100644
--- a/src/xf86Elo.c
+++ b/src/xf86Elo.c
@@ -65,6 +65,20 @@
#include "xf86Module.h"
#endif
+/**
+ * models to be treated specially.
+ */
+#define MODEL_UNKNOWN -1
+
+typedef struct {
+ int type;
+ char *name;
+} Model;
+
+static Model SupportedModels[] =
+{
+ {MODEL_UNKNOWN, NULL}
+};
/*
***************************************************************************
*
@@ -186,6 +200,7 @@ typedef struct _EloPrivateRec {
int packet_buf_p; /* Assembly buffer pointer */
int swap_axes; /* Swap X an Y axes if != 0 */
unsigned char packet_buf[ELO_PACKET_SIZE]; /* Assembly buffer */
+ int model; /* one of MODEL_... */
} EloPrivateRec, *EloPrivatePtr;
/*
@@ -1039,6 +1054,9 @@ xf86EloInit(InputDriverPtr drv,
char *str;
int portrait = 0;
int height, width;
+ char *opt_model;
+ Model* model;
+
local = xf86EloAllocate(drv);
if (!local) {
@@ -1065,6 +1083,19 @@ xf86EloInit(InputDriverPtr drv,
}
priv->input_dev = strdup(str);
+ opt_model = xf86SetStrOption(local->options, "Model", NULL);
+ model = SupportedModels;
+ priv->model = MODEL_UNKNOWN;
+ while(model->type != MODEL_UNKNOWN && opt_model)
+ {
+ if (!strcmp(model->name, opt_model))
+ {
+ priv->model = model->type;
+ break;
+ }
+ model++;
+ }
+
local->name = xf86SetStrOption(local->options, "DeviceName", XI_TOUCHSCREEN);
xf86Msg(X_CONFIG, "Elographics X device name: %s\n", local->name);
priv->screen_no = xf86SetIntOption(local->options, "ScreenNo", 0);