[RFC] XI2 draft protocol specification (v 0.1)

Peter Hutterer peter.hutterer at who-t.net
Tue Feb 10 20:28:47 PST 2009


Thanks for the comments. All your suggestions have been added, but I'll
refrain from commenting on them much (the spec has to work on it's own
eventually).

Please see the diff below your comments. Is that clearer now?

On Mon, Feb 09, 2009 at 03:57:48PM +0100, Simon Thum wrote:
> Peter Hutterer wrote:
> > FP1616
> >         Fixed point decimal in 16.16 format as 32 bit integer. The client is
> >         required to convert to 16.16 decimal format.
> Maybe it's just me, but I don't really get what "16.16 decimal format"
> means.
> 
> >     ┌───
> >         XIChangeDeviceHierarchy
> >             num_changes:     CARD8
> >             changes:         LISTofHIERARCHYCHANGES
> >     └───
> > 
> >     HIERARCHYCHANGE { CREATEMASTER, REMOVEMASTER, CHANGEATTACHMENT }
> > 
> >     HIERARCHYCHANGETYPE { CreateMaster, RemoveMaster, ChangeAttachment }
> > 
> >     CHANGEMODE { Float, Attach }
> I'd split HIERARCHYCHANGE into four: CM, RM, DetachSlave, AttachSlave -
> thereby getting rid of CHANGEMODE.
> 
> >     The server processes the changes one by one and applies changes
> >     immediately. If an error occurs, processing stops at the current change
> >     and the error is returned to the client.
> The point it stopped might be interesting to the client (only if it's
> easy to report)
> 
> > ┌───
> >         XISetClientPointer
> >             win:             Window
> >             ▶
> >             set:             BOOL
> >             deviceid:        DEVICEID
> >     └───
> > 
> >     Query the ClientPointer for the client owning 'win'.
> I guess XI*G*etClientPointer is meant.
> 
> 
> 
> >     ┌───
> >         RawEvent
> >             EVENTHEADER
> >             eventtype:                 RAWTYPE
> >             detail:                    CARD32
> >             buttons_len:               CARD16
> >             valuators_len:             CARD16
> >             buttons:                   SETofBUTTONMASK
> >             valuators:                 SETofVALUATORMASK
> >             valuators_unaccel:         SETofVALUATORMASK
> >             axisvalues:                LISTofFP3232
> >             axisvalues_unaccel:        LISTofFP3232
> >     └───
> > 
> >     RAWTYPE { Motion, KeyPress, KeyRelease, ButtonPress, ButtonRelease }
> > 
> >     A RawDevice event provides the information provided by the driver to the
> >     client. RawDevice events are only generated for slave devices.
> >     Unaccelerated and accelerated valuator data is provided if applicable.
> Of course acceleration is, right now, the only thing that could happen
> to valuators after the driver is finished, but I'd avoid a direct
> reference to it in the spec. (un-)transformed or adjusted seems a better
> choice to me. Or 'raw'.
> 
> >     valuators
> >         Bitmask of valuators provided in 'axisvalues'.
> >     valuators_unaccel
> >         Bitmask of valuators provided in 'axisvalues_unaccel'.
> It might make sense to say something about their correlation, i.e. will
> both be reported when available? The description: 'Unaccelerated and
> accelerated valuator data is provided if applicable.' may mean: 'If an
> axis is accelerated/translated, the server may/must omit the
> untranslated value'.
> IOW, what exactly is 'applicable'?

diff --git a/XI2proto.txt b/XI2proto.txt
index 6bbb89d..cd64b61 100644
--- a/XI2proto.txt
+++ b/XI2proto.txt
@@ -130,8 +130,9 @@ EVENTMASK
         A SETofEVENTMASK is a binary OR of zero or more EVENTMASK.
 
 FP1616
-        Fixed point decimal in 16.16 format as 32 bit integer. The client is
-        required to convert to 16.16 decimal format.
+        Fixed point decimal in 16.16 format as 32 bit integer in the form of
+        (value * 10e15). The client is required to convert to 16.16 decimal
+        format.
 
 FP3232
         Fixed point decimal in 32.32 format as one INT32 and one CARD32.
@@ -450,9 +451,10 @@ XI2. Clients should ignore this data.
             changes:         LISTofHIERARCHYCHANGES
     └───
 
-    HIERARCHYCHANGE { CREATEMASTER, REMOVEMASTER, CHANGEATTACHMENT }
+    HIERARCHYCHANGE { CREATEMASTER, REMOVEMASTER, ATTACHSLAVE, DETACHSLAVE }
 
