Changeset 30209 in vbox for trunk/src/VBox/Main/ConsoleImpl.cpp
- Timestamp:
- Jun 15, 2010 4:10:29 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/ConsoleImpl.cpp
r30207 r30209 377 377 */ 378 378 #define PREP_ARGS0() 379 #define PREP_ARGS1(a1) evDesc.add(a1) 380 #define PREP_ARGS2(a1,a2) evDesc.add(a1).add(a2) 381 #define PREP_ARGS3(a1,a2,a3) evDesc.add(a1).add(a2).add(a3) 382 #define PREP_ARGS4(a1,a2,a3,a4) evDesc.add(a1).add(a2).add(a3).add(a4) 383 #define PREP_ARGS5(a1,a2,a3,a4,a5) evDesc.add(a1).add(a2).add(a3).add(a4).add(a5) 384 #define PREP_ARGS6(a1,a2,a3,a4,a5,a6) evDesc.add(a1).add(a2).add(a3).add(a4).add(a5).add(a6) 385 #define PREP_ARGS7(a1,a2,a3,a4,a5,a6,a7) evDesc.add(a1).add(a2).add(a3).add(a4).add(a5).add(a6).add(a7) 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) 386 387 387 388 #else … … 390 391 * No events for XPCOM targets now. In the future it looks natural to implmenet generic events mechanism 391 392 * for all platforms and get rid of callbacks. 392 */ 393 */ 393 394 #define CONSOLE_EVENTS_START(name,count) 394 395 #define CONSOLE_EVENTS_END() … … 401 402 #define PREP_ARGS6(a1,a2,a3,a4,a5,a6) 402 403 #define PREP_ARGS7(a1,a2,a3,a4,a5,a6,a7) 404 #define PREP_ARGS8(a1,a2,a3,a4,a5,a6,a7,a8) 403 405 404 406 #endif … … 426 428 { \ 427 429 CONSOLE_EVENTS_START(CallbackMethod,Args); \ 428 if (nConnections) { PrepEvent; }\430 PrepEvent; \ 429 431 CONSOLE_EVENTS_END(); \ 430 432 CallbackList::iterator it = this->mCallbacks.begin(); \ … … 445 447 } while (0) 446 448 447 /* Actual invocation macro for different 449 /* Actual invocation macro for different number of parameters */ 448 450 #define CONSOLE_DO_CALLBACKS0(CallbackMethod) \ 449 CONSOLE_DO_CALLBACKS_GEN(CallbackMethod, it->ptrICb-> ##CallbackMethod##(), PREP_ARGS0(), 0)451 CONSOLE_DO_CALLBACKS_GEN(CallbackMethod, it->ptrICb-> CallbackMethod (), PREP_ARGS0(), 0) 450 452 #define CONSOLE_DO_CALLBACKS1(CallbackMethod,Arg1) \ 451 CONSOLE_DO_CALLBACKS_GEN(CallbackMethod, it->ptrICb-> ##CallbackMethod##(Arg1), PREP_ARGS1(Arg1), 1)453 CONSOLE_DO_CALLBACKS_GEN(CallbackMethod, it->ptrICb-> CallbackMethod (Arg1), PREP_ARGS1(Arg1), 1) 452 454 #define CONSOLE_DO_CALLBACKS2(CallbackMethod,Arg1,Arg2) \ 453 CONSOLE_DO_CALLBACKS_GEN(CallbackMethod, it->ptrICb-> ##CallbackMethod##(Arg1,Arg2), PREP_ARGS2(Arg1,Arg2), 2)455 CONSOLE_DO_CALLBACKS_GEN(CallbackMethod, it->ptrICb-> CallbackMethod (Arg1,Arg2), PREP_ARGS2(Arg1,Arg2), 2) 454 456 #define CONSOLE_DO_CALLBACKS3(CallbackMethod,Arg1,Arg2,Arg3) \ 455 CONSOLE_DO_CALLBACKS_GEN(CallbackMethod, it->ptrICb-> ##CallbackMethod##(Arg1,Arg2,Arg3), PREP_ARGS3(Arg1,Arg2,Arg3), 3)457 CONSOLE_DO_CALLBACKS_GEN(CallbackMethod, it->ptrICb-> CallbackMethod (Arg1,Arg2,Arg3), PREP_ARGS3(Arg1,Arg2,Arg3), 3) 456 458 #define CONSOLE_DO_CALLBACKS4(CallbackMethod,Arg1,Arg2,Arg3,Arg4) \ 457 CONSOLE_DO_CALLBACKS_GEN(CallbackMethod, it->ptrICb-> ##CallbackMethod##(Arg1,Arg2,Args3,Arg4), PREP_ARGS4(Arg1,Arg2,Arg3,Arg4), 4)459 CONSOLE_DO_CALLBACKS_GEN(CallbackMethod, it->ptrICb-> CallbackMethod (Arg1,Arg2,Args3,Arg4), PREP_ARGS4(Arg1,Arg2,Arg3,Arg4), 4) 458 460 #define CONSOLE_DO_CALLBACKS7(CallbackMethod,Arg1,Arg2,Arg3,Arg4,Arg5,Arg6,Arg7) \ 459 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) 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) 462 #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) 460 464 461 465 // constructor / destructor … … 4770 4774 mCallbackData.mpsc.valid = true; 4771 4775 4772 CONSOLE_DO_CALLBACKS7(OnMousePointerShapeChange, fVisible, fAlpha, xHot, yHot, width, height, ComSafeArrayInArg(pShape)); 4776 /** 4777 * Although looks stupid, this is result of fact that safearrays params in XPCOM 4778 * passed as separate pointer and length arguments. 4779 * @todo: better solution 4780 */ 4781 #ifdef RT_OS_WINDOWS 4782 CONSOLE_DO_CALLBACKS7(OnMousePointerShapeChange, fVisible, fAlpha, xHot, yHot, width, height, pShape); 4783 #else 4784 CONSOLE_DO_CALLBACKS8(OnMousePointerShapeChange, fVisible, fAlpha, xHot, yHot, width, height, pShapeSize, pShape); 4785 #endif 4773 4786 4774 4787 #if 0
Note:
See TracChangeset
for help on using the changeset viewer.