Index: /trunk/src/VBox/Main/Makefile.kmk
===================================================================
--- /trunk/src/VBox/Main/Makefile.kmk	(revision 85292)
+++ /trunk/src/VBox/Main/Makefile.kmk	(revision 85293)
@@ -805,13 +805,19 @@
 # Generate some event stuff for VBoxSVC and VBoxC.
 #
-$(VBOX_AUTOGEN_EVENT_H): $(VBOX_PATH_MAIN_SRC)/idl/comimpl.xsl $(VBOX_XIDL_FILE) | $$(dir $$@)
+$(call KB_FN_AUTO_CMD_DEPS,$(VBOX_AUTOGEN_EVENT_H).ts)
+$(VBOX_AUTOGEN_EVENT_H).ts +| $(VBOX_AUTOGEN_EVENT_H): $(VBOX_PATH_MAIN_SRC)/idl/comimpl.xsl $(VBOX_XIDL_FILE) | $$(dir $$@)
+	$(call KB_FN_AUTO_CMD_DEPS_COMMANDS)
 	$(call MSG_TOOL,xsltproc,autogen events,$<,$@)
-	$(QUIET)$(VBOX_XSLTPROC) --stringparam G_kind VBoxEventHeader -o $@ $< $(VBOX_XIDL_FILE)
-
-$(VBOX_AUTOGEN_EVENT_CPP): $(VBOX_PATH_MAIN_SRC)/idl/comimpl.xsl $(VBOX_XIDL_FILE) | $$(dir $$@)
+	$(QUIET)$(VBOX_XSLTPROC) --stringparam G_kind VBoxEventHeader -o "$@" "$(VBOX_PATH_MAIN_SRC)/idl/comimpl.xsl" "$(VBOX_XIDL_FILE)"
+	$(QUIET)$(CP) --changed -fv -- "$@" "$(VBOX_AUTOGEN_EVENT_H)"
+
+$(call KB_FN_AUTO_CMD_DEPS,$(VBOX_AUTOGEN_EVENT_CPP).ts)
+$(VBOX_AUTOGEN_EVENT_CPP).ts +| $(VBOX_AUTOGEN_EVENT_CPP): $(VBOX_PATH_MAIN_SRC)/idl/comimpl.xsl $(VBOX_XIDL_FILE) | $$(dir $$@)
+	$(call KB_FN_AUTO_CMD_DEPS_COMMANDS)
 	$(call MSG_TOOL,xsltproc,autogen events,$<,$@)
-	$(QUIET)$(VBOX_XSLTPROC) --stringparam G_kind VBoxEvent -o $@ $< $(VBOX_XIDL_FILE)
-
-OTHER_CLEAN += $(VBOX_AUTOGEN_EVENT_H) $(VBOX_AUTOGEN_EVENT_CPP)
+	$(QUIET)$(VBOX_XSLTPROC) --stringparam G_kind VBoxEvent -o "$@" "$(VBOX_PATH_MAIN_SRC)/idl/comimpl.xsl" "$(VBOX_XIDL_FILE)"
+	$(QUIET)$(CP) --changed -fv -- "$@" "$(VBOX_AUTOGEN_EVENT_CPP)"
+
+OTHER_CLEAN += $(VBOX_AUTOGEN_EVENT_H).ts $(VBOX_AUTOGEN_EVENT_H) $(VBOX_AUTOGEN_EVENT_CPP).ts $(VBOX_AUTOGEN_EVENT_CPP)
 
 ifdef VBOX_WITH_XPCOM
