- Timestamp:
- Jan 21, 2015 2:12:23 AM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/idl/apiwrap-server.xsl
r53879 r53882 331 331 <xsl:param name="mod"/> 332 332 333 <!-- get C++ glue type from IDL type from table in typemap-shared.inc.xsl -->334 <xsl:variable name="gluetypefield" select="exsl:node-set($G_aSharedTypes)/type[@idlname=$type]/@gluename"/>335 333 <xsl:choose> 336 334 <xsl:when test="$type='wstring' or $type='uuid'"> 335 <xsl:if test="$dir='in'"> 336 <xsl:text>IN_</xsl:text> 337 </xsl:if> 338 <xsl:text>BSTR</xsl:text> 339 </xsl:when> 340 341 <xsl:when test="$type='$unknown'"> 342 <xsl:text>IUnknown *</xsl:text> 343 </xsl:when> 344 345 <!-- Micro optimizations: Put off wraptypefield calculation as long as possible; Check interfaces before enums. --> 346 <xsl:otherwise> 347 <!-- get C++ glue type from IDL type from table in typemap-shared.inc.xsl --> 348 <xsl:variable name="gluetypefield" select="exsl:node-set($G_aSharedTypes)/type[@idlname=$type]/@gluename"/> 337 349 <xsl:choose> 338 <xsl:when test="$dir='in'"> 339 <xsl:text>IN_BSTR</xsl:text> 340 </xsl:when> 350 <xsl:when test="string-length($gluetypefield)"> 351 <xsl:value-of select="$gluetypefield"/> 352 </xsl:when> 353 354 <xsl:when test="//interface[@name=$type]"> 355 <xsl:variable name="thatif" select="//interface[@name=$type]"/> 356 <xsl:variable name="thatifname" select="$thatif/@name"/> 357 <xsl:value-of select="concat($thatifname, ' *')"/> 358 </xsl:when> 359 360 <xsl:when test="//enum[@name=$type]"> 361 <xsl:value-of select="concat($type, '_T')"/> 362 </xsl:when> 363 341 364 <xsl:otherwise> 342 <xsl:text>BSTR</xsl:text> 365 <xsl:call-template name="fatalError"> 366 <xsl:with-param name="msg" select="concat('translatepublictype: Type "', $type, '" is not supported.')"/> 367 </xsl:call-template> 343 368 </xsl:otherwise> 344 369 </xsl:choose> 345 </xsl:when>346 <xsl:when test="string-length($gluetypefield)">347 <xsl:value-of select="$gluetypefield"/>348 </xsl:when>349 <xsl:when test="//enum[@name=$type]">350 <xsl:value-of select="concat($type, '_T')"/>351 </xsl:when>352 <xsl:when test="$type='$unknown'">353 <xsl:text>IUnknown *</xsl:text>354 </xsl:when>355 <xsl:when test="//interface[@name=$type]">356 <xsl:variable name="thatif" select="//interface[@name=$type]"/>357 <xsl:variable name="thatifname" select="$thatif/@name"/>358 <xsl:value-of select="concat($thatifname, ' *')"/>359 </xsl:when>360 <xsl:otherwise>361 <xsl:call-template name="fatalError">362 <xsl:with-param name="msg" select="concat('translatepublictype: Type "', $type, '" is not supported.')"/>363 </xsl:call-template>364 370 </xsl:otherwise> 365 371 </xsl:choose> … … 375 381 <xsl:param name="safearray"/> 376 382 377 <!-- get C++ wrap type from IDL type from table in typemap-shared.inc.xsl -->378 <xsl:variable name="wraptypefield" select="exsl:node-set($G_aSharedTypes)/type[@idlname=$type]/@gluename"/>379 383 <xsl:choose> 380 384 <xsl:when test="$type='wstring'"> … … 384 388 <xsl:text>com::Utf8Str &</xsl:text> 385 389 </xsl:when> 390 386 391 <xsl:when test="$type='uuid'"> 387 392 <xsl:if test="$dir='in'"> … … 390 395 <xsl:text>com::Guid &</xsl:text> 391 396 </xsl:when> 392 <xsl:when test="string-length($wraptypefield)"> 393 <xsl:value-of select="$wraptypefield"/> 394 </xsl:when> 395 <xsl:when test="//enum[@name=$type]"> 396 <xsl:value-of select="concat($type, '_T')"/> 397 </xsl:when> 397 398 398 <xsl:when test="$type='$unknown'"> 399 399 <xsl:if test="$dir='in' and not($safearray='yes')"> … … 402 402 <xsl:text>ComPtr<IUnknown> &</xsl:text> 403 403 </xsl:when> 404 <xsl:when test="//interface[@name=$type]"> 405 <xsl:variable name="thatif" select="//interface[@name=$type]"/> 406 <xsl:variable name="thatifname" select="$thatif/@name"/> 407 <xsl:if test="$dir='in' and not($safearray='yes')"> 408 <xsl:text>const </xsl:text> 409 </xsl:if> 410 <xsl:value-of select="concat('ComPtr<', $thatifname, '> &')"/> 411 </xsl:when> 404 405 <!-- Micro optimizations: Put off wraptypefield calculation as long as possible; Check interfaces before enums. --> 412 406 <xsl:otherwise> 413 <xsl:call-template name="fatalError"> 414 <xsl:with-param name="msg" select="concat('translatewrappedtype: Type "', $type, '" is not supported.')"/> 415 </xsl:call-template> 407 <!-- get C++ wrap type from IDL type from table in typemap-shared.inc.xsl --> 408 <xsl:variable name="wraptypefield" select="exsl:node-set($G_aSharedTypes)/type[@idlname=$type]/@gluename"/> 409 <xsl:choose> 410 <xsl:when test="string-length($wraptypefield)"> 411 <xsl:value-of select="$wraptypefield"/> 412 </xsl:when> 413 414 <xsl:when test="//interface[@name=$type]"> 415 <xsl:variable name="thatif" select="//interface[@name=$type]"/> 416 <xsl:variable name="thatifname" select="$thatif/@name"/> 417 <xsl:if test="$dir='in' and not($safearray='yes')"> 418 <xsl:text>const </xsl:text> 419 </xsl:if> 420 <xsl:value-of select="concat('ComPtr<', $thatifname, '> &')"/> 421 </xsl:when> 422 423 <xsl:when test="//enum[@name=$type]"> 424 <xsl:value-of select="concat($type, '_T')"/> 425 </xsl:when> 426 427 <xsl:otherwise> 428 <xsl:call-template name="fatalError"> 429 <xsl:with-param name="msg" select="concat('translatewrappedtype: Type "', $type, '" is not supported.')"/> 430 </xsl:call-template> 431 </xsl:otherwise> 432 </xsl:choose> 416 433 </xsl:otherwise> 417 434 </xsl:choose> … … 856 873 <xsl:param name="dir"/> 857 874 <xsl:variable name="type" select="."/> 858 <xsl:variable name="thatif" select="//interface[@name=$type]"/> 859 <xsl:if test="$thatif or $type = 'wstring' or $type = '$unknown' or $type = 'uuid' or ../@safearray = 'yes'"> 860 <xsl:text>yes</xsl:text> 861 </xsl:if> 875 <xsl:choose> 876 <xsl:when test="$type = 'wstring' or $type = '$unknown' or $type = 'uuid' or ../@safearray = 'yes'"> 877 <xsl:text>yes</xsl:text> 878 </xsl:when> 879 <!-- Micro optimizations: Postpone calculating $thatif. --> 880 <xsl:otherwise> 881 <xsl:variable name="thatif" select="//interface[@name=$type]"/> 882 <xsl:if test="$thatif"> 883 <xsl:text>yes</xsl:text> 884 </xsl:if> 885 </xsl:otherwise> 886 </xsl:choose> 862 887 </xsl:template> 863 888 … … 866 891 <xsl:param name="dir"/> 867 892 868 <xsl:variable name="gluetype">869 <xsl:call-template name="translatepublictype">870 <xsl:with-param name="type" select="."/>871 <xsl:with-param name="dir" select="$dir"/>872 <xsl:with-param name="mod" select="../@mod"/>873 </xsl:call-template>874 </xsl:variable>875 893 <xsl:variable name="type" select="."/> 876 <xsl:variable name="thatif" select="//interface[@name=$type]"/>877 878 894 <xsl:choose> 879 895 <xsl:when test="$type='$unknown'"> … … 891 907 </xsl:when> 892 908 893 <xsl:when test="$thatif">894 <xsl:if test="../@safearray='yes'">895 <xsl:text>Array</xsl:text>896 </xsl:if>897 <xsl:choose>898 <xsl:when test="$dir='in'">899 <xsl:text>ComTypeInConverter</xsl:text>900 </xsl:when>901 <xsl:otherwise>902 <xsl:text>ComTypeOutConverter</xsl:text>903 </xsl:otherwise>904 </xsl:choose>905 <xsl:variable name="thatifname" select="$thatif/@name"/>906 <xsl:value-of select="concat('<', $thatifname, '>')"/>907 </xsl:when>908 909 909 <xsl:when test="$type='wstring'"> 910 910 <xsl:if test="../@safearray='yes'"> … … 935 935 </xsl:when> 936 936 937 <xsl:when test="../@safearray='yes'"> 938 <xsl:text>Array</xsl:text> 937 <!-- Micro optimizations: Delay calculating thatif. --> 938 <xsl:otherwise> 939 <xsl:variable name="thatif" select="//interface[@name=$type]"/> 939 940 <xsl:choose> 940 <xsl:when test="$dir='in'"> 941 <xsl:text>InConverter</xsl:text> 942 </xsl:when> 943 <xsl:otherwise> 944 <xsl:text>OutConverter</xsl:text> 945 </xsl:otherwise> 941 <xsl:when test="$thatif"> 942 <xsl:if test="../@safearray='yes'"> 943 <xsl:text>Array</xsl:text> 944 </xsl:if> 945 <xsl:choose> 946 <xsl:when test="$dir='in'"> 947 <xsl:text>ComTypeInConverter</xsl:text> 948 </xsl:when> 949 <xsl:otherwise> 950 <xsl:text>ComTypeOutConverter</xsl:text> 951 </xsl:otherwise> 952 </xsl:choose> 953 <xsl:variable name="thatifname" select="$thatif/@name"/> 954 <xsl:value-of select="concat('<', $thatifname, '>')"/> 955 </xsl:when> 956 957 <xsl:when test="../@safearray='yes'"> 958 <xsl:text>Array</xsl:text> 959 <xsl:choose> 960 <xsl:when test="$dir='in'"> 961 <xsl:text>InConverter</xsl:text> 962 </xsl:when> 963 <xsl:otherwise> 964 <xsl:text>OutConverter</xsl:text> 965 </xsl:otherwise> 966 </xsl:choose> 967 <xsl:variable name="gluetype"> 968 <xsl:call-template name="translatepublictype"> 969 <xsl:with-param name="type" select="."/> 970 <xsl:with-param name="dir" select="$dir"/> 971 <xsl:with-param name="mod" select="../@mod"/> 972 </xsl:call-template> 973 </xsl:variable> 974 <xsl:value-of select="concat('<', $gluetype, '>')"/> 975 </xsl:when> 946 976 </xsl:choose> 947 <xsl:value-of select="concat('<', $gluetype, '>')"/> 948 </xsl:when> 977 </xsl:otherwise> 949 978 </xsl:choose> 950 979 </xsl:template>
Note:
See TracChangeset
for help on using the changeset viewer.