[Xcb-commit] 3 commits - src xcbgen

Bart Massey bart at kemper.freedesktop.org
Wed Sep 3 11:47:03 PDT 2008


 src/glx.xml      |   16 ++++++++--------
 src/render.xml   |    4 ++--
 src/type.py      |    2 +-
 src/xcb.xsd      |    2 ++
 src/xproto.xml   |   33 +++++++++++++++++----------------
 xcbgen/xtypes.py |   28 ++++++++++++++++++++++++----
 6 files changed, 54 insertions(+), 31 deletions(-)

New commits:
commit 8b3c1209de3c4545f288b0a5c3bd395828f6da34
Author: Bart Massey <bart at cs.pdx.edu>
Date:   Wed Sep 3 11:37:03 2008 -0700

    did remaining replacements of hex constants with decimal

diff --git a/src/glx.xml b/src/glx.xml
index 0f09b28..4689249 100644
--- a/src/glx.xml
+++ b/src/glx.xml
@@ -109,19 +109,19 @@ The patch that fixed this server bug in X.org CVS is here:
 	<!-- enums for PbufferClobber event/draw type -->
 	<enum name="PBCET">
 		<item name="Damaged">
-			<value>0x8017</value>
+			<value>32791</value>
 		</item>
 		<item name="Saved">
-			<value>0x8018</value>
+			<value>32792</value>
 		</item>
 	</enum>
 
 	<enum name="PBCDT">
 		<item name="Window">
-			<value>0x8019</value>
+			<value>32793</value>
 		</item>
 		<item name="Pbuffer">
-			<value>0x801A</value>
+			<value>32794</value>
 		</item>
 	</enum>
 
@@ -222,7 +222,7 @@ The patch that fixed this server bug in X.org CVS is here:
 		<item name="GL_LIST_BIT"><bit>17</bit></item>
 		<item name="GL_TEXTURE_BIT"><bit>18</bit></item>
 		<item name="GL_SCISSOR_BIT"><bit>19</bit></item>
-		<item name="GL_ALL_ATTRIB_BITS"><value>0x000ffffff</value></item>
+		<item name="GL_ALL_ATTRIB_BITS"><value>16777215<!--0x000ffffff--></value></item>
 	</enum>
 
 	<request name="SwapBuffers" opcode="11">
@@ -525,9 +525,9 @@ The patch that fixed this server bug in X.org CVS is here:
 	</request>
 
 	<enum name="RM">
-		<item name="GL_RENDER"><value>0x1C00</value></item>
-		<item name="GL_FEEDBACK"><value>0x1C01</value></item>
-		<item name="GL_SELECT"><value>0x1C02</value></item>
+		<item name="GL_RENDER"><value>7168</value></item>
+		<item name="GL_FEEDBACK"><value>7169</value></item>
+		<item name="GL_SELECT"><value>7170</value></item>
 	</enum>
 
 	<request name="Finish" opcode="108">
diff --git a/src/render.xml b/src/render.xml
index b538f00..63d5b18 100644
--- a/src/render.xml
+++ b/src/render.xml
@@ -32,7 +32,7 @@ for licensing information.
     <item name="Add" />
     <item name="Saturate" />
     
-    <item name="DisjointClear"><value>0x10</value></item>
+    <item name="DisjointClear"><value>16</value></item>
     <item name="DisjointSrc" />
     <item name="DisjointDst" />
     <item name="DisjointOver" />
@@ -45,7 +45,7 @@ for licensing information.
     <item name="DisjointAtopReverse" />
     <item name="DisjointXor" />
     
-    <item name="ConjointClear"><value>0x20</value></item>
+    <item name="ConjointClear"><value>32</value></item>
     <item name="ConjointSrc" />
     <item name="ConjointDst" />
     <item name="ConjointOver" />
commit 183ecffd8b681ca3922cfadfa26e0236a1e2d94f
Author: Carsten Meier <cm at trexity.de>
Date:   Wed Sep 3 13:01:24 2008 +0200

    Replaced hex-values with decimal ones
    
    Replaced the GC-function values with decimal ones as some
    languages have a different notation for hex-values.
    
    Signed-off-by: Bart Massey <bart at cs.pdx.edu>

diff --git a/src/xproto.xml b/src/xproto.xml
index 17f2c47..f49826e 100644
--- a/src/xproto.xml
+++ b/src/xproto.xml
@@ -1396,22 +1396,22 @@ authorization from the authors.
 
   <!-- GC Function values -->
   <enum name="GX">
-    <item name="clear">       <value>0x0</value></item>
-    <item name="and">         <value>0x1</value></item>
-    <item name="andReverse">  <value>0x2</value></item>
-    <item name="copy">        <value>0x3</value></item>
-    <item name="andInverted"> <value>0x4</value></item>
-    <item name="noop">        <value>0x5</value></item>
-    <item name="xor">         <value>0x6</value></item>
-    <item name="or">          <value>0x7</value></item>
-    <item name="nor">         <value>0x8</value></item>
-    <item name="equiv">       <value>0x9</value></item>
-    <item name="invert">      <value>0xa</value></item>
-    <item name="orReverse">   <value>0xb</value></item>
-    <item name="copyInverted"><value>0xc</value></item>
-    <item name="orInverted">  <value>0xd</value></item>
-    <item name="nand">        <value>0xe</value></item>
-    <item name="set">         <value>0xf</value></item>
+    <item name="clear">       <value>0</value></item>
+    <item name="and">         <value>1</value></item>
+    <item name="andReverse">  <value>2</value></item>
+    <item name="copy">        <value>3</value></item>
+    <item name="andInverted"> <value>4</value></item>
+    <item name="noop">        <value>5</value></item>
+    <item name="xor">         <value>6</value></item>
+    <item name="or">          <value>7</value></item>
+    <item name="nor">         <value>8</value></item>
+    <item name="equiv">       <value>9</value></item>
+    <item name="invert">      <value>10</value></item>
+    <item name="orReverse">   <value>11</value></item>
+    <item name="copyInverted"><value>12</value></item>
+    <item name="orInverted">  <value>13</value></item>
+    <item name="nand">        <value>14</value></item>
+    <item name="set">         <value>15</value></item>
   </enum>
 
   <enum name="LineStyle">
