示例#1
0
文件: TiRoot.cpp 项目: cty41/Titan
//-------------------------------------------------------------------------------//
Root::Root(const String& configName, const String& logName)
    :mWindow(0), mLogMgr(0), mActiveRenderer(0),
     mConfigFileName(configName), mSceneMgrSelector(0), mFileSystemMgr(0),
     mResourceGroupMgr(0), mFontMgr(0)
{
    mTimer = TITAN_NEW Timer();

    mLogMgr = TITAN_NEW LogMgr(logName, false);

    mSceneMgrSelector = TITAN_NEW SceneMgrSelector();
    mSceneMgrSelector->addFactory(TITAN_NEW QuadtreeSceneMgrFactory());

    addSceneObjectFactory(TITAN_NEW ManualObjectFactory());


#if TITAN_USE_NEW_D11_RENDERER

#ifdef _DEBUG
    loadPlugin("Plugin_D3D11Renderer_d.dll");
#else
    loadPlugin("Plugin_D3D11Renderer.dll");
#endif
#else
#ifdef _DEBUG
    loadPlugin("Plugin_D3D9Renderer_d.dll");
#else
    loadPlugin("Plugin_D3D9Renderer.dll");
#endif

#endif
    mActiveRenderer = mRendererVector[0];

    mFileSystemMgr = TITAN_NEW FileSystemManager();
    mFileSystemMgr->addFileSystemFactory(TITAN_NEW CommonFileSystemFactory());

    mResourceGroupMgr = TITAN_NEW ResourceGroupMgr();

    mScriptCompilerMgr = TITAN_NEW ScriptCompilerMgr();

    mMaterialMgr = TITAN_NEW MaterialMgr();

    mOverlayMgr = TITAN_NEW OverlayMgr();

    mFontMgr = TITAN_NEW FontMgr();

}
示例#2
0
void
StationsPluginManager::loadPlugins()
{
  factories.clear();

  foreach (QObject *plugin, QPluginLoader::staticInstances()) {
    loadPlugin(plugin);
  }
示例#3
0
bool PluginLoader::loadPlugins(QString dir)
{

  QDir pluginsdir(dir);
  QStringList pluginss=pluginsdir.entryList(QStringList() << QString("*.so"));
  qDebug()<<"Loading Plugins in dir"<<pluginsdir.absolutePath();
  foreach(QString plugin , pluginss){
    loadPlugin(pluginsdir.absoluteFilePath(plugin));
  }
/*!

 */
NmDataPluginInterface *NmApiDataPluginFactory::interfaceInstance()
{
    NM_FUNCTION;
    
    if (!mPlugin) {
        mPlugin = loadPlugin();
    }
    return qobject_cast<NmDataPluginInterface*> (mPlugin);
}
QObject *NmApiDataPluginFactory::plugin()
{
    NM_FUNCTION;
    
    if (!mPlugin) {
        mPlugin = loadPlugin();
    }
    return mPlugin;
}
void KateConfigPluginPage::stateChange(KatePluginListItem *item, bool b)
{
  if(b)
    loadPlugin(item);
  else
    unloadPlugin(item);

  emit changed();
}
示例#7
0
文件: main.c 项目: Trinitek/DLLTest
int loadPlugins(int pluginCount, PLUGINDLL** plugins) {
    for (pluginCount--; pluginCount >= 0; pluginCount--) {
        if (loadPlugin(plugins[pluginCount]) == 1) {
            plugins[pluginCount] = NULL;
        }
    }
    
    return 0;
}
示例#8
0
ViewPtr<plugin::Api> Simulation::requirePlugin(const String& name)
{
    // Load plugin
    auto api = loadPlugin(name);

    if (api)
        return api;

    throw InvalidArgumentException("Plugin '" + name + "' not found");
}
示例#9
0
std::istream& PluginManager::readFromStream(std::istream & in)
{
    while(!in.eof())
    {
        std::string pluginPath;
        in >> pluginPath;
        loadPlugin(pluginPath);
    }
    return in;
}
示例#10
0
void GLXOSD::loadAllPlugins() {
	std::istringstream ss(getEnvironment("GLXOSD_PLUGINS"));
	std::string token;
	while (std::getline(ss, token, ':')) {
		if (token.empty()) {
			continue;
		}
		loadPlugin(token);
	}
}
示例#11
0
void QtTrader::pluginLoader()
{
  QAction* pAction =  qobject_cast<QAction*>(QObject::sender());
  QString name = pAction->text();
  QSettings settings(g_settings);
  settings.beginGroup(g_session);
  settings.setValue("plugin", name);
  settings.sync();

  loadPlugin(name);
}
MainWindow::MainWindow(QWidget *parent) :
    QMainWindow(parent)
{
    setObjectName("MainWindow");

    if (!loadPlugin()||!loadLibrary()) {
        QMessageBox::information(this, "Error", "Could not load the plugin");
    }
     testButton = new QPushButton;
     pencil = customWidgetInterface->createWidget(this);
     videoEditInterface->getDockWidget()->setTitleBarWidget(new QWidget);
     videoEditInterface->getDockWidget()->setFloating(false);

     //connect(testButton,SIGNAL(clicked(bool)),this,SLOT(showMain()));
     connect(videoEditInterface->getTheDialog(),SIGNAL(saveCurrentFrameSignal(int)),pencil,SLOT(saveProject()));
     connect(pencil,SIGNAL(postURL(QString,QString)),videoEditInterface->getTheDialog(),SLOT(loadCurrentFrame(QString,QString)));
     connect(videoEditInterface->getTheDialog(),SIGNAL(openThisPicture(QString,int)),pencil,SLOT(reopenProject(QString)));
     ((QMainWindow*)pencil)->addDockWidget(Qt::BottomDockWidgetArea,videoEditInterface->getDockWidget());




//     m_leftToolBar = loadUIPlugin();
//     if(m_leftToolBar != NULL){
//         m_leftToolBar->install((QMainWindow*)pencil);
//         connect(m_leftToolBar->getSignalBox(),
//                          SIGNAL(whichToolsBoardBtnWasClicked(int)),
//                          pencil, SLOT(whatToolOpen(int)));
//         connect(m_leftToolBar->getSignalBox(), SIGNAL(colorChanged(QColor)),
//                          pencil, SLOT(UIsetColor(QColor)));
//         connect(m_leftToolBar->getSignalBox(),
//                          SIGNAL(materialImagePathChanged(QString)),
//                          pencil, SLOT(importMaterial(QString)));
//     }
//     sliderWidthValue(int newWidth);
//    sliderFeatherValue(int newFeather);
     m_leftToolBar = loadUIPlugin<LeftToolBarInterface *>();
     if(m_leftToolBar != NULL){
         m_leftToolBar->install((QMainWindow*)pencil);
         QObject::connect(m_leftToolBar->getSignalBox(),
                          SIGNAL(whichToolsBoardBtnWasClicked(int)),
                          pencil, SLOT(whatToolOpen(int)));
         QObject::connect(m_leftToolBar->getSignalBox(),
                          SIGNAL(penWidthChanged(int)),
                          pencil, SLOT(sliderWidthValue(int)));
         QObject::connect(m_leftToolBar->getSignalBox(),
                          SIGNAL(penFeatherChanged(int)),
                          pencil, SLOT(sliderFeatherValue(int)));
         QObject::connect(m_leftToolBar->getSignalBox(), SIGNAL(colorChanged(QColor)),
                          pencil, SLOT(UIsetColor(QColor)));
         QObject::connect(m_leftToolBar->getSignalBox(),
                          SIGNAL(materialImagePathChanged(QString)),
                          pencil, SLOT(importMaterial(QString)));
     }
示例#13
0
void KWMailMergeDataBase::load( const QDomElement& parentElem )
{
    QDomNode dn=parentElem.namedItem("PLUGIN");
    if (dn.isNull()) return;
    QDomElement el=dn.toElement();
    plugin=loadPlugin(el.attribute("library"));

    dn=parentElem.namedItem("DATASOURCE");
    if (dn.isNull()) return;
    el=dn.toElement();
    if (plugin) plugin->load(el);
}
示例#14
0
bool PluginsManager::loadPlugins(const TCHAR *dir)
{
	if (_isDisabled)
		return false;

	vector<generic_string> dllNames;
	vector<generic_string> dll2Remove;
	NppParameters * nppParams = NppParameters::getInstance();
    generic_string nppPath = nppParams->getNppPath();
	generic_string pluginsFullPathFilter = (dir && dir[0])?dir:nppPath;

	pluginsFullPathFilter += TEXT("\\plugins\\*.dll");

	WIN32_FIND_DATA foundData;
	HANDLE hFindFile = ::FindFirstFile(pluginsFullPathFilter.c_str(), &foundData);
	if (hFindFile != INVALID_HANDLE_VALUE)
	{
		generic_string plugins1stFullPath = (dir && dir[0])?dir:nppPath;
		plugins1stFullPath += TEXT("\\plugins\\");
		plugins1stFullPath += foundData.cFileName;
		dllNames.push_back(plugins1stFullPath);

		while (::FindNextFile(hFindFile, &foundData))
		{
            bool isInBlackList = nppParams->isInBlackList(foundData.cFileName);
            if (!isInBlackList)
            {
			    generic_string fullPath = (dir && dir[0])?dir:nppPath;
			    fullPath += TEXT("\\plugins\\");

			    fullPath += foundData.cFileName;
			    dllNames.push_back(fullPath);
            }
            PluginList & pl = nppParams->getPluginList();
            pl.add(foundData.cFileName, isInBlackList);
		}
		::FindClose(hFindFile);

		size_t i = 0;

		for ( ; i < dllNames.size() ; i++)
		{
            loadPlugin(dllNames[i].c_str(),  dll2Remove);
		}
        
	}

	for (size_t j = 0 ; j < dll2Remove.size() ; j++)
		::DeleteFile(dll2Remove[j].c_str());

	return true;
}
示例#15
0
// }}}
// {{{ Flow helper
void XzeroDaemon::import(const std::string& name, const std::string& path)
{
    std::string filename = path;
    if (!filename.empty() && filename[filename.size() - 1] != '/')
        filename += "/";
    filename += name;

    std::error_code ec;
    loadPlugin(filename, ec);

    if (ec)
        log(Severity::error, "Error loading plugin: %s: %s", filename.c_str(), ec.message().c_str());
}
示例#16
0
bool KDecorationPlugins::reset( unsigned long changed )
    {
    QString oldPlugin = pluginStr;
    config->reparseConfiguration();
    bool ret = false;
    if(( !loadPlugin( "" ) && library ) // "" = read the one in cfg file
        || oldPlugin == pluginStr )
        { // no new plugin loaded, reset the old one
        assert( fact != NULL );
        ret = fact->reset( changed );
        }
    return ret || oldPlugin != pluginStr;
    }
示例#17
0
文件: core.c 项目: berylline/compiz
CompBool initCore(void)
{
    CompPlugin *corePlugin;

    compObjectInit(&core.base, 0, COMP_OBJECT_TYPE_CORE);

    core.displays = NULL;

    core.tmpRegion = XCreateRegion();
    if(!core.tmpRegion)
    {
		return FALSE;
    }

    core.outputRegion = XCreateRegion();
    if(!core.outputRegion)
    {
		XDestroyRegion(core.tmpRegion);
		return FALSE;
    }

    core.fileWatch	     = NULL;
    core.lastFileWatchHandle = 1;

    core.timeouts	   = NULL;
    core.lastTimeoutHandle = 1;

    core.watchFds	   = NULL;
    core.lastWatchFdHandle = 1;
    core.watchPollFds	   = NULL;
    core.nWatchFds	   = 0;

    gettimeofday(&core.lastTimeout, 0);

    setCoreProcs();

    corePlugin = loadPlugin("core");
    if(!corePlugin)
    {
		compLogMessage("core", CompLogLevelFatal, "Couldn't load core plugin");
		return FALSE;
    }

    if(!pushPlugin(corePlugin))
    {
		compLogMessage("core", CompLogLevelFatal, "Couldn't activate core plugin");
		return FALSE;
    }

    return TRUE;
}
示例#18
0
void BattleServer::newConnection()
{
    GenericSocket newconnection = server->nextPendingConnection();

    if (!newconnection)
        return;

    int id = freeid();
#ifndef BOOST_SOCKETS
    QString ip = newconnection->peerAddress().toString();
#else
    QString ip = newconnection->ip();
#endif

    print(QString("Received new connection on slot %1 from %2").arg(id).arg(ip));
    ServerConnection *conn = connections[id] = new ServerConnection(newconnection, id);

    connect(conn, SIGNAL(newBattle(int,int,BattlePlayer,BattlePlayer,ChallengeInfo,TeamBattle,TeamBattle)), SLOT(newBattle(int,int,BattlePlayer,BattlePlayer,ChallengeInfo,TeamBattle,TeamBattle)));
    connect(conn, SIGNAL(error(int)), SLOT(onError(int)));
    connect(conn, SIGNAL(modChanged(QString)), SLOT(modChanged(QString)));
    connect(conn, SIGNAL(loadPlugin(QString)), SLOT(loadPlugin(QString)));
    connect(conn, SIGNAL(unloadPlugin(QString)), SLOT(unloadPlugin(QString)));
}
示例#19
0
void HTMLPlugInElement::createPluginWithoutRenderer()
{
    ASSERT(document().frame()->loader().client()->canCreatePluginWithoutRenderer(m_serviceType));

    KURL url;
    Vector<String> paramNames;
    Vector<String> paramValues;

    paramNames.append("type");
    paramValues.append(m_serviceType);

    bool useFallback = false;
    loadPlugin(url, m_serviceType, paramNames, paramValues, useFallback, false);
}
示例#20
0
	void Framework::loadXmlPlugin(const std::string &fileName)
	{
	#ifdef _WINDOWS
		hinstXml = LoadLibraryA(fileName.c_str());
		assert(hinstXml != NULL);

		xmlFunction loadPlugin;
		loadPlugin = (xmlFunction)GetProcAddress(hinstXml, "loadPlugin");
		assert(loadPlugin != NULL);

		mXmlManager = loadPlugin();
		assert(mXmlManager != 0);
	#endif
	}
示例#21
0
文件: glwidget.cpp 项目: EikaNN/FIB-G
void GLWidget::keyPressEvent(QKeyEvent *e)
{
    //cout << "keyPressEvent" << endl;
    switch( e->key() ) 
    {	    
    case Qt::Key_A: 
        loadPlugin();
        updateGL();
        break;

    case Qt::Key_D:
        showPlugins();
	    break;

    case Qt::Key_U:
        resetPluginsToDefaults();
	    updateGL();
	break;

    case Qt::Key_L: 
        addObject();
        break;        
        
    case Qt::Key_F: 
        glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
        updateGL();
        break;

    case Qt::Key_S: 
        glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
        updateGL();
        break;

    case Qt::Key_H:
        help();
        break;

    case Qt::Key_Escape: 
        exit(0);
        break;
        
    default: 
        e->ignore(); // el propaguem cap al pare...
    }
    
    for (unsigned int i=0; i<plugins.size(); ++i) 
        qobject_cast<BasicPlugin*>(plugins[i]->instance())->keyPressEvent(e);

    //cout << "endkeyPressEvent" << endl;
}
示例#22
0
void
SeExprFunc::loadPlugins(const char* path)
{
#ifdef SEEXPR_WIN32

#else
    // first split path into individual entries
    char* pathdup = strdup(path);
    char* state = 0;
    char* entry = strtok_r(pathdup, ":", &state);
    while (entry) {
	// if entry ends with ".so", load directly
	if ((!strcmp(entry+strlen(entry)-3, ".so")))
	    loadPlugin(entry);
	else {
	    // assume it's a dir - search it for plugins
	    struct dirent** matches = 0;
	    int numMatches = scandir(entry, &matches, MatchPluginName, alphasort);
	    for (int i = 0; i < numMatches; i++) {
		std::string fullpath = entry; fullpath += "/"; 
		fullpath += matches[i]->d_name;
		loadPlugin(fullpath.c_str());
			free(matches[i]);
	    }
	    if (matches) free(matches);
	    else {
		std::cerr << "No plugins found matching "
			  << path << "/SeExpr*.so" << std::endl;
	    }
	}

	entry = strtok_r(0, ":", &state);
    }
    free(pathdup);
#endif
}
示例#23
0
	void Framework::loadAudioPlugin(const std::string &fileName)
	{
	#ifdef _WINDOWS
		hinstAudio = LoadLibraryA(fileName.c_str());
		assert(hinstAudio != NULL);

		audioFunction loadPlugin;
		loadPlugin = (audioFunction)GetProcAddress(hinstAudio, "loadPlugin");
		assert(loadPlugin != NULL);

		mAudioManager = loadPlugin();
		assert(mAudioManager != 0);
		mAudioManager->initialize(this);
	#endif
	}
示例#24
0
	void Framework::loadEntityPlugin(const std::string &fileName)
	{
	#ifdef _WINDOWS
		hinstEntity = LoadLibraryA(fileName.c_str());
		assert(hinstEntity != NULL);

		entityFunction loadPlugin;
		loadPlugin = (entityFunction)GetProcAddress(hinstEntity, "loadPlugin");
		assert(loadPlugin != NULL);

		mEntityManager = loadPlugin();
		assert(mEntityManager != 0);
		mEntityManager->initialize(this);
	#endif
	}
void init3Ddriver(uintf screenwidth, uintf screenheight, uintf screenbpp)
{
#ifndef STATICDRIVERS
	if (!videoDriverPlugin)
	videoDriverPlugin   = loadPlugin(viddrvfilename);
	vd_init3D			= (void *(*)(void *,uintf, uintf, uintf, uintf))videoDriverPlugin->initPlugin;
#endif

	clear2Dfuncs((void (*)(void))invalid3DFunc);
	void *x = vd_init3D((void *)classfinder,screenwidth,screenheight,5000,screenbpp);	// If this is NULL, the current video driver isn't compatible with this machine		// ### Need to pass in depth instead of using 5000!
	video_interface = (void (*)(const char *,void *))x;							// Woohoo!  Check it out!
	for (uintf i=0; i<num3Dvidfuncs; i++)
	{	video_interface(vid3Dfunc[i].stringname, vid3Dfunc[i].functionadr);
	}
}
示例#26
0
	void Framework::loadPhysicsPlugin(const std::string &fileName)
	{
	#ifdef _WINDOWS
		hinstPhysics = LoadLibraryA(fileName.c_str());
		assert(hinstPhysics != NULL);

		physicsFunction loadPlugin;
		loadPlugin = (physicsFunction)GetProcAddress(hinstPhysics, "loadPlugin");
		assert(loadPlugin != NULL);

		mPhysicsManager = loadPlugin();
		assert(mPhysicsManager != 0);
		mPhysicsManager->initialize(this);
	#endif
	}
示例#27
0
/// Loads all plugins from \p directory.
void PluginManager::loadPlugins(const std::string &directory)
{
    boost::filesystem::path dir(directory);

    if(!boost::filesystem::exists(dir)){
        return;
    }

    for(boost::filesystem::directory_iterator iter(dir); iter != boost::filesystem::directory_iterator(); ++iter){
        std::string fileName = boost::filesystem::path(iter->path().filename()).string();

        if(DynamicLibrary::isLibrary(fileName)){
            loadPlugin(iter->path().string());
        }
    }
}
示例#28
0
void initPlugins ( void )
{
	customPluginMap.clear();

	OSDir	dir;
	std::string path = getAutoLoadDir();
	if (getAutoLoadDir().size())
	{
		dir.setOSDir(getAutoLoadDir());

		OSFile file;
		std::string searchdir = "*" + extension;
		while(dir.getNextFile(file,searchdir.c_str(),false) )
			loadPlugin(file.getOSName(),std::string(""));
	}
}
示例#29
0
void PanelPluginsModel::addPlugin(const LXQt::PluginInfo &desktopFile)
{
    if (dynamic_cast<LXQtPanelApplication const *>(qApp)->isPluginSingletonAndRunnig(desktopFile.id()))
        return;

    QString name = findNewPluginSettingsGroup(desktopFile.id());

    QPointer<Plugin> plugin = loadPlugin(desktopFile, name);
    if (plugin.isNull())
        return;

    beginInsertRows(QModelIndex(), mPlugins.size(), mPlugins.size());
    mPlugins.append({name, plugin});
    endInsertRows();
    mPanel->settings()->setValue(mNamesKey, pluginNames());
    emit pluginAdded(plugin.data());
}
示例#30
0
//--------------------------------------
QList<StreamingServicePlugin> loadPlugins() {
  QList<StreamingServicePlugin> plugins;
  foreach (const QString &path, getSearchPaths()) {
    qInfo() << "Looking for plugins in " << path;
    foreach (const QFileInfo &directory,
             QDir(path).entryInfoList(QDir::Dirs | QDir::NoDotAndDotDot)) {
      if (checkPluginDirectory(directory.absoluteFilePath())) {
        StreamingServicePlugin plugin =
            loadPlugin(directory.absoluteFilePath());
        if (plugin.isValid() && !plugins.contains(plugin)) {
          qInfo() << plugin.Name << "plugin successfully loaded (from "
                  << directory.absoluteFilePath() << ")";
          plugins.append(plugin);
        }
      }
    }
  }