Changeset 34783 in vbox for trunk/src/VBox
- Timestamp:
- Dec 7, 2010 2:47:07 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/globals/COMWrappers.xsl
r33962 r34783 185 185 <xsl:template match="if" mode="begin"> 186 186 <xsl:if test="@target='xpidl'"> 187 <xsl:text>#if !defined 187 <xsl:text>#if !defined(Q_WS_WIN32)
</xsl:text> 188 188 </xsl:if> 189 189 <xsl:if test="@target='midl'"> 190 <xsl:text>#if defined 190 <xsl:text>#if defined(Q_WS_WIN32)
</xsl:text> 191 191 </xsl:if> 192 192 </xsl:template> … … 237 237 (//param[@safearray='yes' and not(../@internal='yes') and @type=current()/@name]) 238 238 "> 239 <xsl:text>typedef QVector 239 <xsl:text>typedef QVector<C</xsl:text> 240 240 <xsl:value-of select="substring(@name,2)"/> 241 241 <xsl:text>> C</xsl:text> … … 273 273 <xsl:text> wrapper

class C</xsl:text> 274 274 <xsl:value-of select="substring(@name,2)"/> 275 <xsl:text> : public CInterface 275 <xsl:text> : public CInterface<</xsl:text> 276 276 <xsl:value-of select="@name"/> 277 277 <!-- use the correct base if supportsErrorInfo --> … … 282 282 283 283 <!-- generate the Base typedef--> 284 <xsl:text> typedef CInterface 284 <xsl:text> typedef CInterface<</xsl:text> 285 285 <xsl:value-of select="@name"/> 286 286 <!-- Use the correct base if supportsErrorInfo --> … … 410 410 <xsl:text> C</xsl:text> 411 411 <xsl:value-of select="substring(@name,2)"/> 412 <xsl:text> 412 <xsl:text>() {}

</xsl:text> 413 413 <!-- constructor taking CWhatever --> 414 <xsl:text> template 415 <xsl:value-of select="substring(@name,2)"/> 416 <xsl:text> (const CInterface<OI, OB> & that)414 <xsl:text> template<class OI, class OB> explicit C</xsl:text> 415 <xsl:value-of select="substring(@name,2)"/> 416 <xsl:text>(const CInterface<OI, OB> & that) 417 417 { 418 attach 419 if (SUCCEEDED 418 attach(that.raw()); 419 if (SUCCEEDED(mRC)) 420 420 { 421 421 mRC = that.lastRC(); 422 setErrorInfo 422 setErrorInfo(that.errorInfo()); 423 423 } 424 424 } … … 428 428 <xsl:text> C</xsl:text> 429 429 <xsl:value-of select="substring(@name,2)"/> 430 <xsl:text> 431 <xsl:value-of select="substring(@name,2)"/> 432 <xsl:text> & that) : Base 430 <xsl:text>(const C</xsl:text> 431 <xsl:value-of select="substring(@name,2)"/> 432 <xsl:text> & that) : Base(that) {}

</xsl:text> 433 433 <!-- constructor taking a raw iface pointer --> 434 <xsl:text> template 435 <xsl:value-of select="substring(@name,2)"/> 436 <xsl:text> (OI * aIface) { attach(aIface); }

</xsl:text>434 <xsl:text> template<class OI> explicit C</xsl:text> 435 <xsl:value-of select="substring(@name,2)"/> 436 <xsl:text>(OI * aIface) { attach(aIface); }

</xsl:text> 437 437 <!-- specialization for ourselves --> 438 438 <xsl:text> explicit C</xsl:text> 439 439 <xsl:value-of select="substring(@name,2)"/> 440 <xsl:text> 440 <xsl:text>(</xsl:text> 441 441 <xsl:value-of select="@name"/> 442 <xsl:text> * aIface) : Base 442 <xsl:text> * aIface) : Base(aIface) {}

