Changeset 53938 in vbox
- Timestamp:
- Jan 22, 2015 8:58:37 PM (10 years ago)
- svn:sync-xref-src-repo-rev:
- 97814
- Location:
- trunk/src/VBox/Main
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/cbinding/Makefile.kmk
r53805 r53938 64 64 $$(CAPIHeaders_0_OUTDIR)/VBoxCAPI.h: \ 65 65 $(PATH_SUB_CURRENT)/capiidl.xsl \ 66 $(PATH_SUB_CURRENT)/../idl/typemap-shared.inc.xsl \ 66 67 $(VBOX_XIDL_FILE) \ 67 68 | $$(dir $$@) -
trunk/src/VBox/Main/cbinding/capiidl.xsl
r52848 r53938 8 8 * compiler (which simultaneously supports C and C++, unlike XPCOM). 9 9 10 Copyright (C) 2008-201 4Oracle Corporation10 Copyright (C) 2008-2015 Oracle Corporation 11 11 12 12 This file is part of VirtualBox Open Source Edition (OSE), as … … 25 25 26 26 27 <xsl:include href="../idl/typemap-shared.inc.xsl"/> 28 27 29 <!-- 28 // helper definitions30 // Keys for more efficiently looking up of types. 29 31 ///////////////////////////////////////////////////////////////////////////// 30 32 --> 31 33 32 <!-- 33 * capitalizes the first letter 34 --> 35 <xsl:template name="capitalize"> 36 <xsl:param name="str" select="."/> 37 <xsl:value-of select=" 38 concat( 39 translate(substring($str,1,1),'abcdefghijklmnopqrstuvwxyz','ABCDEFGHIJKLMNOPQRSTUVWXYZ'), 40 substring($str,2) 41 ) 42 "/> 43 </xsl:template> 44 45 <!-- 46 * uncapitalizes the first letter only if the second one is not capital 47 * otherwise leaves the string unchanged 48 --> 49 <xsl:template name="uncapitalize"> 50 <xsl:param name="str" select="."/> 51 <xsl:choose> 52 <xsl:when test="not(contains('ABCDEFGHIJKLMNOPQRSTUVWXYZ', substring($str,2,1)))"> 53 <xsl:value-of select=" 54 concat( 55 translate(substring($str,1,1),'ABCDEFGHIJKLMNOPQRSTUVWXYZ','abcdefghijklmnopqrstuvwxyz'), 56 substring($str,2) 57 ) 58 "/> 59 </xsl:when> 60 <xsl:otherwise> 61 <xsl:value-of select="string($str)"/> 62 </xsl:otherwise> 63 </xsl:choose> 64 </xsl:template> 65 66 <!-- 67 * translates the string to uppercase 68 --> 69 <xsl:template name="uppercase"> 70 <xsl:param name="str" select="."/> 71 <xsl:value-of select=" 72 translate($str,'abcdefghijklmnopqrstuvwxyz','ABCDEFGHIJKLMNOPQRSTUVWXYZ') 73 "/> 74 </xsl:template> 75 76 77 <!-- 78 * translates the string to lowercase 79 --> 80 <xsl:template name="lowercase"> 81 <xsl:param name="str" select="."/> 82 <xsl:value-of select=" 83 translate($str,'ABCDEFGHIJKLMNOPQRSTUVWXYZ','abcdefghijklmnopqrstuvwxyz') 84 "/> 85 </xsl:template> 34 <xsl:key name="G_keyInterfacesByName" match="//interface[@name]" use="@name"/> 86 35 87 36 … … 124 73 125 74 /* 126 * Copyright (C) 2008-201 4Oracle Corporation75 * Copyright (C) 2008-2015 Oracle Corporation 127 76 * 128 77 * This file is part of a free software library; you can redistribute … … 1258 1207 #endif /* !VBOX_WITH_GLUE */ 1259 1208 }; 1260 1261 1209 </xsl:text> 1210 <xsl:call-template name="xsltprocNewlineOutputHack"/> 1262 1211 <xsl:apply-templates/> 1263 1212 <xsl:text> … … 1627 1576 <xsl:template match="library"> 1628 1577 <!-- result codes --> 1629 <xsl: text>
</xsl:text>1578 <xsl:call-template name="xsltprocNewlineOutputHack"/> 1630 1579 <xsl:for-each select="result"> 1631 1580 <xsl:apply-templates select="."/> 1632 1581 </xsl:for-each> 1633 <xsl:text>

