Changeset 23223 in vbox for trunk/src/VBox/Main/cbinding
- Timestamp:
- Sep 22, 2009 3:50:03 PM (15 years ago)
- Location:
- trunk/src/VBox/Main/cbinding
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/cbinding/tstXPCOMCCall.c
r20220 r23223 140 140 } 141 141 142 static nsresult OnDVDDriveChange(IConsoleCallback *pThis )143 {144 printf("OnDVDDriveChange \n");145 return 0;146 }147 148 static nsresult OnFloppyDriveChange(IConsoleCallback *pThis )149 {150 printf("OnFloppyDriveChange \n");151 return 0;152 }153 154 142 static nsresult OnNetworkAdapterChange( 155 143 IConsoleCallback *pThis, … … 176 164 } 177 165 178 static nsresult OnStorageControllerChange(IConsoleCallback *pThis 166 static nsresult OnStorageControllerChange(IConsoleCallback *pThis) 179 167 { 180 168 printf("OnStorageControllerChange\n"); 169 return 0; 170 } 171 172 static nsresult OnMediumChange(IConsoleCallback *pThis, 173 IMediumAttachment *mediumAttachment) 174 { 175 printf("OnMediumChange\n"); 181 176 return 0; 182 177 } … … 328 323 consoleCallback->vtbl->OnAdditionsStateChange = &OnAdditionsStateChange; 329 324 consoleCallback->vtbl->OnDVDDriveChange = &OnDVDDriveChange; 330 consoleCallback->vtbl->OnFloppyDriveChange = &OnFloppyDriveChange;331 consoleCallback->vtbl->OnNetworkAdapterChange = &OnNetworkAdapterChange;332 325 consoleCallback->vtbl->OnSerialPortChange = &OnSerialPortChange; 333 326 consoleCallback->vtbl->OnParallelPortChange = &OnParallelPortChange; 334 327 consoleCallback->vtbl->OnStorageControllerChange = &OnStorageControllerChange; 328 consoleCallback->vtbl->OnMediumChange = &OnMediumChange; 335 329 consoleCallback->vtbl->OnVRDPServerChange = &OnVRDPServerChange; 336 330 consoleCallback->vtbl->OnUSBControllerChange = &OnUSBControllerChange; -
trunk/src/VBox/Main/cbinding/xpcidl.xsl
r19694 r23223 1133 1133 <xsl:text>

</xsl:text> 1134 1134 <!-- forward declarations --> 1135 <xsl:apply-templates select="if | interface | collection | enumerator" mode="forward"/>1135 <xsl:apply-templates select="if | interface" mode="forward"/> 1136 1136 <xsl:text>
</xsl:text> 1137 1137 <!-- typedef'ing the struct declarations --> 1138 <xsl:apply-templates select="if | interface | collection | enumerator" mode="typedef"/>1138 <xsl:apply-templates select="if | interface" mode="typedef"/> 1139 1139 <xsl:text>
</xsl:text> 1140 1140 <!-- all enums go first --> … … 1159 1159 * forward declarations 1160 1160 --> 1161 <xsl:template match="interface | collection | enumerator" mode="forward">1161 <xsl:template match="interface" mode="forward"> 1162 1162 <xsl:text>struct </xsl:text> 1163 1163 <xsl:value-of select="@name"/> … … 1169 1169 * typedef'ing the struct declarations 1170 1170 --> 1171 <xsl:template match="interface | collection | enumerator" mode="typedef">1171 <xsl:template match="interface" mode="typedef"> 1172 1172 <xsl:text>typedef struct </xsl:text> 1173 1173 <xsl:value-of select="@name"/> … … 1251 1251 * attributes 1252 1252 --> 1253 <xsl:template match="interface//attribute | collection//attribute"> 1254 <xsl:if test="@array"> 1255 <xsl:message terminate="yes"> 1256 <xsl:value-of select="concat(../../@name,'::',../@name,'::',@name,': ')"/> 1257 <xsl:text>'array' attributes are not supported, use 'safearray="yes"' instead.</xsl:text> 1258 </xsl:message> 1259 </xsl:if> 1253 <xsl:template match="interface//attribute"> 1260 1254 <xsl:apply-templates select="@if" mode="begin"/> 1261 1255 <xsl:if test="@mod='ptr'"> … … 1354 1348 </xsl:template> 1355 1349 1356 <xsl:template match="interface//attribute | collection//attribute" mode="forwarder">1357 1358 <xsl:variable name="parent" select="ancestor::interface | ancestor::collection"/>1350 <xsl:template match="interface//attribute" mode="forwarder"> 1351 1352 <xsl:variable name="parent" select="ancestor::interface"/> 1359 1353 1360 1354 <xsl:apply-templates select="@if" mode="begin"/> … … 1511 1505 * methods 1512 1506 --> 1513 <xsl:template match="interface//method | collection//method">1507 <xsl:template match="interface//method"> 1514 1508 <xsl:apply-templates select="@if" mode="begin"/> 1515 1509 <xsl:if test="param/@mod='ptr'"> … … 1544 1538 </xsl:template> 1545 1539 1546 <xsl:template match="interface//method | collection//method" mode="forwarder">1547 1548 <xsl:variable name="parent" select="ancestor::interface | ancestor::collection"/>1540 <xsl:template match="interface//method" mode="forwarder"> 1541 1542 <xsl:variable name="parent" select="ancestor::interface"/> 1549 1543 1550 1544 <xsl:apply-templates select="@if" mode="begin"/> … … 1695 1689 <xsl:text>_CID
</xsl:text> 1696 1690 <xsl:text>

</xsl:text> 1697 </xsl:template>1698 1699 1700 <!--1701 * enumerators1702 -->1703 <xsl:template match="enumerator">1704 <xsl:text>/* Start of struct </xsl:text>1705 <xsl:value-of select="@name"/>1706 <xsl:text> Declaration */
</xsl:text>1707 <xsl:text>#define </xsl:text>1708 <xsl:call-template name="uppercase">1709 <xsl:with-param name="str" select="@name"/>1710 </xsl:call-template>1711 <xsl:value-of select="concat('_IID_STR "',@uuid,'"')"/>1712 <xsl:text>
</xsl:text>1713 <xsl:text>#define </xsl:text>1714 <xsl:call-template name="uppercase">1715 <xsl:with-param name="str" select="@name"/>1716 </xsl:call-template>1717 <xsl:text>_IID { \
</xsl:text>1718 <xsl:text> 0x</xsl:text><xsl:value-of select="substring(@uuid,1,8)"/>1719 <xsl:text>, 0x</xsl:text><xsl:value-of select="substring(@uuid,10,4)"/>1720 <xsl:text>, 0x</xsl:text><xsl:value-of select="substring(@uuid,15,4)"/>1721 <xsl:text>, \
 </xsl:text>1722 <xsl:text>{ 0x</xsl:text><xsl:value-of select="substring(@uuid,20,2)"/>1723 <xsl:text>, 0x</xsl:text><xsl:value-of select="substring(@uuid,22,2)"/>1724 <xsl:text>, 0x</xsl:text><xsl:value-of select="substring(@uuid,25,2)"/>1725 <xsl:text>, 0x</xsl:text><xsl:value-of select="substring(@uuid,27,2)"/>1726 <xsl:text>, 0x</xsl:text><xsl:value-of select="substring(@uuid,29,2)"/>1727 <xsl:text>, 0x</xsl:text><xsl:value-of select="substring(@uuid,31,2)"/>1728 <xsl:text>, 0x</xsl:text><xsl:value-of select="substring(@uuid,33,2)"/>1729 <xsl:text>, 0x</xsl:text><xsl:value-of select="substring(@uuid,35,2)"/>1730 <xsl:text> } \
}
</xsl:text>1731 <xsl:text>struct </xsl:text>1732 <xsl:value-of select="@name"/>1733 <xsl:text>_vtbl
{
</xsl:text>1734 <xsl:text> struct nsISupports_vtbl nsisupports;

</xsl:text>1735 <!-- attributes (properties) -->1736 <xsl:text> nsresult (*HasMore)(</xsl:text>1737 <xsl:value-of select="@name" />1738 <xsl:text> *pThis, PRBool *more);

</xsl:text>1739 <!-- GetNext -->1740 <xsl:text> nsresult (*GetNext)(</xsl:text>1741 <xsl:value-of select="@name" />1742 <xsl:text> *pThis, </xsl:text>1743 <xsl:apply-templates select="@type" mode="forwarder"/>1744 <xsl:text> *next);

</xsl:text>1745 <xsl:text>};</xsl:text>1746 <xsl:text>

