diff options
author | Peter Hutterer <peter.hutterer@redhat.com> | 2008-09-18 16:44:27 +0930 |
---|---|---|
committer | Peter Hutterer <peter.hutterer@redhat.com> | 2008-09-26 13:23:35 +0930 |
commit | 84a0e39c0dd8bcc80d4f6912562260c1771f311f (patch) | |
tree | 69e7e1ff2582dd095696619294fcecff99177078 /src/evdev.c | |
parent | draglock: Shut up compiler warning. (diff) | |
download | xf86-input-evdev-84a0e39c0dd8bcc80d4f6912562260c1771f311f.tar.gz xf86-input-evdev-84a0e39c0dd8bcc80d4f6912562260c1771f311f.tar.bz2 xf86-input-evdev-84a0e39c0dd8bcc80d4f6912562260c1771f311f.zip |
Use new property API (no ConfigureDP, less args to ChangeDP)
Return appropriate status codes from property handlers.
Make properties non-deletable.
Diffstat (limited to 'src/evdev.c')
-rw-r--r-- | src/evdev.c | 23 |
1 files changed, 11 insertions, 12 deletions
diff --git a/src/evdev.c b/src/evdev.c index 5a58a8f..ec23786 100644 --- a/src/evdev.c +++ b/src/evdev.c @@ -100,7 +100,7 @@ static const char *evdevDefaults[] = { #ifdef HAVE_PROPERTIES typedef struct _PropHandler { void (*init)(DeviceIntPtr dev); - BOOL (*handle)(DeviceIntPtr dev, Atom prop, XIPropertyValuePtr val); + int (*handle)(DeviceIntPtr dev, Atom prop, XIPropertyValuePtr val); } PropHandler; static PropHandler evdevPropHandlers[] = @@ -175,28 +175,27 @@ PostKbdEvent(InputInfoPtr pInfo, struct input_event *ev, int value) } #ifdef HAVE_PROPERTIES -static Bool +static int EvdevSetProperty(DeviceIntPtr dev, Atom property, XIPropertyValuePtr val) { PropHandler *handler = evdevPropHandlers; + int rc; while (handler->init || handler->handle) { - if (handler->handle && !handler->handle(dev, property, val)) - return FALSE; + if (handler->handle) + { + rc = handler->handle(dev, property, val); + if (rc != Success) + return rc; + } handler++; } /* property not handled, report success */ - return TRUE; + return Success; } -static Bool EvdevGetProperty(DeviceIntPtr dev, - Atom property) -{ - /* XXX */ - return TRUE; -} #endif /** @@ -986,7 +985,7 @@ EvdevInit(DeviceIntPtr device) /* We drop the return value, the only time we ever want the handlers to * unregister is when the device dies. In which case we don't have to * unregister anyway */ - XIRegisterPropertyHandler(device, EvdevSetProperty, EvdevGetProperty); + XIRegisterPropertyHandler(device, EvdevSetProperty, NULL, NULL); EvdevInitProperties(device); #endif |