</xsl:text> 1582 <xsl:call-template name="xsltprocNewlineOutputHack"/> 1583 <xsl:call-template name="xsltprocNewlineOutputHack"/> 1634 1584 <!-- forward declarations --> 1635 1585 <xsl:apply-templates select="interface | if/interface" mode="forward"/> 1636 <xsl: text>
</xsl:text>1586 <xsl:call-template name="xsltprocNewlineOutputHack"/> 1637 1587 <!-- typedef'ing the struct declarations --> 1638 1588 <xsl:apply-templates select="interface | if/interface" mode="typedef"/> 1639 <xsl: text>
</xsl:text>1589 <xsl:call-template name="xsltprocNewlineOutputHack"/> 1640 1590 <!-- all enums go first --> 1641 1591 <xsl:apply-templates select="enum | if/enum"/> … … 1770 1720 </xsl:when> 1771 1721 <xsl:otherwise> 1772 <xsl:apply-templates select=" //interface[@name=$extends]" mode="cobjmacro">1722 <xsl:apply-templates select="key('G_keyInterfacesByName', $extends)" mode="cobjmacro"> 1773 1723 <xsl:with-param name="iface" select="$iface"/> 1774 1724 </xsl:apply-templates> … … 1847 1797 </xsl:when> 1848 1798 <xsl:otherwise> 1849 <xsl:apply-templates select=" //interface[@name=$extends]" mode="vtab_flat">1799 <xsl:apply-templates select="key('G_keyInterfacesByName', $extends)" mode="vtab_flat"> 1850 1800 <xsl:with-param name="iface" select="$iface"/> 1851 1801 </xsl:apply-templates> … … 1872 1822 <xsl:text> declaration */
</xsl:text> 1873 1823 <xsl:text>#define </xsl:text> 1874 <xsl:call-template name=" uppercase">1824 <xsl:call-template name="string-to-upper"> 1875 1825 <xsl:with-param name="str" select="@name"/> 1876 1826 </xsl:call-template> … … 1878 1828 <xsl:text>
</xsl:text> 1879 1829 <xsl:text>#define </xsl:text> 1880 <xsl:call-template name=" uppercase">1830 <xsl:call-template name="string-to-upper"> 1881 1831 <xsl:with-param name="str" select="@name"/> 1882 1832 </xsl:call-template> … … 1911 1861 <xsl:value-of select="@extends"/> 1912 1862 <xsl:text>_vtbl </xsl:text> 1913 <xsl:call-template name=" lowercase">1863 <xsl:call-template name="string-to-lower"> 1914 1864 <xsl:with-param name="str" select="@extends"/> 1915 1865 </xsl:call-template> … … 1953 1903 <xsl:text>/* End of struct </xsl:text> 1954 1904 <xsl:value-of select="@name"/> 1955 <xsl:text> declaration */


</xsl:text> 1905 <xsl:text> declaration */

</xsl:text> 1906 <xsl:call-template name="xsltprocNewlineOutputHack"/> 1956 1907 </xsl:if> 1957 1908 </xsl:template> … … 2221 2172 <xsl:text>
</xsl:text> 2222 2173 <xsl:text>#define NS_</xsl:text> 2223 <xsl:call-template name=" uppercase">2174 <xsl:call-template name="string-to-upper"> 2224 2175 <xsl:with-param name="str" select="@name"/> 2225 2176 </xsl:call-template> … … 2239 2190 <xsl:text> } \
}
</xsl:text> 2240 2191 <xsl:text>#define NS_</xsl:text> 2241 <xsl:call-template name=" uppercase">2192 <xsl:call-template name="string-to-upper"> 2242 2193 <xsl:with-param name="str" select="@name"/> 2243 2194 </xsl:call-template> … … 2265 2216 <xsl:text> declaration */
</xsl:text> 2266 2217 <xsl:text>#define </xsl:text> 2267 <xsl:call-template name=" uppercase">2218 <xsl:call-template name="string-to-upper"> 2268 2219 <xsl:with-param name="str" select="@name"/> 2269 2220 </xsl:call-template> … … 2271 2222 <xsl:text>
</xsl:text> 2272 2223 <xsl:text>#define </xsl:text> 2273 <xsl:call-template name=" uppercase">2224 <xsl:call-template name="string-to-upper"> 2274 2225 <xsl:with-param name="str" select="@name"/> 2275 2226 </xsl:call-template> -
trunk/src/VBox/Main/idl/typemap-shared.inc.xsl
r53934 r53938 386 386 </xsl:template> 387 387 388 389 <!-- 390 string-to-upper - translates the string to uppercase. 391 --> 392 <xsl:template name="string-to-upper"> 393 <xsl:param name="str" select="."/> 394 <xsl:value-of select="translate($str, $G_lowerCase, $G_upperCase)"/> 395 </xsl:template> 396 397 <!-- 398 string-to-lower - translates the string to lowercase. 399 --> 400 <xsl:template name="string-to-lower"> 401 <xsl:param name="str" select="."/> 402 <xsl:value-of select="translate($str, $G_upperCase, $G_lowerCase)"/> 403 </xsl:template> 404 388 405 <!-- 389 406 string-replace - Replace all occurencees of needle in haystack.
Note:
See TracChangeset
for help on using the changeset viewer.