VirtualBox

Changeset 14572 in vbox for trunk/src


Ignore:
Timestamp:
Nov 25, 2008 1:37:40 PM (16 years ago)
Author:
vboxsync
Message:

Main/XIDL: Added recognition of the following new tags:

  • <desc>/<result> in <method> and <attribute>;
  • <descGroup> everywhere to define logical description groups (modules in doxygen);
  • <desc> in <idl> to generat main documentation page.
Location:
trunk/src/VBox/Main/idl
Files:
3 edited

Legend:

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

    r14469 r14572  
    168168</xsl:template>
    169169
    170 <!--
    171  *  comment for interfaces
    172 -->
    173 <xsl:template match="interface/desc">
     170
     171<!--
     172 *  common comment prologue (handles group IDs)
     173-->
     174<xsl:template match="desc" mode="begin">
    174175  <xsl:text>/**&#x0A;</xsl:text>
     176  <xsl:param name="id" select="@group | preceding::descGroup[1]/@id"/>
     177  <xsl:if test="$id">
     178    <xsl:value-of select="concat(' @ingroup ',$id,'&#x0A;')"/>
     179  </xsl:if>
     180</xsl:template>
     181
     182<!--
     183 *  common brief comment prologue (handles group IDs)
     184-->
     185<xsl:template match="desc" mode="begin_brief">
     186  <xsl:text>/**&#x0A;</xsl:text>
     187  <xsl:param name="id" select="@group | preceding::descGroup[1]/@id"/>
     188  <xsl:if test="$id">
     189    <xsl:value-of select="concat(' @ingroup ',$id,'&#x0A;')"/>
     190  </xsl:if>
     191  <xsl:text> @brief&#x0A;</xsl:text>
     192</xsl:template>
     193
     194<!--
     195 *  common middle part of the comment block
     196-->
     197<xsl:template match="desc" mode="middle">
    175198  <xsl:apply-templates select="text() | *[not(self::note or self::see)]"/>
    176199  <xsl:apply-templates select="note"/>
    177200  <xsl:apply-templates select="see"/>
     201</xsl:template>
     202
     203<!--
     204 *  result part of the comment block
     205-->
     206<xsl:template match="desc" mode="results">
     207  <xsl:if test="result">
     208    <xsl:text>
     209      @par Expected result codes:
     210    </xsl:text>
     211      <table>
     212    <xsl:for-each select="result">
     213      <tr>
     214        <xsl:choose>
     215          <xsl:when test="ancestor::library/result[@name=current()/@name]">
     216            <td><xsl:value-of select=
     217                  "concat('@link ::',@name,' ',@name,' @endlink')"/></td>
     218          </xsl:when>
     219          <xsl:otherwise>
     220            <td><xsl:value-of select="@name"/></td>
     221          </xsl:otherwise>
     222        </xsl:choose>
     223        <td><xsl:value-of select="text()"/></td>
     224      </tr>
     225    </xsl:for-each>
     226      </table>
     227  </xsl:if>
     228</xsl:template>
     229
     230
     231<!--
     232 *  comment for interfaces
     233-->
     234<xsl:template match="interface/desc">
     235  <xsl:apply-templates select="." mode="begin"/>
     236  <xsl:apply-templates select="." mode="middle"/>
    178237@par Interface ID:
    179238<tt>{<xsl:call-template name="uppercase">
     
    187246-->
    188247<xsl:template match="attribute/desc">
    189   <xsl:text>/**&#x0A;</xsl:text>
     248  <xsl:apply-templates select="." mode="begin"/>
    190249  <xsl:apply-templates select="text() | *[not(self::note or self::see)]"/>
     250  <xsl:apply-templates select="." mode="results"/>
    191251  <xsl:apply-templates select="note"/>
    192252  <xsl:if test="../@mod='ptr'">
     
    206266-->
    207267<xsl:template match="method/desc">
    208   <xsl:text>/**&#x0A;</xsl:text>
     268  <xsl:apply-templates select="." mode="begin"/>
    209269  <xsl:apply-templates select="text() | *[not(self::note or self::see)]"/>
    210270  <xsl:for-each select="../param">
    211271    <xsl:apply-templates select="desc"/>
    212272  </xsl:for-each>
     273  <xsl:apply-templates select="." mode="results"/>
    213274  <xsl:apply-templates select="note"/>
    214275  <xsl:apply-templates select="../param/desc/note"/>
     
    240301-->
    241302<xsl:template match="enum/desc">
    242   <xsl:text>/**&#x0A;</xsl:text>
    243   <xsl:apply-templates select="text() | *[not(self::note or self::see)]"/>
    244   <xsl:apply-templates select="note"/>
    245   <xsl:apply-templates select="see"/>
     303  <xsl:apply-templates select="." mode="begin"/>
     304  <xsl:apply-templates select="." mode="middle"/>
    246305@par Interface ID:
    247306<tt>{<xsl:call-template name="uppercase">
     
    255314-->
    256315<xsl:template match="enum/const/desc">
    257   <xsl:text>/** @brief </xsl:text>
    258   <xsl:apply-templates select="text() | *[not(self::note or self::see)]"/>
    259   <xsl:apply-templates select="note"/>
    260   <xsl:apply-templates select="see"/>
     316  <xsl:apply-templates select="." mode="begin_brief"/>
     317  <xsl:apply-templates select="." mode="middle"/>
    261318  <xsl:text>&#x0A;*/&#x0A;</xsl:text>
    262319</xsl:template>
     
    266323-->
    267324<xsl:template match="result/desc">
    268   <xsl:text>/** @brief </xsl:text>
    269   <xsl:apply-templates select="text() | *[not(self::note or self::see)]"/>
    270   <xsl:apply-templates select="note"/>
    271   <xsl:apply-templates select="see"/>
     325  <xsl:apply-templates select="." mode="begin_brief"/>
     326  <xsl:apply-templates select="." mode="middle"/>
    272327  <xsl:text>&#x0A;*/&#x0A;</xsl:text>
    273328</xsl:template>
     329
     330<!--
     331 *  ignore descGroups by default (processed in /idl)
     332-->
     333<xsl:template match="descGroup"/>
    274334
    275335<!--
     
    299359 */
    300360
    301 /** @mainpage
    302  *
    303  *  Welcome to the <b>VirtualBox Main documentation.</b> This describes the
    304  *  so-called VirtualBox "Main API", which comprises all public COM interfaces
    305  *  and components provided by the VirtualBox server and by the VirtualBox client
    306  *  library.
    307  *
    308  *  VirtualBox employs a client-server design, meaning that whenever any part of
    309  *  VirtualBox is running -- be it the Qt GUI, the VBoxManage command-line
    310  *  interface or any virtual machine --, a background server process named
    311  *  VBoxSVC runs in the background. This allows multiple processes to cooperate
    312  *  without conflicts. Some of the COM objects described by this Main documentation
    313  *  "live" in that server process, others "live" in the local client process. In
    314  *  any case, processes that use the Main API are using inter-process communication
    315  *  to communicate with these objects, but the details of this are hidden by the COM API.
    316  *
    317  *  On Windows platforms, the VirtualBox Main API uses Microsoft COM, a native COM
    318  *  implementation. On all other platforms, Mozilla XPCOM, an open-source COM
    319  *  implementation, is used.
    320  *
    321  *  All the parts that a typical VirtualBox user interacts with (the Qt GUI,
    322  *  the VBoxManage command-line interface and the VBoxVRDP server) are technically
    323  *  front-ends to the Main API and only use the interfaces that are documented
    324  *  in this Main API documentation. This ensures that, with any given release
    325  *  version of VirtualBox, all capabilities of the product that could be useful
    326  *  to an external client program are always exposed by way of this API.
    327  *
    328  *  The complete API is described in a source IDL file, called VirtualBox.idl.
    329  *  This contains all public interfaces exposed by the Main API. Two interfaces
    330  *  are of supreme importance and will be needed in order for any front-end program
    331  *  to do anything useful: these are IVirtualBox and ISession. It is recommended
    332  *  to read the documentation of these interfaces first.
    333  *
    334  *  @note VirtualBox.idl is automatically generated from a generic internal file
    335  *  to define all interfaces in a platform-independent way for documentation
    336  *  purposes. This generated file is not a syntactically valid IDL file and
    337  *  <i>must not</i> be used for programming.
    338  */
    339   <xsl:text>&#x0A;</xsl:text>
    340   <xsl:apply-templates/>
     361  <!-- general description -->
     362  <xsl:text>/** @mainpage &#x0A;</xsl:text>
     363  <xsl:apply-templates select="desc" mode="middle"/>
     364  <xsl:text>&#x0A;*/&#x0A;</xsl:text>
     365
     366  <!-- group (module) definitions -->
     367  <xsl:for-each select="//descGroup">
     368    <xsl:if test="@id and (@title or desc)">
     369      <xsl:value-of select="concat('/** @defgroup ',@id,' ',@title)"/>
     370      <xsl:apply-templates select="desc" mode="middle"/>
     371      <xsl:text>&#x0A;*/&#x0A;</xsl:text>
     372    </xsl:if>
     373  </xsl:for-each>
     374
     375  <!-- everything else -->
     376  <xsl:apply-templates select="*[not(self::desc)]"/>
     377
    341378</xsl:template>
    342379
     
    375412<xsl:template match="library">
    376413  <!-- result codes -->
    377   <xsl:text>
    378 /** @defgroup VirtualBox_COM_result_codes VirtualBox COM result codes
    379  *
    380  * This section describes all VirtualBox-specific COM result codes that may be
    381  * returned by methods of VirtualBox COM interfaces in addition to standard COM
    382  * result codes.
    383  *
    384  * Note that in addition to a result code, every VirtualBox method returns extended
    385  * error information through the IVirtualBoxErrorInfo interface on failure. This
    386  * interface is a preferred way to present the error to the end user because it
    387  * contains a human readable description of the error. Raw result codes (both
    388  * standard and described in this section) are intended to be used by programs
    389  * to analyze the reason of a failure and select an appropriate action without
    390  * involving the end user (for example, retry the operation later or make a
    391  * different call).
    392  *
    393  * @todo List what standard codes may originate from our methods.
    394  */
    395 /*@{*/
    396   </xsl:text>
    397414  <xsl:for-each select="result">
    398415    <xsl:apply-templates select="."/>
    399416  </xsl:for-each>
    400   <xsl:text>
    401 /*@}*/
    402 
    403   </xsl:text>
    404417  <!-- all enums go first -->
    405418  <xsl:apply-templates select="enum | if/enum"/>
  • trunk/src/VBox/Main/idl/midl.xsl

    r14469 r14572  
    7171/////////////////////////////////////////////////////////////////////////////
    7272-->
     73
     74<!--
     75 *  not explicitly matched elements and attributes
     76-->
     77<xsl:template match="*"/>
    7378
    7479
     
    608613  <xsl:apply-templates select="@if" mode="end"/>
    609614
     615</xsl:template>
     616
     617
     618<!--
     619 *  modules
     620-->
     621<xsl:template match="module">
     622  <xsl:apply-templates select="class"/>
    610623</xsl:template>
    611624
  • trunk/src/VBox/Main/idl/xpidl.xsl

    r14469 r14572  
    8181/////////////////////////////////////////////////////////////////////////////
    8282-->
     83
     84
     85<!--
     86 *  not explicitly matched elements and attributes
     87-->
     88<xsl:template match="*"/>
    8389
    8490
     
    634640  <xsl:apply-templates select="@if" mode="end"/>
    635641
     642</xsl:template>
     643
     644
     645<!--
     646 *  modules
     647-->
     648<xsl:template match="module">
     649  <xsl:apply-templates select="class"/>
    636650</xsl:template>
    637651
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