From 84a0e39c0dd8bcc80d4f6912562260c1771f311f Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Thu, 18 Sep 2008 16:44:27 +0930 Subject: Use new property API (no ConfigureDP, less args to ChangeDP) Return appropriate status codes from property handlers. Make properties non-deletable. --- src/evdev.c | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) (limited to 'src/evdev.c') 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 -- cgit v1.2.3