</xsl:text>1747 <xsl:text>struct </xsl:text>1748 <xsl:value-of select="@name"/>1749 <xsl:text>
{
 struct </xsl:text>1750 <xsl:value-of select="@name"/>1751 <xsl:text>_vtbl *vtbl;
};
</xsl:text>1752 <xsl:text>/* End of struct </xsl:text>1753 <xsl:value-of select="@name"/>1754 <xsl:text> Declaration */


</xsl:text>1755 </xsl:template>1756 1757 1758 <!--1759 * collections1760 -->1761 <xsl:template match="collection">1762 <xsl:if test="not(@readonly='yes')">1763 <xsl:message terminate="yes">1764 <xsl:value-of select="concat(@name,': ')"/>1765 <xsl:text>non-readonly collections are not currently supported</xsl:text>1766 </xsl:message>1767 </xsl:if>1768 <xsl:text>/* Start of struct </xsl:text>1769 <xsl:value-of select="@name"/>1770 <xsl:text> Declaration */
</xsl:text>1771 <xsl:text>#define </xsl:text>1772 <xsl:call-template name="uppercase">1773 <xsl:with-param name="str" select="@name"/>1774 </xsl:call-template>1775 <xsl:value-of select="concat('_IID_STR "',@uuid,'"')"/>1776 <xsl:text>
</xsl:text>1777 <xsl:text>#define </xsl:text>1778 <xsl:call-template name="uppercase">1779 <xsl:with-param name="str" select="@name"/>1780 </xsl:call-template>1781 <xsl:text>_IID { \
</xsl:text>1782 <xsl:text> 0x</xsl:text><xsl:value-of select="substring(@uuid,1,8)"/>1783 <xsl:text>, 0x</xsl:text><xsl:value-of select="substring(@uuid,10,4)"/>1784 <xsl:text>, 0x</xsl:text><xsl:value-of select="substring(@uuid,15,4)"/>1785 <xsl:text>, \
 </xsl:text>1786 <xsl:text>{ 0x</xsl:text><xsl:value-of select="substring(@uuid,20,2)"/>1787 <xsl:text>, 0x</xsl:text><xsl:value-of select="substring(@uuid,22,2)"/>1788 <xsl:text>, 0x</xsl:text><xsl:value-of select="substring(@uuid,25,2)"/>1789 <xsl:text>, 0x</xsl:text><xsl:value-of select="substring(@uuid,27,2)"/>1790 <xsl:text>, 0x</xsl:text><xsl:value-of select="substring(@uuid,29,2)"/>1791 <xsl:text>, 0x</xsl:text><xsl:value-of select="substring(@uuid,31,2)"/>1792 <xsl:text>, 0x</xsl:text><xsl:value-of select="substring(@uuid,33,2)"/>1793 <xsl:text>, 0x</xsl:text><xsl:value-of select="substring(@uuid,35,2)"/>1794 <xsl:text> } \
}
</xsl:text>1795 <xsl:text>struct </xsl:text>1796 <xsl:value-of select="@name"/>1797 <xsl:text>_vtbl
{
</xsl:text>1798 <xsl:text> struct nsISupports_vtbl nsisupports;

</xsl:text>1799 <!-- Count -->1800 <xsl:text> nsresult (*GetCount)(</xsl:text>1801 <xsl:value-of select="@name" />1802 <xsl:text> *pThis, PRUint32 *aCount);

</xsl:text>1803 <!-- GetItemAt -->1804 <xsl:text> nsresult (*GetItemAt)(</xsl:text>1805 <xsl:value-of select="@name" />1806 <xsl:text> *pThis, PRUint32 index, </xsl:text>1807 <xsl:apply-templates select="@type" mode="forwarder"/>1808 <xsl:text> **item);

</xsl:text>1809 <!-- Enumerate -->1810 <xsl:text> nsresult (*Enumerate)(</xsl:text>1811 <xsl:value-of select="@name" />1812 <xsl:text> *pThis, </xsl:text>1813 <xsl:apply-templates select="@enumerator"/>1814 <xsl:text> **enumerator);

</xsl:text>1815 <!-- other extra attributes (properties) -->1816 <xsl:apply-templates select="attribute"/>1817 <!-- other extra methods -->1818 <xsl:apply-templates select="method"/>1819 <!-- 'if' enclosed elements, unsorted -->1820 <xsl:apply-templates select="if"/>1821 <xsl:text>};</xsl:text>1822 <xsl:text>