commit 57934caa3fb207320c33312646d8e98290950f51
Author: Bart Massey <bart at cs.pdx.edu>
Date:   Sun Aug 31 00:45:17 2008 -0700

    made changes to support new value-mask-pad field of valueparam structures

diff --git a/src/type.py b/src/type.py
index 8338232..873845b 100755
--- a/src/type.py
+++ b/src/type.py
@@ -47,7 +47,7 @@ class AnnotateType(XMLFilterBase):
 			self.declareType(attrs['newname'])
 			attnames = ['oldname', 'newname']
 		elif name == 'valueparam':
-			attnames = ['value-mask-type']
+			attnames = ['value-mask-type', 'value-mask-pad']
 		elif attrs.has_key('type'):
 			attnames = ['type']
 		newattrs = {}
diff --git a/src/xcb.xsd b/src/xcb.xsd
index b40ee6a..ba334d1 100644
--- a/src/xcb.xsd
+++ b/src/xcb.xsd
@@ -109,6 +109,8 @@ authorization from the authors.
     <xsd:complexType>
       <xsd:attribute name="value-mask-type" type="xsd:string" use="required" />
       <xsd:attribute name="value-mask-name" type="xsd:string" use="required" />
+      <!-- This pad is currently needed only by ConfigureWindow.  Sigh. -->
+      <xsd:attribute name="value-mask-pad" type="xsd:integer" use="optional" />
       <xsd:attribute name="value-list-name" type="xsd:string" use="required" />
     </xsd:complexType>
   </xsd:element>
diff --git a/src/xproto.xml b/src/xproto.xml
index 343e734..17f2c47 100644
--- a/src/xproto.xml
+++ b/src/xproto.xml
@@ -815,6 +815,7 @@ authorization from the authors.
     <field type="WINDOW" name="window" />
     <valueparam value-mask-type="CARD16"
                 value-mask-name="value_mask"
+                value-mask-pad="2"
                 value-list-name="value_list" />
   </request>
 
diff --git a/xcbgen/xtypes.py b/xcbgen/xtypes.py
index d4b16e2..b234003 100644
--- a/xcbgen/xtypes.py
+++ b/xcbgen/xtypes.py
@@ -233,15 +233,15 @@ class ExprType(Type):
     def fixed_size(self):
         return True
 
-class PadType(Type):
+class SizedPadType(Type):
     '''
-    Derived class which represents a padding field.
+    Derived class which represents a padding field of given size.
     '''
-    def __init__(self, elt):
+    def __init__(self, size):
         Type.__init__(self, tcard8.name)
         self.is_pad = True
         self.size = 1
-        self.nmemb = 1 if (elt == None) else int(elt.get('bytes'))
+        self.nmemb = int(size)
 
     def resolve(self, module):
         self.resolved = True
@@ -249,6 +249,13 @@ class PadType(Type):
     def fixed_size(self):
         return True
 
+class PadType(SizedPadType):
+    '''
+    Derived class which represents a padding field of given type.
+    '''
+    def __init__(self, elt):
+        self.nmemb = "1" if (elt == None) else elt.get('bytes')
+        SizedPadType.__init__(self, self.nmemb)
     
 class ComplexType(Type):
     '''
@@ -272,6 +279,7 @@ class ComplexType(Type):
 
         # Resolve all of our field datatypes.
         for child in list(self.elt):
+            value_mask_pad = None
             if child.tag == 'pad':
                 field_name = 'pad' + str(pads)
                 fkey = 'CARD8'
@@ -298,6 +306,7 @@ class ComplexType(Type):
                 fkey = 'CARD32'
                 type = ListType(child, module.get_type(fkey), self)
                 visible = True
+                value_mask_pad = child.get('value-mask-pad')
             else:
                 # Hit this on Reply
                 continue 
@@ -309,6 +318,17 @@ class ComplexType(Type):
             # Recursively resolve the type (could be another structure, list)
             type.resolve(module)
 
+            # Add a value-mask-pad if necessary
+            if value_mask_pad != None:
+                vmp_field_name = 'pad' + str(pads)
+                vmp_fkey = 'CARD8'
+                vmp_type = SizedPadType(value_mask_pad)
+                pads = pads + 1
+                vmp_visible = False
+                vmp_field_type = module.get_type_name(vmp_fkey)
+                vmp_type.make_member_of(module, self, vmp_field_type, vmp_field_name, vmp_visible, True, False)
+                vmp_type.resolve(module)
+
         self.calc_size() # Figure out how big we are
         self.resolved = True
 


More information about the xcb-commit mailing list