Xi: add support for input device properties.

Basically just copied from randr properties, with minor changes only.
Each device supports arbitrary properties that can be modified by clients.
Modifications to the properties are passed to the driver (if applicable) and
can then affect the configuration of the device.

Note that device properties are limited to a specific device. A property set
on a slave device does not migrate to the master.
This commit is contained in:
Peter Hutterer
2008-07-07 22:10:17 +09:30
parent 4ab01fe5db
commit 2039c6ea43
7 changed files with 912 additions and 6 deletions

View File

@@ -83,6 +83,7 @@ SOFTWARE.
#include "exglobals.h"
#include "exevents.h"
#include "listdev.h" /* for CopySwapXXXClass */
#include "xiproperty.h"
/** @file
* This file handles input device-related stuff.
@@ -173,6 +174,12 @@ AddInputDevice(ClientPtr client, DeviceProc deviceProc, Bool autoStart)
memset(dev->last.valuators, 0, sizeof(dev->last.valuators));
dev->last.numValuators = 0;
/* device properties */
dev->properties = NULL;
dev->SetProperty = NULL;
dev->GetProperty = NULL;
dev->pendingProperties = FALSE;
/* security creation/labeling check
*/
if (XaceHook(XACE_DEVICE_ACCESS, client, dev, DixCreateAccess)) {
@@ -770,6 +777,8 @@ CloseDevice(DeviceIntPtr dev)
if (!dev)
return;
XIDeleteAllDeviceProperties(dev);
if (dev->inited)
(void)(*dev->deviceProc)(dev, DEVICE_CLOSE);