VirtualBox

Changeset 14469 in vbox


Ignore:
Timestamp:
Nov 21, 2008 3:44:45 PM (16 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
39745
Message:

Main: XIDL: Added support for <result> tags in <library> (MIDL, XPIDL, Doxygen). Added a couple of exemplary VBOX_E_ result codes.

Location:
trunk/src/VBox/Main/idl
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/idl/VirtualBox.xidl

    r14437 r14469  
    149149>
    150150
     151
     152  <!--
     153  // COM result codes for VirtualBox
     154  /////////////////////////////////////////////////////////////////////////
     155  -->
     156
     157  <result name="VBOX_E_OBJECT_NOT_FOUND" value="0x80BB0001">
     158    <desc>
     159       Object corresponding to the supplied arguments does not exist.
     160    </desc>
     161  </result>
     162
     163  <result name="VBOX_E_INVALID_VM_STATE" value="0x80BB0002">
     164    <desc>
     165       Current virtual machine state prevents the operation.
     166    </desc>
     167  </result>
     168
     169
    151170  <!--
    152171  // all common enums
     
    591610    <const name="HostDriveCaptured" value="3"/>
    592611  </enum>
     612
    593613
    594614  <!--
  • trunk/src/VBox/Main/idl/doxygen.xsl

    r14357 r14469  
    237237
    238238<!--
    239  *  comment for interfaces
     239 *  comment for enums
    240240-->
    241241<xsl:template match="enum/desc">
     
    263263
    264264<!--
     265 *  comment for result codes
     266-->
     267<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"/>
     272  <xsl:text>&#x0A;*/&#x0A;</xsl:text>
     273</xsl:template>
     274
     275<!--
    265276//  templates
    266277/////////////////////////////////////////////////////////////////////////////
     
    363374-->
    364375<xsl:template match="library">
     376  <!-- 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>
     397  <xsl:for-each select="result">
     398    <xsl:apply-templates select="."/>
     399  </xsl:for-each>
     400  <xsl:text>
     401/*@}*/
     402
     403  </xsl:text>
    365404  <!-- all enums go first -->
    366405  <xsl:apply-templates select="enum | if/enum"/>
    367   <!-- everything else but enums -->
    368   <xsl:apply-templates select="*[not(self::enum) and not(self::if[enum])]"/>
     406  <!-- everything else but result codes and enums -->
     407  <xsl:apply-templates select="*[not(self::result or self::enum) and
     408                                 not(self::if[result] or self::if[enum])]"/>
     409</xsl:template>
     410
     411
     412<!--
     413 *  result codes
     414-->
     415<xsl:template match="result">
     416  <xsl:apply-templates select="@if" mode="begin"/>
     417  <xsl:apply-templates select="desc"/>
     418  <xsl:value-of select="concat('const HRESULT ',@name,' = ',@value,';')"/>
     419  <xsl:text>&#x0A;</xsl:text>
     420  <xsl:apply-templates select="@if" mode="end"/>
    369421</xsl:template>
    370422
  • trunk/src/VBox/Main/idl/midl.xsl

    r14185 r14469  
    152152  <xsl:text>&#x0A;{&#x0A;</xsl:text>
    153153  <xsl:text>&#x0A;importlib("stdole2.tlb");&#x0A;&#x0A;</xsl:text>
     154  <!-- result codes -->
     155  <xsl:for-each select="result">
     156    <xsl:apply-templates select="."/>
     157  </xsl:for-each>
     158  <xsl:text>&#x0A;</xsl:text>
    154159  <!-- forward declarations -->
    155160  <xsl:apply-templates select="if | interface | collection | enumerator" mode="forward"/>
     
    157162  <!-- all enums go first -->
    158163  <xsl:apply-templates select="enum | if/enum"/>
    159   <!-- everything else but enums -->
    160   <xsl:apply-templates select="*[not(self::enum) and not(self::if[enum])]"/>
     164  <!-- everything else but result codes and enums -->
     165  <xsl:apply-templates select="*[not(self::result or self::enum) and
     166                                 not(self::if[result] or self::if[enum])]"/>
    161167  <!-- -->
    162168  <xsl:text>}; /* library </xsl:text>
    163169  <xsl:value-of select="@name"/>
    164170  <xsl:text> */&#x0A;&#x0A;</xsl:text>
     171</xsl:template>
     172
     173
     174<!--
     175 *  result codes
     176-->
     177<xsl:template match="result">
     178  <xsl:text>cpp_quote("</xsl:text>
     179  <xsl:value-of select="concat('#define ',@name,' ',@value)"/>
     180  <xsl:text>")&#x0A;</xsl:text>
    165181</xsl:template>
    166182
  • trunk/src/VBox/Main/idl/xpidl.xsl

    r14361 r14469  
    184184-->
    185185<xsl:template match="library">
     186  <!-- result codes -->
     187  <xsl:text>%{C++&#x0A;</xsl:text>
     188  <xsl:for-each select="result">
     189    <xsl:apply-templates select="."/>
     190  </xsl:for-each>
     191  <xsl:text>%}&#x0A;&#x0A;</xsl:text>
    186192  <!-- forward declarations -->
    187193  <xsl:apply-templates select="if | interface | collection | enumerator" mode="forward"/>
     
    189195  <!-- all enums go first -->
    190196  <xsl:apply-templates select="enum | if/enum"/>
    191   <!-- everything else but enums -->
    192   <xsl:apply-templates select="*[not(self::enum) and not(self::if[enum])]"/>
     197  <!-- everything else but result codes and enums -->
     198  <xsl:apply-templates select="*[not(self::result or self::enum) and
     199                                 not(self::if[result] or self::if[enum])]"/>
     200  <!-- -->
     201</xsl:template>
     202
     203
     204<!--
     205 *  result codes
     206-->
     207<xsl:template match="result">
     208  <xsl:value-of select="concat('#define ',@name,' ',@value)"/>
     209  <xsl:text>&#x0A;</xsl:text>
    193210</xsl:template>
    194211
Note: See TracChangeset for help on using the changeset viewer.

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