是否可以从OpenFlipper中的另一个插件调用另一个插件的功能? [英] Is it possible to call another plugin's function from another plugin in OpenFlipper?

查看:88
本文介绍了是否可以从OpenFlipper中的另一个插件调用另一个插件的功能?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我希望这个问题具有足够普遍的背景知识,它不需要经验丰富的OpenFlipper开发人员来回答. OpenFlipper使用的插件使用Qt库.

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.

我正在为OpenFlipper编写一个插件,该插件以编程方式添加原始形状.一个已经存在的插件PrimativesGenerator具有我需要的某些功能,因此,自然地,我更喜欢调用PrimativesGeneratorPlugin的功能,而不是重现代码.

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.

我的问题是所有插件都在运行时加载,并且文档建议初始化期间不存在插件间依赖关系,因为无法确定初始化顺序.我宁愿使用现有的实例PrimativesGeneratorPlugin而不是创建自己的实例,因为每个实例还包含一个gui,但是我对如何引用它感到困惑.

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?

以下是插件初始化的文档.

推荐答案

我找到了答案,但不幸的是,它仅适用于某些OpenFlipper插件.

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

PrimativesGenerator实现RPC接口(文档此处),该接口允许其他插件调用其功能.

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

根据实现的不同,还有两种访问插件功能的方法,脚本界面 PluginConnection接口.

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

这篇关于是否可以从OpenFlipper中的另一个插件调用另一个插件的功能?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