Fix Doxygen warnings.
[free-sw/xcb/libxcb] / src / c-client.xsl
index 4a7b50e..d5d2b35 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"/>
 
@@ -270,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)
@@ -345,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>
@@ -361,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">
@@ -403,7 +401,7 @@ authorization from the authors.
     </xsl:if>
   </xsl:template>
 
-  <xsl:template match="xidtype" mode="pass1">
+  <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)}" />
@@ -981,8 +979,16 @@ authorization from the authors.
  * Edit at your peril.
  */
 </xsl:text>
-
 <xsl:if test="$h"><xsl:text>
+/**
+ * @defgroup XCB_</xsl:text><xsl:value-of select="$ext" /><xsl:text>_API XCB </xsl:text><xsl:value-of select="$ext" /><xsl:text> API
+ * @brief </xsl:text><xsl:value-of select="$ext" /><xsl:text> XCB Protocol Implementation.</xsl:text>
+<xsl:text>
+ * @{
+ **/
+</xsl:text>
+
+<xsl:text>
 #ifndef </xsl:text><xsl:value-of select="$guard" /><xsl:text>
 #define </xsl:text><xsl:value-of select="$guard" /><xsl:text>
 </xsl:text>
@@ -994,6 +1000,18 @@ authorization from the authors.
 <xsl:text>
 </xsl:text>
 </xsl:if>
+<xsl:if test="$h">
+    <xsl:choose>
+        <xsl:when test="string($ext)">
+  <xsl:text>#define XCB_</xsl:text><xsl:value-of select="translate($ext, $lcase, $ucase)"/><xsl:text>_MAJOR_VERSION </xsl:text><xsl:value-of select="/xcb/@major-version" /><xsl:text>
+</xsl:text>
+  <xsl:text>#define XCB_</xsl:text><xsl:value-of select="translate($ext, $lcase, $ucase)"/><xsl:text>_MINOR_VERSION </xsl:text><xsl:value-of select="/xcb/@minor-version" />
+  <xsl:text>
+  
+</xsl:text>
+    </xsl:when>
+  </xsl:choose>
+</xsl:if>
 
 <xsl:if test="$c"><xsl:text>
 #include &lt;assert.h&gt;
@@ -1007,6 +1025,10 @@ authorization from the authors.
 <xsl:if test="$h">
 <xsl:text>
 #endif
+
+/**
+ * @}
+ */
 </xsl:text>
 </xsl:if>
   </xsl:template>
@@ -1015,6 +1037,8 @@ authorization from the authors.
     <xsl:choose>
       <xsl:when test="@type = 'number'">
         <xsl:if test="$h">
+          <xsl:text>/** Opcode for </xsl:text><xsl:value-of select="@name"/><xsl:text>. */
+</xsl:text>
           <xsl:text>#define </xsl:text>
           <xsl:value-of select="translate(@name, $lcase, $ucase)" />
           <xsl:text> </xsl:text>
@@ -1075,8 +1099,14 @@ authorization from the authors.
           <xsl:with-param name="items" select="field/@type" />
         </xsl:call-template>
       </xsl:variable>
+      <xsl:text>/**
+ * @brief </xsl:text><xsl:value-of select="@name" /><xsl:text>
+ **/
+</xsl:text>
       <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">
@@ -1084,7 +1114,7 @@ authorization from the authors.
         <xsl:apply-templates select=".">
           <xsl:with-param name="type-lengths" select="$type-lengths" />
         </xsl:apply-templates>
-        <xsl:text>;
+        <xsl:text>; /**&lt; </xsl:text><xsl:text> */
 </xsl:text>
       </xsl:for-each>
       <xsl:text>} </xsl:text>
@@ -1097,7 +1127,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>,
@@ -1127,8 +1159,31 @@ authorization from the authors.
       <xsl:call-template name="type-lengths">
         <xsl:with-param name="items" select="field/@type" />
       </xsl:call-template>
-    </xsl:variable>
-    <xsl:value-of select="@type" />
+  </xsl:variable>
+  <!-- Doxygen for functions in header. -->
+/*****************************************************************************
+ **
+ ** <xsl:value-of select="@type" />
+ <xsl:text> </xsl:text>
+ <xsl:value-of select="@name" />
+ ** <xsl:call-template name="list">
+     <xsl:with-param name="items">
+         <xsl:for-each select="field">
+             <item>
+                 <xsl:text>
+ ** @param </xsl:text>
+                 <xsl:apply-templates select=".">
+                     <xsl:with-param name="type-lengths" select="$type-lengths" />
+                 </xsl:apply-templates>
+             </item>
+         </xsl:for-each>
+     </xsl:with-param>
+ </xsl:call-template>
+ ** @returns <xsl:value-of select="@type" />
+ **
+ *****************************************************************************/
+<xsl:value-of select="@type" />
     <xsl:text>
 </xsl:text>
     <xsl:value-of select="$decl-open" />
@@ -1146,6 +1201,7 @@ authorization from the authors.
             <xsl:apply-templates select=".">
               <xsl:with-param name="type-lengths" select="$type-lengths" />
             </xsl:apply-templates>
+            <xsl:text>  /**&lt; */</xsl:text>
           </item>
         </xsl:for-each>
       </xsl:with-param>