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 17:18:07 +1030 |
commit | 39263dc65d5240f74fd5f1b0ec5bdf53a007d5e9 (patch) | |
tree | 26292bb9ef02f9ea000e617ae0aab0328b1b8b7e /src/emuMB.c | |
parent | 57521e4e60c47b4683910d7f3cec42d1fa276810 (diff) |
Tidy up evdev.h
This includes shuffling some functions around so we don't need the prototypes
in evdev.h.
(cherry picked from commit 0405f7b17fb0ce5cadcc6c5aa6eeb61bdacdf9cd)
Diffstat (limited to 'src/emuMB.c')
-rw-r--r-- | src/emuMB.c | 52 |
1 files changed, 26 insertions, 26 deletions
diff --git a/src/emuMB.c b/src/emuMB.c index 8e8e2ac..ab6dae9 100644 --- a/src/emuMB.c +++ b/src/emuMB.c @@ -342,6 +342,32 @@ EvdevMBEmuEnable(InputInfoPtr pInfo, BOOL enable) #ifdef HAVE_PROPERTIES +int +EvdevMBEmuSetProperty(DeviceIntPtr dev, Atom atom, XIPropertyValuePtr val, + BOOL checkonly) +{ + InputInfoPtr pInfo = dev->public.devicePrivate; + EvdevPtr pEvdev = pInfo->private; + + if (atom == prop_mbemu) + { + if (val->format != 8 || val->size != 1 || val->type != XA_INTEGER) + return BadMatch; + + if (!checkonly) + pEvdev->emulateMB.enabled = *((BOOL*)val->data); + } else if (atom == prop_mbtimeout) + { + if (val->format != 16 || val->size != 1 || val->type != XA_INTEGER) + return BadMatch; + + if (!checkonly) + pEvdev->emulateMB.timeout = *((INT16*)val->data); + } + + return Success; +} + /** * Initialise property for MB emulation on/off. */ @@ -376,30 +402,4 @@ EvdevMBEmuInitProperty(DeviceIntPtr dev) XIRegisterPropertyHandler(dev, EvdevMBEmuSetProperty, NULL, NULL); } - -int -EvdevMBEmuSetProperty(DeviceIntPtr dev, Atom atom, XIPropertyValuePtr val, - BOOL checkonly) -{ - InputInfoPtr pInfo = dev->public.devicePrivate; - EvdevPtr pEvdev = pInfo->private; - - if (atom == prop_mbemu) - { - if (val->format != 8 || val->size != 1 || val->type != XA_INTEGER) - return BadMatch; - - if (!checkonly) - pEvdev->emulateMB.enabled = *((BOOL*)val->data); - } else if (atom == prop_mbtimeout) - { - if (val->format != 16 || val->size != 1 || val->type != XA_INTEGER) - return BadMatch; - - if (!checkonly) - pEvdev->emulateMB.timeout = *((INT16*)val->data); - } - - return Success; -} #endif |