VirtualBox

Changeset 99726 in vbox for trunk/src/VBox/Main/idl


Ignore:
Timestamp:
May 10, 2023 2:35:53 PM (21 months ago)
Author:
vboxsync
Message:

Main: Doxygen fixes. bugref:10442

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/idl/doxygen.xsl

    r98103 r99726  
    4040<xsl:import href="string.xsl"/>
    4141
    42 <xsl:output method="html" indent="yes"/>
     42<!-- Don't indent the output, as it's not exactly html but IDL.
     43     (doxygen 1.9.6 gets confused by <dl> indent.) -->
     44<xsl:output method="html" indent="no"/>
    4345
    4446<xsl:strip-space elements="*"/>
     
    5759    <xsl:value-of select="concat(' ',normalize-space(.),' ')"/>
    5860</xsl:template-->
     61
     62<!--
     63  Replace /* and */ sequences in the text so they won't confuse doxygen with
     64  comment nesting (see IPerformanceCollector).  Doxygen doesn't have any escape
     65  sequence for '/' nor for '*', and xsltproc is in html mode so we cannot easily
     66  output dummy elements.  So, we replace the '*' with '@SLASH-ASTERISK@' and
     67  '@ASTERISK-SLASH@' and run sed afterwards to change them to sequences with
     68  a dummy 'b' element in-between the characters (&#42; does not work).
     69
     70  TODO: Find better fix for this.
     71
     72  ~~Also, strip leading whitespace from the first child of a 'desc' element so
     73  that doxygen 1.9.6 doesn't confuse the text for a tt or pre block (older
     74  versions (1.8.13) didn't used to do this).~~ - fixed by MARKDOWN_SUPPORT=NO.
     75  -->
     76<xsl:template match="desc//text()" name="default-text-processing">
     77  <xsl:param name="text" select="."/>
     78
     79  <!-- xsl:variable name="stripped">
     80    <xsl:choose>
     81      <xsl:when test="parent::desc and position() = 1">
     82        <xsl:call-template name="strip-left">
     83          <xsl:with-param name="text" select="$text"/>
     84        </xsl:call-template>
     85      </xsl:when>
     86      <xsl:otherwise>
     87        <xsl:value-of select="$text"/>
     88      </xsl:otherwise>
     89    </xsl:choose>
     90  </xsl:variable -->
     91
     92  <xsl:variable name="subst1">
     93    <xsl:call-template name="str:subst">
     94      <!-- xsl:with-param name="text" select="$stripped" / -->
     95      <xsl:with-param name="text" select="$text" />
     96      <xsl:with-param name="replace" select="'/*'" />
     97      <xsl:with-param name="with" select="'/@SLASH-ASTERISK@'"/>
     98    </xsl:call-template>
     99  </xsl:variable>
     100  <xsl:variable name="subst2">
     101    <xsl:call-template name="str:subst">
     102      <xsl:with-param name="text" select="$subst1" />
     103      <xsl:with-param name="replace" select="'*/'" />
     104      <xsl:with-param name="with" select="'@ASTERISK-SLASH@/'" />
     105    </xsl:call-template>
     106  </xsl:variable>
     107
     108  <!-- xsl:value-of select="concat('-dbg-',position(),'-gbd-')"/ -->
     109  <xsl:value-of select="$subst2"/>
     110</xsl:template>
     111
     112<!-- Strips leading spaces from $text.  Helper for default-text-processing.  -->
     113<xsl:template name="strip-left">
     114  <xsl:param name="text"/>
     115  <xsl:choose>
     116    <xsl:when test="string-length($text) > 0 and (substring($text, 1, 1) = ' ' or substring($text, 1, 1) = '&#x0A;' or substring($text, 1, 1) = '&#x0D;')">
     117      <xsl:call-template name="strip-left">
     118        <xsl:with-param name="text" select="substring($text, 2)"/>
     119      </xsl:call-template>
     120    </xsl:when>
     121
     122    <xsl:otherwise>
     123      <xsl:value-of select="$text"/>
     124    </xsl:otherwise>
     125  </xsl:choose>
     126</xsl:template>
     127
    59128
    60129<!--
     
    80149    </xsl:call-template>
    81150  </xsl:variable>
    82   <xsl:value-of select="$subst1"/>
     151  <xsl:call-template name="default-text-processing">
     152    <xsl:with-param name="text" select="$subst1"/>
     153  </xsl:call-template>
    83154</xsl:template>
    84155
     
    220291    <xsl:value-of select="concat(' @ingroup ',$id,'&#x0A;')"/>
    221292  </xsl:if>
    222   <xsl:text> @brief&#x0A;</xsl:text>
     293  <xsl:text> @brief </xsl:text>
    223294</xsl:template>
    224295
     
    401472  <xsl:for-each select="//descGroup">
    402473    <xsl:if test="@id and (@title or desc)">
    403       <xsl:value-of select="concat('/** @defgroup ',@id,' ',@title)"/>
     474      <xsl:value-of select="concat('/** @defgroup ', @id, ' ', @title, '&#x0A;')"/>
    404475      <xsl:apply-templates select="desc" mode="middle"/>
    405476      <xsl:text>&#x0A;*/&#x0A;</xsl:text>
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette