summaryrefslogtreecommitdiffstats
path: root/src/compositor/hardware_integration
diff options
context:
space:
mode:
authorAndy Nichols <andy.nichols@digia.com>2013-02-05 12:22:17 +0100
committerAndy Nichols <andy.nichols@digia.com>2013-02-08 12:34:56 +0100
commit1b39d072c2601d39354fe83dff8b1e5c05095aaf (patch)
tree4b38960a1bcef0de376dc5441ec6372e41341801 /src/compositor/hardware_integration
parent2e0efd201aa75121f4dd4049598f4d120811d784 (diff)
Qt-ify the QtCompositor module
Currently the QtCompositor library and API do not follow the Qt API naming conventions. This commit intends to fix these inconsistencies. filenames start with q headers containing private API's end in _p public API classes begin with Q use the qt namespace macros where necessary Wayland namespace is now QtWayland wayland_wrapper classes are now private API's It's important to make these changes not just for stylistic reasons, but also because when qmake builds the module in checks for these conventions to determine how to deploy the include files. Change-Id: I8bfadeceda92a0f52cb73c704551da75540e7587 Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com>
Diffstat (limited to 'src/compositor/hardware_integration')
-rw-r--r--src/compositor/hardware_integration/hardware_integration.pri17
-rw-r--r--src/compositor/hardware_integration/qwaylandgraphicshardwareintegration.cpp (renamed from src/compositor/hardware_integration/graphicshardwareintegration.cpp)8
-rw-r--r--src/compositor/hardware_integration/qwaylandgraphicshardwareintegration.h (renamed from src/compositor/hardware_integration/graphicshardwareintegration.h)25
-rw-r--r--src/compositor/hardware_integration/qwaylandgraphicshardwareintegrationfactory.cpp (renamed from src/compositor/hardware_integration/graphicshardwareintegrationfactory.cpp)22
-rw-r--r--src/compositor/hardware_integration/qwaylandgraphicshardwareintegrationfactory.h (renamed from src/compositor/hardware_integration/graphicshardwareintegrationfactory.h)12
-rw-r--r--src/compositor/hardware_integration/qwaylandgraphicshardwareintegrationplugin.cpp (renamed from src/compositor/hardware_integration/graphicshardwareintegrationplugin.cpp)9
-rw-r--r--src/compositor/hardware_integration/qwaylandgraphicshardwareintegrationplugin.h (renamed from src/compositor/hardware_integration/graphicshardwareintegrationplugin.h)18
7 files changed, 66 insertions, 45 deletions
diff --git a/src/compositor/hardware_integration/hardware_integration.pri b/src/compositor/hardware_integration/hardware_integration.pri
index 352dbaee6..8477243fe 100644
--- a/src/compositor/hardware_integration/hardware_integration.pri
+++ b/src/compositor/hardware_integration/hardware_integration.pri
@@ -4,21 +4,16 @@ isEmpty(QT_WAYLAND_GL_CONFIG):QT_WAYLAND_GL_CONFIG = $$(QT_WAYLAND_GL_CONFIG)
!isEqual(QT_WAYLAND_GL_CONFIG,nogl) {
HEADERS += \
- $$PWD/graphicshardwareintegration.h
+ hardware_integration/qwaylandgraphicshardwareintegration.h \
+ hardware_integration/qwaylandgraphicshardwareintegrationfactory.h \
+ hardware_integration/qwaylandgraphicshardwareintegrationplugin.h
SOURCES += \
- $$PWD/graphicshardwareintegration.cpp
+ hardware_integration/qwaylandgraphicshardwareintegration.cpp \
+ hardware_integration/qwaylandgraphicshardwareintegrationfactory.cpp \
+ hardware_integration/qwaylandgraphicshardwareintegrationplugin.cpp
DEFINES += QT_COMPOSITOR_WAYLAND_GL
} else {
system(echo "Qt-Compositor configured as raster only compositor")
}
-
-HEADERS += \
- hardware_integration/graphicshardwareintegrationplugin.h \
- hardware_integration/graphicshardwareintegrationfactory.h
-
-SOURCES += \
- hardware_integration/graphicshardwareintegrationplugin.cpp \
- hardware_integration/graphicshardwareintegrationfactory.cpp
-
diff --git a/src/compositor/hardware_integration/graphicshardwareintegration.cpp b/src/compositor/hardware_integration/qwaylandgraphicshardwareintegration.cpp
index 13b460d71..7b213bfa5 100644
--- a/src/compositor/hardware_integration/graphicshardwareintegration.cpp
+++ b/src/compositor/hardware_integration/qwaylandgraphicshardwareintegration.cpp
@@ -38,9 +38,13 @@
**
****************************************************************************/
-#include "graphicshardwareintegration.h"
+#include "qwaylandgraphicshardwareintegration.h"
-GraphicsHardwareIntegration::GraphicsHardwareIntegration()
+QT_BEGIN_NAMESPACE
+
+QWaylandGraphicsHardwareIntegration::QWaylandGraphicsHardwareIntegration()
: m_compositor(0)
{
}
+
+QT_END_NAMESPACE
diff --git a/src/compositor/hardware_integration/graphicshardwareintegration.h b/src/compositor/hardware_integration/qwaylandgraphicshardwareintegration.h
index f6c46debf..373880440 100644
--- a/src/compositor/hardware_integration/graphicshardwareintegration.h
+++ b/src/compositor/hardware_integration/qwaylandgraphicshardwareintegration.h
@@ -45,18 +45,23 @@
#include <QtGui/QOpenGLContext>
#include <wayland-server.h>
-#include <QtCompositor/waylandcompositor.h>
-#include <QtCompositor/wldisplay.h>
+#include <QtCompositor/qwaylandcompositor.h>
-class Q_COMPOSITOR_EXPORT GraphicsHardwareIntegration
+QT_BEGIN_NAMESPACE
+
+namespace QtWayland {
+ class Display;
+}
+
+class Q_COMPOSITOR_EXPORT QWaylandGraphicsHardwareIntegration
{
public:
- GraphicsHardwareIntegration();
- virtual ~GraphicsHardwareIntegration() { }
+ QWaylandGraphicsHardwareIntegration();
+ virtual ~QWaylandGraphicsHardwareIntegration() { }
- void setCompositor(WaylandCompositor *compositor) { m_compositor = compositor; }
+ void setCompositor(QWaylandCompositor *compositor) { m_compositor = compositor; }
- virtual void initializeHardware(Wayland::Display *waylandDisplay) = 0;
+ virtual void initializeHardware(QtWayland::Display *waylandDisplay) = 0;
/** Bind the Wayland buffer to the textureId. The correct context is the current context,
so there is no need to do makeCurrent in this function.
@@ -64,13 +69,15 @@ public:
virtual GLuint createTextureFromBuffer(struct wl_buffer *buffer, QOpenGLContext *context) = 0;
virtual bool isYInverted(struct wl_buffer *) const { return true; }
- virtual bool setDirectRenderSurface(WaylandSurface *) {return false;}
+ virtual bool setDirectRenderSurface(QWaylandSurface *) {return false;}
virtual void *lockNativeBuffer(struct wl_buffer *, QOpenGLContext *) const { return 0; }
virtual void unlockNativeBuffer(void *, QOpenGLContext *) const { return; }
protected:
- WaylandCompositor *m_compositor;
+ QWaylandCompositor *m_compositor;
};
+QT_END_NAMESPACE
+
#endif // GRAPHICSHARDWAREINTEGRATION_H
diff --git a/src/compositor/hardware_integration/graphicshardwareintegrationfactory.cpp b/src/compositor/hardware_integration/qwaylandgraphicshardwareintegrationfactory.cpp
index d8337c6e5..17e2dbdbe 100644
--- a/src/compositor/hardware_integration/graphicshardwareintegrationfactory.cpp
+++ b/src/compositor/hardware_integration/qwaylandgraphicshardwareintegrationfactory.cpp
@@ -39,21 +39,23 @@
**
****************************************************************************/
-#include "graphicshardwareintegrationfactory.h"
-#include "graphicshardwareintegrationplugin.h"
-#include "graphicshardwareintegration.h"
+#include "qwaylandgraphicshardwareintegrationfactory.h"
+#include "qwaylandgraphicshardwareintegrationplugin.h"
+#include "qwaylandgraphicshardwareintegration.h"
#include <QtCore/private/qfactoryloader_p.h>
#include <QtCore/QCoreApplication>
#include <QtCore/QDir>
+QT_BEGIN_NAMESPACE
+
#ifndef QT_NO_LIBRARY
Q_GLOBAL_STATIC_WITH_ARGS(QFactoryLoader, loader,
- (GraphicsHardwareIntegrationFactoryInterface_iid, QLatin1String("/waylandcompositors"), Qt::CaseInsensitive))
+ (QWaylandGraphicsHardwareIntegrationFactoryInterface_iid, QLatin1String("/waylandcompositors"), Qt::CaseInsensitive))
Q_GLOBAL_STATIC_WITH_ARGS(QFactoryLoader, directLoader,
- (GraphicsHardwareIntegrationFactoryInterface_iid, QLatin1String(""), Qt::CaseInsensitive))
+ (QWaylandGraphicsHardwareIntegrationFactoryInterface_iid, QLatin1String(""), Qt::CaseInsensitive))
#endif
-QStringList GraphicsHardwareIntegrationFactory::keys(const QString &pluginPath)
+QStringList QWaylandGraphicsHardwareIntegrationFactory::keys(const QString &pluginPath)
{
#ifndef QT_NO_LIBRARY
QStringList list;
@@ -76,17 +78,19 @@ QStringList GraphicsHardwareIntegrationFactory::keys(const QString &pluginPath)
#endif
}
-GraphicsHardwareIntegration *GraphicsHardwareIntegrationFactory::create(const QString &name, const QStringList &args, const QString &pluginPath)
+QWaylandGraphicsHardwareIntegration *QWaylandGraphicsHardwareIntegrationFactory::create(const QString &name, const QStringList &args, const QString &pluginPath)
{
#ifndef QT_NO_LIBRARY
// Try loading the plugin from platformPluginPath first:
if (!pluginPath.isEmpty()) {
QCoreApplication::addLibraryPath(pluginPath);
- if (GraphicsHardwareIntegration *ret = qLoadPlugin1<GraphicsHardwareIntegration, GraphicsHardwareIntegrationPlugin>(directLoader(), name, args))
+ if (QWaylandGraphicsHardwareIntegration *ret = qLoadPlugin1<QWaylandGraphicsHardwareIntegration, QWaylandGraphicsHardwareIntegrationPlugin>(directLoader(), name, args))
return ret;
}
- if (GraphicsHardwareIntegration *ret = qLoadPlugin1<GraphicsHardwareIntegration, GraphicsHardwareIntegrationPlugin>(loader(), name, args))
+ if (QWaylandGraphicsHardwareIntegration *ret = qLoadPlugin1<QWaylandGraphicsHardwareIntegration, QWaylandGraphicsHardwareIntegrationPlugin>(loader(), name, args))
return ret;
#endif
return 0;
}
+
+QT_END_NAMESPACE
diff --git a/src/compositor/hardware_integration/graphicshardwareintegrationfactory.h b/src/compositor/hardware_integration/qwaylandgraphicshardwareintegrationfactory.h
index 22bcd09cf..74e5dda0c 100644
--- a/src/compositor/hardware_integration/graphicshardwareintegrationfactory.h
+++ b/src/compositor/hardware_integration/qwaylandgraphicshardwareintegrationfactory.h
@@ -42,16 +42,20 @@
#ifndef GRAPHICSHARDWAREINTEGRATIONFACTORY_H
#define GRAPHICSHARDWAREINTEGRATIONFACTORY_H
-#include "waylandexport.h"
+#include <QtCompositor/qwaylandexport.h>
#include <QtCore/QStringList>
-class GraphicsHardwareIntegration;
+QT_BEGIN_NAMESPACE
-class Q_COMPOSITOR_EXPORT GraphicsHardwareIntegrationFactory
+class QWaylandGraphicsHardwareIntegration;
+
+class Q_COMPOSITOR_EXPORT QWaylandGraphicsHardwareIntegrationFactory
{
public:
static QStringList keys(const QString &pluginPath = QString());
- static GraphicsHardwareIntegration *create(const QString &name, const QStringList &args, const QString &pluginPath = QString());
+ static QWaylandGraphicsHardwareIntegration *create(const QString &name, const QStringList &args, const QString &pluginPath = QString());
};
+QT_END_NAMESPACE
+
#endif // GRAPHICSHARDWAREINTEGRATIONFACTORY_H
diff --git a/src/compositor/hardware_integration/graphicshardwareintegrationplugin.cpp b/src/compositor/hardware_integration/qwaylandgraphicshardwareintegrationplugin.cpp
index 3bde8e8ab..66e07352e 100644
--- a/src/compositor/hardware_integration/graphicshardwareintegrationplugin.cpp
+++ b/src/compositor/hardware_integration/qwaylandgraphicshardwareintegrationplugin.cpp
@@ -39,14 +39,17 @@
**
****************************************************************************/
-#include "graphicshardwareintegrationplugin.h"
+#include "qwaylandgraphicshardwareintegrationplugin.h"
-GraphicsHardwareIntegrationPlugin::GraphicsHardwareIntegrationPlugin(QObject *parent) :
+QT_BEGIN_NAMESPACE
+
+QWaylandGraphicsHardwareIntegrationPlugin::QWaylandGraphicsHardwareIntegrationPlugin(QObject *parent) :
QObject(parent)
{
}
-GraphicsHardwareIntegrationPlugin::~GraphicsHardwareIntegrationPlugin()
+QWaylandGraphicsHardwareIntegrationPlugin::~QWaylandGraphicsHardwareIntegrationPlugin()
{
}
+QT_END_NAMESPACE
diff --git a/src/compositor/hardware_integration/graphicshardwareintegrationplugin.h b/src/compositor/hardware_integration/qwaylandgraphicshardwareintegrationplugin.h
index 51f605164..6d68a0cc9 100644
--- a/src/compositor/hardware_integration/graphicshardwareintegrationplugin.h
+++ b/src/compositor/hardware_integration/qwaylandgraphicshardwareintegrationplugin.h
@@ -42,23 +42,27 @@
#ifndef GRAPHICSHARDWAREINTEGRATIONPLUGIN_H
#define GRAPHICSHARDWAREINTEGRATIONPLUGIN_H
-#include "waylandexport.h"
+#include <QtCompositor/qwaylandexport.h>
#include <QtCore/qplugin.h>
#include <QtCore/qfactoryinterface.h>
-class GraphicsHardwareIntegration;
+QT_BEGIN_NAMESPACE
-#define GraphicsHardwareIntegrationFactoryInterface_iid "org.qt-project.Qt.Compositor.GraphicsHardwareIntegrationFactoryInterface.5.1"
+class QWaylandGraphicsHardwareIntegration;
-class Q_COMPOSITOR_EXPORT GraphicsHardwareIntegrationPlugin : public QObject
+#define QWaylandGraphicsHardwareIntegrationFactoryInterface_iid "org.qt-project.Qt.Compositor.QWaylandGraphicsHardwareIntegrationFactoryInterface.5.1"
+
+class Q_COMPOSITOR_EXPORT QWaylandGraphicsHardwareIntegrationPlugin : public QObject
{
Q_OBJECT
public:
- explicit GraphicsHardwareIntegrationPlugin(QObject *parent = 0);
- ~GraphicsHardwareIntegrationPlugin();
+ explicit QWaylandGraphicsHardwareIntegrationPlugin(QObject *parent = 0);
+ ~QWaylandGraphicsHardwareIntegrationPlugin();
- virtual GraphicsHardwareIntegration *create(const QString &key, const QStringList &paramList) = 0;
+ virtual QWaylandGraphicsHardwareIntegration *create(const QString &key, const QStringList &paramList) = 0;
};
+QT_END_NAMESPACE
+
#endif // GRAPHICSHARDWAREINTEGRATIONPLUGIN_H