Changeset 30553 in vbox
- Timestamp:
- Jul 1, 2010 1:36:06 PM (15 years ago)
- Location:
- trunk/src/VBox/Main
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/ConsoleImpl.cpp
r30510 r30553 337 337 }; 338 338 339 340 #define PREP_ARGS0() 341 #define PREP_ARGS1(a1) a1 342 #define PREP_ARGS2(a1,a2) a2, a2 343 #define PREP_ARGS3(a1,a2,a3) a1, a2, a3 344 #define PREP_ARGS4(a1,a2,a3,a4) a1, a2, a3, a4 345 #define PREP_ARGS5(a1,a2,a3,a4,a5) a1, a2, a3, a4, a5 346 #define PREP_ARGS6(a1,a2,a3,a4,a5,a6) a1, a2, a3, a4, a5, a6 347 #define PREP_ARGS7(a1,a2,a3,a4,a5,a6,a7) a1, a2, a3, a4, a5, a6, a7 348 #define PREP_ARGS8(a1,a2,a3,a4,a5,a6,a7,a8) a1, a2, a3, a4, a5, a6, a7, a8 349 339 350 #ifdef RT_OS_WINDOWS 340 351 … … 342 353 * Macro used to prepare for COM event firing, note CComObjectRootEx locking. 343 354 */ 344 #define CONSOLE_ EVENTS_START(name,count)\355 #define CONSOLE_COM_EVENTS_START(name,count) \ 345 356 { \ 346 357 ComEventDesc evDesc; \ … … 356 367 * must be synchronized with CComObjectRootEx Lock()/Unlock() methods. 357 368 */ 358 #define CONSOLE_ EVENTS_END()\369 #define CONSOLE_COM_EVENTS_END() \ 359 370 for (int i=0; i<nConnections; i++) \ 360 371 { \ … … 376 387 * member template add(), and every add() here could be, ofc, different function. 377 388 */ 378 #define PREP_ ARGS0()379 #define PREP_ ARGS1(a1) if (nConnections) evDesc.add(a1)380 #define PREP_ ARGS2(a1,a2) if (nConnections) evDesc.add(a1).add(a2)381 #define PREP_ ARGS3(a1,a2,a3) if (nConnections) evDesc.add(a1).add(a2).add(a3)382 #define PREP_ ARGS4(a1,a2,a3,a4) if (nConnections) evDesc.add(a1).add(a2).add(a3).add(a4)383 #define PREP_ ARGS5(a1,a2,a3,a4,a5) if (nConnections) evDesc.add(a1).add(a2).add(a3).add(a4).add(a5)384 #define PREP_ ARGS6(a1,a2,a3,a4,a5,a6) if (nConnections) evDesc.add(a1).add(a2).add(a3).add(a4).add(a5).add(a6)385 #define PREP_ ARGS7(a1,a2,a3,a4,a5,a6,a7) if (nConnections) evDesc.add(a1).add(a2).add(a3).add(a4).add(a5).add(a6).add(a7)386 #define PREP_ ARGS8(a1,a2,a3,a4,a5,a6,a7,a8) if (nConnections) evDesc.add(a1).add(a2).add(a3).add(a4).add(a5).add(a6).add(a7).add(a8)389 #define PREP_COM_ARGS0() 390 #define PREP_COM_ARGS1(a1) if (nConnections) evDesc.add(a1) 391 #define PREP_COM_ARGS2(a1,a2) if (nConnections) evDesc.add(a1).add(a2) 392 #define PREP_COM_ARGS3(a1,a2,a3) if (nConnections) evDesc.add(a1).add(a2).add(a3) 393 #define PREP_COM_ARGS4(a1,a2,a3,a4) if (nConnections) evDesc.add(a1).add(a2).add(a3).add(a4) 394 #define PREP_COM_ARGS5(a1,a2,a3,a4,a5) if (nConnections) evDesc.add(a1).add(a2).add(a3).add(a4).add(a5) 395 #define PREP_COM_ARGS6(a1,a2,a3,a4,a5,a6) if (nConnections) evDesc.add(a1).add(a2).add(a3).add(a4).add(a5).add(a6) 396 #define PREP_COM_ARGS7(a1,a2,a3,a4,a5,a6,a7) if (nConnections) evDesc.add(a1).add(a2).add(a3).add(a4).add(a5).add(a6).add(a7) 397 #define PREP_COM_ARGS8(a1,a2,a3,a4,a5,a6,a7,a8) if (nConnections) evDesc.add(a1).add(a2).add(a3).add(a4).add(a5).add(a6).add(a7).add(a8) 387 398 388 399 #else 389 400 390 401 /** 391 * No events for XPCOM targets now. In the future it looks natural to implmenet generic events mechanism 392 * for all platforms and get rid of callbacks. 402 * No COM events for XPCOM targets ofc. 393 403 */ 394 #define CONSOLE_ EVENTS_START(name,count)395 #define CONSOLE_ EVENTS_END()396 #define PREP_ ARGS0()397 #define PREP_ ARGS1(a1)398 #define PREP_ ARGS2(a1,a2)399 #define PREP_ ARGS3(a1,a2,a3)400 #define PREP_ ARGS4(a1,a2,a3,a4)401 #define PREP_ ARGS5(a1,a2,a3,a4,a5)402 #define PREP_ ARGS6(a1,a2,a3,a4,a5,a6)403 #define PREP_ ARGS7(a1,a2,a3,a4,a5,a6,a7)404 #define PREP_ ARGS8(a1,a2,a3,a4,a5,a6,a7,a8)404 #define CONSOLE_COM_EVENTS_START(name,count) 405 #define CONSOLE_COM_EVENTS_END() 406 #define PREP_COM_ARGS0() 407 #define PREP_COM_ARGS1(a1) 408 #define PREP_COM_ARGS2(a1,a2) 409 #define PREP_COM_ARGS3(a1,a2,a3) 410 #define PREP_COM_ARGS4(a1,a2,a3,a4) 411 #define PREP_COM_ARGS5(a1,a2,a3,a4,a5) 412 #define PREP_COM_ARGS6(a1,a2,a3,a4,a5,a6) 413 #define PREP_COM_ARGS7(a1,a2,a3,a4,a5,a6,a7) 414 #define PREP_COM_ARGS8(a1,a2,a3,a4,a5,a6,a7,a8) 405 415 406 416 #endif … … 424 434 * @param Args Number of callback arguments 425 435 */ 426 #define CONSOLE_DO_CALLBACKS_GEN(CallbackMethod, InvokeCb, PrepEvent, Args) \436 #define CONSOLE_DO_CALLBACKS_GEN(CallbackMethod, Argc, Args, PrepComArgs, MaybeComma) \ 427 437 do \ 428 438 { \ 429 CONSOLE_EVENTS_START(CallbackMethod,Args); \ 430 PrepEvent; \ 431 CONSOLE_EVENTS_END(); \ 439 CONSOLE_COM_EVENTS_START(CallbackMethod,Argc); \ 440 PrepComArgs; \ 441 CONSOLE_COM_EVENTS_END(); \ 442 VBoxEventDesc evDesc; \ 443 evDesc.init(mEventSource, VBoxEventType_##CallbackMethod MaybeComma Args); \ 444 evDesc.fire(/* don't wait for delivery */ 0); \ 432 445 CallbackList::iterator it = this->mCallbacks.begin(); \ 433 446 while (it != this->mCallbacks.end()) \ … … 435 448 if (it->isWanted(ConsoleCallbackRegistration::k ## CallbackMethod)) \ 436 449 { \ 437 HRESULT hrc = InvokeCb; \450 HRESULT hrc = it->ptrICb-> CallbackMethod (Args); \ 438 451 hrc = it->handleResult(ConsoleCallbackRegistration::k ## CallbackMethod, hrc); \ 439 452 if (FAILED_DEAD_INTERFACE(hrc)) \ … … 447 460 } while (0) 448 461 449 /* Actual invocation macro for different number of parameters */ 462 #define COMMA , 463 #define NO_COMMA 464 /* Actual invocation macroses for different number of parameters */ 450 465 #define CONSOLE_DO_CALLBACKS0(CallbackMethod) \ 451 CONSOLE_DO_CALLBACKS_GEN(CallbackMethod, it->ptrICb-> CallbackMethod (), PREP_ARGS0(), 0)466 CONSOLE_DO_CALLBACKS_GEN(CallbackMethod, 0, PREP_ARGS0(), PREP_COM_ARGS0(), NO_COMMA) 452 467 #define CONSOLE_DO_CALLBACKS1(CallbackMethod,Arg1) \ 453 CONSOLE_DO_CALLBACKS_GEN(CallbackMethod, it->ptrICb-> CallbackMethod (Arg1), PREP_ARGS1(Arg1), 1)468 CONSOLE_DO_CALLBACKS_GEN(CallbackMethod, 1, PREP_ARGS1(Arg1), PREP_COM_ARGS1(Arg1), COMMA) 454 469 #define CONSOLE_DO_CALLBACKS2(CallbackMethod,Arg1,Arg2) \ 455 CONSOLE_DO_CALLBACKS_GEN(CallbackMethod, it->ptrICb-> CallbackMethod (Arg1,Arg2), PREP_ARGS2(Arg1,Arg2), 2)470 CONSOLE_DO_CALLBACKS_GEN(CallbackMethod, 2, PREP_ARGS2(Arg1,Arg2),PREP_COM_ARGS2(Arg1,Arg2), COMMA) 456 471 #define CONSOLE_DO_CALLBACKS3(CallbackMethod,Arg1,Arg2,Arg3) \ 457 CONSOLE_DO_CALLBACKS_GEN(CallbackMethod, it->ptrICb-> CallbackMethod (Arg1,Arg2,Arg3), PREP_ARGS3(Arg1,Arg2,Arg3), 3)472 CONSOLE_DO_CALLBACKS_GEN(CallbackMethod, 3, PREP_ARGS3(Arg1,Arg2,Arg3), PREP_COM_ARGS3(Arg1,Arg2,Arg3), COMMA) 458 473 #define CONSOLE_DO_CALLBACKS4(CallbackMethod,Arg1,Arg2,Arg3,Arg4) \ 459 CONSOLE_DO_CALLBACKS_GEN(CallbackMethod, it->ptrICb-> CallbackMethod (Arg1,Arg2,Args3,Arg4), PREP_ARGS4(Arg1,Arg2,Arg3,Arg4), 4)474 CONSOLE_DO_CALLBACKS_GEN(CallbackMethod, 4, PREP_ARGS4(Arg1,Arg2,Arg3,Arg4), PREP_COM_ARGS4(Arg1,Arg2,Arg3,Arg4), COMMA) 460 475 #define CONSOLE_DO_CALLBACKS7(CallbackMethod,Arg1,Arg2,Arg3,Arg4,Arg5,Arg6,Arg7) \ 461 CONSOLE_DO_CALLBACKS_GEN(CallbackMethod, it->ptrICb-> CallbackMethod (Arg1,Arg2,Arg3,Arg4,Arg5,Arg6,Arg7), PREP_ARGS7(Arg1,Arg2,Arg3,Arg4,Arg5,Arg6,Arg7), 7)476 CONSOLE_DO_CALLBACKS_GEN(CallbackMethod, 7, PREP_ARGS7(Arg1,Arg2,Arg3,Arg4,Arg5,Arg6,Arg7), PREP_COM_ARGS7(Arg1,Arg2,Arg3,Arg4,Arg5,Arg6,Arg7), COMMA) 462 477 #define CONSOLE_DO_CALLBACKS8(CallbackMethod,Arg1,Arg2,Arg3,Arg4,Arg5,Arg6,Arg7,Arg8) \ 463 CONSOLE_DO_CALLBACKS_GEN(CallbackMethod, it->ptrICb-> CallbackMethod (Arg1,Arg2,Arg3,Arg4,Arg5,Arg6,Arg7,Arg8), PREP_ARGS8(Arg1,Arg2,Arg3,Arg4,Arg5,Arg6,Arg7,Arg8), 8)478 CONSOLE_DO_CALLBACKS_GEN(CallbackMethod, 8, PREP_ARGS8(Arg1,Arg2,Arg3,Arg4,Arg5,Arg6,Arg7,Arg8), PREP_COM_ARGS8(Arg1,Arg2,Arg3,Arg4,Arg5,Arg6,Arg7, Arg8), COMMA) 464 479 465 480 // constructor / destructor … … 4938 4953 AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS); 4939 4954 CallbackList::iterator it = mCallbacks.begin(); 4955 VBoxEventDesc evDesc; 4956 4940 4957 if (aCheck) 4941 4958 { … … 4958 4975 ++it; 4959 4976 } 4960 *aCanShow = TRUE; 4977 evDesc.init(mEventSource, VBoxEventType_OnCanShowWindow); 4978 BOOL fDelivered = evDesc.fire(10000); /* Wait up to 10 secs for delivery */ 4979 Assert(fDelivered); 4980 if (fDelivered) 4981 { 4982 ComPtr<IEvent> aEvent; 4983 evDesc.getEvent(aEvent.asOutParam()); 4984 // bit clumsy 4985 ComPtr<ICanShowWindowEvent> aCanShowEvent = aEvent; 4986 if (aCanShowEvent) 4987 { 4988 BOOL fVetoed = FALSE; 4989 aCanShowEvent->IsVetoed(&fVetoed); 4990 *aCanShow = !fVetoed; 4991 } 4992 else 4993 { 4994 Assert(FALSE); 4995 *aCanShow = TRUE; 4996 } 4997 } 4998 else 4999 { 5000 Assert(FALSE); 5001 *aCanShow = TRUE; 5002 } 4961 5003 } 4962 5004 else … … 4985 5027 ++it; 4986 5028 } 5029 #if 1 5030 evDesc.init(mEventSource, VBoxEventType_OnShowWindow); 5031 ComPtr<IEvent> aEvent; 5032 evDesc.getEvent(aEvent.asOutParam()); 5033 ComPtr<IShowWindowEvent> aShowEvent = aEvent; 5034 if (aShowEvent) 5035 aShowEvent->COMSETTER(WinId)(0); 5036 5037 BOOL fDelivered = evDesc.fire(10000); /* Wait up to 10 secs for delivery */ 5038 Assert(fDelivered); 5039 if (fDelivered) 5040 { 5041 ULONG64 aEvWinId = 0; 5042 if (aShowEvent) 5043 { 5044 aShowEvent->COMGETTER(WinId)(&aEvWinId); 5045 if (aEvWinId != 0) 5046 *aWinId = aEvWinId; 5047 } 5048 else 5049 Assert(FALSE); 5050 } 5051 else 5052 Assert(FALSE); 5053 #endif 4987 5054 } 4988 5055 -
trunk/src/VBox/Main/EventImpl.cpp
r30534 r30553 99 99 void VBoxEvent::uninit() 100 100 { 101 AutoUninitSpan autoUninitSpan(this);102 if (autoUninitSpan.uninitDone())103 return;104 105 101 if (!m) 106 102 return; … … 258 254 void VBoxVetoEvent::uninit() 259 255 { 260 AutoUninitSpan autoUninitSpan(this);261 if (autoUninitSpan.uninitDone())262 return;263 264 256 VBoxEvent::uninit(); 265 257 if (!m) … … 717 709 uint32_t cListeners = listeners.size(); 718 710 if (cListeners == 0) 711 { 712 aEvent->SetProcessed(); 719 713 break; // just leave the lock and update event object state 714 } 720 715 721 716 PendingEventsMap::iterator pit; … … 892 887 NS_DECL_CLASSINFO(VBoxEvent) 893 888 NS_IMPL_THREADSAFE_ISUPPORTS1_CI(VBoxEvent, IEvent) 889 NS_DECL_CLASSINFO(VBoxVetoEvent) 890 NS_IMPL_ISUPPORTS_INHERITED1(VBoxVetoEvent, VBoxEvent, IVetoEvent) 894 891 #endif 895 892 -
trunk/src/VBox/Main/VirtualBoxImpl.cpp
r30510 r30553 2749 2749 ++it; 2750 2750 } 2751 2752 VBoxEventDesc evDesc; 2753 evDesc.init(m->pEventSource, VBoxEventType_OnExtraDataCanChange, id.raw(), aKey, aValue); 2754 BOOL fDelivered = evDesc.fire(10000); /* Wait up to 10 secs for delivery */ 2755 Assert(fDelivered); 2756 if (fDelivered) 2757 { 2758 ComPtr<IEvent> aEvent; 2759 evDesc.getEvent(aEvent.asOutParam()); 2760 ComPtr<IExtraDataCanChangeEvent> aCanChangeEvent = aEvent; 2761 Assert(aCanChangeEvent); 2762 BOOL fVetoed = FALSE; 2763 aCanChangeEvent->IsVetoed(&fVetoed); 2764 allowChange = !fVetoed; 2765 2766 if (!allowChange) 2767 { 2768 SafeArray<BSTR> aVetos; 2769 aCanChangeEvent->GetVetos(ComSafeArrayAsOutParam(aVetos)); 2770 if (aVetos.size() > 0) 2771 aError = aVetos[0]; 2772 } 2773 } 2774 else 2775 allowChange = TRUE; 2751 2776 2752 2777 LogFlowThisFunc(("allowChange=%RTbool\n", allowChange)); … … 4688 4713 #endif 4689 4714 4690 #if 14691 // We disable generic events firing for now to not harm performance, but it is already functional4692 4715 { 4693 4716 VBoxEventDesc evDesc; 4694 4717 prepareEventDesc(mVirtualBox->m->pEventSource, evDesc); 4695 ComPtr<IEvent> aEvent; 4696 BOOL fDelivered; 4697 4698 evDesc.getEvent(aEvent.asOutParam()); 4699 if (aEvent && mVirtualBox && mVirtualBox->m->pEventSource) 4700 mVirtualBox->m->pEventSource->FireEvent(aEvent, /* don't wait for delivery */ 0, &fDelivered); 4701 } 4702 #endif 4718 4719 evDesc.fire(/* don't wait for delivery */0); 4720 } 4703 4721 4704 4722 for (CallbackList::const_iterator it = callbacks.begin(); -
trunk/src/VBox/Main/idl/VirtualBox.xidl
r30535 r30553 15608 15608 15609 15609 <interface 15610 name="I CanExtraDataChangeEvent" extends="IVetoEvent"15610 name="IExtraDataCanChangeEvent" extends="IVetoEvent" 15611 15611 uuid="245d88bd-800a-40f8-87a6-170d02249a55" 15612 wsmap="managed" id="OnExtraDataCanChange"15612 wsmap="managed" autogen="VBoxEvent" id="OnExtraDataCanChange" 15613 15613 waitable="true" 15614 15614 > … … 15639 15639 name="ICanShowWindowEvent" extends="IVetoEvent" 15640 15640 uuid="adf292b0-92c9-4a77-9d35-e058b39fe0b9" 15641 wsmap="managed" id="OnCanShowWindow"15641 wsmap="managed" autogen="VBoxEvent" id="OnCanShowWindow" 15642 15642 waitable="true" 15643 15643 > -
trunk/src/VBox/Main/idl/comimpl.xsl
r30535 r30553 366 366 <xsl:value-of select=" ' } '" /> 367 367 </xsl:if> 368 368 369 369 <xsl:value-of select=" ' // purely internal setter '" /> 370 370 <xsl:value-of select="concat(' int set_', @name,'(',$pTypeNameIn, ') { ')" /> … … 400 400 <xsl:template name="genEventImpl"> 401 401 <xsl:param name="implName" /> 402 <xsl:param name="isVeto" /> 402 403 403 404 <xsl:value-of select="concat('class ATL_NO_VTABLE ',$implName, … … 424 425 STDMETHOD(COMGETTER(Type)) (VBoxEventType_T *aType) 425 426 { 426 return mEvent->COMGETTER(Type) (aType);427 return ((VBoxEvent*)mEvent)->COMGETTER(Type) (aType); 427 428 } 428 429 STDMETHOD(COMGETTER(Source)) (IEventSource * *aSource) 429 430 { 430 return mEvent->COMGETTER(Source) (aSource);431 return ((VBoxEvent*)mEvent)->COMGETTER(Source) (aSource); 431 432 } 432 433 STDMETHOD(COMGETTER(Waitable)) (BOOL *aWaitable) 433 434 { 434 return mEvent->COMGETTER(Waitable) (aWaitable);435 return ((VBoxEvent*)mEvent)->COMGETTER(Waitable) (aWaitable); 435 436 } 436 437 STDMETHOD(SetProcessed)() 437 438 { 438 return mEvent->SetProcessed();439 return ((VBoxEvent*)mEvent)->SetProcessed(); 439 440 } 440 441 STDMETHOD(WaitProcessed)(LONG aTimeout, BOOL *aResult) 441 442 { 442 return mEvent->WaitProcessed(aTimeout, aResult); 443 } 443 return ((VBoxEvent*)mEvent)->WaitProcessed(aTimeout, aResult); 444 } 445 void uninit() 446 { 447 mEvent->uninit(); 448 } 449 ]]></xsl:text> 450 <xsl:choose> 451 <xsl:when test="$isVeto"> 452 <xsl:text><![CDATA[ 453 HRESULT init (IEventSource* aSource, VBoxEventType_T aType, BOOL aWaitable = TRUE) 454 { 455 NOREF(aWaitable); 456 return mEvent->init(aSource, aType); 457 } 458 STDMETHOD(AddVeto)(IN_BSTR aVeto) 459 { 460 return mEvent->AddVeto(aVeto); 461 } 462 STDMETHOD(IsVetoed)(BOOL *aResult) 463 { 464 return mEvent->IsVetoed(aResult); 465 } 466 STDMETHOD(GetVetos)(ComSafeArrayOut(BSTR, aVetos)) 467 { 468 return mEvent->GetVetos(ComSafeArrayOutArg(aVetos)); 469 } 470 private: 471 ]]></xsl:text> 472 <xsl:value-of select=" ' ComObjPtr<VBoxVetoEvent> mEvent; '" /> 473 </xsl:when> 474 <xsl:otherwise> 475 <xsl:text><![CDATA[ 444 476 HRESULT init (IEventSource* aSource, VBoxEventType_T aType, BOOL aWaitable) 445 477 { 446 478 return mEvent->init(aSource, aType, aWaitable); 447 479 } 448 void uninit() 449 { 450 mEvent->uninit(); 451 } 480 private: 452 481 ]]></xsl:text> 453 <xsl:value-of select=" 'private: '" />454 <xsl:value-of select=" ' ComObjPtr<VBoxEvent> mEvent; '" />455 482 <xsl:value-of select=" ' ComObjPtr<VBoxEvent> mEvent; '" /> 483 </xsl:otherwise> 484 </xsl:choose> 456 485 <xsl:call-template name="genAttrCode"> 457 486 <xsl:with-param name="name" select="@name" /> … … 486 515 <xsl:value-of select="concat(' ComObjPtr<', $implName, '> obj; ')"/> 487 516 <xsl:value-of select=" ' obj.createObject(); '"/> 488 <xsl:value-of select="concat(' obj->init( source, aType, ', $waitable, '); ')"/>517 <xsl:value-of select="concat(' obj->init(aSource, aType, ', $waitable, '); ')"/> 489 518 <xsl:call-template name="genAttrInitCode"> 490 519 <xsl:with-param name="name" select="@name" /> … … 498 527 <xsl:template name="genCommonEventCode"> 499 528 <xsl:text><![CDATA[ 500 HRESULT VBoxEventDesc::init(IEventSource* source, VBoxEventType_T aType, ...)529 HRESULT VBoxEventDesc::init(IEventSource* aSource, VBoxEventType_T aType, ...) 501 530 { 502 531 va_list args; 532 533 mEventSource = aSource; 503 534 va_start(args, aType); 504 535 switch (aType) … … 548 579 <xsl:choose> 549 580 <xsl:when test="$G_kind='VBoxEvent'"> 581 <xsl:variable name="isVeto"> 582 <xsl:value-of select="@extends='IVetoEvent'" /> 583 </xsl:variable> 550 584 <xsl:call-template name="genEventImpl"> 551 585 <xsl:with-param name="implName" select="$implName" /> 586 <xsl:with-param name="isVeto" select="$isVeto" /> 552 587 </xsl:call-template> 553 588 </xsl:when> -
trunk/src/VBox/Main/include/EventImpl.h
r30534 r30553 95 95 HRESULT init (IEventSource *aSource, VBoxEventType_T aType); 96 96 void uninit(); 97 98 // IEvent properties 99 STDMETHOD(COMGETTER(Type)) (VBoxEventType_T *aType) 100 { 101 return VBoxEvent::COMGETTER(Type)(aType); 102 } 103 STDMETHOD(COMGETTER(Source)) (IEventSource * *aSource) 104 { 105 return VBoxEvent::COMGETTER(Source)(aSource); 106 } 107 STDMETHOD(COMGETTER(Waitable)) (BOOL *aWaitable) 108 { 109 return VBoxEvent::COMGETTER(Waitable)(aWaitable); 110 } 111 112 // IEvent methods 113 STDMETHOD(SetProcessed)() 114 { 115 return VBoxEvent::SetProcessed(); 116 } 117 STDMETHOD(WaitProcessed)(LONG aTimeout, BOOL *aResult) 118 { 119 return VBoxEvent::WaitProcessed(aTimeout, aResult); 120 } 97 121 98 122 // IVetoEvent methods … … 186 210 } 187 211 188 private: 189 ComPtr<IEvent> mEvent; 212 BOOL fire(LONG aTimeout) 213 { 214 if (mEventSource && mEvent) 215 { 216 BOOL fDelivered = FALSE; 217 int rc = mEventSource->FireEvent(mEvent, aTimeout, &fDelivered); 218 AssertRCReturn(rc, FALSE); 219 return fDelivered; 220 } 221 return FALSE; 222 } 223 224 private: 225 ComPtr<IEvent> mEvent; 226 ComPtr<IEventSource> mEventSource; 190 227 }; 191 228
Note:
See TracChangeset
for help on using the changeset viewer.