Index: /trunk/src/VBox/Main/idl/comimpl.xsl
===================================================================
--- /trunk/src/VBox/Main/idl/comimpl.xsl	(revision 85292)
+++ /trunk/src/VBox/Main/idl/comimpl.xsl	(revision 85293)
@@ -54,5 +54,5 @@
  * DO NOT EDIT! This is a generated file.
  * Generated from: src/VBox/Main/idl/VirtualBox.xidl (VirtualBox's interface definitions in XML)
- * Generator: src/VBox/Main/idl/comimpl.xsl
+ * Generator:      src/VBox/Main/idl/comimpl.xsl
  */
 
@@ -262,5 +262,4 @@
   <xsl:param name="name" />
   <xsl:param name="obj" />
-  <xsl:param name="va" select="true" />
   <xsl:variable name="extends">
     <xsl:value-of select="key('G_keyInterfacesByName', $name)/@extends" />
@@ -276,5 +275,4 @@
         <xsl:with-param name="name" select="$extends" />
         <xsl:with-param name="obj" select="$obj" />
-        <xsl:with-param name="va" select="$va" />
       </xsl:call-template>
     </xsl:when>
@@ -316,33 +314,10 @@
           </xsl:call-template>
         </xsl:variable>
-        <xsl:if test="$va">
-          <xsl:value-of select="       '#ifdef RT_OS_WINDOWS&#10;'"/>
-          <xsl:value-of select="concat('            SAFEARRAY *aPtr_', @name, ' = va_arg(args, SAFEARRAY *);&#10;')"/>
-          <xsl:value-of select="concat('            com::SafeArray&lt;', $elemtype,'&gt;   aArr_', @name, '(aPtr_', @name, ');&#10;')"/>
-          <xsl:value-of select="       '#else&#10;'"/>
-          <xsl:value-of select="concat('            PRUint32 aArrSize_', @name, ' = va_arg(args, PRUint32);&#10;')"/>
-          <xsl:value-of select="concat('            void*    aPtr_', @name, ' = va_arg(args, void*);&#10;')"/>
-          <xsl:value-of select="concat('            com::SafeArray&lt;', $elemtype,'&gt;   aArr_', @name, '(aArrSize_', @name, ', (', $elemtype,'*)aPtr_', @name, ');&#10;')"/>
-          <xsl:value-of select="       '#endif&#10;'"/>
-          <xsl:value-of select="concat('            ',$obj, '->set_', @name, '(ComSafeArrayAsInParam(aArr_', @name, '));&#10;')"/>
-        </xsl:if>
-        <xsl:if test="not($va)">
-          <xsl:value-of select="concat('            ',$obj, '->set_', @name, '(ComSafeArrayInArg(a_', @name, '));&#10;')"/>
-        </xsl:if>
+        <xsl:value-of select="concat('            ',$obj, '->set_', @name, '(ComSafeArrayInArg(a_', @name, '));&#10;')"/>
       </xsl:when>
       <xsl:when test="substring($aType, string-length($aType) - 1) = '_T'"> <!-- To avoid pedantic gcc warnings/errors. -->
-        <xsl:if test="$va">
-          <xsl:value-of select="       '#ifdef VBOX_WITH_XPCOM_CPP_ENUM_HACK&#10;'"/>
-          <xsl:value-of select="concat('            ',$aTypeName, ' = (',$aType,')va_arg(args, int);&#10;')"/>
-          <xsl:value-of select="       '#else&#10;'"/>
-          <xsl:value-of select="concat('            ',$aTypeName, ' = va_arg(args, ',$aType,');&#10;')"/>
-          <xsl:value-of select="       '#endif&#10;'"/>
-        </xsl:if>
         <xsl:value-of select="concat('            ',$obj, '->set_', @name, '(',$aName, ');&#10;')"/>
       </xsl:when>
       <xsl:otherwise>
-        <xsl:if test="$va">
-          <xsl:value-of select="concat('            ',$aTypeName, ' = va_arg(args, ',$aType,');&#10;')"/>
-        </xsl:if>
         <xsl:value-of select="concat('            ',$obj, '->set_', @name, '(',$aName, ');&#10;')"/>
       </xsl:otherwise>
@@ -689,5 +664,4 @@
       <xsl:with-param name="name" select="@name" />
       <xsl:with-param name="obj" select="'pEvtImpl'" />
-      <xsl:with-param name="va" select="false" />
     </xsl:call-template>
     <xsl:text>        }&#10;</xsl:text>
@@ -717,5 +691,4 @@
     <xsl:with-param name="name" select="@name" />
     <xsl:with-param name="obj" select="'EvtObj'" />
