Changeset 34393 in vbox for trunk/src/VBox/Main/idl
- Timestamp:
- Nov 26, 2010 2:13:35 PM (14 years ago)
- svn:sync-xref-src-repo-rev:
- 68162
- Location:
- trunk/src/VBox/Main/idl
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/idl/VirtualBox.xidl
r34331 r34393 14387 14387 <enum 14388 14388 name="VBoxEventType" 14389 uuid=" FA0D4183-CDCA-428E-A078-BBF5B69CA158">14389 uuid="BA0F90B2-3F41-4222-840D-EDD5055476A8"> 14390 14390 14391 14391 <desc> … … 14604 14604 </desc> 14605 14605 </const> 14606 <const name="OnGuestKeyboard Event" value="64">14606 <const name="OnGuestKeyboard" value="64"> 14607 14607 <desc> 14608 14608 See <link to="IGuestKeyboardEvent">IGuestKeyboardEvent</link>. 14609 14609 </desc> 14610 14610 </const> 14611 <const name="OnGuestMouse Event" value="65">14611 <const name="OnGuestMouse" value="65"> 14612 14612 <desc> 14613 14613 See <link to="IGuestMouseEvent">IGuestMouseEvent</link>. 14614 14614 </desc> 14615 14615 </const> 14616 <const name="OnNATRedirect Event" value="66">14616 <const name="OnNATRedirect" value="66"> 14617 14617 <desc> 14618 14618 See <link to="INATRedirectEvent">INATRedirectEvent</link>. 14619 14619 </desc> 14620 14620 </const> 14621 <const name="OnHostPciDevicePlug Event" value="67">14621 <const name="OnHostPciDevicePlug" value="67"> 14622 14622 <desc> 14623 14623 See <link to="IHostPciDevicePlugEvent">IHostPciDevicePlugEvent</link>. … … 15394 15394 name="IGuestKeyboardEvent" extends="IEvent" 15395 15395 uuid="88394258-7006-40d4-b339-472ee3801844" 15396 wsmap="managed" autogen="VBoxEvent" id="OnGuestKeyboard Event"15396 wsmap="managed" autogen="VBoxEvent" id="OnGuestKeyboard" 15397 15397 > 15398 15398 <desc> … … 15409 15409 name="IGuestMouseEvent" extends="IReusableEvent" 15410 15410 uuid="1f85d35c-c524-40ff-8e98-307000df0992" 15411 wsmap="managed" autogen="VBoxEvent" id="OnGuestMouse Event"15411 wsmap="managed" autogen="VBoxEvent" id="OnGuestMouse" 15412 15412 > 15413 15413 <desc> … … 15816 15816 name="INATRedirectEvent" extends="IMachineEvent" 15817 15817 uuid="57DE97D7-3CBB-42A0-888F-610D5832D16B" 15818 wsmap="managed" autogen="VBoxEvent" id="OnNATRedirect Event"15818 wsmap="managed" autogen="VBoxEvent" id="OnNATRedirect" 15819 15819 > 15820 15820 <desc> … … 15867 15867 waitable="yes" 15868 15868 uuid="EDD4782B-DB74-43A0-B724-2BAA36F039CC" 15869 wsmap="managed" autogen="VBoxEvent" id="OnHostPciDevicePlug Event"15869 wsmap="managed" autogen="VBoxEvent" id="OnHostPciDevicePlug" 15870 15870 > 15871 15871 <desc> -
trunk/src/VBox/Main/idl/comimpl.xsl
r33063 r34393 118 118 <xsl:value-of select="'BYTE*'" /> 119 119 </xsl:when> 120 <xsl:when test="(($type='wstring') or ($type='uuid')) and $param"> 121 <xsl:value-of select="'BSTR'" /> 122 </xsl:when> 123 <xsl:when test="(($type='wstring') or ($type='uuid')) and not($param)"> 124 <xsl:value-of select="'Bstr'" /> 120 <xsl:when test="(($type='wstring') or ($type='uuid'))"> 121 <xsl:choose> 122 <xsl:when test="$param and ($dir='in')"> 123 <xsl:value-of select="'CBSTR'"/> 124 </xsl:when> 125 <xsl:when test="$param and ($dir='out')"> 126 <xsl:value-of select="'BSTR'"/> 127 </xsl:when> 128 <xsl:otherwise> 129 <xsl:value-of select="'Bstr'"/> 130 </xsl:otherwise> 131 </xsl:choose> 125 132 </xsl:when> 126 133 <xsl:when test="//enum[@name=$type]"> … … 624 631 625 632 <xsl:template name="genCommonEventCode"> 626 <xsl:text><![CDATA[627 HRESULT VBoxEventDesc::init(IEventSource* aSource, VBoxEventType_T aType, ...)628 {629 va_list args;630 631 mEventSource = aSource;632 va_start(args, aType);633 switch (aType)634 {635 ]]></xsl:text>636 637 <xsl:for-each select="//interface[@autogen=$G_kind]">638 <xsl:variable name="implName">639 <xsl:value-of select="substring(@name, 2)" />640 </xsl:variable>641 <xsl:call-template name="genSwitchCase">642 <xsl:with-param name="ifaceName" select="@name" />643 <xsl:with-param name="implName" select="$implName" />644 <xsl:with-param name="reinit" select="'no'" />645 </xsl:call-template>646 </xsl:for-each>647 648 <xsl:text><![CDATA[649 default:650 AssertFailed();651 }652 va_end(args);653 654 return S_OK;655 }656 ]]></xsl:text>657 658 <xsl:text><![CDATA[659 HRESULT VBoxEventDesc::reinit(VBoxEventType_T aType, ...)660 {661 va_list args;662 663 va_start(args, aType);664 switch (aType)665 {666 ]]></xsl:text>667 668 <xsl:for-each select="//interface[@autogen=$G_kind and @extends='IReusableEvent']">669 <xsl:variable name="implName">670 <xsl:value-of select="substring(@name, 2)" />671 </xsl:variable>672 <xsl:call-template name="genSwitchCase">673 <xsl:with-param name="ifaceName" select="@name" />674 <xsl:with-param name="implName" select="$implName" />675 <xsl:with-param name="reinit" select="'yes'" />676 </xsl:call-template>677 </xsl:for-each>678 679 <xsl:text><![CDATA[680 default:681 AssertFailed();682 }683 va_end(args);684 685 return S_OK;686 }687 ]]></xsl:text>688 689 </xsl:template>690 691 692 <xsl:template match="/">693 633 <xsl:call-template name="fileheader"> 694 634 <xsl:with-param name="name" select="'VBoxEvents.cpp'" /> … … 700 640 #include "EventImpl.h" 701 641 ]]></xsl:text> 702 703 642 704 643 <!-- Interfaces --> … … 730 669 </xsl:for-each> 731 670 671 <xsl:text><![CDATA[ 672 HRESULT VBoxEventDesc::init(IEventSource* aSource, VBoxEventType_T aType, ...) 673 { 674 va_list args; 675 676 mEventSource = aSource; 677 va_start(args, aType); 678 switch (aType) 679 { 680 ]]></xsl:text> 681 682 <xsl:for-each select="//interface[@autogen=$G_kind]"> 683 <xsl:variable name="implName"> 684 <xsl:value-of select="substring(@name, 2)" /> 685 </xsl:variable> 686 <xsl:call-template name="genSwitchCase"> 687 <xsl:with-param name="ifaceName" select="@name" /> 688 <xsl:with-param name="implName" select="$implName" /> 689 <xsl:with-param name="reinit" select="'no'" /> 690 </xsl:call-template> 691 </xsl:for-each> 692 693 <xsl:text><![CDATA[ 694 default: 695 AssertFailed(); 696 } 697 va_end(args); 698 699 return S_OK; 700 } 701 ]]></xsl:text> 702 703 <xsl:text><![CDATA[ 704 HRESULT VBoxEventDesc::reinit(VBoxEventType_T aType, ...) 705 { 706 va_list args; 707 708 va_start(args, aType); 709 switch (aType) 710 { 711 ]]></xsl:text> 712 713 <xsl:for-each select="//interface[@autogen=$G_kind and @extends='IReusableEvent']"> 714 <xsl:variable name="implName"> 715 <xsl:value-of select="substring(@name, 2)" /> 716 </xsl:variable> 717 <xsl:call-template name="genSwitchCase"> 718 <xsl:with-param name="ifaceName" select="@name" /> 719 <xsl:with-param name="implName" select="$implName" /> 720 <xsl:with-param name="reinit" select="'yes'" /> 721 </xsl:call-template> 722 </xsl:for-each> 723 724 <xsl:text><![CDATA[ 725 default: 726 AssertFailed(); 727 } 728 va_end(args); 729 730 return S_OK; 731 } 732 ]]></xsl:text> 733 734 </xsl:template> 735 736 <xsl:template name="genFormalParams"> 737 <xsl:param name="name" /> 738 <xsl:variable name="extends"> 739 <xsl:value-of select="//interface[@name=$name]/@extends" /> 740 </xsl:variable> 741 742 <xsl:choose> 743 <xsl:when test="$extends='IEvent'"> 744 </xsl:when> 745 <xsl:when test="$extends='IReusableEvent'"> 746 </xsl:when> 747 <xsl:when test="//interface[@name=$extends]"> 748 <xsl:call-template name="genFormalParams"> 749 <xsl:with-param name="name" select="$extends" /> 750 </xsl:call-template> 751 </xsl:when> 752 <xsl:otherwise> 753 <xsl:call-template name="fatalError"> 754 <xsl:with-param name="msg" select="concat('No idea how to process it: ', $name)" /> 755 </xsl:call-template> 756 </xsl:otherwise> 757 </xsl:choose> 758 759 <xsl:for-each select="//interface[@name=$name]/attribute"> 760 <xsl:variable name="aName" select="concat('a_',@name)"/> 761 <xsl:variable name="aTypeName"> 762 <xsl:call-template name="typeIdl2Back"> 763 <xsl:with-param name="type" select="@type" /> 764 <xsl:with-param name="safearray" select="@safearray" /> 765 <xsl:with-param name="param" select="$aName" /> 766 <xsl:with-param name="dir" select="'in'" /> 767 <xsl:with-param name="mod" select="@mod" /> 768 </xsl:call-template> 769 </xsl:variable> 770 <xsl:value-of select="concat(', ',$aTypeName)"/> 771 </xsl:for-each> 772 </xsl:template> 773 774 <xsl:template name="genFactParams"> 775 <xsl:param name="name" /> 776 <xsl:variable name="extends"> 777 <xsl:value-of select="//interface[@name=$name]/@extends" /> 778 </xsl:variable> 779 780 <xsl:choose> 781 <xsl:when test="$extends='IEvent'"> 782 </xsl:when> 783 <xsl:when test="$extends='IReusableEvent'"> 784 </xsl:when> 785 <xsl:when test="//interface[@name=$extends]"> 786 <xsl:call-template name="genFactParams"> 787 <xsl:with-param name="name" select="$extends" /> 788 </xsl:call-template> 789 </xsl:when> 790 <xsl:otherwise> 791 <xsl:call-template name="fatalError"> 792 <xsl:with-param name="msg" select="concat('No idea how to process it: ', $name)" /> 793 </xsl:call-template> 794 </xsl:otherwise> 795 </xsl:choose> 796 797 <xsl:for-each select="//interface[@name=$name]/attribute"> 798 <xsl:variable name="aName" select="concat('a_',@name)"/> 799 <xsl:choose> 800 <xsl:when test="@safearray='yes'"> 801 <xsl:value-of select="concat(', ComSafeArrayInArg(',$aName,')')"/> 802 </xsl:when> 803 <xsl:otherwise> 804 <xsl:value-of select="concat(', ',$aName)"/> 805 </xsl:otherwise> 806 </xsl:choose> 807 </xsl:for-each> 808 </xsl:template> 809 810 <xsl:template name="genCommonEventHeader"> 811 <xsl:call-template name="fileheader"> 812 <xsl:with-param name="name" select="'VBoxEvents.h'" /> 813 </xsl:call-template> 814 815 <xsl:text><![CDATA[ 816 #include "EventImpl.h" 817 ]]></xsl:text> 818 819 <!-- Interfaces --> 820 <xsl:for-each select="//interface[@autogen='VBoxEvent']"> 821 <xsl:value-of select="concat('// ', @name, ' generation routine ')" /> 822 <xsl:variable name="evname"> 823 <xsl:value-of select="substring(@name, 2)" /> 824 </xsl:variable> 825 <xsl:variable name="evid"> 826 <xsl:value-of select="concat('On', substring(@name, 2, string-length(@name)-6))" /> 827 </xsl:variable> 828 829 <xsl:variable name="ifname"> 830 <xsl:value-of select="@name" /> 831 </xsl:variable> 832 833 <xsl:value-of select="concat('DECLINLINE(void) fire', $evname, '(IEventSource* aSource')"/> 834 <xsl:call-template name="genFormalParams"> 835 <xsl:with-param name="name" select="$ifname" /> 836 </xsl:call-template> 837 <xsl:value-of select=" ') { '"/> 838 839 <xsl:value-of select=" ' VBoxEventDesc evDesc; '"/> 840 <xsl:value-of select="concat(' evDesc.init(aSource, VBoxEventType_',$evid)"/> 841 <xsl:call-template name="genFactParams"> 842 <xsl:with-param name="name" select="$ifname" /> 843 </xsl:call-template> 844 <xsl:value-of select="'); '"/> 845 <xsl:value-of select=" ' evDesc.fire(/* do not wait for delivery */ 0); '"/> 846 <xsl:value-of select=" '} '"/> 847 </xsl:for-each> 848 </xsl:template> 849 850 <xsl:template match="/"> 732 851 <!-- Global code --> 733 852 <xsl:choose> … … 736 855 </xsl:call-template> 737 856 </xsl:when> 857 <xsl:when test="$G_kind='VBoxEventHeader'"> 858 <xsl:call-template name="genCommonEventHeader"> 859 </xsl:call-template> 860 </xsl:when> 861 <xsl:otherwise> 862 <xsl:call-template name="fatalError"> 863 <xsl:with-param name="msg" select="concat('Request unsupported: ', $G_kind)" /> 864 </xsl:call-template> 865 </xsl:otherwise> 738 866 </xsl:choose> 739 867 </xsl:template>
Note:
See TracChangeset
for help on using the changeset viewer.