[Xcb] [PATCH proto xkb] Fixes for xkb.xml

Christian Linhart chris at DemoRecorder.com
Mon Feb 10 16:40:01 CET 2014


Hi all,

I have got XKB-support working by making a few changes to xkb.xml:
* The requests "ListComponents" and "GetKbdByName" had an error:
     Each of these requests must not have a list "keymapsSpec". ( only the reply has one. )
     I have verified this by reading the corresponding code in the X-Server source.

* reactivated previously commented-out parts.

I have included the diff in this email below.

I have tested this with code that I generate with my own code-generator, and it works well after I have made these changes.

-Chris

P.S.: I am new to this list, so I introduce myself a bit:
My name is Christian Linhart and I am 43 years old. I live in Salzburg which is a town in Austria/Europe.
My in-depth experience with X11 started in 1997 when I started the project which is now my product DemoRecorder.
This includes modifying X-Server code etc, so I know the inner working of X11 pretty well.

P.P.S.: Here's the diff. (It is based on the current source from git. The revision numbers are from my svn repo, so you can ignore them.)

Index: xkb.xml
===================================================================
--- xkb.xml    (revision 484)
+++ xkb.xml    (revision 522)
@@ -547,26 +547,10 @@

<typedef oldname="char" newname="STRING8" />

- <!-- XXX: Property is broken
<struct name="Property">
- <field name="nameLength" type="CARD16" />
- <list name="name" type="STRING8">
- <fieldref>nameLength</fieldref>
- </list>
- <field name="valueLength" type="CARD16" />
- <list name="value" type="STRING8">
- <fieldref>valueLength</fieldref>
- </list>
- </struct>
-    -->
- <!-- XXX: This would be the correct Property structure as per spec.,
-          but it's broken atm. too. Add it anyway here, so we don't
-          loose that information.
- <struct name="Property">
<field name="name" type="CountedString16" />
<field name="value" type="CountedString16" />
</struct>
-    -->

<struct name="Outline">
<field name="nPoints" type="CARD8" />
@@ -643,7 +627,6 @@
<item name="Logo"> <value>5</value> </item>
</enum>

- <!-- XXX: doodads are broken
<struct name="CommonDoodad">
<field name="name" type="ATOM" />
<field name="type" type="CARD8" enum="DoodadType" />
@@ -737,7 +720,6 @@
<fieldref>nOverlays</fieldref>
</list>
</struct>
-    -->

<struct name="Listing">
<field name="flags" type="CARD16" />
@@ -1829,7 +1811,6 @@
</switch>
</request>

- <!-- XXX: Property and doodads are broken, which renders GetGeometry useless
<request name="GetGeometry" opcode="19">
<field name="deviceSpec" type="DeviceSpec" />
<pad bytes="2" />
@@ -1870,9 +1851,7 @@
</list>
</reply>
</request>
-    -->

- <!-- XXX: Property and doodads are broken, which renders SetGeometry useless
<request name="SetGeometry" opcode="20">
<field name="deviceSpec" type="DeviceSpec" />
<field name="nShapes" type="CARD8" />
@@ -1907,7 +1886,6 @@
<fieldref>nKeyAliases</fieldref>
</list>
</request>
-    -->

<request name="PerClientFlags" opcode="21">
<field name="deviceSpec" type="DeviceSpec" />
@@ -1930,11 +1908,8 @@
<request name="ListComponents" opcode="22">
<field name="deviceSpec" type="DeviceSpec" />
<field name="maxNames" type="CARD16" />
- <!-- XXX: Intermixed fixed size fields and lists are broken
- <field name="keymapsSpecLen" type="CARD8" />
- <list name="keymapsSpec" type="STRING8">
- <fieldref>keymapsSpecLen</fieldref>
- </list>
+ <!-- CL: there is no list named keymapsSpec in the request
+            ( only the reply contains a list of keymaps) -->
<field name="keycodesSpecLen" type="CARD8" />
<list name="keycodesSpec" type="STRING8">
<fieldref>keycodesSpecLen</fieldref>
@@ -1955,7 +1930,6 @@
<list name="geometrySpec" type="STRING8">
<fieldref>geometrySpecLen</fieldref>
</list>
-        -->
<reply>
<field name="deviceID" type="CARD8" />
<field name="nKeymaps" type="CARD16" />
@@ -1993,11 +1967,7 @@
<field name="want" type="CARD16" mask="GBNDetail" />
<field name="load" type="BOOL" />
<pad bytes="1" />
- <!-- XXX: Intermixed fixed size fields and lists are broken
- <field name="keymapsSpecLen" type="CARD8" />
- <list name="keymapsSpec" type="STRING8">
- <fieldref>keymapsSpecLen</fieldref>
- </list>
+ <!-- CL: there is no list named keymapsSpec in the request ( only the reply contains a list of keymaps) -->
<field name="keycodesSpecLen" type="CARD8" />
<list name="keycodesSpec" type="STRING8">
<fieldref>keycodesSpecLen</fieldref>
@@ -2018,7 +1988,6 @@
<list name="geometrySpec" type="STRING8">
<fieldref>geometrySpecLen</fieldref>
</list>
-        -->
<reply>
<field name="deviceID" type="CARD8" />
<field name="minKeyCode" type="KEYCODE" />
@@ -2292,7 +2261,6 @@
<field name="baseColorNdx" type="CARD8" />
<field name="labelColorNdx" type="CARD8" />
<field name="labelFont" type="CountedString16" />
- <!-- XXX: Property is broken
<list name="properties" type="Property">
<fieldref>nProperties</fieldref>
</list>
@@ -2302,8 +2270,6 @@
<list name="shapes" type="Shape">
<fieldref>nShapes</fieldref>
</list>
-                    -->
- <!-- XXX: doodads are broken
<list name="sections" type="Section">
<fieldref>nSections</fieldref>
</list>
@@ -2313,7 +2279,6 @@
<list name="keyAliases" type="KeyAlias">
<fieldref>nKeyAliases</fieldref>
</list>
-                    -->
</bitcase>
</switch>
</reply>
===================================================================






More information about the Xcb mailing list