Developer Documentation
PluginLoader.cc
1 /*===========================================================================*\
2 * *
3 * OpenFlipper *
4  * Copyright (c) 2001-2015, RWTH-Aachen University *
5  * Department of Computer Graphics and Multimedia *
6  * All rights reserved. *
7  * www.openflipper.org *
8  * *
9  *---------------------------------------------------------------------------*
10  * This file is part of OpenFlipper. *
11  *---------------------------------------------------------------------------*
12  * *
13  * Redistribution and use in source and binary forms, with or without *
14  * modification, are permitted provided that the following conditions *
15  * are met: *
16  * *
17  * 1. Redistributions of source code must retain the above copyright notice, *
18  * this list of conditions and the following disclaimer. *
19  * *
20  * 2. Redistributions in binary form must reproduce the above copyright *
21  * notice, this list of conditions and the following disclaimer in the *
22  * documentation and/or other materials provided with the distribution. *
23  * *
24  * 3. Neither the name of the copyright holder nor the names of its *
25  * contributors may be used to endorse or promote products derived from *
26  * this software without specific prior written permission. *
27  * *
28  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS *
29  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED *
30  * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A *
31  * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER *
32  * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, *
33  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, *
34  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR *
35  * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF *
36  * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING *
37  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS *
38  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *
39 * *
40 \*===========================================================================*/
41 
42 /*===========================================================================*\
43 * *
44 * $Revision$ *
45 * $LastChangedBy$ *
46 * $Date$ *
47 * *
48 \*===========================================================================*/
49 
50 
51 
52 
53 //=============================================================================
54 //
55 // CLASS Core - IMPLEMENTATION of the Plugin Loading
56 //
57 //=============================================================================
58 
59 
60 //== INCLUDES =================================================================
61 
62 // -------------------- mview
63 #include "Core.hh"
64 
65 #if QT_VERSION >= 0x050000
66 #endif
67 
76 #include "OpenFlipper/BasePlugin/TextureInterface.hh"
80 #include "OpenFlipper/BasePlugin/INIInterface.hh"
86 
87 
88 #include <ACG/QtWidgets/QtFileDialog.hh>
89 #include "OpenFlipper/widgets/PluginDialog/PluginDialog.hh"
90 
95 static const int PRELOAD_THREADS_COUNT = (QThread::idealThreadCount() != -1) ? QThread::idealThreadCount() : 8;
96 
97 namespace cmake { extern const char *static_plugins; };
98 
100  public:
101  PreloadAggregator() : expectedLoaders_(0) {}
102 
112  void expectLoaders(int count) {
113  QMutexLocker loadersLock(&loadersMutex_);
114  expectedLoaders_ += count;
115  }
116 
123  void loaderReady(QPluginLoader *loader) {
124  QMutexLocker loadersLock(&loadersMutex_);
125  loaders_.push_back(loader);
126  --expectedLoaders_;
127  pluginAvailable_.wakeOne();
128  }
129 
141  QPluginLoader *waitForNextLoader() {
142  QMutexLocker loadersLock(&loadersMutex_);
143  if (loaders_.empty()) {
144  if (expectedLoaders_ > 0) {
145  pluginAvailable_.wait(&loadersMutex_);
146  } else {
147  return 0;
148  }
149  }
150 
151  /*
152  * At this point, it is guaranteed that
153  * loaders_.size() > 0.
154  */
155  QPluginLoader *result = loaders_.front();
156  loaders_.pop_front();
157  return result;
158  }
159 
160  protected:
161  std::deque<QPluginLoader *> loaders_;
162  QWaitCondition pluginAvailable_;
163  QMutex loadersMutex_;
164 
165  int expectedLoaders_;
166 };
167 
168 class PreloadThread : public QThread
169 {
170  public:
171 
178  PreloadThread(PreloadAggregator *aggregator) : aggregator_(aggregator) {
179  }
180 
181  public:
182 
183  void addFilename(const QString &filename) {
184  QMutexLocker filenamesLock(&filenamesMutex_);
185  filenames_.push_back(filename);
186  aggregator_->expectLoaders(1);
187  }
188 
193  void run() {
194  for (;;) {
195  QString fileName;
196  {
197  /*
198  * Just to be on the safe side, we protect
199  * filenames_. (addFilename() could be called from
200  * a different thread.)
201  */
202  QMutexLocker filenamesLock(&filenamesMutex_);
203  if (filenames_.empty()) break;
204  fileName = filenames_.front();
205  filenames_.pop_front();
206  }
207 
208  QPluginLoader *loader = new QPluginLoader;
209  loader->setFileName(fileName);
210  loader->load();
211  aggregator_->loaderReady(loader);
212  }
213  }
214 
215  private:
216  std::deque<QString> filenames_;
217  QMutex filenamesMutex_;
218  PreloadAggregator *aggregator_;
219 };
220 
230  public:
231  size_t getTypeOrdinal(const QString &name) const {
232  const QString basename = QFileInfo(name).baseName();
233  if (basename.contains("Plugin-Type"))
234  return 0;
235  else if (basename.contains("Plugin-File"))
236  return 1;
237  else if (basename.contains("TextureControl"))
238  return 2;
239  else
240  return 3;
241 
242  }
243  bool operator() (const QString &a, const QString &b) const {
244  const size_t typeA = getTypeOrdinal(a);
245  const size_t typeB = getTypeOrdinal(b);
246  if (typeA != typeB) { return typeA < typeB; }
247  return a < b;
248  }
249 
250  bool operator() (const QPluginLoader *a, const QPluginLoader *b) const {
251  return operator() (a->fileName(), b->fileName());
252  }
253 };
254 
255 //== IMPLEMENTATION ==========================================================
256 
257 
258 bool Core::checkSlot(QObject* _plugin , const char* _slotSignature) {
259  const QMetaObject* meta = _plugin->metaObject();
260  int id = meta->indexOfSlot( QMetaObject::normalizedSignature( _slotSignature ) );
261  return ( id != -1 );
262 }
263 
264 bool Core::checkSignal(QObject* _plugin , const char* _signalSignature) {
265  const QMetaObject* meta = _plugin->metaObject();
266  int id = meta->indexOfSignal( QMetaObject::normalizedSignature( _signalSignature ) );
267  return ( id != -1 );
268 }
269 
273 {
274 
275  //regsiter custom datatypes for signal/slots
276  registerTypes();
277 
278  QString licenseTexts = "";
279 
280  //try to load plugins from new location
281  QDir tempDir = QDir(OpenFlipper::Options::pluginDir());
282 
283  // Possible Plugin extensions
284  // Windows gets DLLs
285  // Mac and Linux use so
286  // We don't use the dylib extension on Mac at the moment.
287  QStringList filter;
288  if ( OpenFlipper::Options::isWindows() )
289  filter << "*.dll";
290  else
291  filter << "*.so";
292 
293  // Get all files in the Plugin dir
294  QStringList pluginlist = tempDir.entryList(filter,QDir::Files);
295 
296  // Convert local file path to absolute path
297  for (int i=0; i < pluginlist.size(); i++) {
298  pluginlist[i] = tempDir.absoluteFilePath(pluginlist[i]);
299  }
300 
301  // get all Plugin Names which will not be loaded
302  QStringList dontLoadPlugins = OpenFlipperSettings().value("PluginControl/DontLoadNames", QStringList()).toStringList();
303 
304  // Output info about additional plugins
305  for ( int i = 0 ; i < dontLoadPlugins.size(); ++i)
306  emit log(LOGOUT,tr("dontLoadPlugins Plugin from ini file: %1").arg( dontLoadPlugins[i] ) );
307 
308  // get all Plugins which should be loaded in addition to the standard plugins
309  QStringList additionalPlugins = OpenFlipperSettings().value("PluginControl/AdditionalPlugins", QStringList()).toStringList();
310 
311  // Output info about additional plugins
312  for ( int i = 0 ; i < additionalPlugins.size(); ++i) {
313  emit log(LOGOUT,tr("Additional Plugin from file: %1").arg( additionalPlugins[i] ) );
314  }
315 
316  // Prepend the additional Plugins to the plugin list
317  pluginlist = additionalPlugins << pluginlist;
318 
319 #if QT_VERSION >= 0x050000
320  /*
321  * Remove static plugins from dynamically loaded list.
322  */
323  {
324  QSet<QString> staticPlugins = QSet<QString>::fromList(
325  QString::fromUtf8(cmake::static_plugins).split("\n"));
326  for (int i = 0; i < pluginlist.size(); ) {
327  const QString bn = QFileInfo(pluginlist[i]).fileName();
328  if (staticPlugins.contains(bn)) {
329  emit log(LOGOUT, trUtf8("Not loading dynamic %1 as it is statically "
330  "linked against OpenFlipper.").arg(bn));
331  pluginlist.removeAt(i);
332  } else {
333  ++i;
334  }
335  }
336  }
337 #endif
338 
339  /*
340  * Note: This call is not necessary, anymore. Initialization order
341  * is determined later.
342  */
343  //std::sort(pluginlist.begin(), pluginlist.end(), PluginInitializationOrder());
344 
345  for ( int i = 0 ; i < dontLoadPlugins.size(); ++i )
346  emit log(LOGWARN,tr("Skipping Plugins :\t %1").arg( dontLoadPlugins[i] ) );
347 
348  emit log(LOGOUT,"================================================================================");
349 
350  QTime time;
351 
352  time.start();
353 
354  PreloadAggregator preloadAggregator;
355  std::vector< PreloadThread* > loaderThreads(PRELOAD_THREADS_COUNT);
356 
357  /*
358  * Initialize loaderThreads.
359  */
360  for (std::vector< PreloadThread* >::iterator it = loaderThreads.begin();
361  it != loaderThreads.end(); ++it) {
362  *it = new PreloadThread(&preloadAggregator);
363  }
364 
365  /*
366  * Distribute plugins onto loader threads in a round robin fashion.
367  * (only load them in seperate thread. Instance will be created in main thread)
368  */
369  for ( int i = 0 ; i < pluginlist.size() ; ++i) {
370  loaderThreads[i % loaderThreads.size()]->addFilename(pluginlist[i]);
371  }
372 
373  /*
374  * Start plugin preloading.
375  */
376  for (std::vector< PreloadThread* >::iterator it = loaderThreads.begin();
377  it != loaderThreads.end(); ++it) {
378  (*it)->start();
379  }
380 
381  /*
382  * Wait for the plugins to get preloaded
383  */
384  std::vector<QPluginLoader*> loadedPlugins;
385  loadedPlugins.reserve(pluginlist.size());
386 
387  for (QPluginLoader *loader = preloadAggregator.waitForNextLoader(); loader != 0;
388  loader = preloadAggregator.waitForNextLoader()) {
389 
390  loadedPlugins.push_back(loader);
391 
392  if ( OpenFlipper::Options::gui() && OpenFlipperSettings().value("Core/Gui/splash",true).toBool() ) {
393  splashMessage_ = tr("Loading Plugin %1/%2").arg(loadedPlugins.size()).arg(pluginlist.size()) ;
394  splash_->showMessage( splashMessage_ , Qt::AlignBottom | Qt::AlignLeft , Qt::white);
395  }
396  }
397 
398  /*
399  * Finalize PreloadThreads.
400  */
401  for (std::vector< PreloadThread* >::iterator it = loaderThreads.begin();
402  it != loaderThreads.end(); ++it) {
403  (*it)->wait();
404  delete *it;
405  }
406 
407  /*
408  * Initialize preloaded plugins in the correct order.
409  */
410  std::sort(loadedPlugins.begin(), loadedPlugins.end(), PluginInitializationOrder());
411  for (std::vector<QPluginLoader*>::iterator it = loadedPlugins.begin();
412  it != loadedPlugins.end(); ++it) {
413 
414  if ( OpenFlipper::Options::gui() && OpenFlipperSettings().value("Core/Gui/splash",true).toBool() ) {
415  splashMessage_ = tr("Initializing Plugin %1/%2")
416  .arg(std::distance(loadedPlugins.begin(), it) + 1)
417  .arg(loadedPlugins.size());
418  splash_->showMessage( splashMessage_ , Qt::AlignBottom | Qt::AlignLeft , Qt::white);
419  }
420 
421  if ((*it)->instance() != 0 ) {
422  QString pluginLicenseText = "";
423  loadPlugin((*it)->fileName(),true,pluginLicenseText, (*it)->instance());
424  licenseTexts += pluginLicenseText;
425  } else {
426  emit log(LOGERR,tr("Unable to load Plugin :\t %1").arg( (*it)->fileName() ) );
427  emit log(LOGERR,tr("Error was : ") + (*it)->errorString() );
428  emit log(LOGOUT,"================================================================================");
429  }
430  delete *it;
431  }
432 
433 #if QT_VERSION >= 0x050000
434  /*
435  * Initialize static plugins.
436  */
437  QVector<QStaticPlugin> staticPlugins = QPluginLoader::staticPlugins();
438  for (QVector<QStaticPlugin>::iterator it = staticPlugins.begin();
439  it != staticPlugins.end(); ++it) {
440  QObject *instance = it->instance();
441  BaseInterface* basePlugin = qobject_cast< BaseInterface * >(instance);
442  if (basePlugin) {
443  QString fakeName = QString::fromUtf8("<Statically Linked>::/%1.%2")
444  .arg(basePlugin->name())
445  .arg(OpenFlipper::Options::isWindows() ? "dll" : "so");
446  QString pluginLicenseText = "";
447  loadPlugin(fakeName, true, pluginLicenseText, instance);
448  licenseTexts += pluginLicenseText;
449  }
450  }
451 #endif
452 
453  emit log(LOGINFO, tr("Total time needed to load plugins was %1 ms.").arg(time.elapsed()));
454 
455  splashMessage_ = "";
456 
457  if ( licenseTexts != "" ) {
458  if ( OpenFlipper::Options::gui() ) {
459 
460  // split for each license block
461  QStringList licenseBlocks = licenseTexts.split("==");
462 
463  // Cleanup lists to get only the ones containing valid plugins.
464  for ( QStringList::iterator it = licenseBlocks.begin(); it != licenseBlocks.end() ; ++it )
465  if ( ! it->contains("PluginName") ) {
466  licenseBlocks.erase(it);
467  it = licenseBlocks.begin();
468  }
469 
470  // sort by the contact mails
471  QMap< QString , QString > contacts;
472 
473  for ( QStringList::iterator it = licenseBlocks.begin(); it != licenseBlocks.end() ; ++it ) {
474  QStringList lines = it->split("\n");
475 
476  lines = lines.filter ( "Contact mail", Qt::CaseInsensitive );
477 
478  // Corect one found:
479  if (lines.size() == 1) {
480  QString mail = lines[0].section(":",-1).simplified();
481  QString list = contacts.take(mail);
482  list.append(*it);
483  contacts.insert(mail,list);
484  } else {
485  emit log(LOGWARN,tr("Can't extract mail contact from license request"));
486  }
487 
488  }
489 
490  for ( QMap<QString , QString>::iterator it = contacts.begin() ; it != contacts.end() ; ++it ) {
491 
492  QStringList request = it.value().split("\n");
493 
494  // Cleanup lists to get only the relevant part
495  for ( QStringList::iterator lit = request.begin(); lit != request.end() ; ++lit ) {
496 
497  if ( lit->contains("Message:") ) {
498  *lit = lit->section(":",-1).simplified();
499  }
500 
501  if ( lit->contains("Contact mail:") ) {
502  *lit = lit->section(":",-1).simplified();
503  }
504 
505  }
506 
507  QDialog licenseBox;
508 
509  QTextEdit *edit = new QTextEdit(&licenseBox);
510  edit->setText(request.join("\n"));
511 
512  QLabel* mailLabel = new QLabel(&licenseBox);
513  mailLabel->setText(tr("The text has been copied to your clipboard. Open in Mail program?"));
514 
515  QPushButton* noButton = new QPushButton(&licenseBox);
516  noButton->setText(tr("No"));
517  connect( noButton, SIGNAL(clicked ()), &licenseBox, SLOT(reject()) );
518 
519  QPushButton* yesButton = new QPushButton(&licenseBox);
520  yesButton->setText(tr("Yes"));
521  connect( yesButton, SIGNAL(clicked ()), &licenseBox, SLOT(accept()) );
522 
523  QGridLayout *layout = new QGridLayout;
524  layout->addWidget(edit,0,0,1,2);
525  layout->addWidget(mailLabel,1,0,1,2);
526  layout->addWidget(noButton,2,0);
527  layout->addWidget(yesButton,2,1);
528  licenseBox.setLayout(layout);
529 
530  licenseBox.resize(500,500);
531  licenseBox.setModal(true);
532  licenseBox.setWindowTitle(tr("Plugin License check failed, issuer is: %1").arg( it.key() ));
533  int userAnswer =licenseBox.exec();
534 
535  // set a text to the Clipboard
536  QClipboard *cb = QApplication::clipboard();
537  cb->setText(request.join("\n"));
538 
539  if ( userAnswer == 1 ) {
540  QString url = "mailto:" + it.key();
541  url += "?subject=License Request&body=";
542 #ifdef WIN32
543  url += request.join(";;");
544 #else
545  url += request.join("\n");
546 #endif
547 
548  QUrl encodedURL(url, QUrl::TolerantMode);
549  QDesktopServices::openUrl(encodedURL);
550  }
551 
552  }
553 
554 
555  } else {
556  emit log(LOGWARN,tr("Plugin License check failed: "));
557  std::cerr << licenseTexts.toStdString() << std::endl;
558  }
559  }
560 
561  emit pluginsInitialized();
562 
563  emit log(LOGOUT,tr("Loaded %n Plugin(s)","",int(plugins_.size())) );
564 }
565 
569 
570  if ( OpenFlipper::Options::nogui() )
571  return;
572 
573  // Setup filters for possible plugin extensions
574  // Windows gets DLLs
575  // Mac and Linux use so
576  // We don't use the dylib extension on Mac at the moment.
577  QString filter;
578  if ( OpenFlipper::Options::isWindows() )
579  filter = "Plugins (*.dll)";
580  else
581  filter = "Plugins (*.so)";
582 
583  // Ask the user to select the file to load
584  QString filename = ACG::getOpenFileName(coreWidget_,tr("Load Plugin"),filter, OpenFlipperSettings().value("Core/CurrentDir").toString() );
585 
586  if (filename.isEmpty())
587  return;
588 
589  // get the plugin name
590  // and check if Plugin is in the dontLoad List
591  QPluginLoader loader( filename );
592  QObject *plugin = loader.instance();
593  QString name;
594 
595  // Check if a plugin has been loaded
596  if (plugin) {
597  // Check if it is a BasePlugin
598  BaseInterface* basePlugin = qobject_cast< BaseInterface * >(plugin);
599  if ( basePlugin ) {
600  name = basePlugin->name();
601  }else
602  return;
603  }else
604  return;
605 
606  // Ask if the plugin is on the block list
607  QStringList dontLoadPlugins = OpenFlipperSettings().value("PluginControl/DontLoadNames", QStringList()).toStringList();
608  if (dontLoadPlugins.contains(name)){
609  int ret = QMessageBox::question(0, tr("Plugin Loading Prevention"),
610  tr("OpenFlipper is currently configured to prevent loading this plugin.\n"
611  "Do you want to enable this plugin permanently?"),
612  QMessageBox::Yes | QMessageBox::No,
613  QMessageBox::Yes);
614  if (ret == QMessageBox::Yes) {
615  dontLoadPlugins.removeAll(name);
616  OpenFlipperSettings().setValue("PluginControl/DontLoadNames",dontLoadPlugins);
617  } else
618  return;
619  }
620 
621  // check if the plugin is not on the additional plugin list
622  QStringList additionalPlugins = OpenFlipperSettings().value("PluginControl/AdditionalPlugins", QStringList()).toStringList();
623  if (!additionalPlugins.contains(name)){
624  int ret = QMessageBox::question(0, tr("Plugin Loading ..."),
625  tr("Should OpenFlipper load this plugin on next startup?"),
626  QMessageBox::Yes | QMessageBox::No,
627  QMessageBox::Yes);
628  if (ret == QMessageBox::Yes) {
629  additionalPlugins << filename;
630  std::cerr << "Added: " << filename.toStdString() << std::endl;
631  OpenFlipperSettings().setValue("PluginControl/AdditionalPlugins",additionalPlugins);
632  }
633  }
634 
635  QString licenseText = "";
636  loadPlugin(filename,false,licenseText);
637 
638  if ( licenseText != "" ) {
639  if ( OpenFlipper::Options::gui() ) {
640  QMessageBox::warning ( 0, tr("Plugin License check failed"), licenseText );
641 
642  std::cerr << "OpenURL: " << std::endl;
643  QDesktopServices::openUrl(QUrl(tr("mailto:contact@openflipper.com?subject=License Request&body=%1").arg(licenseText), QUrl::TolerantMode));
644  } else {
645  std::cerr << "Plugin License check failed" << std::endl;
646  std::cerr << licenseText.toStdString() << std::endl;
647  }
648  }
649 }
650 
654 
655  if ( OpenFlipper::Options::gui() ){
656 
657  int ret = 0;
658 
659  while (ret == 0){
660 
661  PluginDialog* dialog = new PluginDialog(plugins_, coreWidget_);
662 
663  //connect signals
664  connect(dialog, SIGNAL( loadPlugin() ), this, SLOT( slotLoadPlugin() ));
665  connect(dialog, SIGNAL(blockPlugin(const QString&)), this, SLOT(slotBlockPlugin(const QString&)));
666  connect(dialog, SIGNAL(unBlockPlugin(const QString&)), this, SLOT(slotUnBlockPlugin(const QString&)));
667  connect(dialog, SIGNAL(loadPlugin(const QString& ,const bool , QString& , QObject* )),
668  this,SLOT(loadPlugin(const QString& ,const bool , QString& , QObject* )));
669 
670  //if a plugin was deleted/loaded the dialog returns 0 and it needs to be loaded again
671  ret = dialog->exec();
672 
673  delete dialog;
674  }
675  }
676 }
677 
678 void Core::slotBlockPlugin(const QString &_name)
679 {
680  QStringList dontLoadPlugins = OpenFlipperSettings().value("PluginControl/DontLoadNames",QStringList()).toStringList();
681  if ( !dontLoadPlugins.contains(_name) ){
682  dontLoadPlugins << _name;
683  OpenFlipperSettings().setValue("PluginControl/DontLoadNames",dontLoadPlugins);
684  }
685 
686  for (size_t i = 0; i < plugins_.size();++i)
687  if (plugins_[i].name == _name)
688  plugins_[i].status = PluginInfo::BLOCKED;
689 }
690 
691 void Core::slotUnBlockPlugin(const QString &_name)
692 {
693  QStringList dontLoadPlugins = OpenFlipperSettings().value("PluginControl/DontLoadNames",QStringList()).toStringList();
694  dontLoadPlugins.removeAll(_name);
695  OpenFlipperSettings().setValue("PluginControl/DontLoadNames",dontLoadPlugins);
696 
697  for (size_t i = 0; i < plugins_.size();++i)
698  if (plugins_[i].name == _name)
699  plugins_[i].status = PluginInfo::UNLOADED;
700 }
701 
708 void Core::loadPlugin(const QString& _filename,const bool _silent, QString& _licenseErrors, QObject* _plugin){
709 
710  _licenseErrors = "";
711 
712  // Only load .dll under windows
713  if ( OpenFlipper::Options::isWindows() ) {
714  QString dllname = _filename;
715  if ( ! dllname.endsWith( ".dll" ) )
716  return;
717  }
718  // Only load .so under linux
719  if ( OpenFlipper::Options::isLinux() ) {
720  QString soname = _filename;
721  if ( ! soname.endsWith( ".so" ) )
722  return;
723  }
724 
725  // This will be the reference to our plugin
726  QObject *plugin = 0;
727 
728  // Try to open the file if we did not get a plugin,
729  // Otherwise use the supplied plugin pointer
730  if ( _plugin == 0 ) {
731  QPluginLoader loader( _filename );
732  plugin = loader.instance();
733 
734  if ( !plugin) {
735  emit log(LOGERR,tr("Unable to load Plugin :\t %1").arg( _filename ) );
736  emit log(LOGERR,tr("Error was : ") + loader.errorString() );
737  emit log(LOGOUT,"================================================================================");
738  }
739  emit log (LOGOUT,tr("Plugin loaded: \t %1").arg(_filename));
740 
741  } else {
742  plugin = _plugin;
743  }
744 
745  // Check if a plugin has been loaded
746  PluginInfo info;
747  int alreadyLoadedAt = -1;
748  for (unsigned int k=0; k < plugins_.size(); k++)
749  {
750  if (plugins_[k].path == _filename)
751  alreadyLoadedAt = static_cast<int>(k);
752  }
753  info.status = PluginInfo::FAILED;
754  info.path = _filename;
755  QString supported;
756 
757  emit log(LOGOUT,tr("Location : \t %1").arg( _filename) );
758 
759  // Check if it is a BasePlugin
760  BaseInterface* basePlugin = qobject_cast< BaseInterface * >(plugin);
761  if ( basePlugin ) {
762 
763  //set basic information about plugin
764  info.name = basePlugin->name();
765  info.rpcName = info.name.remove(" ").toLower();
766  info.description = basePlugin->description();
767 
768  QStringList additionalPlugins = OpenFlipperSettings().value("PluginControl/AdditionalPlugins", QStringList()).toStringList();
769  info.buildIn = !additionalPlugins.contains(info.path);
770 
771  emit log(LOGOUT,tr("Found Plugin : \t %1").arg(basePlugin->name()) );
772 
773  if ( OpenFlipper::Options::gui() && OpenFlipperSettings().value("Core/Gui/splash",true).toBool() ) {
774  splashMessage_ = splashMessage_ + " " + basePlugin->name() ;
775  splash_->showMessage( splashMessage_ , Qt::AlignBottom | Qt::AlignLeft , Qt::white);
776  }
777 
778  //Check if plugin is already loaded
779  for (unsigned int k=0; k < plugins_.size(); k++){
780 
781  QString name_nospace = basePlugin->name();
782  name_nospace.remove(" ");
783 
784  if (plugins_[k].name == name_nospace && plugins_[k].path != _filename && plugins_[k].status == PluginInfo::LOADED){
785  if (_silent || OpenFlipper::Options::nogui() ){ //dont load the plugin
786  emit log(LOGWARN, tr("\t\t\t Already loaded from %1").arg( plugins_[k].path) );
787  emit log(LOGOUT,"================================================================================");
788  info.description = basePlugin->description() + tr(" *Already loaded.*");
789  return;
790  }else{ //ask the user
791  int ret = QMessageBox::question(coreWidget_,
792  tr("Plugin already loaded"),
793  tr("A Plugin with the same name was already loaded from %1.\n"
794  "You can only load the new plugin if you unload the existing one first.\n\n"
795  "Do you want to unload the existing plugin first?").arg( plugins_[k].path),
796  QMessageBox::Yes|QMessageBox::No, QMessageBox::No);
797  if (ret == QMessageBox::No)
798  {
799  emit log(LOGWARN, tr("\t\t\t Already loaded from %1.").arg( plugins_[k].path));
800  emit log(LOGOUT,"================================================================================");
801  info.description = basePlugin->description() + tr(" *Already loaded.*");
802  return;
803  }
804  }
805  }
806  }
807 
808  QStringList dontLoadPlugins = OpenFlipperSettings().value("PluginControl/DontLoadNames",QStringList()).toStringList();
809 
810  if ( dontLoadPlugins.contains(basePlugin->name(), Qt::CaseInsensitive) ) {
811  emit log(LOGWARN,tr("OpenFlipper.ini prevented Plugin %1 from being loaded! ").arg( basePlugin->name() ));
812  emit log(LOGOUT,"================================================================================");
813  info.status = PluginInfo::BLOCKED;
814  return;
815  }
816 
817  //Check if it is a BasePlugin
818  SecurityInterface * securePlugin = qobject_cast< SecurityInterface * >(plugin);
819  if ( securePlugin ) {
820  emit log(LOGINFO,tr("Plugin uses security interface. Trying to authenticate against plugin ..."));
821 
822  bool success = false;
823  QMetaObject::invokeMethod(plugin,"authenticate", Q_RETURN_ARG( bool , success ) ) ;
824 
825  QString message = "";
826  QMetaObject::invokeMethod(plugin,"licenseError", Q_RETURN_ARG( QString , message ) ) ;
827  _licenseErrors = message;
828 
829  if ( success )
830  emit log(LOGINFO,tr("... ok. Loading plugin "));
831  else {
832  emit log(LOGERR,tr("... failed. Plugin access denied."));
833  emit log(LOGOUT,"================================================================================");
834  info.description = basePlugin->description() + tr(" *Plugin access denied.*");
835  // Abort here, as the plugin will not do anything else until correct authentication.
836  return;
837  }
838  }
839 
840 
841  emit log(LOGOUT,tr("Plugin Desciption :\t %1 ").arg( basePlugin->description()) );
842 
843  supported = "BaseInterface ";
844 
845  info.plugin = plugin;
846  if ( checkSlot(plugin,"version()") )
847  info.version = basePlugin->version();
848  else
849  info.version = QString::number(-1);
850 
851  if ( OpenFlipper::Options::nogui() ) {
852 
853  if ( ! checkSlot( plugin , "noguiSupported()" ) ) {
854  emit log(LOGWARN,tr("Running in nogui mode which is unsupported by this plugin, skipping") );
855  emit log(LOGOUT,"================================================================================");
856  return;
857  }
858 
859  }
860 
861 
862  // Check for baseInterface of old style!
863  if ( checkSignal(plugin,"updated_objects(int)") ) {
864  log(LOGERR,tr("Plugin Uses old style updated_objects! Convert to updatedObject!"));
865  emit log(LOGOUT,"================================================================================");
866  return;
867  }
868 
869  if ( checkSignal(plugin,"update_view()") ) {
870  log(LOGERR,tr("Plugin Uses old style update_view! Convert to updateView!"));
871  emit log(LOGOUT,"================================================================================");
872  return;
873  }
874 
875  if ( checkSignal(plugin,"updateView()") )
876  connect(plugin,SIGNAL(updateView()),this,SLOT(updateView()), Qt::AutoConnection);
877 
878  if ( checkSignal(plugin,"blockScenegraphUpdates(bool)") )
879  connect(plugin,SIGNAL(blockScenegraphUpdates(bool)),this,SLOT(blockScenegraphUpdates(bool)), Qt::QueuedConnection);
880 
881  if ( checkSignal(plugin,"updatedObject(int)") && checkSignal(plugin,"updatedObject(int,const UpdateType&)") ){
882 
883  log(LOGERR,tr("Plugin uses deprecated and(!) new updatedObject. Only new updatedObject will be active."));
884  connect(plugin,SIGNAL(updatedObject(int,const UpdateType&)),this,SLOT(slotObjectUpdated(int,const UpdateType&)), Qt::AutoConnection);
885 
886  } else {
887 
888  if ( checkSignal(plugin,"updatedObject(int)") ){
889  log(LOGWARN,tr("Plugin uses deprecated updatedObject."));
890  connect(plugin,SIGNAL(updatedObject(int)),this,SLOT(slotObjectUpdated(int)), Qt::AutoConnection);
891  }
892 
893  if ( checkSignal(plugin,"updatedObject(int,const UpdateType&)") )
894  connect(plugin,SIGNAL(updatedObject(int,const UpdateType&)),this,SLOT(slotObjectUpdated(int,const UpdateType&)), Qt::AutoConnection);
895  }
896 
897  if ( checkSlot( plugin , "slotObjectUpdated(int)" ) && checkSlot( plugin , "slotObjectUpdated(int,const UpdateType&)" ) ){
898 
899  log(LOGERR,tr("Plugin uses deprecated and(!) new slotObjectUpdated. Only new slotObjectUpdated will be active."));
900  connect(this,SIGNAL(signalObjectUpdated(int,const UpdateType&)),plugin,SLOT(slotObjectUpdated(int,const UpdateType&)), Qt::DirectConnection);
901 
902  } else {
903 
904  if ( checkSlot( plugin , "slotObjectUpdated(int)" ) ){
905  log(LOGWARN,tr("Plugin uses deprecated slotObjectUpdated."));
906  connect(this,SIGNAL(signalObjectUpdated(int)),plugin,SLOT(slotObjectUpdated(int)), Qt::DirectConnection);
907  }
908 
909  if ( checkSlot( plugin , "slotObjectUpdated(int,const UpdateType&)" ) )
910  connect(this,SIGNAL(signalObjectUpdated(int,const UpdateType&)),plugin,SLOT(slotObjectUpdated(int,const UpdateType&)), Qt::DirectConnection);
911  }
912 
913  if ( checkSignal(plugin,"objectPropertiesChanged(int)")) {
914  emit log (LOGERR,tr("Signal objectPropertiesChanged(int) is deprecated. " ));
915  emit log (LOGERR,tr("The signal will be automatically emitted by the object that has been changed and the core will deliver it to the plugins!. "));
916  emit log (LOGERR,tr("Please remove this signal from your plugins!. "));
917  }
918 
919  if ( checkSlot( plugin , "slotViewChanged()" ) )
920  connect(this,SIGNAL(pluginViewChanged()),plugin,SLOT(slotViewChanged()), Qt::DirectConnection);
921 
922  if ( checkSlot( plugin , "slotSceneDrawn()" ) )
923  connect(this,SIGNAL(pluginSceneDrawn()),plugin,SLOT(slotSceneDrawn()), Qt::DirectConnection);
924 
925  if ( checkSlot( plugin , "slotDrawModeChanged(int)" ) )
926  connect(coreWidget_,SIGNAL(drawModeChanged(int)),plugin,SLOT(slotDrawModeChanged(int)), Qt::DirectConnection);
927 
928  if ( checkSlot(plugin,"slotObjectPropertiesChanged(int)"))
929  connect(this,SIGNAL(objectPropertiesChanged(int)),plugin,SLOT(slotObjectPropertiesChanged(int)), Qt::DirectConnection);
930 
931  if ( checkSignal(plugin,"visibilityChanged()" ) )
932  emit log (LOGERR,tr("Signal visibilityChanged() now requires objectid or -1 as argument " ));
933 
934  if ( checkSignal(plugin,"visibilityChanged(int)") ) {
935  emit log (LOGERR,tr("Signal visibilityChanged(int) is deprecated! " ));
936  emit log (LOGERR,tr("If an object changes its visibility, it will call the required functions automatically." ));
937  emit log (LOGERR,tr("If you change a scenegraph node, call nodeVisibilityChanged(int). See docu of this function for details." ));
938  }
939 
940  if ( checkSignal(plugin,"nodeVisibilityChanged(int)") )
941  connect(plugin,SIGNAL(nodeVisibilityChanged(int)),this,SLOT(slotVisibilityChanged(int)), Qt::DirectConnection);
942 
943 
944  if ( checkSlot(plugin,"slotVisibilityChanged(int)") )
945  connect(this,SIGNAL(visibilityChanged(int)),plugin,SLOT(slotVisibilityChanged(int)), Qt::DirectConnection);
946 
947  if ( checkSignal(plugin,"activeObjectChanged()" ) )
948  emit log (LOGERR,tr("Signal activeObjectChanged() is now objectSelectionChanged( int _objectId ) ") );
949 
950  if ( checkSlot(plugin,"slotActiveObjectChanged()" ) )
951  emit log (LOGERR,tr("Slot slotActiveObjectChanged() is now slotObjectSelectionChanged( int _objectId ) ") );
952 
953  if ( checkSlot(plugin,"slotAllCleared()") )
954  connect(this,SIGNAL(allCleared()),plugin,SLOT(slotAllCleared()));
955 
956 
957  if ( checkSignal(plugin,"objectSelectionChanged(int)") ) {
958  emit log (LOGERR,tr("Signal objectSelectionChanged(in) is deprecated!") );
959  emit log (LOGERR,tr("If the selection for an object is changed, the core will emit the required signals itself!") );
960  }
961 
962  if ( checkSlot( plugin , "slotObjectSelectionChanged(int)" ) )
963  connect(this,SIGNAL(objectSelectionChanged(int)),plugin,SLOT(slotObjectSelectionChanged(int) ), Qt::DirectConnection);
964 
965 
966  if ( checkSlot( plugin , "pluginsInitialized()" ) )
967  connect(this,SIGNAL(pluginsInitialized()),plugin,SLOT(pluginsInitialized()), Qt::DirectConnection);
968 
969  if ( checkSignal(plugin,"setSlotDescription(QString,QString,QStringList,QStringList)") )
970  connect(plugin, SIGNAL(setSlotDescription(QString,QString,QStringList,QStringList)),
971  this, SLOT(slotSetSlotDescription(QString,QString,QStringList,QStringList)) );
972 
973  // =============================================
974  // Function allowing switching of renderers from other plugins
975  // =============================================
976  if ( checkSignal(plugin,"setRenderer(unsigned int,QString)" ) ) {
977  connect(plugin,SIGNAL(setRenderer(unsigned int,QString)),this,SLOT(slotSetRenderer(unsigned int,QString)));
978  }
979 
980  if ( checkSignal(plugin,"getCurrentRenderer(unsigned int,QString&)" ) ) {
981  connect(plugin,SIGNAL(getCurrentRenderer(unsigned int,QString&)),this,SLOT(slotGetCurrentRenderer(unsigned int,QString&)), Qt::DirectConnection);
982  }
983 
984 
985  }
986 
987  //Check if the plugin supports Logging
988  LoggingInterface* logPlugin = qobject_cast< LoggingInterface * >(plugin);
989  if ( logPlugin ) {
990  supported = supported + "Logging ";
991 
992  // Create intermediate logger class which will mangle the output
993  PluginLogger* newlog = new PluginLogger(info.name);
994  loggers_.push_back(newlog);
995  connect(plugin,SIGNAL(log(Logtype, QString )),newlog,SLOT(slotLog(Logtype, QString )),Qt::DirectConnection);
996  connect(plugin,SIGNAL(log(QString )),newlog,SLOT(slotLog(QString )),Qt::DirectConnection);
997 
998  // Connect it to the core widget logger
999  if ( OpenFlipper::Options::gui() )
1000  connect(newlog,SIGNAL(log(Logtype, QString )),coreWidget_,SLOT(slotLog(Logtype, QString )),Qt::DirectConnection);
1001 
1002  // connection to console logger
1003  connect(newlog,SIGNAL(log(Logtype, QString )),this,SLOT(slotLog(Logtype, QString )),Qt::DirectConnection);
1004 
1005  // connection to file logger
1006  connect(newlog,SIGNAL(log(Logtype, QString )),this,SLOT(slotLogToFile(Logtype, QString )),Qt::DirectConnection);
1007 
1008  // connection to external plugin logger
1009  if ( checkSlot(plugin,"logOutput(Logtype,QString)") )
1010  connect(this,SIGNAL(externalLog(Logtype,QString)), plugin, SLOT(logOutput(Logtype,QString)) ) ;
1011  }
1012 
1013  //Check if the plugin supports Menubar-Interface
1014  MenuInterface* menubarPlugin = qobject_cast< MenuInterface * >(plugin);
1015  if ( menubarPlugin && OpenFlipper::Options::gui() ) {
1016  supported = supported + "Menubar ";
1017 
1018  if ( checkSignal(plugin,"addMenubarAction(QAction*,QString)") )
1019  connect(plugin , SIGNAL(addMenubarAction(QAction*,QString)),
1020  coreWidget_ , SLOT(slotAddMenubarAction(QAction*,QString)),Qt::DirectConnection);
1021  if ( checkSignal(plugin,"addMenubarActions(std::vector<QAction*>, QString)") )
1022  connect(plugin , SIGNAL(addMenubarActions(std::vector<QAction*>,QString)),
1023  coreWidget_ , SLOT(slotAddMenubarActions(std::vector<QAction*>,QString)),Qt::DirectConnection);
1024  if ( checkSignal(plugin,"getMenubarMenu (QString,QMenu*&,bool)") )
1025  connect(plugin , SIGNAL(getMenubarMenu (QString,QMenu*&,bool)),
1026  coreWidget_ , SLOT(slotGetMenubarMenu (QString,QMenu*&,bool)),Qt::DirectConnection);
1027  }
1028 
1029  //Check if the plugin supports ContextMenuInterface
1030  ContextMenuInterface* contextMenuPlugin = qobject_cast< ContextMenuInterface * >(plugin);
1031  if ( contextMenuPlugin && OpenFlipper::Options::gui() ) {
1032  supported = supported + "ContextMenu ";
1033 
1034  if ( checkSignal(plugin,"addContextMenuItem(QAction*,ContextMenuType)") )
1035  connect(plugin , SIGNAL(addContextMenuItem(QAction*,ContextMenuType)),
1036  coreWidget_ , SLOT(slotAddContextItem(QAction*,ContextMenuType)),Qt::DirectConnection);
1037 
1038  if ( checkSignal(plugin,"addContextMenuItem(QAction*,DataType,ContextMenuType)") )
1039  connect(plugin , SIGNAL(addContextMenuItem(QAction*,DataType,ContextMenuType)),
1040  coreWidget_ , SLOT(slotAddContextItem(QAction*,DataType,ContextMenuType)),Qt::DirectConnection);
1041 
1042  if ( checkSignal(plugin,"hideContextMenu()") )
1043  connect(plugin , SIGNAL(hideContextMenu()),
1044  coreWidget_ , SLOT(slotHideContextMenu()),Qt::DirectConnection);
1045 
1046  if ( checkSlot(plugin,"slotUpdateContextMenu(int)") )
1047  connect(coreWidget_ , SIGNAL(updateContextMenu(int)),
1048  plugin , SLOT(slotUpdateContextMenu(int)),Qt::DirectConnection);
1049 
1050  if ( checkSlot(plugin,"slotUpdateContextMenuNode(int)") )
1051  connect(coreWidget_ , SIGNAL(updateContextMenuNode(int)),
1052  plugin , SLOT(slotUpdateContextMenuNode(int)),Qt::DirectConnection);
1053 
1054  if ( checkSlot(plugin,"slotUpdateContextMenuBackground()") )
1055  connect(coreWidget_ , SIGNAL(updateContextMenuBackground()),
1056  plugin , SLOT(slotUpdateContextMenuBackground()),Qt::DirectConnection);
1057  }
1058 
1059  //Check if the plugin supports Toolbox-Interface
1060  ToolboxInterface* toolboxPlugin = qobject_cast< ToolboxInterface * >(plugin);
1061  if ( toolboxPlugin && OpenFlipper::Options::gui() ) {
1062  supported = supported + "Toolbox ";
1063 
1064 
1065  if ( checkSignal(plugin, "addToolbox(QString,QWidget*)"))
1066  connect(plugin, SIGNAL( addToolbox(QString,QWidget*) ),
1067  this, SLOT( addToolbox(QString,QWidget*) ),Qt::DirectConnection );
1068 
1069  if ( checkSignal(plugin, "addToolbox(QString,QWidget*,QIcon*)"))
1070  connect(plugin, SIGNAL( addToolbox(QString,QWidget*,QIcon*) ),
1071  this, SLOT( addToolbox(QString,QWidget*,QIcon*) ),Qt::DirectConnection );
1072 
1073  if ( checkSignal(plugin, "addToolbox(QString,QWidget*,QIcon*,QWidget*)"))
1074  connect(plugin, SIGNAL( addToolbox(QString,QWidget*,QIcon*,QWidget*) ),
1075  this, SLOT( addToolbox(QString,QWidget*,QIcon*,QWidget*) ),Qt::DirectConnection );
1076 }
1077 
1078  //Check if the plugin supports ViewMode-Interface
1079  ViewModeInterface* viewModePlugin = qobject_cast< ViewModeInterface * >(plugin);
1080  if ( viewModePlugin && OpenFlipper::Options::gui() ) {
1081  supported = supported + "ViewMode ";
1082 
1083  if ( checkSignal(plugin, "defineViewModeToolboxes(QString,QStringList)"))
1084  connect(plugin, SIGNAL( defineViewModeToolboxes(QString, QStringList) ),
1085  coreWidget_, SLOT( slotAddViewModeToolboxes(QString, QStringList) ),Qt::DirectConnection );
1086 
1087  if ( checkSignal(plugin, "defineViewModeToolbars(QString,QStringList)"))
1088  connect(plugin, SIGNAL( defineViewModeToolbars(QString, QStringList) ),
1089  coreWidget_, SLOT( slotAddViewModeToolbars(QString, QStringList) ),Qt::DirectConnection );
1090 
1091  if ( checkSignal(plugin, "defineViewModeContextMenus(QString,QStringList)"))
1092  connect(plugin, SIGNAL( defineViewModeContextMenus(QString, QStringList) ),
1093  coreWidget_, SLOT( slotAddViewModeContextMenus(QString, QStringList) ),Qt::DirectConnection );
1094 
1095  if ( checkSignal(plugin, "defineViewModeIcon(QString,QString)"))
1096  connect(plugin, SIGNAL( defineViewModeIcon(QString, QString) ),
1097  coreWidget_, SLOT( slotSetViewModeIcon(QString, QString) ),Qt::DirectConnection );
1098 
1099  if ( checkSignal(plugin, "setViewMode(QString,bool)"))
1100  connect(plugin, SIGNAL( setViewMode(QString, bool) ),
1101  coreWidget_, SLOT( setViewMode(QString, bool) ),Qt::DirectConnection );
1102  }
1103 
1104  //Check if the plugin supports Options-Interface
1105  OptionsInterface* optionsPlugin = qobject_cast< OptionsInterface * >(plugin);
1106  if ( optionsPlugin && OpenFlipper::Options::gui() ) {
1107  supported = supported + "Options ";
1108 
1109  QWidget* widget = 0;
1110  if ( optionsPlugin->initializeOptionsWidget( widget ) ) {
1111  info.optionsWidget = widget;
1112 
1113  if ( checkSlot(plugin,"applyOptions()") )
1114  connect(coreWidget_ , SIGNAL( applyOptions() ),
1115  plugin , SLOT( applyOptions() ),Qt::DirectConnection);
1116  }
1117  }
1118 
1119  //Check if the plugin supports Toolbar-Interface
1120  ToolbarInterface* toolbarPlugin = qobject_cast< ToolbarInterface * >(plugin);
1121  if ( toolbarPlugin && OpenFlipper::Options::gui() ) {
1122  supported = supported + "Toolbars ";
1123 
1124  if ( checkSignal(plugin,"addToolbar(QToolBar*)") )
1125  connect(plugin,SIGNAL(addToolbar(QToolBar*)),
1126  coreWidget_,SLOT(slotAddToolbar(QToolBar*)),Qt::DirectConnection);
1127 
1128  if ( checkSignal(plugin,"removeToolbar(QToolBar*)") )
1129  connect(plugin,SIGNAL(removeToolbar(QToolBar*)),
1130  coreWidget_,SLOT(slotRemoveToolbar(QToolBar*)),Qt::DirectConnection);
1131 
1132  if ( checkSignal(plugin,"getToolBar(QString,QToolBar*&)") )
1133  connect(plugin,SIGNAL(getToolBar(QString,QToolBar*&)),
1134  coreWidget_,SLOT(getToolBar(QString,QToolBar*&)),Qt::DirectConnection);
1135 
1136  }
1137 
1138  //Check if the plugin supports StatusBar-Interface
1139  StatusbarInterface* statusbarPlugin = qobject_cast< StatusbarInterface * >(plugin);
1140  if ( statusbarPlugin && OpenFlipper::Options::gui() ) {
1141  supported = supported + "StatusBar ";
1142 
1143  if ( checkSignal(plugin,"showStatusMessage(QString,int)") )
1144  connect(plugin,SIGNAL(showStatusMessage(QString,int)),
1145  coreWidget_,SLOT(statusMessage(QString,int)),Qt::DirectConnection);
1146 
1147 
1148  if ( checkSignal(plugin,"setStatus(ApplicationStatus::applicationStatus)") )
1149  connect(plugin,SIGNAL(setStatus(ApplicationStatus::applicationStatus)),
1150  coreWidget_,SLOT(setStatus(ApplicationStatus::applicationStatus)),Qt::DirectConnection);
1151 
1152  if ( checkSignal(plugin,"clearStatusMessage()") )
1153  connect(plugin,SIGNAL(clearStatusMessage()),
1154  coreWidget_,SLOT(clearStatusMessage()));
1155 
1156  if ( checkSignal(plugin,"addWidgetToStatusbar(QWidget*)") )
1157  connect(plugin,SIGNAL(addWidgetToStatusbar(QWidget*)), coreWidget_,SLOT(addWidgetToStatusbar(QWidget*)));
1158  }
1159 
1160  //Check if the plugin supports Key-Interface
1161  KeyInterface* keyPlugin = qobject_cast< KeyInterface * >(plugin);
1162  if ( keyPlugin && OpenFlipper::Options::gui() ) {
1163  supported = supported + "KeyboardEvents ";
1164 
1165  if ( checkSignal(plugin,"registerKey(int,Qt::KeyboardModifiers,QString,bool)") )
1166  connect(plugin,SIGNAL( registerKey(int, Qt::KeyboardModifiers, QString, bool) ),
1167  coreWidget_,SLOT(slotRegisterKey(int, Qt::KeyboardModifiers, QString, bool)) );
1168  }
1169 
1170  //Check if the plugin supports Mouse-Interface
1171  MouseInterface* mousePlugin = qobject_cast< MouseInterface * >(plugin);
1172  if ( mousePlugin && OpenFlipper::Options::gui() ) {
1173  supported = supported + "MouseEvents ";
1174 
1175  if ( checkSlot( plugin , "slotMouseWheelEvent(QWheelEvent*,const std::string&)" ) )
1176  connect(this , SIGNAL(PluginWheelEvent(QWheelEvent * , const std::string & )),
1177  plugin , SLOT(slotMouseWheelEvent(QWheelEvent* , const std::string & )));
1178 
1179  if ( checkSlot( plugin , "slotMouseEvent(QMouseEvent*)" ) )
1180  connect(this , SIGNAL(PluginMouseEvent(QMouseEvent*)),
1181  plugin , SLOT(slotMouseEvent(QMouseEvent*)));
1182 
1183  if ( checkSlot( plugin , "slotMouseEventLight(QMouseEvent*)" ) )
1184  connect(this , SIGNAL(PluginMouseEventLight(QMouseEvent*)),
1185  plugin , SLOT(slotMouseEventLight(QMouseEvent*)));
1186 
1187  }
1188 
1189  //Check if the plugin supports InformationInterface
1190  InformationInterface* infoPlugin = qobject_cast< InformationInterface * >(plugin);
1191  if ( infoPlugin && OpenFlipper::Options::gui() ) {
1192  supported = supported + "TypeInformation ";
1193 
1194  DataType dtype = infoPlugin->supportedDataTypes();
1195  supportedInfoTypes().insert(std::pair<InformationInterface*,DataType>(infoPlugin,dtype));
1196  }
1197 
1198  //Check if the plugin supports Picking-Interface
1199  PickingInterface* pickPlugin = qobject_cast< PickingInterface * >(plugin);
1200  if ( pickPlugin && OpenFlipper::Options::gui() ) {
1201  supported = supported + "Picking ";
1202 
1203  if ( checkSlot( plugin , "slotPickModeChanged(const std::string&)" ) )
1204  connect(coreWidget_,SIGNAL(signalPickModeChanged (const std::string &)),
1205  plugin,SLOT(slotPickModeChanged( const std::string &)));
1206 
1207  if ( checkSignal(plugin,"addPickMode(const std::string&)") )
1208  connect(plugin,SIGNAL(addPickMode( const std::string& )),
1209  this,SLOT(slotAddPickMode( const std::string& )),Qt::DirectConnection);
1210 
1211  if ( checkSignal(plugin,"addHiddenPickMode(const std::string&)") )
1212  connect(plugin,SIGNAL(addHiddenPickMode( const std::string& )),
1213  this,SLOT(slotAddHiddenPickMode( const std::string& )),Qt::DirectConnection);
1214 
1215  if ( checkSignal(plugin,"setPickModeCursor(const std::string&,QCursor)") )
1216  for ( unsigned int i = 0 ; i < OpenFlipper::Options::examinerWidgets() ; ++i )
1217  connect(plugin,SIGNAL(setPickModeCursor( const std::string& ,QCursor)),
1218  coreWidget_,SLOT(setPickModeCursor( const std::string& ,QCursor)),Qt::DirectConnection);
1219 
1220  if ( checkSignal(plugin,"setPickModeMouseTracking(const std::string&,bool)") )
1221  for ( unsigned int i = 0 ; i < OpenFlipper::Options::examinerWidgets() ; ++i )
1222  connect(plugin,SIGNAL(setPickModeMouseTracking( const std::string& ,bool)),
1223  coreWidget_,SLOT(setPickModeMouseTracking( const std::string& ,bool)),Qt::DirectConnection);
1224 
1225  if ( checkSignal(plugin,"setPickModeToolbar(const std::string&,QToolBar*)") )
1226  connect(plugin,SIGNAL(setPickModeToolbar (const std::string&, QToolBar*)),
1227  coreWidget_,SLOT(setPickModeToolbar (const std::string&, QToolBar*)),Qt::DirectConnection);
1228 
1229  if ( checkSignal(plugin,"removePickModeToolbar(const std::string&)") )
1230  connect(plugin,SIGNAL(removePickModeToolbar( const std::string&)),
1231  coreWidget_,SLOT(removePickModeToolbar( const std::string&)),Qt::DirectConnection);
1232 
1233  }
1234 
1235  //Check if the plugin supports INI-Interface
1236  INIInterface* iniPlugin = qobject_cast< INIInterface * >(plugin);
1237  if ( iniPlugin ) {
1238  supported = supported + "INIFile ";
1239 
1240  if ( checkSlot( plugin , "loadIniFile(INIFile&,int)" ) )
1241  connect(this , SIGNAL(iniLoad( INIFile&,int)),
1242  plugin , SLOT( loadIniFile( INIFile&,int) ),Qt::DirectConnection);
1243 
1244  if ( checkSlot( plugin , "saveIniFile(INIFile&,int)" ) )
1245  connect(this , SIGNAL(iniSave( INIFile& , int )),
1246  plugin , SLOT( saveIniFile( INIFile& , int ) ),Qt::DirectConnection);
1247 
1248  if ( checkSlot( plugin , "saveIniFileOptions(INIFile&)" ) )
1249  connect(this , SIGNAL(iniSaveOptions( INIFile& )),
1250  plugin , SLOT( saveIniFileOptions( INIFile& ) ),Qt::DirectConnection);
1251 
1252  if ( checkSlot( plugin , "saveOnExit(INIFile&)" ) )
1253  connect(this , SIGNAL(saveOnExit( INIFile& )),
1254  plugin , SLOT( saveOnExit( INIFile& ) ),Qt::DirectConnection);
1255 
1256  if ( checkSlot( plugin , "loadIniFileOptions(INIFile&)" ) )
1257  connect(this , SIGNAL(iniLoadOptions( INIFile& )),
1258  plugin , SLOT( loadIniFileOptions( INIFile& ) ),Qt::DirectConnection);
1259 
1260  if ( checkSlot( plugin , "loadIniFileOptionsLast(INIFile&)" ) )
1261  connect(this , SIGNAL(iniLoadOptionsLast( INIFile& )),
1262  plugin , SLOT( loadIniFileOptionsLast( INIFile& ) ),Qt::DirectConnection);
1263  }
1264 
1265  //Check if the plugin supports Selection-Interface
1266  SelectionInterface* selectionPlugin = qobject_cast< SelectionInterface * >(plugin);
1267  if ( selectionPlugin && OpenFlipper::Options::gui() ) {
1268  supported = supported + "SelectionBase ";
1269 
1270  if ( checkSignal(plugin,"addSelectionEnvironment(QString,QString,QIcon,QString&)") )
1271  log(LOGERR,tr("Plugin uses deprecated addSelectionEnvironment(QString,QString,QIcon,QString&) , Replace the qicon by the path to the icon!"));
1272 
1273  if ( checkSignal(plugin,"addSelectionEnvironment(QString,QString,QString,QString&)") )
1274  connect(plugin , SIGNAL(addSelectionEnvironment(QString,QString,QString,QString&)),
1275  this , SLOT(slotAddSelectionEnvironment(QString,QString,QString,QString&)),Qt::DirectConnection);
1276 
1277  // ===============
1278 
1279  if ( checkSlot(plugin,"slotAddSelectionEnvironment(QString,QString,QIcon,QString&)") )
1280  log(LOGERR,tr("Plugin uses deprecated slotAddSelectionEnvironment(QString,QString,QIcon,QString&) , Replace the qicon by the path to the icon!"));
1281 
1282  if ( checkSlot( plugin , "slotAddSelectionEnvironment(QString,QString,QString,QString&)" ) )
1283  connect(this , SIGNAL(addSelectionEnvironment(QString,QString,QString,QString&)),
1284  plugin , SLOT(slotAddSelectionEnvironment(QString,QString,QString,QString&)),Qt::DirectConnection);
1285 
1286  // ===============
1287 
1288  if ( checkSignal(plugin,"registerType(QString,DataType)") )
1289  connect(plugin , SIGNAL(registerType(QString,DataType)),
1290  this , SLOT(slotRegisterType(QString,DataType)),Qt::DirectConnection);
1291 
1292  // ===============
1293 
1294  if ( checkSlot( plugin , "slotRegisterType(QString,DataType)" ) )
1295  connect(this , SIGNAL(registerType(QString,DataType)),
1296  plugin , SLOT(slotRegisterType(QString,DataType)),Qt::DirectConnection);
1297 
1298  // ===============
1299 
1300  if ( checkSignal(plugin,"addPrimitiveType(QString,QString,QIcon,SelectionInterface::PrimitiveType&)") )
1301  log(LOGERR,tr("Plugin uses deprecated addPrimitiveType(QString,QString,QIcon,SelectionInterface::PrimitiveType&) , Replace the qicon by the path to the icon!"));
1302 
1303  if ( checkSignal(plugin,"addPrimitiveType(QString,QString,QString,SelectionInterface::PrimitiveType&)") )
1304  connect(plugin , SIGNAL(addPrimitiveType(QString,QString,QString,SelectionInterface::PrimitiveType&)),
1305  this , SLOT(slotAddPrimitiveType(QString,QString,QString,SelectionInterface::PrimitiveType&)),Qt::DirectConnection);
1306 
1307  // ===============
1308 
1309  if ( checkSlot(plugin,"slotAddPrimitiveType(QString,QString,QIcon,SelectionInterface::PrimitiveType&)") )
1310  log(LOGERR,tr("Plugin uses deprecated slotAddPrimitiveType(QString,QString,QIcon,SelectionInterface::PrimitiveType&) , Replace the qicon by the path to the icon!"));
1311 
1312  if ( checkSlot( plugin , "slotAddPrimitiveType(QString,QString,QString,SelectionInterface::PrimitiveType&)" ) )
1313  connect(this , SIGNAL(addPrimitiveType(QString,QString,QString,SelectionInterface::PrimitiveType&)),
1314  plugin , SLOT(slotAddPrimitiveType(QString,QString,QString,SelectionInterface::PrimitiveType&)),Qt::DirectConnection);
1315 
1316  // ===============
1317 
1318  if ( checkSignal(plugin,"addCustomSelectionMode(QString,QString,QString,QIcon,SelectionInterface::PrimitiveType,QString&)") )
1319  log(LOGERR,tr("Plugin uses deprecated addCustomSelectionMode(QString,QString,QString,QIcon,SelectionInterface::PrimitiveType,QString&) , Replace the qicon by the path to the icon!"));
1320 
1321  if ( checkSignal(plugin,"addCustomSelectionMode(QString,QString,QString,QString,SelectionInterface::PrimitiveType,QString&)") )
1322  connect(plugin , SIGNAL(addCustomSelectionMode(QString,QString,QString,QString,SelectionInterface::PrimitiveType,QString&)),
1323  this , SLOT(slotAddCustomSelectionMode(QString,QString,QString,QString,SelectionInterface::PrimitiveType,QString&)),Qt::DirectConnection);
1324 
1325  // ===============
1326 
1327  if ( checkSignal(plugin,"addCustomSelectionMode(QString,QString,QString,QIcon,SelectionInterface::PrimitiveType,QString&,DataType)") )
1328  log(LOGERR,tr("Plugin uses deprecated addCustomSelectionMode(QString,QString,QString,QIcon,SelectionInterface::PrimitiveType,QString&,DataType) , Replace the qicon by the path to the icon!"));
1329 
1330  if ( checkSignal(plugin,"addCustomSelectionMode(QString,QString,QString,QIcon,SelectionInterface::PrimitiveType,QString&,DataType)") )
1331  connect(plugin , SIGNAL(addCustomSelectionMode(QString,QString,QString,QIcon,SelectionInterface::PrimitiveType,QString&,DataType)),
1332  this , SLOT(slotAddCustomSelectionMode(QString,QString,QString,QIcon,SelectionInterface::PrimitiveType,QString&,DataType)),Qt::DirectConnection);
1333 
1334  // ===============
1335 
1336  if ( checkSlot(plugin,"slotAddCustomSelectionMode(QString,QString,QString,QIcon,SelectionInterface::PrimitiveType,QString&)") )
1337  log(LOGERR,tr("Plugin uses deprecated slotAddCustomSelectionMode(QString,QString,QString,QIcon,SelectionInterface::PrimitiveType,QString&) , Replace the qicon by the path to the icon!"));
1338 
1339  if ( checkSlot( plugin , "slotAddCustomSelectionMode(QString,QString,QString,QString,SelectionInterface::PrimitiveType,QString&)" ) )
1340  connect(this , SIGNAL(addCustomSelectionMode(QString,QString,QString,QString,SelectionInterface::PrimitiveType,QString&)),
1341  plugin , SLOT(slotAddCustomSelectionMode(QString,QString,QString,QString,SelectionInterface::PrimitiveType,QString&)),Qt::DirectConnection);
1342 
1343  // ===============
1344 
1345  if ( checkSlot(plugin,"slotAddCustomSelectionMode(QString,QString,QString,QIcon,SelectionInterface::PrimitiveType,QString&,DataType)") )
1346  log(LOGERR,tr("Plugin uses deprecated slotAddCustomSelectionMode(QString,QString,QString,QIcon,SelectionInterface::PrimitiveType,QString&,DataType) , Replace the qicon by the path to the icon!"));
1347 
1348  if ( checkSlot( plugin , "slotAddCustomSelectionMode(QString,QString,QString,QString,SelectionInterface::PrimitiveType,QString&,DataType)" ) )
1349  connect(this , SIGNAL(addCustomSelectionMode(QString,QString,QString,QString,SelectionInterface::PrimitiveType,QString&,DataType)),
1350  plugin , SLOT(slotAddCustomSelectionMode(QString,QString,QString,QString,SelectionInterface::PrimitiveType,QString&,DataType)),Qt::DirectConnection);
1351 
1352  // ===============
1353 
1354 
1355  if ( checkSignal(plugin,"addSelectionOperations(QString,QStringList,QString,SelectionInterface::PrimitiveType)") )
1356  connect(plugin , SIGNAL(addSelectionOperations(QString,QStringList,QString,SelectionInterface::PrimitiveType)),
1357  this , SLOT(slotAddSelectionOperations(QString,QStringList,QString,SelectionInterface::PrimitiveType)),Qt::DirectConnection);
1358 
1359  if ( checkSlot( plugin , "slotAddSelectionOperations(QString,QStringList,QString,SelectionInterface::PrimitiveType)" ) )
1360  connect(this , SIGNAL(addSelectionOperations(QString,QStringList,QString,SelectionInterface::PrimitiveType)),
1361  plugin , SLOT(slotAddSelectionOperations(QString,QStringList,QString,SelectionInterface::PrimitiveType)),Qt::DirectConnection);
1362 
1363  if ( checkSignal(plugin,"selectionOperation(QString)") )
1364  connect(plugin , SIGNAL(selectionOperation(QString)),
1365  this , SLOT(slotSelectionOperation(QString)),Qt::DirectConnection);
1366 
1367  if ( checkSlot( plugin , "slotSelectionOperation(QString)" ) )
1368  connect(this , SIGNAL(selectionOperation(QString)),
1369  plugin , SLOT(slotSelectionOperation(QString)),Qt::DirectConnection);
1370 
1371  if ( checkSignal(plugin,"showToggleSelectionMode(QString,bool,SelectionInterface::PrimitiveType)") )
1372  connect(plugin , SIGNAL(showToggleSelectionMode(QString,bool,SelectionInterface::PrimitiveType)),
1373  this , SLOT(slotShowToggleSelectionMode(QString,bool,SelectionInterface::PrimitiveType)),Qt::DirectConnection);
1374 
1375  if ( checkSlot( plugin , "slotShowToggleSelectionMode(QString,bool,SelectionInterface::PrimitiveType)" ) )
1376  connect(this , SIGNAL(showToggleSelectionMode(QString,bool,SelectionInterface::PrimitiveType)),
1377  plugin , SLOT(slotShowToggleSelectionMode(QString,bool,SelectionInterface::PrimitiveType)),Qt::DirectConnection);
1378 
1379  if ( checkSignal(plugin,"showLassoSelectionMode(QString,bool,SelectionInterface::PrimitiveType)") )
1380  connect(plugin , SIGNAL(showLassoSelectionMode(QString,bool,SelectionInterface::PrimitiveType)),
1381  this , SLOT(slotShowLassoSelectionMode(QString,bool,SelectionInterface::PrimitiveType)),Qt::DirectConnection);
1382 
1383  if ( checkSlot( plugin , "slotShowLassoSelectionMode(QString,bool,SelectionInterface::PrimitiveType)" ) )
1384  connect(this , SIGNAL(showLassoSelectionMode(QString,bool,SelectionInterface::PrimitiveType)),
1385  plugin , SLOT(slotShowLassoSelectionMode(QString,bool,SelectionInterface::PrimitiveType)),Qt::DirectConnection);
1386 
1387  if ( checkSignal(plugin,"showVolumeLassoSelectionMode(QString,bool,SelectionInterface::PrimitiveType)") )
1388  connect(plugin , SIGNAL(showVolumeLassoSelectionMode(QString,bool,SelectionInterface::PrimitiveType)),
1389  this , SLOT(slotShowVolumeLassoSelectionMode(QString,bool,SelectionInterface::PrimitiveType)),Qt::DirectConnection);
1390 
1391  if ( checkSlot( plugin , "slotShowVolumeLassoSelectionMode(QString,bool,SelectionInterface::PrimitiveType)" ) )
1392  connect(this , SIGNAL(showVolumeLassoSelectionMode(QString,bool,SelectionInterface::PrimitiveType)),
1393  plugin , SLOT(slotShowVolumeLassoSelectionMode(QString,bool,SelectionInterface::PrimitiveType)),Qt::DirectConnection);
1394 
1395  if ( checkSignal(plugin,"showSurfaceLassoSelectionMode(QString,bool,SelectionInterface::PrimitiveType)") )
1396  connect(plugin , SIGNAL(showSurfaceLassoSelectionMode(QString,bool,SelectionInterface::PrimitiveType)),
1397  this , SLOT(slotShowSurfaceLassoSelectionMode(QString,bool,SelectionInterface::PrimitiveType)),Qt::DirectConnection);
1398 
1399  if ( checkSlot( plugin , "slotShowSurfaceLassoSelectionMode(QString,bool,SelectionInterface::PrimitiveType)" ) )
1400  connect(this , SIGNAL(showSurfaceLassoSelectionMode(QString,bool,SelectionInterface::PrimitiveType)),
1401  plugin , SLOT(slotShowSurfaceLassoSelectionMode(QString,bool,SelectionInterface::PrimitiveType)),Qt::DirectConnection);
1402 
1403  if ( checkSignal(plugin,"showSphereSelectionMode(QString,bool,SelectionInterface::PrimitiveType)") )
1404  connect(plugin , SIGNAL(showSphereSelectionMode(QString,bool,SelectionInterface::PrimitiveType)),
1405  this , SLOT(slotShowSphereSelectionMode(QString,bool,SelectionInterface::PrimitiveType)),Qt::DirectConnection);
1406 
1407  if ( checkSlot( plugin , "slotShowSphereSelectionMode(QString,bool,SelectionInterface::PrimitiveType)" ) )
1408  connect(this , SIGNAL(showSphereSelectionMode(QString,bool,SelectionInterface::PrimitiveType)),
1409  plugin , SLOT(slotShowSphereSelectionMode(QString,bool,SelectionInterface::PrimitiveType)),Qt::DirectConnection);
1410 
1411  if ( checkSignal(plugin,"showClosestBoundarySelectionMode(QString,bool,SelectionInterface::PrimitiveType)") )
1412  connect(plugin , SIGNAL(showClosestBoundarySelectionMode(QString,bool,SelectionInterface::PrimitiveType)),
1413  this , SLOT(slotShowClosestBoundarySelectionMode(QString,bool,SelectionInterface::PrimitiveType)),Qt::DirectConnection);
1414 
1415  if ( checkSlot( plugin , "slotShowClosestBoundarySelectionMode(QString,bool,SelectionInterface::PrimitiveType)" ) )
1416  connect(this , SIGNAL(showClosestBoundarySelectionMode(QString,bool,SelectionInterface::PrimitiveType)),
1417  plugin , SLOT(slotShowClosestBoundarySelectionMode(QString,bool,SelectionInterface::PrimitiveType)),Qt::DirectConnection);
1418 
1419  if ( checkSignal(plugin,"showFloodFillSelectionMode(QString,bool,SelectionInterface::PrimitiveType)") )
1420  connect(plugin , SIGNAL(showFloodFillSelectionMode(QString,bool,SelectionInterface::PrimitiveType)),
1421  this , SLOT(slotShowFloodFillSelectionMode(QString,bool,SelectionInterface::PrimitiveType)),Qt::DirectConnection);
1422 
1423  if ( checkSlot( plugin , "slotShowFloodFillSelectionMode(QString,bool,SelectionInterface::PrimitiveType)" ) )
1424  connect(this , SIGNAL(showFloodFillSelectionMode(QString,bool,SelectionInterface::PrimitiveType)),
1425  plugin , SLOT(slotShowFloodFillSelectionMode(QString,bool,SelectionInterface::PrimitiveType)),Qt::DirectConnection);
1426 
1427  if ( checkSignal(plugin,"showComponentsSelectionMode(QString,bool,SelectionInterface::PrimitiveType)") )
1428  connect(plugin , SIGNAL(showComponentsSelectionMode(QString,bool,SelectionInterface::PrimitiveType)),
1429  this , SLOT(slotShowComponentsSelectionMode(QString,bool,SelectionInterface::PrimitiveType)),Qt::DirectConnection);
1430 
1431  if ( checkSlot( plugin , "slotShowComponentsSelectionMode(QString,bool,SelectionInterface::PrimitiveType)" ) )
1432  connect(this , SIGNAL(showComponentsSelectionMode(QString,bool,SelectionInterface::PrimitiveType)),
1433  plugin , SLOT(slotShowComponentsSelectionMode(QString,bool,SelectionInterface::PrimitiveType)),Qt::DirectConnection);
1434 
1435  if ( checkSignal(plugin,"toggleSelection(QMouseEvent*,SelectionInterface::PrimitiveType,bool)") )
1436  connect(plugin , SIGNAL(toggleSelection(QMouseEvent*,SelectionInterface::PrimitiveType,bool)),
1437  this , SLOT(slotToggleSelection(QMouseEvent*,SelectionInterface::PrimitiveType,bool)),Qt::DirectConnection);
1438 
1439  if ( checkSlot( plugin , "slotToggleSelection(QMouseEvent*,SelectionInterface::PrimitiveType,bool)" ) )
1440  connect(this , SIGNAL(toggleSelection(QMouseEvent*,SelectionInterface::PrimitiveType,bool)),
1441  plugin , SLOT(slotToggleSelection(QMouseEvent*,SelectionInterface::PrimitiveType,bool)),Qt::DirectConnection);
1442 
1443  if ( checkSignal(plugin,"lassoSelection(QMouseEvent*,SelectionInterface::PrimitiveType,bool)") )
1444  connect(plugin , SIGNAL(lassoSelection(QMouseEvent*,SelectionInterface::PrimitiveType,bool)),
1445  this , SLOT(slotLassoSelection(QMouseEvent*,SelectionInterface::PrimitiveType,bool)),Qt::DirectConnection);
1446 
1447  if ( checkSlot( plugin , "slotLassoSelection(QMouseEvent*,SelectionInterface::PrimitiveType,bool)" ) )
1448  connect(this , SIGNAL(lassoSelection(QMouseEvent*,SelectionInterface::PrimitiveType,bool)),
1449  plugin , SLOT(slotLassoSelection(QMouseEvent*,SelectionInterface::PrimitiveType,bool)),Qt::DirectConnection);
1450 
1451  if ( checkSignal(plugin,"volumeLassoSelection(QMouseEvent*,SelectionInterface::PrimitiveType,bool)") )
1452  connect(plugin , SIGNAL(volumeLassoSelection(QMouseEvent*,SelectionInterface::PrimitiveType,bool)),
1453  this , SLOT(slotVolumeLassoSelection(QMouseEvent*,SelectionInterface::PrimitiveType,bool)),Qt::DirectConnection);
1454 
1455  if ( checkSlot( plugin , "slotVolumeLassoSelection(QMouseEvent*,SelectionInterface::PrimitiveType,bool)" ) )
1456  connect(this , SIGNAL(volumeLassoSelection(QMouseEvent*,SelectionInterface::PrimitiveType,bool)),
1457  plugin , SLOT(slotVolumeLassoSelection(QMouseEvent*,SelectionInterface::PrimitiveType,bool)),Qt::DirectConnection);
1458 
1459  if ( checkSignal(plugin,"surfaceLassoSelection(QMouseEvent*,SelectionInterface::PrimitiveType,bool)") )
1460  connect(plugin , SIGNAL(surfaceLassoSelection(QMouseEvent*,SelectionInterface::PrimitiveType,bool)),
1461  this , SLOT(slotSurfaceLassoSelection(QMouseEvent*,SelectionInterface::PrimitiveType,bool)),Qt::DirectConnection);
1462 
1463  if ( checkSlot( plugin , "slotSurfaceLassoSelection(QMouseEvent*,SelectionInterface::PrimitiveType,bool)" ) )
1464  connect(this , SIGNAL(surfaceLassoSelection(QMouseEvent*,SelectionInterface::PrimitiveType,bool)),
1465  plugin , SLOT(slotSurfaceLassoSelection(QMouseEvent*,SelectionInterface::PrimitiveType,bool)),Qt::DirectConnection);
1466 
1467  if ( checkSignal(plugin,"sphereSelection(QMouseEvent*,double,SelectionInterface::PrimitiveType,bool)") )
1468  connect(plugin , SIGNAL(sphereSelection(QMouseEvent*,double,SelectionInterface::PrimitiveType,bool)),
1469  this , SLOT(slotSphereSelection(QMouseEvent*,double,SelectionInterface::PrimitiveType,bool)),Qt::DirectConnection);
1470 
1471  if ( checkSlot( plugin , "slotSphereSelection(QMouseEvent*,double,SelectionInterface::PrimitiveType,bool)" ) )
1472  connect(this , SIGNAL(sphereSelection(QMouseEvent*,double,SelectionInterface::PrimitiveType,bool)),
1473  plugin , SLOT(slotSphereSelection(QMouseEvent*,double,SelectionInterface::PrimitiveType,bool)),Qt::DirectConnection);
1474 
1475  if ( checkSignal(plugin,"closestBoundarySelection(QMouseEvent*,SelectionInterface::PrimitiveType,bool)") )
1476  connect(plugin , SIGNAL(closestBoundarySelection(QMouseEvent*,SelectionInterface::PrimitiveType,bool)),
1477  this , SLOT(slotClosestBoundarySelection(QMouseEvent*,SelectionInterface::PrimitiveType,bool)),Qt::DirectConnection);
1478 
1479  if ( checkSlot( plugin , "slotClosestBoundarySelection(QMouseEvent*,SelectionInterface::PrimitiveType,bool)" ) )
1480  connect(this , SIGNAL(closestBoundarySelection(QMouseEvent*,SelectionInterface::PrimitiveType,bool)),
1481  plugin , SLOT(slotClosestBoundarySelection(QMouseEvent*,SelectionInterface::PrimitiveType,bool)),Qt::DirectConnection);
1482 
1483  if ( checkSignal(plugin,"floodFillSelection(QMouseEvent*,double,SelectionInterface::PrimitiveType,bool)") )
1484  connect(plugin , SIGNAL(floodFillSelection(QMouseEvent*,double,SelectionInterface::PrimitiveType,bool)),
1485  this , SLOT(slotFloodFillSelection(QMouseEvent*,double,SelectionInterface::PrimitiveType,bool)),Qt::DirectConnection);
1486 
1487  if ( checkSlot( plugin , "slotFloodFillSelection(QMouseEvent*,double,SelectionInterface::PrimitiveType,bool)" ) )
1488  connect(this , SIGNAL(floodFillSelection(QMouseEvent*,double,SelectionInterface::PrimitiveType,bool)),
1489  plugin , SLOT(slotFloodFillSelection(QMouseEvent*,double,SelectionInterface::PrimitiveType,bool)),Qt::DirectConnection);
1490 
1491  if ( checkSignal(plugin,"componentsSelection(QMouseEvent*,SelectionInterface::PrimitiveType,bool)") )
1492  connect(plugin , SIGNAL(componentsSelection(QMouseEvent*,SelectionInterface::PrimitiveType,bool)),
1493  this , SLOT(slotComponentsSelection(QMouseEvent*,SelectionInterface::PrimitiveType,bool)),Qt::DirectConnection);
1494 
1495  if ( checkSlot( plugin , "slotComponentsSelection(QMouseEvent*,SelectionInterface::PrimitiveType,bool)" ) )
1496  connect(this , SIGNAL(componentsSelection(QMouseEvent*,SelectionInterface::PrimitiveType,bool)),
1497  plugin , SLOT(slotComponentsSelection(QMouseEvent*,SelectionInterface::PrimitiveType,bool)),Qt::DirectConnection);
1498 
1499  if ( checkSignal(plugin,"customSelection(QMouseEvent*,SelectionInterface::PrimitiveType,QString,bool)") )
1500  connect(plugin , SIGNAL(customSelection(QMouseEvent*,SelectionInterface::PrimitiveType,QString,bool)),
1501  this , SLOT(slotCustomSelection(QMouseEvent*,SelectionInterface::PrimitiveType,QString,bool)),Qt::DirectConnection);
1502 
1503  if ( checkSlot( plugin , "slotCustomSelection(QMouseEvent*,SelectionInterface::PrimitiveType,QString,bool)" ) )
1504  connect(this , SIGNAL(customSelection(QMouseEvent*,SelectionInterface::PrimitiveType,QString,bool)),
1505  plugin , SLOT(slotCustomSelection(QMouseEvent*,SelectionInterface::PrimitiveType,QString,bool)),Qt::DirectConnection);
1506 
1507  if ( checkSignal(plugin,"getActiveDataTypes(SelectionInterface::TypeList&)") )
1508  connect(plugin , SIGNAL(getActiveDataTypes(SelectionInterface::TypeList&)),
1509  this , SLOT(slotGetActiveDataTypes(SelectionInterface::TypeList&)),Qt::DirectConnection);
1510 
1511  if ( checkSlot( plugin , "slotGetActiveDataTypes(SelectionInterface::TypeList&)" ) )
1512  connect(this , SIGNAL(getActiveDataTypes(SelectionInterface::TypeList&)),
1513  plugin , SLOT(slotGetActiveDataTypes(SelectionInterface::TypeList&)),Qt::DirectConnection);
1514 
1515  if ( checkSignal(plugin,"getActivePrimitiveType(SelectionInterface::PrimitiveType&)") )
1516  connect(plugin , SIGNAL(getActivePrimitiveType(SelectionInterface::PrimitiveType&)),
1517  this , SLOT(slotGetActivePrimitiveType(SelectionInterface::PrimitiveType&)),Qt::DirectConnection);
1518 
1519  if ( checkSlot( plugin , "slotGetActivePrimitiveType(SelectionInterface::PrimitiveType&)" ) )
1520  connect(this , SIGNAL(getActivePrimitiveType(SelectionInterface::PrimitiveType&)),
1521  plugin , SLOT(slotGetActivePrimitiveType(SelectionInterface::PrimitiveType&)),Qt::DirectConnection);
1522 
1523  if ( checkSignal(plugin,"targetObjectsOnly(bool&)") )
1524  connect(plugin , SIGNAL(targetObjectsOnly(bool&)),
1525  this , SLOT(slotTargetObjectsOnly(bool&)),Qt::DirectConnection);
1526 
1527  if ( checkSlot( plugin , "slotTargetObjectsOnly(bool&)" ) )
1528  connect(this , SIGNAL(targetObjectsOnly(bool&)),
1529  plugin , SLOT(slotTargetObjectsOnly(bool&)),Qt::DirectConnection);
1530 
1531  if ( checkSignal(plugin,"loadSelection(const INIFile&)") )
1532  connect(plugin , SIGNAL(loadSelection(const INIFile&)),
1533  this , SLOT(slotLoadSelection(const INIFile&)),Qt::DirectConnection);
1534 
1535  if ( checkSlot( plugin , "slotLoadSelection(const INIFile&)" ) )
1536  connect(this , SIGNAL(loadSelection(const INIFile&)),
1537  plugin , SLOT(slotLoadSelection(const INIFile&)),Qt::DirectConnection);
1538 
1539  if ( checkSignal(plugin,"saveSelection(INIFile&)") )
1540  connect(plugin , SIGNAL(saveSelection(INIFile&)),
1541  this , SLOT(slotSaveSelection(INIFile&)),Qt::DirectConnection);
1542 
1543  if ( checkSlot( plugin , "slotSaveSelection(INIFile&)" ) )
1544  connect(this , SIGNAL(saveSelection(INIFile&)),
1545  plugin , SLOT(slotSaveSelection(INIFile&)),Qt::DirectConnection);
1546 
1547  if ( checkSignal(plugin,"registerKeyShortcut(int,Qt::KeyboardModifiers)") )
1548  connect(plugin , SIGNAL(registerKeyShortcut(int,Qt::KeyboardModifiers)),
1549  this , SLOT(slotRegisterKeyShortcut(int,Qt::KeyboardModifiers)),Qt::DirectConnection);
1550 
1551  if ( checkSlot( plugin , "slotRegisterKeyShortcut(int,Qt::KeyboardModifiers)" ) )
1552  connect(this , SIGNAL(registerKeyShortcut(int,Qt::KeyboardModifiers)),
1553  plugin , SLOT(slotRegisterKeyShortcut(int,Qt::KeyboardModifiers)),Qt::DirectConnection);
1554 
1555  if ( checkSignal(plugin,"keyShortcutEvent(int,Qt::KeyboardModifiers)") )
1556  connect(plugin , SIGNAL(keyShortcutEvent(int,Qt::KeyboardModifiers)),
1557  this , SLOT(slotKeyShortcutEvent(int,Qt::KeyboardModifiers)),Qt::DirectConnection);
1558 
1559  if ( checkSlot( plugin , "slotKeyShortcutEvent(int,Qt::KeyboardModifiers)" ) )
1560  connect(this , SIGNAL(keyShortcutEvent(int,Qt::KeyboardModifiers)),
1561  plugin , SLOT(slotKeyShortcutEvent(int,Qt::KeyboardModifiers)),Qt::DirectConnection);
1562  }
1563 
1564  //Check if the plugin supports Texture-Interface
1565  TextureInterface* texturePlugin = qobject_cast< TextureInterface * >(plugin);
1566  if ( texturePlugin && OpenFlipper::Options::gui() ) {
1567  supported = supported + "Textures ";
1568 
1569  if ( checkSignal(plugin,"addTexture(QString,QString,uint,int)") )
1570  connect(plugin , SIGNAL(addTexture( QString , QString , uint , int )),
1571  this , SLOT(slotAddTexture(QString, QString, uint, int)),Qt::DirectConnection);
1572 
1573  if ( checkSlot( plugin , "slotTextureAdded(QString,QString,uint,int)" ) )
1574  connect(this , SIGNAL(addTexture(QString,QString, uint, int)),
1575  plugin , SLOT(slotTextureAdded(QString,QString, uint, int)),Qt::DirectConnection);
1576 
1577  if ( checkSignal(plugin,"addTexture(QString,QString,uint)") )
1578  connect(plugin , SIGNAL(addTexture( QString , QString , uint )),
1579  this , SLOT(slotAddTexture(QString, QString, uint)),Qt::AutoConnection);
1580 
1581  if ( checkSlot( plugin , "slotTextureAdded(QString,QString,uint)" ) )
1582  connect(this , SIGNAL(addTexture(QString,QString, uint)),
1583  plugin , SLOT(slotTextureAdded(QString,QString, uint)),Qt::DirectConnection);
1584 
1585  if ( checkSignal(plugin,"updateTexture(QString,int)") )
1586  connect(plugin , SIGNAL(updateTexture( QString ,int )),
1587  this , SLOT(slotUpdateTexture(QString , int)),Qt::AutoConnection);
1588 
1589  if ( checkSlot( plugin , "slotUpdateTexture(QString,int)" ) )
1590  connect(this , SIGNAL(updateTexture(QString ,int)),
1591  plugin , SLOT(slotUpdateTexture(QString,int )),Qt::DirectConnection);
1592 
1593  if ( checkSignal(plugin,"updateAllTextures()") )
1594  connect(plugin , SIGNAL(updateAllTextures()),
1595  this , SLOT(slotUpdateAllTextures()));
1596 
1597  if ( checkSlot( plugin , "slotUpdateAllTextures()" ) )
1598  connect(this , SIGNAL(updateAllTextures()),
1599  plugin , SLOT(slotUpdateAllTextures()));
1600 
1601  if ( checkSignal(plugin,"updatedTextures(QString,int)") )
1602  connect(plugin , SIGNAL(updatedTextures( QString , int )),
1603  this , SLOT(slotTextureUpdated( QString, int ) ),Qt::AutoConnection);
1604 
1605  if ( checkSlot( plugin , "slotTextureUpdated(QString,int)" ) )
1606  connect(this , SIGNAL(updatedTextures( QString , int )),
1607  plugin , SLOT(slotTextureUpdated( QString, int ) ),Qt::DirectConnection);
1608 
1609  if ( checkSignal(plugin,"setTextureMode(QString,QString,int)") )
1610  connect(plugin , SIGNAL(setTextureMode(QString, QString, int )),
1611  this , SLOT(slotSetTextureMode(QString, QString, int )),Qt::AutoConnection );
1612 
1613  if ( checkSlot( plugin , "slotSetTextureMode(QString,QString,int)" ) )
1614  connect(this , SIGNAL(setTextureMode(QString, QString, int )),
1615  plugin , SLOT(slotSetTextureMode(QString, QString, int )),Qt::DirectConnection );
1616 
1617  if ( checkSignal(plugin,"setTextureMode(QString,QString)") )
1618  connect(plugin , SIGNAL(setTextureMode(QString ,QString )),
1619  this , SLOT(slotSetTextureMode(QString ,QString )),Qt::AutoConnection );
1620 
1621  if ( checkSlot( plugin , "slotSetTextureMode(QString,QString)" ) )
1622  connect(this , SIGNAL(setTextureMode(QString ,QString )),
1623  plugin , SLOT(slotSetTextureMode(QString ,QString )),Qt::DirectConnection );
1624 
1625  if ( checkSignal(plugin,"switchTexture(QString,int)") )
1626  connect(plugin , SIGNAL(switchTexture(QString, int )),
1627  this , SLOT(slotSwitchTexture(QString, int )),Qt::AutoConnection);
1628 
1629  if ( checkSlot( plugin , "slotSwitchTexture(QString,int)" ) )
1630  connect(this , SIGNAL(switchTexture(QString, int )),
1631  plugin , SLOT(slotSwitchTexture(QString, int )),Qt::DirectConnection);
1632 
1633  if ( checkSignal(plugin,"switchTexture(QString)") )
1634  connect(plugin , SIGNAL(switchTexture(QString )),
1635  this , SLOT(slotSwitchTexture(QString )),Qt::AutoConnection);
1636 
1637  if ( checkSlot( plugin , "slotSwitchTexture(QString)" ) )
1638  connect(this , SIGNAL(switchTexture(QString )),
1639  plugin , SLOT(slotSwitchTexture(QString )),Qt::DirectConnection);
1640 
1641 
1642 
1643  if ( checkSignal( plugin , "textureChangeImage(QString,QImage&,int)" ) )
1644  connect(plugin , SIGNAL(textureChangeImage(QString,QImage&,int)),
1645  this , SLOT(slotTextureChangeImage(QString,QImage&,int)),Qt::DirectConnection);
1646 
1647  if ( checkSlot( plugin , "slotTextureChangeImage(QString,QImage&,int)" ) )
1648  connect(this , SIGNAL(textureChangeImage(QString,QImage&,int)),
1649  plugin , SLOT(slotTextureChangeImage(QString,QImage&,int)),Qt::DirectConnection);
1650 
1651  if ( checkSignal( plugin , "textureChangeImage(QString,QImage&)" ) )
1652  connect(plugin , SIGNAL(textureChangeImage(QString,QImage&)),
1653  this , SLOT(slotTextureChangeImage(QString,QImage&)),Qt::DirectConnection);
1654 
1655  if ( checkSlot( plugin , "slotTextureChangeImage(QString,QImage&)" ) )
1656  connect(this , SIGNAL(textureChangeImage(QString,QImage&)),
1657  plugin , SLOT(slotTextureChangeImage(QString,QImage&)),Qt::DirectConnection);
1658 
1659  if ( checkSignal( plugin , "addMultiTexture(QString,QString,QString,int,int&)" ) )
1660  connect(plugin , SIGNAL(addMultiTexture(QString,QString,QString,int,int&) ),
1661  this , SLOT(slotMultiTextureAdded(QString,QString,QString,int,int&) ),Qt::DirectConnection);
1662 
1663  if ( checkSlot( plugin , "slotMultiTextureAdded( QString,QString,QString,int,int&)" ) )
1664  connect(this , SIGNAL(addMultiTexture(QString,QString,QString,int,int&) ),
1665  plugin , SLOT(slotMultiTextureAdded( QString,QString,QString,int,int&) ),Qt::DirectConnection);
1666 
1667  if ( checkSignal( plugin , "textureGetImage(QString,QImage&,int)" ) )
1668  connect(plugin , SIGNAL(textureGetImage(QString,QImage&,int)),
1669  this , SLOT(slotTextureGetImage(QString,QImage&,int)),Qt::DirectConnection);
1670 
1671  if ( checkSlot( plugin , "slotTextureGetImage(QString,QImage&,int)" ) )
1672  connect(this , SIGNAL(textureGetImage(QString,QImage&,int)),
1673  plugin , SLOT(slotTextureGetImage(QString,QImage&,int)),Qt::DirectConnection);
1674 
1675  if ( checkSignal( plugin , "textureGetImage(QString,QImage&)" ) )
1676  connect(plugin , SIGNAL(textureGetImage(QString,QImage&)),
1677  this , SLOT(slotTextureGetImage(QString,QImage&)),Qt::DirectConnection);
1678 
1679  if ( checkSlot( plugin , "slotTextureGetImage(QString,QImage&)" ) )
1680  connect(this , SIGNAL(textureGetImage(QString,QImage&)),
1681  plugin , SLOT(slotTextureGetImage(QString,QImage&)),Qt::DirectConnection);
1682 
1683  if ( checkSignal( plugin , "textureIndex(QString,int,int&)" ) )
1684  connect(plugin , SIGNAL(textureIndex(QString,int,int&)),
1685  this , SLOT(slotTextureIndex(QString,int,int&)),Qt::DirectConnection);
1686 
1687  if ( checkSlot( plugin , "slotTextureIndex(QString,int,int&)" ) )
1688  connect(this , SIGNAL(textureIndex(QString,int,int&)),
1689  plugin , SLOT(slotTextureIndex(QString,int,int&)),Qt::DirectConnection);
1690 
1691  if ( checkSignal( plugin , "textureIndexPropertyName(int,QString&)" ) )
1692  connect(plugin , SIGNAL(textureIndexPropertyName(int,QString&)),
1693  this , SLOT(slotTextureIndexPropertyName(int,QString&)),Qt::DirectConnection);
1694 
1695  if ( checkSlot( plugin , "slotTextureIndexPropertyName(int,QString&)" ) )
1696  connect(this , SIGNAL(textureIndexPropertyName(int,QString&)),
1697  plugin , SLOT(slotTextureIndexPropertyName(int,QString&)),Qt::DirectConnection);
1698 
1699  if ( checkSignal( plugin , "textureName(int,int,QString&)" ) )
1700  connect(plugin , SIGNAL(textureName(int,int,QString&)),
1701  this , SLOT(slotTextureName(int,int,QString&)),Qt::DirectConnection);
1702 
1703  if ( checkSlot( plugin , "slotTextureName(int,int,QString&)" ) )
1704  connect(this , SIGNAL(textureName(int,int,QString&)),
1705  plugin , SLOT(slotTextureName(int,int,QString&)),Qt::DirectConnection);
1706 
1707  if ( checkSignal( plugin , "textureFilename(int,QString,QString&)" ) )
1708  connect(plugin , SIGNAL(textureFilename(int,QString,QString&)),
1709  this , SLOT(slotTextureFilename(int,QString,QString&)),Qt::DirectConnection);
1710 
1711  if ( checkSlot( plugin , "slotTextureFilename(int,QString,QString&)" ) )
1712  connect(this , SIGNAL(textureFilename(int,QString,QString&)),
1713  plugin , SLOT(slotTextureFilename(int,QString,QString&)),Qt::DirectConnection);
1714 
1715  if ( checkSignal( plugin , "getCurrentTexture(int,QString&)" ) )
1716  connect(plugin , SIGNAL(getCurrentTexture(int,QString&)),
1717  this , SLOT(slotGetCurrentTexture(int,QString&)),Qt::DirectConnection);
1718 
1719  if ( checkSlot( plugin , "slotGetCurrentTexture(int,QString&)" ) )
1720  connect(this , SIGNAL(getCurrentTexture(int,QString&)),
1721  plugin , SLOT(slotGetCurrentTexture(int,QString&)),Qt::DirectConnection);
1722 
1723  if ( checkSignal( plugin , "getSubTextures(int,QString,QStringList&)" ) )
1724  connect(plugin , SIGNAL(getSubTextures(int,QString,QStringList&)),
1725  this , SLOT(slotGetSubTextures(int,QString,QStringList&)),Qt::DirectConnection);
1726 
1727  if ( checkSlot( plugin , "slotGetSubTextures(int,QString,QStringList&)" ) )
1728  connect(this , SIGNAL(getSubTextures(int,QString,QStringList&)),
1729  plugin , SLOT(slotGetSubTextures(int,QString,QStringList&)),Qt::DirectConnection);
1730  }
1731 
1732  //Check if the plugin supports Backup-Interface
1733  BackupInterface* backupPlugin = qobject_cast< BackupInterface * >(plugin);
1734  if ( backupPlugin ) {
1735  supported = supported + "Backups ";
1736 
1737  // Incoming Signal that a backup should be created
1738  if ( checkSignal( plugin , "createBackup(int,QString,UpdateType)" ) ) {
1739  connect(plugin , SIGNAL(createBackup(int,QString,UpdateType)) ,
1740  this , SIGNAL(createBackup(int,QString,UpdateType)),Qt::DirectConnection );
1741  }
1742  // Signal send from core to plugins that they should create a backup
1743  if ( checkSlot( plugin , "slotCreateBackup(int,QString,UpdateType)" ) ) {
1744  connect(this , SIGNAL(createBackup(int,QString,UpdateType)),
1745  plugin , SLOT( slotCreateBackup(int,QString,UpdateType) ),Qt::DirectConnection);
1746  }
1747 
1748  // Incoming Signal that a backup should be created
1749  if ( checkSignal( plugin , "createBackup(IdList,QString,std::vector<UpdateType>)" ) ) {
1750  connect(plugin , SIGNAL(createBackup(IdList,QString,std::vector<UpdateType>)) ,
1751  this , SIGNAL(createBackup(IdList,QString,std::vector<UpdateType>)),Qt::DirectConnection );
1752  }
1753  // Signal send from core to plugins that they should create a backup
1754  if ( checkSlot( plugin , "slotCreateBackup(IdList,QString,std::vector<UpdateType>)" ) ) {
1755  connect(this , SIGNAL(createBackup(IdList,QString,std::vector<UpdateType>)),
1756  plugin , SLOT( slotCreateBackup(IdList,QString,std::vector<UpdateType>) ),Qt::DirectConnection);
1757  }
1758 
1759 
1760  // Signal from plugin to restore an object with the given id
1761  if ( checkSignal( plugin , "undo(int)" ) ) {
1762  connect(plugin , SIGNAL(undo(int)) ,
1763  this , SIGNAL(undo(int)),Qt::DirectConnection );
1764  }
1765 
1766  // Signal send from core to backup plugin that it should restore the given object
1767  if ( checkSlot( plugin , "slotUndo(int)" ) ) {
1768  connect(this , SIGNAL(undo(int)),
1769  plugin , SLOT( slotUndo(int) ),Qt::DirectConnection);
1770  }
1771 
1772  // Signal from plugin to restore an object with the given id
1773  if ( checkSignal( plugin , "redo(int)" ) ) {
1774  connect(plugin , SIGNAL(redo(int)) ,
1775  this , SIGNAL(redo(int)),Qt::DirectConnection );
1776  }
1777 
1778  // Signal send from core to backup plugin that it should restore the given object
1779  if ( checkSlot( plugin , "slotRedo(int)" ) ) {
1780  connect(this , SIGNAL(redo(int)),
1781  plugin , SLOT( slotRedo(int) ),Qt::DirectConnection);
1782  }
1783 
1784  // Signal from plugin to restore an object with the given id
1785  if ( checkSignal( plugin , "undo()" ) ) {
1786  connect(plugin , SIGNAL(undo()) ,
1787  this , SIGNAL(undo()),Qt::DirectConnection );
1788  }
1789 
1790  // Signal send from core to backup plugin that it should restore the given object
1791  if ( checkSlot( plugin , "slotUndo()" ) ) {
1792  connect(this , SIGNAL(undo()),
1793  plugin , SLOT( slotUndo() ),Qt::DirectConnection);
1794  }
1795 
1796  // Signal from plugin to restore an object with the given id
1797  if ( checkSignal( plugin , "redo()" ) ) {
1798  connect(plugin , SIGNAL(redo()) ,
1799  this , SIGNAL(redo()),Qt::DirectConnection );
1800  }
1801 
1802  // Signal send from core to backup plugin that it should restore the given object
1803  if ( checkSlot( plugin , "slotRedo()" ) ) {
1804  connect(this , SIGNAL(redo()),
1805  plugin , SLOT( slotRedo() ),Qt::DirectConnection);
1806  }
1807 
1808  //====================================================================================
1809  // Backup Plugin signals for communication with the other plugins about restore state
1810  //====================================================================================
1811 
1812  // Stage one : restore will happen soon
1813  if ( checkSignal( plugin , "aboutToRestore(int)" ) ) {
1814  connect(plugin , SIGNAL( aboutToRestore(int)) ,
1815  this , SIGNAL( aboutToRestore(int) ),Qt::DirectConnection);
1816  }
1817 
1818  // Stage two: Restore complete
1819  if ( checkSignal( plugin , "restored(int)" ) ) {
1820  connect(plugin , SIGNAL(restored(int)) ,
1821  this , SIGNAL( restored(int) ),Qt::DirectConnection);
1822  }
1823 
1824  //====================================================================================
1825  // Plugin slots about restore state
1826  //====================================================================================
1827 
1828  // Stage one : restore will happen soon
1829  if ( checkSlot( plugin , "slotAboutToRestore(int)" ) ) {
1830  connect(this , SIGNAL( aboutToRestore(int)) ,
1831  plugin , SLOT( slotAboutToRestore(int) ),Qt::DirectConnection);
1832  }
1833 
1834  // Stage two : restore will happen soon
1835  if ( checkSlot( plugin , "slotRestored(int)" ) ) {
1836  connect(this , SIGNAL( restored(int)) ,
1837  plugin , SLOT( slotRestored(int) ),Qt::DirectConnection);
1838  }
1839 
1840  // Signal from plugin to restore a group with the given id
1841  if ( checkSignal( plugin , "generateBackup(int,QString,UpdateType)" ) ) {
1842  connect(plugin , SIGNAL(generateBackup(int,QString,UpdateType)) ,
1843  this , SLOT(slotGenerateBackup(int,QString,UpdateType)),Qt::DirectConnection );
1844  }
1845  }
1846 
1847  //Check if the plugin supports LoadSave-Interface
1848  LoadSaveInterface* LoadSavePlugin = qobject_cast< LoadSaveInterface * >(plugin);
1849  if ( LoadSavePlugin ) {
1850  supported = supported + "Load/Save ";
1851  if ( checkSignal(plugin,"load( QString,DataType,int& )" ) )
1852  connect(plugin , SIGNAL(load( QString,DataType,int& )) ,
1853  this , SLOT(slotLoad( QString,DataType,int& )),Qt::DirectConnection );
1854  if ( checkSignal(plugin,"save(int,QString)" ) )
1855  connect(plugin , SIGNAL( save(int,QString) ) ,
1856  this , SLOT( saveObject(int,QString) ), Qt::DirectConnection);
1857 
1858  if ( checkSlot( plugin , "fileOpened(int)" ) )
1859  connect(this , SIGNAL( openedFile( int) ) ,
1860  plugin , SLOT( fileOpened( int ) ),Qt::DirectConnection);
1861 
1862  if ( checkSignal(plugin,"addEmptyObject(DataType,int&)" ) )
1863  connect(plugin , SIGNAL( addEmptyObject( DataType, int& )) ,
1864  this , SLOT( slotAddEmptyObject( DataType, int&) ),Qt::DirectConnection);
1865 
1866  if ( checkSignal(plugin,"copyObject(int,int&)" ) )
1867  connect(plugin , SIGNAL( copyObject( int, int& )) ,
1868  this , SLOT( slotCopyObject( int, int&) ),Qt::DirectConnection);
1869 
1870  // Plugins to core
1871  if ( checkSignal(plugin,"emptyObjectAdded(int)" ) )
1872  connect(plugin , SIGNAL( emptyObjectAdded( int ) ) ,
1873  this , SLOT( slotEmptyObjectAdded ( int ) ),Qt::QueuedConnection);
1874 
1875  // core to plugins
1876  if ( checkSlot(plugin,"addedEmptyObject(int)" ) )
1877  connect(this , SIGNAL( emptyObjectAdded( int ) ) ,
1878  plugin , SLOT( addedEmptyObject( int ) ),Qt::DirectConnection);
1879 
1880  if ( checkSignal(plugin,"deleteObject(int)" ) )
1881  connect(plugin , SIGNAL( deleteObject( int ) ) ,
1882  this , SLOT( deleteObject( int ) ),Qt::AutoConnection);
1883 
1884  if ( checkSignal(plugin,"deleteAllObjects()" ) )
1885  connect(plugin , SIGNAL( deleteAllObjects() ) ,
1886  this , SLOT( slotDeleteAllObjects() ),Qt::DirectConnection);
1887 
1888  if ( checkSignal(plugin,"getAllFileFilters(QStringList&)" ) )
1889  connect(plugin , SIGNAL( getAllFileFilters(QStringList&) ) ,
1890  this , SLOT( slotGetAllFilters(QStringList&) ),Qt::DirectConnection);
1891 
1892  if ( checkSlot(plugin,"objectDeleted(int)" ) )
1893  connect(this , SIGNAL( objectDeleted( int ) ) ,
1894  plugin , SLOT( objectDeleted( int ) ),Qt::DirectConnection);
1895 
1896  }
1897 
1898  //Check if the plugin supports View-Interface
1899  ViewInterface* viewPlugin = qobject_cast< ViewInterface * >(plugin);
1900  if ( viewPlugin && OpenFlipper::Options::gui() ) {
1901  supported = supported + "View ";
1902 
1903  if ( checkSignal(plugin,"getStackWidget(QString,QWidget*&)" ) )
1904  connect(plugin , SIGNAL(getStackWidget( QString , QWidget*&)),
1905  coreWidget_ , SLOT( slotGetStackWidget( QString , QWidget*& ) ) ,Qt::DirectConnection );
1906  if ( checkSignal(plugin,"addStackWidget(QString,QWidget*)" ) )
1907  connect(plugin , SIGNAL(addStackWidget( QString , QWidget*)),
1908  coreWidget_ , SLOT( slotAddStackWidget( QString , QWidget* ) ) ,Qt::DirectConnection );
1909  if ( checkSignal(plugin,"updateStackWidget(QString,QWidget*)" ) )
1910  connect(plugin , SIGNAL(updateStackWidget( QString , QWidget*)),
1911  coreWidget_ , SLOT( slotUpdateStackWidget( QString , QWidget* ) ) ,Qt::DirectConnection );
1912  }
1913 
1914  //Check if the plugin supports Process-Interface
1915  ProcessInterface* processPlugin = qobject_cast< ProcessInterface * >(plugin);
1916  if ( processPlugin ) {
1917  supported = supported + "Process ";
1918 
1919  if ( checkSignal(plugin,"startJob(QString,QString,int,int,bool)" ) )
1920  connect(plugin , SIGNAL(startJob(QString, QString,int,int,bool)),
1921  this , SLOT( slotStartJob(QString, QString,int,int,bool) ), Qt::DirectConnection );
1922  else
1923  emit log(LOGERR,"Process Interface defined but no startJob signal found!");
1924 
1925  if ( checkSignal(plugin,"setJobState(QString,int)" ) )
1926  connect(plugin , SIGNAL(setJobState(QString,int)),
1927  this , SLOT( slotSetJobState(QString,int) ), Qt::QueuedConnection );
1928  else
1929  emit log(LOGERR,"Process Interface defined but no setJobState signal found!");
1930 
1931  if ( checkSignal(plugin,"setJobName(QString,QString)" ) )
1932  connect(plugin , SIGNAL(setJobName(QString, QString)),
1933  this , SLOT( slotSetJobName(QString, QString) ), Qt::QueuedConnection );
1934  else
1935  emit log(LOGERR,"Process Interface defined but no setJobName signal found!");
1936 
1937  if ( checkSignal(plugin,"setJobDescription(QString,QString)" ) )
1938  connect(plugin , SIGNAL(setJobDescription(QString, QString)),
1939  this , SLOT( slotSetJobDescription(QString, QString) ), Qt::QueuedConnection );
1940  else
1941  emit log(LOGERR,"Process Interface defined but no setJobDescription signal found!");
1942 
1943  if ( checkSignal(plugin,"cancelJob(QString)" ) )
1944  connect(plugin , SIGNAL(cancelJob(QString)),
1945  this , SLOT( slotCancelJob(QString) ), Qt::QueuedConnection );
1946 
1947  if ( checkSignal(plugin,"finishJob(QString)" ) )
1948  connect(plugin , SIGNAL(finishJob(QString)),
1949  this , SLOT( slotFinishJob(QString) ), Qt::QueuedConnection );
1950  else
1951  emit log(LOGERR,"Process Interface defined but no finishJob signal found!");
1952 
1953  if ( checkSlot(plugin,"canceledJob(QString)" ) )
1954  connect(this , SIGNAL( jobCanceled( QString ) ) ,
1955  plugin , SLOT( canceledJob(QString) ),Qt::QueuedConnection);
1956  else
1957  emit log(LOGERR,"Process Interface defined but no cancel canceledJob slot found!");
1958  }
1959 
1960  //Check if the plugin supports RPC-Interface
1961  RPCInterface* rpcPlugin = qobject_cast< RPCInterface * >(plugin);
1962  if ( rpcPlugin ) {
1963  supported = supported + "RPC ";
1964 
1965  if ( checkSignal(plugin,"pluginExists(QString,bool&)" ) )
1966  connect(plugin , SIGNAL( pluginExists(QString,bool&) ),
1967  this , SLOT( slotPluginExists(QString,bool&) ) ,Qt::DirectConnection );
1968  if ( checkSignal(plugin,"functionExists(QString,QString,bool&)" ) )
1969  connect(plugin , SIGNAL(functionExists(QString,QString,bool&)),
1970  this , SLOT( slotFunctionExists(QString,QString,bool&) ) ,Qt::DirectConnection );
1971  if ( checkSignal(plugin,"call(QString,QString,bool&)" ) )
1972  connect(plugin , SIGNAL(call(QString,QString,bool&)),
1973  this , SLOT(slotCall(QString,QString,bool&)) ,Qt::DirectConnection );
1974  if ( checkSignal(plugin,"call(QString,bool&)" ) )
1975  connect(plugin , SIGNAL(call(QString,bool&)),
1976  this , SLOT(slotCall(QString,bool&)) ,Qt::DirectConnection );
1977  if ( checkSignal(plugin,"getValue(QString,QVariant&)" ) )
1978  connect(plugin , SIGNAL(getValue(QString,QVariant&)),
1979  this , SLOT(slotGetValue(QString,QVariant&)) ,Qt::DirectConnection );
1980  }
1981 
1982  //Check if the plugin supports PluginConnectionInterface
1983  PluginConnectionInterface* interconnectionPlugin = qobject_cast< PluginConnectionInterface * >(plugin);
1984  if ( interconnectionPlugin ) {
1985  supported = supported + "Plugin Interconnection ";
1986 
1987  if ( checkSignal(plugin,"crossPluginConnect(QString,const char*,QString,const char*)" ) ) {
1988  connect(plugin , SIGNAL( crossPluginConnect(QString,const char*,QString,const char*) ),
1989  this , SLOT( slotCrossPluginConnect(QString,const char*,QString,const char*) ));
1990  }
1991  }
1992 
1993  //Check if the plugin supports RenderInterface
1994  RenderInterface* renderPlugin = qobject_cast< RenderInterface * >(plugin);
1995  if ( renderPlugin ) {
1996  supported = supported + "Rendering ";
1997 
1998  if ( checkSlot( plugin , "rendererName()" ) ) {
1999  QString rendererNameString = "";
2000 
2001  // Get the name of the renderer
2002  QMetaObject::invokeMethod(plugin,"rendererName", Qt::DirectConnection, Q_RETURN_ARG(QString,rendererNameString) ) ;
2003 
2004  // Let the plugin check its OpenGL support requirements
2005  QString openGLCheck = "";
2006  QMetaObject::invokeMethod(plugin,"checkOpenGL", Qt::DirectConnection, Q_RETURN_ARG(QString,openGLCheck) ) ;
2007 
2008  if ( openGLCheck != "" ) {
2009  emit log(LOGERR,tr("Error: Insufficient OpenGL capabilities in Renderer Plugin ") + rendererNameString + " !");
2010  emit log(LOGERR,openGLCheck);
2011  return;
2012  }
2013 
2014  // Check if it already exists and add it if not.
2015  RendererInfo* rendererInfo = 0;
2016  if ( ! renderManager().rendererExists(rendererNameString) ) {
2017  rendererInfo = renderManager().newRenderer(rendererNameString);
2018  } else {
2019  emit log(LOGERR,tr("Error: Renderer Plugin %1 already exists").arg(rendererNameString));
2020  }
2021 
2022  // Retrieve and store renderer information
2023  if ( rendererInfo != 0) {
2024  rendererInfo->plugin = renderPlugin;
2025  rendererInfo->name = basePlugin->name();
2026  rendererInfo->version = basePlugin->version();
2027  rendererInfo->description = basePlugin->description();
2028 
2029  ACG::SceneGraph::DrawModes::DrawMode supportedModes;
2030 
2031  // Get the supported draw modes of the renderer
2032  QMetaObject::invokeMethod(plugin,"supportedDrawModes", Q_ARG(ACG::SceneGraph::DrawModes::DrawMode& ,supportedModes) );
2033 
2034  rendererInfo->modes = supportedModes;
2035 
2036  if ( checkSlot( plugin , "optionsAction()" ) ) {
2037  //Get an action for the post processor options
2038  rendererInfo->optionsAction = renderPlugin->optionsAction();
2039 
2040  } else {
2041  rendererInfo->optionsAction = 0;
2042  }
2043  }
2044 
2045  } else {
2046  emit log(LOGERR,tr("Error: Renderer Plugin without rendererName Function?!"));
2047  }
2048 
2049  }
2050 
2051  //Check if the plugin supports PostProcessorInterface
2052  PostProcessorInterface* postProcessorPlugin = qobject_cast< PostProcessorInterface * >(plugin);
2053  if ( postProcessorPlugin ) {
2054  supported = supported + "PostProcessor ";
2055 
2056  if ( checkSlot( plugin , "postProcessorName()" ) ) {
2057  QString postProcessorNameString = "";
2058 
2059  // Get the name of the PostProcessor
2060  QMetaObject::invokeMethod(plugin,"postProcessorName", Qt::DirectConnection, Q_RETURN_ARG(QString,postProcessorNameString) ) ;
2061 
2062  // Let the plugin check its OpenGL support requirements
2063  QString openGLCheck = "";
2064  QMetaObject::invokeMethod(plugin,"checkOpenGL", Qt::DirectConnection, Q_RETURN_ARG(QString,openGLCheck) ) ;
2065 
2066  if ( openGLCheck != "" ) {
2067  emit log(LOGERR,tr("Error: Insufficient OpenGL capabilities in post processor Plugin ") + postProcessorNameString + " !");
2068  emit log(LOGERR,openGLCheck);
2069  return;
2070  }
2071 
2072  // Check if it already exists and add it if not.
2073  PostProcessorInfo* postProcessorInfo = 0;
2074  if ( ! postProcessorManager().postProcessorExists(postProcessorNameString) ) {
2075  postProcessorInfo = postProcessorManager().newPostProcessor(postProcessorNameString);
2076  } else {
2077  emit log(LOGERR,tr("Error: PostProcessor Plugin %1 already exists").arg(postProcessorNameString));
2078  }
2079 
2080  // Retrieve and store PostProcessor information
2081  if ( postProcessorInfo != 0) {
2082  postProcessorInfo->plugin = postProcessorPlugin;
2083  postProcessorInfo->name = basePlugin->name();
2084  postProcessorInfo->version = basePlugin->version();
2085  postProcessorInfo->description = basePlugin->description();
2086 
2087  if ( checkSlot( plugin , "optionsAction()" ) ) {
2088  //Get an action for the post processor options
2089  postProcessorInfo->optionsAction = postProcessorPlugin->optionsAction();
2090 
2091  } else {
2092  postProcessorInfo->optionsAction = 0;
2093  }
2094  }
2095 
2096  } else {
2097  emit log(LOGERR,tr("Error: PostProcessor Plugin without postProcessorName Function?!"));
2098  }
2099  }
2100 
2101  //Check if the plugin supports AboutInfo-Interface
2102  AboutInfoInterface* aboutInfoPlugin = qobject_cast< AboutInfoInterface * >(plugin);
2103  if ( aboutInfoPlugin && OpenFlipper::Options::gui() ) {
2104  supported = supported + "AboutInfo ";
2105 
2106  if ( checkSignal(plugin,"addAboutInfo(QString,QString)") )
2107  connect(plugin , SIGNAL(addAboutInfo(QString,QString)),
2108  coreWidget_ , SLOT(addAboutInfo(QString,QString)),Qt::DirectConnection);
2109  }
2110 
2111  //========================================================================================
2112  // === Collect Scripting Information for Plugin ============================
2113 
2114  QScriptValue scriptInstance = scriptEngine_.newQObject(plugin,
2115  QScriptEngine::QtOwnership,
2116  QScriptEngine::ExcludeChildObjects |
2117  QScriptEngine::ExcludeSuperClassMethods |
2118  QScriptEngine::ExcludeSuperClassProperties
2119  );
2120 
2121  // Make plugin available for scripting
2122  QString scriptingName = info.rpcName;
2123 
2124  scriptEngine_.globalObject().setProperty(scriptingName, scriptInstance);
2125 
2126  QScriptValueIterator it(scriptInstance);
2127  while (it.hasNext()) {
2128  it.next();
2129 
2131  if ( checkSignal( plugin, it.name().toLatin1() ) )
2132  continue;
2133 
2134  info.rpcFunctions.push_back( it.name() );
2135 
2136  scriptingFunctions_.push_back( scriptingName + "." + it.name() );
2137 
2138  }
2139 
2140  //Check if the plugin supports RPC-Interface
2141  ScriptInterface* scriptPlugin = qobject_cast< ScriptInterface * >(plugin);
2142  if ( scriptPlugin ) {
2143  supported = supported + "Scripting ";
2144 
2145  // Create intermediate wrapper class which will mangle the call information
2146  ScriptingWrapper* newScript = new ScriptingWrapper(info.rpcName);
2147  scriptingWrappers_.push_back(newScript);
2148 
2149  //========= Part one, Scriptinfos via wrapper to core and than to scipting Plugin ==========
2150 
2151  if ( checkSignal(plugin,"scriptInfo(QString)" ) ) {
2152 
2153  // Plugin to wrapper
2154  connect(plugin , SIGNAL( scriptInfo(QString) ),
2155  newScript , SLOT( slotScriptInfo(QString) ) ,Qt::DirectConnection );
2156 
2157  // wrapper to core
2158  connect(newScript , SIGNAL( scriptInfo(QString,QString) ),
2159  this , SLOT( slotScriptInfo(QString,QString) ));
2160  }
2161 
2162  // Core to plugins ( normally only one scripting plugin)
2163  if ( checkSlot(plugin,"slotScriptInfo(QString,QString)") ) {
2164  connect(this , SIGNAL(scriptInfo(QString,QString)),
2165  plugin , SLOT(slotScriptInfo(QString,QString)));
2166  }
2167 
2168  // Function descriptions
2169  if ( checkSignal(plugin,"getDescription(QString,QString&,QStringList&,QStringList&)") )
2170  connect(plugin , SIGNAL( getDescription(QString,QString&,QStringList&,QStringList&) ),
2171  this , SLOT( slotGetDescription(QString,QString&,QStringList&,QStringList&) ));
2172 
2173  //========= Script Execution ==========
2174 
2175  // Plugins to Core
2176  if ( checkSignal(plugin,"executeScript(QString)") )
2177  connect(plugin , SIGNAL(executeScript(QString)),
2178  this , SLOT(slotExecuteScript(QString)));
2179 
2180  // Plugins to Core
2181  if ( checkSignal(plugin,"executeFileScript(QString)") )
2182  connect(plugin , SIGNAL(executeFileScript(QString)),
2183  this , SLOT(slotExecuteFileScript(QString)));
2184 
2185  // Core to plugins ( normally only one scripting plugin)
2186  if ( checkSlot(plugin,"slotExecuteScript(QString)") )
2187  connect(this , SIGNAL(executeScript(QString)),
2188  plugin , SLOT(slotExecuteScript(QString)));
2189 
2190  // Core to plugins ( normally only one scripting plugin)
2191  if ( checkSlot(plugin,"slotExecuteFileScript(QString)") )
2192  connect(this , SIGNAL(executeFileScript(QString)),
2193  plugin , SLOT(slotExecuteFileScript(QString)));
2194 
2195  //========= Engine ==========
2196 
2197  // Plugins to Core
2198  if ( checkSignal(plugin,"getScriptingEngine(QScriptEngine*&)") )
2199  connect(plugin , SIGNAL(getScriptingEngine(QScriptEngine*&)),
2200  this , SLOT(slotGetScriptingEngine(QScriptEngine*&)));
2201 
2202  // Plugins to Core
2203  if ( checkSignal(plugin,"getAvailableFunctions(QStringList&)") )
2204  connect(plugin , SIGNAL(getAvailableFunctions(QStringList&)),
2205  this , SLOT(slotGetAllAvailableFunctions(QStringList&)));
2206 
2207  }
2208 
2209  //========================================================================================
2210  //========================================================================================
2211 
2212  info.status = PluginInfo::LOADED;
2213  if (alreadyLoadedAt != -1)
2214  plugins_[alreadyLoadedAt] = info;
2215  else
2216  plugins_.push_back(info);
2217 
2218  // Initialize Plugin
2219  if ( basePlugin ) {
2220  if ( checkSlot(plugin,"initializePlugin()") )
2221  QMetaObject::invokeMethod(plugin, "initializePlugin", Qt::DirectConnection);
2222  }
2223 
2224 
2225  //Check if its a filePlugin
2226  FileInterface* filePlugin = qobject_cast< FileInterface * >(plugin);
2227  if ( filePlugin ){
2228  supported = supported + "File ";
2229 
2230  QStringList loadFilters = filePlugin->getLoadFilters().split(";;");
2231  QStringList saveFilters = filePlugin->getSaveFilters().split(";;");
2232 
2233  // Collect supported Data from file plugin
2234  for (int i = 0; i < loadFilters.size(); ++i) {
2235  fileTypes ft;
2236  ft.name = basePlugin->name();
2237  ft.type = filePlugin->supportedType();
2238  ft.loadFilters = loadFilters[i];
2239  ft.saveFilters = "";
2240  ft.plugin = filePlugin;
2241  ft.object = plugin;
2242  ft.saveMultipleObjects = checkSlot(plugin,"saveObjects(IdList,QString)");
2243 
2244  supportedTypes().push_back(ft);
2245  }
2246  for (int i = 0; i < saveFilters.size(); ++i) {
2247  fileTypes ft;
2248  ft.name = basePlugin->name();
2249  ft.type = filePlugin->supportedType();
2250  ft.loadFilters = "";
2251  ft.saveFilters = saveFilters[i];
2252  ft.plugin = filePlugin;
2253  ft.object = plugin;
2254  ft.saveMultipleObjects = checkSlot(plugin,"saveObjects(IdList,QString)");
2255 
2256  supportedTypes().push_back(ft);
2257  }
2258 
2259 
2260  if ( checkSignal(plugin,"openedFile(int)" ) )
2261  connect(plugin , SIGNAL( openedFile( int ) ) ,
2262  this , SLOT( slotFileOpened ( int ) ),Qt::DirectConnection);
2263  }
2264 
2265  //Check if it's a typePlugin
2266  TypeInterface* typePlugin = qobject_cast< TypeInterface * >(plugin);
2267  if ( typePlugin ){
2268  supported = supported + "Type ";
2269 
2270  // Call register type
2271  typePlugin->registerType();
2272 
2273  // Collect supported Data from type plugin
2274  dataTypes dt;
2275  dt.name = basePlugin->name();
2276  dt.type = typePlugin->supportedType();
2277  dt.plugin = typePlugin;
2278 
2279  // Add type info
2280  supportedDataTypes_.push_back(dt);
2281 
2282  // Connect signals ( But only if we not already connected in in the loadsave interface )
2283  if ( !LoadSavePlugin && checkSignal(plugin,"emptyObjectAdded(int)" ) )
2284  connect(plugin , SIGNAL( emptyObjectAdded( int ) ) ,
2285  this , SLOT( slotEmptyObjectAdded ( int ) ),Qt::DirectConnection);
2286  }
2287 
2288  MetadataInterface* metadataPlugin = qobject_cast< MetadataInterface * >(plugin);
2289  if ( metadataPlugin ) {
2290  if (checkSlot(plugin, "slotGenericMetadataDeserialized(QString,QString)")) {
2291  connect(this, SIGNAL(genericMetadataDeserialized(QString, QString)),
2292  plugin, SLOT(slotGenericMetadataDeserialized(QString, QString)));
2293  }
2294  if (checkSlot(plugin, "slotObjectMetadataDeserialized(QString,QString)")) {
2295  connect(this, SIGNAL(objectMetadataDeserialized(QString, QString)),
2296  plugin, SLOT(slotObjectMetadataDeserialized(QString, QString)));
2297  }
2298 #if QT_VERSION >= 0x050000
2299  if (checkSlot(plugin, "slotObjectMetadataDeserializedJson(QString,QJsonDocument)")) {
2300  connect(this, SIGNAL(objectMetadataDeserializedJson(QString, QJsonDocument)),
2301  plugin, SLOT(slotObjectMetadataDeserializedJson(QString, QJsonDocument)));
2302  }
2303 #endif
2304  if (checkSignal(plugin, "metadataDeserialized(QVector<QPair<QString,QString> >)")) {
2305  connect(plugin, SIGNAL(metadataDeserialized(QVector<QPair<QString, QString> >)),
2306  this, SLOT(slotMetadataDeserialized(QVector<QPair<QString, QString> >)));
2307  }
2308  }
2309 
2310  emit log(LOGOUT,"================================================================================");
2311 
2312 }
ACG::SceneGraph::DrawModes::DrawMode modes
Supported DrawModes.
Definition: RendererInfo.hh:86
Options Dialog interface.
QAction * optionsAction
Possible action to add an options action or menu to the system.
Definition: RendererInfo.hh:89
void loadPlugin(const QString &_filename, const bool _silent, QString &_licenseErrors, QObject *_plugin=0)
Function for loading Plugins.
Interface class for creating custom context menus.
Interface class for receiving mouse events.
Predefined datatypes.
Definition: DataTypes.hh:96
virtual DataType supportedType()=0
Return your supported object type( e.g. DATA_TRIANGLE_MESH )
QPluginLoader * waitForNextLoader()
virtual QAction * optionsAction()
Return options menu.
QString name
Name of the plugin ( requested from the plugin on load)
Definition: PluginInfo.hh:130
Logtype
Log types for Message Window.
DLLEXPORT void registerTypes()
Definition: Types.cc:433
Control OpenFlippers status bar.
Allow to connect slots between plugins.
Keyboard Event Interface.
Definition: KeyInterface.hh:76
QString rpcName
Clean rpc name of the plugin.
Definition: PluginInfo.hh:142
virtual DataType supportedDataTypes()=0
Get data type for information requests.
QAction * optionsAction
Possible action to add an options action or menu to the system.
Defines the order in which plugins have to be loaded.
Enables implementers to react on deserialization of meta data.
Interface class for type definitions.
RendererInfo * newRenderer(QString _name)
Get a new renderer Instance.
Definition: RendererInfo.cc:98
QString description
Description of the plugin ( requested from the plugin on load)
Definition: RendererInfo.hh:83
virtual bool initializeOptionsWidget(QWidget *&_widget)=0
Initialize the Options Widget.
DLLEXPORT OpenFlipperQSettings & OpenFlipperSettings()
QSettings object containing all program settings of OpenFlipper.
Interface to add global image post processor functions from within plugins.
Interface for all Plugins which provide scriptable Functions.
Interface class for Plugins which have to store information in ini files.
Definition: INIInterface.hh:81
Interface class from which all plugins have to be created.
Interface class for Thread handling.
QString path
Path to the plugin ( set on load )
Definition: PluginInfo.hh:139
bool buildIn
Indicates, if the plugin is a built in Plugin (in Plugin directory)
Definition: PluginInfo.hh:172
Update type class.
Definition: UpdateType.hh:70
void slotShowPlugins()
Show Plugins Dialog.
bool checkSignal(QObject *_plugin, const char *_signalSignature)
Check if a plugin has a signal.
Plugins can add its own toolbox to the main widget&#39;s toolbox area by using this interface.
Interface for all Plugins which do logging to the logging window of the framework.
Interface to add additional rendering functions from within plugins.
virtual QString getLoadFilters()=0
void setValue(const QString &key, const QVariant &value)
Wrapper function which makes it possible to enable Debugging output with -DOPENFLIPPER_SETTINGS_DEBUG...
void slotLoadPlugin()
Load Plugins from menu.
Interface for all plugins which provide entries to the main menubar.
PostProcessorInfo * newPostProcessor(QString _name)
Get a new post processor Instance.
QVariant value(const QString &key, const QVariant &defaultValue=QVariant()) const
QString description
Description of the plugin.
virtual QString name()=0
Return a name for the plugin.
Class for the handling of simple configuration files.
Definition: INIFile.hh:105
void expectLoaders(int count)
QString name
Name of the plugin ( requested from the plugin on load)
QObject * plugin
Pointer to the loaded plugin (Already casted when loading it)
Definition: PluginInfo.hh:127
QString description
Description of the plugin ( requested from the plugin on load)
Definition: PluginInfo.hh:133
virtual DataType supportedType()=0
Return your supported object type( e.g. DATA_TRIANGLE_MESH )
Interface class for file handling.
QWidget * optionsWidget
Pointer to plugins options widget (if available)
Definition: PluginInfo.hh:169
Interface for all plugins which want to use selection functions.
Provide texture support for a plugin.
std::vector< int > IdList
Standard Type for id Lists used for scripting.
Definition: DataTypes.hh:192
virtual QString getSaveFilters()=0
PostProcessorInterface * plugin
Pointer to the loaded plugin (Already casted when loading it)
virtual QString description()=0
Return a description of what the plugin is doing.
Interface class for adding view modes to the ui.
void slotUnBlockPlugin(const QString &_rpcName)
Function for UnBlocking Plugins. Plugins will not loaded automatically.
applicationStatus
Enum for the statusBar Status Icon.
QString version
Version of the plugin ( requested from the plugin on load)
Definition: RendererInfo.hh:80
PreloadThread(PreloadAggregator *aggregator)
Preload thread constructor.
RenderInterface * plugin
Pointer to the loaded plugin (Already casted when loading it)
Definition: RendererInfo.hh:74
Interface for all plugins which want to Load or Save files and create Objects.
Interface class for adding copy protection and license management to a plugin.
QStringList rpcFunctions
List of exported rpc slots.
Definition: PluginInfo.hh:145
void loaderReady(QPluginLoader *loader)
virtual QString version()
Return a version string for your plugin.
void slotBlockPlugin(const QString &_rpcName)
Function for Blocking Plugins. Blocked plugins will unloaded and not loaded wthin the next starts...
QString version
Version of the plugin.
void loadPlugins()
Load all plugins from default plugin directory and from INI-File.
bool checkSlot(QObject *_plugin, const char *_slotSignature)
Check if a plugin has a slot.
About Info interface.
Interface to call functions across plugins.
Definition: RPCInterface.hh:71
virtual QAction * optionsAction()
Return options menu.
QString version
Version of the plugin.
Definition: PluginInfo.hh:136
Interface class for providing information on objects.
Interface class for backup handling.
void run()
preload function
QString name
Name of the plugin ( requested from the plugin on load)
Definition: RendererInfo.hh:77
Add a toolbox to OpenFlipper.
Allow access to picking functions.