Commit a92bcc88 authored by Jan Möbius's avatar Jan Möbius

Added RPC callfunction with 6 parameters

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@15106 383ad7c9-94d9-4d36-a494-682f7c89f535
parent 8de735de
......@@ -230,6 +230,29 @@ void callFunction( QString _plugin, QString _functionName, T0 _t0 , T1 _t1 , T2
callFunction(_plugin,_functionName,parameters);
}
/** \brief call a function in another plugin
*
* @param _plugin Plugin name ( Scripting name of the plugin )
* @param _functionName Name of the remote function
* @param _t0 Parameter 1 passed to the function
* @param _t1 Parameter 2 passed to the function
* @param _t2 Parameter 3 passed to the function
* @param _t3 Parameter 4 passed to the function
* @param _t4 Parameter 5 passed to the function
*/
template <typename T0, typename T1 , typename T2, typename T3, typename T4, typename T5>
void callFunction( QString _plugin, QString _functionName, T0 _t0 , T1 _t1 , T2 _t2 , T3 _t3 , T4 _t4, T5 _t5) {
QScriptEngine* engine = getScriptEngine();
std::vector< QScriptValue > parameters;
parameters.push_back( engine->toScriptValue( _t0 ) );
parameters.push_back( engine->toScriptValue( _t1 ) );
parameters.push_back( engine->toScriptValue( _t2 ) );
parameters.push_back( engine->toScriptValue( _t3 ) );
parameters.push_back( engine->toScriptValue( _t4 ) );
parameters.push_back( engine->toScriptValue( _t5 ) );
callFunction(_plugin,_functionName,parameters);
}
/** @} */
//===========================================================================
......
......@@ -98,10 +98,28 @@ void Core::slotObjectUpdated(int _identifier, const UpdateType& _type) {
}
}
// just inform the plugins as we dont do anything else (Do deprecated and new updatedObjects here)
emit signalObjectUpdated(_identifier);
emit signalObjectUpdated(_identifier, _type);
// If the identifier is -1 we force an update of all objects in the scene (Bad idea for scenes with many objects)
if ( _identifier == -1 ) {
for ( PluginFunctions::ObjectIterator o_it(PluginFunctions::ALL_OBJECTS,DATA_ALL ) ; o_it != PluginFunctions::objectsEnd(); ++o_it) {
// just inform the plugins as we don't do anything else (Do deprecated and new updatedObjects here)
emit signalObjectUpdated(o_it->id());
emit signalObjectUpdated(o_it->id(), _type);
// Call the objects update function
o_it->update();
}
} else {
// just inform the plugins as we don't do anything else (Do deprecated and new updatedObjects here)
emit signalObjectUpdated(_identifier);
emit signalObjectUpdated(_identifier, _type);
}
// If we have an single object, call it's update function
if ( object != 0 )
object->update(_type);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment