xinput: struct ValuatorState.mode: add mask
authorChristian Linhart <chris@DemoRecorder.com>
Tue, 19 Aug 2014 11:12:32 +0000 (13:12 +0200)
committerChristian Linhart <chris@demorecorder.com>
Mon, 25 Aug 2014 11:42:56 +0000 (13:42 +0200)
add new enum ValuatorStateModeMask as mask to field "mode"

V2: patch revised according to suggestions from Peter Harris:
* use bit instead of value
* use names which indicate the way the bits should be flipped

spec:
http://cgit.freedesktop.org/xorg/proto/inputproto/tree/specs/XIproto.txt#n2095
http://cgit.freedesktop.org/xorg/lib/libXi/tree/specs/encoding.xml#n1783

src/xinput.xml

index 29758a2..e318339 100644 (file)
@@ -768,11 +768,16 @@ authorization from the authors.
         </list>
     </struct>
 
+    <enum name="ValuatorStateModeMask">
+        <item name="DeviceModeAbsolute"> <bit>0</bit> </item>
+        <item name="OutOfProximity">     <bit>1</bit> </item>
+    </enum>
+
     <struct name="ValuatorState">
         <field type="CARD8" name="class_id" enum="InputClass" />
         <field type="CARD8" name="len" />
         <field type="CARD8" name="num_valuators" />
-        <field type="CARD8" name="mode" />
+        <field type="CARD8" name="mode" mask="ValuatorStateModeMask" />
         <list type="CARD32" name="valuators">
             <fieldref>num_valuators</fieldref>
         </list>