-    <xsl:with-param name="va" select="false" />
   </xsl:call-template>
   <xsl:text>            hrc = EvtObj.queryInterfaceTo(aEvent);&#10;</xsl:text>
@@ -752,45 +725,7 @@
 
 
-<xsl:template name="genSwitchCase">
-  <xsl:param name="ifaceName" />
-  <xsl:param name="implName" />
-  <xsl:param name="reinit" />
-  <xsl:variable name="waitable">
-    <xsl:choose>
-      <xsl:when test="@waitable='yes'">
-        <xsl:value-of select="'TRUE'"/>
-      </xsl:when>
-      <xsl:otherwise>
-        <xsl:value-of select="'FALSE'"/>
-      </xsl:otherwise>
-    </xsl:choose>
-  </xsl:variable>
-  <xsl:value-of select="concat('         case VBoxEventType_', @id, ':&#10;')"/>
-  <xsl:value-of select="       '         {&#10;'"/>
-  <xsl:choose>
-    <xsl:when test="$reinit='yes'">
-      <xsl:value-of select="concat('              ComPtr&lt;', $ifaceName, '&gt; iobj;&#10;')"/>
-      <xsl:value-of select="       '              iobj = mEvent;&#10;'"/>
-      <xsl:value-of select="       '              Assert(!iobj.isNull());&#10;'"/>
-      <xsl:value-of select="concat('              ',$implName, '* obj = (', $implName, '*)(', $ifaceName, '*)iobj;&#10;')"/>
-      <xsl:value-of select="       '              obj->Reuse();&#10;'"/>
-    </xsl:when>
-    <xsl:otherwise>
-      <xsl:value-of select="concat('              ComObjPtr&lt;', $implName, '&gt; obj;&#10;')"/>
-      <xsl:value-of select="       '              obj.createObject();&#10;'"/>
-      <xsl:value-of select="concat('              obj->init(aSource, aType, ', $waitable, ');&#10;')"/>
-    </xsl:otherwise>
-  </xsl:choose>
-  <xsl:call-template name="genAttrInitCode">
-    <xsl:with-param name="name" select="@name" />
-    <xsl:with-param name="obj" select="'obj'" />
-  </xsl:call-template>
-  <xsl:if test="not($reinit='yes')">
-    <xsl:value-of select="       '              obj.queryInterfaceTo(mEvent.asOutParam());&#10;'"/>
-  </xsl:if>
-  <xsl:value-of select="       '              break;&#10;'"/>
-  <xsl:value-of select="       '         }&#10;'"/>
-</xsl:template>
-
+<!--
+ Produces VBoxEvents.cpp
+ -->
 <xsl:template name="genCommonEventCode">
   <xsl:call-template name="fileheader">
@@ -834,71 +769,4 @@
   </xsl:for-each>
 
-  <xsl:text><![CDATA[
-#if 0
-HRESULT VBoxEventDesc::init(IEventSource *aSource, VBoxEventType_T aType, ...)
-{
-    va_list args;
-
-    mEventSource = aSource;
-    va_start(args, aType);
-    switch (aType)
-    {
-]]></xsl:text>
-
-  <xsl:for-each select="//interface[@autogen=$G_kind]">
-    <xsl:variable name="implName">
-      <xsl:value-of select="substring(@name, 2)" />
-    </xsl:variable>
-    <xsl:call-template name="genSwitchCase">
-      <xsl:with-param name="ifaceName" select="@name" />
-      <xsl:with-param name="implName" select="$implName" />
-      <xsl:with-param name="reinit" select="'no'" />
-    </xsl:call-template>
-  </xsl:for-each>
-
-  <xsl:text><![CDATA[
-         default:
-            AssertFailed();
-    }
-    va_end(args);
-
-    return S_OK;
-}
-#endif
-]]></xsl:text>
-
- <xsl:text><![CDATA[
-#if 0
-HRESULT VBoxEventDesc::reinit(VBoxEventType_T aType, ...)
-{
-    va_list args;
-
-    va_start(args, aType);
-    switch (aType)
-    {
-]]></xsl:text>
-
-  <xsl:for-each select="//interface[@autogen=$G_kind and @extends='IReusableEvent']">
-    <xsl:variable name="implName">
-      <xsl:value-of select="substring(@name, 2)" />
-    </xsl:variable>
-    <xsl:call-template name="genSwitchCase">
-      <xsl:with-param name="ifaceName" select="@name" />
-      <xsl:with-param name="implName" select="$implName" />
-      <xsl:with-param name="reinit" select="'yes'" />
-    </xsl:call-template>
-  </xsl:for-each>
-
-  <xsl:text><![CDATA[
-         default:
-            AssertFailed();
-    }
-    va_end(args);
-
-    return S_OK;
-}
-#endif
-]]></xsl:text>
-
 </xsl:template>
 
@@ -977,4 +845,8 @@
 </xsl:template>
 
+
+<!--
+ Produces VBoxEvents.h
+ -->
 <xsl:template name="genCommonEventHeader">
   <xsl:call-template name="fileheader">
@@ -982,5 +854,5 @@
   </xsl:call-template>
 
-<xsl:text><![CDATA[
+  <xsl:text><![CDATA[
 #include "EventImpl.h"
 
@@ -995,31 +867,8 @@
       <xsl:value-of select="substring(@name, 2)" />
     </xsl:variable>
-    <xsl:variable name="evid">
-      <xsl:value-of select="concat('On', substring(@name, 2, string-length(@name)-6))" />
-    </xsl:variable>
-
     <xsl:variable name="ifname">
       <xsl:value-of select="@name" />
     </xsl:variable>
 
-    <!--
-    OLD:
-    <xsl:value-of select="concat('DECLINLINE(void) fire', $evname, '(IEventSource *aSource')"/>
-    <xsl:call-template name="genFormalParams">
-      <xsl:with-param name="name" select="$ifname" />
-    </xsl:call-template>
-    <xsl:value-of select="       ')&#10;{&#10;'"/>
-
-    <xsl:value-of select="       '    VBoxEventDesc evDesc;&#10;'"/>
-    <xsl:value-of select="concat('    evDesc.init(aSource, VBoxEventType_',$evid)"/>
-    <xsl:call-template name="genFactParams">
-      <xsl:with-param name="name" select="$ifname" />
-    </xsl:call-template>
-    <xsl:value-of select="');&#10;'"/>
-    <xsl:value-of select="       '    evDesc.fire(/* do not wait for delivery */ 0);&#10;'"/>
-    <xsl:value-of select="       '}&#10;'"/>
-
-    NEW:
-    -->
     <xsl:value-of select="concat('DECLHIDDEN(HRESULT) fire', $evname, '(IEventSource *aSource')"/>
     <xsl:call-template name="genFormalParams">
@@ -1037,7 +886,4 @@
     <xsl:variable name="evname">
       <xsl:value-of select="substring(@name, 2)" />
-    </xsl:variable>
-    <xsl:variable name="evid">
-      <xsl:value-of select="concat('On', substring(@name, 2, string-length(@name)-6))" />
     </xsl:variable>
     <xsl:variable name="ifname">
Index: /trunk/src/VBox/Main/include/EventImpl.h
===================================================================
--- /trunk/src/VBox/Main/include/EventImpl.h	(revision 85292)
+++ /trunk/src/VBox/Main/include/EventImpl.h	(revision 85293)
@@ -141,21 +141,4 @@
     {}
 
-
-#if 0
-    /**
-     * This function to be used with some care, as arguments order must match
-     * attribute declaration order event class and its superclasses up to
-     * IEvent. If unsure, consult implementation in generated VBoxEvents.cpp.
-     */
-    HRESULT init(IEventSource* aSource, VBoxEventType_T aType, ...);
-
-    /**
-    * Function similar to the above, but assumes that init() for this type
-    * already called once, so no need to allocate memory, and only reinit
-    * fields. Assumes event is subtype of IReusableEvent, asserts otherwise.
-    */
-    HRESULT reinit(VBoxEventType_T aType, ...);
-#endif
-
     void init(IEvent *aEvent, IEventSource *aSource)
     {