-    HIERARCHYCHANGETYPE { CreateMaster, RemoveMaster, ChangeAttachment }
+    HIERARCHYCHANGETYPE { CreateMaster, RemoveMaster, SlaveAttached,
+                          SlaveDetached }
 
     CHANGEMODE { Float, Attach }
 
@@ -470,11 +472,14 @@ XI2. Clients should ignore this data.
                    return_pointer:  DEVICEID
                    return_keyboard: DEVICEID }
 
-    CHANGEATTACHMENT { type:        HIERARCHYCHANGETYPE
-                       length:      CARD16
-                       deviceid:    DEVICEID
-                       change_mode: CHANGEMODE
-                       master:      DEVICEID }
+    ATTACHSLAVE   { type:        HIERARCHYCHANGETYPE
+                    length:      CARD16
+                    deviceid:    DEVICEID
+                    master:      DEVICEID }
+
+    DETACHSLAVE { type:       HIERARCHYCHANGETYPE
+                  length:     CARD16
+                  deviceid:   DEVICEID }
 
     XIChangeDeviceHierarchy allows a client to modify the MD/SD device
     hierarchy (see Section 4).
@@ -486,7 +491,7 @@ XI2. Clients should ignore this data.
 
     The server processes the changes one by one and applies changes
     immediately. If an error occurs, processing stops at the current change
-    and the error is returned to the client.
+    and returns the number of successfully applied changes in the error.
 
     CREATEMASTER creates a pair of master devices.
     type
@@ -525,20 +530,23 @@ XI2. Clients should ignore this data.
     Removing a master pointer removes the paired master keyboard and vice
     versa.
 
-    CHANGEATTACHMENT changes the attachment of a slave device.
+    ATTACHSLAVE attaches a slave device to a given master device.
     type
         ChangeAttachment
     length
         Length in 4 byte units.
     deviceid
         Deviceid of the slave device
-    change_mode
-        Attachment mode for the slave device.
-        If 'change_mode' is Attach, 'master' specifies the new master device. 
-        If 'change_mode' is Float, the slave device is set floating.
     master
-        The new master device to attach this slave device to, if 'change_mode'
-        is floating.
+        The new master device to attach this slave device to
+
+    DETACHSLAVE detaches a slave device from its current master device.
+    type
+        ChangeAttachment
+    length
+        Length in 4 byte units.
+    deviceid
+        Deviceid of the slave device
 
     ┌───
         XISetClientPointer
@@ -559,7 +567,7 @@ XI2. Clients should ignore this data.
     client currently has a grab on another device.
 
     ┌───
-        XISetClientPointer
+        XIGetClientPointer
             win:             Window
             ▶
             set:             BOOL
@@ -797,16 +805,19 @@ EVENTHEADER { type:                       BYTE
             valuators_len:             CARD16
             buttons:                   SETofBUTTONMASK
             valuators:                 SETofVALUATORMASK
-            valuators_unaccel:         SETofVALUATORMASK
             axisvalues:                LISTofFP3232
-            axisvalues_unaccel:        LISTofFP3232
+            axisvalues_raw:            LISTofFP3232
     └───
 
     RAWTYPE { Motion, KeyPress, KeyRelease, ButtonPress, ButtonRelease }
 
     A RawDevice event provides the information provided by the driver to the
-    client. RawDevice events are only generated for slave devices.
-    Unaccelerated and accelerated valuator data is provided if applicable.
+    client. RawDevice events are only generated for slave devices and provide
+    both the raw data as supplied by the driver and transformed data as used
+    in the server. Transformations include, but are not limited to, axis
+    clipping and acceleration.
+    Transformed valuator data may be equivalent to raw data. In this case,
+    both raw and transformed valuator data is provided.
     RawDeviceEvents are sent exclusively to all root windows or to the client
     that grabbed the device only.
 
@@ -821,13 +832,11 @@ EVENTHEADER { type:                       BYTE
     buttons
         Button state before the event
     valuators
-        Bitmask of valuators provided in 'axisvalues'.
-    valuators_unaccel
-        Bitmask of valuators provided in 'axisvalues_unaccel'.
+        Bitmask of valuators provided in 'axisvalues' and 'axisvalues_raw'.
     axisvalues
         Valuator data in device-native resolution.
-    axisvalues_unaccel
-        Unaccelerated valuator data in device-native resolution.
+    axisvalues_raw
+        Untransformed valuator data in device-native resolution.
 
     ┌───
         Enter or Leave

Cheers,
  Peter



More information about the xorg mailing list