Developer Documentation
|
The RPCInterface can be used by plugins to call functions from other OpenFlipper plugins. The calls are internally transformed into scripting calls and passed to the other plugins.
You can directly connect signals and slots via the Plugin Connection Interface .
The interface itself contains two basic functions which can be used to check if another plugin exists (RPCInterface::pluginExists()) or if a specific function exists in another plugin (RPCInterface::functionExists()). Both functions get the clean name of the plugin to check. To get that name, just open the script editor in OpenFlipper which lists all plugins and their available functions.
Example Code for plugins:
Example Code for functions:
In addition to these basic functions there is a set of template functions in RPCWrappers.hh which can be used to directly call a function from another plugin via the scripting system. This requires the parameters to be registered to the QT MetaObject system which is already done for the most common types of variables.
For calling a function you can use RPC::callFunction() or RPC::callFunctionValue() if the called function returns a value. These functions get the pluginName and the function name and call the requested function via scripting. It is possible to supply additional parameters to these functions that will be passed to the called function.
Example code:
To use the RPCInterface: