fishulla/Torque3D — pull request #28 by fishulla (2014-12-28 15:05:55+00:00)
Title: Add SimEvent declarations similar to script callbacks.

Change all engine script callback declarations to SimSignals (when return type is void) and SimDelegates.

/// Declare a global signal and a script callback
/// When SIMDELEGATE are called with NAME##_callback, c++ signal are triggered first, then torque-script callback.
/// Torque::ISignal< void ARGS >> getISignal_##NAME()
/// @see IMPLEMENT_SIMSIGNAL
#define DECLARE_GLOBAL_SIMSIGNAL( NAME, ARGS )

/// Declare a global delegate and a script callback
/// When SIMDELEGATE are called with NAME##_callback, if a c++ delegate is set, torque-script callback are not executed.
/// void setDelegate_##NAME(const Delegate< returnType ARGS > &dlg);
/// Delegate< returnType ARGS > getDelegateCopy_##NAME() const;
//! @see IMPLEMENT_GLOBAL_SIMDELEGATE
#define DECLARE_GLOBAL_SIMDELEGATE( NAME, RET, ARGS )

/// Declare a member signal and a script callback
/// When SIMDELEGATE are called with NAME##_callback, c++ signal are triggered first, then torque-script callback.
/// This macro change the actual scope of class members to SCOPE
/// Torque::ISignal< void(ownerPtr + ARGS) >> getISignal_##NAME()
/// @see IMPLEMENT_SIMSIGNAL
#define DECLARE_SIMSIGNAL( SCOPE, NAME, ARGS )

/// Declare a member delegate and a script callback
/// When SIMDELEGATE are called with NAME##_callback, if a c++ delegate is set, torque-script callback are not executed.
/// This macro change the actual scope of class members to SCOPE
/// void setDelegate_##NAME(const Delegate< returnType (ownerPtr + ARGS) > &dlg);
/// Delegate< returnType (ownerPtr + ARGS) > getDelegateCopy_##NAME() const;
//! @see IMPLEMENT_SIMDELEGATE
#define DECLARE_SIMDELEGATE( SCOPE, returnType, NAME, ARGS )