Remove the QFactoryInterface dependency from platform plugins
Change-Id: I4010e59dcd8a790e06bb9a0ccf3cc9a5c7737ed1 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This commit is contained in:
parent
d173da37ee
commit
0b69385e42
@ -66,10 +66,10 @@ QPlatformIntegration *QPlatformIntegrationFactory::create(const QString& key, co
|
||||
// Try loading the plugin from platformPluginPath first:
|
||||
if (!platformPluginPath.isEmpty()) {
|
||||
QCoreApplication::addLibraryPath(platformPluginPath);
|
||||
if (QPlatformIntegration *ret = qLoadPlugin1<QPlatformIntegration, QPlatformIntegrationFactoryInterface >(directLoader(), platform, paramList))
|
||||
if (QPlatformIntegration *ret = qLoadPlugin1<QPlatformIntegration, QPlatformIntegrationPlugin>(directLoader(), platform, paramList))
|
||||
return ret;
|
||||
}
|
||||
if (QPlatformIntegration *ret = qLoadPlugin1<QPlatformIntegration, QPlatformIntegrationFactoryInterface >(loader(), platform, paramList))
|
||||
if (QPlatformIntegration *ret = qLoadPlugin1<QPlatformIntegration, QPlatformIntegrationPlugin>(loader(), platform, paramList))
|
||||
return ret;
|
||||
#endif
|
||||
return 0;
|
||||
|
@ -61,24 +61,15 @@ QT_BEGIN_NAMESPACE
|
||||
|
||||
class QPlatformIntegration;
|
||||
|
||||
struct QPlatformIntegrationFactoryInterface : public QFactoryInterface
|
||||
{
|
||||
virtual QPlatformIntegration *create(const QString &key, const QStringList ¶mList) = 0;
|
||||
};
|
||||
|
||||
#define QPlatformIntegrationFactoryInterface_iid "org.qt-project.Qt.QPlatformIntegrationFactoryInterface"
|
||||
|
||||
Q_DECLARE_INTERFACE(QPlatformIntegrationFactoryInterface, QPlatformIntegrationFactoryInterface_iid)
|
||||
|
||||
class Q_GUI_EXPORT QPlatformIntegrationPlugin : public QObject, public QPlatformIntegrationFactoryInterface
|
||||
class Q_GUI_EXPORT QPlatformIntegrationPlugin : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_INTERFACES(QPlatformIntegrationFactoryInterface:QFactoryInterface)
|
||||
public:
|
||||
explicit QPlatformIntegrationPlugin(QObject *parent = 0);
|
||||
~QPlatformIntegrationPlugin();
|
||||
|
||||
virtual QStringList keys() const = 0;
|
||||
virtual QPlatformIntegration *create(const QString &key, const QStringList ¶mList) = 0;
|
||||
};
|
||||
|
||||
|
@ -66,10 +66,10 @@ QPlatformTheme *QPlatformThemeFactory::create(const QString& key, const QString
|
||||
// Try loading the plugin from platformPluginPath first:
|
||||
if (!platformPluginPath.isEmpty()) {
|
||||
QCoreApplication::addLibraryPath(platformPluginPath);
|
||||
if (QPlatformTheme *ret = qLoadPlugin1<QPlatformTheme, QPlatformThemeFactoryInterface>(directLoader(), platform, paramList))
|
||||
if (QPlatformTheme *ret = qLoadPlugin1<QPlatformTheme, QPlatformThemePlugin>(directLoader(), platform, paramList))
|
||||
return ret;
|
||||
}
|
||||
if (QPlatformTheme *ret = qLoadPlugin1<QPlatformTheme, QPlatformThemeFactoryInterface>(loader(), platform, paramList))
|
||||
if (QPlatformTheme *ret = qLoadPlugin1<QPlatformTheme, QPlatformThemePlugin>(loader(), platform, paramList))
|
||||
return ret;
|
||||
#endif
|
||||
return 0;
|
||||
|
@ -58,27 +58,17 @@ QT_BEGIN_HEADER
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
|
||||
class QPlatformTheme;
|
||||
|
||||
struct QPlatformThemeFactoryInterface : public QFactoryInterface
|
||||
{
|
||||
virtual QPlatformTheme *create(const QString &key, const QStringList ¶mList) = 0;
|
||||
};
|
||||
|
||||
#define QPlatformThemeFactoryInterface_iid "org.qt-project.Qt.QPlatformThemeFactoryInterface"
|
||||
|
||||
Q_DECLARE_INTERFACE(QPlatformThemeFactoryInterface, QPlatformThemeFactoryInterface_iid)
|
||||
|
||||
class Q_GUI_EXPORT QPlatformThemePlugin : public QObject, public QPlatformThemeFactoryInterface
|
||||
class Q_GUI_EXPORT QPlatformThemePlugin : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_INTERFACES(QPlatformThemeFactoryInterface:QFactoryInterface)
|
||||
public:
|
||||
explicit QPlatformThemePlugin(QObject *parent = 0);
|
||||
~QPlatformThemePlugin();
|
||||
|
||||
virtual QStringList keys() const = 0;
|
||||
virtual QPlatformTheme *create(const QString &key, const QStringList ¶mList) = 0;
|
||||
};
|
||||
|
||||
|
@ -53,17 +53,9 @@ class QCocoaIntegrationPlugin : public QPlatformIntegrationPlugin
|
||||
Q_OBJECT
|
||||
Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QPlatformIntegrationFactoryInterface" FILE "cocoa.json")
|
||||
public:
|
||||
QStringList keys() const;
|
||||
QPlatformIntegration *create(const QString&, const QStringList&);
|
||||
};
|
||||
|
||||
QStringList QCocoaIntegrationPlugin::keys() const
|
||||
{
|
||||
QStringList list;
|
||||
list << "Cocoa";
|
||||
return list;
|
||||
}
|
||||
|
||||
QPlatformIntegration * QCocoaIntegrationPlugin::create(const QString& system, const QStringList& paramList)
|
||||
{
|
||||
Q_UNUSED(paramList);
|
||||
|
@ -60,18 +60,9 @@ class QDirectFbIntegrationPlugin : public QPlatformIntegrationPlugin
|
||||
Q_OBJECT
|
||||
Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QPlatformIntegrationFactoryInterface" FILE "directfb.json")
|
||||
public:
|
||||
QStringList keys() const;
|
||||
QPlatformIntegration *create(const QString&, const QStringList&);
|
||||
};
|
||||
|
||||
QStringList QDirectFbIntegrationPlugin::keys() const
|
||||
{
|
||||
QStringList list;
|
||||
list << "directfb";
|
||||
QT_EGL_BACKEND_STRING(list);
|
||||
return list;
|
||||
}
|
||||
|
||||
QPlatformIntegration * QDirectFbIntegrationPlugin::create(const QString& system, const QStringList& paramList)
|
||||
{
|
||||
Q_UNUSED(paramList);
|
||||
|
@ -49,17 +49,9 @@ class QEglFSIntegrationPlugin : public QPlatformIntegrationPlugin
|
||||
Q_OBJECT
|
||||
Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QPlatformIntegrationFactoryInterface" FILE "eglfs.json")
|
||||
public:
|
||||
QStringList keys() const;
|
||||
QPlatformIntegration *create(const QString&, const QStringList&);
|
||||
};
|
||||
|
||||
QStringList QEglFSIntegrationPlugin::keys() const
|
||||
{
|
||||
QStringList list;
|
||||
list << "EglFS";
|
||||
return list;
|
||||
}
|
||||
|
||||
QPlatformIntegration* QEglFSIntegrationPlugin::create(const QString& system, const QStringList& paramList)
|
||||
{
|
||||
Q_UNUSED(paramList);
|
||||
|
@ -49,17 +49,9 @@ class QKmsIntegrationPlugin : public QPlatformIntegrationPlugin
|
||||
Q_OBJECT
|
||||
Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QPlatformIntegrationFactoryInterface" FILE "kms.json")
|
||||
public:
|
||||
QStringList keys() const;
|
||||
QPlatformIntegration *create(const QString&, const QStringList&);
|
||||
};
|
||||
|
||||
QStringList QKmsIntegrationPlugin::keys() const
|
||||
{
|
||||
QStringList list;
|
||||
list << "kms";
|
||||
return list;
|
||||
}
|
||||
|
||||
QPlatformIntegration *QKmsIntegrationPlugin::create(const QString& system, const QStringList& paramList)
|
||||
{
|
||||
Q_UNUSED(paramList);
|
||||
|
@ -47,17 +47,9 @@ QT_BEGIN_NAMESPACE
|
||||
class QLinuxFbIntegrationPlugin : public QPlatformIntegrationPlugin
|
||||
{
|
||||
public:
|
||||
QStringList keys() const;
|
||||
QPlatformIntegration *create(const QString&, const QStringList&);
|
||||
};
|
||||
|
||||
QStringList QLinuxFbIntegrationPlugin::keys() const
|
||||
{
|
||||
QStringList list;
|
||||
list << "LinuxFb";
|
||||
return list;
|
||||
}
|
||||
|
||||
QPlatformIntegration* QLinuxFbIntegrationPlugin::create(const QString& system, const QStringList& paramList)
|
||||
{
|
||||
Q_UNUSED(paramList);
|
||||
|
@ -50,17 +50,9 @@ class QMinimalIntegrationPlugin : public QPlatformIntegrationPlugin
|
||||
Q_OBJECT
|
||||
Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QPlatformIntegrationFactoryInterface" FILE "minimal.json")
|
||||
public:
|
||||
QStringList keys() const;
|
||||
QPlatformIntegration *create(const QString&, const QStringList&);
|
||||
};
|
||||
|
||||
QStringList QMinimalIntegrationPlugin::keys() const
|
||||
{
|
||||
QStringList list;
|
||||
list << "Minimal";
|
||||
return list;
|
||||
}
|
||||
|
||||
QPlatformIntegration *QMinimalIntegrationPlugin::create(const QString& system, const QStringList& paramList)
|
||||
{
|
||||
Q_UNUSED(paramList);
|
||||
|
@ -47,17 +47,9 @@ QT_BEGIN_NAMESPACE
|
||||
class QOpenWFDIntegrationPlugin : public QPlatformIntegrationPlugin
|
||||
{
|
||||
public:
|
||||
QStringList keys() const;
|
||||
QPlatformIntegration *create(const QString&, const QStringList&);
|
||||
};
|
||||
|
||||
QStringList QOpenWFDIntegrationPlugin::keys() const
|
||||
{
|
||||
QStringList list;
|
||||
list << "OpenWFD";
|
||||
return list;
|
||||
}
|
||||
|
||||
QPlatformIntegration* QOpenWFDIntegrationPlugin::create(const QString& system, const QStringList& paramList)
|
||||
{
|
||||
Q_UNUSED(paramList);
|
||||
|
@ -44,13 +44,6 @@
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
QStringList QQnxIntegrationPlugin::keys() const
|
||||
{
|
||||
QStringList list;
|
||||
list << QLatin1String("qnx");
|
||||
return list;
|
||||
}
|
||||
|
||||
QPlatformIntegration *QQnxIntegrationPlugin::create(const QString& system, const QStringList& paramList)
|
||||
{
|
||||
Q_UNUSED(paramList);
|
||||
|
@ -48,7 +48,6 @@ class QQnxIntegrationPlugin : public QPlatformIntegrationPlugin
|
||||
Q_OBJECT
|
||||
Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QPlatformIntegrationFactoryInterface" FILE "qnx.json")
|
||||
public:
|
||||
QStringList keys() const;
|
||||
QPlatformIntegration *create(const QString&, const QStringList&);
|
||||
};
|
||||
|
||||
|
@ -107,15 +107,9 @@ class QWindowsIntegrationPlugin : public QPlatformIntegrationPlugin
|
||||
Q_OBJECT
|
||||
Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QPlatformIntegrationFactoryInterface" FILE "windows.json")
|
||||
public:
|
||||
QStringList keys() const;
|
||||
QPlatformIntegration *create(const QString&, const QStringList&);
|
||||
};
|
||||
|
||||
QStringList QWindowsIntegrationPlugin::keys() const
|
||||
{
|
||||
return QStringList(QStringLiteral("windows"));
|
||||
}
|
||||
|
||||
QPlatformIntegration *QWindowsIntegrationPlugin::create(const QString& system, const QStringList& paramList)
|
||||
{
|
||||
Q_UNUSED(paramList);
|
||||
|
@ -49,17 +49,9 @@ class QXcbIntegrationPlugin : public QPlatformIntegrationPlugin
|
||||
Q_OBJECT
|
||||
Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QPlatformIntegrationFactoryInterface" FILE "xcb.json")
|
||||
public:
|
||||
QStringList keys() const;
|
||||
QPlatformIntegration *create(const QString&, const QStringList&);
|
||||
};
|
||||
|
||||
QStringList QXcbIntegrationPlugin::keys() const
|
||||
{
|
||||
QStringList list;
|
||||
list << "xcb";
|
||||
return list;
|
||||
}
|
||||
|
||||
QPlatformIntegration* QXcbIntegrationPlugin::create(const QString& system, const QStringList& parameters)
|
||||
{
|
||||
if (system.toLower() == "xcb")
|
||||
|
Loading…
Reference in New Issue
Block a user