Make XAnyDeviceHierarchyChangeInfo a union of the possible types.
authorPeter Hutterer <peter@cs.unisa.edu.au>
Thu, 14 Feb 2008 06:03:03 +0000 (16:33 +1030)
committerPeter Hutterer <peter@cs.unisa.edu.au>
Thu, 14 Feb 2008 06:03:03 +0000 (16:33 +1030)
Kinda the same as the XEvent union.

Some whitespace fixes too.

XInput.h

index 774c496..8b28a94 100644 (file)
--- a/XInput.h
+++ b/XInput.h
@@ -999,13 +999,8 @@ typedef struct {
 
 
 /*******************************************************************
- * 
+ *
  */
-
-typedef struct {
-    int                 type;
-} XAnyHierarchyChangeInfo;
-
 typedef struct {
     int                 type;
     char*               name;
@@ -1025,9 +1020,17 @@ typedef struct {
     int                 type;
     XDevice*            device;
     int                 changeMode; /* AttachToMaster, Floating */
-    XDevice*            newMaster;                    
+    XDevice*            newMaster;
 } XChangeAttachmentInfo;
 
+typedef union {
+    int                   type; /* must be first element */
+    XCreateMasterInfo     create;
+    XRemoveMasterInfo     remove;
+    XChangeAttachmentInfo change;
+} XAnyHierarchyChangeInfo;
+
+
 /*******************************************************************
  *
  * Function definitions.