Is it possible to call another plugin's functi

2019-09-18 09:47发布

问题:

I'm hoping that this question has general enough context that it won't require an experienced OpenFlipper developer to answer it. The plugins used by OpenFlipper use the Qt Library.

I'm writing a plugin for OpenFlipper that programatically add primitive shapes. A prexisting plugin, PrimativesGenerator, has some of the same functionality that I will need, so naturally, I'd prefer to call the functions of PrimativesGeneratorPlugin rather than reproduce the code.

My problem is that all plugins are loaded at runtime and the documentation recommends that there be no between-plugin dependancies during the initialization because the initialization order cannot be determined. I would rather use the existing instance PrimativesGeneratorPlugin rather than create my own instance since every instance also includes a gui, but I'm stumped on how to reference it.

Is it even possible to use the original instance? Or do I need to create my own instance?

Here's the documentation for Plugin Initialization.

回答1:

I found the answer, but unfortunately it will only work for some of the OpenFlipper plugins.

PrimativesGenerator implements the RPC Interface (documentation here ) which allows other plugins to call its functions.

There are also two other ways to access a plugins functions depending on the implementation, the Scripting interface and the PluginConnection interface.



标签: c++ qt plugins