[Xcb] [PATCH proto 2/3] xkb: Rename enum EventType to EventTypeMask, add EventType

Daniel Martin consume.noise at gmail.com
Sun Aug 18 07:53:58 PDT 2013


The enum EventType had the bit mask items for the SelectEvents request
and therefor should've been called EventTypeMask. Renaming it to
EventTypeMask makes it possible to add an enum EventType, which can be
used to distinguish the sub events later.

This is part 1/2 to fix bug #51295:
    various problems with the xkb protocol bindings
    https://bugs.freedesktop.org/show_bug.cgi?id=51295

Signed-off-by: Daniel Martin <consume.noise at gmail.com>
---
 src/xkb.xml | 43 +++++++++++++++++++++++++++++--------------
 1 file changed, 29 insertions(+), 14 deletions(-)

diff --git a/src/xkb.xml b/src/xkb.xml
index af8f512..4ab8d3e 100644
--- a/src/xkb.xml
+++ b/src/xkb.xml
@@ -41,6 +41,21 @@ <enum name="Const">
 	</enum>
 
 	<enum name="EventType">
+		<item name="NewKeyboardNotify" />
+		<item name="MapNotify" />
+		<item name="StateNotify" />
+		<item name="ControlsNotify" />
+		<item name="IndicatorStateNotify" />
+		<item name="IndicatorMapNotify" />
+		<item name="NamesNotify" />
+		<item name="CompatMapNotify" />
+		<item name="BellNotify" />
+		<item name="ActionMessage" />
+		<item name="AccessXNotify" />
+		<item name="ExtensionDeviceNotify" />
+	</enum>
+
+	<enum name="EventTypeMask">
 		<item name="NewKeyboardNotify">      <bit>0</bit> </item>
 		<item name="MapNotify">              <bit>1</bit> </item>
 		<item name="StateNotify">            <bit>2</bit> </item>
@@ -1083,9 +1098,9 @@ <request name="UseExtension" opcode="0">
 
 	<request name="SelectEvents" opcode="1">
 		<field name="deviceSpec" type="DeviceSpec" />
-		<field name="affectWhich" type="CARD16" mask="EventType" />
-		<field name="clear" type="CARD16" mask="EventType" />
-		<field name="selectAll" type="CARD16" mask="EventType" />
+		<field name="affectWhich" type="CARD16" mask="EventTypeMask" />
+		<field name="clear" type="CARD16" mask="EventTypeMask" />
+		<field name="selectAll" type="CARD16" mask="EventTypeMask" />
 		<field name="affectMap" type="CARD16" mask="MapPart" />
 		<field name="map" type="CARD16" mask="MapPart" />
 		<switch name="details">
@@ -1097,57 +1112,57 @@ <request name="SelectEvents" opcode="1">
 				</op>
 			</op>
 			<bitcase>
-				<enumref ref="EventType">NewKeyboardNotify</enumref>
+				<enumref ref="EventTypeMask">NewKeyboardNotify</enumref>
 				<field name="affectNewKeyboard" type="CARD16" mask="NKNDetail" />
 				<field name="newKeyboardDetails" type="CARD16" mask="NKNDetail" />
 			</bitcase>
 			<bitcase>
-				<enumref ref="EventType">StateNotify</enumref>
+				<enumref ref="EventTypeMask">StateNotify</enumref>
 				<field name="affectState" type="CARD16" mask="StatePart" />
 				<field name="stateDetails" type="CARD16" mask="StatePart" />
 			</bitcase>
 			<bitcase>
-				<enumref ref="EventType">ControlsNotify</enumref>
+				<enumref ref="EventTypeMask">ControlsNotify</enumref>
 				<field name="affectCtrls" type="CARD32" mask="Control" />
 				<field name="ctrlDetails" type="CARD32" mask="Control" />
 			</bitcase>
 			<bitcase>
-				<enumref ref="EventType">IndicatorStateNotify</enumref>
+				<enumref ref="EventTypeMask">IndicatorStateNotify</enumref>
 				<field name="affectIndicatorState" type="CARD32" />
 				<field name="indicatorStateDetails" type="CARD32" />
 			</bitcase>
 			<bitcase>
-				<enumref ref="EventType">IndicatorMapNotify</enumref>
+				<enumref ref="EventTypeMask">IndicatorMapNotify</enumref>
 				<field name="affectIndicatorMap" type="CARD32" />
 				<field name="indicatorMapDetails" type="CARD32" />
 			</bitcase>
 			<bitcase>
-				<enumref ref="EventType">NamesNotify</enumref>
+				<enumref ref="EventTypeMask">NamesNotify</enumref>
 				<field name="affectNames" type="CARD16" mask="NameDetail" />
 				<field name="namesDetails" type="CARD16" mask="NameDetail" />
 			</bitcase>
 			<bitcase>
-				<enumref ref="EventType">CompatMapNotify</enumref>
+				<enumref ref="EventTypeMask">CompatMapNotify</enumref>
 				<field name="affectCompat" type="CARD8" mask="CMDetail" />
 				<field name="compatDetails" type="CARD8" mask="CMDetail" />
 			</bitcase>
 			<bitcase>
-				<enumref ref="EventType">BellNotify</enumref>
+				<enumref ref="EventTypeMask">BellNotify</enumref>
 				<field name="affectBell" type="CARD8" />
 				<field name="bellDetails" type="CARD8" />
 			</bitcase>
 			<bitcase>
-				<enumref ref="EventType">ActionMessage</enumref>
+				<enumref ref="EventTypeMask">ActionMessage</enumref>
 				<field name="affectMsgDetails" type="CARD8" />
 				<field name="msgDetails" type="CARD8" />
 			</bitcase>
 			<bitcase>
-				<enumref ref="EventType">AccessXNotify</enumref>
+				<enumref ref="EventTypeMask">AccessXNotify</enumref>
 				<field name="affectAccessX" type="CARD16" mask="AXNDetail" />
 				<field name="accessXDetails" type="CARD16" mask="AXNDetail" />
 			</bitcase>
 			<bitcase>
-				<enumref ref="EventType">ExtensionDeviceNotify</enumref>
+				<enumref ref="EventTypeMask">ExtensionDeviceNotify</enumref>
 				<field name="affectExtDev" type="CARD16" mask="XIFeature" />
 				<field name="extdevDetails" type="CARD16" mask="XIFeature" />
 			</bitcase>
-- 
1.8.3.3



More information about the Xcb mailing list