Ignore generated xinerama files.
[free-sw/xcb/libxcb] / src / c-client.xsl
index 188e8b0..445a8a6 100644 (file)
@@ -68,9 +68,6 @@ authorization from the authors.
     <xsl:for-each select="/xcb/import">
       <path><xsl:value-of select="concat($extension-path, ., '.xml')" /></path>
     </xsl:for-each>
-    <xsl:if test="not($header='xproto')">
-      <path><xsl:value-of select="concat($base-path, 'xproto.xml')" /></path>
-    </xsl:if>
   </xsl:variable>
   <xsl:variable name="search-path" select="e:node-set($search-path-rtf)/path"/>
 
@@ -89,11 +86,6 @@ authorization from the authors.
         <constant type="xcb_extension_t" name="{xcb:xcb-prefix()}_id">
           <xsl:attribute name="value">{ "<xsl:value-of select="@extension-xname" />" }</xsl:attribute>
         </constant>
-        <function type="const xcb_query_extension_reply_t *" name="{xcb:xcb-prefix('init')}">
-          <field type="xcb_connection_t *" name="c" />
-          <l>return xcb_get_extension_data(c, &amp;<!--
-          --><xsl:value-of select="xcb:xcb-prefix()" />_id);</l>
-        </function>
       </xsl:if>
       <xsl:apply-templates mode="pass1" />
     </xcb>
@@ -275,8 +267,8 @@ authorization from the authors.
         <xsl:variable name="type-definitions"
                       select="(/xcb|document($search-path)/xcb
                               )[$is-unqualified or @header=$namespace]
-                               /*[((self::struct or self::union
-                                    or self::xidtype or self::enum
+                               /*[((self::struct or self::union or self::enum
+                                    or self::xidtype or self::xidunion
                                     or self::event or self::eventcopy
                                     or self::error or self::errorcopy)
                                    and @name=$unqualified-type)
@@ -350,7 +342,7 @@ authorization from the authors.
       </xsl:attribute>
       <field type="xcb_connection_t *" name="c" />
       <xsl:apply-templates select="$req/*[not(self::reply)]" mode="param" />
-      <do-request ref="{xcb:xcb-prefix($req/@name)}_request_t" opcode="{$req/@opcode}"
+      <do-request ref="{xcb:xcb-prefix($req/@name)}_request_t" opcode="{translate(xcb:xcb-prefix($req/@name), $lcase, $ucase)}"
                   checked="{$checked}">
         <xsl:if test="$req/reply">
           <xsl:attribute name="has-reply">true</xsl:attribute>
@@ -366,6 +358,7 @@ authorization from the authors.
         <field type="unsigned int" name="sequence" />
       </struct>
     </xsl:if>
+    <constant type="number" name="{xcb:xcb-prefix($req/@name)}" value="{$req/@opcode}" />
     <struct name="{xcb:xcb-prefix(@name)}_request_t">
       <field type="uint8_t" name="major_opcode" no-assign="true" />
       <xsl:if test="$ext">
@@ -408,18 +401,10 @@ authorization from the authors.
     </xsl:if>
   </xsl:template>
 
-  <xsl:template match="xidtype" mode="pass1">
-    <struct name="{xcb:xcb-prefix(@name)}_t">
-      <field type="uint32_t" name="xid" />
-    </struct>
+  <xsl:template match="xidtype|xidunion" mode="pass1">
+    <typedef oldname="uint32_t" newname="{xcb:xcb-prefix(@name)}_t" />
     <iterator ref="{xcb:xcb-prefix(@name)}" />
     <iterator-functions ref="{xcb:xcb-prefix(@name)}" />
-    <function type="{xcb:xcb-prefix(@name)}_t" name="{xcb:xcb-prefix(@name)}_new">
-      <field type="xcb_connection_t *" name="c" />
-      <l><xsl:value-of select="concat(xcb:xcb-prefix(@name), '_t')" /> ret;</l>
-      <l>ret.xid = xcb_generate_id(c);</l>
-      <l>return ret;</l>
-    </function>
   </xsl:template>
 
   <xsl:template match="struct|union" mode="pass1">
@@ -1090,6 +1075,8 @@ authorization from the authors.
       </xsl:variable>
       <xsl:text>typedef </xsl:text>
       <xsl:if test="not(@kind)">struct</xsl:if><xsl:value-of select="@kind" />
+      <xsl:text> </xsl:text>
+      <xsl:value-of select="@name" />
       <xsl:text> {
 </xsl:text>
       <xsl:for-each select="exprfield|field|list[@fixed]|pad">
@@ -1110,7 +1097,9 @@ authorization from the authors.
 
   <xsl:template match="enum" mode="output">
     <xsl:if test="$h">
-      <xsl:text>typedef enum {
+      <xsl:text>typedef enum </xsl:text>
+      <xsl:value-of select="@name" />
+      <xsl:text> {
     </xsl:text>
       <xsl:call-template name="list">
         <xsl:with-param name="separator"><xsl:text>,