</xsl:text> 443 443 <!-- assignment taking CWhatever --> 444 <xsl:text> template 445 <xsl:value-of select="substring(@name,2)"/> 446 <xsl:text> & operator = (const CInterface<OI, OB> & that)444 <xsl:text> template<class OI, class OB> C</xsl:text> 445 <xsl:value-of select="substring(@name,2)"/> 446 <xsl:text> & operator=(const CInterface<OI, OB> & that) 447 447 { 448 attach 449 if (SUCCEEDED 448 attach(that.raw()); 449 if (SUCCEEDED(mRC)) 450 450 { 451 451 mRC = that.lastRC(); 452 setErrorInfo 452 setErrorInfo(that.errorInfo()); 453 453 } 454 454 return *this; … … 459 459 <xsl:text> C</xsl:text> 460 460 <xsl:value-of select="substring(@name,2)"/> 461 <xsl:text> & operator =(const C</xsl:text>461 <xsl:text> & operator=(const C</xsl:text> 462 462 <xsl:value-of select="substring(@name,2)"/> 463 463 <xsl:text> & that) 464 464 { 465 Base::operator= 465 Base::operator=(that); 466 466 return *this; 467 467 } … … 469 469 <xsl:text>
</xsl:text> 470 470 <!-- assignment taking a raw iface pointer --> 471 <xsl:text> template 472 <xsl:value-of select="substring(@name,2)"/> 473 <xsl:text> & operator =(OI * aIface)471 <xsl:text> template<class OI> C</xsl:text> 472 <xsl:value-of select="substring(@name,2)"/> 473 <xsl:text> & operator=(OI * aIface) 474 474 { 475 attach 475 attach(aIface); 476 476 return *this; 477 477 } … … 481 481 <xsl:text> C</xsl:text> 482 482 <xsl:value-of select="substring(@name,2)"/> 483 <xsl:text> & operator =(</xsl:text>483 <xsl:text> & operator=(</xsl:text> 484 484 <xsl:value-of select="@name"/> 485 485 <xsl:text> * aIface) 486 486 { 487 Base::operator= 487 Base::operator=(aIface); 488 488 return *this; 489 489 } … … 703 703 bool fResult = fDef; 704 704 QString value = GetExtraData(strKey); 705 if ( value == "true" 705 if ( value == "true" 706 706 || value == "on" 707 707 || value == "yes") … … 951 951 <xsl:text>
{
</xsl:text> 952 952 <!-- iface assertion --> 953 <xsl:text> Assert (mIface);
</xsl:text> 954 <xsl:text> if (!mIface)
 return;
</xsl:text> 953 <xsl:text> AssertReturnVoid(mIface);
</xsl:text> 955 954 <!-- method call --> 956 955 <xsl:call-template name="composeMethodCall"> … … 991 990 <xsl:text>;
</xsl:text> 992 991 <!-- iface assertion --> 993 <xsl:text> Assert (mIface);
</xsl:text> 994 <xsl:text> if (!mIface)
 return a</xsl:text> 992 <xsl:text> AssertReturn(mIface, a</xsl:text> 995 993 <xsl:call-template name="capitalize"> 996 994 <xsl:with-param name="str" select="$return/@name"/> 997 995 </xsl:call-template> 998 <xsl:text> ;
</xsl:text>996 <xsl:text>);
</xsl:text> 999 997 <!-- method call --> 1000 998 <xsl:call-template name="composeMethodCall"/> … … 1034 1032 <xsl:with-param name="str" select="@name"/> 1035 1033 </xsl:call-template> 1036 <xsl:text> 1034 <xsl:text>(</xsl:text> 1037 1035 <!-- parameter --> 1038 1036 <xsl:apply-templates select="@type" mode="param"/> … … 1049 1047 <xsl:with-param name="str" select="@name"/> 1050 1048 </xsl:call-template> 1051 <xsl:text> 1049 <xsl:text>(</xsl:text> 1052 1050 <!-- const method --> 1053 1051 <xsl:text>) const</xsl:text> … … 1061 1059 <xsl:with-param name="str" select="@name"/> 1062 1060 </xsl:call-template> 1063 <xsl:text> 1061 <xsl:text>(</xsl:text> 1064 1062 <!-- parameters --> 1065 1063 <xsl:for-each select="param[@dir!='return']"> … … 1115 1113 <xsl:with-param name="str" select="@name"/> 1116 1114 </xsl:call-template> 1117 <xsl:text>) 1115 <xsl:text>)(</xsl:text> 1118 1116 <!-- parameter --> 1119 1117 <xsl:call-template name="composeMethodCallParam"> … … 1128 1126 <xsl:with-param name="str" select="@name"/> 1129 1127 </xsl:call-template> 1130 <xsl:text> 1128 <xsl:text>(</xsl:text> 1131 1129 <!-- parameters --> 1132 1130 <xsl:for-each select="param"> … … 1202 1200 <xsl:otherwise> 1203 1201 <xsl:if test="$supports='strict' or $supports='yes'"> 1204 <xsl:text> if ( mRC != S_OK)
 {
</xsl:text>1205 <xsl:text> fetchErrorInfo (mIface, &COM_IIDOF(Base::Iface));
</xsl:text>1202 <xsl:text> if (RT_UNLIKELY(mRC != S_OK))
 {
</xsl:text> 1203 <xsl:text> fetchErrorInfo(mIface, &COM_IIDOF(Base::Iface));
</xsl:text> 1206 1204 <xsl:if test="$supports='strict'"> 1207 <xsl:text> AssertMsg 1205 <xsl:text> AssertMsg(errInfo.isFullAvailable(), </xsl:text> 1208 1206 <xsl:text>("for RC=0x%08X\n", mRC));
</xsl:text> 1209 1207 </xsl:if> … … 1226 1224 <xsl:choose> 1227 1225 <xsl:when test="$isIn"> 1228 <xsl:text>ComSafeArrayAsInParam 1226 <xsl:text>ComSafeArrayAsInParam(</xsl:text> 1229 1227 <xsl:value-of select="@name"/> 1230 1228 <xsl:text>)</xsl:text> 1231 1229 </xsl:when> 1232 1230 <xsl:when test="$isOut"> 1233 <xsl:text>ComSafeArrayAsOutParam 1231 <xsl:text>ComSafeArrayAsOutParam(</xsl:text> 1234 1232 <xsl:value-of select="@name"/> 1235 1233 <xsl:text>)</xsl:text> … … 1241 1239 <xsl:choose> 1242 1240 <xsl:when test="$isIn"> 1243 <xsl:text>BSTRIn 1241 <xsl:text>BSTRIn(a</xsl:text> 1244 1242 <xsl:call-template name="capitalize"> 1245 1243 <xsl:with-param name="str" select="@name"/> … … 1248 1246 </xsl:when> 1249 1247 <xsl:when test="$isOut"> 1250 <xsl:text>BSTROut 1248 <xsl:text>BSTROut(a</xsl:text> 1251 1249 <xsl:call-template name="capitalize"> 1252 1250 <xsl:with-param name="str" select="@name"/> … … 1271 1269 </xsl:when> 1272 1270 <xsl:when test="$isOut"> 1273 <xsl:text>ENUMOut 1271 <xsl:text>ENUMOut<K</xsl:text> 1274 1272 <xsl:value-of select="@type"/> 1275 1273 <xsl:text>, </xsl:text> 1276 1274 <xsl:value-of select="@type"/> 1277 <xsl:text>_T> 1275 <xsl:text>_T>(a</xsl:text> 1278 1276 <xsl:call-template name="capitalize"> 1279 1277 <xsl:with-param name="str" select="@name"/> … … 1391 1389 <xsl:when test="../@mod='string'"> 1392 1390 <xsl:if test="../@safearray"> 1393 <xsl:text>QVector 1391 <xsl:text>QVector<</xsl:text> 1394 1392 </xsl:if> 1395 1393 <xsl:choose> … … 1423 1421 <xsl:otherwise> 1424 1422 <xsl:if test="../@safearray"> 1425 <xsl:text>QVector 1423 <xsl:text>QVector<</xsl:text> 1426 1424 </xsl:if> 1427 1425 <xsl:choose> … … 1825 1823 <!-- interface types need special treatment here --> 1826 1824 <xsl:when test="@type='$unknown' or $is_iface"> 1827 <xsl:text> ToSafeIfaceArray 1825 <xsl:text> ToSafeIfaceArray(</xsl:text> 1828 1826 </xsl:when> 1829 1827 <xsl:otherwise> 1830 <xsl:text> ToSafeArray 1828 <xsl:text> ToSafeArray(</xsl:text> 1831 1829 </xsl:otherwise> 1832 1830 </xsl:choose> … … 1851 1849 <!-- interface types need special treatment here --> 1852 1850 <xsl:when test="@type='$unknown' or $is_iface"> 1853 <xsl:text> FromSafeIfaceArray 1851 <xsl:text> FromSafeIfaceArray(</xsl:text> 1854 1852 </xsl:when> 1855 1853 <xsl:otherwise> 1856 <xsl:text> FromSafeArray 1854 <xsl:text> FromSafeArray(</xsl:text> 1857 1855 </xsl:otherwise> 1858 1856 </xsl:choose>
Note:
See TracChangeset
for help on using the changeset viewer.