Skip to content

Commit

Permalink
Updated to work with Xorg 1.10.
Browse files Browse the repository at this point in the history
  • Loading branch information
rynbrd committed Apr 14, 2011
1 parent 64e5133 commit 75bbca0
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions driver/mtrack.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@
#define SCALE_THRESHOLD 0.15
#define ROTATE_THRESHOLD 0.15

#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 12
typedef InputInfoPtr LocalDevicePtr;
#endif

/* button mapping simplified */
#define PROPMAP(m, x, y) m[x] = XIGetKnownProperty(y)

Expand Down Expand Up @@ -140,15 +144,23 @@ static int device_init(DeviceIntPtr dev, LocalDevicePtr local)
#endif
mt->caps.abs[MTDEV_POSITION_X].minimum,
mt->caps.abs[MTDEV_POSITION_X].maximum,
#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 12
1, 0, 1, Absolute);
#else
1, 0, 1);
#endif
xf86InitValuatorDefaults(dev, 0);
xf86InitValuatorAxisStruct(dev, 1,
#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 7
axes_labels[1],
#endif
mt->caps.abs[MTDEV_POSITION_Y].minimum,
mt->caps.abs[MTDEV_POSITION_Y].maximum,
#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 12
1, 0, 1, Absolute);
#else
1, 0, 1);
#endif
xf86InitValuatorDefaults(dev, 1);

XIRegisterPropertyHandler(dev, pointer_property, NULL, NULL);
Expand Down Expand Up @@ -248,6 +260,26 @@ static Bool device_control(DeviceIntPtr dev, int mode)
}


#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 12
static int preinit(InputDriverPtr drv, InputInfoPtr pInfo, int flags)
{
struct MTouch *mt;

mt = calloc(1, sizeof(*mt));
if (!mt)
return BadAlloc;

pInfo->private = mt;
pInfo->type_name = XI_TOUCHPAD;
pInfo->device_control = device_control;
pInfo->read_input = read_input;
pInfo->switch_mode = 0;
//xf86CollectInputOptions(local, NULL);
//xf86ProcessCommonOptions(local, local->options);

return Success;
}
#else
static InputInfoPtr preinit(InputDriverPtr drv, IDevPtr dev, int flags)
{
struct MTouch *mt;
Expand Down Expand Up @@ -277,6 +309,7 @@ static InputInfoPtr preinit(InputDriverPtr drv, IDevPtr dev, int flags)
error:
return local;
}
#endif

static void uninit(InputDriverPtr drv, InputInfoPtr local, int flags)
{
Expand Down

0 comments on commit 75bbca0

Please sign in to comment.