- Timestamp:
- Jul 13, 2020 8:55:08 AM (5 years ago)
- svn:sync-xref-src-repo-rev:
- 139271
- Location:
- trunk/src/VBox/Main
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/Makefile.kmk
r85143 r85293 805 805 # Generate some event stuff for VBoxSVC and VBoxC. 806 806 # 807 $(VBOX_AUTOGEN_EVENT_H): $(VBOX_PATH_MAIN_SRC)/idl/comimpl.xsl $(VBOX_XIDL_FILE) | $$(dir $$@) 807 $(call KB_FN_AUTO_CMD_DEPS,$(VBOX_AUTOGEN_EVENT_H).ts) 808 $(VBOX_AUTOGEN_EVENT_H).ts +| $(VBOX_AUTOGEN_EVENT_H): $(VBOX_PATH_MAIN_SRC)/idl/comimpl.xsl $(VBOX_XIDL_FILE) | $$(dir $$@) 809 $(call KB_FN_AUTO_CMD_DEPS_COMMANDS) 808 810 $(call MSG_TOOL,xsltproc,autogen events,$<,$@) 809 $(QUIET)$(VBOX_XSLTPROC) --stringparam G_kind VBoxEventHeader -o $@ $< $(VBOX_XIDL_FILE) 810 811 $(VBOX_AUTOGEN_EVENT_CPP): $(VBOX_PATH_MAIN_SRC)/idl/comimpl.xsl $(VBOX_XIDL_FILE) | $$(dir $$@) 811 $(QUIET)$(VBOX_XSLTPROC) --stringparam G_kind VBoxEventHeader -o "$@" "$(VBOX_PATH_MAIN_SRC)/idl/comimpl.xsl" "$(VBOX_XIDL_FILE)" 812 $(QUIET)$(CP) --changed -fv -- "$@" "$(VBOX_AUTOGEN_EVENT_H)" 813 814 $(call KB_FN_AUTO_CMD_DEPS,$(VBOX_AUTOGEN_EVENT_CPP).ts) 815 $(VBOX_AUTOGEN_EVENT_CPP).ts +| $(VBOX_AUTOGEN_EVENT_CPP): $(VBOX_PATH_MAIN_SRC)/idl/comimpl.xsl $(VBOX_XIDL_FILE) | $$(dir $$@) 816 $(call KB_FN_AUTO_CMD_DEPS_COMMANDS) 812 817 $(call MSG_TOOL,xsltproc,autogen events,$<,$@) 813 $(QUIET)$(VBOX_XSLTPROC) --stringparam G_kind VBoxEvent -o $@ $< $(VBOX_XIDL_FILE) 814 815 OTHER_CLEAN += $(VBOX_AUTOGEN_EVENT_H) $(VBOX_AUTOGEN_EVENT_CPP) 818 $(QUIET)$(VBOX_XSLTPROC) --stringparam G_kind VBoxEvent -o "$@" "$(VBOX_PATH_MAIN_SRC)/idl/comimpl.xsl" "$(VBOX_XIDL_FILE)" 819 $(QUIET)$(CP) --changed -fv -- "$@" "$(VBOX_AUTOGEN_EVENT_CPP)" 820 821 OTHER_CLEAN += $(VBOX_AUTOGEN_EVENT_H).ts $(VBOX_AUTOGEN_EVENT_H) $(VBOX_AUTOGEN_EVENT_CPP).ts $(VBOX_AUTOGEN_EVENT_CPP) 816 822 817 823 ifdef VBOX_WITH_XPCOM -
trunk/src/VBox/Main/idl/comimpl.xsl
r85290 r85293 54 54 * DO NOT EDIT! This is a generated file. 55 55 * Generated from: src/VBox/Main/idl/VirtualBox.xidl (VirtualBox's interface definitions in XML) 56 * Generator: src/VBox/Main/idl/comimpl.xsl56 * Generator: src/VBox/Main/idl/comimpl.xsl 57 57 */ 58 58 … … 262 262 <xsl:param name="name" /> 263 263 <xsl:param name="obj" /> 264 <xsl:param name="va" select="true" />265 264 <xsl:variable name="extends"> 266 265 <xsl:value-of select="key('G_keyInterfacesByName', $name)/@extends" /> … … 276 275 <xsl:with-param name="name" select="$extends" /> 277 276 <xsl:with-param name="obj" select="$obj" /> 278 <xsl:with-param name="va" select="$va" />279 277 </xsl:call-template> 280 278 </xsl:when> … … 316 314 </xsl:call-template> 317 315 </xsl:variable> 318 <xsl:if test="$va"> 319 <xsl:value-of select=" '#ifdef RT_OS_WINDOWS '"/> 320 <xsl:value-of select="concat(' SAFEARRAY *aPtr_', @name, ' = va_arg(args, SAFEARRAY *); ')"/> 321 <xsl:value-of select="concat(' com::SafeArray<', $elemtype,'> aArr_', @name, '(aPtr_', @name, '); ')"/> 322 <xsl:value-of select=" '#else '"/> 323 <xsl:value-of select="concat(' PRUint32 aArrSize_', @name, ' = va_arg(args, PRUint32); ')"/> 324 <xsl:value-of select="concat(' void* aPtr_', @name, ' = va_arg(args, void*); ')"/> 325 <xsl:value-of select="concat(' com::SafeArray<', $elemtype,'> aArr_', @name, '(aArrSize_', @name, ', (', $elemtype,'*)aPtr_', @name, '); ')"/> 326 <xsl:value-of select=" '#endif '"/> 327 <xsl:value-of select="concat(' ',$obj, '->set_', @name, '(ComSafeArrayAsInParam(aArr_', @name, ')); ')"/> 328 </xsl:if> 329 <xsl:if test="not($va)"> 330 <xsl:value-of select="concat(' ',$obj, '->set_', @name, '(ComSafeArrayInArg(a_', @name, ')); ')"/> 331 </xsl:if> 316 <xsl:value-of select="concat(' ',$obj, '->set_', @name, '(ComSafeArrayInArg(a_', @name, ')); ')"/> 332 317 </xsl:when> 333 318 <xsl:when test="substring($aType, string-length($aType) - 1) = '_T'"> <!-- To avoid pedantic gcc warnings/errors. --> 334 <xsl:if test="$va">335 <xsl:value-of select=" '#ifdef VBOX_WITH_XPCOM_CPP_ENUM_HACK '"/>336 <xsl:value-of select="concat(' ',$aTypeName, ' = (',$aType,')va_arg(args, int); ')"/>337 <xsl:value-of select=" '#else '"/>338 <xsl:value-of select="concat(' ',$aTypeName, ' = va_arg(args, ',$aType,'); ')"/>339 <xsl:value-of select=" '#endif '"/>340 </xsl:if>341 319 <xsl:value-of select="concat(' ',$obj, '->set_', @name, '(',$aName, '); ')"/> 342 320 </xsl:when> 343 321 <xsl:otherwise> 344 <xsl:if test="$va">345 <xsl:value-of select="concat(' ',$aTypeName, ' = va_arg(args, ',$aType,'); ')"/>346 </xsl:if>347 322 <xsl:value-of select="concat(' ',$obj, '->set_', @name, '(',$aName, '); ')"/> 348 323 </xsl:otherwise> … … 689 664 <xsl:with-param name="name" select="@name" /> 690 665 <xsl:with-param name="obj" select="'pEvtImpl'" /> 691 <xsl:with-param name="va" select="false" />692 666 </xsl:call-template> 693 667 <xsl:text> } </xsl:text> … … 717 691 <xsl:with-param name="name" select="@name" /> 718 692 <xsl:with-param name="obj" select="'EvtObj'" /> 719 <xsl:with-param name="va" select="false" />720 693 </xsl:call-template> 721 694 <xsl:text> hrc = EvtObj.queryInterfaceTo(aEvent); </xsl:text> … … 752 725 753 726 754 <xsl:template name="genSwitchCase"> 755 <xsl:param name="ifaceName" /> 756 <xsl:param name="implName" /> 757 <xsl:param name="reinit" /> 758 <xsl:variable name="waitable"> 759 <xsl:choose> 760 <xsl:when test="@waitable='yes'"> 761 <xsl:value-of select="'TRUE'"/> 762 </xsl:when> 763 <xsl:otherwise> 764 <xsl:value-of select="'FALSE'"/> 765 </xsl:otherwise> 766 </xsl:choose> 767 </xsl:variable> 768 <xsl:value-of select="concat(' case VBoxEventType_', @id, ': ')"/> 769 <xsl:value-of select=" ' { '"/> 770 <xsl:choose> 771 <xsl:when test="$reinit='yes'"> 772 <xsl:value-of select="concat(' ComPtr<', $ifaceName, '> iobj; ')"/> 773 <xsl:value-of select=" ' iobj = mEvent; '"/> 774 <xsl:value-of select=" ' Assert(!iobj.isNull()); '"/> 775 <xsl:value-of select="concat(' ',$implName, '* obj = (', $implName, '*)(', $ifaceName, '*)iobj; ')"/> 776 <xsl:value-of select=" ' obj->Reuse(); '"/> 777 </xsl:when> 778 <xsl:otherwise> 779 <xsl:value-of select="concat(' ComObjPtr<', $implName, '> obj; ')"/> 780 <xsl:value-of select=" ' obj.createObject(); '"/> 781 <xsl:value-of select="concat(' obj->init(aSource, aType, ', $waitable, '); ')"/> 782 </xsl:otherwise> 783 </xsl:choose> 784 <xsl:call-template name="genAttrInitCode"> 785 <xsl:with-param name="name" select="@name" /> 786 <xsl:with-param name="obj" select="'obj'" /> 787 </xsl:call-template> 788 <xsl:if test="not($reinit='yes')"> 789 <xsl:value-of select=" ' obj.queryInterfaceTo(mEvent.asOutParam()); '"/> 790 </xsl:if> 791 <xsl:value-of select=" ' break; '"/> 792 <xsl:value-of select=" ' } '"/> 793 </xsl:template> 794 727 <!-- 728 Produces VBoxEvents.cpp 729 --> 795 730 <xsl:template name="genCommonEventCode"> 796 731 <xsl:call-template name="fileheader"> … … 834 769 </xsl:for-each> 835 770 836 <xsl:text><![CDATA[837 #if 0838 HRESULT VBoxEventDesc::init(IEventSource *aSource, VBoxEventType_T aType, ...)839 {840 va_list args;841 842 mEventSource = aSource;843 va_start(args, aType);844 switch (aType)845 {846 ]]></xsl:text>847 848 <xsl:for-each select="//interface[@autogen=$G_kind]">849 <xsl:variable name="implName">850 <xsl:value-of select="substring(@name, 2)" />851 </xsl:variable>852 <xsl:call-template name="genSwitchCase">853 <xsl:with-param name="ifaceName" select="@name" />854 <xsl:with-param name="implName" select="$implName" />855 <xsl:with-param name="reinit" select="'no'" />856 </xsl:call-template>857 </xsl:for-each>858 859 <xsl:text><![CDATA[860 default:861 AssertFailed();862 }863 va_end(args);864 865 return S_OK;866 }867 #endif868 ]]></xsl:text>869 870 <xsl:text><![CDATA[871 #if 0872 HRESULT VBoxEventDesc::reinit(VBoxEventType_T aType, ...)873 {874 va_list args;875 876 va_start(args, aType);877 switch (aType)878 {879 ]]></xsl:text>880 881 <xsl:for-each select="//interface[@autogen=$G_kind and @extends='IReusableEvent']">882 <xsl:variable name="implName">883 <xsl:value-of select="substring(@name, 2)" />884 </xsl:variable>885 <xsl:call-template name="genSwitchCase">886 <xsl:with-param name="ifaceName" select="@name" />887 <xsl:with-param name="implName" select="$implName" />888 <xsl:with-param name="reinit" select="'yes'" />889 </xsl:call-template>890 </xsl:for-each>891 892 <xsl:text><![CDATA[893 default:894 AssertFailed();895 }896 va_end(args);897 898 return S_OK;899 }900 #endif901 ]]></xsl:text>902 903 771 </xsl:template> 904 772 … … 977 845 </xsl:template> 978 846 847 848 <!-- 849 Produces VBoxEvents.h 850 --> 979 851 <xsl:template name="genCommonEventHeader"> 980 852 <xsl:call-template name="fileheader"> … … 982 854 </xsl:call-template> 983 855 984 <xsl:text><![CDATA[856 <xsl:text><![CDATA[ 985 857 #include "EventImpl.h" 986 858 … … 995 867 <xsl:value-of select="substring(@name, 2)" /> 996 868 </xsl:variable> 997 <xsl:variable name="evid">998 <xsl:value-of select="concat('On', substring(@name, 2, string-length(@name)-6))" />999 </xsl:variable>1000 1001 869 <xsl:variable name="ifname"> 1002 870 <xsl:value-of select="@name" /> 1003 871 </xsl:variable> 1004 872 1005 <!--1006 OLD:1007 <xsl:value-of select="concat('DECLINLINE(void) fire', $evname, '(IEventSource *aSource')"/>1008 <xsl:call-template name="genFormalParams">1009 <xsl:with-param name="name" select="$ifname" />1010 </xsl:call-template>1011 <xsl:value-of select=" ') { '"/>1012 1013 <xsl:value-of select=" ' VBoxEventDesc evDesc; '"/>1014 <xsl:value-of select="concat(' evDesc.init(aSource, VBoxEventType_',$evid)"/>1015 <xsl:call-template name="genFactParams">1016 <xsl:with-param name="name" select="$ifname" />1017 </xsl:call-template>1018 <xsl:value-of select="'); '"/>1019 <xsl:value-of select=" ' evDesc.fire(/* do not wait for delivery */ 0); '"/>1020 <xsl:value-of select=" '} '"/>1021 1022 NEW:1023 -->1024 873 <xsl:value-of select="concat('DECLHIDDEN(HRESULT) fire', $evname, '(IEventSource *aSource')"/> 1025 874 <xsl:call-template name="genFormalParams"> … … 1037 886 <xsl:variable name="evname"> 1038 887 <xsl:value-of select="substring(@name, 2)" /> 1039 </xsl:variable>1040 <xsl:variable name="evid">1041 <xsl:value-of select="concat('On', substring(@name, 2, string-length(@name)-6))" />1042 888 </xsl:variable> 1043 889 <xsl:variable name="ifname"> -
trunk/src/VBox/Main/include/EventImpl.h
r85286 r85293 141 141 {} 142 142 143 144 #if 0145 /**146 * This function to be used with some care, as arguments order must match147 * attribute declaration order event class and its superclasses up to148 * IEvent. If unsure, consult implementation in generated VBoxEvents.cpp.149 */150 HRESULT init(IEventSource* aSource, VBoxEventType_T aType, ...);151 152 /**153 * Function similar to the above, but assumes that init() for this type154 * already called once, so no need to allocate memory, and only reinit155 * fields. Assumes event is subtype of IReusableEvent, asserts otherwise.156 */157 HRESULT reinit(VBoxEventType_T aType, ...);158 #endif159 160 143 void init(IEvent *aEvent, IEventSource *aSource) 161 144 {
Note:
See TracChangeset
for help on using the changeset viewer.