[Xcb] [PATCH proto 10/22 V2] xinput: req ChangeFeedbackControl.mask: add mask

Christian Linhart chris at DemoRecorder.com
Thu Aug 21 13:50:52 PDT 2014


add new enum ChangeFeedbackControlMask to field "mask" as mask

V2: patch revised according to suggestion from Ran Benita:
* changed item name from "ledMode" to "LedMode" ( initial character uppercase )
  to be consistent with the initial uppercase letter of the other items.

V2: added a note to the commit-message 
    about multiple items with the same value.

Note:
This enum contains multiple items with the same value.
This is defined that way in the spec.
The reason is probably as follows:
The semantic of those values probably depends on the 
the value of field "class_id" of struct "FeedbackCtrl".

spec and code:
http://cgit.freedesktop.org/xorg/lib/libXi/tree/specs/encoding.xml#n1450
http://cgit.freedesktop.org/xorg/proto/inputproto/tree/XI.h#n207
http://cgit.freedesktop.org/xorg/xserver/tree/Xi/chgfctl.c

the following spec just mentions that the field "mask" is a BITMASK,
but does not list its values:
http://cgit.freedesktop.org/xorg/proto/inputproto/tree/specs/XIproto.txt#n1725
---
 src/xinput.xml | 18 +++++++++++++++++-
 1 file changed, 17 insertions(+), 1 deletion(-)

diff --git a/src/xinput.xml b/src/xinput.xml
index c1a24ee..cd46471 100644
--- a/src/xinput.xml
+++ b/src/xinput.xml
@@ -632,16 +632,32 @@ <struct name="FeedbackCtl">
             <op op="-">
                 <fieldref>len</fieldref>
                 <value>4</value>
             </op>
         </list>
     </struct>
 
+    <enum name="ChangeFeedbackControlMask">
+        <item name="KeyClickPercent">  <bit>0</bit> </item> <!-- 0x01 -->
+        <item name="Percent">          <bit>1</bit> </item> <!-- 0x02 -->
+        <item name="Pitch">            <bit>2</bit> </item> <!-- 0x04 -->
+        <item name="Duration">         <bit>3</bit> </item> <!-- 0x08 -->
+        <item name="Led">              <bit>4</bit> </item> <!-- 0x10 -->
+        <item name="LedMode">          <bit>5</bit> </item> <!-- 0x20 -->
+        <item name="Key">              <bit>6</bit> </item> <!-- 0x40 -->
+        <item name="AutoRepeatMode">   <bit>7</bit> </item> <!-- 0x80 -->
+        <item name="String">           <bit>0</bit> </item> <!-- 0x01 -->
+        <item name="Integer">          <bit>0</bit> </item> <!-- 0x01 -->
+        <item name="AccelNum">         <bit>0</bit> </item> <!-- 0x01 -->
+        <item name="AccelDenom">       <bit>1</bit> </item> <!-- 0x02 -->
+        <item name="Threshold">        <bit>2</bit> </item> <!-- 0x04 -->
+    </enum>
+
     <request name="ChangeFeedbackControl" opcode="23">
-        <field type="CARD32"      name="mask" />
+        <field type="CARD32"      name="mask" mask="ChangeFeedbackControlMask" />
         <field type="CARD8"       name="device_id" />
         <field type="CARD8"       name="feedback_id" />
         <pad bytes="2" />
         <field type="FeedbackCtl" name="feedback" />
     </request>
 
     <!-- GetDeviceKeyMapping -->
-- 2.0.1




More information about the Xcb mailing list