[Xcb] [PATCH] Fix xcb-proto xml typos

Alp Toker alp at atoker.com
Sat Feb 18 17:17:52 PST 2006


Further to my previous mail ([ANNOUNCE] Xnb: X protocol library for 
.NET), attached is a patch to fix typos in the XCB protocol 
specifications that were found whilst writing Xnb:

     * The "bytes" attribute is spelt "byes" and "byte" in various places.
     * item elements in certain enums specify the value as CDATA, 
whereas they should be wrapped with the value tag.

The patch has not been tested for correctness with XCB, but is trivially 
correct for Xnb. You should probably check your generated bindings 
before committing the patch.


The authors of XCB should note that xprint.xml and glx.xml will continue 
to be invalid as long as they contain request replies with valueparams, 
which is not allowed by the XCB schema:

XmlSchema error: Invalid start element: :valueparam XML URI: 
file:///home/alp/Projects/mono-svn/xnb/proto/xprint.xml . Line 217, 
Position 14.

XmlSchema error: Invalid start element: :valueparam XML URI: 
file:///home/alp/Projects/mono-svn/xnb/proto/glx.xml . Line 244, Position 5.

Once the patch has been applied and the issues with xprint.xml and 
glx.xml are resolved, I'll be able to remove all forked specification 
files from the Xnb sources.


Also, the question of enum values in the specifications remains. Certain 
languages allow typesafe enumerations and flags, and it would be great 
to maintain this information in one place (xcb-proto) rather than 
requiring individual consumers of xcb-proto to provide additional metadata.

Any XCB hackers care to comment on how the XCB protocol specification 
format could be extended to accommodate this?
-------------- next part --------------
Index: src/extensions/glx.xml
===================================================================
RCS file: /cvs/xcb/xcb-proto/src/extensions/glx.xml,v
retrieving revision 1.9
diff -u -r1.9 glx.xml
--- src/extensions/glx.xml	10 Feb 2006 19:29:38 -0000	1.9
+++ src/extensions/glx.xml	19 Feb 2006 00:45:52 -0000
@@ -282,7 +282,7 @@
 			<pad bytes="1" />
 			<pad bytes="4" />
 			<field type="CARD32" name="n" />
-			<pad byes="16" />
+			<pad bytes="16" />
 		</reply>
 	</request>
 
@@ -367,7 +367,7 @@
 		<reply>
 			<pad bytes="1" />
 			<field type="CARD32" name="context_tag" />
-			<pad byes="20" />
+			<pad bytes="20" />
 		</reply>
 	</request>
 
Index: src/extensions/xprint.xml
===================================================================
RCS file: /cvs/xcb/xcb-proto/src/extensions/xprint.xml,v
retrieving revision 1.2
diff -u -r1.2 xprint.xml
--- src/extensions/xprint.xml	18 Jul 2005 03:03:43 -0000	1.2
+++ src/extensions/xprint.xml	19 Feb 2006 00:45:54 -0000
@@ -50,36 +50,36 @@
 
     <!-- "PrintGetDocumentData" -->
     <enum name="GetDoc">
-        <item name="Finished">0</item>
-            <item name="SecondConsumer">1</item>
+        <item name="Finished"><value>0</value></item>
+            <item name="SecondConsumer"><value>1</value></item>
     </enum>
 
     <!-- Event Mask ("PrintSelectInput") -->
     <enum name="EvMask">
-        <item name="NoEventMask">0x00000000</item>
-        <item name="PrintMask">0x00000001</item>
-        <item name="AttributeMask">0x00000002</item>
+        <item name="NoEventMask"><value>0x00000000</value></item>
+        <item name="PrintMask"><value>0x00000001</value></item>
+        <item name="AttributeMask"><value>0x00000002</value></item>
     </enum>
 
     <!-- "PrintNotify" detail -->
     <enum name="Detail">
-        <item name="StartJobNotify">1</item>
-        <item name="EndJobNotify">2</item>
-        <item name="StartDocNotify">3</item>
-        <item name="EndDocNotify">4</item>
-        <item name="StartPageNotify">5</item>
-        <item name="EndPageNotify">6</item>
+        <item name="StartJobNotify"><value>1</value></item>
+        <item name="EndJobNotify"><value>2</value></item>
+        <item name="StartDocNotify"><value>3</value></item>
+        <item name="EndDocNotify"><value>4</value></item>
+        <item name="StartPageNotify"><value>5</value></item>
+        <item name="EndPageNotify"><value>6</value></item>
     </enum>
 
     <!-- "AttributeNotify" detail -->
     <enum name="Attr">
-        <item name="JobAttr">1</item>
-        <item name="DocAttr">2</item>
-        <item name="PageAttr">3</item>
-        <item name="PrinterAttr">4</item>
-        <item name="ServerAttr">5</item>
-        <item name="MediumAttr">6</item>
-        <item name="SpoolerAttr">7</item>
+        <item name="JobAttr"><value>1</value></item>
+        <item name="DocAttr"><value>2</value></item>
+        <item name="PageAttr"><value>3</value></item>
+        <item name="PrinterAttr"><value>4</value></item>
+        <item name="ServerAttr"><value>5</value></item>
+        <item name="MediumAttr"><value>6</value></item>
+        <item name="SpoolerAttr"><value>7</value></item>
     </enum>
     
     
Index: src/extensions/xvmc.xml
===================================================================
RCS file: /cvs/xcb/xcb-proto/src/extensions/xvmc.xml,v
retrieving revision 1.1
diff -u -r1.1 xvmc.xml
--- src/extensions/xvmc.xml	12 Jan 2006 16:34:13 -0000	1.1
+++ src/extensions/xvmc.xml	19 Feb 2006 00:45:55 -0000
@@ -77,7 +77,7 @@
             <field type="CARD16" name="width_actual" />
             <field type="CARD16" name="height_actual" />
             <field type="CARD32" name="flags_return" />
-            <pad byte="20" />
+            <pad bytes="20" />
             <list type="CARD32" name="priv_data" />
         </reply>
     </request>


More information about the Xcb mailing list