diff options
author | Peter Hutterer <peter.hutterer@redhat.com> | 2008-10-14 16:21:00 +1030 |
---|---|---|
committer | Peter Hutterer <peter.hutterer@redhat.com> | 2008-10-14 16:22:00 +1030 |
commit | 0405f7b17fb0ce5cadcc6c5aa6eeb61bdacdf9cd (patch) | |
tree | 62b39a8ae96f4eb9b62020c8d4107273b8f1392f /src/draglock.c | |
parent | 088e0a175a4913bf827c1f7e19de09fdf987d347 (diff) |
Tidy up evdev.h
This includes shuffling some functions around so we don't need the prototypes
in evdev.h.
Diffstat (limited to 'src/draglock.c')
-rw-r--r-- | src/draglock.c | 79 |
1 files changed, 40 insertions, 39 deletions
diff --git a/src/draglock.c b/src/draglock.c index e1f037a..631da17 100644 --- a/src/draglock.c +++ b/src/draglock.c @@ -211,45 +211,6 @@ EvdevDragLockFilterEvent(InputInfoPtr pInfo, unsigned int button, int value) #ifdef HAVE_PROPERTIES /** - * Initialise property for drag lock buttons setting. - */ -void -EvdevDragLockInitProperty(DeviceIntPtr dev) -{ - InputInfoPtr pInfo = dev->public.devicePrivate; - EvdevPtr pEvdev = pInfo->private; - - if (!dev->button) /* don't init prop for keyboards */ - return; - - prop_dlock = MakeAtom(EVDEV_PROP_DRAGLOCK, strlen(EVDEV_PROP_DRAGLOCK), TRUE); - if (pEvdev->dragLock.meta) - { - XIChangeDeviceProperty(dev, prop_dlock, XA_INTEGER, 8, - PropModeReplace, 1, &pEvdev->dragLock.meta, - FALSE); - } else { - int highest = 0; - int i; - CARD8 pair[EVDEV_MAXBUTTONS] = {0}; - - for (i = 0; i < EVDEV_MAXBUTTONS; i++) - { - if (pEvdev->dragLock.lock_pair[i]) - highest = i; - pair[i] = pEvdev->dragLock.lock_pair[i]; - } - - XIChangeDeviceProperty(dev, prop_dlock, XA_INTEGER, 8, PropModeReplace, - highest + 1, pair, FALSE); - } - - XISetDevicePropertyDeletable(dev, prop_dlock, FALSE); - - XIRegisterPropertyHandler(dev, EvdevDragLockSetProperty, NULL, NULL); -} - -/** * Set the drag lock property. * If only one value is supplied, then this is used as the meta button. * If more than one value is supplied, then each value is the drag lock button @@ -314,4 +275,44 @@ EvdevDragLockSetProperty(DeviceIntPtr dev, Atom atom, XIPropertyValuePtr val, return Success; } + +/** + * Initialise property for drag lock buttons setting. + */ +void +EvdevDragLockInitProperty(DeviceIntPtr dev) +{ + InputInfoPtr pInfo = dev->public.devicePrivate; + EvdevPtr pEvdev = pInfo->private; + + if (!dev->button) /* don't init prop for keyboards */ + return; + + prop_dlock = MakeAtom(EVDEV_PROP_DRAGLOCK, strlen(EVDEV_PROP_DRAGLOCK), TRUE); + if (pEvdev->dragLock.meta) + { + XIChangeDeviceProperty(dev, prop_dlock, XA_INTEGER, 8, + PropModeReplace, 1, &pEvdev->dragLock.meta, + FALSE); + } else { + int highest = 0; + int i; + CARD8 pair[EVDEV_MAXBUTTONS] = {0}; + + for (i = 0; i < EVDEV_MAXBUTTONS; i++) + { + if (pEvdev->dragLock.lock_pair[i]) + highest = i; + pair[i] = pEvdev->dragLock.lock_pair[i]; + } + + XIChangeDeviceProperty(dev, prop_dlock, XA_INTEGER, 8, PropModeReplace, + highest + 1, pair, FALSE); + } + + XISetDevicePropertyDeletable(dev, prop_dlock, FALSE); + + XIRegisterPropertyHandler(dev, EvdevDragLockSetProperty, NULL, NULL); +} + #endif |