本文整理汇总了C++中PluginManager类的典型用法代码示例。如果您正苦于以下问题:C++ PluginManager类的具体用法?C++ PluginManager怎么用?C++ PluginManager使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了PluginManager类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetWordAtCaret
void CscopePlugin::BuildModuleMenu(const ModuleType type, wxMenu* menu, const FileTreeData* /*data*/)
{
if ( !IsAttached() || m_pProcess) return;
if(type != mtEditorManager || !menu ) return;
EditorManager* emngr = Manager::Get()->GetEditorManager();
if ( !emngr ) return;
EditorBase *edb = emngr->GetActiveEditor();
if ( !edb || !edb->IsBuiltinEditor() ) return;
cbStyledTextCtrl* stc = ((cbEditor*)edb)->GetControl();
if ( !stc ) return;
if ( stc->GetLexer() != wxSCI_LEX_CPP) return;
wxString word = GetWordAtCaret();
if ( word.IsEmpty() ) return;
PluginManager *pluginManager = Manager::Get()->GetPluginManager();
int idximp = pluginManager->GetFindMenuItemFirst() + pluginManager->GetFindMenuItemCount();
menu->Insert(idximp++, idOnFindFunctionsCalledByThisFuncion, _("Find functions called by '") + word + _T("'"));
menu->Insert(idximp++, idOnFindFunctionsCallingThisFunction, _("Find functions calling '") + word + _T("'"));
pluginManager->RegisterFindMenuItems(false, 2);
}
示例2: setPluginEnabled
void Preferences::setPluginEnabled(const QString &fileName, bool enabled)
{
PluginManager::instance()->setPluginState(fileName, enabled ? PluginEnabled : PluginDisabled);
QStringList disabledPlugins;
QStringList enabledPlugins;
PluginManager *pluginManager = PluginManager::instance();
auto &states = pluginManager->pluginStates();
for (auto it = states.begin(), it_end = states.end(); it != it_end; ++it) {
const QString &fileName = it.key();
PluginState state = it.value();
switch (state) {
case PluginEnabled:
enabledPlugins.append(fileName);
break;
case PluginDisabled:
disabledPlugins.append(fileName);
break;
case PluginDefault:
case PluginStatic:
break;
}
}
mSettings->setValue(QLatin1String("Plugins/Disabled"), disabledPlugins);
mSettings->setValue(QLatin1String("Plugins/Enabled"), enabledPlugins);
}
示例3: save
bool MapDocument::save(const QString &fileName, QString *error)
{
PluginManager *pm = PluginManager::instance();
MapWriterInterface *chosenWriter = 0;
if (const Plugin *plugin = pm->pluginByFileName(mWriterPluginFileName))
chosenWriter = qobject_cast<MapWriterInterface*>(plugin->instance);
TmxMapWriter mapWriter;
if (!chosenWriter)
chosenWriter = &mapWriter;
if (!chosenWriter->write(map(), fileName)) {
if (error)
*error = chosenWriter->errorString();
return false;
}
undoStack()->setClean();
setFileName(fileName);
mLastSaved = QFileInfo(fileName).lastModified();
emit saved();
return true;
}
示例4: wxGetApp
//=================================================================================
// It's important to note that we can't just unload the plugin here and now,
// because the plugin code is still running the call-stack.
/*virtual*/ bool PluginManager::PluginAssistant::UnloadPlugin( const wxString& libraryPath )
{
PluginManager* pluginManager = wxGetApp().GetPluginManager();
Cornucopia::Path path( ( const char* )libraryPath.c_str() );
if( pluginManager && pluginManager->UnloadPluginLater( path ) )
return true;
return false;
}
示例5: main
int main()
{
PluginManager pluginManager;
pluginManager.loadAllPlugins();
pluginManager.destroyAllPlugins();
return 0;
}
示例6: qDebug
void MainWindowBase::unloadPlugins(){
qDebug()<<"--MainWindowBase::unloadPlugins()";
PluginManager *pluginManager = PluginManager::instance();
pluginManager->unloadPlugins();
//delete pluginManager();
}
示例7: onItemClicked
void ProjectManagerPlugin::onItemClicked(const QModelIndex &index)
{
FileItem* item = static_cast<FileItem*>(index.internalPointer());
if (item->isDirectory)
return;
PluginManager *pluginManager = dynamic_cast<PluginManager*>(mdiServer->mdiHost);
if (pluginManager)
pluginManager->openFile(item->fullPath);
}
示例8: foreach
/*!
\fn IPlugin::~IPlugin()
\internal
*/
IPlugin::~IPlugin()
{
PluginManager *pm = PluginManager::instance();
foreach (QObject *obj, d->addedObjectsInReverseOrder)
pm->removeObject(obj);
qDeleteAll(d->addedObjectsInReverseOrder);
d->addedObjectsInReverseOrder.clear();
delete d;
d = 0;
}
示例9: foreach
IPlugin::IPlugin(const QString& depInterfaces)
{
PluginManager *pluginManager = PluginManager::instance();
m_depModulList = depInterfaces.split(" ");
foreach (const QString &depPlugin, depModulList()) {
if (!depPlugin.isEmpty())
pluginManager->nextLoadPlugins(depPlugin);
}
if (pluginManager->settings())
setSettings(pluginManager->settings());
}
示例10: main
int main(int argc,const char**argv) {
using namespace Sirikata;
OptionSet::getOptions("")->parse(argc,argv);
Network::IOService*io=Network::IOServiceFactory::makeIOService();
//FIXME
//Network::IOServiceFactory::runService(io);
PluginManager plugins;
const char* pluginNames[] = { "mono", NULL};
for(const char** plugin_name = pluginNames; *plugin_name != NULL; plugin_name++)
plugins.load( DynamicLibrary::filename(*plugin_name) );
return 0;
}
示例11:
void
VisItDataServerPrivate::LoadPluginsNow(PluginManager &plugins)
{
// Enable all plugins
for(int i = 0; i < plugins.GetNAllPlugins(); ++i)
{
// Get a pointer to the GUI portion of the Operator plugin information.
plugins.EnablePlugin(plugins.GetAllID(i));
}
// Load the plugins
plugins.LoadPluginsNow();
}
示例12: WriteWebServerJSON
// -----------------------------------------------------------------------------
//
// -----------------------------------------------------------------------------
void WriteWebServerJSON(const QString& filePath)
{
// Register all the filters including trying to load those from Plugins
FilterManager* fm = FilterManager::Instance();
DREAM3DPluginLoader::LoadPluginFilters(fm);
PluginManager* pm = PluginManager::Instance();
QVector<IDREAM3DPlugin*> plugins = pm->getPluginsVector();
// Send progress messages from PipelineBuilder to this object for display
QMetaObjectUtilities::RegisterMetaTypes();
// Write our File Version and DREAM3D Version strings
QJsonObject meta;
meta["Release Date"] = QDate::currentDate().toString();
meta["Release Type"] = DREAM3DProj_RELEASE_TYPE;
meta["Major"] = DREAM3DLib::Version::Major();
meta["Minor"] = DREAM3DLib::Version::Minor();
meta["Patch"] = DREAM3DLib::Version::Patch();
meta["Revision"] = DREAM3DLib::Version::Revision();
meta["Download WebSite"] = "http://dream3d.bluequartz.net/?page_id=32";
QJsonObject m_Root;
m_Root["DREAM3D"] = meta;
QJsonArray plugArray;
for(int i = 0; i < plugins.size(); i++)
{
IDREAM3DPlugin* plug = plugins[i];
QJsonObject jobj;
jobj["Plugin Name"] = plug->getPluginName();
jobj["Plugin Version"] = plug->getVersion();
jobj["Plugin Vendor"] = plug->getVendor();
plugArray.append(jobj);
}
m_Root["Plugins"] = plugArray;
QJsonDocument doc(m_Root);
QFile outputFile(filePath);
if (outputFile.open(QIODevice::WriteOnly))
{
outputFile.write(doc.toJson());
outputFile.close();
}
}
示例13: dfhack_open_plugin
static int dfhack_open_plugin(lua_State *L)
{
luaL_checktype(L, 1, LUA_TTABLE);
luaL_checktype(L, 2, LUA_TSTRING);
const char *name = lua_tostring(L, 2);
PluginManager *pmgr = Core::getInstance().getPluginManager();
Plugin *plugin = pmgr->getPluginByName(name);
if (!plugin)
luaL_error(L, "plugin not found: '%s'", name);
plugin->open_lua(L, 1);
return 0;
}
示例14:
AccessControlDataBackendManager::AccessControlDataBackendManager( PluginManager& pluginManager ) :
m_backends(),
m_defaultBackend( nullptr ),
m_configuredBackend( nullptr )
{
for( auto pluginObject : pluginManager.pluginObjects() )
{
auto pluginInterface = qobject_cast<PluginInterface *>( pluginObject );
auto accessControlDataBackendInterface = qobject_cast<AccessControlDataBackendInterface *>( pluginObject );
if( pluginInterface && accessControlDataBackendInterface )
{
m_backends[pluginInterface->uid()] = accessControlDataBackendInterface;
if( pluginInterface->flags().testFlag( Plugin::ProvidesDefaultImplementation ) )
{
m_defaultBackend = accessControlDataBackendInterface;
}
}
}
if( m_defaultBackend == nullptr )
{
qCritical( "AccessControlDataBackendManager: no default plugin available!" );
}
reloadConfiguration();
}
示例15: main
int main(int argc, char** argv) {
using namespace Sirikata;
InitOptions();
Trace::Trace::InitOptions();
OHTrace::InitOptions();
InitSimOHOptions();
ParseOptions(argc, argv);
PluginManager plugins;
plugins.loadList( GetOptionValue<String>(OPT_PLUGINS) );
plugins.loadList( GetOptionValue<String>(OPT_OH_PLUGINS) );
String trace_file = GetPerServerFile(STATS_OH_TRACE_FILE, 1);
Trace::Trace* gTrace = new Trace::Trace(trace_file);
BoundingBox3f region = GetOptionValue<BoundingBox3f>("region");
Duration duration = GetOptionValue<Duration>("duration");
// Get the starting time
Time start_time = Timer::now();
srand( GetOptionValue<uint32>("rand-seed") );
Network::IOService* ios = Network::IOServiceFactory::makeIOService();
Network::IOStrand* mainStrand = ios->createStrand();
ObjectHostContext* ctx = new ObjectHostContext(ObjectHostID(1), ios, mainStrand, gTrace, start_time, duration);
ObjectFactory* obj_factory = new ObjectFactory(ctx, region, duration);
// Nothing actually runs here -- we only cared about getting the
// object factory setup so it could dump the object pack data.
gTrace->prepareShutdown();
delete obj_factory;
delete ctx;
gTrace->shutdown();
delete gTrace;
gTrace = NULL;
delete mainStrand;
Network::IOServiceFactory::destroyIOService(ios);
return 0;
}