diff options
author | Peter Hutterer <peter.hutterer@who-t.net> | 2008-07-07 22:10:17 +0930 |
---|---|---|
committer | Peter Hutterer <peter.hutterer@who-t.net> | 2008-07-10 16:28:34 +0930 |
commit | 2039c6ea43244339659323d05d96c14e41996c20 (patch) | |
tree | 9f396ab16102d5b9199c439b39a087c8afd5247a /include/inputstr.h | |
parent | 4ab01fe5db7fb330b1ec463aa49b77859527e597 (diff) |
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.
Diffstat (limited to 'include/inputstr.h')
-rw-r--r-- | include/inputstr.h | 41 |
1 files changed, 40 insertions, 1 deletions
diff --git a/include/inputstr.h b/include/inputstr.h index e5de6fc31..280774e99 100644 --- a/include/inputstr.h +++ b/include/inputstr.h @@ -335,6 +335,38 @@ typedef struct { } SpriteRec, *SpritePtr; +/* Device properties */ +typedef struct _XIPropertyValue +{ + Atom type; /* ignored by server */ + short format; /* format of data for swapping - 8,16,32 */ + long size; /* size of data in (format/8) bytes */ + pointer data; /* private to client */ +} XIPropertyValueRec; + +typedef struct _XIProperty +{ + struct _XIProperty *next; + Atom propertyName; + Bool is_pending; + Bool range; + Bool immutable; + Bool fromClient; /* created by client or driver/server */ + int num_valid; + INT32 *valid_values; + XIPropertyValueRec current, + pending; +} XIPropertyRec; + +typedef XIPropertyRec *XIPropertyPtr; +typedef XIPropertyValueRec *XIPropertyValuePtr; + +typedef Bool (*XISetDevicePropertyProcPtr) (DeviceIntPtr dev, + Atom property, + XIPropertyValuePtr prop); +typedef Bool (*XIGetDevicePropertyProcPtr) (DeviceIntPtr dev, + Atom property); + /* states for devices */ #define NOT_GRABBED 0 @@ -347,8 +379,9 @@ typedef struct { #define FROZEN_WITH_EVENT 6 #define THAW_OTHERS 7 + typedef struct _GrabInfoRec { - TimeStamp grabTime; + TimeStamp grabTime; Bool fromPassiveGrab; /* true if from passive grab */ Bool implicitGrab; /* implicit from ButtonPress */ GrabRec activeGrab; @@ -431,6 +464,12 @@ typedef struct _DeviceIntRec { int valuators[MAX_VALUATORS]; int numValuators; } last; + + /* Input device property handling */ + XIPropertyPtr properties; + Bool pendingProperties; + XISetDevicePropertyProcPtr SetProperty; + XIGetDevicePropertyProcPtr GetProperty; } DeviceIntRec; typedef struct { |