本文整理汇总了C++中PluginManager::createPlugin方法的典型用法代码示例。如果您正苦于以下问题:C++ PluginManager::createPlugin方法的具体用法?C++ PluginManager::createPlugin怎么用?C++ PluginManager::createPlugin使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PluginManager
的用法示例。
在下文中一共展示了PluginManager::createPlugin方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: onContextMenuClick
void FrameAttachmentPoint::onContextMenuClick(int frame, int command)
{
if (frame >= 0 && frame < mAttachedFrames.size())
{
auto framePos = mAttachedFrames.begin();
for (int i = 0; i < frame; i++) framePos++;
//Check for command
if (command == COMMAND_COPY)
{
//Copy the plugin
PluginManager* manager = Carbon::get()->getPluginManager();
AbstractPlugin* plugin = manager->createPlugin(*(*framePos)->getPluginDefinition(), true);
}
else if (command == COMMAND_DELETE)
{
//Delete the plugin
PluginManager* manager = Carbon::get()->getPluginManager();
manager->deletePlugin((*framePos)->getPluginId(), true);
}
else if (command >= COMMAND_MAX_ID)
{
//Reattach the plugin
int target = command - COMMAND_MAX_ID;
WindowManager* manager = Carbon::get()->getWindowManager();
if ((int)manager->getFrameAttachmentPoints().size() > target && target >= 0)
{
auto pos = manager->getFrameAttachmentPoints().begin();
for (int i = 0; i < target; i++) pos++;
manager->changeAttachment(*framePos, pos->second->getName());
}
}
}
else
{
LOG_ERROR() << "Illegal frame index " << frame;
}
}