714void Core::loadPlugin(
const QString& _filename,
const bool _silent, QString& _licenseErrors, QObject* _plugin){
719 if ( OpenFlipper::Options::isWindows() ) {
720 QString dllname = _filename;
721 if ( ! dllname.endsWith(
".dll" ) )
725 if ( OpenFlipper::Options::isLinux() ) {
726 QString soname = _filename;
727 if ( ! soname.endsWith(
".so" ) )
735 QString errors, warnings;
740 if ( _plugin == 0 ) {
741 QPluginLoader loader( _filename );
742 plugin = loader.instance();
746 errors += tr(
"Error: Unable to load Plugin :\t %1").arg( _filename ) +
"\n";
747 errors += tr(
"Error: Error was : ") + loader.errorString() +
"\n";
751 emit
log(
LOGOUT,
"================================================================================");
753 emit
log (
LOGOUT,tr(
"Plugin loaded: \t %1").arg(_filename));
762 int alreadyLoadedAt = -1;
763 for (
unsigned int k=0; k <
plugins().size(); k++)
765 if (
plugins()[k].path == _filename)
766 alreadyLoadedAt =
static_cast<int>(k);
768 info.status = PluginInfo::FAILED;
769 info.
path = _filename;
772 emit
log(
LOGOUT,tr(
"Location : \t %1").arg( _filename) );
775 BaseInterface* basePlugin = qobject_cast< BaseInterface * >(plugin);
784 QStringList additionalPlugins = OpenFlipperSettings().
value(
"PluginControl/AdditionalPlugins", QStringList()).toStringList();
785 info.
buildIn = !additionalPlugins.contains(info.
path);
787 emit
log(
LOGOUT,tr(
"Found Plugin : \t %1").arg(basePlugin->
name()) );
795 for (
unsigned int k=0; k <
plugins().size(); k++){
797 QString name_nospace = basePlugin->
name();
798 name_nospace.remove(
" ");
800 if (
plugins()[k].name == name_nospace &&
plugins()[k].path != _filename &&
plugins()[k].status == PluginInfo::LOADED){
801 if (_silent || OpenFlipper::Options::nogui() ){
803 warnings += tr(
"Warning: Already loaded from %1").arg(
plugins()[k].path) +
"\n";
812 PluginStorage::pluginsFailed().push_back(info);
817 tr(
"Plugin already loaded"),
818 tr(
"A Plugin with the same name was already loaded from %1.\n"
819 "You can only load the new plugin if you unload the existing one first.\n\n"
820 "Do you want to unload the existing plugin first?").arg(
plugins()[k].path),
821 QMessageBox::Yes|QMessageBox::No, QMessageBox::No);
822 if (ret == QMessageBox::No)
824 warnings += tr(
"Warning: Already loaded from %1.").arg(
plugins()[k].path) +
"\n";
833 PluginStorage::pluginsFailed().push_back(info);
840 QStringList dontLoadPlugins = OpenFlipperSettings().
value(
"PluginControl/DontLoadNames",QStringList()).toStringList();
842 if ( dontLoadPlugins.contains(basePlugin->
name(), Qt::CaseInsensitive) ) {
844 warnings += tr(
"Warning: OpenFlipper.ini prevented Plugin %1 from being loaded! ").arg( basePlugin->
name() ) +
"\n";
848 info.status = PluginInfo::BLOCKED;
853 PluginStorage::pluginsFailed().push_back(info);
860 if ( securePlugin ) {
861 emit
log(
LOGINFO,tr(
"Plugin uses security interface. Trying to authenticate against plugin ..."));
863 bool success =
false;
864 QMetaObject::invokeMethod(plugin,
"authenticate", Q_RETURN_ARG(
bool , success ) ) ;
866 QString message =
"";
867 QMetaObject::invokeMethod(plugin,
"licenseError", Q_RETURN_ARG( QString , message ) ) ;
868 _licenseErrors = message;
871 emit
log(
LOGINFO,tr(
"... ok. Loading plugin "));
874 errors += tr(
"Error: Failed to load plugin. Plugin access denied by license management.");
884 PluginStorage::pluginsFailed().push_back(info);
892 supported =
"BaseInterface ";
898 info.
version = QString::number(-1);
900 if ( OpenFlipper::Options::nogui() ) {
902 if ( !
checkSlot( plugin ,
"noguiSupported()" ) ) {
903 warnings += tr(
"Warning: Running in nogui mode which is unsupported by this plugin, skipping");
910 PluginStorage::pluginsFailed().push_back(info);
919 if (
checkSignal(plugin,
"updated_objects(int)") ) {
921 errors += tr(
"Error: Plugin Uses old style updated_objects! Convert to updatedObject!") +
"\n";
928 PluginStorage::pluginsFailed().push_back(info);
934 errors += tr(
"Error: Plugin Uses old style update_view! Convert to updateView!") +
"\n";
941 PluginStorage::pluginsFailed().push_back(info);
949 if (
checkSignal(plugin,
"blockScenegraphUpdates(bool)") )
952 if (
checkSignal(plugin,
"updatedObject(int)") &&
checkSignal(plugin,
"updatedObject(int,const UpdateType&)") ){
954 errors += tr(
"Error: Plugin uses deprecated and(!) new updatedObject. Only new updatedObject will be active.") +
"\n";
956 log(
LOGERR,tr(
"Plugin uses deprecated and(!) new updatedObject. Only new updatedObject will be active."));
962 warnings += tr(
"Warning: Plugin uses deprecated updatedObject.") +
"\n";
964 log(
LOGWARN,tr(
"Plugin uses deprecated updatedObject."));
965 connect(plugin,SIGNAL(updatedObject(
int)),
this,SLOT(
slotObjectUpdated(
int)), Qt::AutoConnection);
968 if (
checkSignal(plugin,
"updatedObject(int,const UpdateType&)") )
972 if (
checkSlot( plugin ,
"slotObjectUpdated(int)" ) &&
checkSlot( plugin ,
"slotObjectUpdated(int,const UpdateType&)" ) ){
973 errors += tr(
"Error: Plugin uses deprecated and(!) new slotObjectUpdated. Only new slotObjectUpdated will be active.") +
"\n";
975 log(
LOGERR,tr(
"Plugin uses deprecated and(!) new slotObjectUpdated. Only new slotObjectUpdated will be active."));
980 if (
checkSlot( plugin ,
"slotObjectUpdated(int)" ) ){
981 warnings += tr(
"Warning: Plugin uses deprecated slotObjectUpdated.") +
"\n";
982 log(
LOGWARN,tr(
"Plugin uses deprecated slotObjectUpdated."));
986 if (
checkSlot( plugin ,
"slotObjectUpdated(int,const UpdateType&)" ) )
990 if (
checkSignal(plugin,
"objectPropertiesChanged(int)")) {
991 errors += tr(
"Error: Signal objectPropertiesChanged(int) is deprecated.") +
"\n";
992 errors += tr(
"Error: The signal will be automatically emitted by the object that has been changed and the core will deliver it to the plugins!.") +
"\n";
993 errors += tr(
"Error: Please remove this signal from your plugins!.") +
"\n";
996 if (
checkSlot( plugin ,
"slotViewChanged()" ) )
997 connect(
this,SIGNAL(
pluginViewChanged()),plugin,SLOT(slotViewChanged()), Qt::DirectConnection);
999 if (
checkSlot( plugin ,
"slotSceneDrawn()" ) )
1000 connect(
this,SIGNAL(
pluginSceneDrawn()),plugin,SLOT(slotSceneDrawn()), Qt::DirectConnection);
1002 if (
checkSlot( plugin ,
"slotDrawModeChanged(int)" ) )
1003 connect(
coreWidget_,SIGNAL(drawModeChanged(
int)),plugin,SLOT(slotDrawModeChanged(
int)), Qt::DirectConnection);
1005 if (
checkSlot(plugin,
"slotObjectPropertiesChanged(int)"))
1008 if (
checkSignal(plugin,
"visibilityChanged()" ) ) {
1009 errors += tr(
"Error: Signal visibilityChanged() now requires objectid or -1 as argument.") +
"\n";
1012 if (
checkSignal(plugin,
"visibilityChanged(int)") ) {
1013 errors += tr(
"Error: Signal visibilityChanged(int) is deprecated!") +
"\n";
1014 errors += tr(
"Error: If an object changes its visibility, it will call the required functions automatically.") +
"\n";
1015 errors += tr(
"Error: If you change a scenegraph node, call nodeVisibilityChanged(int). See docu of this function for details.") +
"\n";
1018 if (
checkSignal(plugin,
"nodeVisibilityChanged(int)") )
1019 connect(plugin,SIGNAL(nodeVisibilityChanged(
int)),
this,SLOT(
slotVisibilityChanged(
int)), Qt::DirectConnection);
1022 if (
checkSlot(plugin,
"slotVisibilityChanged(int)") )
1025 if (
checkSignal(plugin,
"activeObjectChanged()" ) ) {
1026 errors += tr(
"Error: Signal activeObjectChanged() is now objectSelectionChanged( int _objectId )") +
"\n";
1029 if (
checkSlot(plugin,
"slotActiveObjectChanged()" ) ) {
1030 errors += tr(
"Error: Slot slotActiveObjectChanged() is now slotObjectSelectionChanged( int _objectId ) ") +
"\n";
1033 if (
checkSlot(plugin,
"slotAllCleared()") )
1034 connect(
this,SIGNAL(
allCleared()),plugin,SLOT(slotAllCleared()));
1037 if (
checkSignal(plugin,
"objectSelectionChanged(int)") ) {
1038 errors += tr(
"Error: Signal objectSelectionChanged(in) is deprecated!") +
"\n";
1039 errors += tr(
"Error: If the selection for an object is changed, the core will emit the required signals itself!") +
"\n";
1042 if (
checkSlot( plugin ,
"slotObjectSelectionChanged(int)" ) )
1046 if (
checkSlot( plugin ,
"pluginsInitialized()" ) )
1049 if (
checkSlot( plugin ,
"pluginsInitialized(QVector<QPair<QString,QString>>const&)" ) )
1052 if (
checkSignal(plugin,
"setSlotDescription(QString,QString,QStringList,QStringList)") )
1059 if (
checkSignal(plugin,
"setRenderer(unsigned int,QString)" ) ) {
1060 connect(plugin,SIGNAL(setRenderer(
unsigned int,QString)),
this,SLOT(
slotSetRenderer(
unsigned int,QString)));
1063 if (
checkSignal(plugin,
"getCurrentRenderer(unsigned int,QString&)" ) ) {
1064 connect(plugin,SIGNAL(getCurrentRenderer(
unsigned int,QString&)),
this,SLOT(
slotGetCurrentRenderer(
unsigned int,QString&)), Qt::DirectConnection);
1073 supported = supported +
"Logging ";
1079 connect(plugin,SIGNAL(
log(QString )),newlog,SLOT(
slotLog(QString )),Qt::DirectConnection);
1082 if ( OpenFlipper::Options::gui() )
1092 if (
checkSlot(plugin,
"logOutput(Logtype,QString)") )
1097 MenuInterface* menubarPlugin = qobject_cast< MenuInterface * >(plugin);
1098 if ( menubarPlugin && OpenFlipper::Options::gui() ) {
1099 supported = supported +
"Menubar ";
1101 if (
checkSignal(plugin,
"addMenubarAction(QAction*,QString)") )
1102 connect(plugin , SIGNAL(addMenubarAction(QAction*,QString)),
1103 coreWidget_ , SLOT(slotAddMenubarAction(QAction*,QString)),Qt::DirectConnection);
1104 if (
checkSignal(plugin,
"addMenubarActions(std::vector<QAction*>, QString)") )
1105 connect(plugin , SIGNAL(addMenubarActions(std::vector<QAction*>,QString)),
1106 coreWidget_ , SLOT(slotAddMenubarActions(std::vector<QAction*>,QString)),Qt::DirectConnection);
1107 if (
checkSignal(plugin,
"getMenubarMenu (QString,QMenu*&,bool)") )
1108 connect(plugin , SIGNAL(getMenubarMenu (QString,QMenu*&,
bool)),
1109 coreWidget_ , SLOT(slotGetMenubarMenu (QString,QMenu*&,
bool)),Qt::DirectConnection);
1114 if ( contextMenuPlugin && OpenFlipper::Options::gui() ) {
1115 supported = supported +
"ContextMenu ";
1117 if (
checkSignal(plugin,
"addContextMenuItem(QAction*,ContextMenuType)") )
1118 connect(plugin , SIGNAL(addContextMenuItem(QAction*,
ContextMenuType)),
1121 if (
checkSignal(plugin,
"addContextMenuItem(QAction*,DataType,ContextMenuType)") )
1126 connect(plugin , SIGNAL(hideContextMenu()),
1127 coreWidget_ , SLOT(slotHideContextMenu()),Qt::DirectConnection);
1129 if (
checkSlot(plugin,
"slotUpdateContextMenu(int)") )
1130 connect(
coreWidget_ , SIGNAL(updateContextMenu(
int)),
1131 plugin , SLOT(slotUpdateContextMenu(
int)),Qt::DirectConnection);
1133 if (
checkSlot(plugin,
"slotUpdateContextMenuNode(int)") )
1134 connect(
coreWidget_ , SIGNAL(updateContextMenuNode(
int)),
1135 plugin , SLOT(slotUpdateContextMenuNode(
int)),Qt::DirectConnection);
1137 if (
checkSlot(plugin,
"slotUpdateContextMenuBackground()") )
1138 connect(
coreWidget_ , SIGNAL(updateContextMenuBackground()),
1139 plugin , SLOT(slotUpdateContextMenuBackground()),Qt::DirectConnection);
1143 ToolboxInterface* toolboxPlugin = qobject_cast< ToolboxInterface * >(plugin);
1144 if ( toolboxPlugin && OpenFlipper::Options::gui() ) {
1145 supported = supported +
"Toolbox ";
1148 if (
checkSignal(plugin,
"addToolbox(QString,QWidget*)"))
1149 connect(plugin, SIGNAL(
addToolbox(QString,QWidget*) ),
1150 this, SLOT(
addToolbox(QString,QWidget*) ),Qt::DirectConnection );
1152 if (
checkSignal(plugin,
"addToolbox(QString,QWidget*,QIcon*)"))
1153 connect(plugin, SIGNAL(
addToolbox(QString,QWidget*,QIcon*) ),
1154 this, SLOT(
addToolbox(QString,QWidget*,QIcon*) ),Qt::DirectConnection );
1156 if (
checkSignal(plugin,
"addToolbox(QString,QWidget*,QIcon*,QWidget*)"))
1157 connect(plugin, SIGNAL(
addToolbox(QString,QWidget*,QIcon*,QWidget*) ),
1158 this, SLOT(
addToolbox(QString,QWidget*,QIcon*,QWidget*) ),Qt::DirectConnection );
1162 ViewModeInterface* viewModePlugin = qobject_cast< ViewModeInterface * >(plugin);
1163 if ( viewModePlugin && OpenFlipper::Options::gui() ) {
1164 supported = supported +
"ViewMode ";
1166 if (
checkSignal(plugin,
"defineViewModeToolboxes(QString,QStringList)"))
1167 connect(plugin, SIGNAL( defineViewModeToolboxes(QString, QStringList) ),
1168 coreWidget_, SLOT( slotAddViewModeToolboxes(QString, QStringList) ),Qt::DirectConnection );
1170 if (
checkSignal(plugin,
"defineViewModeToolbars(QString,QStringList)"))
1171 connect(plugin, SIGNAL( defineViewModeToolbars(QString, QStringList) ),
1172 coreWidget_, SLOT( slotAddViewModeToolbars(QString, QStringList) ),Qt::DirectConnection );
1174 if (
checkSignal(plugin,
"defineViewModeContextMenus(QString,QStringList)"))
1175 connect(plugin, SIGNAL( defineViewModeContextMenus(QString, QStringList) ),
1176 coreWidget_, SLOT( slotAddViewModeContextMenus(QString, QStringList) ),Qt::DirectConnection );
1178 if (
checkSignal(plugin,
"defineViewModeIcon(QString,QString)"))
1179 connect(plugin, SIGNAL( defineViewModeIcon(QString, QString) ),
1180 coreWidget_, SLOT( slotSetViewModeIcon(QString, QString) ),Qt::DirectConnection );
1182 if (
checkSignal(plugin,
"setViewMode(QString,bool)"))
1183 connect(plugin, SIGNAL(
setViewMode(QString,
bool) ),
1188 OptionsInterface* optionsPlugin = qobject_cast< OptionsInterface * >(plugin);
1189 if ( optionsPlugin && OpenFlipper::Options::gui() ) {
1190 supported = supported +
"Options ";
1192 QWidget* widget = 0;
1196 if (
checkSlot(plugin,
"applyOptions()") )
1203 ToolbarInterface* toolbarPlugin = qobject_cast< ToolbarInterface * >(plugin);
1204 if ( toolbarPlugin && OpenFlipper::Options::gui() ) {
1205 supported = supported +
"Toolbars ";
1207 if (
checkSignal(plugin,
"addToolbar(QToolBar*)") )
1208 connect(plugin,SIGNAL(addToolbar(QToolBar*)),
1209 coreWidget_,SLOT(slotAddToolbar(QToolBar*)),Qt::DirectConnection);
1211 if (
checkSignal(plugin,
"removeToolbar(QToolBar*)") )
1212 connect(plugin,SIGNAL(removeToolbar(QToolBar*)),
1213 coreWidget_,SLOT(slotRemoveToolbar(QToolBar*)),Qt::DirectConnection);
1215 if (
checkSignal(plugin,
"getToolBar(QString,QToolBar*&)") )
1216 connect(plugin,SIGNAL(getToolBar(QString,QToolBar*&)),
1217 coreWidget_,SLOT(getToolBar(QString,QToolBar*&)),Qt::DirectConnection);
1223 if ( statusbarPlugin && OpenFlipper::Options::gui() ) {
1224 supported = supported +
"StatusBar ";
1226 if (
checkSignal(plugin,
"showStatusMessage(QString,int)") )
1227 connect(plugin,SIGNAL(showStatusMessage(QString,
int)),
1228 coreWidget_,SLOT(statusMessage(QString,
int)),Qt::DirectConnection);
1231 if (
checkSignal(plugin,
"setStatus(ApplicationStatus::applicationStatus)") )
1236 connect(plugin,SIGNAL(clearStatusMessage()),
1239 if (
checkSignal(plugin,
"addWidgetToStatusbar(QWidget*)") )
1240 connect(plugin,SIGNAL(addWidgetToStatusbar(QWidget*)),
coreWidget_,SLOT(addWidgetToStatusbar(QWidget*)));
1244 KeyInterface* keyPlugin = qobject_cast< KeyInterface * >(plugin);
1245 if ( keyPlugin && OpenFlipper::Options::gui() ) {
1246 supported = supported +
"KeyboardEvents ";
1248 if (
checkSignal(plugin,
"registerKey(int,Qt::KeyboardModifiers,QString,bool)") )
1249 connect(plugin,SIGNAL( registerKey(
int, Qt::KeyboardModifiers, QString,
bool) ),
1250 coreWidget_,SLOT(slotRegisterKey(
int, Qt::KeyboardModifiers, QString,
bool)) );
1254 MouseInterface* mousePlugin = qobject_cast< MouseInterface * >(plugin);
1255 if ( mousePlugin && OpenFlipper::Options::gui() ) {
1256 supported = supported +
"MouseEvents ";
1258 if (
checkSlot( plugin ,
"slotMouseWheelEvent(QWheelEvent*,const std::string&)" ) )
1259 connect(
this , SIGNAL(
PluginWheelEvent(QWheelEvent * ,
const std::string & )),
1260 plugin , SLOT(slotMouseWheelEvent(QWheelEvent* ,
const std::string & )));
1262 if (
checkSlot( plugin ,
"slotMouseEvent(QMouseEvent*)" ) )
1266 if (
checkSlot( plugin ,
"slotMouseEventLight(QMouseEvent*)" ) )
1274 if ( infoPlugin && OpenFlipper::Options::gui() ) {
1275 supported = supported +
"TypeInformation ";
1278 supportedInfoTypes().insert(std::pair<InformationInterface*,DataType>(infoPlugin,dtype));
1283 if ( pickPlugin && OpenFlipper::Options::gui() ) {
1284 supported = supported +
"Picking ";
1286 if (
checkSlot( plugin ,
"slotPickModeChanged(const std::string&)" ) )
1287 connect(
coreWidget_,SIGNAL(signalPickModeChanged (
const std::string &)),
1288 plugin,SLOT(slotPickModeChanged(
const std::string &)));
1290 if (
checkSignal(plugin,
"addPickMode(const std::string&)") )
1291 connect(plugin,SIGNAL(addPickMode(
const std::string& )),
1292 this,SLOT(
slotAddPickMode(
const std::string& )),Qt::DirectConnection);
1294 if (
checkSignal(plugin,
"addHiddenPickMode(const std::string&)") )
1295 connect(plugin,SIGNAL(addHiddenPickMode(
const std::string& )),
1298 if (
checkSignal(plugin,
"setPickModeCursor(const std::string&,QCursor)") )
1299 for (
unsigned int i = 0 ; i < OpenFlipper::Options::examinerWidgets() ; ++i )
1300 connect(plugin,SIGNAL(setPickModeCursor(
const std::string& ,QCursor)),
1301 coreWidget_,SLOT(setPickModeCursor(
const std::string& ,QCursor)),Qt::DirectConnection);
1303 if (
checkSignal(plugin,
"setPickModeMouseTracking(const std::string&,bool)") )
1304 for (
unsigned int i = 0 ; i < OpenFlipper::Options::examinerWidgets() ; ++i )
1305 connect(plugin,SIGNAL(setPickModeMouseTracking(
const std::string& ,
bool)),
1306 coreWidget_,SLOT(setPickModeMouseTracking(
const std::string& ,
bool)),Qt::DirectConnection);
1308 if (
checkSignal(plugin,
"setPickModeToolbar(const std::string&,QToolBar*)") )
1309 connect(plugin,SIGNAL(setPickModeToolbar (
const std::string&, QToolBar*)),
1310 coreWidget_,SLOT(setPickModeToolbar (
const std::string&, QToolBar*)),Qt::DirectConnection);
1312 if (
checkSignal(plugin,
"removePickModeToolbar(const std::string&)") )
1313 connect(plugin,SIGNAL(removePickModeToolbar(
const std::string&)),
1314 coreWidget_,SLOT(removePickModeToolbar(
const std::string&)),Qt::DirectConnection);
1319 INIInterface* iniPlugin = qobject_cast< INIInterface * >(plugin);
1321 supported = supported +
"INIFile ";
1323 if (
checkSlot( plugin ,
"loadIniFile(INIFile&,int)" ) )
1325 plugin , SLOT( loadIniFile(
INIFile&,
int) ),Qt::DirectConnection);
1327 if (
checkSlot( plugin ,
"saveIniFile(INIFile&,int)" ) )
1329 plugin , SLOT( saveIniFile(
INIFile& ,
int ) ),Qt::DirectConnection);
1331 if (
checkSlot( plugin ,
"saveIniFileOptions(INIFile&)" ) )
1333 plugin , SLOT( saveIniFileOptions(
INIFile& ) ),Qt::DirectConnection);
1335 if (
checkSlot( plugin ,
"saveOnExit(INIFile&)" ) )
1339 if (
checkSlot( plugin ,
"loadIniFileOptions(INIFile&)" ) )
1341 plugin , SLOT( loadIniFileOptions(
INIFile& ) ),Qt::DirectConnection);
1343 if (
checkSlot( plugin ,
"loadIniFileOptionsLast(INIFile&)" ) )
1345 plugin , SLOT( loadIniFileOptionsLast(
INIFile& ) ),Qt::DirectConnection);
1348#ifdef PYTHON_ENABLED
1351 PythonInterface* pythonPlugin = qobject_cast< PythonInterface * >(plugin);
1352 if ( pythonPlugin ) {
1353 supported = supported +
"PythonInterface ";
1355 QObject* currentPluginPointer = qobject_cast< QObject * >(plugin);
1357 setPluginPointer(basePlugin->
name() , currentPluginPointer);
1359 if (
checkSignal(plugin,
"executePythonScript(QString)")) {
1361 this, SLOT(slotExecutePythonScript(QString)), Qt::DirectConnection);
1364 if (
checkSignal(plugin,
"openPythonScriptInEditor(QString)")) {
1365 connect(plugin, SIGNAL(openPythonScriptInEditor(QString)),
1366 this, SLOT(slotOpenPythonScriptInEditor(QString)), Qt::DirectConnection);
1374 if ( selectionPlugin && OpenFlipper::Options::gui() ) {
1375 supported = supported +
"SelectionBase ";
1377 if (
checkSignal(plugin,
"addSelectionEnvironment(QString,QString,QIcon,QString&)") ) {
1378 errors += tr(
"Error: Plugin uses deprecated addSelectionEnvironment(QString,QString,QIcon,QString&) , Replace the qicon by the path to the icon!") +
"\n";
1379 log(
LOGERR,tr(
"Plugin uses deprecated addSelectionEnvironment(QString,QString,QIcon,QString&) , Replace the qicon by the path to the icon!"));
1382 if (
checkSignal(plugin,
"addSelectionEnvironment(QString,QString,QString,QString&)") )
1388 if (
checkSlot(plugin,
"slotAddSelectionEnvironment(QString,QString,QIcon,QString&)") ) {
1389 errors += tr(
"Error: Plugin uses deprecated slotAddSelectionEnvironment(QString,QString,QIcon,QString&) , Replace the qicon by the path to the icon!") +
"\n";
1392 if (
checkSlot( plugin ,
"slotAddSelectionEnvironment(QString,QString,QString,QString&)" ) )
1398 if (
checkSignal(plugin,
"registerType(QString,DataType)") )
1404 if (
checkSlot( plugin ,
"slotRegisterType(QString,DataType)" ) )
1410 if (
checkSignal(plugin,
"addPrimitiveType(QString,QString,QIcon,SelectionInterface::PrimitiveType&)") ) {
1411 errors += tr(
"Error: Plugin uses deprecated addPrimitiveType(QString,QString,QIcon,SelectionInterface::PrimitiveType&) , Replace the qicon by the path to the icon!") +
"\n";
1414 if (
checkSignal(plugin,
"addPrimitiveType(QString,QString,QString,SelectionInterface::PrimitiveType&)") )
1415 connect(plugin , SIGNAL(
addPrimitiveType(QString,QString,QString,SelectionInterface::PrimitiveType&)),
1416 this , SLOT(
slotAddPrimitiveType(QString,QString,QString,SelectionInterface::PrimitiveType&)),Qt::DirectConnection);
1420 if (
checkSlot(plugin,
"slotAddPrimitiveType(QString,QString,QIcon,SelectionInterface::PrimitiveType&)") )
1421 log(
LOGERR,tr(
"Plugin uses deprecated slotAddPrimitiveType(QString,QString,QIcon,SelectionInterface::PrimitiveType&) , Replace the qicon by the path to the icon!"));
1423 if (
checkSlot( plugin ,
"slotAddPrimitiveType(QString,QString,QString,SelectionInterface::PrimitiveType&)" ) )
1424 connect(
this , SIGNAL(
addPrimitiveType(QString,QString,QString,SelectionInterface::PrimitiveType&)),
1425 plugin , SLOT(
slotAddPrimitiveType(QString,QString,QString,SelectionInterface::PrimitiveType&)),Qt::DirectConnection);
1429 if (
checkSignal(plugin,
"addCustomSelectionMode(QString,QString,QString,QIcon,SelectionInterface::PrimitiveType,QString&)") ) {
1430 errors += tr(
"Error: Plugin uses deprecated addCustomSelectionMode(QString,QString,QString,QIcon,SelectionInterface::PrimitiveType,QString&) , Replace the qicon by the path to the icon!") +
"\n";
1432 log(
LOGERR,tr(
"Plugin uses deprecated addCustomSelectionMode(QString,QString,QString,QIcon,SelectionInterface::PrimitiveType,QString&) , Replace the qicon by the path to the icon!"));
1435 if (
checkSignal(plugin,
"addCustomSelectionMode(QString,QString,QString,QString,SelectionInterface::PrimitiveType,QString&)") )
1436 connect(plugin , SIGNAL(
addCustomSelectionMode(QString,QString,QString,QString,SelectionInterface::PrimitiveType,QString&)),
1437 this , SLOT(
slotAddCustomSelectionMode(QString,QString,QString,QString,SelectionInterface::PrimitiveType,QString&)),Qt::DirectConnection);
1441 if (
checkSignal(plugin,
"addCustomSelectionMode(QString,QString,QString,QIcon,SelectionInterface::PrimitiveType,QString&,DataType)") ) {
1442 errors += tr(
"Error: Plugin uses deprecated addCustomSelectionMode(QString,QString,QString,QIcon,SelectionInterface::PrimitiveType,QString&,DataType) , Replace the qicon by the path to the icon!") +
"\n";
1443 log(
LOGERR,tr(
"Plugin uses deprecated addCustomSelectionMode(QString,QString,QString,QIcon,SelectionInterface::PrimitiveType,QString&,DataType) , Replace the qicon by the path to the icon!"));
1446 if (
checkSignal(plugin,
"addCustomSelectionMode(QString,QString,QString,QIcon,SelectionInterface::PrimitiveType,QString&,DataType)") )
1452 if (
checkSlot(plugin,
"slotAddCustomSelectionMode(QString,QString,QString,QIcon,SelectionInterface::PrimitiveType,QString&)") ) {
1453 errors += tr(
"Error: Plugin uses deprecated slotAddCustomSelectionMode(QString,QString,QString,QIcon,SelectionInterface::PrimitiveType,QString&) , Replace the qicon by the path to the icon!") +
"\n";
1454 log(
LOGERR,tr(
"Plugin uses deprecated slotAddCustomSelectionMode(QString,QString,QString,QIcon,SelectionInterface::PrimitiveType,QString&) , Replace the qicon by the path to the icon!"));
1457 if (
checkSlot( plugin ,
"slotAddCustomSelectionMode(QString,QString,QString,QString,SelectionInterface::PrimitiveType,QString&)" ) )
1458 connect(
this , SIGNAL(
addCustomSelectionMode(QString,QString,QString,QString,SelectionInterface::PrimitiveType,QString&)),
1459 plugin , SLOT(
slotAddCustomSelectionMode(QString,QString,QString,QString,SelectionInterface::PrimitiveType,QString&)),Qt::DirectConnection);
1463 if (
checkSlot(plugin,
"slotAddCustomSelectionMode(QString,QString,QString,QIcon,SelectionInterface::PrimitiveType,QString&,DataType)") ) {
1464 errors += tr(
"Error: Plugin uses deprecated slotAddCustomSelectionMode(QString,QString,QString,QIcon,SelectionInterface::PrimitiveType,QString&,DataType) , Replace the qicon by the path to the icon!") +
"\n";
1465 log(
LOGERR,tr(
"Plugin uses deprecated slotAddCustomSelectionMode(QString,QString,QString,QIcon,SelectionInterface::PrimitiveType,QString&,DataType) , Replace the qicon by the path to the icon!"));
1468 if (
checkSlot( plugin ,
"slotAddCustomSelectionMode(QString,QString,QString,QString,SelectionInterface::PrimitiveType,QString&,DataType)" ) )
1475 if (
checkSignal(plugin,
"addSelectionOperations(QString,QStringList,QString,SelectionInterface::PrimitiveType)") )
1476 connect(plugin , SIGNAL(
addSelectionOperations(QString,QStringList,QString,SelectionInterface::PrimitiveType)),
1477 this , SLOT(
slotAddSelectionOperations(QString,QStringList,QString,SelectionInterface::PrimitiveType)),Qt::DirectConnection);
1479 if (
checkSlot( plugin ,
"slotAddSelectionOperations(QString,QStringList,QString,SelectionInterface::PrimitiveType)" ) )
1480 connect(
this , SIGNAL(
addSelectionOperations(QString,QStringList,QString,SelectionInterface::PrimitiveType)),
1481 plugin , SLOT(
slotAddSelectionOperations(QString,QStringList,QString,SelectionInterface::PrimitiveType)),Qt::DirectConnection);
1483 if (
checkSignal(plugin,
"addSelectionParameters(QString,QWidget*,QString,SelectionInterface::PrimitiveType)") )
1484 connect(plugin , SIGNAL(
addSelectionParameters(QString,QWidget*,QString,SelectionInterface::PrimitiveType)),
1487 if (
checkSlot( plugin ,
"slotAddSelectionParameters(QString,QWidget*,QString,SelectionInterface::PrimitiveType)" ) )
1488 connect(
this , SIGNAL(
addSelectionParameters(QString,QWidget*,QString,SelectionInterface::PrimitiveType)),
1492 if (
checkSignal(plugin,
"selectionOperation(QString)") )
1496 if (
checkSlot( plugin ,
"slotSelectionOperation(QString)" ) )
1500 if (
checkSignal(plugin,
"showToggleSelectionMode(QString,bool,SelectionInterface::PrimitiveType)") )
1504 if (
checkSlot( plugin ,
"slotShowToggleSelectionMode(QString,bool,SelectionInterface::PrimitiveType)" ) )
1508 if (
checkSignal(plugin,
"showLassoSelectionMode(QString,bool,SelectionInterface::PrimitiveType)") )
1512 if (
checkSlot( plugin ,
"slotShowLassoSelectionMode(QString,bool,SelectionInterface::PrimitiveType)" ) )
1516 if (
checkSignal(plugin,
"showVolumeLassoSelectionMode(QString,bool,SelectionInterface::PrimitiveType)") )
1520 if (
checkSlot( plugin ,
"slotShowVolumeLassoSelectionMode(QString,bool,SelectionInterface::PrimitiveType)" ) )
1524 if (
checkSignal(plugin,
"showSurfaceLassoSelectionMode(QString,bool,SelectionInterface::PrimitiveType)") )
1528 if (
checkSlot( plugin ,
"slotShowSurfaceLassoSelectionMode(QString,bool,SelectionInterface::PrimitiveType)" ) )
1532 if (
checkSignal(plugin,
"showSphereSelectionMode(QString,bool,SelectionInterface::PrimitiveType)") )
1536 if (
checkSlot( plugin ,
"slotShowSphereSelectionMode(QString,bool,SelectionInterface::PrimitiveType)" ) )
1540 if (
checkSignal(plugin,
"showClosestBoundarySelectionMode(QString,bool,SelectionInterface::PrimitiveType)") )
1544 if (
checkSlot( plugin ,
"slotShowClosestBoundarySelectionMode(QString,bool,SelectionInterface::PrimitiveType)" ) )
1548 if (
checkSignal(plugin,
"showFloodFillSelectionMode(QString,bool,SelectionInterface::PrimitiveType)") )
1552 if (
checkSlot( plugin ,
"slotShowFloodFillSelectionMode(QString,bool,SelectionInterface::PrimitiveType)" ) )
1556 if (
checkSignal(plugin,
"showComponentsSelectionMode(QString,bool,SelectionInterface::PrimitiveType)") )
1560 if (
checkSlot( plugin ,
"slotShowComponentsSelectionMode(QString,bool,SelectionInterface::PrimitiveType)" ) )
1564 if (
checkSignal(plugin,
"toggleSelection(QMouseEvent*,SelectionInterface::PrimitiveType,bool)") )
1565 connect(plugin , SIGNAL(
toggleSelection(QMouseEvent*,SelectionInterface::PrimitiveType,
bool)),
1566 this , SLOT(
slotToggleSelection(QMouseEvent*,SelectionInterface::PrimitiveType,
bool)),Qt::DirectConnection);
1568 if (
checkSlot( plugin ,
"slotToggleSelection(QMouseEvent*,SelectionInterface::PrimitiveType,bool)" ) )
1569 connect(
this , SIGNAL(
toggleSelection(QMouseEvent*,SelectionInterface::PrimitiveType,
bool)),
1570 plugin , SLOT(
slotToggleSelection(QMouseEvent*,SelectionInterface::PrimitiveType,
bool)),Qt::DirectConnection);
1572 if (
checkSignal(plugin,
"lassoSelection(QMouseEvent*,SelectionInterface::PrimitiveType,bool)") )
1573 connect(plugin , SIGNAL(
lassoSelection(QMouseEvent*,SelectionInterface::PrimitiveType,
bool)),
1574 this , SLOT(
slotLassoSelection(QMouseEvent*,SelectionInterface::PrimitiveType,
bool)),Qt::DirectConnection);
1576 if (
checkSlot( plugin ,
"slotLassoSelection(QMouseEvent*,SelectionInterface::PrimitiveType,bool)" ) )
1577 connect(
this , SIGNAL(
lassoSelection(QMouseEvent*,SelectionInterface::PrimitiveType,
bool)),
1578 plugin , SLOT(
slotLassoSelection(QMouseEvent*,SelectionInterface::PrimitiveType,
bool)),Qt::DirectConnection);
1580 if (
checkSignal(plugin,
"volumeLassoSelection(QMouseEvent*,SelectionInterface::PrimitiveType,bool)") )
1581 connect(plugin , SIGNAL(
volumeLassoSelection(QMouseEvent*,SelectionInterface::PrimitiveType,
bool)),
1584 if (
checkSlot( plugin ,
"slotVolumeLassoSelection(QMouseEvent*,SelectionInterface::PrimitiveType,bool)" ) )
1585 connect(
this , SIGNAL(
volumeLassoSelection(QMouseEvent*,SelectionInterface::PrimitiveType,
bool)),
1586 plugin , SLOT(
slotVolumeLassoSelection(QMouseEvent*,SelectionInterface::PrimitiveType,
bool)),Qt::DirectConnection);
1588 if (
checkSignal(plugin,
"surfaceLassoSelection(QMouseEvent*,SelectionInterface::PrimitiveType,bool)") )
1589 connect(plugin , SIGNAL(
surfaceLassoSelection(QMouseEvent*,SelectionInterface::PrimitiveType,
bool)),
1592 if (
checkSlot( plugin ,
"slotSurfaceLassoSelection(QMouseEvent*,SelectionInterface::PrimitiveType,bool)" ) )
1596 if (
checkSignal(plugin,
"sphereSelection(QMouseEvent*,double,SelectionInterface::PrimitiveType,bool)") )
1597 connect(plugin , SIGNAL(
sphereSelection(QMouseEvent*,
double,SelectionInterface::PrimitiveType,
bool)),
1598 this , SLOT(
slotSphereSelection(QMouseEvent*,
double,SelectionInterface::PrimitiveType,
bool)),Qt::DirectConnection);
1600 if (
checkSlot( plugin ,
"slotSphereSelection(QMouseEvent*,double,SelectionInterface::PrimitiveType,bool)" ) )
1601 connect(
this , SIGNAL(
sphereSelection(QMouseEvent*,
double,SelectionInterface::PrimitiveType,
bool)),
1602 plugin , SLOT(
slotSphereSelection(QMouseEvent*,
double,SelectionInterface::PrimitiveType,
bool)),Qt::DirectConnection);
1604 if (
checkSignal(plugin,
"closestBoundarySelection(QMouseEvent*,SelectionInterface::PrimitiveType,bool)") )
1608 if (
checkSlot( plugin ,
"slotClosestBoundarySelection(QMouseEvent*,SelectionInterface::PrimitiveType,bool)" ) )
1612 if (
checkSignal(plugin,
"floodFillSelection(QMouseEvent*,SelectionInterface::PrimitiveType,bool)") )
1613 connect(plugin , SIGNAL(
floodFillSelection(QMouseEvent*,SelectionInterface::PrimitiveType,
bool)),
1614 this , SLOT(
slotFloodFillSelection(QMouseEvent*,SelectionInterface::PrimitiveType,
bool)),Qt::DirectConnection);
1616 if (
checkSlot( plugin ,
"slotFloodFillSelection(QMouseEvent*,SelectionInterface::PrimitiveType,bool)" ) )
1617 connect(
this , SIGNAL(
floodFillSelection(QMouseEvent*,SelectionInterface::PrimitiveType,
bool)),
1618 plugin , SLOT(
slotFloodFillSelection(QMouseEvent*,SelectionInterface::PrimitiveType,
bool)),Qt::DirectConnection);
1620 if (
checkSignal(plugin,
"componentsSelection(QMouseEvent*,SelectionInterface::PrimitiveType,bool)") )
1621 connect(plugin , SIGNAL(
componentsSelection(QMouseEvent*,SelectionInterface::PrimitiveType,
bool)),
1622 this , SLOT(
slotComponentsSelection(QMouseEvent*,SelectionInterface::PrimitiveType,
bool)),Qt::DirectConnection);
1624 if (
checkSlot( plugin ,
"slotComponentsSelection(QMouseEvent*,SelectionInterface::PrimitiveType,bool)" ) )
1625 connect(
this , SIGNAL(
componentsSelection(QMouseEvent*,SelectionInterface::PrimitiveType,
bool)),
1626 plugin , SLOT(
slotComponentsSelection(QMouseEvent*,SelectionInterface::PrimitiveType,
bool)),Qt::DirectConnection);
1628 if (
checkSignal(plugin,
"customSelection(QMouseEvent*,SelectionInterface::PrimitiveType,QString,bool)") )
1629 connect(plugin , SIGNAL(
customSelection(QMouseEvent*,SelectionInterface::PrimitiveType,QString,
bool)),
1630 this , SLOT(
slotCustomSelection(QMouseEvent*,SelectionInterface::PrimitiveType,QString,
bool)),Qt::DirectConnection);
1632 if (
checkSlot( plugin ,
"slotCustomSelection(QMouseEvent*,SelectionInterface::PrimitiveType,QString,bool)" ) )
1633 connect(
this , SIGNAL(
customSelection(QMouseEvent*,SelectionInterface::PrimitiveType,QString,
bool)),
1634 plugin , SLOT(
slotCustomSelection(QMouseEvent*,SelectionInterface::PrimitiveType,QString,
bool)),Qt::DirectConnection);
1636 if (
checkSignal(plugin,
"getActiveDataTypes(SelectionInterface::TypeList&)") )
1640 if (
checkSlot( plugin ,
"slotGetActiveDataTypes(SelectionInterface::TypeList&)" ) )
1644 if (
checkSignal(plugin,
"getActivePrimitiveType(SelectionInterface::PrimitiveType&)") )
1648 if (
checkSlot( plugin ,
"slotGetActivePrimitiveType(SelectionInterface::PrimitiveType&)" ) )
1652 if (
checkSignal(plugin,
"targetObjectsOnly(bool&)") )
1656 if (
checkSlot( plugin ,
"slotTargetObjectsOnly(bool&)" ) )
1660 if (
checkSignal(plugin,
"loadSelection(const INIFile&)") )
1664 if (
checkSlot( plugin ,
"slotLoadSelection(const INIFile&)" ) )
1668 if (
checkSignal(plugin,
"saveSelection(INIFile&)") )
1672 if (
checkSlot( plugin ,
"slotSaveSelection(INIFile&)" ) )
1676 if (
checkSignal(plugin,
"registerKeyShortcut(int,Qt::KeyboardModifiers)") )
1680 if (
checkSlot( plugin ,
"slotRegisterKeyShortcut(int,Qt::KeyboardModifiers)" ) )
1684 if (
checkSignal(plugin,
"keyShortcutEvent(int,Qt::KeyboardModifiers)") )
1688 if (
checkSlot( plugin ,
"slotKeyShortcutEvent(int,Qt::KeyboardModifiers)" ) )
1694 TextureInterface* texturePlugin = qobject_cast< TextureInterface * >(plugin);
1695 if ( texturePlugin && OpenFlipper::Options::gui() ) {
1696 supported = supported +
"Textures ";
1698 if (
checkSignal(plugin,
"addTexture(QString,QString,uint,int)") )
1699 connect(plugin , SIGNAL(
addTexture( QString , QString , uint ,
int )),
1700 this , SLOT(
slotAddTexture(QString, QString, uint,
int)),Qt::DirectConnection);
1702 if (
checkSignal(plugin,
"addTexture(QString,QImage,uint,int)") )
1703 connect(plugin , SIGNAL(
addTexture( QString , QImage , uint ,
int )),
1704 this , SLOT(
slotAddTexture(QString, QImage, uint,
int)),Qt::DirectConnection);
1706 if (
checkSlot( plugin ,
"slotTextureAdded(QString,QString,uint,int)" ) )
1707 connect(
this , SIGNAL(
addTexture(QString,QString, uint,
int)),
1708 plugin , SLOT(slotTextureAdded(QString,QString, uint,
int)),Qt::DirectConnection);
1710 if (
checkSlot( plugin ,
"slotTextureAdded(QString,QImage,uint,int)" ) )
1711 connect(
this , SIGNAL(
addTexture(QString,QImage, uint,
int)),
1712 plugin , SLOT(slotTextureAdded(QString,QImage, uint,
int)),Qt::DirectConnection);
1714 if (
checkSignal(plugin,
"addTexture(QString,QString,uint)") )
1715 connect(plugin , SIGNAL(
addTexture( QString , QString , uint )),
1716 this , SLOT(
slotAddTexture(QString, QString, uint)),Qt::AutoConnection);
1718 if (
checkSignal(plugin,
"addTexture(QString,QImage,uint)") )
1719 connect(plugin , SIGNAL(
addTexture( QString , QImage , uint )),
1720 this , SLOT(
slotAddTexture(QString, QImage, uint)),Qt::AutoConnection);
1722 if (
checkSlot( plugin ,
"slotTextureAdded(QString,QString,uint)" ) )
1723 connect(
this , SIGNAL(
addTexture(QString,QString, uint)),
1724 plugin , SLOT(slotTextureAdded(QString,QString, uint)),Qt::DirectConnection);
1726 if (
checkSlot( plugin ,
"slotTextureAdded(QString,QImage,uint)" ) )
1727 connect(
this , SIGNAL(
addTexture(QString,QImage, uint)),
1728 plugin , SLOT(slotTextureAdded(QString,QImage, uint)),Qt::DirectConnection);
1730 if (
checkSignal(plugin,
"updateTexture(QString,int)") )
1734 if (
checkSlot( plugin ,
"slotUpdateTexture(QString,int)" ) )
1742 if (
checkSlot( plugin ,
"slotUpdateAllTextures()" ) )
1746 if (
checkSignal(plugin,
"updatedTextures(QString,int)") )
1750 if (
checkSlot( plugin ,
"slotTextureUpdated(QString,int)" ) )
1754 if (
checkSignal(plugin,
"setTextureMode(QString,QString,int)") )
1758 if (
checkSlot( plugin ,
"slotSetTextureMode(QString,QString,int)" ) )
1762 if (
checkSignal(plugin,
"setTextureMode(QString,QString)") )
1766 if (
checkSlot( plugin ,
"slotSetTextureMode(QString,QString)" ) )
1770 if (
checkSignal(plugin,
"switchTexture(QString,int)") )
1774 if (
checkSlot( plugin ,
"slotSwitchTexture(QString,int)" ) )
1778 if (
checkSignal(plugin,
"switchTexture(QString)") )
1782 if (
checkSlot( plugin ,
"slotSwitchTexture(QString)" ) )
1788 if (
checkSignal( plugin ,
"textureChangeImage(QString,QImage&,int)" ) )
1792 if (
checkSlot( plugin ,
"slotTextureChangeImage(QString,QImage&,int)" ) )
1796 if (
checkSignal( plugin ,
"textureChangeImage(QString,QImage&)" ) )
1800 if (
checkSlot( plugin ,
"slotTextureChangeImage(QString,QImage&)" ) )
1804 if (
checkSignal( plugin ,
"addMultiTexture(QString,QString,QString,int,int&)" ) )
1805 connect(plugin , SIGNAL(
addMultiTexture(QString,QString,QString,
int,
int&) ),
1808 if (
checkSignal( plugin ,
"addMultiTexture(QString,QString,QImage,int,int&)" ) )
1809 connect(plugin , SIGNAL(
addMultiTexture(QString,QString,QImage,
int,
int&) ),
1812 if (
checkSlot( plugin ,
"slotMultiTextureAdded( QString,QString,QString,int,int&)" ) )
1813 connect(
this , SIGNAL(
addMultiTexture(QString,QString,QString,
int,
int&) ),
1816 if (
checkSlot( plugin ,
"slotMultiTextureAdded( QString,QString,QImage,int,int&)" ) )
1817 connect(
this , SIGNAL(
addMultiTexture(QString,QString,QImage,
int,
int&) ),
1820 if (
checkSignal( plugin ,
"textureGetImage(QString,QImage&,int)" ) )
1824 if (
checkSlot( plugin ,
"slotTextureGetImage(QString,QImage&,int)" ) )
1828 if (
checkSignal( plugin ,
"textureGetImage(QString,QImage&)" ) )
1832 if (
checkSlot( plugin ,
"slotTextureGetImage(QString,QImage&)" ) )
1836 if (
checkSignal( plugin ,
"textureIndex(QString,int,int&)" ) )
1837 connect(plugin , SIGNAL(
textureIndex(QString,
int,
int&)),
1840 if (
checkSlot( plugin ,
"slotTextureIndex(QString,int,int&)" ) )
1844 if (
checkSignal( plugin ,
"textureIndexPropertyName(int,QString&)" ) )
1848 if (
checkSlot( plugin ,
"slotTextureIndexPropertyName(int,QString&)" ) )
1852 if (
checkSignal( plugin ,
"textureName(int,int,QString&)" ) )
1853 connect(plugin , SIGNAL(
textureName(
int,
int,QString&)),
1856 if (
checkSlot( plugin ,
"slotTextureName(int,int,QString&)" ) )
1857 connect(
this , SIGNAL(
textureName(
int,
int,QString&)),
1858 plugin , SLOT(
slotTextureName(
int,
int,QString&)),Qt::DirectConnection);
1860 if (
checkSignal( plugin ,
"textureFilename(int,QString,QString&)" ) )
1864 if (
checkSlot( plugin ,
"slotTextureFilename(int,QString,QString&)" ) )
1868 if (
checkSignal( plugin ,
"getCurrentTexture(int,QString&)" ) )
1872 if (
checkSlot( plugin ,
"slotGetCurrentTexture(int,QString&)" ) )
1876 if (
checkSignal( plugin ,
"getSubTextures(int,QString,QStringList&)" ) )
1877 connect(plugin , SIGNAL(
getSubTextures(
int,QString,QStringList&)),
1880 if (
checkSlot( plugin ,
"slotGetSubTextures(int,QString,QStringList&)" ) )
1886 BackupInterface* backupPlugin = qobject_cast< BackupInterface * >(plugin);
1887 if ( backupPlugin ) {
1888 supported = supported +
"Backups ";
1891 if (
checkSignal( plugin ,
"createBackup(int,QString,UpdateType)" ) ) {
1896 if (
checkSlot( plugin ,
"slotCreateBackup(int,QString,UpdateType)" ) ) {
1898 plugin , SLOT( slotCreateBackup(
int,QString,
UpdateType) ),Qt::DirectConnection);
1902 if (
checkSignal( plugin ,
"createBackup(IdList,QString,std::vector<UpdateType>)" ) ) {
1904 this , SIGNAL(
createBackup(
IdList,QString,std::vector<UpdateType>)),Qt::DirectConnection );
1907 if (
checkSlot( plugin ,
"slotCreateBackup(IdList,QString,std::vector<UpdateType>)" ) ) {
1909 plugin , SLOT( slotCreateBackup(
IdList,QString,std::vector<UpdateType>) ),Qt::DirectConnection);
1915 connect(plugin , SIGNAL(
undo(
int)) ,
1916 this , SIGNAL(
undo(
int)),Qt::DirectConnection );
1920 if (
checkSlot( plugin ,
"slotUndo(int)" ) ) {
1921 connect(
this , SIGNAL(
undo(
int)),
1922 plugin , SLOT( slotUndo(
int) ),Qt::DirectConnection);
1927 connect(plugin , SIGNAL(
redo(
int)) ,
1928 this , SIGNAL(
redo(
int)),Qt::DirectConnection );
1932 if (
checkSlot( plugin ,
"slotRedo(int)" ) ) {
1933 connect(
this , SIGNAL(
redo(
int)),
1934 plugin , SLOT( slotRedo(
int) ),Qt::DirectConnection);
1939 connect(plugin , SIGNAL(
undo()) ,
1940 this , SIGNAL(
undo()),Qt::DirectConnection );
1944 if (
checkSlot( plugin ,
"slotUndo()" ) ) {
1945 connect(
this , SIGNAL(
undo()),
1946 plugin , SLOT( slotUndo() ),Qt::DirectConnection);
1951 connect(plugin , SIGNAL(
redo()) ,
1952 this , SIGNAL(
redo()),Qt::DirectConnection );
1956 if (
checkSlot( plugin ,
"slotRedo()" ) ) {
1957 connect(
this , SIGNAL(
redo()),
1958 plugin , SLOT( slotRedo() ),Qt::DirectConnection);
1966 if (
checkSignal( plugin ,
"aboutToRestore(int)" ) ) {
1973 connect(plugin , SIGNAL(
restored(
int)) ,
1974 this , SIGNAL(
restored(
int) ),Qt::DirectConnection);
1982 if (
checkSlot( plugin ,
"slotAboutToRestore(int)" ) ) {
1984 plugin , SLOT( slotAboutToRestore(
int) ),Qt::DirectConnection);
1988 if (
checkSlot( plugin ,
"slotRestored(int)" ) ) {
1989 connect(
this , SIGNAL(
restored(
int)) ,
1990 plugin , SLOT( slotRestored(
int) ),Qt::DirectConnection);
1994 if (
checkSignal( plugin ,
"generateBackup(int,QString,UpdateType)" ) ) {
1995 connect(plugin , SIGNAL(generateBackup(
int,QString,
UpdateType)) ,
2001 LoadSaveInterface* LoadSavePlugin = qobject_cast< LoadSaveInterface * >(plugin);
2002 if ( LoadSavePlugin ) {
2003 supported = supported +
"Load/Save ";
2004 if (
checkSignal(plugin,
"load( QString,DataType,int& )" ) )
2005 connect(plugin , SIGNAL(load( QString,
DataType,
int& )) ,
2008 connect(plugin , SIGNAL( save(
int,QString) ) ,
2009 this , SLOT(
saveObject(
int,QString) ), Qt::DirectConnection);
2011 if (
checkSlot( plugin ,
"fileOpened(int)" ) )
2013 plugin , SLOT( fileOpened(
int ) ),Qt::DirectConnection);
2015 if (
checkSignal(plugin,
"addEmptyObject(DataType,int&)" ) )
2019 if (
checkSignal(plugin,
"copyObject(int,int&)" ) )
2020 connect(plugin , SIGNAL( copyObject(
int,
int& )) ,
2024 if (
checkSignal(plugin,
"emptyObjectAdded(int)" ) )
2029 if (
checkSlot(plugin,
"addedEmptyObject(int)" ) )
2031 plugin , SLOT( addedEmptyObject(
int ) ),Qt::DirectConnection);
2035 this , SLOT(
deleteObject(
int ) ),Qt::AutoConnection);
2038 connect(plugin , SIGNAL( deleteAllObjects() ) ,
2041 if (
checkSignal(plugin,
"getAllFileFilters(QStringList&)" ) )
2042 connect(plugin , SIGNAL( getAllFileFilters(QStringList&) ) ,
2045 if (
checkSlot(plugin,
"objectDeleted(int)" ) )
2047 plugin , SLOT(
objectDeleted(
int ) ),Qt::DirectConnection);
2052 ViewInterface* viewPlugin = qobject_cast< ViewInterface * >(plugin);
2053 if ( viewPlugin && OpenFlipper::Options::gui() ) {
2054 supported = supported +
"View ";
2056 if (
checkSignal(plugin,
"getStackWidget(QString,QWidget*&)" ) )
2057 connect(plugin , SIGNAL(getStackWidget( QString , QWidget*&)),
2058 coreWidget_ , SLOT( slotGetStackWidget( QString , QWidget*& ) ) ,Qt::DirectConnection );
2059 if (
checkSignal(plugin,
"addStackWidget(QString,QWidget*)" ) )
2060 connect(plugin , SIGNAL(addStackWidget( QString , QWidget*)),
2061 coreWidget_ , SLOT( slotAddStackWidget( QString , QWidget* ) ) ,Qt::DirectConnection );
2062 if (
checkSignal(plugin,
"updateStackWidget(QString,QWidget*)" ) )
2063 connect(plugin , SIGNAL(updateStackWidget( QString , QWidget*)),
2064 coreWidget_ , SLOT( slotUpdateStackWidget( QString , QWidget* ) ) ,Qt::DirectConnection );
2068 ProcessInterface* processPlugin = qobject_cast< ProcessInterface * >(plugin);
2069 if ( processPlugin ) {
2070 supported = supported +
"Process ";
2072 if (
checkSignal(plugin,
"startJob(QString,QString,int,int,bool)" ) )
2073 connect(plugin , SIGNAL(startJob(QString, QString,
int,
int,
bool)),
2074 this , SLOT(
slotStartJob(QString, QString,
int,
int,
bool) ), Qt::DirectConnection );
2076 errors += tr(
"Error: Process Interface defined but no startJob signal found!") +
"\n";
2079 if (
checkSignal(plugin,
"setJobState(QString,int)" ) )
2080 connect(plugin , SIGNAL(setJobState(QString,
int)),
2083 errors += tr(
"Error: Process Interface defined but no setJobState signal found!") +
"\n";
2086 if (
checkSignal(plugin,
"setJobName(QString,QString)" ) )
2087 connect(plugin , SIGNAL(setJobName(QString, QString)),
2088 this , SLOT(
slotSetJobName(QString, QString) ), Qt::QueuedConnection );
2090 errors += tr(
"Error: Process Interface defined but no setJobName signal found!") +
"\n";
2093 if (
checkSignal(plugin,
"setJobDescription(QString,QString)" ) )
2094 connect(plugin , SIGNAL(setJobDescription(QString, QString)),
2097 errors += tr(
"Error: Process Interface defined but no setJobDescription signal found!") +
"\n";
2101 connect(plugin , SIGNAL(cancelJob(QString)),
2102 this , SLOT(
slotCancelJob(QString) ), Qt::QueuedConnection );
2105 connect(plugin , SIGNAL(finishJob(QString)),
2106 this , SLOT(
slotFinishJob(QString) ), Qt::QueuedConnection );
2108 errors += tr(
"Error: Process Interface defined but no finishJob signal found!") +
"\n";
2111 if (
checkSlot(plugin,
"canceledJob(QString)" ) )
2113 plugin , SLOT( canceledJob(QString) ),Qt::QueuedConnection);
2115 errors += tr(
"Error: Process Interface defined but no cancel canceledJob slot found!") +
"\n";
2120 RPCInterface* rpcPlugin = qobject_cast< RPCInterface * >(plugin);
2122 supported = supported +
"RPC ";
2124 if (
checkSignal(plugin,
"pluginExists(QString,bool&)" ) )
2125 connect(plugin , SIGNAL( pluginExists(QString,
bool&) ),
2127 if (
checkSignal(plugin,
"functionExists(QString,QString,bool&)" ) )
2128 connect(plugin , SIGNAL(functionExists(QString,QString,
bool&)),
2130 if (
checkSignal(plugin,
"call(QString,QString,bool&)" ) )
2131 connect(plugin , SIGNAL(call(QString,QString,
bool&)),
2132 this , SLOT(
slotCall(QString,QString,
bool&)) ,Qt::DirectConnection );
2134 connect(plugin , SIGNAL(call(QString,
bool&)),
2135 this , SLOT(
slotCall(QString,
bool&)) ,Qt::DirectConnection );
2136 if (
checkSignal(plugin,
"getValue(QString,QVariant&)" ) )
2137 connect(plugin , SIGNAL(getValue(QString,QVariant&)),
2138 this , SLOT(
slotGetValue(QString,QVariant&)) ,Qt::DirectConnection );
2143 if ( interconnectionPlugin ) {
2144 supported = supported +
"Plugin Interconnection ";
2146 if (
checkSignal(plugin,
"crossPluginConnect(QString,const char*,QString,const char*)" ) ) {
2147 connect(plugin , SIGNAL( crossPluginConnect(QString,
const char*,QString,
const char*) ),
2151 if (
checkSignal(plugin,
"crossPluginConnectQueued(QString,const char*,QString,const char*)" ) ) {
2152 connect(plugin , SIGNAL( crossPluginConnectQueued(QString,
const char*,QString,
const char*) ),
2158 RenderInterface* renderPlugin = qobject_cast< RenderInterface * >(plugin);
2159 if ( renderPlugin ) {
2160 supported = supported +
"Rendering ";
2162 if (
checkSlot( plugin ,
"rendererName()" ) ) {
2163 QString rendererNameString =
"";
2166 QMetaObject::invokeMethod(plugin,
"rendererName", Qt::DirectConnection, Q_RETURN_ARG(QString,rendererNameString) ) ;
2169 QString openGLCheck =
"";
2170 QMetaObject::invokeMethod(plugin,
"checkOpenGL", Qt::DirectConnection, Q_RETURN_ARG(QString,openGLCheck) ) ;
2172 if ( openGLCheck !=
"" ) {
2173 errors += tr(
"Error: Insufficient OpenGL capabilities in Renderer Plugin ") + rendererNameString +
" !" +
"\n";
2174 errors += openGLCheck +
"\n";
2181 PluginStorage::pluginsFailed().push_back(info);
2188 if ( ! renderManager().rendererExists(rendererNameString) ) {
2189 rendererInfo = renderManager().
newRenderer(rendererNameString);
2191 errors += tr(
"Error: Renderer Plugin %1 already exists") +
"\n";
2195 if ( rendererInfo != 0) {
2196 rendererInfo->
plugin = renderPlugin;
2197 rendererInfo->
name = basePlugin->
name();
2206 rendererInfo->
modes = supportedModes;
2208 if (
checkSlot( plugin ,
"optionsAction()" ) ) {
2218 errors += tr(
"Error: Renderer Plugin without rendererName Function?!") +
"\n";
2225 if ( postProcessorPlugin ) {
2226 supported = supported +
"PostProcessor ";
2228 if (
checkSlot( plugin ,
"postProcessorName()" ) ) {
2229 QString postProcessorNameString =
"";
2232 QMetaObject::invokeMethod(plugin,
"postProcessorName", Qt::DirectConnection, Q_RETURN_ARG(QString,postProcessorNameString) ) ;
2235 QString openGLCheck =
"";
2236 QMetaObject::invokeMethod(plugin,
"checkOpenGL", Qt::DirectConnection, Q_RETURN_ARG(QString,openGLCheck) ) ;
2238 if ( openGLCheck !=
"" ) {
2239 errors += tr(
"Error: Insufficient OpenGL capabilities in post processor Plugin ") + postProcessorNameString +
" !" +
"\n";
2240 errors += openGLCheck +
"\n";
2245 PluginStorage::pluginsFailed().push_back(info);
2252 if ( ! postProcessorManager().postProcessorExists(postProcessorNameString) ) {
2253 postProcessorInfo = postProcessorManager().
newPostProcessor(postProcessorNameString);
2255 errors += tr(
"Error: PostProcessor Plugin %1 already exists").arg(postProcessorNameString) +
"\n";
2259 if ( postProcessorInfo != 0) {
2260 postProcessorInfo->
plugin = postProcessorPlugin;
2261 postProcessorInfo->
name = basePlugin->
name();
2265 if (
checkSlot( plugin ,
"optionsAction()" ) ) {
2275 errors += tr(
"Error: PostProcessor Plugin without postProcessorName Function?!") +
"\n";
2281 if ( aboutInfoPlugin && OpenFlipper::Options::gui() ) {
2282 supported = supported +
"AboutInfo ";
2284 if (
checkSignal(plugin,
"addAboutInfo(QString,QString)") )
2285 connect(plugin , SIGNAL(addAboutInfo(QString,QString)),
2286 coreWidget_ , SLOT(addAboutInfo(QString,QString)),Qt::DirectConnection);
2291#if QT_VERSION_MAJOR < 6
2293 QScriptValue scriptInstance =
scriptEngine_.newQObject(plugin,
2294 QScriptEngine::QtOwnership,
2295 QScriptEngine::ExcludeChildObjects |
2296 QScriptEngine::ExcludeSuperClassMethods |
2297 QScriptEngine::ExcludeSuperClassProperties
2301 QString scriptingName = info.
rpcName;
2303 scriptEngine_.globalObject().setProperty(scriptingName, scriptInstance);
2305 QScriptValueIterator it(scriptInstance);
2306 while (it.hasNext()) {
2310 if (
checkSignal( plugin, it.name().toLatin1() ) )
2324 ScriptInterface* scriptPlugin = qobject_cast< ScriptInterface * >(plugin);
2325 if ( scriptPlugin ) {
2326 supported = supported +
"Scripting ";
2328 #if QT_VERSION_MAJOR < 6
2336 if (
checkSignal(plugin,
"scriptInfo(QString)" ) ) {
2339 connect(plugin , SIGNAL(
scriptInfo(QString) ),
2340 newScript , SLOT(
slotScriptInfo(QString) ) ,Qt::DirectConnection );
2343 connect(newScript , SIGNAL(
scriptInfo(QString,QString) ),
2349 if (
checkSlot(plugin,
"slotScriptInfo(QString,QString)") ) {
2350 connect(
this , SIGNAL(
scriptInfo(QString,QString)),
2355 if (
checkSignal(plugin,
"getDescription(QString,QString&,QStringList&,QStringList&)") )
2356 connect(plugin , SIGNAL( getDescription(QString,QString&,QStringList&,QStringList&) ),
2361 if (
checkSignal(plugin,
"executeScript(QString)") )
2366 if (
checkSlot(plugin,
"slotExecuteScript(QString)") )
2371 if (
checkSlot(plugin,
"slotExecuteFileScript(QString)") )
2378 if (
checkSignal(plugin,
"getScriptingEngine(QScriptEngine*&)") )
2379 connect(plugin , SIGNAL(getScriptingEngine(QScriptEngine*&)),
2383 if (
checkSignal(plugin,
"getAvailableFunctions(QStringList&)") )
2384 connect(plugin , SIGNAL(getAvailableFunctions(QStringList&)),
2396 if (
checkSignal(plugin,
"executeFileScript(QString)") )
2401 if (
checkSignal(plugin,
"showScriptInEditor(QString)") )
2402 connect(plugin , SIGNAL(showScriptInEditor(QString)),
2409 for (
int i=0;i<plugin->metaObject()->methodCount();i++) {
2410 QMetaMethod method = plugin->metaObject()->method(i);
2412 if (method.access() == QMetaMethod::Public) {
2413 const std::string name = method.name().toStdString();
2426 info.status = PluginInfo::LOADED;
2430 if (alreadyLoadedAt != -1) {
2431 plugins()[alreadyLoadedAt] = info;
2441 if (
checkSlot(plugin,
"initializePlugin()") )
2442 QMetaObject::invokeMethod(plugin,
"initializePlugin", Qt::DirectConnection);
2447 FileInterface* filePlugin = qobject_cast< FileInterface * >(plugin);
2449 supported = supported +
"File ";
2451 QStringList loadFilters = filePlugin->
getLoadFilters().split(
";;");
2452 QStringList saveFilters = filePlugin->
getSaveFilters().split(
";;");
2455 for (
int i = 0; i < loadFilters.size(); ++i) {
2457 ft.name = basePlugin->
name();
2459 ft.loadFilters = loadFilters[i];
2460 ft.saveFilters =
"";
2461 ft.plugin = filePlugin;
2463 ft.saveMultipleObjects =
checkSlot(plugin,
"saveObjects(IdList,QString)");
2465 supportedTypes().push_back(ft);
2467 for (
int i = 0; i < saveFilters.size(); ++i) {
2469 ft.name = basePlugin->
name();
2471 ft.loadFilters =
"";
2472 ft.saveFilters = saveFilters[i];
2473 ft.plugin = filePlugin;
2475 ft.saveMultipleObjects =
checkSlot(plugin,
"saveObjects(IdList,QString)");
2477 supportedTypes().push_back(ft);
2482 connect(plugin , SIGNAL(
openedFile(
int ) ) ,
2487 TypeInterface* typePlugin = qobject_cast< TypeInterface * >(plugin);
2489 supported = supported +
"Type ";
2492 typePlugin->registerType();
2496 dt.name = basePlugin->
name();
2498 dt.plugin = typePlugin;
2504 if ( !LoadSavePlugin &&
checkSignal(plugin,
"emptyObjectAdded(int)" ) )
2509 MetadataInterface* metadataPlugin = qobject_cast< MetadataInterface * >(plugin);
2510 if ( metadataPlugin ) {
2511 if (
checkSlot(plugin,
"slotGenericMetadataDeserialized(QString,QString)")) {
2512 connect(
this, SIGNAL(genericMetadataDeserialized(QString, QString)),
2513 plugin, SLOT(slotGenericMetadataDeserialized(QString, QString)));
2515 if (
checkSlot(plugin,
"slotObjectMetadataDeserialized(QString,QString)")) {
2516 connect(
this, SIGNAL(objectMetadataDeserialized(QString, QString)),
2517 plugin, SLOT(slotObjectMetadataDeserialized(QString, QString)));
2519 if (
checkSlot(plugin,
"slotObjectMetadataDeserializedJson(QString,QJsonDocument)")) {
2520 connect(
this, SIGNAL(objectMetadataDeserializedJson(QString, QJsonDocument)),
2521 plugin, SLOT(slotObjectMetadataDeserializedJson(QString, QJsonDocument)));
2523 if (
checkSignal(plugin,
"metadataDeserialized(QVector<QPair<QString,QString> >)")) {
2524 connect(plugin, SIGNAL(metadataDeserialized(QVector<QPair<QString, QString> >)),
2525 this, SLOT(slotMetadataDeserialized(QVector<QPair<QString, QString> >)));