diff options
author | Peter Hutterer <peter.hutterer@redhat.com> | 2008-10-14 10:11:11 +1030 |
---|---|---|
committer | Peter Hutterer <peter.hutterer@redhat.com> | 2008-10-14 10:11:11 +1030 |
commit | d0aa1083c0130861a2c78509b72847fc3f7ee5f3 (patch) | |
tree | c22ae32b3fa3069ec88a00f29abf58eae1c7857d /src/xf86Elo.c | |
parent | bf0e1bf915cb679bd425712300f5dc5c80ed190a (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>
Diffstat (limited to 'src/xf86Elo.c')
-rw-r--r-- | src/xf86Elo.c | 31 |
1 files changed, 31 insertions, 0 deletions
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); |