</xsl:text>1823 <xsl:text>struct </xsl:text>1824 <xsl:value-of select="@name"/>1825 <xsl:text>
{
 struct </xsl:text>1826 <xsl:value-of select="@name"/>1827 <xsl:text>_vtbl *vtbl;
};
</xsl:text>1828 <xsl:text>/* End of struct </xsl:text>1829 <xsl:value-of select="@name"/>1830 <xsl:text> Declaration */


</xsl:text>1831 1691 </xsl:template> 1832 1692 … … 1942 1802 <!-- normal and array parameters --> 1943 1803 <xsl:otherwise> 1944 <xsl:if test="@array">1945 <xsl:if test="@dir='return'">1946 <xsl:message terminate="yes">1947 <xsl:value-of select="concat(../../@name,'::',../@name,'::',@name,': ')"/>1948 <xsl:text>return 'array' parameters are not supported, use 'safearray="yes"' instead.</xsl:text>1949 </xsl:message>1950 </xsl:if>1951 <xsl:text>[array, </xsl:text>1952 <xsl:choose>1953 <xsl:when test="../param[@name=current()/@array]">1954 <xsl:if test="../param[@name=current()/@array]/@dir != @dir">1955 <xsl:message terminate="yes">1956 <xsl:value-of select="concat(../../@name,'::',../@name,': ')"/>1957 <xsl:value-of select="concat(@name,' and ',../param[@name=current()/@array]/@name)"/>1958 <xsl:text> must have the same direction</xsl:text>1959 </xsl:message>1960 </xsl:if>1961 <xsl:text>size_is(</xsl:text>1962 <xsl:value-of select="@array"/>1963 <xsl:text>)</xsl:text>1964 </xsl:when>1965 <xsl:otherwise>1966 <xsl:message terminate="yes">1967 <xsl:value-of select="concat(../../@name,'::',../@name,'::',@name,': ')"/>1968 <xsl:text>array attribute refers to non-existent param: </xsl:text>1969 <xsl:value-of select="@array"/>1970 </xsl:message>1971 </xsl:otherwise>1972 </xsl:choose>1973 <xsl:text>] </xsl:text>1974 </xsl:if>1975 1804 <xsl:choose> 1976 1805 <xsl:when test="@dir='in'"> … … 2026 1855 * attribute/parameter type conversion 2027 1856 --> 2028 <xsl:template match=" 2029 attribute/@type | param/@type | 2030 enumerator/@type | collection/@type | collection/@enumerator 2031 "> 1857 <xsl:template match="attribute/@type | param/@type"> 2032 1858 <xsl:variable name="self_target" select="current()/ancestor::if/@target"/> 2033 2034 <xsl:if test="../@array and ../@safearray='yes'">2035 <xsl:message terminate="yes">2036 <xsl:value-of select="concat(../../../@name,'::',../../@name,'::',../@name,': ')"/>2037 <xsl:text>either 'array' or 'safearray="yes"' attribute is allowed, but not both!</xsl:text>2038 </xsl:message>2039 </xsl:if>2040 1859 2041 1860 <xsl:choose> … … 2055 1874 <xsl:when test=".='unsigned long'">ulongPtr</xsl:when> 2056 1875 <xsl:when test=".='unsigned long long'">ullongPtr</xsl:when> 2057 <xsl:when test=".='char'">charPtr</xsl:when> 2058 <!--xsl:when test=".='string'">??</xsl:when--> 2059 <xsl:when test=".='wchar'">wcharPtr</xsl:when> 2060 <!--xsl:when test=".='wstring'">??</xsl:when--> 1876 <xsl:otherwise> 1877 <xsl:message terminate="yes"> 1878 <xsl:value-of select="concat(../../../@name,'::',../../@name,'::',../@name,': ')"/> 1879 <xsl:text>attribute 'mod=</xsl:text> 1880 <xsl:value-of select="concat('"',../@mod,'"')"/> 1881 <xsl:text>' cannot be used with type </xsl:text> 1882 <xsl:value-of select="concat('"',current(),'"!')"/> 1883 </xsl:message> 1884 </xsl:otherwise> 1885 </xsl:choose> 1886 </xsl:when> 1887 <xsl:when test="../@mod='string'"> 1888 <xsl:choose> 1889 <!-- standard types --> 1890 <!--xsl:when test=".='result'">??</xsl:when--> 1891 <xsl:when test=".='uuid'">wstring</xsl:when> 2061 1892 <xsl:otherwise> 2062 1893 <xsl:message terminate="yes"> … … 2143 1974 ((ancestor::library/interface[@name=current()]) or 2144 1975 (ancestor::library/if[@target=$self_target]/interface[@name=current()]) 2145 ) or2146 ((ancestor::library/collection[@name=current()]) or2147 (ancestor::library/if[@target=$self_target]/collection[@name=current()])2148 1976 ) 2149 1977 "> … … 2164 1992 </xsl:template> 2165 1993 2166 <xsl:template match=" 2167 attribute/@type | param/@type | 2168 enumerator/@type | collection/@type | collection/@enumerator 2169 " mode="forwarder"> 1994 <xsl:template match="attribute/@type | param/@type" mode="forwarder"> 2170 1995 2171 1996 <xsl:variable name="self_target" select="current()/ancestor::if/@target"/> … … 2187 2012 <xsl:when test=".='unsigned long'">PRUint32 *</xsl:when> 2188 2013 <xsl:when test=".='unsigned long long'">PRUint64 *</xsl:when> 2189 <xsl:when test=".='char'">char *</xsl:when> 2190 <!--xsl:when test=".='string'">??</xsl:when--> 2191 <xsl:when test=".='wchar'">PRUnichar *</xsl:when> 2192 <!--xsl:when test=".='wstring'">??</xsl:when--> 2014 <xsl:otherwise> 2015 <xsl:message terminate="yes"> 2016 <xsl:value-of select="concat(../../../@name,'::',../../@name,'::',../@name,': ')"/> 2017 <xsl:text>attribute 'mod=</xsl:text> 2018 <xsl:value-of select="concat('"',../@mod,'"')"/> 2019 <xsl:text>' cannot be used with type </xsl:text> 2020 <xsl:value-of select="concat('"',current(),'"!')"/> 2021 </xsl:message> 2022 </xsl:otherwise> 2023 </xsl:choose> 2024 </xsl:when> 2025 <xsl:when test="../@mod='string'"> 2026 <xsl:choose> 2027 <!-- standard types --> 2028 <!--xsl:when test=".='result'">??</xsl:when--> 2029 <xsl:when test=".='uuid'">PRUnichar *</xsl:when> 2030 <xsl:otherwise> 2031 <xsl:message terminate="yes"> 2032 <xsl:value-of select="concat(../../../@name,'::',../../@name,'::',../@name,': ')"/> 2033 <xsl:text>attribute 'mod=</xsl:text> 2034 <xsl:value-of select="concat('"',../@mod,'"')"/> 2035 <xsl:text>' cannot be used with type </xsl:text> 2036 <xsl:value-of select="concat('"',current(),'"!')"/> 2037 </xsl:message> 2038 </xsl:otherwise> 2193 2039 </xsl:choose> 2194 2040 </xsl:when> … … 2254 2100 ((ancestor::library/interface[@name=current()]) or 2255 2101 (ancestor::library/if[@target=$self_target]/interface[@name=current()]) 2256 ) or2257 ((ancestor::library/collection[@name=current()]) or2258 (ancestor::library/if[@target=$self_target]/collection[@name=current()])2259 2102 ) 2260 2103 ">
Note:
See TracChangeset
for help on using the changeset viewer.