Commit b8906443 authored by Jan Möbius's avatar Jan Möbius
parents cd161990 5875bf0c
......@@ -51,11 +51,7 @@
#pragma once
#if QT_VERSION >= 0x050000
#include <QtWidgets>
#else
#include <QtGui>
#endif
/** \file AboutInfoInterface.hh
......
......@@ -53,11 +53,7 @@
#include <OpenFlipper/common/Types.hh>
#if QT_VERSION >= 0x050000
#include <QtWidgets>
#else
#include <QtGui>
#endif
/** \file BackupInterface.hh
*
......
......@@ -52,11 +52,7 @@
#define CONTEXTMENUINTERFACE_HH
#include <OpenFlipper/common/Types.hh>
#if QT_VERSION >= 0x050000
#include <QtWidgets>
#else
#include <QtGui>
#endif
#include <QMenuBar>
......
......@@ -53,11 +53,7 @@
#include <OpenFlipper/common/Types.hh>
#if QT_VERSION >= 0x050000
#include <QtWidgets>
#else
#include <QtGui>
#endif
#include <QMenuBar>
......
......@@ -52,11 +52,7 @@
#define KEYINTERFACE_HH
#if QT_VERSION >= 0x050000
#include <QtWidgets>
#else
#include <QtGui>
#endif
......
......@@ -51,11 +51,7 @@
#define MENUBARINTERFACE_HH
#include <OpenFlipper/common/Types.hh>
#if QT_VERSION >= 0x050000
#include <QtWidgets>
#else
#include <QtGui>
#endif
#include <QMenuBar>
......
......@@ -55,9 +55,7 @@
#include <QObject>
#include <QString>
#if QT_VERSION >= 0x050000
#include <QJsonDocument>
#endif
......@@ -110,14 +108,12 @@ class MetadataInterface {
virtual void slotObjectMetadataDeserialized(
QString object_name, QString value) {};
#if QT_VERSION >= 0x050000
/**
* Triggered for every piece of object specific meta data encapsulated
* in "Mesh Comments" if it is valid JSON.
*/
virtual void slotObjectMetadataDeserializedJson(
QString object_name, QJsonDocument value) {};
#endif
signals:
/**
......@@ -154,10 +150,6 @@ to find out which specific signal suits your needs.
*/
#if QT_VERSION >= 0x050000
Q_DECLARE_INTERFACE(MetadataInterface,"OpenFlipper.MetadataInterface_qt5/1.0")
#else
Q_DECLARE_INTERFACE(MetadataInterface,"OpenFlipper.MetadataInterface_qt4/1.0")
#endif
#endif // METADATAINTERFACE_HH
......@@ -52,11 +52,7 @@
#define MOUSEINTERFACE_HH
#if QT_VERSION >= 0x050000
#include <QtWidgets>
#else
#include <QtGui>
#endif
/** \file MouseInterface.hh
......
......@@ -52,11 +52,7 @@
#define OPTIONSINTERFACE_HH
#if QT_VERSION >= 0x050000
#include <QtWidgets>
#else
#include <QtGui>
#endif
/** \file OptionsInterface.hh
......
......@@ -52,11 +52,7 @@
#include <OpenFlipper/common/Types.hh>
#if QT_VERSION >= 0x050000
#include <QtWidgets>
#else
#include <QtGui>
#endif
#include <QMenuBar>
......
......@@ -68,13 +68,7 @@
#ifndef OPENFLIPPERCORE
#ifndef OPENFLIPPERPLUGINLIB
#ifdef WIN32
#pragma message("PluginFunctionsCore is only allowed to be used from within OpenFlippers Core application!")
#else
#warning PluginFunctionsCore is only allowed to be used from within OpenFlippers Core application!
#error Bla
#endif
#error PluginFunctionsCore is only allowed to be used from within OpenFlippers Core application!
#endif
#endif
......
......@@ -52,11 +52,7 @@
#include <OpenFlipper/threads/OpenFlipperThread.hh>
#if QT_VERSION >= 0x050000
#include <QtWidgets>
#else
#include <QtGui>
#endif
/** \file ProcessInterface.hh
......
......@@ -64,10 +64,10 @@ QScriptValue callFunction( QString _plugin, QString _functionName , std::vector<
RPCHelper h;
Qt::ConnectionType connection = Qt::DirectConnection;
if (h.thread() != QThread::currentThread())
if (h.thread() != QApplication::instance()->thread())
{
h.moveToThread(QApplication::instance()->thread());
connection = Qt::QueuedConnection;
connection = Qt::BlockingQueuedConnection;
}
QScriptValue retVal;
......@@ -90,10 +90,10 @@ QScriptValue callFunction( QString _plugin, QString _functionName ) {
RPCHelper h;
Qt::ConnectionType connection = Qt::DirectConnection;
if (h.thread() != QThread::currentThread())
if (h.thread() != QApplication::instance()->thread())
{
h.moveToThread(QApplication::instance()->thread());
connection = Qt::QueuedConnection;
connection = Qt::BlockingQueuedConnection;
}
QScriptValue retVal;
......
......@@ -52,11 +52,7 @@
#include <OpenFlipper/common/Types.hh>
#if QT_VERSION >= 0x050000
#include <QtWidgets>
#else
#include <QtGui>
#endif
/** \file SecurityInterface.hh
......
......@@ -55,11 +55,7 @@
#include <OpenFlipper/common/Types.hh>
#if QT_VERSION >= 0x050000
#include <QtWidgets>
#else
#include <QtGui>
#endif
/** \file SelectionInterface.hh
......
......@@ -52,11 +52,7 @@
#include <OpenFlipper/common/Types.hh>
#if QT_VERSION >= 0x050000
#include <QtWidgets>
#else
#include <QtGui>
#endif
#include <QStatusBar>
......
......@@ -53,11 +53,7 @@
#include <OpenFlipper/common/Types.hh>
#if QT_VERSION >= 0x050000
#include <QtWidgets>
#else
#include <QtGui>
#endif
#include <QMenuBar>
......
......@@ -52,11 +52,7 @@
#include <OpenFlipper/common/Types.hh>
#if QT_VERSION >= 0x050000
#include <QtWidgets>
#else
#include <QtGui>
#endif
#include <QMenuBar>
#include <QStringList>
......
......@@ -51,11 +51,7 @@
#define TOOLBOXINTERFACE_HH
#include <OpenFlipper/common/Types.hh>
#if QT_VERSION >= 0x050000
#include <QtWidgets>
#else
#include <QtGui>
#endif
#include <QMenuBar>
#include <QStringList>
......
......@@ -51,11 +51,7 @@
#define VIEWINTERFACE_HH
#include <OpenFlipper/common/Types.hh>
#if QT_VERSION >= 0x050000
#include <QtWidgets>
#else
#include <QtGui>
#endif
#include <QMenuBar>
......
......@@ -51,11 +51,7 @@
#define VIEWMODEINTERFACE_HH
#if QT_VERSION >= 0x050000
#include <QtWidgets>
#else
#include <QtGui>
#endif
#include <QMenuBar>
#include <QStringList>
......
......@@ -67,11 +67,6 @@
#include <ACG/QtWidgets/QtFileDialog.hh>
// -------------------- Qt
#if QT_VERSION >= 0x050000
#else
#undef QT_NO_OPENGL
#include <QGLFormat>
#endif
#include "OpenFlipper/BasePlugin/KeyInterface.hh"
#include "OpenFlipper/BasePlugin/MouseInterface.hh"
......@@ -93,6 +88,8 @@
#include <OpenFlipper/widgets/messageBox/StaysOnTopMessageBox.hh>
#include <OpenFlipper/common/PluginStorage.hh>
#define WIDGET_HEIGHT 800
#define WIDGET_WIDTH 800
......@@ -241,7 +238,7 @@ Core::init() {
Qt::AlignBottom | Qt::AlignLeft , Qt::white);
}
coreWidget_ = new CoreWidget(viewModes_ , plugins_, coreSlots_);
coreWidget_ = new CoreWidget(viewModes_ , coreSlots_);
spinBoxEventFilter_.registerScrollArea(coreWidget_->getToolboxScrollArea());
spinBoxEventFilter_.registerScrollArea(coreWidget_->getToolboxArea());
......@@ -723,6 +720,12 @@ Core::~Core()
//-----------------------------------------------------------------------------
std::vector<PluginInfo>& Core::plugins() {
return PluginStorage::plugins();
};
//-----------------------------------------------------------------------------
void
Core::slotMouseEventIdentify( QMouseEvent* _event )
{
......@@ -1174,8 +1177,8 @@ void Core::slotExit() {
clearAll();
// Notify plugins of imminent exit.
for ( uint i = 0 ; i < plugins_.size() ; ++i ){
BaseInterface* basePlugin = qobject_cast< BaseInterface * >(plugins_[i].plugin);
for ( uint i = 0 ; i < plugins().size() ; ++i ){
BaseInterface* basePlugin = qobject_cast< BaseInterface * >(plugins()[i].plugin);
// Dont call exit if we cannot get the Plugin
if ( basePlugin )
......@@ -1183,7 +1186,7 @@ void Core::slotExit() {
}
// Delete Plugins to actually call their destructor
for(PluginInfo p : plugins_)
for(PluginInfo p : plugins())
delete p.plugin;
// close the log file to ensure everything is writeen correctly
......@@ -1305,9 +1308,9 @@ void Core::slotSetSlotDescription(QString _slotName, QString _slotDescrip
//find plugin
PluginInfo* pluginInfo = 0;
for (uint i=0; i < plugins_.size(); i++)
if (plugins_[i].plugin == sender())
pluginInfo = &plugins_[i];
for (uint i=0; i < plugins().size(); i++)
if (plugins()[i].plugin == sender())
pluginInfo = &plugins()[i];
if (pluginInfo == 0){
emit log(LOGERR, tr("Unable to set slot-description. Plugin not found!"));
......@@ -1383,9 +1386,9 @@ void Core::slotGetDescription(QString _function, QString& _fnDescript
//find plugin
PluginInfo* pluginInfo = 0;
for (uint i=0; i < plugins_.size(); i++)
if (plugins_[i].rpcName == pluginName)
pluginInfo = &plugins_[i];
for (uint i=0; i < plugins().size(); i++)
if (plugins()[i].rpcName == pluginName)
pluginInfo = &plugins()[i];
if (pluginInfo == 0){
emit log(LOGERR, tr("Unable to get slot-description. Plugin not found!"));
......@@ -1529,12 +1532,12 @@ void Core::writeVersionNumbers(QString _filename){
ini.add_entry( "Core" , "VersionLinux" , OpenFlipper::Options::coreVersion() );
//add pluginVersions
for (uint i=0; i < plugins_.size(); i++){
for (uint i=0; i < plugins().size(); i++){
if ( OpenFlipper::Options::isWindows() )
ini.add_entry( plugins_[i].name , "VersionWindows" , plugins_[i].version );
ini.add_entry( plugins()[i].name , "VersionWindows" , plugins()[i].version );
else
ini.add_entry( plugins_[i].name , "VersionLinux" , plugins_[i].version );
ini.add_entry( plugins()[i].name , "VersionLinux" , plugins()[i].version );
}
ini.disconnect();
......
......@@ -121,7 +121,6 @@
#include <OpenFlipper/threads/JobInfo.hh>
#include <OpenFlipper/common/FileTypes.hh>
#include <OpenFlipper/common/InformationPlugins.hh>
#include "SpinBoxEventFilter.hh"
......@@ -1214,17 +1213,19 @@ private slots:
//===========================================================================
public :
const std::vector<PluginInfo> plugins() const {return plugins_; };
std::vector<PluginInfo>& plugins();
private:
/// List of all loaded plugins_
std::vector<PluginInfo> plugins_;
/// Index of Plugins toolbox widget
int toolboxindex_;
/// Load all plugins from default plugin directory and from INI-File
void loadPlugins();
/// Print all info collected about plugin during loading
void printPluginLoadLog(const QString& errors,const QString& warnings);
private slots:
/// Show Plugins Dialog
void slotShowPlugins();
......@@ -1250,10 +1251,8 @@ private slots:
signals:
void genericMetadataDeserialized(QString key, QString value);
void objectMetadataDeserialized(QString object_name, QString value);
#if QT_VERSION >= 0x050000
void objectMetadataDeserializedJson(
QString object_name, QJsonDocument value);
#endif
private slots:
void slotMetadataDeserialized( const QVector<QPair<QString, QString> > &data);
......
......@@ -467,11 +467,11 @@ void connectPlugins( Core* c, const std::vector<PluginInfo>& plugins_, QString _
}
void Core::slotCrossPluginConnect( QString _pluginName1, const char* _signal, QString _pluginName2, const char* _slot) {
connectPlugins(this, plugins_, _pluginName1, _signal, _pluginName2, _slot, false);
connectPlugins(this, plugins(), _pluginName1, _signal, _pluginName2, _slot, false);
}
void Core::slotCrossPluginConnectQueued( QString _pluginName1, const char* _signal, QString _pluginName2, const char* _slot) {
connectPlugins(this, plugins_, _pluginName1, _signal, _pluginName2, _slot, true);
connectPlugins(this, plugins(), _pluginName1, _signal, _pluginName2, _slot, true);
}
//========================================================================================
......@@ -533,7 +533,6 @@ void Core::slotMetadataDeserialized(
const QStringRef value = obj_metadata.midRef(cursor, next - cursor);
emit objectMetadataDeserialized(current_object_name, value.toString());
#if QT_VERSION >= 0x050000
QJsonParseError json_error;
QJsonDocument json_doc =
QJsonDocument::fromJson(value.toUtf8(), &json_error);
......@@ -541,7 +540,6 @@ void Core::slotMetadataDeserialized(
emit objectMetadataDeserializedJson(
current_object_name, json_doc);
}
#endif
cursor = next + re_end.matchedLength();
state = STATE_SEARCH_BEGIN;
break;
......
......@@ -85,6 +85,8 @@ class PluginInfo{
version(""),
path(""),
rpcName(""),
errors(""),
warnings(""),
optionsWidget(0),
buildIn(true),
status(FAILED)
......@@ -108,6 +110,8 @@ class PluginInfo{
version(_i.version),
path(_i.path),
rpcName(_i.rpcName),
errors(_i.errors),
warnings(_i.warnings),
rpcFunctions(_i.rpcFunctions),
slotInfos(_i.slotInfos),
keys(_i.keys),
......@@ -141,6 +145,12 @@ class PluginInfo{
/// Clean rpc name of the plugin
QString rpcName;
/// Store errors encountered during plugin loading
QString errors;
/// Store warnings encountered during plugin loading
QString warnings;
/// List of exported rpc slots
QStringList rpcFunctions;
......
This diff is collapsed.
......@@ -68,8 +68,8 @@
void Core::slotPluginExists( QString _pluginName , bool& _exists ) {
for ( int i = 0 ; i < (int)plugins_.size(); ++i ) {
if ( plugins_[i].rpcName == _pluginName ) {
for ( int i = 0 ; i < (int)plugins().size(); ++i ) {
if ( plugins()[i].rpcName == _pluginName ) {
_exists = true;
return;
}
......@@ -82,8 +82,8 @@ void Core::slotFunctionExists( QString _pluginName , QString _functionName , boo
//Find plugin
int plugin = -1;
for ( int i = 0 ; i < (int)plugins_.size(); ++i ) {
if ( plugins_[i].rpcName == _pluginName ) {
for ( int i = 0 ; i < (int)plugins().size(); ++i ) {
if ( plugins()[i].rpcName == _pluginName ) {
plugin = i;
break;
}
......@@ -94,15 +94,15 @@ void Core::slotFunctionExists( QString _pluginName , QString _functionName , boo
return;
}
_exists = plugins_[plugin].rpcFunctions.contains(_functionName);
_exists = plugins()[plugin].rpcFunctions.contains(_functionName);
}
void Core::slotCall( QString _pluginName , QString _functionName , bool& _success ) {
//Find plugin
int plugin = -1;
for ( int i = 0 ; i < (int)plugins_.size(); ++i ) {
if ( plugins_[i].rpcName == _pluginName ) {
for ( int i = 0 ; i < (int)plugins().size(); ++i ) {
if ( plugins()[i].rpcName == _pluginName ) {
plugin = i;
break;
}
......@@ -114,7 +114,7 @@ void Core::slotCall( QString _pluginName , QString _functionName , bool& _succes
return;
}
if ( !plugins_[plugin].rpcFunctions.contains(_functionName) ) {
if ( !plugins()[plugin].rpcFunctions.contains(_functionName) ) {
_success = false;
emit log(LOGERR, tr("Unable to call function from Plugin : ") + _pluginName);
emit log(LOGERR, tr("Function ") + _functionName + tr(" not found!"));
......
......@@ -52,6 +52,9 @@
//#include <ObjectTypes/Light/Light.hh>
#include <OpenFlipper/common/FileTypes.hh>
/// Save Settings (slot is called from CoreWidget's File-Menu)
void Core::saveSettings(){
......
......@@ -231,13 +231,13 @@ void Core::setToolBoxSide(QString _side) {
//-----------------------------------------------------------------------------
QWidget *Core::getToolbox(QString _pluginName, QString _toolboxName) {
std::vector<PluginInfo>::const_iterator pluginIt = plugins_.end();
for (std::vector<PluginInfo>::const_iterator it = plugins_.begin(), it_end = plugins_.end(); it != it_end; ++it) {
std::vector<PluginInfo>::const_iterator pluginIt = plugins().end();
for (std::vector<PluginInfo>::const_iterator it = plugins().begin(), it_end = plugins().end(); it != it_end; ++it) {
if (it->name == _pluginName) {
pluginIt = it;
}
}
if (pluginIt == plugins_.end()) return 0;
if (pluginIt == plugins().end()) return 0;
for (std::vector<std::pair<QString , QWidget*> >::const_iterator it = pluginIt->toolboxWidgets.begin(), it_end = pluginIt->toolboxWidgets.end();
it != it_end; ++it) {
......@@ -266,8 +266,8 @@ void Core::addToolbox(QString _name ,QWidget* _widget, QIcon* _icon,
int id = -1;
// Find the plugin which added this Toolbox
for ( uint i = 0 ; i < plugins_.size(); ++i ) {
if ( plugins_[i].plugin == sender() ) {
for ( uint i = 0 ; i < plugins().size(); ++i ) {
if ( plugins()[i].plugin == sender() ) {
id = i;
break;
}
......@@ -275,8 +275,8 @@ void Core::addToolbox(QString _name ,QWidget* _widget, QIcon* _icon,
// Find the scripting plugin because we assign this toolBox to it as we did not find the original sender
if ( id == -1 ) {
for ( uint i = 0 ; i < plugins_.size(); ++i ) {
if ( plugins_[i].name == "Scripting" ) {
for ( uint i = 0 ; i < plugins().size(); ++i ) {
if ( plugins()[i].name == "Scripting" ) {
id = i;
break;
}
......@@ -290,9 +290,9 @@ void Core::addToolbox(QString _name ,QWidget* _widget, QIcon* _icon,
}
spinBoxEventFilter_.hookUpToWidgetTree(_widget);
plugins_[id].toolboxWidgets.push_back( std::pair< QString,QWidget* >( _name , _widget) );
plugins_[id].toolboxIcons.push_back( _icon );
plugins_[id].headerAreaWidgets.push_back( std::pair< QString,QWidget* >( _name , _headerAreaWidget) );
plugins()[id].toolboxWidgets.push_back( std::pair< QString,QWidget* >( _name , _widget) );
plugins()[id].toolboxIcons.push_back( _icon );
plugins()[id].headerAreaWidgets.push_back( std::pair< QString,QWidget* >( _name , _headerAreaWidget) );
// add widget name to viewMode 'all'
if ( !viewModes_[0]->visibleToolboxes.contains(_name) ){
......
......@@ -144,6 +144,7 @@ if (WIN32)
-DUSEACG
-DPLUGINLIBDLL
-DUSEPLUGINLIBDLL
-DFREEGLUT_LIB_PRAGMAS=0
)
endif ()
......@@ -359,7 +360,16 @@ elseif(WIN32)
file (GLOB qtplugin_dirs RELATIVE "${QT_PLUGINS_DIR}" "${QT_PLUGINS_DIR}/*" )
file(MAKE_DIRECTORY "${CMAKE_BINARY_DIR}/Build/QtPlugins" )
foreach (qtplugin ${qtplugin_dirs})
file(COPY "${QT_PLUGINS_DIR}/${qtplugin}" DESTINATION "${CMAKE_BINARY_DIR}/Build/QtPlugins/")
# Exclude PDB files if we build release mode
if ( CMAKE_BUILD_TYPE MATCHES "Debug" )
file(COPY "${QT_PLUGINS_DIR}/${qtplugin}"
DESTINATION "${CMAKE_BINARY_DIR}/Build/QtPlugins/" )
else()
file(COPY "${QT_PLUGINS_DIR}/${qtplugin}"
DESTINATION "${CMAKE_BINARY_DIR}/Build/QtPlugins/"
PATTERN "*.pdb" EXCLUDE )
endif()
endforeach ()
endif( APPLE )
......
......@@ -19,6 +19,7 @@
- <b>ACG</b>
- Clamp shininess in Materialnode (caused GL Errors)
- Better Material support in Materialnode (emissive and refractive materials)
- Use ShaderGenerator for picking shaders
- <b>Plugins</b>
- File-OBJ
- Read emissive and refractive materials
......
......@@ -10,6 +10,13 @@
* --no-splash : Disable splash screen\n
* --disable-stereo : Disable Stereo Mode\n
*
* OpenGL Options:\n
* -profile < compat | core > : request Compatibility or %Core context ( Default = %Core )\n
* -glVersion <int.int> : request specified OpenGL version (Default = 3.2)\n
* -samples <int> : request MSAA with <int> samples (Default = 16)\n
* -glStereo <true | false> : request creation of stereo buffers
* \note The OpenGL command line parameters override stored settings temporarily. To permanently store an OpenGL setting, use the options dialog.
*
* Log options:\n
* --log-to-console ( -c ) : Write logger window contents to console\n
* \note On Window Systems, using the --log-to-console option causes the creation of a console if OpenFlipper was started without one.
......
......@@ -49,11 +49,7 @@
#include <QApplication>
#if QT_VERSION >= 0x050000
#include <QtWidgets>
#else
#include <QtGui>
#endif
#include <QtWidgets>
#include <QFile>
#include <QMessageBox>
......
......@@ -48,12 +48,7 @@
\*===========================================================================*/