configure.ac | 4 src/xf86Elo.c | 310 +++++++++++++++------------------------------------------- 2 files changed, 83 insertions(+), 231 deletions(-)
New commits: commit 7c324ede65c17e5c747b28f40b9fd19f21b79d9d Author: Peter Hutterer <[email protected]> Date: Mon Jun 27 14:48:11 2011 +1000 elographics 1.3.0 Signed-off-by: Peter Hutterer <[email protected]> diff --git a/configure.ac b/configure.ac index 9fd1fc6..a91be89 100644 --- a/configure.ac +++ b/configure.ac @@ -22,7 +22,7 @@ AC_PREREQ(2.57) AC_INIT([xf86-input-elographics], - 1.2.99, + 1.3.0, [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], xf86-input-elographics) commit 6c9a801a5c1d7e694ff7f4f097599f2b96357982 Author: Peter Hutterer <[email protected]> Date: Mon Jun 27 14:47:32 2011 +1000 Require server 1.10 And remove the manual input ABI check. Signed-off-by: Peter Hutterer <[email protected]> diff --git a/configure.ac b/configure.ac index 0d881e6..9fd1fc6 100644 --- a/configure.ac +++ b/configure.ac @@ -58,7 +58,7 @@ XORG_DRIVER_CHECK_EXT(RANDR, randrproto) XORG_DRIVER_CHECK_EXT(XINPUT, inputproto) # Checks for pkg-config packages -PKG_CHECK_MODULES(XORG, [xorg-server >= 1.9.0] xproto $REQUIRED_MODULES) +PKG_CHECK_MODULES(XORG, [xorg-server >= 1.10.0] xproto $REQUIRED_MODULES) sdkdir=$(pkg-config --variable=sdkdir xorg-server) XORG_CFLAGS="$CWARNFLAGS $XORG_CFLAGS" diff --git a/src/xf86Elo.c b/src/xf86Elo.c index f5b31d7..5aba02f 100644 --- a/src/xf86Elo.c +++ b/src/xf86Elo.c @@ -58,10 +58,6 @@ #include "xf86Module.h" -#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) < 12 -#error "Need server with input ABI 12." -#endif - /** * models to be treated specially. */ commit 6fd22a9d64f07a480d177e877189a3a3ebf7cb90 Author: Peter Hutterer <[email protected]> Date: Fri Dec 3 09:34:46 2010 +1000 Support input ABI 12 Signed-off-by: Peter Hutterer <[email protected]> Reviewed-by: Cyril Brulebois <[email protected]> diff --git a/src/xf86Elo.c b/src/xf86Elo.c index 4c3426f..f5b31d7 100644 --- a/src/xf86Elo.c +++ b/src/xf86Elo.c @@ -58,6 +58,10 @@ #include "xf86Module.h" +#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) < 12 +#error "Need server with input ABI 12." +#endif + /** * models to be treated specially. */ @@ -725,13 +729,15 @@ xf86EloControl(DeviceIntPtr dev, -1, -1, 9500, 0 /* min_res */, - 9500 /* max_res */); + 9500 /* max_res */, + Absolute); InitValuatorAxisStruct(dev, 1, axis_labels[1], -1, -1, 10500, 0 /* min_res */, - 10500 /* max_res */); + 10500 /* max_res */, + Absolute); } if (InitFocusClassDeviceStruct(dev) == FALSE) { @@ -859,22 +865,14 @@ xf86EloControl(DeviceIntPtr dev, * *************************************************************************** */ -static InputInfoPtr -xf86EloAllocate(InputDriverPtr drv, IDevPtr dev) +static int +xf86EloAllocate(InputDriverPtr drv, InputInfoPtr pInfo) { - InputInfoPtr pInfo; EloPrivatePtr priv; priv = malloc(sizeof(EloPrivateRec)); if (!priv) - return NULL; - - pInfo = xf86AllocateInput(drv, 0); - - if (!pInfo) { - free(priv); - return NULL; - } + return BadAlloc; priv->input_dev = strdup(ELO_PORT); priv->min_x = 0; @@ -892,19 +890,15 @@ xf86EloAllocate(InputDriverPtr drv, IDevPtr dev) priv->packet_buf_p = 0; priv->swap_axes = 0; - pInfo->name = xstrdup(dev->identifier); pInfo->flags = 0 /* XI86_NO_OPEN_ON_INIT */; pInfo->device_control = xf86EloControl; pInfo->read_input = xf86EloReadInput; pInfo->control_proc = NULL; pInfo->switch_mode = NULL; - pInfo->fd = -1; - pInfo->atom = 0; - pInfo->dev = NULL; pInfo->private = priv; pInfo->type_name = "Elographics TouchScreen"; - return pInfo; + return Success; } @@ -921,7 +915,7 @@ xf86EloUninit(InputDriverPtr drv, xf86DeleteInput(pInfo, 0); } -static const char *default_options[] = { +static char *default_options[] = { "BaudRate", "9600", "StopBits", "1", "DataBits", "8", @@ -930,42 +924,37 @@ static const char *default_options[] = { NULL }; -static InputInfoPtr +static int xf86EloInit(InputDriverPtr drv, - IDevPtr dev, + InputInfoPtr pInfo, int flags) { - InputInfoPtr pInfo=NULL; EloPrivatePtr priv=NULL; char *str; int portrait = 0; int height, width; char *opt_model; Model* model; + int rc; - pInfo = xf86EloAllocate(drv, dev); - if (!pInfo) { - return NULL; - } - priv = pInfo->private; - pInfo->conf_idev = dev; + rc = xf86EloAllocate(drv, pInfo); + if (rc != Success) + return rc; - xf86CollectInputOptions(pInfo, default_options, NULL); - /* Process the common options. */ - xf86ProcessCommonOptions(pInfo, pInfo->options); + priv = pInfo->private; str = xf86FindOptionValue(pInfo->options, "Device"); if (!str) { xf86Msg(X_ERROR, "%s: No Device specified in Elographics module config.\n", - dev->identifier); + pInfo->name); if (priv) { if (priv->input_dev) { free(priv->input_dev); } free(priv); } - return pInfo; + return BadValue; } priv->input_dev = strdup(str); @@ -1027,14 +1016,14 @@ xf86EloInit(InputDriverPtr drv, height = priv->max_y - priv->min_y; if (width == 0) { xf86Msg(X_ERROR, "Elographics: Cannot configure touchscreen with width 0\n"); - return pInfo; + return BadValue; } else if (width < 0) { xf86Msg(X_INFO, "Elographics: reverse x mode (minimum x position >= maximum x position)\n"); } if (height == 0) { xf86Msg(X_ERROR, "Elographics: Cannot configure touchscreen with height 0\n"); - return pInfo; + return BadValue; } else if (height < 0) { xf86Msg(X_INFO, "Elographics: reverse y mode (minimum y position >= maximum y position)\n"); @@ -1061,9 +1050,7 @@ xf86EloInit(InputDriverPtr drv, priv->swap_axes = (priv->swap_axes==0) ? 1 : 0; } - /* mark the device configured */ - pInfo->flags |= XI86_CONFIGURED; - return pInfo; + return Success; } _X_EXPORT InputDriverRec ELOGRAPHICS = { @@ -1073,6 +1060,7 @@ _X_EXPORT InputDriverRec ELOGRAPHICS = { xf86EloInit, /* pre-init */ xf86EloUninit, /* un-init */ NULL, /* module */ + default_options }; static pointer commit 3dac6ffa77c046b3d754f0a1105fe8ecc7377911 Author: Peter Hutterer <[email protected]> Date: Fri Dec 3 09:33:55 2010 +1000 Remove refcount field, dropped from the server Signed-off-by: Peter Hutterer <[email protected]> Reviewed-by: Cyril Brulebois <[email protected]> diff --git a/src/xf86Elo.c b/src/xf86Elo.c index 527ad1c..4c3426f 100644 --- a/src/xf86Elo.c +++ b/src/xf86Elo.c @@ -1073,7 +1073,6 @@ _X_EXPORT InputDriverRec ELOGRAPHICS = { xf86EloInit, /* pre-init */ xf86EloUninit, /* un-init */ NULL, /* module */ - 0 /* ref count */ }; static pointer commit 447f547fbb7d11ec56ea578292908192175b3828 Author: Peter Hutterer <[email protected]> Date: Fri Dec 3 09:29:36 2010 +1000 Drop close_proc, conversion_proc, reverse_conversion_proc All three are not called by the server anymore. Signed-off-by: Peter Hutterer <[email protected]> Reviewed-by: Cyril Brulebois <[email protected]> diff --git a/src/xf86Elo.c b/src/xf86Elo.c index 7b5e5e2..527ad1c 100644 --- a/src/xf86Elo.c +++ b/src/xf86Elo.c @@ -303,73 +303,6 @@ xf86EloGetPacket(unsigned char *buffer, } } -/* - *************************************************************************** - * - * xf86EloConvert -- - * Convert extended valuators to x and y suitable for core motion - * events. Return True if ok and False if the requested conversion - * can't be done for the specified valuators. - * - *************************************************************************** - */ -static Bool -xf86EloConvert(InputInfoPtr pInfo, - int first, - int num, - int v0, - int v1, - int v2, - int v3, - int v4, - int v5, - int *x, - int *y) -{ - EloPrivatePtr priv = (EloPrivatePtr) pInfo->private; - int width = priv->max_x - priv->min_x; - int height = priv->max_y - priv->min_y; - int input_x, input_y; - - if (first != 0 || num != 2) { - return FALSE; - } - - DBG(3, ErrorF("EloConvert: Screen(%d) - v0(%d), v1(%d)\n", priv->screen_no, v0, v1)); - - if (width == 0) width = 1; - if (height == 0) height = 1; - - if (priv->swap_axes) { - input_x = v1; - input_y = v0; - } - else { - input_x = v0; - input_y = v1; - } - *x = (priv->screen_width * (input_x - priv->min_x)) / width; - *y = (priv->screen_height - - (priv->screen_height * (input_y - priv->min_y)) / height); - - /* - * MHALAS: Based on the description in xf86XInputSetScreen - * this code must be called from ReadInput BEFORE any events - * are posted but this method is called FROM xf86PostMotionEvent - * Therefore I have moved this method into xf86EloReadInput - */ - /* - * Need to check if still on the correct screen. - * This call is here so that this work can be done after - * calib and before posting the event. - */ -/* xf86XInputSetScreen(pInfo, priv->screen_no, *x, *y); */ - - DBG(3, ErrorF("EloConvert: Screen(%d) - x(%d), y(%d)\n", priv->screen_no, *x, *y)); - - return TRUE; -} - /* *************************************************************************** @@ -964,10 +897,7 @@ xf86EloAllocate(InputDriverPtr drv, IDevPtr dev) pInfo->device_control = xf86EloControl; pInfo->read_input = xf86EloReadInput; pInfo->control_proc = NULL; - pInfo->close_proc = NULL; pInfo->switch_mode = NULL; - pInfo->conversion_proc = xf86EloConvert; - pInfo->reverse_conversion_proc = NULL; pInfo->fd = -1; pInfo->atom = 0; pInfo->dev = NULL; commit 61b249e75e357fc8974e3892517f251ecf36fda5 Author: Peter Hutterer <[email protected]> Date: Fri Dec 3 09:27:24 2010 +1000 Drop driver-specific motion history size handling. Signed-off-by: Peter Hutterer <[email protected]> Reviewed-by: Cyril Brulebois <[email protected]> diff --git a/src/xf86Elo.c b/src/xf86Elo.c index 3569017..7b5e5e2 100644 --- a/src/xf86Elo.c +++ b/src/xf86Elo.c @@ -781,7 +781,7 @@ xf86EloControl(DeviceIntPtr dev, * screen to fit one meter. */ if (InitValuatorClassDeviceStruct(dev, 2, axis_labels, - pInfo->history_size, Absolute) == FALSE) { + GetMotionHistorySize(), Absolute) == FALSE) { ErrorF("Unable to allocate Elographics touchscreen ValuatorClassDeviceStruct\n"); return !Success; } @@ -973,7 +973,6 @@ xf86EloAllocate(InputDriverPtr drv, IDevPtr dev) pInfo->dev = NULL; pInfo->private = priv; pInfo->type_name = "Elographics TouchScreen"; - pInfo->history_size = 0; return pInfo; } commit 8d90c971582b90c96901036203841064cb9f7a84 Author: Peter Hutterer <[email protected]> Date: Fri Dec 3 09:27:05 2010 +1000 Require server 1.9, drop earlier ABI support Signed-off-by: Peter Hutterer <[email protected]> Reviewed-by: Cyril Brulebois <[email protected]> diff --git a/configure.ac b/configure.ac index 9309d83..0d881e6 100644 --- a/configure.ac +++ b/configure.ac @@ -58,7 +58,7 @@ XORG_DRIVER_CHECK_EXT(RANDR, randrproto) XORG_DRIVER_CHECK_EXT(XINPUT, inputproto) # Checks for pkg-config packages -PKG_CHECK_MODULES(XORG, xorg-server xproto $REQUIRED_MODULES) +PKG_CHECK_MODULES(XORG, [xorg-server >= 1.9.0] xproto $REQUIRED_MODULES) sdkdir=$(pkg-config --variable=sdkdir xorg-server) XORG_CFLAGS="$CWARNFLAGS $XORG_CFLAGS" diff --git a/src/xf86Elo.c b/src/xf86Elo.c index 924916b..3569017 100644 --- a/src/xf86Elo.c +++ b/src/xf86Elo.c @@ -402,16 +402,6 @@ xf86EloReadInput(InputInfoPtr pInfo) EloPrivatePtr priv = (EloPrivatePtr)(pInfo->private); int cur_x, cur_y; int state; -#if GET_ABI_MAJOR(XINPUT_ABI) == 0 - int first = 0; /* since convert is expecting 0 */ - int num = 2; /* since convert is expecting 0 */ - int v0 = 0; /* = cur_x - based on the debug output this is what v0 is */ - int v1 = 0; /* = cur_y based on the debug output this is what v0 is */ - int v2 = 0; /* not used in convert */ - int v3 = 0; /* not used in convert */ - int v4 = 0; /* not used in convert */ - int v5 = 0; /* not used in convert */ -#endif DBG(4, ErrorF("Entering ReadInput\n")); @@ -436,31 +426,6 @@ xf86EloReadInput(InputInfoPtr pInfo) cur_x = WORD_ASSEMBLY(priv->packet_buf[3], priv->packet_buf[4]); cur_y = WORD_ASSEMBLY(priv->packet_buf[5], priv->packet_buf[6]); state = priv->packet_buf[2] & 0x07; -#if GET_ABI_MAJOR(XINPUT_ABI) == 0 - /* - * MHALAS: Based on the description in xf86XInputSetScreen - * this code must be called from ReadInput BEFORE any events - * are posted but this method is called FROM xf86PostMotionEvent - * Therefore I have moved this method into xf86EloReadInput - */ - /* - * Need to check if still on the correct screen. - * This call is here so that this work can be done after - * calib and before posting the event. - */ - - DBG(3, ErrorF("EloConvert Before Fix: Screen(%d) - x(%d), y(%d)\n", priv->screen_no, cur_x, cur_y)); - v0 = cur_x; /* based on the debug output this is what v0 is */ - v1 = cur_y; /* based on the debug output this is what v1 is */ - /* - * Use the conversion method to send correct coordinates - * since it contains all necessary logic - */ - xf86EloConvert(pInfo, first, num, v0, v1, v2, v3, v4, v5, &cur_x, &cur_y); - DBG(3, ErrorF("EloConvert During Fix: Screen(%d) - x(%d), y(%d)\n", priv->screen_no, cur_x, cur_y)); - xf86XInputSetScreen(pInfo, priv->screen_no, cur_x, cur_y); - DBG(3, ErrorF("EloConvert After Fix: Screen(%d) - x(%d), y(%d)\n", priv->screen_no, cur_x, cur_y)); -#endif /* * Send events. @@ -776,10 +741,8 @@ xf86EloControl(DeviceIntPtr dev, unsigned char map[] = { 0, 1 }; unsigned char req[ELO_PACKET_SIZE]; unsigned char reply[ELO_PACKET_SIZE]; -#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 7 Atom btn_label; Atom axis_labels[2] = { 0, 0 }; -#endif switch(mode) { @@ -797,11 +760,7 @@ xf86EloControl(DeviceIntPtr dev, /* * Device reports button press for up to 1 button. */ - if (InitButtonClassDeviceStruct(dev, 1, -#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 7 - &btn_label, -#endif - map) == FALSE) { + if (InitButtonClassDeviceStruct(dev, 1, &btn_label, map) == FALSE) { ErrorF("Unable to allocate Elographics touchscreen ButtonClassDeviceStruct\n"); return !Success; } @@ -821,13 +780,7 @@ xf86EloControl(DeviceIntPtr dev, * max and min values scaled from the approximate size of the * screen to fit one meter. */ - if (InitValuatorClassDeviceStruct(dev, 2, -#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 7 - axis_labels, -#endif -#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) < 3 - xf86GetMotionEvents, -#endif + if (InitValuatorClassDeviceStruct(dev, 2, axis_labels, pInfo->history_size, Absolute) == FALSE) { ErrorF("Unable to allocate Elographics touchscreen ValuatorClassDeviceStruct\n"); return !Success; @@ -835,17 +788,13 @@ xf86EloControl(DeviceIntPtr dev, else { /* I will map coordinates myself */ InitValuatorAxisStruct(dev, 0, -#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 7 axis_labels[0], -#endif -1, -1, 9500, 0 /* min_res */, 9500 /* max_res */); InitValuatorAxisStruct(dev, 1, -#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 7 axis_labels[1], -#endif -1, -1, 10500, 0 /* min_res */, commit 7f35fe7d26c48622896fec8cab475f510601802b Author: Peter Hutterer <[email protected]> Date: Fri Dec 3 09:23:15 2010 +1000 Replace LocalDevicePtr with InputInfoPtr Both describe the same struct, LocalDevicePtr has been removed from the server. Signed-off-by: Peter Hutterer <[email protected]> Reviewed-by: Cyril Brulebois <[email protected]> diff --git a/src/xf86Elo.c b/src/xf86Elo.c index 876f318..924916b 100644 --- a/src/xf86Elo.c +++ b/src/xf86Elo.c @@ -314,7 +314,7 @@ xf86EloGetPacket(unsigned char *buffer, *************************************************************************** */ static Bool -xf86EloConvert(LocalDevicePtr local, +xf86EloConvert(InputInfoPtr pInfo, int first, int num, int v0, @@ -326,7 +326,7 @@ xf86EloConvert(LocalDevicePtr local, int *x, int *y) { - EloPrivatePtr priv = (EloPrivatePtr) local->private; + EloPrivatePtr priv = (EloPrivatePtr) pInfo->private; int width = priv->max_x - priv->min_x; int height = priv->max_y - priv->min_y; int input_x, input_y; @@ -363,7 +363,7 @@ xf86EloConvert(LocalDevicePtr local, * This call is here so that this work can be done after * calib and before posting the event. */ -/* xf86XInputSetScreen(local, priv->screen_no, *x, *y); */ +/* xf86XInputSetScreen(pInfo, priv->screen_no, *x, *y); */ DBG(3, ErrorF("EloConvert: Screen(%d) - x(%d), y(%d)\n", priv->screen_no, *x, *y)); @@ -397,9 +397,9 @@ xf86EloConvert(LocalDevicePtr local, *************************************************************************** */ static void -xf86EloReadInput(LocalDevicePtr local) +xf86EloReadInput(InputInfoPtr pInfo) { - EloPrivatePtr priv = (EloPrivatePtr)(local->private); + EloPrivatePtr priv = (EloPrivatePtr)(pInfo->private); int cur_x, cur_y; int state; #if GET_ABI_MAJOR(XINPUT_ABI) == 0 @@ -423,7 +423,7 @@ xf86EloReadInput(LocalDevicePtr local) if(xf86EloGetPacket(priv->packet_buf, &priv->packet_buf_p, &priv->checksum, - local->fd) != Success) + pInfo->fd) != Success) continue; /* @@ -456,9 +456,9 @@ xf86EloReadInput(LocalDevicePtr local) * Use the conversion method to send correct coordinates * since it contains all necessary logic */ - xf86EloConvert(local, first, num, v0, v1, v2, v3, v4, v5, &cur_x, &cur_y); + xf86EloConvert(pInfo, first, num, v0, v1, v2, v3, v4, v5, &cur_x, &cur_y); DBG(3, ErrorF("EloConvert During Fix: Screen(%d) - x(%d), y(%d)\n", priv->screen_no, cur_x, cur_y)); - xf86XInputSetScreen(local, priv->screen_no, cur_x, cur_y); + xf86XInputSetScreen(pInfo, priv->screen_no, cur_x, cur_y); DBG(3, ErrorF("EloConvert After Fix: Screen(%d) - x(%d), y(%d)\n", priv->screen_no, cur_x, cur_y)); #endif @@ -469,13 +469,13 @@ xf86EloReadInput(LocalDevicePtr local) * location has changed as DIX assumes this. This is why we always * emit a motion, regardless of the kind of packet processed. */ - xf86PostMotionEvent(local->dev, TRUE, 0, 2, cur_x, cur_y); + xf86PostMotionEvent(pInfo->dev, TRUE, 0, 2, cur_x, cur_y); /* * Emit a button press or release. */ if (state == ELO_PRESS || state == ELO_RELEASE) { - xf86PostButtonEvent(local->dev, TRUE, 1, state == ELO_PRESS, 0, 2, cur_x, cur_y); + xf86PostButtonEvent(pInfo->dev, TRUE, 1, state == ELO_PRESS, 0, 2, cur_x, cur_y); } DBG(3, ErrorF("TouchScreen: x(%d), y(%d), %s\n", @@ -483,7 +483,7 @@ xf86EloReadInput(LocalDevicePtr local) (state == ELO_PRESS) ? "Press" : ((state == ELO_RELEASE) ? "Release" : "Stream"))); } } - while (xf86WaitForInput(local->fd, 0) > 0); /* don't wait, just check */ + while (xf86WaitForInput(pInfo->fd, 0) > 0); /* don't wait, just check */ } @@ -771,8 +771,8 @@ static Bool xf86EloControl(DeviceIntPtr dev, int mode) { - LocalDevicePtr local = (LocalDevicePtr) dev->public.devicePrivate; - EloPrivatePtr priv = (EloPrivatePtr)(local->private); + InputInfoPtr pInfo = (InputInfoPtr) dev->public.devicePrivate; + EloPrivatePtr priv = (EloPrivatePtr)(pInfo->private); unsigned char map[] = { 0, 1 }; unsigned char req[ELO_PACKET_SIZE]; unsigned char reply[ELO_PACKET_SIZE]; @@ -828,7 +828,7 @@ xf86EloControl(DeviceIntPtr dev, #if GET_ABI_MAJOR(ABI_XINPUT_VERSION) < 3 xf86GetMotionEvents, #endif - local->history_size, Absolute) == FALSE) { + pInfo->history_size, Absolute) == FALSE) { ErrorF("Unable to allocate Elographics touchscreen ValuatorClassDeviceStruct\n"); return !Success; } @@ -859,7 +859,7 @@ xf86EloControl(DeviceIntPtr dev, /* * Allocate the motion events buffer. */ - xf86MotionHistoryAllocate(local); + xf86MotionHistoryAllocate(pInfo); DBG(2, ErrorF("Done.\n")); @@ -869,11 +869,11 @@ xf86EloControl(DeviceIntPtr dev, case DEVICE_ON: DBG(2, ErrorF("Elographics touchscreen on...\n")); - if (local->fd < 0) { + if (pInfo->fd < 0) { DBG(2, ErrorF("Elographics touchscreen opening : %s\n", priv->input_dev)); - local->fd = xf86OpenSerial(local->options); - if (local->fd < 0) { + pInfo->fd = xf86OpenSerial(pInfo->options); + if (pInfo->fd < 0) { Error("Unable to open Elographics touchscreen device"); return !Success; } @@ -886,7 +886,7 @@ xf86EloControl(DeviceIntPtr dev, */ memset(req, 0, ELO_PACKET_SIZE); req[1] = tolower(ELO_PARAMETER); - if (xf86EloSendQuery(req, reply, local->fd) != Success) { + if (xf86EloSendQuery(req, reply, pInfo->fd) != Success) { priv->is_a_2310 = 1; ErrorF("Not at the specified rate or model 2310, will continue\n"); } @@ -896,7 +896,7 @@ xf86EloControl(DeviceIntPtr dev, */ memset(req, 0, ELO_PACKET_SIZE); req[1] = tolower(ELO_ID); - if (xf86EloSendQuery(req, reply, local->fd) == Success) { + if (xf86EloSendQuery(req, reply, pInfo->fd) == Success) { xf86EloPrintIdent(reply, priv); } else { @@ -911,7 +911,7 @@ xf86EloControl(DeviceIntPtr dev, req[1] = ELO_MODE; req[3] = ELO_TOUCH_MODE | ELO_STREAM_MODE | ELO_UNTOUCH_MODE; req[4] = ELO_TRACKING_MODE; - if (xf86EloSendControl(req, local->fd) != Success) { + if (xf86EloSendControl(req, pInfo->fd) != Success) { DBG(2, ErrorF("Unable to change Elographics touchscreen operating mode... Maybe it's GeneralTouch touchscreen...\n")); } @@ -922,11 +922,11 @@ xf86EloControl(DeviceIntPtr dev, req[1] = ELO_REPORT; req[2] = priv->untouch_delay; req[3] = priv->report_delay; - if (xf86EloSendControl(req, local->fd) != Success) { + if (xf86EloSendControl(req, pInfo->fd) != Success) { DBG(2, ErrorF("Unable to change Elographics touchscreen reports timings... Maybe it's GeneralTouch touchscreen...\n")); } } - xf86AddEnabledDevice(local); + xf86AddEnabledDevice(pInfo); dev->public.on = TRUE; } @@ -941,11 +941,11 @@ xf86EloControl(DeviceIntPtr dev, case DEVICE_OFF: DBG(2, ErrorF("Elographics touchscreen off...\n")); dev->public.on = FALSE; - if (local->fd >= 0) { - xf86RemoveEnabledDevice(local); + if (pInfo->fd >= 0) { + xf86RemoveEnabledDevice(pInfo); } - SYSCALL(close(local->fd)); - local->fd = -1; + SYSCALL(close(pInfo->fd)); + pInfo->fd = -1; DBG(2, ErrorF("Done\n")); return Success; @@ -956,11 +956,11 @@ xf86EloControl(DeviceIntPtr dev, case DEVICE_CLOSE: DBG(2, ErrorF("Elographics touchscreen close...\n")); dev->public.on = FALSE; - if (local->fd >= 0) { - xf86RemoveEnabledDevice(local); + if (pInfo->fd >= 0) { + xf86RemoveEnabledDevice(pInfo); } - SYSCALL(close(local->fd)); - local->fd = -1; + SYSCALL(close(pInfo->fd)); + pInfo->fd = -1; DBG(2, ErrorF("Done\n")); return Success; @@ -977,19 +977,19 @@ xf86EloControl(DeviceIntPtr dev, * *************************************************************************** */ -static LocalDevicePtr +static InputInfoPtr xf86EloAllocate(InputDriverPtr drv, IDevPtr dev) { - LocalDevicePtr local; + InputInfoPtr pInfo; EloPrivatePtr priv; priv = malloc(sizeof(EloPrivateRec)); if (!priv) return NULL; - local = xf86AllocateInput(drv, 0); + pInfo = xf86AllocateInput(drv, 0); - if (!local) { + if (!pInfo) { free(priv); return NULL; } @@ -1010,37 +1010,37 @@ xf86EloAllocate(InputDriverPtr drv, IDevPtr dev) priv->packet_buf_p = 0; priv->swap_axes = 0; - local->name = xstrdup(dev->identifier); - local->flags = 0 /* XI86_NO_OPEN_ON_INIT */; - local->device_control = xf86EloControl; - local->read_input = xf86EloReadInput; - local->control_proc = NULL; - local->close_proc = NULL; - local->switch_mode = NULL; - local->conversion_proc = xf86EloConvert; - local->reverse_conversion_proc = NULL; - local->fd = -1; - local->atom = 0; - local->dev = NULL; - local->private = priv; - local->type_name = "Elographics TouchScreen"; - local->history_size = 0; - - return local; + pInfo->name = xstrdup(dev->identifier); + pInfo->flags = 0 /* XI86_NO_OPEN_ON_INIT */; + pInfo->device_control = xf86EloControl; + pInfo->read_input = xf86EloReadInput; + pInfo->control_proc = NULL; + pInfo->close_proc = NULL; + pInfo->switch_mode = NULL; + pInfo->conversion_proc = xf86EloConvert; + pInfo->reverse_conversion_proc = NULL; + pInfo->fd = -1; + pInfo->atom = 0; + pInfo->dev = NULL; + pInfo->private = priv; + pInfo->type_name = "Elographics TouchScreen"; + pInfo->history_size = 0; + + return pInfo; } static void xf86EloUninit(InputDriverPtr drv, - LocalDevicePtr local, + InputInfoPtr pInfo, int flags) { - EloPrivatePtr priv = (EloPrivatePtr) local->private; + EloPrivatePtr priv = (EloPrivatePtr) pInfo->private; free(priv->input_dev); free(priv); - local->private = NULL; - xf86DeleteInput(local, 0); + pInfo->private = NULL; + xf86DeleteInput(pInfo, 0); } static const char *default_options[] = { @@ -1057,7 +1057,7 @@ xf86EloInit(InputDriverPtr drv, IDevPtr dev, int flags) { - LocalDevicePtr local=NULL; + InputInfoPtr pInfo=NULL; EloPrivatePtr priv=NULL; char *str; int portrait = 0; @@ -1066,18 +1066,18 @@ xf86EloInit(InputDriverPtr drv, Model* model; - local = xf86EloAllocate(drv, dev); - if (!local) { + pInfo = xf86EloAllocate(drv, dev); + if (!pInfo) { return NULL; } - priv = local->private; - local->conf_idev = dev; + priv = pInfo->private; + pInfo->conf_idev = dev; - xf86CollectInputOptions(local, default_options, NULL); + xf86CollectInputOptions(pInfo, default_options, NULL); /* Process the common options. */ - xf86ProcessCommonOptions(local, local->options); + xf86ProcessCommonOptions(pInfo, pInfo->options); - str = xf86FindOptionValue(local->options, "Device"); + str = xf86FindOptionValue(pInfo->options, "Device"); if (!str) { xf86Msg(X_ERROR, "%s: No Device specified in Elographics module config.\n", dev->identifier); @@ -1087,11 +1087,11 @@ xf86EloInit(InputDriverPtr drv, } free(priv); } - return local; + return pInfo; } priv->input_dev = strdup(str); - opt_model = xf86SetStrOption(local->options, "Model", NULL); + opt_model = xf86SetStrOption(pInfo->options, "Model", NULL); model = SupportedModels; priv->model = MODEL_UNKNOWN; while(model->type != MODEL_UNKNOWN && opt_model) @@ -1104,27 +1104,27 @@ xf86EloInit(InputDriverPtr drv, 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); + pInfo->name = xf86SetStrOption(pInfo->options, "DeviceName", XI_TOUCHSCREEN); + xf86Msg(X_CONFIG, "Elographics X device name: %s\n", pInfo->name); + priv->screen_no = xf86SetIntOption(pInfo->options, "ScreenNo", 0); xf86Msg(X_CONFIG, "Elographics associated screen: %d\n", priv->screen_no); - priv->untouch_delay = xf86SetIntOption(local->options, "UntouchDelay", ELO_UNTOUCH_DELAY); + priv->untouch_delay = xf86SetIntOption(pInfo->options, "UntouchDelay", ELO_UNTOUCH_DELAY); xf86Msg(X_CONFIG, "Elographics untouch delay: %d ms\n", priv->untouch_delay*10); - priv->report_delay = xf86SetIntOption(local->options, "ReportDelay", ELO_REPORT_DELAY); + priv->report_delay = xf86SetIntOption(pInfo->options, "ReportDelay", ELO_REPORT_DELAY); xf86Msg(X_CONFIG, "Elographics report delay: %d ms\n", priv->report_delay*10); - priv->max_x = xf86SetIntOption(local->options, "MaxX", 3000); + priv->max_x = xf86SetIntOption(pInfo->options, "MaxX", 3000); xf86Msg(X_CONFIG, "Elographics maximum x position: %d\n", priv->max_x); - priv->min_x = xf86SetIntOption(local->options, "MinX", 0); + priv->min_x = xf86SetIntOption(pInfo->options, "MinX", 0); xf86Msg(X_CONFIG, "Elographics minimum x position: %d\n", priv->min_x); - priv->max_y = xf86SetIntOption(local->options, "MaxY", 3000); + priv->max_y = xf86SetIntOption(pInfo->options, "MaxY", 3000); xf86Msg(X_CONFIG, "Elographics maximum y position: %d\n", priv->max_y); - priv->min_y = xf86SetIntOption(local->options, "MinY", 0); + priv->min_y = xf86SetIntOption(pInfo->options, "MinY", 0); xf86Msg(X_CONFIG, "Elographics minimum y position: %d\n", priv->min_y); - priv->swap_axes = xf86SetBoolOption(local->options, "SwapXY", 0); + priv->swap_axes = xf86SetBoolOption(pInfo->options, "SwapXY", 0); if (priv->swap_axes) { xf86Msg(X_CONFIG, "Elographics device will work with X and Y axes swapped\n"); } - debug_level = xf86SetIntOption(local->options, "DebugLevel", 0); + debug_level = xf86SetIntOption(pInfo->options, "DebugLevel", 0); if (debug_level) { #if DEBUG xf86Msg(X_CONFIG, "Elographics debug level sets to %d\n", debug_level); @@ -1132,7 +1132,7 @@ xf86EloInit(InputDriverPtr drv, xf86Msg(X_INFO, "Elographics debug not available\n"); #endif } - str = xf86SetStrOption(local->options, "PortraitMode", "Landscape"); + str = xf86SetStrOption(pInfo->options, "PortraitMode", "Landscape"); if (strcmp(str, "Portrait") == 0) { portrait = 1; } @@ -1149,14 +1149,14 @@ xf86EloInit(InputDriverPtr drv, height = priv->max_y - priv->min_y; if (width == 0) { xf86Msg(X_ERROR, "Elographics: Cannot configure touchscreen with width 0\n"); - return local; + return pInfo; } else if (width < 0) { xf86Msg(X_INFO, "Elographics: reverse x mode (minimum x position >= maximum x position)\n"); } if (height == 0) { xf86Msg(X_ERROR, "Elographics: Cannot configure touchscreen with height 0\n"); - return local; + return pInfo; } else if (height < 0) { xf86Msg(X_INFO, "Elographics: reverse y mode (minimum y position >= maximum y position)\n"); @@ -1184,8 +1184,8 @@ xf86EloInit(InputDriverPtr drv, } /* mark the device configured */ - local->flags |= XI86_CONFIGURED; - return local; + pInfo->flags |= XI86_CONFIGURED; + return pInfo; } _X_EXPORT InputDriverRec ELOGRAPHICS = { commit 0f3df8923d4d48b24b565becefa12d676c48a61a Author: Peter Hutterer <[email protected]> Date: Fri Dec 3 09:21:23 2010 +1000 unifdef XFree86LOADER Signed-off-by: Peter Hutterer <[email protected]> Reviewed-by: Cyril Brulebois <[email protected]> diff --git a/src/xf86Elo.c b/src/xf86Elo.c index 6887a66..876f318 100644 --- a/src/xf86Elo.c +++ b/src/xf86Elo.c @@ -50,20 +50,13 @@ #include "xorgVersion.h" -#ifndef XFree86LOADER -#include <unistd.h> -#include <errno.h> -#endif - #include "misc.h" #include "xf86.h" #include "xf86_OSproc.h" #include "xf86Xinput.h" #include "exevents.h" -#ifdef XFree86LOADER #include "xf86Module.h" -#endif /** -- To UNSUBSCRIBE, email to [email protected] with a subject of "unsubscribe". Trouble? Contact [email protected] Archive: http://lists.debian.org/[email protected]

