summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2009-05-20 15:28:16 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2009-05-22 15:44:50 +1000
commitb12d302df8283186ce87882c29b2b0294adb2770 (patch)
tree7b2f4ce175d1a1aec64a354b922429b50dcc8bde /include
parentadd2defac7e59dcb355e5ba12b6de60861741d57 (diff)
Input: rename DeviceIntRec->isMaster to ->type.
isMaster is not enough as long as we differ between master pointers and keyboard. With flexible device classes, the usual checks for whether a master device is a pointer (currently check for ->button, ->valuators or ->key) do not work as an SD may post an event through a master and mess this check up. Example, a device with valuators but no buttons would remove the button class from the VCP and thus result in the IsPointerDevice(inputInfo.pointer) == FALSE. This will become worse in the future when new device classes are introduced that aren't provided in the current system (e.g. a switch class). This patch replaces isMaster with "type", one of SLAVE, MASTER_POINTER and MASTER_KEYBOARD. All checks for dev->isMaster are replaced with an IsMaster(dev).
Diffstat (limited to 'include')
-rw-r--r--include/dix.h1
-rw-r--r--include/inputstr.h7
2 files changed, 7 insertions, 1 deletions
diff --git a/include/dix.h b/include/dix.h
index 781198202..d4bec5f20 100644
--- a/include/dix.h
+++ b/include/dix.h
@@ -580,6 +580,7 @@ extern Bool DevHasCursor(DeviceIntPtr pDev);
extern Bool IsPointerDevice( DeviceIntPtr dev);
extern Bool IsKeyboardDevice(DeviceIntPtr dev);
extern Bool IsPointerEvent(InternalEvent *event);
+extern Bool IsMaster(DeviceIntPtr dev);
/*
* These are deprecated compatibility functions and will be removed soon!
diff --git a/include/inputstr.h b/include/inputstr.h
index 0fd348812..5c74ba391 100644
--- a/include/inputstr.h
+++ b/include/inputstr.h
@@ -458,6 +458,11 @@ typedef struct _SpriteInfoRec {
pointer that owns the sprite. */
} SpriteInfoRec, *SpriteInfoPtr;
+/* device types */
+#define MASTER_POINTER 1
+#define MASTER_KEYBOARD 2
+#define SLAVE 3
+
typedef struct _DeviceIntRec {
DeviceRec public;
DeviceIntPtr next;
@@ -470,7 +475,7 @@ typedef struct _DeviceIntRec {
Bool enabled; /* TRUE if ON returns Success */
Bool coreEvents; /* TRUE if device also sends core */
GrabInfoRec deviceGrab; /* grab on the device */
- Bool isMaster; /* TRUE if device is master */
+ int type; /* MASTER_POINTER, MASTER_KEYBOARD, SLAVE */
Atom xinput_type;
char *name;
CARD8 id;