diff options
author | Andy Nichols <andy.nichols@digia.com> | 2013-02-05 12:22:17 +0100 |
---|---|---|
committer | Andy Nichols <andy.nichols@digia.com> | 2013-02-08 12:34:56 +0100 |
commit | 1b39d072c2601d39354fe83dff8b1e5c05095aaf (patch) | |
tree | 4b38960a1bcef0de376dc5441ec6372e41341801 | |
parent | 2e0efd201aa75121f4dd4049598f4d120811d784 (diff) | |
download | qtwayland-1b39d072c2601d39354fe83dff8b1e5c05095aaf.tar.gz qtwayland-1b39d072c2601d39354fe83dff8b1e5c05095aaf.tar.bz2 qtwayland-1b39d072c2601d39354fe83dff8b1e5c05095aaf.zip |
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>
171 files changed, 1418 insertions, 898 deletions
diff --git a/examples/qml-compositor/main.cpp b/examples/qml-compositor/main.cpp index fdaf4657..d481a252 100644 --- a/examples/qml-compositor/main.cpp +++ b/examples/qml-compositor/main.cpp @@ -38,9 +38,9 @@ ** ****************************************************************************/ -#include "waylandcompositor.h" -#include "waylandsurface.h" -#include "waylandsurfaceitem.h" +#include "qwaylandcompositor.h" +#include "qwaylandsurface.h" +#include "qwaylandsurfaceitem.h" #include <QGuiApplication> #include <QTimer> @@ -52,14 +52,14 @@ #include <QQuickItem> #include <QQuickView> -class QmlCompositor : public QQuickView, public WaylandCompositor +class QmlCompositor : public QQuickView, public QWaylandCompositor { Q_OBJECT - Q_PROPERTY(WaylandSurface* fullscreenSurface READ fullscreenSurface WRITE setFullscreenSurface NOTIFY fullscreenSurfaceChanged) + Q_PROPERTY(QWaylandSurface* fullscreenSurface READ fullscreenSurface WRITE setFullscreenSurface NOTIFY fullscreenSurfaceChanged) public: QmlCompositor() - : WaylandCompositor(this) + : QWaylandCompositor(this) , m_fullscreenSurface(0) { enableSubSurfaceExtension(); @@ -71,7 +71,7 @@ public: connect(this, SIGNAL(frameSwapped()), this, SLOT(frameSwappedSlot())); } - WaylandSurface *fullscreenSurface() const + QWaylandSurface *fullscreenSurface() const { return m_fullscreenSurface; } @@ -88,11 +88,11 @@ public slots: } void destroyClientForWindow(QVariant window) { - WaylandSurface *surface = qobject_cast<WaylandSurfaceItem *>(qvariant_cast<QObject *>(window))->surface(); + QWaylandSurface *surface = qobject_cast<QWaylandSurfaceItem *>(qvariant_cast<QObject *>(window))->surface(); destroyClientForSurface(surface); } - void setFullscreenSurface(WaylandSurface *surface) { + void setFullscreenSurface(QWaylandSurface *surface) { if (surface == m_fullscreenSurface) return; m_fullscreenSurface = surface; @@ -101,22 +101,22 @@ public slots: private slots: void surfaceMapped() { - WaylandSurface *surface = qobject_cast<WaylandSurface *>(sender()); + QWaylandSurface *surface = qobject_cast<QWaylandSurface *>(sender()); //Ignore surface if it's not a window surface if (!surface->hasShellSurface()) return; - WaylandSurfaceItem *item = surface->surfaceItem(); + QWaylandSurfaceItem *item = surface->surfaceItem(); //Create a WaylandSurfaceItem if we have not yet if (!item) - item = new WaylandSurfaceItem(surface, rootObject()); + item = new QWaylandSurfaceItem(surface, rootObject()); item->setTouchEventsEnabled(true); //item->takeFocus(); emit windowAdded(QVariant::fromValue(static_cast<QQuickItem *>(item))); } void surfaceUnmapped() { - WaylandSurface *surface = qobject_cast<WaylandSurface *>(sender()); + QWaylandSurface *surface = qobject_cast<QWaylandSurface *>(sender()); if (surface == m_fullscreenSurface) m_fullscreenSurface = 0; QQuickItem *item = surface->surfaceItem(); @@ -124,7 +124,7 @@ private slots: } void surfaceDestroyed(QObject *object) { - WaylandSurface *surface = static_cast<WaylandSurface *>(object); + QWaylandSurface *surface = static_cast<QWaylandSurface *>(object); if (surface == m_fullscreenSurface) m_fullscreenSurface = 0; QQuickItem *item = surface->surfaceItem(); @@ -139,17 +139,17 @@ protected: void resizeEvent(QResizeEvent *event) { QQuickView::resizeEvent(event); - WaylandCompositor::setOutputGeometry(QRect(0, 0, width(), height())); + QWaylandCompositor::setOutputGeometry(QRect(0, 0, width(), height())); } - void surfaceCreated(WaylandSurface *surface) { + void surfaceCreated(QWaylandSurface *surface) { connect(surface, SIGNAL(destroyed(QObject *)), this, SLOT(surfaceDestroyed(QObject *))); connect(surface, SIGNAL(mapped()), this, SLOT(surfaceMapped())); connect(surface,SIGNAL(unmapped()), this,SLOT(surfaceUnmapped())); } private: - WaylandSurface *m_fullscreenSurface; + QWaylandSurface *m_fullscreenSurface; }; int main(int argc, char *argv[]) diff --git a/examples/qwidget-compositor/main.cpp b/examples/qwidget-compositor/main.cpp index 12160a90..0c115166 100644 --- a/examples/qwidget-compositor/main.cpp +++ b/examples/qwidget-compositor/main.cpp @@ -38,10 +38,10 @@ ** ****************************************************************************/ -#include "waylandcompositor.h" +#include "qwaylandcompositor.h" -#include "waylandsurface.h" -#include <QtCompositor/waylandinput.h> +#include "qwaylandsurface.h" +#include <QtCompositor/qwaylandinput.h> #include <QApplication> #include <QWidget> @@ -61,7 +61,7 @@ #include <QDebug> #ifdef QT_COMPOSITOR_WAYLAND_GL -class QWidgetCompositor : public QGLWidget, public WaylandCompositor +class QWidgetCompositor : public QGLWidget, public QWaylandCompositor #else class QWidgetCompositor : public QWidget, public WaylandCompositor #endif @@ -69,7 +69,7 @@ class QWidgetCompositor : public QWidget, public WaylandCompositor Q_OBJECT public: QWidgetCompositor() - : WaylandCompositor(windowHandle()) + : QWaylandCompositor(windowHandle()) #ifdef QT_COMPOSITOR_WAYLAND_GL , m_surfaceCompositorFbo(0) , m_textureBlitter(0) @@ -90,13 +90,13 @@ public: private slots: void surfaceDestroyed(QObject *object) { - WaylandSurface *surface = static_cast<WaylandSurface *>(object); + QWaylandSurface *surface = static_cast<QWaylandSurface *>(object); m_surfaces.removeAll(surface); update(); } void surfaceMapped() { - WaylandSurface *surface = qobject_cast<WaylandSurface *>(sender()); + QWaylandSurface *surface = qobject_cast<QWaylandSurface *>(sender()); QPoint pos; if (!m_surfaces.contains(surface)) { uint px = 1 + (qrand() % (width() - surface->size().width() - 2)); @@ -112,12 +112,12 @@ private slots: } void surfaceDamaged(const QRect &rect) { - WaylandSurface *surface = qobject_cast<WaylandSurface *>(sender()); + QWaylandSurface *surface = qobject_cast<QWaylandSurface *>(sender()); surfaceDamaged(surface, rect); } protected: - void surfaceDamaged(WaylandSurface *surface, const QRect &rect) + void surfaceDamaged(QWaylandSurface *surface, const QRect &rect) { #ifdef QT_COMPOSITOR_WAYLAND_GL Q_UNUSED(surface); @@ -128,7 +128,7 @@ protected: #endif } - void surfaceCreated(WaylandSurface *surface) { + void surfaceCreated(QWaylandSurface *surface) { connect(surface, SIGNAL(destroyed(QObject *)), this, SLOT(surfaceDestroyed(QObject *))); connect(surface, SIGNAL(mapped()), this, SLOT(surfaceMapped())); connect(surface, SIGNAL(damaged(const QRect &)), this, SLOT(surfaceDamaged(const QRect &))); @@ -136,7 +136,7 @@ protected: } #ifdef QT_COMPOSITOR_WAYLAND_GL - GLuint composeSurface(WaylandSurface *surface) { + GLuint composeSurface(QWaylandSurface *surface) { GLuint texture = 0; QOpenGLFunctions *functions = QOpenGLContext::currentContext()->functions(); @@ -145,7 +145,7 @@ protected: functions->glBindFramebuffer(GL_FRAMEBUFFER, m_surfaceCompositorFbo); - if (surface->type() == WaylandSurface::Shm) { + if (surface->type() == QWaylandSurface::Shm) { texture = m_textureCache->bindTexture(context()->contextHandle(), surface->image()); } else { texture = surface->texture(QOpenGLContext::currentContext()); @@ -161,21 +161,21 @@ protected: return texture; } - void paintChildren(WaylandSurface *surface, WaylandSurface *window) { + void paintChildren(QWaylandSurface *surface, QWaylandSurface *window) { if (surface->subSurfaces().size() == 0) return; - QLinkedListIterator<WaylandSurface *> i(surface->subSurfaces()); + QLinkedListIterator<QWaylandSurface *> i(surface->subSurfaces()); while (i.hasNext()) { - WaylandSurface *subSurface = i.next(); + QWaylandSurface *subSurface = i.next(); QPointF p = subSurface->mapTo(window,QPoint(0,0)); QSize size = subSurface->size(); if (size.isValid()) { GLuint texture = 0; - if (subSurface->type() == WaylandSurface::Texture) { + if (subSurface->type() == QWaylandSurface::Texture) { texture = subSurface->texture(QOpenGLContext::currentContext()); - } else if (surface->type() == WaylandSurface::Shm ) { + } else if (surface->type() == QWaylandSurface::Shm ) { texture = m_textureCache->bindTexture(context()->contextHandle(), surface->image()); } m_textureBlitter->drawTexture(texture,QRect(p.toPoint(),size),window->size(),0,window->isYInverted(),subSurface->isYInverted()); @@ -232,7 +232,7 @@ protected: for (int i = 0; i < m_surfaces.size(); ++i) { #ifdef QT_COMPOSITOR_WAYLAND_GL GLuint texture = composeSurface(m_surfaces.at(i)); - WaylandSurface *surface = m_surfaces.at(i); + QWaylandSurface *surface = m_surfaces.at(i); QRect geo(surface->pos().toPoint(),surface->size()); m_textureBlitter->drawTexture(texture,geo,size(),0,false,m_surfaces.at(i)->isYInverted()); #else @@ -258,7 +258,7 @@ protected: } } - void raise(WaylandSurface *surface) { + void raise(QWaylandSurface *surface) { defaultInputDevice()->setKeyboardFocus(surface); surfaceDamaged(surface, QRect(QPoint(), surface->size())); m_surfaces.removeOne(surface); @@ -268,7 +268,7 @@ protected: void mousePressEvent(QMouseEvent *e) { m_cursorPos = e->pos(); QPointF local; - if (WaylandSurface *surface = surfaceAt(e->pos(), &local)) { + if (QWaylandSurface *surface = surfaceAt(e->pos(), &local)) { raise(surface); if (e->modifiers() & Qt::ControlModifier) { m_moveSurface = surface; @@ -284,7 +284,7 @@ protected: if (isDragging()) { QPoint global = e->pos(); // "global" here means the window of the compositor QPointF local; - WaylandSurface *surface = surfaceAt(e->pos(), &local); + QWaylandSurface *surface = surfaceAt(e->pos(), &local); if (surface) { if (!m_dragSourceSurface) m_dragSourceSurface = surface; @@ -335,9 +335,9 @@ protected: defaultInputDevice()->sendKeyReleaseEvent(event->nativeScanCode()); } - WaylandSurface *surfaceAt(const QPointF &point, QPointF *local = 0) { + QWaylandSurface *surfaceAt(const QPointF &point, QPointF *local = 0) { for (int i = m_surfaces.size() - 1; i >= 0; --i) { - WaylandSurface *surface = m_surfaces.at(i); + QWaylandSurface *surface = m_surfaces.at(i); QRect geo(surface->pos().toPoint(),surface->size()); if (geo.contains(point.toPoint())) { if (local) @@ -348,7 +348,7 @@ protected: return 0; } - void setCursorSurface(WaylandSurface *surface, int hotspotX, int hotspotY) { + void setCursorSurface(QWaylandSurface *surface, int hotspotX, int hotspotY) { m_cursorSurface = surface; m_cursorHotspot = QPoint(hotspotX, hotspotY); update(); @@ -358,7 +358,7 @@ private: QImage m_background; QPixmap m_backgroundScaled; - QList<WaylandSurface *> m_surfaces; + QList<QWaylandSurface *> m_surfaces; #ifdef QT_COMPOSITOR_WAYLAND_GL GLuint m_surfaceCompositorFbo; @@ -366,12 +366,12 @@ private: QOpenGLTextureCache *m_textureCache; #endif - WaylandSurface *m_moveSurface; + QWaylandSurface *m_moveSurface; QPointF m_moveOffset; - WaylandSurface *m_dragSourceSurface; + QWaylandSurface *m_dragSourceSurface; QPointF m_lastDragSourcePos; - WaylandSurface* m_cursorSurface; + QWaylandSurface* m_cursorSurface; QPoint m_cursorPos; QPoint m_cursorHotspot; diff --git a/examples/qwindow-compositor/qwindowcompositor.cpp b/examples/qwindow-compositor/qwindowcompositor.cpp index 4b543eab..09522ae2 100644 --- a/examples/qwindow-compositor/qwindowcompositor.cpp +++ b/examples/qwindow-compositor/qwindowcompositor.cpp @@ -51,10 +51,10 @@ #include <QScreen> #include <QPainter> -#include <QtCompositor/waylandinput.h> +#include <QtCompositor/qwaylandinput.h> QWindowCompositor::QWindowCompositor(QOpenGLWindow *window) - : WaylandCompositor(window) + : QWaylandCompositor(window) , m_window(window) , m_textureBlitter(0) , m_renderScheduler(this) @@ -112,16 +112,16 @@ QImage QWindowCompositor::makeBackgroundImage(const QString &fileName) return patternedBackground; } -void QWindowCompositor::ensureKeyboardFocusSurface(WaylandSurface *oldSurface) +void QWindowCompositor::ensureKeyboardFocusSurface(QWaylandSurface *oldSurface) { - WaylandSurface *kbdFocus = defaultInputDevice()->keyboardFocus(); + QWaylandSurface *kbdFocus = defaultInputDevice()->keyboardFocus(); if (kbdFocus == oldSurface || !kbdFocus) defaultInputDevice()->setKeyboardFocus(m_surfaces.isEmpty() ? 0 : m_surfaces.last()); } void QWindowCompositor::surfaceDestroyed(QObject *object) { - WaylandSurface *surface = static_cast<WaylandSurface *>(object); + QWaylandSurface *surface = static_cast<QWaylandSurface *>(object); m_surfaces.removeOne(surface); ensureKeyboardFocusSurface(surface); m_renderScheduler.start(0); @@ -129,7 +129,7 @@ void QWindowCompositor::surfaceDestroyed(QObject *object) void QWindowCompositor::surfaceMapped() { - WaylandSurface *surface = qobject_cast<WaylandSurface *>(sender()); + QWaylandSurface *surface = qobject_cast<QWaylandSurface *>(sender()); QPoint pos; if (!m_surfaces.contains(surface)) { uint px = 0; @@ -153,7 +153,7 @@ void QWindowCompositor::surfaceMapped() void QWindowCompositor::surfaceUnmapped() { - WaylandSurface *surface = qobject_cast<WaylandSurface *>(sender()); + QWaylandSurface *surface = qobject_cast<QWaylandSurface *>(sender()); if (m_surfaces.removeOne(surface)) m_surfaces.insert(0, surface); @@ -162,18 +162,18 @@ void QWindowCompositor::surfaceUnmapped() void QWindowCompositor::surfaceDamaged(const QRect &rect) { - WaylandSurface *surface = qobject_cast<WaylandSurface *>(sender()); + QWaylandSurface *surface = qobject_cast<QWaylandSurface *>(sender()); surfaceDamaged(surface, rect); } -void QWindowCompositor::surfaceDamaged(WaylandSurface *surface, const QRect &rect) +void QWindowCompositor::surfaceDamaged(QWaylandSurface *surface, const QRect &rect) { Q_UNUSED(surface) Q_UNUSED(rect) m_renderScheduler.start(0); } -void QWindowCompositor::surfaceCreated(WaylandSurface *surface) +void QWindowCompositor::surfaceCreated(QWaylandSurface *surface) { connect(surface, SIGNAL(destroyed(QObject *)), this, SLOT(surfaceDestroyed(QObject *))); connect(surface, SIGNAL(mapped()), this, SLOT(surfaceMapped())); @@ -185,7 +185,7 @@ void QWindowCompositor::surfaceCreated(WaylandSurface *surface) void QWindowCompositor::sendExpose() { - WaylandSurface *surface = qobject_cast<WaylandSurface *>(sender()); + QWaylandSurface *surface = qobject_cast<QWaylandSurface *>(sender()); surface->sendOnScreenVisibilityChange(true); } @@ -203,12 +203,12 @@ void QWindowCompositor::updateCursor() } } -QPointF QWindowCompositor::toSurface(WaylandSurface *surface, const QPointF &pos) const +QPointF QWindowCompositor::toSurface(QWaylandSurface *surface, const QPointF &pos) const { return pos - surface->pos(); } -void QWindowCompositor::setCursorSurface(WaylandSurface *surface, int hotspotX, int hotspotY) +void QWindowCompositor::setCursorSurface(QWaylandSurface *surface, int hotspotX, int hotspotY) { if ((m_cursorSurface != surface) && surface) connect(surface, SIGNAL(damaged(QRect)), this, SLOT(updateCursor())); @@ -218,10 +218,10 @@ void QWindowCompositor::setCursorSurface(WaylandSurface *surface, int hotspotX, m_cursorHotspotY = hotspotY; } -WaylandSurface *QWindowCompositor::surfaceAt(const QPointF &point, QPointF *local) +QWaylandSurface *QWindowCompositor::surfaceAt(const QPointF &point, QPointF *local) { for (int i = m_surfaces.size() - 1; i >= 0; --i) { - WaylandSurface *surface = m_surfaces.at(i); + QWaylandSurface *surface = m_surfaces.at(i); QRectF geo(surface->pos(), surface->size()); if (geo.contains(point)) { if (local) @@ -232,16 +232,16 @@ WaylandSurface *QWindowCompositor::surfaceAt(const QPointF &point, QPointF *loca return 0; } -GLuint QWindowCompositor::composeSurface(WaylandSurface *surface) +GLuint QWindowCompositor::composeSurface(QWaylandSurface *surface) { GLuint texture = 0; QOpenGLFunctions *functions = QOpenGLContext::currentContext()->functions(); functions->glBindFramebuffer(GL_FRAMEBUFFER, m_surface_fbo); - if (surface->type() == WaylandSurface::Shm) { + if (surface->type() == QWaylandSurface::Shm) { texture = m_textureCache->bindTexture(QOpenGLContext::currentContext(),surface->image()); - } else if (surface->type() == WaylandSurface::Texture) { + } else if (surface->type() == QWaylandSurface::Texture) { texture = surface->texture(QOpenGLContext::currentContext()); } @@ -255,20 +255,20 @@ GLuint QWindowCompositor::composeSurface(WaylandSurface *surface) return texture; } -void QWindowCompositor::paintChildren(WaylandSurface *surface, WaylandSurface *window) { +void QWindowCompositor::paintChildren(QWaylandSurface *surface, QWaylandSurface *window) { if (surface->subSurfaces().size() == 0) return; - QLinkedListIterator<WaylandSurface *> i(surface->subSurfaces()); + QLinkedListIterator<QWaylandSurface *> i(surface->subSurfaces()); while (i.hasNext()) { - WaylandSurface *subSurface = i.next(); + QWaylandSurface *subSurface = i.next(); QPointF p = subSurface->mapTo(window,QPointF(0,0)); if (subSurface->size().isValid()) { GLuint texture = 0; - if (subSurface->type() == WaylandSurface::Texture) { + if (subSurface->type() == QWaylandSurface::Texture) { texture = subSurface->texture(QOpenGLContext::currentContext()); - } else if (surface->type() == WaylandSurface::Shm ) { + } else if (surface->type() == QWaylandSurface::Shm ) { texture = m_textureCache->bindTexture(QOpenGLContext::currentContext(),surface->image()); } QRect geo(p.toPoint(),subSurface->size()); @@ -291,7 +291,7 @@ void QWindowCompositor::render() window()->size(), 0, false, true); - foreach (WaylandSurface *surface, m_surfaces) { + foreach (QWaylandSurface *surface, m_surfaces) { GLuint texture = composeSurface(surface); QRect geo(surface->pos().toPoint(),surface->size()); m_textureBlitter->drawTexture(texture,geo,m_window->size(),0,false,surface->isYInverted()); @@ -308,7 +308,7 @@ bool QWindowCompositor::eventFilter(QObject *obj, QEvent *event) if (obj != m_window) return false; - WaylandInputDevice *input = defaultInputDevice(); + QWaylandInputDevice *input = defaultInputDevice(); switch (event->type()) { case QEvent::Expose: @@ -330,7 +330,7 @@ bool QWindowCompositor::eventFilter(QObject *obj, QEvent *event) case QEvent::MouseButtonPress: { QPointF local; QMouseEvent *me = static_cast<QMouseEvent *>(event); - WaylandSurface *targetSurface = surfaceAt(me->localPos(), &local); + QWaylandSurface *targetSurface = surfaceAt(me->localPos(), &local); if (m_dragKeyIsPressed && targetSurface) { m_draggingWindow = targetSurface; m_drag_diff = local; @@ -346,7 +346,7 @@ bool QWindowCompositor::eventFilter(QObject *obj, QEvent *event) return true; } case QEvent::MouseButtonRelease: { - WaylandSurface *targetSurface = input->mouseFocus(); + QWaylandSurface *targetSurface = input->mouseFocus(); if (m_draggingWindow) { m_draggingWindow = 0; m_drag_diff = QPointF(); @@ -366,7 +366,7 @@ bool QWindowCompositor::eventFilter(QObject *obj, QEvent *event) m_renderScheduler.start(0); } else { QPointF local; - WaylandSurface *targetSurface = surfaceAt(me->localPos(), &local); + QWaylandSurface *targetSurface = surfaceAt(me->localPos(), &local); input->sendMouseMoveEvent(targetSurface, local, me->localPos()); } break; @@ -382,7 +382,7 @@ bool QWindowCompositor::eventFilter(QObject *obj, QEvent *event) m_dragKeyIsPressed = true; } m_modifiers = ke->modifiers(); - WaylandSurface *targetSurface = input->keyboardFocus(); + QWaylandSurface *targetSurface = input->keyboardFocus(); if (targetSurface) input->sendKeyPressEvent(ke->nativeScanCode()); break; @@ -393,7 +393,7 @@ bool QWindowCompositor::eventFilter(QObject *obj, QEvent *event) m_dragKeyIsPressed = false; } m_modifiers = ke->modifiers(); - WaylandSurface *targetSurface = input->keyboardFocus(); + QWaylandSurface *targetSurface = input->keyboardFocus(); if (targetSurface) input->sendKeyReleaseEvent(ke->nativeScanCode()); break; @@ -402,7 +402,7 @@ bool QWindowCompositor::eventFilter(QObject *obj, QEvent *event) case QEvent::TouchUpdate: case QEvent::TouchEnd: { - WaylandSurface *targetSurface = 0; + QWaylandSurface *targetSurface = 0; QTouchEvent *te = static_cast<QTouchEvent *>(event); QList<QTouchEvent::TouchPoint> points = te->touchPoints(); QPoint pointPos; diff --git a/examples/qwindow-compositor/qwindowcompositor.h b/examples/qwindow-compositor/qwindowcompositor.h index 6f2c8d3d..7ad2faf6 100644 --- a/examples/qwindow-compositor/qwindowcompositor.h +++ b/examples/qwindow-compositor/qwindowcompositor.h @@ -41,8 +41,8 @@ #ifndef QWINDOWCOMPOSITOR_H #define QWINDOWCOMPOSITOR_H -#include "waylandcompositor.h" -#include "waylandsurface.h" +#include "qwaylandcompositor.h" +#include "qwaylandsurface.h" #include "textureblitter.h" #include "qopenglwindow.h" @@ -50,7 +50,7 @@ #include <QObject> #include <QTimer> -class QWindowCompositor : public QObject, public WaylandCompositor +class QWindowCompositor : public QObject, public QWaylandCompositor { Q_OBJECT public: @@ -65,21 +65,21 @@ private slots: void render(); protected: - void surfaceDamaged(WaylandSurface *surface, const QRect &rect); - void surfaceCreated(WaylandSurface *surface); + void surfaceDamaged(QWaylandSurface *surface, const QRect &rect); + void surfaceCreated(QWaylandSurface *surface); - WaylandSurface* surfaceAt(const QPointF &point, QPointF *local = 0); + QWaylandSurface* surfaceAt(const QPointF &point, QPointF *local = 0); - GLuint composeSurface(WaylandSurface *surface); - void paintChildren(WaylandSurface *surface, WaylandSurface *window); + GLuint composeSurface(QWaylandSurface *surface); + void paintChildren(QWaylandSurface *surface, QWaylandSurface *window); bool eventFilter(QObject *obj, QEvent *event); - QPointF toSurface(WaylandSurface *surface, const QPointF &pos) const; + QPointF toSurface(QWaylandSurface *surface, const QPointF &pos) const; - void setCursorSurface(WaylandSurface *surface, int hotspotX, int hotspotY); + void setCursorSurface(QWaylandSurface *surface, int hotspotX, int hotspotY); - void ensureKeyboardFocusSurface(WaylandSurface *oldSurface); + void ensureKeyboardFocusSurface(QWaylandSurface *oldSurface); QImage makeBackgroundImage(const QString &fileName); private slots: @@ -90,19 +90,19 @@ private: QOpenGLWindow *m_window; QImage m_backgroundImage; GLuint m_backgroundTexture; - QList<WaylandSurface *> m_surfaces; + QList<QWaylandSurface *> m_surfaces; TextureBlitter *m_textureBlitter; QOpenGLTextureCache *m_textureCache; GLuint m_surface_fbo; QTimer m_renderScheduler; //Dragging windows around - WaylandSurface *m_draggingWindow; + QWaylandSurface *m_draggingWindow; bool m_dragKeyIsPressed; QPointF m_drag_diff; //Cursor - WaylandSurface *m_cursorSurface; + QWaylandSurface *m_cursorSurface; int m_cursorHotspotX; int m_cursorHotspotY; diff --git a/src/compositor/compositor.pri b/src/compositor/compositor.pri deleted file mode 100644 index 595bbf7c..00000000 --- a/src/compositor/compositor.pri +++ /dev/null @@ -1,15 +0,0 @@ -CONFIG += link_pkgconfig - -DEFINES += QT_WAYLAND_WINDOWMANAGER_SUPPORT - -!contains(QT_CONFIG, no-pkg-config) { - PKGCONFIG += wayland-server -} else { - LIBS += -lwayland-server -} - -include ($$PWD/global/global.pri) -include ($$PWD/wayland_wrapper/wayland_wrapper.pri) -include ($$PWD/hardware_integration/hardware_integration.pri) -include ($$PWD/compositor_api/compositor_api.pri) -include ($$PWD/windowmanagerprotocol/windowmanagerprotocol.pri) diff --git a/src/compositor/compositor.pro b/src/compositor/compositor.pro index 5ba6bc11..8a2fa01e 100644 --- a/src/compositor/compositor.pro +++ b/src/compositor/compositor.pro @@ -5,5 +5,24 @@ contains(QT_CONFIG, opengl):MODULE_DEFINES = QT_COMPOSITOR_WAYLAND_GL load(qt_module) -include(compositor.pri) +CONFIG += link_pkgconfig + +DEFINES += QT_WAYLAND_WINDOWMANAGER_SUPPORT + +!contains(QT_CONFIG, no-pkg-config) { + PKGCONFIG += wayland-server +} else { + LIBS += -lwayland-server +} + +INCLUDEPATH += ../shared +HEADERS += ../shared/qwaylandmimehelper.h +SOURCES += ../shared/qwaylandmimehelper.cpp + +include ($$PWD/global/global.pri) +include ($$PWD/wayland_wrapper/wayland_wrapper.pri) +include ($$PWD/hardware_integration/hardware_integration.pri) +include ($$PWD/compositor_api/compositor_api.pri) +include ($$PWD/windowmanagerprotocol/windowmanagerprotocol.pri) + diff --git a/src/compositor/compositor_api/compositor_api.pri b/src/compositor/compositor_api/compositor_api.pri index 2e98c775..f0bbe764 100644 --- a/src/compositor/compositor_api/compositor_api.pri +++ b/src/compositor/compositor_api/compositor_api.pri @@ -1,29 +1,30 @@ -INCLUDEPATH += $$PWD +INCLUDEPATH += compositor_api HEADERS += \ - $$PWD/waylandcompositor.h \ - $$PWD/waylandsurface.h \ - $$PWD/waylandinput.h + compositor_api/qwaylandcompositor.h \ + compositor_api/qwaylandsurface.h \ + compositor_api/qwaylandinput.h SOURCES += \ - $$PWD/waylandcompositor.cpp \ - $$PWD/waylandsurface.cpp \ - $$PWD/waylandinput.cpp + compositor_api/qwaylandcompositor.cpp \ + compositor_api/qwaylandsurface.cpp \ + compositor_api/qwaylandinput.cpp QT += core-private qtHaveModule(quick) { - SOURCES += $$PWD/waylandsurfaceitem.cpp \ - $$PWD/waylandsurfacenode.cpp \ - $$PWD/waylandsurfacetexturematerial.cpp + SOURCES += \ + compositor_api/qwaylandsurfaceitem.cpp \ + compositor_api/qwaylandsurfacenode.cpp \ + compositor_api/qwaylandsurfacetexturematerial.cpp - HEADERS += $$PWD/waylandsurfaceitem.h \ - $$PWD/waylandsurfacenode.h \ - $$PWD/waylandsurfacetexturematerial.h + HEADERS += \ + compositor_api/qwaylandsurfaceitem.h \ + compositor_api/qwaylandsurfacenode_p.h \ + compositor_api/qwaylandsurfacetexturematerial_p.h DEFINES += QT_COMPOSITOR_QUICK QT += qml quick QT += quick-private gui-private } - diff --git a/src/compositor/compositor_api/waylandcompositor.cpp b/src/compositor/compositor_api/qwaylandcompositor.cpp index 38c40474..f742a8de 100644 --- a/src/compositor/compositor_api/waylandcompositor.cpp +++ b/src/compositor/compositor_api/qwaylandcompositor.cpp @@ -38,13 +38,13 @@ ** ****************************************************************************/ -#include "waylandcompositor.h" +#include "qwaylandcompositor.h" -#include "waylandinput.h" +#include "qwaylandinput.h" -#include "wayland_wrapper/wlcompositor.h" -#include "wayland_wrapper/wlsurface.h" -#include "wayland_wrapper/wlinputdevice.h" +#include "wayland_wrapper/qwlcompositor_p.h" +#include "wayland_wrapper/qwlsurface_p.h" +#include "wayland_wrapper/qwlinputdevice_p.h" #include <QtCore/QCoreApplication> #include <QtCore/QStringList> @@ -54,10 +54,12 @@ #include <QDebug> #ifdef QT_COMPOSITOR_QUICK -#include "waylandsurfaceitem.h" +#include "qwaylandsurfaceitem.h" #endif -WaylandCompositor::WaylandCompositor(QWindow *window, const char *socketName) +QT_BEGIN_NAMESPACE + +QWaylandCompositor::QWaylandCompositor(QWindow *window, const char *socketName) : m_compositor(0) , m_toplevel_window(window) , m_socket_name(socketName) @@ -68,10 +70,10 @@ WaylandCompositor::WaylandCompositor(QWindow *window, const char *socketName) if (socketArg != -1 && socketArg + 1 < arguments.size()) m_socket_name = arguments.at(socketArg + 1).toLocal8Bit(); - m_compositor = new Wayland::Compositor(this); + m_compositor = new QtWayland::Compositor(this); #ifdef QT_COMPOSITOR_QUICK - qmlRegisterType<WaylandSurfaceItem>("WaylandCompositor", 1, 0, "WaylandSurfaceItem"); - qmlRegisterType<WaylandSurface>("WaylandCompositor", 1, 0, "WaylandSurface"); + qmlRegisterType<QWaylandSurfaceItem>("WaylandCompositor", 1, 0, "WaylandSurfaceItem"); + qmlRegisterType<QWaylandSurface>("WaylandCompositor", 1, 0, "WaylandSurface"); #else qRegisterMetaType<WaylandSurface*>("WaylandSurface*"); #endif @@ -80,38 +82,38 @@ WaylandCompositor::WaylandCompositor(QWindow *window, const char *socketName) m_compositor->initializeDefaultInputDevice(); } -WaylandCompositor::~WaylandCompositor() +QWaylandCompositor::~QWaylandCompositor() { delete m_compositor; } -struct wl_display *WaylandCompositor::waylandDisplay() const +struct wl_display *QWaylandCompositor::waylandDisplay() const { return m_compositor->wl_display(); } -void WaylandCompositor::frameFinished(WaylandSurface *surface) +void QWaylandCompositor::frameFinished(QWaylandSurface *surface) { - Wayland::Surface *surfaceImpl = surface? surface->handle():0; + QtWayland::Surface *surfaceImpl = surface? surface->handle():0; m_compositor->frameFinished(surfaceImpl); } -void WaylandCompositor::destroyClientForSurface(WaylandSurface *surface) +void QWaylandCompositor::destroyClientForSurface(QWaylandSurface *surface) { destroyClient(surface->client()); } -void WaylandCompositor::destroyClient(WaylandClient *client) +void QWaylandCompositor::destroyClient(WaylandClient *client) { m_compositor->destroyClient(client); } -QList<WaylandSurface *> WaylandCompositor::surfacesForClient(WaylandClient* c) const +QList<QWaylandSurface *> QWaylandCompositor::surfacesForClient(WaylandClient* c) const { wl_client *client = static_cast<wl_client *>(c); - QList<Wayland::Surface *> surfaces = m_compositor->surfaces(); + QList<QtWayland::Surface *> surfaces = m_compositor->surfaces(); - QList<WaylandSurface *> result; + QList<QWaylandSurface *> result; for (int i = 0; i < surfaces.count(); ++i) { if (surfaces.at(i)->base()->resource.client == client) { @@ -122,23 +124,23 @@ QList<WaylandSurface *> WaylandCompositor::surfacesForClient(WaylandClient* c) c return result; } -void WaylandCompositor::setDirectRenderSurface(WaylandSurface *surface, QOpenGLContext *context) +void QWaylandCompositor::setDirectRenderSurface(QWaylandSurface *surface, QOpenGLContext *context) { m_compositor->setDirectRenderSurface(surface ? surface->handle() : 0, context); } -WaylandSurface *WaylandCompositor::directRenderSurface() const +QWaylandSurface *QWaylandCompositor::directRenderSurface() const { - Wayland::Surface *surf = m_compositor->directRenderSurface(); + QtWayland::Surface *surf = m_compositor->directRenderSurface(); return surf ? surf->waylandSurface() : 0; } -QWindow * WaylandCompositor::window() const +QWindow * QWaylandCompositor::window() const { return m_toplevel_window; } -void WaylandCompositor::surfaceAboutToBeDestroyed(WaylandSurface *surface) +void QWaylandCompositor::surfaceAboutToBeDestroyed(QWaylandSurface *surface) { Q_UNUSED(surface); } @@ -148,18 +150,18 @@ void WaylandCompositor::surfaceAboutToBeDestroyed(WaylandSurface *surface) The default implementation simply forwards the request to QDesktopServices::openUrl(). */ -void WaylandCompositor::openUrl(WaylandClient *client, const QUrl &url) +void QWaylandCompositor::openUrl(WaylandClient *client, const QUrl &url) { Q_UNUSED(client); QDesktopServices::openUrl(url); } -Wayland::Compositor * WaylandCompositor::handle() const +QtWayland::Compositor * QWaylandCompositor::handle() const { return m_compositor; } -void WaylandCompositor::setRetainedSelectionEnabled(bool enable) +void QWaylandCompositor::setRetainedSelectionEnabled(bool enable) { if (enable) m_compositor->setRetainedSelectionWatcher(retainedSelectionChanged, this); @@ -167,27 +169,27 @@ void WaylandCompositor::setRetainedSelectionEnabled(bool enable) m_compositor->setRetainedSelectionWatcher(0, 0); } -void WaylandCompositor::retainedSelectionChanged(QMimeData *mimeData, void *param) +void QWaylandCompositor::retainedSelectionChanged(QMimeData *mimeData, void *param) { - WaylandCompositor *self = static_cast<WaylandCompositor *>(param); + QWaylandCompositor *self = static_cast<QWaylandCompositor *>(param); self->retainedSelectionReceived(mimeData); } -void WaylandCompositor::retainedSelectionReceived(QMimeData *) +void QWaylandCompositor::retainedSelectionReceived(QMimeData *) { } -void WaylandCompositor::overrideSelection(QMimeData *data) +void QWaylandCompositor::overrideSelection(QMimeData *data) { m_compositor->overrideSelection(data); } -void WaylandCompositor::setClientFullScreenHint(bool value) +void QWaylandCompositor::setClientFullScreenHint(bool value) { m_compositor->setClientFullScreenHint(value); } -const char *WaylandCompositor::socketName() const +const char *QWaylandCompositor::socketName() const { if (m_socket_name.isEmpty()) return 0; @@ -197,53 +199,53 @@ const char *WaylandCompositor::socketName() const /*! Set the screen orientation based on accelerometer data or similar. */ -void WaylandCompositor::setScreenOrientation(Qt::ScreenOrientation orientation) +void QWaylandCompositor::setScreenOrientation(Qt::ScreenOrientation orientation) { m_compositor->setScreenOrientation(orientation); } -void WaylandCompositor::setOutputGeometry(const QRect &geometry) +void QWaylandCompositor::setOutputGeometry(const QRect &geometry) { m_compositor->setOutputGeometry(geometry); } -QRect WaylandCompositor::outputGeometry() const +QRect QWaylandCompositor::outputGeometry() const { return m_compositor->outputGeometry(); } -void WaylandCompositor::setOutputRefreshRate(int rate) +void QWaylandCompositor::setOutputRefreshRate(int rate) { m_compositor->setOutputRefreshRate(rate); } -int WaylandCompositor::outputRefreshRate() const +int QWaylandCompositor::outputRefreshRate() const { return m_compositor->outputRefreshRate(); } -WaylandInputDevice *WaylandCompositor::defaultInputDevice() const +QWaylandInputDevice *QWaylandCompositor::defaultInputDevice() const { return m_compositor->defaultInputDevice()->handle(); } -bool WaylandCompositor::isDragging() const +bool QWaylandCompositor::isDragging() const { return m_compositor->isDragging(); } -void WaylandCompositor::sendDragMoveEvent(const QPoint &global, const QPoint &local, - WaylandSurface *surface) +void QWaylandCompositor::sendDragMoveEvent(const QPoint &global, const QPoint &local, + QWaylandSurface *surface) { m_compositor->sendDragMoveEvent(global, local, surface ? surface->handle() : 0); } -void WaylandCompositor::sendDragEndEvent() +void QWaylandCompositor::sendDragEndEvent() { m_compositor->sendDragEndEvent(); } -void WaylandCompositor::setCursorSurface(WaylandSurface *surface, int hotspotX, int hotspotY) +void QWaylandCompositor::setCursorSurface(QWaylandSurface *surface, int hotspotX, int hotspotY) { Q_UNUSED(surface); Q_UNUSED(hotspotX); @@ -251,17 +253,19 @@ void WaylandCompositor::setCursorSurface(WaylandSurface *surface, int hotspotX, qDebug() << "changeCursor" << surface->size() << hotspotX << hotspotY; } -void WaylandCompositor::enableSubSurfaceExtension() +void QWaylandCompositor::enableSubSurfaceExtension() { m_compositor->enableSubSurfaceExtension(); } -void WaylandCompositor::enableTouchExtension() +void QWaylandCompositor::enableTouchExtension() { // nothing to do here } -void WaylandCompositor::configureTouchExtension(TouchExtensionFlags flags) +void QWaylandCompositor::configureTouchExtension(TouchExtensionFlags flags) { m_compositor->configureTouchExtension(flags); } + +QT_END_NAMESPACE diff --git a/src/compositor/compositor_api/waylandcompositor.h b/src/compositor/compositor_api/qwaylandcompositor.h index 3df737d1..0f258617 100644 --- a/src/compositor/compositor_api/waylandcompositor.h +++ b/src/compositor/compositor_api/qwaylandcompositor.h @@ -38,52 +38,54 @@ ** ****************************************************************************/ -#ifndef QTCOMP_H -#define QTCOMP_H +#ifndef QWAYLANDCOMPOSITOR_H +#define QWAYLANDCOMPOSITOR_H -#include "waylandexport.h" +#include <QtCompositor/qwaylandexport.h> #include <QObject> #include <QImage> #include <QRect> +QT_BEGIN_NAMESPACE + class QMimeData; class QUrl; class QOpenGLContext; -class WaylandSurface; -class WaylandInputDevice; +class QWaylandSurface; +class QWaylandInputDevice; -namespace Wayland +namespace QtWayland { class Compositor; } -class Q_COMPOSITOR_EXPORT WaylandCompositor +class Q_COMPOSITOR_EXPORT QWaylandCompositor { public: - WaylandCompositor(QWindow *window = 0, const char *socketName = 0); - virtual ~WaylandCompositor(); + QWaylandCompositor(QWindow *window = 0, const char *socketName = 0); + virtual ~QWaylandCompositor(); struct wl_display *waylandDisplay() const; - void frameFinished(WaylandSurface *surface = 0); + void frameFinished(QWaylandSurface *surface = 0); - void destroyClientForSurface(WaylandSurface *surface); + void destroyClientForSurface(QWaylandSurface *surface); void destroyClient(WaylandClient *client); - QList<WaylandSurface *> surfacesForClient(WaylandClient* client) const; + QList<QWaylandSurface *> surfacesForClient(WaylandClient* client) const; - void setDirectRenderSurface(WaylandSurface *surface, QOpenGLContext *context); - WaylandSurface *directRenderSurface() const; + void setDirectRenderSurface(QWaylandSurface *surface, QOpenGLContext *context); + QWaylandSurface *directRenderSurface() const; QWindow *window()const; - virtual void surfaceCreated(WaylandSurface *surface) = 0; - virtual void surfaceAboutToBeDestroyed(WaylandSurface *surface); + virtual void surfaceCreated(QWaylandSurface *surface) = 0; + virtual void surfaceAboutToBeDestroyed(QWaylandSurface *surface); virtual void openUrl(WaylandClient *client, const QUrl &url); - Wayland::Compositor *handle() const; + QtWayland::Compositor *handle() const; void setRetainedSelectionEnabled(bool enable); virtual void retainedSelectionReceived(QMimeData *mimeData); @@ -101,13 +103,13 @@ public: void setOutputRefreshRate(int refreshRate); int outputRefreshRate() const; - WaylandInputDevice *defaultInputDevice() const; + QWaylandInputDevice *defaultInputDevice() const; bool isDragging() const; - void sendDragMoveEvent(const QPoint &global, const QPoint &local, WaylandSurface *surface); + void sendDragMoveEvent(const QPoint &global, const QPoint &local, QWaylandSurface *surface); void sendDragEndEvent(); - virtual void setCursorSurface(WaylandSurface *surface, int hotspotX, int hotspotY); + virtual void setCursorSurface(QWaylandSurface *surface, int hotspotX, int hotspotY); void enableSubSurfaceExtension(); @@ -121,11 +123,13 @@ public: private: static void retainedSelectionChanged(QMimeData *mimeData, void *param); - Wayland::Compositor *m_compositor; + QtWayland::Compositor *m_compositor; QWindow *m_toplevel_window; QByteArray m_socket_name; }; -Q_DECLARE_OPERATORS_FOR_FLAGS(WaylandCompositor::TouchExtensionFlags) +Q_DECLARE_OPERATORS_FOR_FLAGS(QWaylandCompositor::TouchExtensionFlags) + +QT_END_NAMESPACE -#endif // QTCOMP_H +#endif // QWAYLANDCOMPOSITOR_H diff --git a/src/compositor/compositor_api/waylandinput.cpp b/src/compositor/compositor_api/qwaylandinput.cpp index 4eaeae65..c73784eb 100644 --- a/src/compositor/compositor_api/waylandinput.cpp +++ b/src/compositor/compositor_api/qwaylandinput.cpp @@ -38,34 +38,36 @@ ** ****************************************************************************/ -#include "waylandinput.h" +#include "qwaylandinput.h" -#include "wlinputdevice.h" -#include "waylandcompositor.h" -#include "wlsurface.h" -#include "wlcompositor.h" +#include "qwlinputdevice_p.h" +#include "qwaylandcompositor.h" +#include "qwlsurface_p.h" +#include "qwlcompositor_p.h" -WaylandInputDevice::WaylandInputDevice(WaylandCompositor *compositor) - : d(new Wayland::InputDevice(this,compositor->handle())) +QT_BEGIN_NAMESPACE + +QWaylandInputDevice::QWaylandInputDevice(QWaylandCompositor *compositor) + : d(new QtWayland::InputDevice(this,compositor->handle())) { } -WaylandInputDevice::~WaylandInputDevice() +QWaylandInputDevice::~QWaylandInputDevice() { delete d; } -void WaylandInputDevice::sendMousePressEvent(Qt::MouseButton button, const QPointF &localPos, const QPointF &globalPos) +void QWaylandInputDevice::sendMousePressEvent(Qt::MouseButton button, const QPointF &localPos, const QPointF &globalPos) { d->sendMousePressEvent(button,localPos,globalPos); } -void WaylandInputDevice::sendMouseReleaseEvent(Qt::MouseButton button, const QPointF &localPos, const QPointF &globalPos) +void QWaylandInputDevice::sendMouseReleaseEvent(Qt::MouseButton button, const QPointF &localPos, const QPointF &globalPos) { d->sendMouseReleaseEvent(button,localPos,globalPos); } -void WaylandInputDevice::sendMouseMoveEvent(const QPointF &localPos, const QPointF &globalPos) +void QWaylandInputDevice::sendMouseMoveEvent(const QPointF &localPos, const QPointF &globalPos) { d->sendMouseMoveEvent(localPos,globalPos); } @@ -73,88 +75,88 @@ void WaylandInputDevice::sendMouseMoveEvent(const QPointF &localPos, const QPoin /** Convenience function that will set the mouse focus to the surface, then send the mouse move event. * If the mouse focus is the same surface as the surface passed in, then only the move event is sent **/ -void WaylandInputDevice::sendMouseMoveEvent(WaylandSurface *surface, const QPointF &localPos, const QPointF &globalPos) +void QWaylandInputDevice::sendMouseMoveEvent(QWaylandSurface *surface, const QPointF &localPos, const QPointF &globalPos) { - Wayland::Surface *wlsurface = surface? surface->handle():0; + QtWayland::Surface *wlsurface = surface? surface->handle():0; d->sendMouseMoveEvent(wlsurface,localPos,globalPos); } -void WaylandInputDevice::sendMouseWheelEvent(Qt::Orientation orientation, int delta) +void QWaylandInputDevice::sendMouseWheelEvent(Qt::Orientation orientation, int delta) { d->sendMouseWheelEvent(orientation, delta); } -void WaylandInputDevice::sendKeyPressEvent(uint code) +void QWaylandInputDevice::sendKeyPressEvent(uint code) { d->sendKeyPressEvent(code); } -void WaylandInputDevice::sendKeyReleaseEvent(uint code) +void QWaylandInputDevice::sendKeyReleaseEvent(uint code) { d->sendKeyReleaseEvent(code); } -void WaylandInputDevice::sendTouchPointEvent(int id, double x, double y, Qt::TouchPointState state) +void QWaylandInputDevice::sendTouchPointEvent(int id, double x, double y, Qt::TouchPointState state) { d->sendTouchPointEvent(id,x,y,state); } -void WaylandInputDevice::sendTouchFrameEvent() +void QWaylandInputDevice::sendTouchFrameEvent() { d->sendTouchFrameEvent(); } -void WaylandInputDevice::sendTouchCancelEvent() +void QWaylandInputDevice::sendTouchCancelEvent() { d->sendTouchCancelEvent(); } -void WaylandInputDevice::sendFullTouchEvent(QTouchEvent *event) +void QWaylandInputDevice::sendFullTouchEvent(QTouchEvent *event) { d->sendFullTouchEvent(event); } -void WaylandInputDevice::sendFullKeyEvent(QKeyEvent *event) +void QWaylandInputDevice::sendFullKeyEvent(QKeyEvent *event) { d->sendFullKeyEvent(event); } -WaylandSurface *WaylandInputDevice::keyboardFocus() const +QWaylandSurface *QWaylandInputDevice::keyboardFocus() const { - Wayland::Surface *wlsurface = d->keyboardFocus(); + QtWayland::Surface *wlsurface = d->keyboardFocus(); if (wlsurface) return wlsurface->waylandSurface(); return 0; } -bool WaylandInputDevice::setKeyboardFocus(WaylandSurface *surface) +bool QWaylandInputDevice::setKeyboardFocus(QWaylandSurface *surface) { - Wayland::Surface *wlsurface = surface?surface->handle():0; + QtWayland::Surface *wlsurface = surface?surface->handle():0; return d->setKeyboardFocus(wlsurface); } -WaylandSurface *WaylandInputDevice::mouseFocus() const +QWaylandSurface *QWaylandInputDevice::mouseFocus() const { - Wayland::Surface *wlsurface = d->mouseFocus(); + QtWayland::Surface *wlsurface = d->mouseFocus(); if (wlsurface) return wlsurface->waylandSurface(); return 0; } -void WaylandInputDevice::setMouseFocus(WaylandSurface *surface, const QPointF &localPos, const QPointF &globalPos) +void QWaylandInputDevice::setMouseFocus(QWaylandSurface *surface, const QPointF &localPos, const QPointF &globalPos) { - Wayland::Surface *wlsurface = surface?surface->handle():0; + QtWayland::Surface *wlsurface = surface?surface->handle():0; d->setMouseFocus(wlsurface,localPos,globalPos); } -WaylandCompositor *WaylandInputDevice::compositor() const +QWaylandCompositor *QWaylandInputDevice::compositor() const { return d->compositor()->waylandCompositor(); } -Wayland::InputDevice *WaylandInputDevice::handle() const +QtWayland::InputDevice *QWaylandInputDevice::handle() const { return d; } - +QT_END_NAMESPACE diff --git a/src/compositor/compositor_api/waylandinput.h b/src/compositor/compositor_api/qwaylandinput.h index 62229107..b9d66178 100644 --- a/src/compositor/compositor_api/waylandinput.h +++ b/src/compositor/compositor_api/qwaylandinput.h @@ -38,33 +38,35 @@ ** ****************************************************************************/ -#ifndef WAYLANDINPUT_H -#define WAYLANDINPUT_H +#ifndef QWAYLANDINPUT_H +#define QWAYLANDINPUT_H #include <QtCore/qnamespace.h> #include <QtCore/QPoint> -#include "waylandexport.h" +#include <QtCompositor/qwaylandexport.h> -class WaylandCompositor; -class WaylandSurface; +class QWaylandCompositor; +class QWaylandSurface; class QKeyEvent; class QTouchEvent; -namespace Wayland { +QT_BEGIN_NAMESPACE + +namespace QtWayland { class InputDevice; } -class Q_COMPOSITOR_EXPORT WaylandInputDevice +class Q_COMPOSITOR_EXPORT QWaylandInputDevice { public: - WaylandInputDevice(WaylandCompositor *compositor); - ~WaylandInputDevice(); + QWaylandInputDevice(QWaylandCompositor *compositor); + ~QWaylandInputDevice(); void sendMousePressEvent(Qt::MouseButton button, const QPointF &localPos, const QPointF &globalPos = QPointF()); void sendMouseReleaseEvent(Qt::MouseButton button, const QPointF &localPos, const QPointF &globalPos = QPointF()); void sendMouseMoveEvent(const QPointF &localPos, const QPointF &globalPos = QPointF()); - void sendMouseMoveEvent(WaylandSurface *surface , const QPointF &localPos, const QPointF &globalPos = QPointF()); + void sendMouseMoveEvent(QWaylandSurface *surface , const QPointF &localPos, const QPointF &globalPos = QPointF()); void sendMouseWheelEvent(Qt::Orientation orientation, int delta); void sendKeyPressEvent(uint code); @@ -78,18 +80,20 @@ public: void sendFullTouchEvent(QTouchEvent *event); - WaylandSurface *keyboardFocus() const; - bool setKeyboardFocus(WaylandSurface *surface); + QWaylandSurface *keyboardFocus() const; + bool setKeyboardFocus(QWaylandSurface *surface); - WaylandSurface *mouseFocus() const; - void setMouseFocus(WaylandSurface *surface, const QPointF &local_pos, const QPointF &global_pos = QPointF()); + QWaylandSurface *mouseFocus() const; + void setMouseFocus(QWaylandSurface *surface, const QPointF &local_pos, const QPointF &global_pos = QPointF()); - WaylandCompositor *compositor() const; - Wayland::InputDevice *handle() const; + QWaylandCompositor *compositor() const; + QtWayland::InputDevice *handle() const; private: - Wayland::InputDevice *d; - Q_DISABLE_COPY(WaylandInputDevice) + QtWayland::InputDevice *d; + Q_DISABLE_COPY(QWaylandInputDevice) }; -#endif // WAYLANDINPUT_H +QT_END_NAMESPACE + +#endif // QWAYLANDINPUT_H diff --git a/src/compositor/compositor_api/waylandsurface.cpp b/src/compositor/compositor_api/qwaylandsurface.cpp index e30c148a..f9716925 100644 --- a/src/compositor/compositor_api/waylandsurface.cpp +++ b/src/compositor/compositor_api/qwaylandsurface.cpp @@ -38,37 +38,39 @@ ** ****************************************************************************/ -#include "waylandsurface.h" +#include "qwaylandsurface.h" #include <private/qobject_p.h> -#include "wayland_wrapper/wlsurface.h" -#include "wayland_wrapper/wlextendedsurface.h" -#include "wayland_wrapper/wlsubsurface.h" -#include "wayland_wrapper/wlcompositor.h" -#include "wayland_wrapper/wlshellsurface.h" +#include "wayland_wrapper/qwlsurface_p.h" +#include "wayland_wrapper/qwlextendedsurface_p.h" +#include "wayland_wrapper/qwlsubsurface_p.h" +#include "wayland_wrapper/qwlcompositor_p.h" +#include "wayland_wrapper/qwlshellsurface_p.h" -#include "waylandcompositor.h" +#include "qwaylandcompositor.h" #include "waylandwindowmanagerintegration.h" #include <QtGui/QGuiApplication> #include <QtGui/QScreen> #ifdef QT_COMPOSITOR_QUICK -#include "waylandsurfaceitem.h" +#include "qwaylandsurfaceitem.h" #endif -class WaylandSurfacePrivate : public QObjectPrivate +QT_BEGIN_NAMESPACE + +class QWaylandSurfacePrivate : public QObjectPrivate { public: - WaylandSurfacePrivate(Wayland::Surface *srfc) + QWaylandSurfacePrivate(QtWayland::Surface *srfc) : surface(srfc) #ifdef QT_COMPOSITOR_QUICK , surface_item(0) #endif {} - ~WaylandSurfacePrivate() + ~QWaylandSurfacePrivate() { #ifdef QT_COMPOSITOR_QUICK if (surface_item) @@ -76,155 +78,155 @@ public: #endif } - Wayland::Surface *surface; + QtWayland::Surface *surface; #ifdef QT_COMPOSITOR_QUICK - WaylandSurfaceItem *surface_item; + QWaylandSurfaceItem *surface_item; #endif }; -WaylandSurface::WaylandSurface(Wayland::Surface *surface) - : QObject(*new WaylandSurfacePrivate(surface)) +QWaylandSurface::QWaylandSurface(QtWayland::Surface *surface) + : QObject(*new QWaylandSurfacePrivate(surface)) { } -WaylandClient *WaylandSurface::client() const +WaylandClient *QWaylandSurface::client() const { - Q_D(const WaylandSurface); + Q_D(const QWaylandSurface); return d->surface->base()->resource.client; } -WaylandSurface *WaylandSurface::parentSurface() const +QWaylandSurface *QWaylandSurface::parentSurface() const { - Q_D(const WaylandSurface); + Q_D(const QWaylandSurface); if (d->surface->subSurface() && d->surface->subSurface()->parent()) { return d->surface->subSurface()->parent()->waylandSurface(); } return 0; } -QLinkedList<WaylandSurface *> WaylandSurface::subSurfaces() const +QLinkedList<QWaylandSurface *> QWaylandSurface::subSurfaces() const { - Q_D(const WaylandSurface); + Q_D(const QWaylandSurface); if (d->surface->subSurface()) { return d->surface->subSurface()->subSurfaces(); } - return QLinkedList<WaylandSurface *>(); + return QLinkedList<QWaylandSurface *>(); } -WaylandSurface::Type WaylandSurface::type() const +QWaylandSurface::Type QWaylandSurface::type() const { - Q_D(const WaylandSurface); + Q_D(const QWaylandSurface); return d->surface->type(); } -bool WaylandSurface::isYInverted() const +bool QWaylandSurface::isYInverted() const { - Q_D(const WaylandSurface); + Q_D(const QWaylandSurface); return d->surface->isYInverted(); } -bool WaylandSurface::visible() const +bool QWaylandSurface::visible() const { - Q_D(const WaylandSurface); + Q_D(const QWaylandSurface); return d->surface->visible(); } -QPointF WaylandSurface::pos() const +QPointF QWaylandSurface::pos() const { - Q_D(const WaylandSurface); + Q_D(const QWaylandSurface); return d->surface->pos(); } -void WaylandSurface::setPos(const QPointF &pos) +void QWaylandSurface::setPos(const QPointF &pos) { - Q_D(WaylandSurface); + Q_D(QWaylandSurface); d->surface->setPos(pos); } -QSize WaylandSurface::size() const +QSize QWaylandSurface::size() const { - Q_D(const WaylandSurface); + Q_D(const QWaylandSurface); return d->surface->size(); } -void WaylandSurface::setSize(const QSize &size) +void QWaylandSurface::setSize(const QSize &size) { - Q_D(WaylandSurface); + Q_D(QWaylandSurface); d->surface->setSize(size); } -void WaylandSurface::sendConfigure(const QSize &size) +void QWaylandSurface::sendConfigure(const QSize &size) { - Q_D(WaylandSurface); + Q_D(QWaylandSurface); if (d->surface->shellSurface()) d->surface->shellSurface()->sendConfigure(WL_SHELL_SURFACE_RESIZE_BOTTOM_RIGHT, size.width(), size.height()); } -Qt::ScreenOrientations WaylandSurface::orientationUpdateMask() const +Qt::ScreenOrientations QWaylandSurface::orientationUpdateMask() const { - Q_D(const WaylandSurface); + Q_D(const QWaylandSurface); return d->surface->compositor()->orientationUpdateMaskForClient(static_cast<wl_client *>(client())); } -Qt::ScreenOrientation WaylandSurface::contentOrientation() const +Qt::ScreenOrientation QWaylandSurface::contentOrientation() const { - Q_D(const WaylandSurface); + Q_D(const QWaylandSurface); if (!d->surface->extendedSurface()) return Qt::PrimaryOrientation; return d->surface->extendedSurface()->contentOrientation(); } -WaylandSurface::WindowFlags WaylandSurface::windowFlags() const +QWaylandSurface::WindowFlags QWaylandSurface::windowFlags() const { - Q_D(const WaylandSurface); + Q_D(const QWaylandSurface); if (!d->surface->extendedSurface()) - return WaylandSurface::WindowFlags(0); + return QWaylandSurface::WindowFlags(0); return d->surface->extendedSurface()->windowFlags(); } -QImage WaylandSurface::image() const +QImage QWaylandSurface::image() const { - Q_D(const WaylandSurface); + Q_D(const QWaylandSurface); return d->surface->image(); } #ifdef QT_COMPOSITOR_WAYLAND_GL -GLuint WaylandSurface::texture(QOpenGLContext *context) const +GLuint QWaylandSurface::texture(QOpenGLContext *context) const { - Q_D(const WaylandSurface); + Q_D(const QWaylandSurface); return d->surface->textureId(context); } #else //QT_COMPOSITOR_WAYLAND_GL -uint WaylandSurface::texture(QOpenGLContext *) const +uint QWaylandSurface::texture(QOpenGLContext *) const { return 0; } #endif -Wayland::Surface * WaylandSurface::handle() const +QtWayland::Surface * QWaylandSurface::handle() const { - Q_D(const WaylandSurface); + Q_D(const QWaylandSurface); return d->surface; } #ifdef QT_COMPOSITOR_QUICK -WaylandSurfaceItem *WaylandSurface::surfaceItem() const +QWaylandSurfaceItem *QWaylandSurface::surfaceItem() const { - Q_D(const WaylandSurface); + Q_D(const QWaylandSurface); return d->surface_item; } -void WaylandSurface::setSurfaceItem(WaylandSurfaceItem *surfaceItem) +void QWaylandSurface::setSurfaceItem(QWaylandSurfaceItem *surfaceItem) { - Q_D(WaylandSurface); + Q_D(QWaylandSurface); d->surface_item = surfaceItem; } #endif //QT_COMPOSITOR_QUICK -qint64 WaylandSurface::processId() const +qint64 QWaylandSurface::processId() const { - Q_D(const WaylandSurface); + Q_D(const QWaylandSurface); WindowManagerServerIntegration *wmIntegration = d->surface->compositor()->windowManagerIntegration(); if (!wmIntegration) { return 0; @@ -234,9 +236,9 @@ qint64 WaylandSurface::processId() const return mcl ? mcl->processId() : 0; } -QByteArray WaylandSurface::authenticationToken() const +QByteArray QWaylandSurface::authenticationToken() const { - Q_D(const WaylandSurface); + Q_D(const QWaylandSurface); WindowManagerServerIntegration *wmIntegration = d->surface->compositor()->windowManagerIntegration(); if (!wmIntegration) { return QByteArray(); @@ -246,34 +248,34 @@ QByteArray WaylandSurface::authenticationToken() const return mcl ? mcl->authenticationToken() : QByteArray(); } -QVariantMap WaylandSurface::windowProperties() const +QVariantMap QWaylandSurface::windowProperties() const { - Q_D(const WaylandSurface); + Q_D(const QWaylandSurface); if (!d->surface->extendedSurface()) return QVariantMap(); return d->surface->extendedSurface()->windowProperties(); } -void WaylandSurface::setWindowProperty(const QString &name, const QVariant &value) +void QWaylandSurface::setWindowProperty(const QString &name, const QVariant &value) { - Q_D(WaylandSurface); + Q_D(QWaylandSurface); if (!d->surface->extendedSurface()) return; d->surface->extendedSurface()->setWindowProperty(name, value); } -QPointF WaylandSurface::mapToParent(const QPointF &pos) const +QPointF QWaylandSurface::mapToParent(const QPointF &pos) const { return pos + this->pos(); } -QPointF WaylandSurface::mapTo(WaylandSurface *parent, const QPointF &pos) const +QPointF QWaylandSurface::mapTo(QWaylandSurface *parent, const QPointF &pos) const { QPointF p = pos; if (parent) { - const WaylandSurface * surface = this; + const QWaylandSurface * surface = this; while (surface != parent) { Q_ASSERT_X(surface, "WaylandSurface::mapTo(WaylandSurface *parent, const QPoint &pos)", "parent must be in parent hierarchy"); @@ -284,48 +286,48 @@ QPointF WaylandSurface::mapTo(WaylandSurface *parent, const QPointF &pos) const return p; } -WaylandCompositor *WaylandSurface::compositor() const +QWaylandCompositor *QWaylandSurface::compositor() const { - Q_D(const WaylandSurface); + Q_D(const QWaylandSurface); return d->surface->compositor()->waylandCompositor(); } -void WaylandSurface::frameFinished() +void QWaylandSurface::frameFinished() { - Q_D(WaylandSurface); + Q_D(QWaylandSurface); d->surface->frameFinished(); } -WaylandSurface *WaylandSurface::transientParent() const +QWaylandSurface *QWaylandSurface::transientParent() const { - Q_D(const WaylandSurface); + Q_D(const QWaylandSurface); if (d->surface->shellSurface() && d->surface->shellSurface()->transientParent()) return d->surface->shellSurface()->transientParent()->surface()->waylandSurface(); return 0; } -void WaylandSurface::sendOnScreenVisibilityChange(bool visible) +void QWaylandSurface::sendOnScreenVisibilityChange(bool visible) { - Q_D(WaylandSurface); + Q_D(QWaylandSurface); if (d->surface->extendedSurface()) d->surface->extendedSurface()->sendOnScreenVisibility(visible); } -QString WaylandSurface::className() const +QString QWaylandSurface::className() const { - Q_D(const WaylandSurface); + Q_D(const QWaylandSurface); return d->surface->className(); } -QString WaylandSurface::title() const +QString QWaylandSurface::title() const { - Q_D(const WaylandSurface); + Q_D(const QWaylandSurface); return d->surface->title(); } -bool WaylandSurface::hasShellSurface() const +bool QWaylandSurface::hasShellSurface() const { - Q_D(const WaylandSurface); + Q_D(const QWaylandSurface); if (d->surface->shellSurface()) return true; @@ -335,8 +337,10 @@ bool WaylandSurface::hasShellSurface() const /*! * \return True if WL_SHELL_SURFACE_TRANSIENT_INACTIVE was set for this surface, meaning it should not receive keyboard focus. */ -bool WaylandSurface::transientInactive() const +bool QWaylandSurface::transientInactive() const { - Q_D(const WaylandSurface); + Q_D(const QWaylandSurface); return d->surface->transientInactive(); } + +QT_END_NAMESPACE diff --git a/src/compositor/compositor_api/waylandsurface.h b/src/compositor/compositor_api/qwaylandsurface.h index e21f124a..544fbc04 100644 --- a/src/compositor/compositor_api/waylandsurface.h +++ b/src/compositor/compositor_api/qwaylandsurface.h @@ -38,10 +38,10 @@ ** ****************************************************************************/ -#ifndef WAYLANDSURFACE_H -#define WAYLANDSURFACE_H +#ifndef QWAYLANDSURFACE_H +#define QWAYLANDSURFACE_H -#include "waylandexport.h" +#include <QtCompositor/qwaylandexport.h> #include <QtCore/QScopedPointer> #include <QtGui/QImage> @@ -52,27 +52,29 @@ #include <QtGui/qopengl.h> #endif +QT_BEGIN_NAMESPACE + class QTouchEvent; -class WaylandSurfacePrivate; -class WaylandCompositor; +class QWaylandSurfacePrivate; +class QWaylandCompositor; #ifdef QT_COMPOSITOR_QUICK -class WaylandSurfaceItem; +class QWaylandSurfaceItem; #endif -namespace Wayland { +namespace QtWayland { class Surface; class SurfacePrivate; class ExtendedSurface; } -class Q_COMPOSITOR_EXPORT WaylandSurface : public QObject +class Q_COMPOSITOR_EXPORT QWaylandSurface : public QObject { Q_OBJECT - Q_DECLARE_PRIVATE(WaylandSurface) + Q_DECLARE_PRIVATE(QWaylandSurface) Q_PROPERTY(QSize size READ size WRITE setSize NOTIFY sizeChanged) Q_PROPERTY(QPointF pos READ pos WRITE setPos NOTIFY posChanged) - Q_PROPERTY(WaylandSurface::WindowFlags windowFlags READ windowFlags NOTIFY windowFlagsChanged) + Q_PROPERTY(QWaylandSurface::WindowFlags windowFlags READ windowFlags NOTIFY windowFlagsChanged) Q_PROPERTY(Qt::ScreenOrientation contentOrientation READ contentOrientation NOTIFY contentOrientationChanged) Q_PROPERTY(QString className READ className NOTIFY classNameChanged) Q_PROPERTY(QString title READ title NOTIFY titleChanged) @@ -94,12 +96,12 @@ public: Texture }; - WaylandSurface(Wayland::Surface *surface = 0); + QWaylandSurface(QtWayland::Surface *surface = 0); WaylandClient *client() const; - WaylandSurface *parentSurface() const; - QLinkedList<WaylandSurface *> subSurfaces() const; + QWaylandSurface *parentSurface() const; + QLinkedList<QWaylandSurface *> subSurfaces() const; Type type() const; bool isYInverted() const; @@ -128,13 +130,13 @@ public: void frameFinished(); - WaylandSurface *transientParent() const; + QWaylandSurface *transientParent() const; - Wayland::Surface *handle() const; + QtWayland::Surface *handle() const; #ifdef QT_COMPOSITOR_QUICK - WaylandSurfaceItem *surfaceItem() const; - void setSurfaceItem(WaylandSurfaceItem *surfaceItem); + QWaylandSurfaceItem *surfaceItem() const; + void setSurfaceItem(QWaylandSurfaceItem *surfaceItem); #endif qint64 processId() const; @@ -143,9 +145,9 @@ public: void setWindowProperty(const QString &name, const QVariant &value); QPointF mapToParent(const QPointF &) const; - QPointF mapTo(WaylandSurface *, const QPointF &) const; + QPointF mapTo(QWaylandSurface *, const QPointF &) const; - WaylandCompositor *compositor() const; + QWaylandCompositor *compositor() const; QString className() const; @@ -159,7 +161,7 @@ signals: void mapped(); void unmapped(); void damaged(const QRect &rect); - void parentChanged(WaylandSurface *newParent, WaylandSurface *oldParent); + void parentChanged(QWaylandSurface *newParent, QWaylandSurface *oldParent); void sizeChanged(); void posChanged(); void windowPropertyChanged(const QString &name, const QVariant &value); @@ -172,4 +174,6 @@ signals: }; -#endif // WAYLANDSURFACE_H +QT_END_NAMESPACE + +#endif // QWAYLANDSURFACE_H diff --git a/src/compositor/compositor_api/waylandsurfaceitem.cpp b/src/compositor/compositor_api/qwaylandsurfaceitem.cpp index f90809bc..787db177 100644 --- a/src/compositor/compositor_api/waylandsurfaceitem.cpp +++ b/src/compositor/compositor_api/qwaylandsurfaceitem.cpp @@ -38,14 +38,14 @@ ** ****************************************************************************/ -#include "waylandsurfaceitem.h" -#include "waylandsurfacenode.h" -#include "waylandsurface.h" -#include "waylandcompositor.h" -#include "waylandinput.h" +#include "qwaylandsurfaceitem.h" +#include "qwaylandsurfacenode_p.h" +#include "qwaylandsurface.h" +#include "qwaylandcompositor.h" +#include "qwaylandinput.h" -#include "wlsurface.h" -#include "wlextendedsurface.h" +#include "qwlsurface_p.h" +#include "qwlextendedsurface_p.h" #include <QtGui/QKeyEvent> #include <QtGui/QGuiApplication> @@ -57,14 +57,15 @@ #include <QtCore/QMutexLocker> #include <QtCore/QMutex> +QT_BEGIN_NAMESPACE -class WaylandSurfaceTextureProvider : public QSGTextureProvider +class QWaylandSurfaceTextureProvider : public QSGTextureProvider { Q_OBJECT public: - WaylandSurfaceTextureProvider() : t(0) { } - ~WaylandSurfaceTextureProvider() { delete t; } + QWaylandSurfaceTextureProvider() : t(0) { } + ~QWaylandSurfaceTextureProvider() { delete t; } QSGTexture *texture() const { if (t) @@ -83,9 +84,9 @@ public slots: } }; -QMutex *WaylandSurfaceItem::mutex = 0; +QMutex *QWaylandSurfaceItem::mutex = 0; -WaylandSurfaceItem::WaylandSurfaceItem(QQuickItem *parent) +QWaylandSurfaceItem::QWaylandSurfaceItem(QQuickItem *parent) : QQuickItem(parent) , m_surface(0) , m_provider(0) @@ -99,7 +100,7 @@ WaylandSurfaceItem::WaylandSurfaceItem(QQuickItem *parent) mutex = new QMutex; } -WaylandSurfaceItem::WaylandSurfaceItem(WaylandSurface *surface, QQuickItem *parent) +QWaylandSurfaceItem::QWaylandSurfaceItem(QWaylandSurface *surface, QQuickItem *parent) : QQuickItem(parent) , m_surface(0) , m_provider(0) @@ -112,7 +113,7 @@ WaylandSurfaceItem::WaylandSurfaceItem(WaylandSurface *surface, QQuickItem *pare init(surface); } -void WaylandSurfaceItem::init(WaylandSurface *surface) +void QWaylandSurfaceItem::init(QWaylandSurface *surface) { if (!surface) return; @@ -142,8 +143,8 @@ void WaylandSurfaceItem::init(WaylandSurface *surface) connect(surface, SIGNAL(unmapped()), this, SLOT(surfaceUnmapped())); connect(surface, SIGNAL(destroyed(QObject *)), this, SLOT(surfaceDestroyed(QObject *))); connect(surface, SIGNAL(damaged(const QRect &)), this, SLOT(surfaceDamaged(const QRect &))); - connect(surface, SIGNAL(parentChanged(WaylandSurface*,WaylandSurface*)), - this, SLOT(parentChanged(WaylandSurface*,WaylandSurface*))); + connect(surface, SIGNAL(parentChanged(QWaylandSurface*,QWaylandSurface*)), + this, SLOT(parentChanged(QWaylandSurface*,QWaylandSurface*))); connect(surface, SIGNAL(sizeChanged()), this, SLOT(updateSize())); connect(surface, SIGNAL(posChanged()), this, SLOT(updatePosition())); @@ -151,7 +152,7 @@ void WaylandSurfaceItem::init(WaylandSurface *surface) m_yInverted = surface ? surface->isYInverted() : true; } -WaylandSurfaceItem::~WaylandSurfaceItem() +QWaylandSurfaceItem::~QWaylandSurfaceItem() { QMutexLocker locker(mutex); if (m_node) @@ -162,7 +163,7 @@ WaylandSurfaceItem::~WaylandSurfaceItem() m_provider->deleteLater(); } -void WaylandSurfaceItem::setSurface(WaylandSurface *surface) +void QWaylandSurfaceItem::setSurface(QWaylandSurface *surface) { if (surface == m_surface) return; @@ -171,79 +172,79 @@ void WaylandSurfaceItem::setSurface(WaylandSurface *surface) emit surfaceChanged(); } -bool WaylandSurfaceItem::isYInverted() const +bool QWaylandSurfaceItem::isYInverted() const { return m_yInverted; } -QSGTextureProvider *WaylandSurfaceItem::textureProvider() const +QSGTextureProvider *QWaylandSurfaceItem::textureProvider() const { - const_cast<WaylandSurfaceItem *>(this)->ensureProvider(); + const_cast<QWaylandSurfaceItem *>(this)->ensureProvider(); return m_provider; } -void WaylandSurfaceItem::ensureProvider() +void QWaylandSurfaceItem::ensureProvider() { if (!m_provider) { - m_provider = new WaylandSurfaceTextureProvider(); + m_provider = new QWaylandSurfaceTextureProvider(); connect(window(), SIGNAL(sceneGraphInvalidated()), m_provider, SLOT(invalidate()), Qt::DirectConnection); } } -void WaylandSurfaceItem::mousePressEvent(QMouseEvent *event) +void QWaylandSurfaceItem::mousePressEvent(QMouseEvent *event) { if (m_surface) { - WaylandInputDevice *inputDevice = m_surface->compositor()->defaultInputDevice(); + QWaylandInputDevice *inputDevice = m_surface->compositor()->defaultInputDevice(); if (inputDevice->mouseFocus() != m_surface) inputDevice->setMouseFocus(m_surface, event->pos(), event->globalPos()); inputDevice->sendMousePressEvent(event->button(), toSurface(event->pos()), event->globalPos()); } } -void WaylandSurfaceItem::mouseMoveEvent(QMouseEvent *event) +void QWaylandSurfaceItem::mouseMoveEvent(QMouseEvent *event) { if (m_surface){ - WaylandInputDevice *inputDevice = m_surface->compositor()->defaultInputDevice(); + QWaylandInputDevice *inputDevice = m_surface->compositor()->defaultInputDevice(); inputDevice->sendMouseMoveEvent(m_surface, toSurface(event->pos()), event->globalPos()); } } -void WaylandSurfaceItem::mouseReleaseEvent(QMouseEvent *event) +void QWaylandSurfaceItem::mouseReleaseEvent(QMouseEvent *event) { if (m_surface){ - WaylandInputDevice *inputDevice = m_surface->compositor()->defaultInputDevice(); + QWaylandInputDevice *inputDevice = m_surface->compositor()->defaultInputDevice(); inputDevice->sendMouseReleaseEvent(event->button(), toSurface(event->pos()), event->globalPos()); } } -void WaylandSurfaceItem::wheelEvent(QWheelEvent *event) +void QWaylandSurfaceItem::wheelEvent(QWheelEvent *event) { if (m_surface) { - WaylandInputDevice *inputDevice = m_surface->compositor()->defaultInputDevice(); + QWaylandInputDevice *inputDevice = m_surface->compositor()->defaultInputDevice(); inputDevice->sendMouseWheelEvent(event->orientation(), event->delta()); } } -void WaylandSurfaceItem::keyPressEvent(QKeyEvent *event) +void QWaylandSurfaceItem::keyPressEvent(QKeyEvent *event) { if (m_surface && hasFocus()) { - WaylandInputDevice *inputDevice = m_surface->compositor()->defaultInputDevice(); + QWaylandInputDevice *inputDevice = m_surface->compositor()->defaultInputDevice(); inputDevice->sendFullKeyEvent(event); } } -void WaylandSurfaceItem::keyReleaseEvent(QKeyEvent *event) +void QWaylandSurfaceItem::keyReleaseEvent(QKeyEvent *event) { if (m_surface && hasFocus()) { - WaylandInputDevice *inputDevice = m_surface->compositor()->defaultInputDevice(); + QWaylandInputDevice *inputDevice = m_surface->compositor()->defaultInputDevice(); inputDevice->sendFullKeyEvent(event); } } -void WaylandSurfaceItem::touchEvent(QTouchEvent *event) +void QWaylandSurfaceItem::touchEvent(QTouchEvent *event) { if (m_touchEventsEnabled && m_surface) { - WaylandInputDevice *inputDevice = m_surface->compositor()->defaultInputDevice(); + QWaylandInputDevice *inputDevice = m_surface->compositor()->defaultInputDevice(); event->accept(); if (inputDevice->mouseFocus() != m_surface) { QPoint pointPos; @@ -258,43 +259,43 @@ void WaylandSurfaceItem::touchEvent(QTouchEvent *event) } } -void WaylandSurfaceItem::takeFocus() +void QWaylandSurfaceItem::takeFocus() { setFocus(true); if (m_surface) { - WaylandInputDevice *inputDevice = m_surface->compositor()->defaultInputDevice(); + QWaylandInputDevice *inputDevice = m_surface->compositor()->defaultInputDevice(); inputDevice->setKeyboardFocus(m_surface); } } -QPoint WaylandSurfaceItem::toSurface(const QPointF &pos) const +QPoint QWaylandSurfaceItem::toSurface(const QPointF &pos) const { return pos.toPoint(); } -void WaylandSurfaceItem::surfaceMapped() +void QWaylandSurfaceItem::surfaceMapped() { setPaintEnabled(true); } -void WaylandSurfaceItem::surfaceUnmapped() +void QWaylandSurfaceItem::surfaceUnmapped() { setPaintEnabled(false); } -void WaylandSurfaceItem::surfaceDestroyed(QObject *) +void QWaylandSurfaceItem::surfaceDestroyed(QObject *) { m_surface = 0; } -void WaylandSurfaceItem::setDamagedFlag(bool on) +void QWaylandSurfaceItem::setDamagedFlag(bool on) { m_damaged = on; } -void WaylandSurfaceItem::surfaceDamaged(const QRect &) +void QWaylandSurfaceItem::surfaceDamaged(const QRect &) { m_damaged = true; if (m_surface) { @@ -308,11 +309,11 @@ void WaylandSurfaceItem::surfaceDamaged(const QRect &) update(); } -void WaylandSurfaceItem::parentChanged(WaylandSurface *newParent, WaylandSurface *oldParent) +void QWaylandSurfaceItem::parentChanged(QWaylandSurface *newParent, QWaylandSurface *oldParent) { Q_UNUSED(oldParent); - WaylandSurfaceItem *item = newParent? newParent->surfaceItem():0; + QWaylandSurfaceItem *item = newParent? newParent->surfaceItem():0; setParentItem(item); if (newParent) { @@ -323,35 +324,35 @@ void WaylandSurfaceItem::parentChanged(WaylandSurface *newParent, WaylandSurface } } -void WaylandSurfaceItem::updateSize() +void QWaylandSurfaceItem::updateSize() { setSize(m_surface->size()); } -void WaylandSurfaceItem::updatePosition() +void QWaylandSurfaceItem::updatePosition() { setPosition(m_surface->pos()); } -bool WaylandSurfaceItem::paintEnabled() const +bool QWaylandSurfaceItem::paintEnabled() const { return m_paintEnabled; } -void WaylandSurfaceItem::setPaintEnabled(bool enabled) +void QWaylandSurfaceItem::setPaintEnabled(bool enabled) { m_paintEnabled = enabled; update(); } -void WaylandSurfaceItem::updateTexture() +void QWaylandSurfaceItem::updateTexture() { ensureProvider(); QSGTexture *texture = m_provider->t; if (m_damaged) { m_damaged = false; QSGTexture *oldTexture = texture; - if (m_surface->type() == WaylandSurface::Texture) { + if (m_surface->type() == QWaylandSurface::Texture) { QOpenGLContext *context = QOpenGLContext::currentContext(); QQuickWindow::CreateTextureOptions opt = 0; if (useTextureAlpha()) { @@ -369,7 +370,7 @@ void WaylandSurfaceItem::updateTexture() m_provider->smooth = smooth(); } -QSGNode *WaylandSurfaceItem::updatePaintNode(QSGNode *oldNode, UpdatePaintNodeData *) +QSGNode *QWaylandSurfaceItem::updatePaintNode(QSGNode *oldNode, UpdatePaintNodeData *) { if (!m_surface) { delete oldNode; @@ -382,10 +383,10 @@ QSGNode *WaylandSurfaceItem::updatePaintNode(QSGNode *oldNode, UpdatePaintNodeDa return 0; } - WaylandSurfaceNode *node = static_cast<WaylandSurfaceNode *>(oldNode); + QWaylandSurfaceNode *node = static_cast<QWaylandSurfaceNode *>(oldNode); if (!node) { - node = new WaylandSurfaceNode(this); + node = new QWaylandSurfaceNode(this); } node->updateTexture(); @@ -401,7 +402,7 @@ QSGNode *WaylandSurfaceItem::updatePaintNode(QSGNode *oldNode, UpdatePaintNodeDa return node; } -void WaylandSurfaceItem::setUseTextureAlpha(bool useTextureAlpha) +void QWaylandSurfaceItem::setUseTextureAlpha(bool useTextureAlpha) { m_useTextureAlpha = useTextureAlpha; @@ -410,7 +411,7 @@ void WaylandSurfaceItem::setUseTextureAlpha(bool useTextureAlpha) } } -void WaylandSurfaceItem::setClientRenderingEnabled(bool enabled) +void QWaylandSurfaceItem::setClientRenderingEnabled(bool enabled) { if (m_clientRenderingEnabled != enabled) { m_clientRenderingEnabled = enabled; @@ -423,7 +424,7 @@ void WaylandSurfaceItem::setClientRenderingEnabled(bool enabled) } } -void WaylandSurfaceItem::setTouchEventsEnabled(bool enabled) +void QWaylandSurfaceItem::setTouchEventsEnabled(bool enabled) { if (m_touchEventsEnabled != enabled) { m_touchEventsEnabled = enabled; @@ -431,4 +432,6 @@ void WaylandSurfaceItem::setTouchEventsEnabled(bool enabled) } } -#include "waylandsurfaceitem.moc" +#include "qwaylandsurfaceitem.moc" + +QT_END_NAMESPACE diff --git a/src/compositor/compositor_api/waylandsurfaceitem.h b/src/compositor/compositor_api/qwaylandsurfaceitem.h index 6888262a..cc3323dd 100644 --- a/src/compositor/compositor_api/waylandsurfaceitem.h +++ b/src/compositor/compositor_api/qwaylandsurfaceitem.h @@ -38,27 +38,29 @@ ** ****************************************************************************/ -#ifndef WAYLANDSURFACEITEM_H -#define WAYLANDSURFACEITEM_H +#ifndef QWAYLANDSURFACEITEM_H +#define QWAYLANDSURFACEITEM_H -#include "waylandexport.h" -#include "waylandsurface.h" +#include <QtCompositor/qwaylandexport.h> +#include <QtCompositor/qwaylandsurface.h> #include <QtQuick/QQuickItem> #include <QtQuick/qsgtexture.h> #include <QtQuick/qsgtextureprovider.h> -class WaylandSurfaceTextureProvider; -class WaylandSurfaceNode; +QT_BEGIN_NAMESPACE + +class QWaylandSurfaceTextureProvider; +class QWaylandSurfaceNode; class QMutex; -Q_DECLARE_METATYPE(WaylandSurface*) +Q_DECLARE_METATYPE(QWaylandSurface*) -class Q_COMPOSITOR_EXPORT WaylandSurfaceItem : public QQuickItem +class Q_COMPOSITOR_EXPORT QWaylandSurfaceItem : public QQuickItem { Q_OBJECT - Q_PROPERTY(WaylandSurface* surface READ surface WRITE setSurface NOTIFY surfaceChanged) + Q_PROPERTY(QWaylandSurface* surface READ surface WRITE setSurface NOTIFY surfaceChanged) Q_PROPERTY(bool paintEnabled READ paintEnabled WRITE setPaintEnabled) Q_PROPERTY(bool useTextureAlpha READ useTextureAlpha WRITE setUseTextureAlpha NOTIFY useTextureAlphaChanged) Q_PROPERTY(bool clientRenderingEnabled READ clientRenderingEnabled WRITE setClientRenderingEnabled NOTIFY clientRenderingEnabledChanged) @@ -66,12 +68,12 @@ class Q_COMPOSITOR_EXPORT WaylandSurfaceItem : public QQuickItem Q_PROPERTY(bool isYInverted READ isYInverted NOTIFY yInvertedChanged) public: - WaylandSurfaceItem(QQuickItem *parent = 0); - WaylandSurfaceItem(WaylandSurface *surface, QQuickItem *parent = 0); - ~WaylandSurfaceItem(); + QWaylandSurfaceItem(QQuickItem *parent = 0); + QWaylandSurfaceItem(QWaylandSurface *surface, QQuickItem *parent = 0); + ~QWaylandSurfaceItem(); - void setSurface(WaylandSurface *surface); - WaylandSurface *surface() const {return m_surface; } + void setSurface(QWaylandSurface *surface); + QWaylandSurface *surface() const {return m_surface; } Q_INVOKABLE bool isYInverted() const; @@ -109,7 +111,7 @@ private slots: void surfaceUnmapped(); void surfaceDestroyed(QObject *object); void surfaceDamaged(const QRect &); - void parentChanged(WaylandSurface *newParent, WaylandSurface *oldParent); + void parentChanged(QWaylandSurface *newParent, QWaylandSurface *oldParent); void updateSize(); void updatePosition(); @@ -125,17 +127,17 @@ protected: QSGNode *updatePaintNode(QSGNode *oldNode, UpdatePaintNodeData *); private: - friend class WaylandSurfaceNode; + friend class QWaylandSurfaceNode; void updateTexture(); QPoint toSurface(const QPointF &pos) const; - void init(WaylandSurface *); + void init(QWaylandSurface *); void ensureProvider(); static QMutex *mutex; - WaylandSurface *m_surface; - WaylandSurfaceTextureProvider *m_provider; - WaylandSurfaceNode *m_node; + QWaylandSurface *m_surface; + QWaylandSurfaceTextureProvider *m_provider; + QWaylandSurfaceNode *m_node; bool m_paintEnabled; bool m_useTextureAlpha; bool m_clientRenderingEnabled; @@ -144,4 +146,6 @@ private: bool m_yInverted; }; +QT_END_NAMESPACE + #endif diff --git a/src/compositor/compositor_api/waylandsurfacenode.cpp b/src/compositor/compositor_api/qwaylandsurfacenode.cpp index a6188ff7..513704f1 100644 --- a/src/compositor/compositor_api/waylandsurfacenode.cpp +++ b/src/compositor/compositor_api/qwaylandsurfacenode.cpp @@ -39,22 +39,24 @@ ** ****************************************************************************/ -#include "waylandsurfacenode.h" -#include "waylandsurfaceitem.h" +#include "qwaylandsurfacenode_p.h" +#include "qwaylandsurfaceitem.h" #include <QtCore/QMutexLocker> #include <QtQuick/QSGTexture> #include <QtQuick/QSGSimpleTextureNode> #include <QtQuick/QSGFlatColorMaterial> -WaylandSurfaceNode::WaylandSurfaceNode(WaylandSurfaceItem *item) +QT_BEGIN_NAMESPACE + +QWaylandSurfaceNode::QWaylandSurfaceNode(QWaylandSurfaceItem *item) : m_item(item) , m_textureUpdated(false) , m_useTextureAlpha(false) , m_geometry(QSGGeometry::defaultAttributes_TexturedPoint2D(), 4) { - m_textureMaterial = WaylandSurfaceTextureMaterial::createMaterial(); - m_opaqueTextureMaterial = WaylandSurfaceTextureOpaqueMaterial::createMaterial(); + m_textureMaterial = QWaylandSurfaceTextureMaterial::createMaterial(); + m_opaqueTextureMaterial = QWaylandSurfaceTextureOpaqueMaterial::createMaterial(); m_currentMaterial = m_opaqueTextureMaterial; @@ -67,18 +69,18 @@ WaylandSurfaceNode::WaylandSurfaceNode(WaylandSurfaceItem *item) } -WaylandSurfaceNode::~WaylandSurfaceNode() +QWaylandSurfaceNode::~QWaylandSurfaceNode() { - QMutexLocker locker(WaylandSurfaceItem::mutex); + QMutexLocker locker(QWaylandSurfaceItem::mutex); if (m_item) m_item->m_node = 0; delete m_textureMaterial; delete m_opaqueTextureMaterial; } -void WaylandSurfaceNode::preprocess() +void QWaylandSurfaceNode::preprocess() { - QMutexLocker locker(WaylandSurfaceItem::mutex); + QMutexLocker locker(QWaylandSurfaceItem::mutex); if (m_item && m_item->surface()) { //Update if the item is dirty and we haven't done an updateTexture for this frame @@ -91,7 +93,7 @@ void WaylandSurfaceNode::preprocess() m_textureUpdated = false; } -void WaylandSurfaceNode::updateTexture() +void QWaylandSurfaceNode::updateTexture() { Q_ASSERT(m_item && m_item->textureProvider()); @@ -111,7 +113,7 @@ void WaylandSurfaceNode::updateTexture() setTexture(texture); } -void WaylandSurfaceNode::setRect(const QRectF &rect) +void QWaylandSurfaceNode::setRect(const QRectF &rect) { if (m_rect == rect) return; @@ -124,7 +126,7 @@ void WaylandSurfaceNode::setRect(const QRectF &rect) } } -void WaylandSurfaceNode::setTexture(QSGTexture *texture) +void QWaylandSurfaceNode::setTexture(QSGTexture *texture) { if (m_currentMaterial->state()->texture() == texture) return; @@ -136,12 +138,14 @@ void WaylandSurfaceNode::setTexture(QSGTexture *texture) markDirty(DirtyMaterial); } -QSGTexture *WaylandSurfaceNode::texture() const +QSGTexture *QWaylandSurfaceNode::texture() const { return m_currentMaterial->state()->texture(); } -void WaylandSurfaceNode::setItem(WaylandSurfaceItem *item) +void QWaylandSurfaceNode::setItem(QWaylandSurfaceItem *item) { m_item = item; } + +QT_END_NAMESPACE diff --git a/src/compositor/compositor_api/waylandsurfacenode.h b/src/compositor/compositor_api/qwaylandsurfacenode_p.h index f4c9c0ec..99bca039 100644 --- a/src/compositor/compositor_api/waylandsurfacenode.h +++ b/src/compositor/compositor_api/qwaylandsurfacenode_p.h @@ -39,22 +39,24 @@ ** ****************************************************************************/ -#ifndef WAYLANDSURFACENODE_H -#define WAYLANDSURFACENODE_H +#ifndef QWAYLANDSURFACENODE_H +#define QWAYLANDSURFACENODE_H -#include "waylandsurfacetexturematerial.h" +#include "qwaylandsurfacetexturematerial_p.h" #include <QtQuick/QSGGeometryNode> #include <QtQuick/QSGOpaqueTextureMaterial> -class WaylandSurfaceItem; +QT_BEGIN_NAMESPACE + +class QWaylandSurfaceItem; class QSGTexture; -class WaylandSurfaceNode : public QSGGeometryNode +class QWaylandSurfaceNode : public QSGGeometryNode { public: - WaylandSurfaceNode(WaylandSurfaceItem *item = 0); - ~WaylandSurfaceNode(); + QWaylandSurfaceNode(QWaylandSurfaceItem *item = 0); + ~QWaylandSurfaceNode(); void preprocess(); void updateTexture(); @@ -68,21 +70,23 @@ public: bool isTextureUpdated() const { return m_textureUpdated; } void setTextureUpdated(bool textureUpdated) { m_textureUpdated = textureUpdated; } - WaylandSurfaceItem *item() const { return m_item; } - void setItem(WaylandSurfaceItem *item); + QWaylandSurfaceItem *item() const { return m_item; } + void setItem(QWaylandSurfaceItem *item); private: - WaylandSurfaceItem *m_item; + QWaylandSurfaceItem *m_item; bool m_textureUpdated; bool m_useTextureAlpha; QSGGeometry m_geometry; - QSGSimpleMaterial<WaylandSurfaceTextureState> *m_textureMaterial; - QSGSimpleMaterial<WaylandSurfaceTextureState> *m_opaqueTextureMaterial; - QSGSimpleMaterial<WaylandSurfaceTextureState> *m_currentMaterial; + QSGSimpleMaterial<QWaylandSurfaceTextureState> *m_textureMaterial; + QSGSimpleMaterial<QWaylandSurfaceTextureState> *m_opaqueTextureMaterial; + QSGSimpleMaterial<QWaylandSurfaceTextureState> *m_currentMaterial; QRectF m_rect; }; -#endif // WAYLANDSURFACENODE_H +QT_END_NAMESPACE + +#endif // QWAYLANDSURFACENODE_H diff --git a/src/compositor/compositor_api/waylandsurfacetexturematerial.cpp b/src/compositor/compositor_api/qwaylandsurfacetexturematerial.cpp index 0ec8ccb4..9562457e 100644 --- a/src/compositor/compositor_api/waylandsurfacetexturematerial.cpp +++ b/src/compositor/compositor_api/qwaylandsurfacetexturematerial.cpp @@ -39,9 +39,11 @@ ** ****************************************************************************/ -#include "waylandsurfacetexturematerial.h" +#include "qwaylandsurfacetexturematerial_p.h" #include <QtGui/QOpenGLContext> +QT_BEGIN_NAMESPACE + static const char wayland_surface_texture_material_vertex[] = "uniform highp mat4 qt_Matrix; \n" "attribute highp vec4 qt_VertexPosition; \n" @@ -69,7 +71,7 @@ static const char wayland_surface_texture_material_fragment[] = " gl_FragColor = texture2D(qt_Texture, qt_TexCoord) * qt_Opacity; \n" "}"; -QList<QByteArray> WaylandSurfaceTextureMaterial::attributes() const +QList<QByteArray> QWaylandSurfaceTextureMaterial::attributes() const { QList<QByteArray> attributeList; attributeList << "qt_VertexPosition"; @@ -77,23 +79,23 @@ QList<QByteArray> WaylandSurfaceTextureMaterial::attributes() const return attributeList; } -void WaylandSurfaceTextureMaterial::updateState(const WaylandSurfaceTextureState *newState, const WaylandSurfaceTextureState *oldState) +void QWaylandSurfaceTextureMaterial::updateState(const QWaylandSurfaceTextureState *newState, const QWaylandSurfaceTextureState *oldState) { Q_UNUSED(oldState); newState->texture()->bind(); } -const char *WaylandSurfaceTextureMaterial::vertexShader() const +const char *QWaylandSurfaceTextureMaterial::vertexShader() const { return wayland_surface_texture_material_vertex; } -const char *WaylandSurfaceTextureMaterial::fragmentShader() const +const char *QWaylandSurfaceTextureMaterial::fragmentShader() const { return wayland_surface_texture_material_fragment; } -QList<QByteArray> WaylandSurfaceTextureOpaqueMaterial::attributes() const +QList<QByteArray> QWaylandSurfaceTextureOpaqueMaterial::attributes() const { QList<QByteArray> attributeList; attributeList << "qt_VertexPosition"; @@ -101,18 +103,20 @@ QList<QByteArray> WaylandSurfaceTextureOpaqueMaterial::attributes() const return attributeList; } -void WaylandSurfaceTextureOpaqueMaterial::updateState(const WaylandSurfaceTextureState *newState, const WaylandSurfaceTextureState *oldState) +void QWaylandSurfaceTextureOpaqueMaterial::updateState(const QWaylandSurfaceTextureState *newState, const QWaylandSurfaceTextureState *oldState) { Q_UNUSED(oldState); newState->texture()->bind(); } -const char *WaylandSurfaceTextureOpaqueMaterial::vertexShader() const +const char *QWaylandSurfaceTextureOpaqueMaterial::vertexShader() const { return wayland_surface_texture_material_vertex; } -const char *WaylandSurfaceTextureOpaqueMaterial::fragmentShader() const +const char *QWaylandSurfaceTextureOpaqueMaterial::fragmentShader() const { return wayland_surface_texture_opaque_material_fragment; } + +QT_END_NAMESPACE diff --git a/src/compositor/compositor_api/waylandsurfacetexturematerial.h b/src/compositor/compositor_api/qwaylandsurfacetexturematerial_p.h index 4f5b66a3..4cf3df09 100644 --- a/src/compositor/compositor_api/waylandsurfacetexturematerial.h +++ b/src/compositor/compositor_api/qwaylandsurfacetexturematerial_p.h @@ -39,16 +39,18 @@ ** ****************************************************************************/ -#ifndef WAYLANDSURFACETEXTUREMATERIAL_H -#define WAYLANDSURFACETEXTUREMATERIAL_H +#ifndef QWAYLANDSURFACETEXTUREMATERIAL_H +#define QWAYLANDSURFACETEXTUREMATERIAL_H #include <QtQuick/QSGSimpleMaterial> #include <QtQuick/QSGTexture> #include <QtGui/QOpenGLFunctions> -class WaylandSurfaceTextureState { +QT_BEGIN_NAMESPACE + +class QWaylandSurfaceTextureState { public: - WaylandSurfaceTextureState() + QWaylandSurfaceTextureState() : m_texture(0) {} void setTexture(QSGTexture *texture) { m_texture = texture; } @@ -58,30 +60,32 @@ private: QSGTexture *m_texture; }; -class WaylandSurfaceTextureMaterial : public QSGSimpleMaterialShader<WaylandSurfaceTextureState> +class QWaylandSurfaceTextureMaterial : public QSGSimpleMaterialShader<QWaylandSurfaceTextureState> { - QSG_DECLARE_SIMPLE_SHADER(WaylandSurfaceTextureMaterial, WaylandSurfaceTextureState) + QSG_DECLARE_SIMPLE_SHADER(QWaylandSurfaceTextureMaterial, QWaylandSurfaceTextureState) public: QList<QByteArray> attributes() const; - void updateState(const WaylandSurfaceTextureState *newState, const WaylandSurfaceTextureState *oldState); + void updateState(const QWaylandSurfaceTextureState *newState, const QWaylandSurfaceTextureState *oldState); protected: const char *vertexShader() const; const char *fragmentShader() const; }; -class WaylandSurfaceTextureOpaqueMaterial : public QSGSimpleMaterialShader<WaylandSurfaceTextureState> +class QWaylandSurfaceTextureOpaqueMaterial : public QSGSimpleMaterialShader<QWaylandSurfaceTextureState> { - QSG_DECLARE_SIMPLE_SHADER(WaylandSurfaceTextureOpaqueMaterial, WaylandSurfaceTextureState) + QSG_DECLARE_SIMPLE_SHADER(QWaylandSurfaceTextureOpaqueMaterial, QWaylandSurfaceTextureState) public: QList<QByteArray> attributes() const; - void updateState(const WaylandSurfaceTextureState *newState, const WaylandSurfaceTextureState *oldState); + void updateState(const QWaylandSurfaceTextureState *newState, const QWaylandSurfaceTextureState *oldState); protected: const char *vertexShader() const; const char *fragmentShader() const; }; -#endif // WAYLANDSURFACETEXTUREMATERIAL_H +QT_END_NAMESPACE + +#endif // QWAYLANDSURFACETEXTUREMATERIAL_H diff --git a/src/compositor/global/global.pri b/src/compositor/global/global.pri index 4dcbe340..f187619e 100644 --- a/src/compositor/global/global.pri +++ b/src/compositor/global/global.pri @@ -1,10 +1,10 @@ -INCLUDEPATH += $$PWD +INCLUDEPATH += global/ HEADERS += \ - $$PWD/waylandexport.h \ - $$PWD/waylandobject.h \ - $$PWD/waylandresourcecollection.h \ + global/qwaylandexport.h \ + global/qwaylandobject.h \ + global/qwaylandresourcecollection.h SOURCES += \ - $$PWD/waylandresourcecollection.cpp \ + global/qwaylandresourcecollection.cpp diff --git a/src/compositor/global/waylandexport.h b/src/compositor/global/qwaylandexport.h index 7d1685b3..4998f836 100644 --- a/src/compositor/global/waylandexport.h +++ b/src/compositor/global/qwaylandexport.h @@ -43,6 +43,8 @@ #include <QtCore/qglobal.h> +QT_BEGIN_NAMESPACE + #if !defined(Q_COMPOSITOR_EXPORT) # if defined(QT_SHARED) # define Q_COMPOSITOR_EXPORT Q_DECL_EXPORT @@ -53,4 +55,6 @@ typedef void WaylandClient; +QT_END_NAMESPACE + #endif //WAYLANDEXPORT_H diff --git a/src/compositor/global/waylandobject.h b/src/compositor/global/qwaylandobject.h index 3f735fda..6d93297a 100644 --- a/src/compositor/global/waylandobject.h +++ b/src/compositor/global/qwaylandobject.h @@ -42,10 +42,13 @@ #define WAYLAND_OBJECT_H #include <wayland-server.h> - #include <string.h> -namespace Wayland { +#include <QtCompositor/qwaylandexport.h> + +QT_BEGIN_NAMESPACE + +namespace QtWayland { template <typename T> class Object : public T @@ -91,4 +94,6 @@ T *wayland_cast(typename T::Base *from) } +QT_END_NAMESPACE + #endif //WAYLAND_OBJECT_H diff --git a/src/compositor/global/waylandresourcecollection.cpp b/src/compositor/global/qwaylandresourcecollection.cpp index 0f57750f..6433474a 100644 --- a/src/compositor/global/waylandresourcecollection.cpp +++ b/src/compositor/global/qwaylandresourcecollection.cpp @@ -38,11 +38,13 @@ ** ****************************************************************************/ -#include "waylandresourcecollection.h" +#include "qwaylandresourcecollection.h" #include <QtCore/qglobal.h> -namespace Wayland { +QT_BEGIN_NAMESPACE + +namespace QtWayland { ResourceCollection::ResourceCollection() { @@ -86,5 +88,6 @@ void ResourceCollection::destroy_listener_notify(struct wl_listener *listener, v delete listener; } - } + +QT_END_NAMESPACE diff --git a/src/compositor/global/waylandresourcecollection.h b/src/compositor/global/qwaylandresourcecollection.h index 8bcc5bd2..cfc1c32c 100644 --- a/src/compositor/global/waylandresourcecollection.h +++ b/src/compositor/global/qwaylandresourcecollection.h @@ -43,7 +43,11 @@ #include <wayland-server.h> -namespace Wayland { +#include <QtCompositor/qwaylandexport.h> + +QT_BEGIN_NAMESPACE + +namespace QtWayland { class ResourceCollection { @@ -62,4 +66,6 @@ private: } +QT_END_NAMESPACE + #endif //WAYLAND_RESOURCE_OBJECT_H diff --git a/src/compositor/hardware_integration/hardware_integration.pri b/src/compositor/hardware_integration/hardware_integration.pri index 352dbaee..8477243f 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 13b460d7..7b213bfa 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 f6c46deb..37388044 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 d8337c6e..17e2dbdb 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 22bcd09c..74e5dda0 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 3bde8e8a..66e07352 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 51f60516..6d68a0cc 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 ¶mList) = 0; + virtual QWaylandGraphicsHardwareIntegration *create(const QString &key, const QStringList ¶mList) = 0; }; +QT_END_NAMESPACE + #endif // GRAPHICSHARDWAREINTEGRATIONPLUGIN_H diff --git a/src/compositor/wayland_wrapper/wlcompositor.cpp b/src/compositor/wayland_wrapper/qwlcompositor.cpp index a0716f3b..26defc0b 100644 --- a/src/compositor/wayland_wrapper/wlcompositor.cpp +++ b/src/compositor/wayland_wrapper/qwlcompositor.cpp @@ -38,22 +38,23 @@ ** ****************************************************************************/ -#include "wlcompositor.h" - -#include "waylandinput.h" -#include "wldisplay.h" -#include "wlsurface.h" -#include "waylandcompositor.h" -#include "wldatadevicemanager.h" -#include "wldatadevice.h" -#include "wlextendedoutput.h" -#include "wlextendedsurface.h" -#include "wlsubsurface.h" -#include "wlshellsurface.h" -#include "wltouch.h" -#include "wlqtkey.h" -#include "wlinputdevice.h" -#include "wlregion.h" +#include "qwlcompositor_p.h" + +#include "qwaylandinput.h" +#include "qwldisplay_p.h" +#include "qwloutput_p.h" +#include "qwlsurface_p.h" +#include "qwaylandcompositor.h" +#include "qwldatadevicemanager_p.h" +#include "qwldatadevice_p.h" +#include "qwlextendedoutput_p.h" +#include "qwlextendedsurface_p.h" +#include "qwlsubsurface_p.h" +#include "qwlshellsurface_p.h" +#include "qwltouch_p.h" +#include "qwlqtkey_p.h" +#include "qwlinputdevice_p.h" +#include "qwlregion_p.h" #include <QWindow> #include <QSocketNotifier> @@ -80,12 +81,14 @@ #include <wayland-server.h> -#include "hardware_integration/graphicshardwareintegration.h" +#include "hardware_integration/qwaylandgraphicshardwareintegration.h" #include "waylandwindowmanagerintegration.h" -#include "hardware_integration/graphicshardwareintegrationfactory.h" +#include "hardware_integration/qwaylandgraphicshardwareintegrationfactory.h" -namespace Wayland { +QT_BEGIN_NAMESPACE + +namespace QtWayland { static Compositor *compositor; @@ -119,7 +122,7 @@ Compositor *Compositor::instance() return compositor; } -Compositor::Compositor(WaylandCompositor *qt_compositor) +Compositor::Compositor(QWaylandCompositor *qt_compositor) : m_display(new Display) , m_default_input_device(0) , m_pageFlipper(0) @@ -144,7 +147,7 @@ Compositor::Compositor(WaylandCompositor *qt_compositor) #if defined (QT_COMPOSITOR_WAYLAND_GL) QWindow *window = qt_compositor->window(); if (window && window->surfaceType() != QWindow::RasterSurface) { - QStringList keys = GraphicsHardwareIntegrationFactory::keys(); + QStringList keys = QWaylandGraphicsHardwareIntegrationFactory::keys(); QString targetKey; QByteArray hardwareIntegration = qgetenv("QT_WAYLAND_HARDWARE_INTEGRATION"); if (keys.contains(QString::fromLocal8Bit(hardwareIntegration.constData()))) { @@ -156,7 +159,7 @@ Compositor::Compositor(WaylandCompositor *qt_compositor) } if (!targetKey.isEmpty()) { - m_graphics_hw_integration = GraphicsHardwareIntegrationFactory::create(targetKey, QStringList()); + m_graphics_hw_integration = QWaylandGraphicsHardwareIntegrationFactory::create(targetKey, QStringList()); if (m_graphics_hw_integration) { m_graphics_hw_integration->setCompositor(qt_compositor); } @@ -173,7 +176,8 @@ Compositor::Compositor(WaylandCompositor *qt_compositor) wl_display_init_shm(m_display->handle()); - wl_display_add_global(m_display->handle(),&wl_output_interface, &m_output_global,OutputGlobal::output_bind_func); + m_output_global = new OutputGlobal(); + wl_display_add_global(m_display->handle(),&wl_output_interface, m_output_global, OutputGlobal::output_bind_func); m_shell = new Shell(); wl_display_add_global(m_display->handle(), &wl_shell_interface, m_shell, Shell::bind_func); @@ -217,7 +221,7 @@ Compositor::~Compositor() #ifdef QT_COMPOSITOR_WAYLAND_GL delete m_graphics_hw_integration; #endif - + delete m_output_global; delete m_display; } @@ -317,7 +321,7 @@ void Compositor::surfaceDestroyed(Surface *surface) waylandCompositor()->surfaceAboutToBeDestroyed(surface->waylandSurface()); } -void Compositor::markSurfaceAsDirty(Wayland::Surface *surface) +void Compositor::markSurfaceAsDirty(QtWayland::Surface *surface) { m_dirty_surfaces.insert(surface); } @@ -341,7 +345,7 @@ QWindow *Compositor::window() const return m_qt_compositor->window(); } -GraphicsHardwareIntegration * Compositor::graphicsHWIntegration() const +QWaylandGraphicsHardwareIntegration * Compositor::graphicsHWIntegration() const { #ifdef QT_COMPOSITOR_WAYLAND_GL return m_graphics_hw_integration; @@ -360,7 +364,7 @@ void Compositor::initializeHardwareIntegration() void Compositor::initializeDefaultInputDevice() { - m_default_wayland_input_device = new WaylandInputDevice(m_qt_compositor); + m_default_wayland_input_device = new QWaylandInputDevice(m_qt_compositor); m_default_input_device = m_default_wayland_input_device->handle(); } @@ -420,7 +424,7 @@ QList<struct wl_client *> Compositor::clients() const Qt::ScreenOrientations Compositor::orientationUpdateMaskForClient(wl_client *client) { - Output *output = m_output_global.outputForClient(client); + Output *output = m_output_global->outputForClient(client); Q_ASSERT(output); if (output->extendedOutput()) return output->extendedOutput()->orientationUpdateMask(); @@ -434,7 +438,7 @@ void Compositor::setScreenOrientation(Qt::ScreenOrientation orientation) QList<struct wl_client*> clientList = clients(); for (int i = 0; i < clientList.length(); ++i) { struct wl_client *client = clientList.at(i); - Output *output = m_output_global.outputForClient(client); + Output *output = m_output_global->outputForClient(client); Q_ASSERT(output); if (output->extendedOutput()){ output->extendedOutput()->sendOutputOrientation(orientation); @@ -449,22 +453,28 @@ Qt::ScreenOrientation Compositor::screenOrientation() const void Compositor::setOutputGeometry(const QRect &geometry) { - m_output_global.setGeometry(geometry); + if (m_output_global) + m_output_global->setGeometry(geometry); } QRect Compositor::outputGeometry() const { - return m_output_global.geometry(); + if (m_output_global) + return m_output_global->geometry(); + return QRect(); } void Compositor::setOutputRefreshRate(int rate) { - m_output_global.setRefreshRate(rate); + if (m_output_global) + m_output_global->setRefreshRate(rate); } int Compositor::outputRefreshRate() const { - return m_output_global.refreshRate(); + if (m_output_global) + return m_output_global->refreshRate(); + return 0; } void Compositor::setClientFullScreenHint(bool value) @@ -477,9 +487,9 @@ InputDevice* Compositor::defaultInputDevice() return m_default_input_device; } -QList<Wayland::Surface *> Compositor::surfacesForClient(wl_client *client) +QList<QtWayland::Surface *> Compositor::surfacesForClient(wl_client *client) { - QList<Wayland::Surface *> ret; + QList<QtWayland::Surface *> ret; for (int i=0; i < m_surfaces.count(); ++i) { if (m_surfaces.at(i)->base()->resource.client == client) { @@ -559,3 +569,5 @@ void Compositor::sendDragEndEvent() } } // namespace Wayland + +QT_END_NAMESPACE diff --git a/src/compositor/wayland_wrapper/wlcompositor.h b/src/compositor/wayland_wrapper/qwlcompositor_p.h index a009037b..62847068 100644 --- a/src/compositor/wayland_wrapper/wlcompositor.h +++ b/src/compositor/wayland_wrapper/qwlcompositor_p.h @@ -41,30 +41,32 @@ #ifndef WL_COMPOSITOR_H #define WL_COMPOSITOR_H -#include "waylandexport.h" +#include <QtCompositor/qwaylandexport.h> #include <QtCore/QSet> #include <QtGui/QWindow> -#include "wloutput.h" -#include "wldisplay.h" +#include <private/qwldisplay_p.h> #include <wayland-server.h> -class WaylandCompositor; -class WaylandInputDevice; -class GraphicsHardwareIntegration; +QT_BEGIN_NAMESPACE + +class QWaylandCompositor; +class QWaylandInputDevice; +class QWaylandGraphicsHardwareIntegration; class WindowManagerServerIntegration; class QMimeData; class QPlatformScreenPageFlipper; class QPlatformScreenBuffer; -namespace Wayland { +namespace QtWayland { class Surface; class SurfaceBuffer; class InputDevice; class DataDeviceManager; +class OutputGlobal; class OutputExtensionGlobal; class SurfaceExtensionGlobal; class SubSurfaceExtensionGlobal; @@ -77,7 +79,7 @@ class Q_COMPOSITOR_EXPORT Compositor : public QObject Q_OBJECT public: - Compositor(WaylandCompositor *qt_compositor); + Compositor(QWaylandCompositor *qt_compositor); ~Compositor(); void frameFinished(Surface *surface = 0); @@ -99,7 +101,7 @@ public: QWindow *window() const; - GraphicsHardwareIntegration *graphicsHWIntegration() const; + QWaylandGraphicsHardwareIntegration *graphicsHWIntegration() const; void initializeHardwareIntegration(); void initializeDefaultInputDevice(); void initializeWindowManagerProtocol(); @@ -112,7 +114,7 @@ public: QList<Surface*> surfaces() const { return m_surfaces; } QList<Surface*> surfacesForClient(wl_client* client); - WaylandCompositor *waylandCompositor() const { return m_qt_compositor; } + QWaylandCompositor *waylandCompositor() const { return m_qt_compositor; } struct wl_display *wl_display() const { return m_display->handle(); } @@ -162,12 +164,12 @@ private: Display *m_display; /* Input */ - WaylandInputDevice *m_default_wayland_input_device; + QWaylandInputDevice *m_default_wayland_input_device; InputDevice *m_default_input_device; /* Output */ //make this a list of the available screens - OutputGlobal m_output_global; + OutputGlobal *m_output_global; //This one should be part of the outputs QPlatformScreenPageFlipper *m_pageFlipper; @@ -182,7 +184,7 @@ private: wl_event_loop *m_loop; - WaylandCompositor *m_qt_compositor; + QWaylandCompositor *m_qt_compositor; Qt::ScreenOrientation m_orientation; Surface *m_directRenderSurface; @@ -190,7 +192,7 @@ private: bool m_directRenderActive; #ifdef QT_COMPOSITOR_WAYLAND_GL - GraphicsHardwareIntegration *m_graphics_hw_integration; + QWaylandGraphicsHardwareIntegration *m_graphics_hw_integration; #endif //extensions @@ -212,4 +214,6 @@ private: } +QT_END_NAMESPACE + #endif //WL_COMPOSITOR_H diff --git a/src/compositor/wayland_wrapper/wldatadevice.cpp b/src/compositor/wayland_wrapper/qwldatadevice.cpp index 2c3bc380..89fa7a08 100644 --- a/src/compositor/wayland_wrapper/wldatadevice.cpp +++ b/src/compositor/wayland_wrapper/qwldatadevice.cpp @@ -38,17 +38,19 @@ ** ****************************************************************************/ -#include "wldatadevice.h" +#include "qwldatadevice_p.h" -#include "wldatasource.h" -#include "wldataoffer.h" -#include "wldatadevicemanager.h" +#include "qwldatasource_p.h" +#include "qwldataoffer_p.h" +#include "qwldatadevicemanager_p.h" #include <stdlib.h> #include <QDebug> -namespace Wayland { +QT_BEGIN_NAMESPACE + +namespace QtWayland { void DataDevice::start_drag(struct wl_client *client, struct wl_resource *resource, @@ -125,3 +127,5 @@ struct wl_resource *DataDevice::dataDeviceResource() const } } + +QT_END_NAMESPACE diff --git a/src/compositor/wayland_wrapper/wldatadevice.h b/src/compositor/wayland_wrapper/qwldatadevice_p.h index 2f1d72f2..2b4acdc9 100644 --- a/src/compositor/wayland_wrapper/wldatadevice.h +++ b/src/compositor/wayland_wrapper/qwldatadevice_p.h @@ -41,9 +41,11 @@ #ifndef WLDATADEVICE_H #define WLDATADEVICE_H -#include "wldatadevicemanager.h" +#include <private/qwldatadevicemanager_p.h> -namespace Wayland { +QT_BEGIN_NAMESPACE + +namespace QtWayland { class DataSource; class DataDeviceManager; @@ -79,4 +81,6 @@ private: } +QT_END_NAMESPACE + #endif // WLDATADEVICE_H diff --git a/src/compositor/wayland_wrapper/wldatadevicemanager.cpp b/src/compositor/wayland_wrapper/qwldatadevicemanager.cpp index cdfc0002..f89dbc31 100644 --- a/src/compositor/wayland_wrapper/wldatadevicemanager.cpp +++ b/src/compositor/wayland_wrapper/qwldatadevicemanager.cpp @@ -38,14 +38,14 @@ ** ****************************************************************************/ -#include "wldatadevicemanager.h" - -#include "wldatadevice.h" -#include "wldatasource.h" -#include "wlinputdevice.h" -#include "wlcompositor.h" -#include "wldataoffer.h" -#include "wlsurface.h" +#include "qwldatadevicemanager_p.h" + +#include "qwldatadevice_p.h" +#include "qwldatasource_p.h" +#include "qwlinputdevice_p.h" +#include "qwlcompositor_p.h" +#include "qwldataoffer_p.h" +#include "qwlsurface_p.h" #include "qwaylandmimehelper.h" #include <QtCore/QDebug> @@ -54,7 +54,9 @@ #include <QtCore/private/qcore_unix_p.h> #include <QtCore/QFile> -namespace Wayland { +QT_BEGIN_NAMESPACE + +namespace QtWayland { DataDeviceManager::DataDeviceManager(Compositor *compositor) : m_compositor(compositor) @@ -302,3 +304,5 @@ const struct wl_data_offer_interface DataDeviceManager::compositor_offer_interfa }; } //namespace + +QT_END_NAMESPACE diff --git a/src/compositor/wayland_wrapper/wldatadevicemanager.h b/src/compositor/wayland_wrapper/qwldatadevicemanager_p.h index 5576a41f..11510e63 100644 --- a/src/compositor/wayland_wrapper/wldatadevicemanager.h +++ b/src/compositor/wayland_wrapper/qwldatadevicemanager_p.h @@ -41,16 +41,18 @@ #ifndef WLDATADEVICEMANAGER_H #define WLDATADEVICEMANAGER_H -#include "wlcompositor.h" +#include <private/qwlcompositor_p.h> #include <QtCore/QList> #include <QtCore/QMap> #include <QtGui/QClipboard> #include <QtCore/QMimeData> +QT_BEGIN_NAMESPACE + class QSocketNotifier; -namespace Wayland { +namespace QtWayland { class Compositor; @@ -124,4 +126,7 @@ private: }; } + +QT_END_NAMESPACE + #endif // WLDATADEVICEMANAGER_H diff --git a/src/compositor/wayland_wrapper/wldataoffer.cpp b/src/compositor/wayland_wrapper/qwldataoffer.cpp index 80293a7d..c2bfea35 100644 --- a/src/compositor/wayland_wrapper/wldataoffer.cpp +++ b/src/compositor/wayland_wrapper/qwldataoffer.cpp @@ -38,9 +38,9 @@ ** ****************************************************************************/ -#include "wldataoffer.h" +#include "qwldataoffer_p.h" -#include "wldatadevice.h" +#include "qwldatadevice_p.h" #include <wayland-server.h> @@ -49,7 +49,9 @@ #include <QtCore/QDebug> -namespace Wayland +QT_BEGIN_NAMESPACE + +namespace QtWayland { DataOffer::DataOffer(DataSource *data_source) @@ -113,5 +115,6 @@ void DataOffer::destroy(wl_client *client, wl_resource *resource) } } - } + +QT_END_NAMESPACE diff --git a/src/compositor/wayland_wrapper/wldataoffer.h b/src/compositor/wayland_wrapper/qwldataoffer_p.h index 4b47c977..57943445 100644 --- a/src/compositor/wayland_wrapper/wldataoffer.h +++ b/src/compositor/wayland_wrapper/qwldataoffer_p.h @@ -41,11 +41,12 @@ #ifndef WLDATAOFFER_H #define WLDATAOFFER_H -#include "wldatasource.h" +#include <private/qwldatasource_p.h> +#include <QtCompositor/qwaylandresourcecollection.h> -#include "waylandresourcecollection.h" +QT_BEGIN_NAMESPACE -namespace Wayland +namespace QtWayland { class DataOffer : public ResourceCollection @@ -75,4 +76,6 @@ private: } +QT_END_NAMESPACE + #endif // WLDATAOFFER_H diff --git a/src/compositor/wayland_wrapper/wldatasource.cpp b/src/compositor/wayland_wrapper/qwldatasource.cpp index d243f0a4..271467f2 100644 --- a/src/compositor/wayland_wrapper/wldatasource.cpp +++ b/src/compositor/wayland_wrapper/qwldatasource.cpp @@ -38,16 +38,18 @@ ** ****************************************************************************/ -#include "wldatasource.h" -#include "wldataoffer.h" -#include "wldatadevicemanager.h" -#include "wlcompositor.h" +#include "qwldatasource_p.h" +#include "qwldataoffer_p.h" +#include "qwldatadevicemanager_p.h" +#include "qwlcompositor_p.h" #include <wayland-server-protocol.h> #include <QtCore/QDebug> -namespace Wayland { +QT_BEGIN_NAMESPACE + +namespace QtWayland { DataSource::DataSource(struct wl_client *client, uint32_t id, uint32_t time) : m_time(time) @@ -130,3 +132,5 @@ void DataSource::setManager(DataDeviceManager *mgr) } } + +QT_END_NAMESPACE diff --git a/src/compositor/wayland_wrapper/wldatasource.h b/src/compositor/wayland_wrapper/qwldatasource_p.h index 75e9bbdd..be855d8d 100644 --- a/src/compositor/wayland_wrapper/wldatasource.h +++ b/src/compositor/wayland_wrapper/qwldatasource_p.h @@ -46,7 +46,9 @@ #include <QtCore/QByteArray> #include <QtCore/QList> -namespace Wayland { +QT_BEGIN_NAMESPACE + +namespace QtWayland { class DataOffer; class DataDeviceManager; @@ -87,4 +89,6 @@ private: } +QT_END_NAMESPACE + #endif // WLDATASOURCE_H diff --git a/src/compositor/wayland_wrapper/wldisplay.cpp b/src/compositor/wayland_wrapper/qwldisplay.cpp index e933e53e..be5b5418 100644 --- a/src/compositor/wayland_wrapper/wldisplay.cpp +++ b/src/compositor/wayland_wrapper/qwldisplay.cpp @@ -38,13 +38,15 @@ ** ****************************************************************************/ -#include "wldisplay.h" +#include "qwldisplay_p.h" #include <QtCore/QDebug> #include <wayland-server-protocol.h> -namespace Wayland { +QT_BEGIN_NAMESPACE + +namespace QtWayland { Display::Display() { @@ -60,3 +62,4 @@ Display::~Display() } +QT_END_NAMESPACE diff --git a/src/compositor/wayland_wrapper/wldisplay.h b/src/compositor/wayland_wrapper/qwldisplay_p.h index 69cc93d0..f18cb1e6 100644 --- a/src/compositor/wayland_wrapper/wldisplay.h +++ b/src/compositor/wayland_wrapper/qwldisplay_p.h @@ -42,8 +42,11 @@ #define WL_DISPLAY_H #include <wayland-server.h> +#include <QtCompositor/qwaylandexport.h> -namespace Wayland { +QT_BEGIN_NAMESPACE + +namespace QtWayland { class Display { @@ -60,4 +63,6 @@ private: } +QT_END_NAMESPACE + #endif //WL_DISPLAY_H diff --git a/src/compositor/wayland_wrapper/wlextendedoutput.cpp b/src/compositor/wayland_wrapper/qwlextendedoutput.cpp index b9182011..8249f272 100644 --- a/src/compositor/wayland_wrapper/wlextendedoutput.cpp +++ b/src/compositor/wayland_wrapper/qwlextendedoutput.cpp @@ -38,13 +38,15 @@ ** ****************************************************************************/ -#include "wlextendedoutput.h" +#include "qwlextendedoutput_p.h" -#include "wlcompositor.h" -#include "wlsurface.h" -#include "wloutput.h" +#include "qwlcompositor_p.h" +#include "qwlsurface_p.h" +#include "qwloutput_p.h" -namespace Wayland { +QT_BEGIN_NAMESPACE + +namespace QtWayland { OutputExtensionGlobal::OutputExtensionGlobal(Compositor *compositor) : m_compositor(compositor) @@ -144,5 +146,6 @@ void ExtendedOutput::sendOutputOrientation(Qt::ScreenOrientation orientation) wl_extended_output_send_set_screen_rotation(m_extended_output_resource, sendOpperation); } - } + +QT_END_NAMESPACE diff --git a/src/compositor/wayland_wrapper/wlextendedoutput.h b/src/compositor/wayland_wrapper/qwlextendedoutput_p.h index 0d24a924..46c56beb 100644 --- a/src/compositor/wayland_wrapper/wlextendedoutput.h +++ b/src/compositor/wayland_wrapper/qwlextendedoutput_p.h @@ -44,9 +44,13 @@ #include "wayland-server.h" #include "wayland-output-extension-server-protocol.h" +#include <QtCompositor/qwaylandexport.h> + #include <QtCore/qnamespace.h> -namespace Wayland { +QT_BEGIN_NAMESPACE + +namespace QtWayland { class Compositor; class Output; @@ -93,4 +97,6 @@ private: } +QT_END_NAMESPACE + #endif // WLEXTENDEDOUTPUT_H diff --git a/src/compositor/wayland_wrapper/wlextendedsurface.cpp b/src/compositor/wayland_wrapper/qwlextendedsurface.cpp index 1ffb9c42..dd550af1 100644 --- a/src/compositor/wayland_wrapper/wlextendedsurface.cpp +++ b/src/compositor/wayland_wrapper/qwlextendedsurface.cpp @@ -38,12 +38,14 @@ ** ****************************************************************************/ -#include "wlextendedsurface.h" +#include "qwlextendedsurface_p.h" -#include "wlcompositor.h" -#include "wlsurface.h" +#include "qwlcompositor_p.h" +#include "qwlsurface_p.h" -namespace Wayland { +QT_BEGIN_NAMESPACE + +namespace QtWayland { SurfaceExtensionGlobal::SurfaceExtensionGlobal(Compositor *compositor) : m_compositor(compositor) @@ -155,7 +157,7 @@ void ExtendedSurface::set_content_orientation(struct wl_client *client, emit extended_surface->m_surface->waylandSurface()->contentOrientationChanged(); } -void ExtendedSurface::setWindowFlags(WaylandSurface::WindowFlags flags) +void ExtendedSurface::setWindowFlags(QWaylandSurface::WindowFlags flags) { if (flags == m_windowFlags) return; @@ -186,7 +188,7 @@ void ExtendedSurface::set_window_flags(wl_client *client, wl_resource *resource, { Q_UNUSED(client); ExtendedSurface *extended_surface = static_cast<ExtendedSurface *>(resource->data); - extended_surface->setWindowFlags(WaylandSurface::WindowFlags(flags)); + extended_surface->setWindowFlags(QWaylandSurface::WindowFlags(flags)); } const struct wl_extended_surface_interface ExtendedSurface::extended_surface_interface = { @@ -196,3 +198,5 @@ const struct wl_extended_surface_interface ExtendedSurface::extended_surface_int }; } + +QT_END_NAMESPACE diff --git a/src/compositor/wayland_wrapper/wlextendedsurface.h b/src/compositor/wayland_wrapper/qwlextendedsurface_p.h index bb319224..6dc60efb 100644 --- a/src/compositor/wayland_wrapper/wlextendedsurface.h +++ b/src/compositor/wayland_wrapper/qwlextendedsurface_p.h @@ -44,15 +44,17 @@ #include <wayland-server.h> #include "wayland-surface-extension-server-protocol.h" -#include "wlsurface.h" -#include "waylandsurface.h" +#include <private/qwlsurface_p.h> +#include <QtCompositor/qwaylandsurface.h> #include <QtCore/QVariant> #include <QtCore/QLinkedList> -class WaylandSurface; +QT_BEGIN_NAMESPACE -namespace Wayland { +class QWaylandSurface; + +namespace QtWayland { class Compositor; @@ -87,11 +89,11 @@ public: void removeSubSurface(ExtendedSurface *subSurfaces); ExtendedSurface *parent() const; void setParent(ExtendedSurface *parent); - QLinkedList<WaylandSurface *> subSurfaces() const; + QLinkedList<QWaylandSurface *> subSurfaces() const; Qt::ScreenOrientation contentOrientation() const; - WaylandSurface::WindowFlags windowFlags() const { return m_windowFlags; } + QWaylandSurface::WindowFlags windowFlags() const { return m_windowFlags; } qint64 processId() const; void setProcessId(qint64 processId); @@ -106,7 +108,7 @@ private: Qt::ScreenOrientation m_contentOrientation; - WaylandSurface::WindowFlags m_windowFlags; + QWaylandSurface::WindowFlags m_windowFlags; QByteArray m_authenticationToken; QVariantMap m_windowProperties; @@ -124,11 +126,13 @@ private: static void set_window_flags(struct wl_client *client, struct wl_resource *resource, int32_t flags); - void setWindowFlags(WaylandSurface::WindowFlags flags); + void setWindowFlags(QWaylandSurface::WindowFlags flags); static const struct wl_extended_surface_interface extended_surface_interface; }; } +QT_END_NAMESPACE + #endif // WLEXTENDEDSURFACE_H diff --git a/src/compositor/wayland_wrapper/wlinputdevice.cpp b/src/compositor/wayland_wrapper/qwlinputdevice.cpp index 6b8f3640..8591de25 100644 --- a/src/compositor/wayland_wrapper/wlinputdevice.cpp +++ b/src/compositor/wayland_wrapper/qwlinputdevice.cpp @@ -38,14 +38,14 @@ ** ****************************************************************************/ -#include "wlinputdevice.h" +#include "qwlinputdevice_p.h" -#include "wlcompositor.h" -#include "wldatadevice.h" -#include "wlsurface.h" -#include "wltouch.h" -#include "wlqtkey.h" -#include "waylandcompositor.h" +#include "qwlcompositor_p.h" +#include "qwldatadevice_p.h" +#include "qwlsurface_p.h" +#include "qwltouch_p.h" +#include "qwlqtkey_p.h" +#include "qwaylandcompositor.h" #include <QtGui/QTouchEvent> @@ -60,9 +60,11 @@ #include <stdlib.h> #endif -namespace Wayland { +QT_BEGIN_NAMESPACE -InputDevice::InputDevice(WaylandInputDevice *handle, Compositor *compositor) +namespace QtWayland { + +InputDevice::InputDevice(QWaylandInputDevice *handle, Compositor *compositor) : m_handle(handle) , m_compositor(compositor) { @@ -245,7 +247,7 @@ void InputDevice::set_cursor(wl_client *client, wl_resource *resource, wl_pointer *pointer = reinterpret_cast<wl_pointer *>(resource->data); InputDevice *inputDevice = wayland_cast<InputDevice>(pointer->seat); - Wayland::Surface *surface = reinterpret_cast<Wayland::Surface *>(surface_resource->data); + QtWayland::Surface *surface = reinterpret_cast<QtWayland::Surface *>(surface_resource->data); surface->setCursorSurface(true); inputDevice->m_compositor->waylandCompositor()->setCursorSurface(surface->waylandSurface(), hotspot_x, hotspot_y); @@ -599,7 +601,7 @@ Compositor *InputDevice::compositor() const return m_compositor; } -WaylandInputDevice *InputDevice::handle() const +QWaylandInputDevice *InputDevice::handle() const { return m_handle; } @@ -644,3 +646,5 @@ DataDevice *InputDevice::dataDevice(struct wl_client *client) const } } + +QT_END_NAMESPACE diff --git a/src/compositor/wayland_wrapper/wlinputdevice.h b/src/compositor/wayland_wrapper/qwlinputdevice_p.h index afd7ff51..9365fa9d 100644 --- a/src/compositor/wayland_wrapper/wlinputdevice.h +++ b/src/compositor/wayland_wrapper/qwlinputdevice_p.h @@ -41,7 +41,7 @@ #ifndef WLINPUTDEVICE_H #define WLINPUTDEVICE_H -#include "waylandobject.h" +#include <QtCompositor/qwaylandobject.h> #include <stdint.h> @@ -52,11 +52,13 @@ #include <xkbcommon/xkbcommon.h> #endif +QT_BEGIN_NAMESPACE + class QKeyEvent; class QTouchEvent; -class WaylandInputDevice; +class QWaylandInputDevice; -namespace Wayland { +namespace QtWayland { class Compositor; class DataDevice; @@ -66,7 +68,7 @@ class DataDeviceManager; class InputDevice : public Object<struct wl_seat> { public: - InputDevice(WaylandInputDevice *handle, Compositor *compositor); + InputDevice(QWaylandInputDevice *handle, Compositor *compositor); ~InputDevice(); void sendMousePressEvent(Qt::MouseButton button, const QPointF &localPos, const QPointF &globalPos = QPointF()); @@ -96,7 +98,7 @@ public: void sendSelectionFocus(Surface *surface); Compositor *compositor() const; - WaylandInputDevice *handle() const; + QWaylandInputDevice *handle() const; wl_pointer *pointerDevice(); wl_keyboard *keyboardDevice(); @@ -112,7 +114,7 @@ private: void updateModifierState(uint key, int state); void sendKeyModifiers(wl_resource *resource); - WaylandInputDevice *m_handle; + QWaylandInputDevice *m_handle; Compositor *m_compositor; QList<DataDevice *> m_data_devices; struct { @@ -159,4 +161,6 @@ private: } +QT_END_NAMESPACE + #endif // WLINPUTDEVICE_H diff --git a/src/compositor/wayland_wrapper/wloutput.cpp b/src/compositor/wayland_wrapper/qwloutput.cpp index 33e86eee..f248dccd 100644 --- a/src/compositor/wayland_wrapper/wloutput.cpp +++ b/src/compositor/wayland_wrapper/qwloutput.cpp @@ -38,13 +38,15 @@ ** ****************************************************************************/ -#include "wloutput.h" -#include "wlextendedoutput.h" +#include "qwloutput_p.h" +#include "qwlextendedoutput_p.h" #include <QGuiApplication> #include <QtGui/QScreen> #include <QRect> -namespace Wayland { +QT_BEGIN_NAMESPACE + +namespace QtWayland { OutputGlobal::OutputGlobal() : m_displayId(-1) @@ -122,3 +124,5 @@ wl_resource *Output::handle() const } } // namespace Wayland + +QT_END_NAMESPACE diff --git a/src/compositor/wayland_wrapper/wloutput.h b/src/compositor/wayland_wrapper/qwloutput_p.h index 8baf545f..11341737 100644 --- a/src/compositor/wayland_wrapper/wloutput.h +++ b/src/compositor/wayland_wrapper/qwloutput_p.h @@ -41,12 +41,14 @@ #ifndef WL_OUTPUT_H #define WL_OUTPUT_H -#include "waylandresourcecollection.h" +#include <QtCompositor/qwaylandresourcecollection.h> #include <QtCore/QRect> #include <QtCore/QList> -namespace Wayland { +QT_BEGIN_NAMESPACE + +namespace QtWayland { class Output; class ExtendedOutput; @@ -101,4 +103,6 @@ private: } +QT_END_NAMESPACE + #endif //WL_OUTPUT_H diff --git a/src/compositor/wayland_wrapper/wlqtkey.cpp b/src/compositor/wayland_wrapper/qwlqtkey.cpp index a4948924..a6fea9f2 100644 --- a/src/compositor/wayland_wrapper/wlqtkey.cpp +++ b/src/compositor/wayland_wrapper/qwlqtkey.cpp @@ -38,12 +38,14 @@ ** ****************************************************************************/ -#include "wlqtkey.h" -#include "wlsurface.h" +#include "qwlqtkey_p.h" +#include "qwlsurface_p.h" #include <QKeyEvent> #include <QWindow> -namespace Wayland { +QT_BEGIN_NAMESPACE + +namespace QtWayland { static void dummy(wl_client *, wl_resource *) { @@ -111,3 +113,5 @@ bool QtKeyExtensionGlobal::postQtKeyEvent(QKeyEvent *event, Surface *surface) } } + +QT_END_NAMESPACE diff --git a/src/compositor/wayland_wrapper/wlqtkey.h b/src/compositor/wayland_wrapper/qwlqtkey_p.h index d44e7c1b..bb98f9b8 100644 --- a/src/compositor/wayland_wrapper/wlqtkey.h +++ b/src/compositor/wayland_wrapper/qwlqtkey_p.h @@ -41,15 +41,17 @@ #ifndef WLQTKEY_H #define WLQTKEY_H -#include "wlcompositor.h" +#include <private/qwlcompositor_p.h> #include "wayland-qtkey-extension-server-protocol.h" #include "wayland-util.h" +QT_BEGIN_NAMESPACE + class Compositor; class Surface; class QKeyEvent; -namespace Wayland { +namespace QtWayland { class QtKeyExtensionGlobal { @@ -73,4 +75,6 @@ private: } +QT_END_NAMESPACE + #endif // WLQTKEY_H diff --git a/src/compositor/wayland_wrapper/wlregion.cpp b/src/compositor/wayland_wrapper/qwlregion.cpp index c4adcae4..c9e45252 100644 --- a/src/compositor/wayland_wrapper/wlregion.cpp +++ b/src/compositor/wayland_wrapper/qwlregion.cpp @@ -38,11 +38,13 @@ ** ****************************************************************************/ -#include "wlregion.h" +#include "qwlregion_p.h" -#include "wlcompositor.h" +#include "qwlcompositor_p.h" -namespace Wayland { +QT_BEGIN_NAMESPACE + +namespace QtWayland { void destroy_region(struct wl_resource *resource) { @@ -87,4 +89,4 @@ void Region::region_subtract(wl_client *client, wl_resource *region, } - +QT_END_NAMESPACE diff --git a/src/compositor/wayland_wrapper/wlregion.h b/src/compositor/wayland_wrapper/qwlregion_p.h index 80a48ab1..2002e737 100644 --- a/src/compositor/wayland_wrapper/wlregion.h +++ b/src/compositor/wayland_wrapper/qwlregion_p.h @@ -41,14 +41,16 @@ #ifndef WL_REGION_H #define WL_REGION_H -#include "waylandexport.h" -#include "waylandobject.h" +#include <QtCompositor/qwaylandexport.h> +#include <QtCompositor/qwaylandobject.h> #include <QRegion> #include <wayland-util.h> -namespace Wayland { +QT_BEGIN_NAMESPACE + +namespace QtWayland { class Q_COMPOSITOR_EXPORT Region : public Object<wl_resource> { @@ -76,5 +78,7 @@ private: } +QT_END_NAMESPACE + #endif // WL_REGION_H diff --git a/src/compositor/wayland_wrapper/wlshellsurface.cpp b/src/compositor/wayland_wrapper/qwlshellsurface.cpp index aed1ee64..f8d6e0c5 100644 --- a/src/compositor/wayland_wrapper/wlshellsurface.cpp +++ b/src/compositor/wayland_wrapper/qwlshellsurface.cpp @@ -38,17 +38,19 @@ ** ****************************************************************************/ -#include "wlshellsurface.h" +#include "qwlshellsurface_p.h" -#include "wlcompositor.h" -#include "wlsurface.h" -#include "wlinputdevice.h" -#include "wlsubsurface.h" +#include "qwlcompositor_p.h" +#include "qwlsurface_p.h" +#include "qwlinputdevice_p.h" +#include "qwlsubsurface_p.h" #include <QtCore/qglobal.h> #include <QtCore/QDebug> -namespace Wayland { +QT_BEGIN_NAMESPACE + +namespace QtWayland { Shell::Shell() { @@ -471,3 +473,5 @@ const struct wl_pointer_grab_interface ShellSurfaceMoveGrabber::move_grabber_int }; } + +QT_END_NAMESPACE diff --git a/src/compositor/wayland_wrapper/wlshellsurface.h b/src/compositor/wayland_wrapper/qwlshellsurface_p.h index e3a4713f..1bb0c4e4 100644 --- a/src/compositor/wayland_wrapper/wlshellsurface.h +++ b/src/compositor/wayland_wrapper/qwlshellsurface_p.h @@ -41,12 +41,14 @@ #ifndef WLSHELLSURFACE_H #define WLSHELLSURFACE_H -#include "waylandobject.h" +#include <QtCompositor/qwaylandobject.h> #include <wayland-server.h> #include <QPoint> -namespace Wayland { +QT_BEGIN_NAMESPACE + +namespace QtWayland { class Compositor; class Surface; @@ -193,8 +195,8 @@ public: static const struct wl_pointer_grab_interface move_grabber_interface; }; - - } +QT_END_NAMESPACE + #endif // WLSHELLSURFACE_H diff --git a/src/compositor/wayland_wrapper/wlsubsurface.cpp b/src/compositor/wayland_wrapper/qwlsubsurface.cpp index c6013b65..f482cde6 100644 --- a/src/compositor/wayland_wrapper/wlsubsurface.cpp +++ b/src/compositor/wayland_wrapper/qwlsubsurface.cpp @@ -38,12 +38,14 @@ ** ****************************************************************************/ -#include "wlsubsurface.h" +#include "qwlsubsurface_p.h" -#include "wlcompositor.h" -#include "waylandsurface.h" +#include "qwlcompositor_p.h" +#include "qwaylandsurface.h" -namespace Wayland { +QT_BEGIN_NAMESPACE + +namespace QtWayland { SubSurfaceExtensionGlobal::SubSurfaceExtensionGlobal(Compositor *compositor) : m_compositor(compositor) @@ -88,7 +90,7 @@ SubSurface::~SubSurface() if (m_parent) { m_parent->removeSubSurface(this); } - QLinkedList<WaylandSurface *>::iterator it; + QLinkedList<QWaylandSurface *>::iterator it; for (it = m_sub_surfaces.begin(); it != m_sub_surfaces.end(); ++it) { (*it)->handle()->subSurface()->parentDestroyed(); } @@ -119,8 +121,8 @@ void SubSurface::setParent(SubSurface *parent) if (m_parent == parent) return; - WaylandSurface *oldParent = 0; - WaylandSurface *newParent = 0; + QWaylandSurface *oldParent = 0; + QWaylandSurface *newParent = 0; if (m_parent) { oldParent = m_parent->m_surface->waylandSurface(); @@ -134,7 +136,7 @@ void SubSurface::setParent(SubSurface *parent) m_surface->waylandSurface()->parentChanged(newParent,oldParent); } -QLinkedList<WaylandSurface *> SubSurface::subSurfaces() const +QLinkedList<QWaylandSurface *> SubSurface::subSurfaces() const { return m_sub_surfaces; } @@ -184,3 +186,5 @@ const struct wl_sub_surface_interface SubSurface::sub_surface_interface = { }; } + +QT_END_NAMESPACE diff --git a/src/compositor/wayland_wrapper/wlsubsurface.h b/src/compositor/wayland_wrapper/qwlsubsurface_p.h index 6c7ede04..4fb80d61 100644 --- a/src/compositor/wayland_wrapper/wlsubsurface.h +++ b/src/compositor/wayland_wrapper/qwlsubsurface_p.h @@ -41,16 +41,18 @@ #ifndef WLSUBSURFACE_H #define WLSUBSURFACE_H -#include "wlsurface.h" +#include <private/qwlsurface_p.h> #include "wayland-sub-surface-extension-server-protocol.h" #include <QtCore/QLinkedList> +QT_BEGIN_NAMESPACE + class Compositor; -class WaylandSurface; +class QWaylandSurface; -namespace Wayland { +namespace QtWayland { class SubSurfaceExtensionGlobal { @@ -82,10 +84,10 @@ public: SubSurface *parent() const; void setParent(SubSurface *parent); - QLinkedList<WaylandSurface *> subSurfaces() const; + QLinkedList<QWaylandSurface *> subSurfaces() const; Surface *surface() const; - WaylandSurface *waylandSurface() const; + QWaylandSurface *waylandSurface() const; private: void parentDestroyed(); @@ -93,7 +95,7 @@ private: Surface *m_surface; SubSurface *m_parent; - QLinkedList<WaylandSurface *> m_sub_surfaces; + QLinkedList<QWaylandSurface *> m_sub_surfaces; static void attach_sub_surface(struct wl_client *client, struct wl_resource *sub_surface_parent_resource, @@ -119,12 +121,13 @@ inline Surface *SubSurface::surface() const return m_surface; } -inline WaylandSurface *SubSurface::waylandSurface() const +inline QWaylandSurface *SubSurface::waylandSurface() const { return m_surface->waylandSurface(); } - } +QT_END_NAMESPACE + #endif // WLSUBSURFACE_H diff --git a/src/compositor/wayland_wrapper/wlsurface.cpp b/src/compositor/wayland_wrapper/qwlsurface.cpp index 6781f29b..e61b30fc 100644 --- a/src/compositor/wayland_wrapper/wlsurface.cpp +++ b/src/compositor/wayland_wrapper/qwlsurface.cpp @@ -38,20 +38,20 @@ ** ****************************************************************************/ -#include "wlsurface.h" +#include "qwlsurface_p.h" -#include "waylandsurface.h" +#include "qwaylandsurface.h" #ifdef QT_COMPOSITOR_QUICK -#include "waylandsurfaceitem.h" +#include "qwaylandsurfaceitem.h" #endif -#include "wlcompositor.h" -#include "wlinputdevice.h" -#include "wlextendedsurface.h" -#include "wlregion.h" -#include "wlsubsurface.h" -#include "wlsurfacebuffer.h" -#include "wlshellsurface.h" +#include "qwlcompositor_p.h" +#include "qwlinputdevice_p.h" +#include "qwlextendedsurface_p.h" +#include "qwlregion_p.h" +#include "qwlsubsurface_p.h" +#include "qwlsurfacebuffer_p.h" +#include "qwlshellsurface_p.h" #include <QtCore/QDebug> #include <QTouchEvent> @@ -59,7 +59,7 @@ #include <wayland-server.h> #ifdef QT_COMPOSITOR_WAYLAND_GL -#include "hardware_integration/graphicshardwareintegration.h" +#include "hardware_integration/qwaylandgraphicshardwareintegration.h" #include <qpa/qplatformopenglcontext.h> #endif @@ -67,7 +67,9 @@ #include "waylandwindowmanagerintegration.h" #endif -namespace Wayland { +QT_BEGIN_NAMESPACE + +namespace QtWayland { void destroy_surface(struct wl_resource *resource) { @@ -78,7 +80,7 @@ void destroy_surface(struct wl_resource *resource) Surface::Surface(struct wl_client *client, uint32_t id, Compositor *compositor) : m_compositor(compositor) - , m_waylandSurface(new WaylandSurface(this)) + , m_waylandSurface(new QWaylandSurface(this)) , m_backBuffer(0) , m_frontBuffer(0) , m_surfaceMapped(false) @@ -109,30 +111,30 @@ Surface::~Surface() } } -WaylandSurface::Type Surface::type() const +QWaylandSurface::Type Surface::type() const { SurfaceBuffer *surfaceBuffer = currentSurfaceBuffer(); if (surfaceBuffer && surfaceBuffer->waylandBufferHandle()) { if (surfaceBuffer->isShmBuffer()) { - return WaylandSurface::Shm; + return QWaylandSurface::Shm; } else { - return WaylandSurface::Texture; + return QWaylandSurface::Texture; } } - return WaylandSurface::Invalid; + return QWaylandSurface::Invalid; } bool Surface::isYInverted() const { bool ret = false; static bool negateReturn = qgetenv("QT_COMPOSITOR_NEGATE_INVERTED_Y").toInt(); - GraphicsHardwareIntegration *graphicsHWIntegration = m_compositor->graphicsHWIntegration(); + QWaylandGraphicsHardwareIntegration *graphicsHWIntegration = m_compositor->graphicsHWIntegration(); #ifdef QT_COMPOSITOR_WAYLAND_GL SurfaceBuffer *surfacebuffer = currentSurfaceBuffer(); if (!surfacebuffer) { ret = false; - } else if (graphicsHWIntegration && surfacebuffer->waylandBufferHandle() && type() != WaylandSurface::Shm) { + } else if (graphicsHWIntegration && surfacebuffer->waylandBufferHandle() && type() != QWaylandSurface::Shm) { ret = graphicsHWIntegration->isYInverted(surfacebuffer->waylandBufferHandle()); } else #endif @@ -197,7 +199,7 @@ QRegion Surface::opaqueRegion() const QImage Surface::image() const { SurfaceBuffer *surfacebuffer = currentSurfaceBuffer(); - if (surfacebuffer && !surfacebuffer->isDestroyed() && type() == WaylandSurface::Shm) { + if (surfacebuffer && !surfacebuffer->isDestroyed() && type() == QWaylandSurface::Shm) { struct wl_buffer *buffer = surfacebuffer->waylandBufferHandle(); int stride = wl_shm_buffer_get_stride(buffer); uint format = wl_shm_buffer_get_format(buffer); @@ -215,9 +217,9 @@ GLuint Surface::textureId(QOpenGLContext *context) const { const SurfaceBuffer *surfacebuffer = currentSurfaceBuffer(); - if (m_compositor->graphicsHWIntegration() && type() == WaylandSurface::Texture + if (m_compositor->graphicsHWIntegration() && type() == QWaylandSurface::Texture && !surfacebuffer->textureCreated()) { - GraphicsHardwareIntegration *hwIntegration = m_compositor->graphicsHWIntegration(); + QWaylandGraphicsHardwareIntegration *hwIntegration = m_compositor->graphicsHWIntegration(); const_cast<SurfaceBuffer *>(surfacebuffer)->createTexture(hwIntegration,context); } return surfacebuffer->texture(); @@ -253,7 +255,7 @@ void Surface::frameFinished() m_compositor->frameFinished(this); } -WaylandSurface * Surface::waylandSurface() const +QWaylandSurface * Surface::waylandSurface() const { return m_waylandSurface; } @@ -349,7 +351,7 @@ bool Surface::advanceBufferQueue() void Surface::doUpdate() { if (postBuffer()) { #ifdef QT_COMPOSITOR_QUICK - WaylandSurfaceItem *surfaceItem = waylandSurface()->surfaceItem(); + QWaylandSurfaceItem *surfaceItem = waylandSurface()->surfaceItem(); if (surfaceItem) surfaceItem->setDamagedFlag(true); // avoid flicker when we switch back to composited mode #endif @@ -520,3 +522,4 @@ void Surface::setTitle(const QString &title) } // namespace Wayland +QT_END_NAMESPACE diff --git a/src/compositor/wayland_wrapper/wlsurface.h b/src/compositor/wayland_wrapper/qwlsurface_p.h index 5c11c6bc..21b1ae74 100644 --- a/src/compositor/wayland_wrapper/wlsurface.h +++ b/src/compositor/wayland_wrapper/qwlsurface_p.h @@ -41,12 +41,12 @@ #ifndef WL_SURFACE_H #define WL_SURFACE_H -#include "waylandexport.h" +#include <QtCompositor/qwaylandexport.h> -#include "wlsurfacebuffer.h" -#include "waylandsurface.h" +#include <private/qwlsurfacebuffer_p.h> +#include <QtCompositor/qwaylandsurface.h> -#include "waylandobject.h" +#include <QtCompositor/qwaylandobject.h> #include <QtCore/QRect> #include <QtGui/QImage> @@ -61,9 +61,11 @@ #include <wayland-util.h> +QT_BEGIN_NAMESPACE + class QTouchEvent; -namespace Wayland { +namespace QtWayland { class Compositor; class Buffer; @@ -77,7 +79,7 @@ public: Surface(struct wl_client *client, uint32_t id, Compositor *compositor); ~Surface(); - WaylandSurface::Type type() const; + QWaylandSurface::Type type() const; bool isYInverted() const; bool visible() const; @@ -104,7 +106,7 @@ public: void frameFinished(); - WaylandSurface *waylandSurface() const; + QWaylandSurface *waylandSurface() const; QPoint lastMousePos() const; @@ -139,7 +141,7 @@ private: Q_DISABLE_COPY(Surface) Compositor *m_compositor; - WaylandSurface *m_waylandSurface; + QWaylandSurface *m_waylandSurface; SurfaceBuffer *m_backBuffer; SurfaceBuffer *m_frontBuffer; @@ -199,4 +201,6 @@ inline SurfaceBuffer *Surface::currentSurfaceBuffer() const { } +QT_END_NAMESPACE + #endif //WL_SURFACE_H diff --git a/src/compositor/wayland_wrapper/wlsurfacebuffer.cpp b/src/compositor/wayland_wrapper/qwlsurfacebuffer.cpp index 6dd76532..cebe105b 100644 --- a/src/compositor/wayland_wrapper/wlsurfacebuffer.cpp +++ b/src/compositor/wayland_wrapper/qwlsurfacebuffer.cpp @@ -38,19 +38,21 @@ ** ****************************************************************************/ -#include "wlsurfacebuffer.h" +#include "qwlsurfacebuffer_p.h" -#include "wlsurface.h" -#include "wlcompositor.h" +#include "qwlsurface_p.h" +#include "qwlcompositor_p.h" #ifdef QT_COMPOSITOR_WAYLAND_GL -#include "hardware_integration/graphicshardwareintegration.h" +#include "hardware_integration/qwaylandgraphicshardwareintegration.h" #include <qpa/qplatformopenglcontext.h> #endif #include <QtCore/QDebug> -namespace Wayland { +QT_BEGIN_NAMESPACE + +namespace QtWayland { SurfaceBuffer::SurfaceBuffer(Surface *surface) : QPlatformScreenBuffer() @@ -106,7 +108,7 @@ void SurfaceBuffer::destructBufferState() delete static_cast<QImage *>(m_handle); #ifdef QT_COMPOSITOR_WAYLAND_GL } else { - GraphicsHardwareIntegration *hwIntegration = m_compositor->graphicsHWIntegration(); + QWaylandGraphicsHardwareIntegration *hwIntegration = m_compositor->graphicsHWIntegration(); hwIntegration->unlockNativeBuffer(m_handle, m_compositor->directRenderContext()); #endif } @@ -217,7 +219,7 @@ void *SurfaceBuffer::handle() const that->m_handle = image; #ifdef QT_COMPOSITOR_WAYLAND_GL } else { - GraphicsHardwareIntegration *hwIntegration = m_compositor->graphicsHWIntegration(); + QWaylandGraphicsHardwareIntegration *hwIntegration = m_compositor->graphicsHWIntegration(); that->m_handle = hwIntegration->lockNativeBuffer(m_buffer, m_compositor->directRenderContext()); #endif } @@ -241,7 +243,7 @@ void freeTexture(QOpenGLFunctions *, GLuint id) glDeleteTextures(1, &id); } -void SurfaceBuffer::createTexture(GraphicsHardwareIntegration *hwIntegration, QOpenGLContext *context) +void SurfaceBuffer::createTexture(QWaylandGraphicsHardwareIntegration *hwIntegration, QOpenGLContext *context) { #ifdef QT_COMPOSITOR_WAYLAND_GL m_texture = hwIntegration->createTextureFromBuffer(m_buffer, context); @@ -253,3 +255,5 @@ void SurfaceBuffer::createTexture(GraphicsHardwareIntegration *hwIntegration, QO } } + +QT_END_NAMESPACE diff --git a/src/compositor/wayland_wrapper/wlsurfacebuffer.h b/src/compositor/wayland_wrapper/qwlsurfacebuffer_p.h index 8efab29c..dda33544 100644 --- a/src/compositor/wayland_wrapper/wlsurfacebuffer.h +++ b/src/compositor/wayland_wrapper/qwlsurfacebuffer_p.h @@ -48,10 +48,12 @@ #include <wayland-server.h> -class GraphicsHardwareIntegration; +QT_BEGIN_NAMESPACE + +class QWaylandGraphicsHardwareIntegration; class QOpenGLContext; -namespace Wayland { +namespace QtWayland { class Surface; class Compositor; @@ -95,7 +97,7 @@ public: inline bool textureCreated() const { return m_texture; } - void createTexture(GraphicsHardwareIntegration *hwIntegration, QOpenGLContext *context); + void createTexture(QWaylandGraphicsHardwareIntegration *hwIntegration, QOpenGLContext *context); inline GLuint texture() const; void destroyTexture(); @@ -139,4 +141,6 @@ GLuint SurfaceBuffer::texture() const } +QT_END_NAMESPACE + #endif // SURFACEBUFFER_H diff --git a/src/compositor/wayland_wrapper/wltouch.cpp b/src/compositor/wayland_wrapper/qwltouch.cpp index 67efc110..458c74bf 100644 --- a/src/compositor/wayland_wrapper/wltouch.cpp +++ b/src/compositor/wayland_wrapper/qwltouch.cpp @@ -38,12 +38,14 @@ ** ****************************************************************************/ -#include "wltouch.h" -#include "wlsurface.h" +#include "qwltouch_p.h" +#include "qwlsurface_p.h" #include <QTouchEvent> #include <QWindow> -namespace Wayland { +QT_BEGIN_NAMESPACE + +namespace QtWayland { static void dummy(wl_client *, wl_resource *) { @@ -174,3 +176,5 @@ bool TouchExtensionGlobal::postTouchEvent(QTouchEvent *event, Surface *surface) } } + +QT_END_NAMESPACE diff --git a/src/compositor/wayland_wrapper/wltouch.h b/src/compositor/wayland_wrapper/qwltouch_p.h index 8a4eba00..09c9a089 100644 --- a/src/compositor/wayland_wrapper/wltouch.h +++ b/src/compositor/wayland_wrapper/qwltouch_p.h @@ -41,15 +41,17 @@ #ifndef WLTOUCH_H #define WLTOUCH_H -#include "wlcompositor.h" +#include <private/qwlcompositor_p.h> #include "wayland-touch-extension-server-protocol.h" #include "wayland-util.h" +QT_BEGIN_NAMESPACE + class Compositor; class Surface; class QTouchEvent; -namespace Wayland { +namespace QtWayland { class TouchExtensionGlobal { @@ -78,4 +80,6 @@ private: } +QT_END_NAMESPACE + #endif // WLTOUCH_H diff --git a/src/compositor/wayland_wrapper/wayland_wrapper.pri b/src/compositor/wayland_wrapper/wayland_wrapper.pri index 84008c6c..9bfe957e 100644 --- a/src/compositor/wayland_wrapper/wayland_wrapper.pri +++ b/src/compositor/wayland_wrapper/wayland_wrapper.pri @@ -1,53 +1,50 @@ WAYLANDSOURCES += \ - $$PWD/../../extensions/surface-extension.xml \ - $$PWD/../../extensions/sub-surface-extension.xml \ - $$PWD/../../extensions/output-extension.xml \ - $$PWD/../../extensions/touch-extension.xml \ - $$PWD/../../extensions/qtkey-extension.xml - + ../extensions/surface-extension.xml \ + ../extensions/sub-surface-extension.xml \ + ../extensions/output-extension.xml \ + ../extensions/touch-extension.xml \ + ../extensions/qtkey-extension.xml \ + ../extensions/windowmanager.xml HEADERS += \ - $$PWD/wlcompositor.h \ - $$PWD/wldisplay.h \ - $$PWD/wloutput.h \ - $$PWD/wlsurface.h \ - $$PWD/wlshellsurface.h \ - $$PWD/wlinputdevice.h \ - $$PWD/wldatadevicemanager.h \ - $$PWD/wldatadevice.h \ - $$PWD/wldataoffer.h \ - $$PWD/wldatasource.h \ - $$PWD/wlextendedsurface.h \ - $$PWD/wlextendedoutput.h \ - $$PWD/wlsubsurface.h \ - $$PWD/wltouch.h \ - $$PWD/wlqtkey.h \ - $$PWD/../../shared/qwaylandmimehelper.h \ - $$PWD/wlsurfacebuffer.h \ - $$PWD/wlregion.h + wayland_wrapper/qwlcompositor_p.h \ + wayland_wrapper/qwldatadevice_p.h \ + wayland_wrapper/qwldatadevicemanager_p.h \ + wayland_wrapper/qwldataoffer_p.h \ + wayland_wrapper/qwldatasource_p.h \ + wayland_wrapper/qwldisplay_p.h \ + wayland_wrapper/qwlextendedoutput_p.h \ + wayland_wrapper/qwlextendedsurface_p.h \ + wayland_wrapper/qwlinputdevice_p.h \ + wayland_wrapper/qwloutput_p.h \ + wayland_wrapper/qwlqtkey_p.h \ + wayland_wrapper/qwlregion_p.h \ + wayland_wrapper/qwlshellsurface_p.h \ + wayland_wrapper/qwlsubsurface_p.h \ + wayland_wrapper/qwlsurface_p.h \ + wayland_wrapper/qwlsurfacebuffer_p.h \ + wayland_wrapper/qwltouch_p.h SOURCES += \ - $$PWD/wlcompositor.cpp \ - $$PWD/wldisplay.cpp \ - $$PWD/wloutput.cpp \ - $$PWD/wlsurface.cpp \ - $$PWD/wlshellsurface.cpp \ - $$PWD/wlinputdevice.cpp \ - $$PWD/wldatadevicemanager.cpp \ - $$PWD/wldatadevice.cpp \ - $$PWD/wldataoffer.cpp \ - $$PWD/wldatasource.cpp \ - $$PWD/wlextendedsurface.cpp \ - $$PWD/wlextendedoutput.cpp \ - $$PWD/wlsubsurface.cpp \ - $$PWD/wltouch.cpp \ - $$PWD/wlqtkey.cpp \ - $$PWD/../../shared/qwaylandmimehelper.cpp \ - $$PWD/wlsurfacebuffer.cpp \ - $$PWD/wlregion.cpp + wayland_wrapper/qwlcompositor.cpp \ + wayland_wrapper/qwldatadevice.cpp \ + wayland_wrapper/qwldatadevicemanager.cpp \ + wayland_wrapper/qwldataoffer.cpp \ + wayland_wrapper/qwldatasource.cpp \ + wayland_wrapper/qwldisplay.cpp \ + wayland_wrapper/qwlextendedoutput.cpp \ + wayland_wrapper/qwlextendedsurface.cpp \ + wayland_wrapper/qwlinputdevice.cpp \ + wayland_wrapper/qwloutput.cpp \ + wayland_wrapper/qwlqtkey.cpp \ + wayland_wrapper/qwlregion.cpp \ + wayland_wrapper/qwlshellsurface.cpp \ + wayland_wrapper/qwlsubsurface.cpp \ + wayland_wrapper/qwlsurface.cpp \ + wayland_wrapper/qwlsurfacebuffer.cpp \ + wayland_wrapper/qwltouch.cpp -INCLUDEPATH += $$PWD -INCLUDEPATH += $$PWD/../../shared +INCLUDEPATH += wayland_wrapper config_xkbcommon { !contains(QT_CONFIG, no-pkg-config) { diff --git a/src/compositor/windowmanagerprotocol/waylandwindowmanagerintegration.cpp b/src/compositor/windowmanagerprotocol/waylandwindowmanagerintegration.cpp index 80c159d5..ea16da31 100644 --- a/src/compositor/windowmanagerprotocol/waylandwindowmanagerintegration.cpp +++ b/src/compositor/windowmanagerprotocol/waylandwindowmanagerintegration.cpp @@ -40,17 +40,19 @@ #include "waylandwindowmanagerintegration.h" -#include "wayland_wrapper/wldisplay.h" -#include "wayland_wrapper/wlcompositor.h" +#include "wayland_wrapper/qwldisplay_p.h" +#include "wayland_wrapper/qwlcompositor_p.h" -#include "compositor_api/waylandcompositor.h" +#include "compositor_api/qwaylandcompositor.h" #include "wayland-server.h" #include "wayland-windowmanager-server-protocol.h" #include <QUrl> -WindowManagerServerIntegration::WindowManagerServerIntegration(WaylandCompositor *compositor, QObject *parent) +QT_BEGIN_NAMESPACE + +WindowManagerServerIntegration::WindowManagerServerIntegration(QWaylandCompositor *compositor, QObject *parent) : QObject(parent) , m_showIsFullScreen(false) , m_compositor(compositor) @@ -62,7 +64,7 @@ WindowManagerServerIntegration::~WindowManagerServerIntegration() qDeleteAll(m_managedClients); } -void WindowManagerServerIntegration::initialize(Wayland::Display *waylandDisplay) +void WindowManagerServerIntegration::initialize(QtWayland::Display *waylandDisplay) { wl_display_add_global(waylandDisplay->handle(),&wl_windowmanager_interface,this,WindowManagerServerIntegration::bind_func); } @@ -208,3 +210,5 @@ QByteArray WaylandManagedClient::authenticationToken() const { return m_authenticationToken; } + +QT_END_NAMESPACE diff --git a/src/compositor/windowmanagerprotocol/waylandwindowmanagerintegration.h b/src/compositor/windowmanagerprotocol/waylandwindowmanagerintegration.h index f261e37b..afae39dc 100644 --- a/src/compositor/windowmanagerprotocol/waylandwindowmanagerintegration.h +++ b/src/compositor/windowmanagerprotocol/waylandwindowmanagerintegration.h @@ -41,8 +41,8 @@ #ifndef WAYLANDWINDOWMANAGERINTEGRATION_H #define WAYLANDWINDOWMANAGERINTEGRATION_H -#include "waylandexport.h" -#include "waylandresourcecollection.h" +#include <QtCompositor/qwaylandexport.h> +#include <QtCompositor/qwaylandresourcecollection.h> #include <qwindowdefs.h> #include <stdint.h> @@ -54,22 +54,24 @@ struct wl_client; struct wl_object; -namespace Wayland { +QT_BEGIN_NAMESPACE + +namespace QtWayland { class Display; } class WindowManagerObject; class WaylandManagedClient; -class WaylandCompositor; +class QWaylandCompositor; -class Q_COMPOSITOR_EXPORT WindowManagerServerIntegration : public QObject, private Wayland::ResourceCollection +class Q_COMPOSITOR_EXPORT WindowManagerServerIntegration : public QObject, private QtWayland::ResourceCollection { Q_OBJECT public: - WindowManagerServerIntegration(WaylandCompositor *compositor, QObject *parent = 0); + WindowManagerServerIntegration(QWaylandCompositor *compositor, QObject *parent = 0); ~WindowManagerServerIntegration(); - void initialize(Wayland::Display *waylandDisplay); + void initialize(QtWayland::Display *waylandDisplay); void removeClient(wl_client *client); WaylandManagedClient *managedClient(wl_client *client) const; @@ -86,7 +88,7 @@ private: private: bool m_showIsFullScreen; - WaylandCompositor *m_compositor; + QWaylandCompositor *m_compositor; QMap<wl_client*, WaylandManagedClient*> m_managedClients; static void bind_func(struct wl_client *client, void *data, @@ -121,4 +123,6 @@ private: friend class WindowManagerServerIntegration; }; +QT_END_NAMESPACE + #endif // WAYLANDWINDOWMANAGERINTEGRATION_H diff --git a/src/compositor/windowmanagerprotocol/windowmanagerprotocol.pri b/src/compositor/windowmanagerprotocol/windowmanagerprotocol.pri index 457080f5..7b35c7b7 100644 --- a/src/compositor/windowmanagerprotocol/windowmanagerprotocol.pri +++ b/src/compositor/windowmanagerprotocol/windowmanagerprotocol.pri @@ -1,11 +1,9 @@ INCLUDEPATH += $$PWD -WAYLANDSOURCES += $$PWD/../../extensions/windowmanager.xml - HEADERS += \ - $$PWD/waylandwindowmanagerintegration.h \ + windowmanagerprotocol/waylandwindowmanagerintegration.h SOURCES += \ - $$PWD/waylandwindowmanagerintegration.cpp \ + windowmanagerprotocol/waylandwindowmanagerintegration.cpp diff --git a/src/plugins/platforms/qwayland-brcm-egl/qwaylandbrcmeglintegration.cpp b/src/plugins/platforms/qwayland-brcm-egl/qwaylandbrcmeglintegration.cpp index a1d6df08..2bd5732d 100644 --- a/src/plugins/platforms/qwayland-brcm-egl/qwaylandbrcmeglintegration.cpp +++ b/src/plugins/platforms/qwayland-brcm-egl/qwaylandbrcmeglintegration.cpp @@ -50,6 +50,8 @@ #include "wayland-brcm-client-protocol.h" +QT_USE_NAMESPACE + QWaylandBrcmEglIntegration::QWaylandBrcmEglIntegration(QWaylandDisplay *waylandDisplay) : m_waylandDisplay(waylandDisplay->wl_display()) { diff --git a/src/plugins/platforms/qwayland-brcm-egl/qwaylandbrcmeglintegration.h b/src/plugins/platforms/qwayland-brcm-egl/qwaylandbrcmeglintegration.h index de7b38a5..c7cb41b6 100644 --- a/src/plugins/platforms/qwayland-brcm-egl/qwaylandbrcmeglintegration.h +++ b/src/plugins/platforms/qwayland-brcm-egl/qwaylandbrcmeglintegration.h @@ -50,6 +50,10 @@ #define EGL_EGLEXT_PROTOTYPES #include <EGL/eglext_brcm.h> +#include <QtCore/qglobal.h> + +QT_BEGIN_NAMESPACE + class QWaylandWindow; class QWindow; @@ -85,4 +89,6 @@ private: EGLDisplay m_eglDisplay; }; +QT_END_NAMESPACE + #endif // QWAYLANDBRCMEGLINTEGRATION_H diff --git a/src/plugins/platforms/qwayland-brcm-egl/qwaylandbrcmeglwindow.cpp b/src/plugins/platforms/qwayland-brcm-egl/qwaylandbrcmeglwindow.cpp index 82f67392..0b2f4d31 100644 --- a/src/plugins/platforms/qwayland-brcm-egl/qwaylandbrcmeglwindow.cpp +++ b/src/plugins/platforms/qwayland-brcm-egl/qwaylandbrcmeglwindow.cpp @@ -59,6 +59,8 @@ #include "wayland-brcm-client-protocol.h" +QT_USE_NAMESPACE + class QWaylandBrcmBuffer : public QWaylandBuffer { public: diff --git a/src/plugins/platforms/qwayland-brcm-egl/qwaylandbrcmeglwindow.h b/src/plugins/platforms/qwayland-brcm-egl/qwaylandbrcmeglwindow.h index 92c0aa57..e8fcfbaa 100644 --- a/src/plugins/platforms/qwayland-brcm-egl/qwaylandbrcmeglwindow.h +++ b/src/plugins/platforms/qwayland-brcm-egl/qwaylandbrcmeglwindow.h @@ -49,6 +49,8 @@ #include <EGL/egl.h> +QT_BEGIN_NAMESPACE + class QWaylandGLContext; class QWaylandBrcmBuffer; @@ -94,4 +96,6 @@ private: QMutex m_mutex; }; +QT_END_NAMESPACE + #endif // QWAYLANDBRCMEGLWINDOW_H diff --git a/src/plugins/platforms/qwayland-brcm-egl/qwaylandbrcmglcontext.cpp b/src/plugins/platforms/qwayland-brcm-egl/qwaylandbrcmglcontext.cpp index a3b737f5..14b98987 100644 --- a/src/plugins/platforms/qwayland-brcm-egl/qwaylandbrcmglcontext.cpp +++ b/src/plugins/platforms/qwayland-brcm-egl/qwaylandbrcmglcontext.cpp @@ -50,6 +50,8 @@ #include <qpa/qplatformopenglcontext.h> #include <QtGui/QSurfaceFormat> +QT_USE_NAMESPACE + extern QSurfaceFormat brcmFixFormat(const QSurfaceFormat &format); QWaylandBrcmGLContext::QWaylandBrcmGLContext(EGLDisplay eglDisplay, const QSurfaceFormat &format, QPlatformOpenGLContext *share) diff --git a/src/plugins/platforms/qwayland-brcm-egl/qwaylandbrcmglcontext.h b/src/plugins/platforms/qwayland-brcm-egl/qwaylandbrcmglcontext.h index ae248a6a..7beef166 100644 --- a/src/plugins/platforms/qwayland-brcm-egl/qwaylandbrcmglcontext.h +++ b/src/plugins/platforms/qwayland-brcm-egl/qwaylandbrcmglcontext.h @@ -48,6 +48,8 @@ #include <EGL/egl.h> +QT_BEGIN_NAMESPACE + class QWaylandWindow; class QWaylandGLWindowSurface; @@ -76,5 +78,6 @@ private: QSurfaceFormat m_format; }; +QT_END_NAMESPACE #endif // QWAYLANDBRCMGLCONTEXT_H diff --git a/src/plugins/platforms/qwayland-egl/qwaylandegldecoration.cpp b/src/plugins/platforms/qwayland-egl/qwaylandegldecoration.cpp index 5cf5239a..7724f283 100644 --- a/src/plugins/platforms/qwayland-egl/qwaylandegldecoration.cpp +++ b/src/plugins/platforms/qwayland-egl/qwaylandegldecoration.cpp @@ -46,6 +46,8 @@ #include <QtGui/QPainter> #include <QtGui/QOpenGLPaintDevice> +QT_USE_NAMESPACE + QWaylandEglDecoration::QWaylandEglDecoration(QWaylandEglWindow *window) : QWaylandDecoration(window) { diff --git a/src/plugins/platforms/qwayland-egl/qwaylandegldecoration.h b/src/plugins/platforms/qwayland-egl/qwaylandegldecoration.h index c1ef6d54..3039b728 100644 --- a/src/plugins/platforms/qwayland-egl/qwaylandegldecoration.h +++ b/src/plugins/platforms/qwayland-egl/qwaylandegldecoration.h @@ -44,6 +44,8 @@ #include "qwaylanddecoration.h" +QT_BEGIN_NAMESPACE + class QWaylandEglWindow; class QWaylandEglDecoration : public QWaylandDecoration @@ -56,4 +58,6 @@ public: }; +QT_END_NAMESPACE + #endif // QWAYLANDEGLDECORATION_H diff --git a/src/plugins/platforms/qwayland-egl/qwaylandeglintegration.cpp b/src/plugins/platforms/qwayland-egl/qwaylandeglintegration.cpp index b64798f6..53cc5270 100644 --- a/src/plugins/platforms/qwayland-egl/qwaylandeglintegration.cpp +++ b/src/plugins/platforms/qwayland-egl/qwaylandeglintegration.cpp @@ -50,6 +50,8 @@ #include <QtCore/QDebug> +QT_USE_NAMESPACE + QWaylandEglIntegration::QWaylandEglIntegration(struct wl_display *waylandDisplay) : m_waylandDisplay(waylandDisplay) { diff --git a/src/plugins/platforms/qwayland-egl/qwaylandeglintegration.h b/src/plugins/platforms/qwayland-egl/qwaylandeglintegration.h index 77a365df..64e7d97d 100644 --- a/src/plugins/platforms/qwayland-egl/qwaylandeglintegration.h +++ b/src/plugins/platforms/qwayland-egl/qwaylandeglintegration.h @@ -46,6 +46,8 @@ #include "qwaylandeglinclude.h" +QT_BEGIN_NAMESPACE + class QWaylandWindow; class QWindow; @@ -69,4 +71,6 @@ private: EGLDisplay m_eglDisplay; }; +QT_END_NAMESPACE + #endif // QWAYLANDEGLINTEGRATION_H diff --git a/src/plugins/platforms/qwayland-egl/qwaylandeglwindow.cpp b/src/plugins/platforms/qwayland-egl/qwaylandeglwindow.cpp index caed3dfe..6edf7483 100644 --- a/src/plugins/platforms/qwayland-egl/qwaylandeglwindow.cpp +++ b/src/plugins/platforms/qwayland-egl/qwaylandeglwindow.cpp @@ -57,6 +57,8 @@ #include "windowmanager_integration/qwaylandwindowmanagerintegration.h" #endif +QT_USE_NAMESPACE + QWaylandEglWindow::QWaylandEglWindow(QWindow *window) : QWaylandWindow(window) , m_eglIntegration(static_cast<QWaylandEglIntegration *>(mDisplay->eglIntegration())) diff --git a/src/plugins/platforms/qwayland-egl/qwaylandeglwindow.h b/src/plugins/platforms/qwayland-egl/qwaylandeglwindow.h index 4a7b3054..dfc5a26d 100644 --- a/src/plugins/platforms/qwayland-egl/qwaylandeglwindow.h +++ b/src/plugins/platforms/qwayland-egl/qwaylandeglwindow.h @@ -46,6 +46,8 @@ #include "qwaylandeglinclude.h" #include "qwaylandeglintegration.h" +QT_BEGIN_NAMESPACE + class QWaylandGLContext; class QOpenGLFramebufferObject; @@ -85,4 +87,6 @@ private: QSurfaceFormat m_format; }; +QT_END_NAMESPACE + #endif // QWAYLANDEGLWINDOW_H diff --git a/src/plugins/platforms/qwayland-egl/qwaylandglcontext.cpp b/src/plugins/platforms/qwayland-egl/qwaylandglcontext.cpp index f9ad280f..4d8017dc 100644 --- a/src/plugins/platforms/qwayland-egl/qwaylandglcontext.cpp +++ b/src/plugins/platforms/qwayland-egl/qwaylandglcontext.cpp @@ -54,6 +54,8 @@ #include <QtGui/QSurfaceFormat> #include <QtGui/QOpenGLShaderProgram> +QT_USE_NAMESPACE + QWaylandGLContext::QWaylandGLContext(EGLDisplay eglDisplay, const QSurfaceFormat &format, QPlatformOpenGLContext *share) : QPlatformOpenGLContext() , m_eglDisplay(eglDisplay) diff --git a/src/plugins/platforms/qwayland-egl/qwaylandglcontext.h b/src/plugins/platforms/qwayland-egl/qwaylandglcontext.h index 767f188f..696a0b91 100644 --- a/src/plugins/platforms/qwayland-egl/qwaylandglcontext.h +++ b/src/plugins/platforms/qwayland-egl/qwaylandglcontext.h @@ -48,6 +48,8 @@ #include "qwaylandeglinclude.h" +QT_BEGIN_NAMESPACE + class QWaylandWindow; class QWaylandGLWindowSurface; class QOpenGLShaderProgram; @@ -84,5 +86,6 @@ private: QOpenGLShaderProgram *m_blitProgram; }; +QT_END_NAMESPACE #endif // QWAYLANDGLCONTEXT_H diff --git a/src/plugins/platforms/qwayland-xcomposite-egl/qwaylandxcompositeeglcontext.cpp b/src/plugins/platforms/qwayland-xcomposite-egl/qwaylandxcompositeeglcontext.cpp index 5024ba25..42139ef1 100644 --- a/src/plugins/platforms/qwayland-xcomposite-egl/qwaylandxcompositeeglcontext.cpp +++ b/src/plugins/platforms/qwayland-xcomposite-egl/qwaylandxcompositeeglcontext.cpp @@ -48,6 +48,8 @@ #include <QtPlatformSupport/private/qeglconvenience_p.h> +QT_USE_NAMESPACE + QWaylandXCompositeEGLContext::QWaylandXCompositeEGLContext(const QSurfaceFormat &format, QPlatformOpenGLContext *share, EGLDisplay display) : QEGLPlatformContext(format, share, display) { diff --git a/src/plugins/platforms/qwayland-xcomposite-egl/qwaylandxcompositeeglcontext.h b/src/plugins/platforms/qwayland-xcomposite-egl/qwaylandxcompositeeglcontext.h index 906f8a3f..32cdb432 100644 --- a/src/plugins/platforms/qwayland-xcomposite-egl/qwaylandxcompositeeglcontext.h +++ b/src/plugins/platforms/qwayland-xcomposite-egl/qwaylandxcompositeeglcontext.h @@ -48,6 +48,8 @@ #include <QtPlatformSupport/private/qeglplatformcontext_p.h> +QT_BEGIN_NAMESPACE + class QWaylandXCompositeEGLWindow; class QWaylandXCompositeEGLContext : public QEGLPlatformContext @@ -61,4 +63,6 @@ private: EGLSurface eglSurfaceForPlatformSurface(QPlatformSurface *surface); }; +QT_END_NAMESPACE + #endif // QWAYLANDXCOMPOSITEEGLCONTEXT_H diff --git a/src/plugins/platforms/qwayland-xcomposite-egl/qwaylandxcompositeeglintegration.cpp b/src/plugins/platforms/qwayland-xcomposite-egl/qwaylandxcompositeeglintegration.cpp index c4d98a8e..992c2dcf 100644 --- a/src/plugins/platforms/qwayland-xcomposite-egl/qwaylandxcompositeeglintegration.cpp +++ b/src/plugins/platforms/qwayland-xcomposite-egl/qwaylandxcompositeeglintegration.cpp @@ -47,6 +47,8 @@ #include "wayland-xcomposite-client-protocol.h" +QT_USE_NAMESPACE + QWaylandGLIntegration * QWaylandGLIntegration::createGLIntegration(QWaylandDisplay *waylandDisplay) { return new QWaylandXCompositeEGLIntegration(waylandDisplay); diff --git a/src/plugins/platforms/qwayland-xcomposite-egl/qwaylandxcompositeeglintegration.h b/src/plugins/platforms/qwayland-xcomposite-egl/qwaylandxcompositeeglintegration.h index ae0fc30b..d3015ab5 100644 --- a/src/plugins/platforms/qwayland-xcomposite-egl/qwaylandxcompositeeglintegration.h +++ b/src/plugins/platforms/qwayland-xcomposite-egl/qwaylandxcompositeeglintegration.h @@ -60,6 +60,8 @@ struct wl_xcomposite; +QT_BEGIN_NAMESPACE + class QWaylandXCompositeEGLIntegration : public QWaylandGLIntegration { public: @@ -99,4 +101,6 @@ private: uint32_t root_window); }; +QT_END_NAMESPACE + #endif // QWAYLANDXCOMPOSITEEGLINTEGRATION_H diff --git a/src/plugins/platforms/qwayland-xcomposite-egl/qwaylandxcompositeeglwindow.cpp b/src/plugins/platforms/qwayland-xcomposite-egl/qwaylandxcompositeeglwindow.cpp index 0f50f63f..edf77a64 100644 --- a/src/plugins/platforms/qwayland-xcomposite-egl/qwaylandxcompositeeglwindow.cpp +++ b/src/plugins/platforms/qwayland-xcomposite-egl/qwaylandxcompositeeglwindow.cpp @@ -53,6 +53,8 @@ #include <QtCore/QDebug> +QT_USE_NAMESPACE + QWaylandXCompositeEGLWindow::QWaylandXCompositeEGLWindow(QWindow *window, QWaylandXCompositeEGLIntegration *glxIntegration) : QWaylandWindow(window) , m_glxIntegration(glxIntegration) diff --git a/src/plugins/platforms/qwayland-xcomposite-egl/qwaylandxcompositeeglwindow.h b/src/plugins/platforms/qwayland-xcomposite-egl/qwaylandxcompositeeglwindow.h index ac7419a9..895ac28f 100644 --- a/src/plugins/platforms/qwayland-xcomposite-egl/qwaylandxcompositeeglwindow.h +++ b/src/plugins/platforms/qwayland-xcomposite-egl/qwaylandxcompositeeglwindow.h @@ -48,6 +48,8 @@ #include "qwaylandxcompositeeglintegration.h" #include "qwaylandxcompositeeglcontext.h" +QT_BEGIN_NAMESPACE + class QWaylandXCompositeEGLWindow : public QWaylandWindow { public: @@ -77,4 +79,6 @@ private: uint32_t time); }; +QT_END_NAMESPACE + #endif // QWAYLANDXCOMPOSITEEGLWINDOW_H diff --git a/src/plugins/platforms/qwayland-xcomposite-glx/qwaylandxcompositeglxcontext.cpp b/src/plugins/platforms/qwayland-xcomposite-glx/qwaylandxcompositeglxcontext.cpp index 4ba49925..28643690 100644 --- a/src/plugins/platforms/qwayland-xcomposite-glx/qwaylandxcompositeglxcontext.cpp +++ b/src/plugins/platforms/qwayland-xcomposite-glx/qwaylandxcompositeglxcontext.cpp @@ -47,6 +47,8 @@ #include <QRegion> +QT_USE_NAMESPACE + QWaylandXCompositeGLXContext::QWaylandXCompositeGLXContext(const QSurfaceFormat &format, QPlatformOpenGLContext *share, Display *display, int screen) : m_display(display) { diff --git a/src/plugins/platforms/qwayland-xcomposite-glx/qwaylandxcompositeglxcontext.h b/src/plugins/platforms/qwayland-xcomposite-glx/qwaylandxcompositeglxcontext.h index 55b6c2af..de031126 100644 --- a/src/plugins/platforms/qwayland-xcomposite-glx/qwaylandxcompositeglxcontext.h +++ b/src/plugins/platforms/qwayland-xcomposite-glx/qwaylandxcompositeglxcontext.h @@ -47,6 +47,8 @@ #include "qwaylandxcompositeglxintegration.h" #include <QtPlatformSupport/private/qglxconvenience_p.h> +QT_BEGIN_NAMESPACE + class QWaylandXCompositeGLXWindow; class QWaylandShmBuffer; @@ -71,4 +73,6 @@ private: QSurfaceFormat m_format; }; +QT_END_NAMESPACE + #endif // QWAYLANDXCOMPOSITEGLXCONTEXT_H diff --git a/src/plugins/platforms/qwayland-xcomposite-glx/qwaylandxcompositeglxintegration.cpp b/src/plugins/platforms/qwayland-xcomposite-glx/qwaylandxcompositeglxintegration.cpp index d82c6456..56554236 100644 --- a/src/plugins/platforms/qwayland-xcomposite-glx/qwaylandxcompositeglxintegration.cpp +++ b/src/plugins/platforms/qwayland-xcomposite-glx/qwaylandxcompositeglxintegration.cpp @@ -47,6 +47,8 @@ #include "wayland-xcomposite-client-protocol.h" +QT_USE_NAMESPACE + QWaylandGLIntegration * QWaylandGLIntegration::createGLIntegration(QWaylandDisplay *waylandDisplay) { return new QWaylandXCompositeGLXIntegration(waylandDisplay); diff --git a/src/plugins/platforms/qwayland-xcomposite-glx/qwaylandxcompositeglxintegration.h b/src/plugins/platforms/qwayland-xcomposite-glx/qwaylandxcompositeglxintegration.h index 3417967c..8bbbab89 100644 --- a/src/plugins/platforms/qwayland-xcomposite-glx/qwaylandxcompositeglxintegration.h +++ b/src/plugins/platforms/qwayland-xcomposite-glx/qwaylandxcompositeglxintegration.h @@ -55,6 +55,8 @@ struct wl_xcomposite; +QT_BEGIN_NAMESPACE + class QWaylandXCompositeGLXIntegration : public QWaylandGLIntegration { public: @@ -92,4 +94,6 @@ private: uint32_t root_window); }; +QT_END_NAMESPACE + #endif // QWAYLANDXCOMPOSITEGLXINTEGRATION_H diff --git a/src/plugins/platforms/qwayland-xcomposite-glx/qwaylandxcompositeglxwindow.cpp b/src/plugins/platforms/qwayland-xcomposite-glx/qwaylandxcompositeglxwindow.cpp index ad1916b3..1ffb5b87 100644 --- a/src/plugins/platforms/qwayland-xcomposite-glx/qwaylandxcompositeglxwindow.cpp +++ b/src/plugins/platforms/qwayland-xcomposite-glx/qwaylandxcompositeglxwindow.cpp @@ -49,6 +49,8 @@ #include <X11/extensions/Xcomposite.h> +QT_USE_NAMESPACE + QWaylandXCompositeGLXWindow::QWaylandXCompositeGLXWindow(QWindow *window, QWaylandXCompositeGLXIntegration *glxIntegration) : QWaylandWindow(window) , m_glxIntegration(glxIntegration) diff --git a/src/plugins/platforms/qwayland-xcomposite-glx/qwaylandxcompositeglxwindow.h b/src/plugins/platforms/qwayland-xcomposite-glx/qwaylandxcompositeglxwindow.h index 6c19ee49..fa16c36d 100644 --- a/src/plugins/platforms/qwayland-xcomposite-glx/qwaylandxcompositeglxwindow.h +++ b/src/plugins/platforms/qwayland-xcomposite-glx/qwaylandxcompositeglxwindow.h @@ -50,6 +50,8 @@ #include "qwaylandbuffer.h" +QT_BEGIN_NAMESPACE + class QWaylandXCompositeGLXWindow : public QWaylandWindow { public: @@ -77,4 +79,6 @@ private: static void sync_function(void *data, struct wl_callback *wl_callback, uint32_t time); }; +QT_END_NAMESPACE + #endif // QWAYLANDXCOMPOSITEGLXWINDOW_H diff --git a/src/plugins/platforms/wayland_common/qwaylandbuffer.h b/src/plugins/platforms/wayland_common/qwaylandbuffer.h index 357862c9..eee64856 100644 --- a/src/plugins/platforms/wayland_common/qwaylandbuffer.h +++ b/src/plugins/platforms/wayland_common/qwaylandbuffer.h @@ -48,6 +48,8 @@ #include <wayland-client.h> #include <wayland-client-protocol.h> +QT_BEGIN_NAMESPACE + class QWaylandBuffer { public: QWaylandBuffer() { } @@ -59,4 +61,6 @@ protected: struct wl_buffer *mBuffer; }; +QT_END_NAMESPACE + #endif // QWAYLANDBUFFER_H diff --git a/src/plugins/platforms/wayland_common/qwaylandclipboard.cpp b/src/plugins/platforms/wayland_common/qwaylandclipboard.cpp index 362584b1..31fe6045 100644 --- a/src/plugins/platforms/wayland_common/qwaylandclipboard.cpp +++ b/src/plugins/platforms/wayland_common/qwaylandclipboard.cpp @@ -46,6 +46,8 @@ #include "qwaylanddatasource.h" #include "qwaylanddatadevicemanager.h" +QT_USE_NAMESPACE + QWaylandClipboard::QWaylandClipboard(QWaylandDisplay *display) : mDisplay(display) { diff --git a/src/plugins/platforms/wayland_common/qwaylandclipboard.h b/src/plugins/platforms/wayland_common/qwaylandclipboard.h index 7cdc8474..a8f52e10 100644 --- a/src/plugins/platforms/wayland_common/qwaylandclipboard.h +++ b/src/plugins/platforms/wayland_common/qwaylandclipboard.h @@ -45,6 +45,8 @@ #include <qpa/qplatformclipboard.h> #include <QtCore/QVariant> +QT_BEGIN_NAMESPACE + class QWaylandDisplay; class QWaylandClipboard : public QPlatformClipboard @@ -64,4 +66,6 @@ private: QWaylandDisplay *mDisplay; }; +QT_END_NAMESPACE + #endif // QWAYLANDCLIPBOARD_H diff --git a/src/plugins/platforms/wayland_common/qwaylandcursor.cpp b/src/plugins/platforms/wayland_common/qwaylandcursor.cpp index 1511abcb..d4823950 100644 --- a/src/plugins/platforms/wayland_common/qwaylandcursor.cpp +++ b/src/plugins/platforms/wayland_common/qwaylandcursor.cpp @@ -51,6 +51,8 @@ #include <wayland-cursor.h> +QT_USE_NAMESPACE + QWaylandCursor::QWaylandCursor(QWaylandScreen *screen) : mDisplay(screen->display()) { diff --git a/src/plugins/platforms/wayland_common/qwaylandcursor.h b/src/plugins/platforms/wayland_common/qwaylandcursor.h index 8b4d5e37..df5dcbe3 100644 --- a/src/plugins/platforms/wayland_common/qwaylandcursor.h +++ b/src/plugins/platforms/wayland_common/qwaylandcursor.h @@ -45,6 +45,8 @@ #include <qpa/qplatformcursor.h> #include <QMap> +QT_BEGIN_NAMESPACE + class QWaylandDisplay; class QWaylandScreen; struct wl_cursor_theme; @@ -103,4 +105,6 @@ private: QMultiMap<WaylandCursor, QByteArray> mCursorNamesMap; }; +QT_END_NAMESPACE + #endif // QWAYLANDCURSOR_H diff --git a/src/plugins/platforms/wayland_common/qwaylanddatadevicemanager.cpp b/src/plugins/platforms/wayland_common/qwaylanddatadevicemanager.cpp index 0b22fb2b..d4ba6179 100644 --- a/src/plugins/platforms/wayland_common/qwaylanddatadevicemanager.cpp +++ b/src/plugins/platforms/wayland_common/qwaylanddatadevicemanager.cpp @@ -58,6 +58,8 @@ #include <QtCore/QDebug> +QT_USE_NAMESPACE + void QWaylandDataDeviceManager::data_offer(void *data, struct wl_data_device *data_device, struct wl_data_offer *id) diff --git a/src/plugins/platforms/wayland_common/qwaylanddatadevicemanager.h b/src/plugins/platforms/wayland_common/qwaylanddatadevicemanager.h index ba2015d1..101f7844 100644 --- a/src/plugins/platforms/wayland_common/qwaylanddatadevicemanager.h +++ b/src/plugins/platforms/wayland_common/qwaylanddatadevicemanager.h @@ -49,6 +49,8 @@ #include <QtCore/QStringList> #include <QtGui/QClipboard> +QT_BEGIN_NAMESPACE + class QWaylandDataOffer; class QWaylandDataSource; class QDrag; @@ -120,4 +122,6 @@ private: static const struct wl_data_device_listener transfer_device_listener; }; +QT_END_NAMESPACE + #endif // QWAYLANDDATADEVICEMANAGER_H diff --git a/src/plugins/platforms/wayland_common/qwaylanddataoffer.cpp b/src/plugins/platforms/wayland_common/qwaylanddataoffer.cpp index c04807c9..d2080ea5 100644 --- a/src/plugins/platforms/wayland_common/qwaylanddataoffer.cpp +++ b/src/plugins/platforms/wayland_common/qwaylanddataoffer.cpp @@ -47,6 +47,7 @@ #include <QtCore/QDebug> +QT_USE_NAMESPACE void QWaylandDataOffer::offer_sync_callback(void *data, struct wl_callback *callback, diff --git a/src/plugins/platforms/wayland_common/qwaylanddataoffer.h b/src/plugins/platforms/wayland_common/qwaylanddataoffer.h index 46ca3ce3..fada683a 100644 --- a/src/plugins/platforms/wayland_common/qwaylanddataoffer.h +++ b/src/plugins/platforms/wayland_common/qwaylanddataoffer.h @@ -51,9 +51,12 @@ #include <stdint.h> -class QWaylandDisplay; struct wl_callback; +QT_BEGIN_NAMESPACE + +class QWaylandDisplay; + class QWaylandDataOffer : public QInternalMimeData { public: @@ -79,4 +82,6 @@ private: static const struct wl_callback_listener offer_sync_callback_listener; }; +QT_END_NAMESPACE + #endif diff --git a/src/plugins/platforms/wayland_common/qwaylanddatasource.cpp b/src/plugins/platforms/wayland_common/qwaylanddatasource.cpp index ab3f8b59..ad280b03 100644 --- a/src/plugins/platforms/wayland_common/qwaylanddatasource.cpp +++ b/src/plugins/platforms/wayland_common/qwaylanddatasource.cpp @@ -50,6 +50,8 @@ #include <unistd.h> +QT_USE_NAMESPACE + void QWaylandDataSource::data_source_target(void *data, struct wl_data_source *wl_data_source, const char *mime_type) diff --git a/src/plugins/platforms/wayland_common/qwaylanddatasource.h b/src/plugins/platforms/wayland_common/qwaylanddatasource.h index 7baa05e3..8fdf0636 100644 --- a/src/plugins/platforms/wayland_common/qwaylanddatasource.h +++ b/src/plugins/platforms/wayland_common/qwaylanddatasource.h @@ -46,6 +46,8 @@ #include <wayland-client-protocol.h> +QT_BEGIN_NAMESPACE + class QWaylandDataSource { public: @@ -72,4 +74,6 @@ private: static const struct wl_data_source_listener data_source_listener; }; +QT_END_NAMESPACE + #endif // QWAYLANDDATASOURCE_H diff --git a/src/plugins/platforms/wayland_common/qwaylanddecoration.cpp b/src/plugins/platforms/wayland_common/qwaylanddecoration.cpp index 9fcc6a8b..a0c9534c 100644 --- a/src/plugins/platforms/wayland_common/qwaylanddecoration.cpp +++ b/src/plugins/platforms/wayland_common/qwaylanddecoration.cpp @@ -54,6 +54,8 @@ #define BUTTON_WIDTH 25 #define BUTTON_SPACING 5 +QT_USE_NAMESPACE + QWaylandDecoration::QWaylandDecoration(QWaylandWindow *window) : m_window(window->window()) , m_wayland_window(window) diff --git a/src/plugins/platforms/wayland_common/qwaylanddecoration.h b/src/plugins/platforms/wayland_common/qwaylanddecoration.h index 30a5e31f..0ad9b030 100644 --- a/src/plugins/platforms/wayland_common/qwaylanddecoration.h +++ b/src/plugins/platforms/wayland_common/qwaylanddecoration.h @@ -53,6 +53,8 @@ #include <QtCore/QDebug> +QT_BEGIN_NAMESPACE + class QWindow; class QPaintDevice; class QPainter; @@ -154,4 +156,6 @@ inline void QWaylandDecoration::overrideCursor(Qt::CursorShape shape) } } +QT_END_NAMESPACE + #endif // QWAYLANDDECORATION_H diff --git a/src/plugins/platforms/wayland_common/qwaylanddisplay.cpp b/src/plugins/platforms/wayland_common/qwaylanddisplay.cpp index 83eaee33..5b1d2e70 100644 --- a/src/plugins/platforms/wayland_common/qwaylanddisplay.cpp +++ b/src/plugins/platforms/wayland_common/qwaylanddisplay.cpp @@ -73,6 +73,8 @@ #include <QtCore/QDebug> +QT_USE_NAMESPACE + struct wl_surface *QWaylandDisplay::createSurface(void *handle) { struct wl_surface * surface = wl_compositor_create_surface(mCompositor); diff --git a/src/plugins/platforms/wayland_common/qwaylanddisplay.h b/src/plugins/platforms/wayland_common/qwaylanddisplay.h index 0e551182..de551372 100644 --- a/src/plugins/platforms/wayland_common/qwaylanddisplay.h +++ b/src/plugins/platforms/wayland_common/qwaylanddisplay.h @@ -49,6 +49,8 @@ #include <wayland-client.h> +QT_BEGIN_NAMESPACE + class QAbstractEventDispatcher; class QWaylandInputDevice; class QSocketNotifier; @@ -201,4 +203,6 @@ private: int32_t width, int32_t height); }; +QT_END_NAMESPACE + #endif // QWAYLANDDISPLAY_H diff --git a/src/plugins/platforms/wayland_common/qwaylanddnd.cpp b/src/plugins/platforms/wayland_common/qwaylanddnd.cpp index 800f4c18..790fbbd0 100644 --- a/src/plugins/platforms/wayland_common/qwaylanddnd.cpp +++ b/src/plugins/platforms/wayland_common/qwaylanddnd.cpp @@ -43,6 +43,8 @@ #include "qwaylanddatadevicemanager.h" +QT_USE_NAMESPACE + QWaylandDrag::QWaylandDrag(QWaylandDisplay *display) : m_display(display) { diff --git a/src/plugins/platforms/wayland_common/qwaylanddnd.h b/src/plugins/platforms/wayland_common/qwaylanddnd.h index d766947e..fa8f5b63 100644 --- a/src/plugins/platforms/wayland_common/qwaylanddnd.h +++ b/src/plugins/platforms/wayland_common/qwaylanddnd.h @@ -47,6 +47,8 @@ #include <QtCore/QMimeData> #include "qwaylanddisplay.h" +QT_BEGIN_NAMESPACE + class QWaylandDrag : public QPlatformDrag { public: @@ -67,4 +69,6 @@ private: QWaylandDisplay *m_display; }; +QT_END_NAMESPACE + #endif // QWAYLANDDND_H diff --git a/src/plugins/platforms/wayland_common/qwaylandextendedoutput.cpp b/src/plugins/platforms/wayland_common/qwaylandextendedoutput.cpp index 5f97a927..7b6f9f3c 100644 --- a/src/plugins/platforms/wayland_common/qwaylandextendedoutput.cpp +++ b/src/plugins/platforms/wayland_common/qwaylandextendedoutput.cpp @@ -49,6 +49,8 @@ #include <QtCore/QDebug> +QT_USE_NAMESPACE + QWaylandOutputExtension::QWaylandOutputExtension(QWaylandDisplay *display, uint32_t id) { m_output_extension = static_cast<struct wl_output_extension *>( diff --git a/src/plugins/platforms/wayland_common/qwaylandextendedoutput.h b/src/plugins/platforms/wayland_common/qwaylandextendedoutput.h index bbf4e060..780f5702 100644 --- a/src/plugins/platforms/wayland_common/qwaylandextendedoutput.h +++ b/src/plugins/platforms/wayland_common/qwaylandextendedoutput.h @@ -44,6 +44,8 @@ #include "qwaylanddisplay.h" +QT_BEGIN_NAMESPACE + class QWaylandExtendedOutput; class QWaylandOutputExtension @@ -75,5 +77,6 @@ private: static const struct wl_extended_output_listener extended_output_listener; }; +QT_END_NAMESPACE #endif // QWAYLANDEXTENDEDOUTPUT_H diff --git a/src/plugins/platforms/wayland_common/qwaylandextendedsurface.cpp b/src/plugins/platforms/wayland_common/qwaylandextendedsurface.cpp index 0f30fcf2..82b294b0 100644 --- a/src/plugins/platforms/wayland_common/qwaylandextendedsurface.cpp +++ b/src/plugins/platforms/wayland_common/qwaylandextendedsurface.cpp @@ -54,6 +54,8 @@ #include <qpa/qplatformnativeinterface.h> #include <qpa/qwindowsysteminterface.h> +QT_USE_NAMESPACE + QWaylandSurfaceExtension::QWaylandSurfaceExtension(QWaylandDisplay *display, uint32_t id) { m_surface_extension = static_cast<struct wl_surface_extension *>( diff --git a/src/plugins/platforms/wayland_common/qwaylandextendedsurface.h b/src/plugins/platforms/wayland_common/qwaylandextendedsurface.h index 9588dfbb..940d9ab7 100644 --- a/src/plugins/platforms/wayland_common/qwaylandextendedsurface.h +++ b/src/plugins/platforms/wayland_common/qwaylandextendedsurface.h @@ -47,6 +47,8 @@ #include <wayland-client.h> +QT_BEGIN_NAMESPACE + class QWaylandDisplay; class QWaylandWindow; class QWaylandExtendedSurface; @@ -97,4 +99,6 @@ private: bool m_exposed; }; +QT_END_NAMESPACE + #endif // QWAYLANDEXTENDEDSURFACE_H diff --git a/src/plugins/platforms/wayland_common/qwaylandglintegration.cpp b/src/plugins/platforms/wayland_common/qwaylandglintegration.cpp index b106f5e0..a4b3331c 100644 --- a/src/plugins/platforms/wayland_common/qwaylandglintegration.cpp +++ b/src/plugins/platforms/wayland_common/qwaylandglintegration.cpp @@ -41,6 +41,8 @@ #include "qwaylandglintegration.h" +QT_USE_NAMESPACE + QWaylandGLIntegration::QWaylandGLIntegration() { diff --git a/src/plugins/platforms/wayland_common/qwaylandglintegration.h b/src/plugins/platforms/wayland_common/qwaylandglintegration.h index c015ee1f..4055790b 100644 --- a/src/plugins/platforms/wayland_common/qwaylandglintegration.h +++ b/src/plugins/platforms/wayland_common/qwaylandglintegration.h @@ -42,6 +42,10 @@ #ifndef QWAYLANDGLINTEGRATION_H #define QWAYLANDGLINTEGRATION_H +#include <QtCore/qglobal.h> + +QT_BEGIN_NAMESPACE + class QWaylandWindow; class QWaylandDisplay; class QWindow; @@ -66,4 +70,6 @@ public: static QWaylandGLIntegration *createGLIntegration(QWaylandDisplay *waylandDisplay); }; +QT_END_NAMESPACE + #endif // QWAYLANDGLINTEGRATION_H diff --git a/src/plugins/platforms/wayland_common/qwaylandinputdevice.cpp b/src/plugins/platforms/wayland_common/qwaylandinputdevice.cpp index aaef268e..9820854d 100644 --- a/src/plugins/platforms/wayland_common/qwaylandinputdevice.cpp +++ b/src/plugins/platforms/wayland_common/qwaylandinputdevice.cpp @@ -63,6 +63,8 @@ #include <X11/keysym.h> #endif +QT_USE_NAMESPACE + QWaylandInputDevice::QWaylandInputDevice(QWaylandDisplay *display, uint32_t id) : mQDisplay(display) , mDisplay(display->wl_display()) diff --git a/src/plugins/platforms/wayland_common/qwaylandintegration.cpp b/src/plugins/platforms/wayland_common/qwaylandintegration.cpp index b35f0c49..7aaef546 100644 --- a/src/plugins/platforms/wayland_common/qwaylandintegration.cpp +++ b/src/plugins/platforms/wayland_common/qwaylandintegration.cpp @@ -71,6 +71,8 @@ #include "windowmanager_integration/qwaylandwindowmanagerintegration.h" #endif +QT_USE_NAMESPACE + QWaylandIntegration::QWaylandIntegration() : mFontDb(new QGenericUnixFontDatabase()) , mEventDispatcher(createUnixEventDispatcher()) diff --git a/src/plugins/platforms/wayland_common/qwaylandnativeinterface.cpp b/src/plugins/platforms/wayland_common/qwaylandnativeinterface.cpp index 3cce9603..b49114e6 100644 --- a/src/plugins/platforms/wayland_common/qwaylandnativeinterface.cpp +++ b/src/plugins/platforms/wayland_common/qwaylandnativeinterface.cpp @@ -50,6 +50,8 @@ #include "windowmanager_integration/qwaylandwindowmanagerintegration.h" +QT_USE_NAMESPACE + QWaylandNativeInterface::QWaylandNativeInterface(QWaylandIntegration *integration) : m_integration(integration) { diff --git a/src/plugins/platforms/wayland_common/qwaylandnativeinterface.h b/src/plugins/platforms/wayland_common/qwaylandnativeinterface.h index 26372ad3..60411508 100644 --- a/src/plugins/platforms/wayland_common/qwaylandnativeinterface.h +++ b/src/plugins/platforms/wayland_common/qwaylandnativeinterface.h @@ -46,6 +46,8 @@ #include <QVariantMap> #include <qpa/qplatformnativeinterface.h> +QT_BEGIN_NAMESPACE + class QWaylandIntegration; class QWaylandNativeInterface : public QPlatformNativeInterface @@ -70,5 +72,6 @@ private: QHash<QPlatformWindow*, QVariantMap> m_windowProperties; }; +QT_END_NAMESPACE #endif // QWAYLANDNATIVEINTERFACE_H diff --git a/src/plugins/platforms/wayland_common/qwaylandqtkey.cpp b/src/plugins/platforms/wayland_common/qwaylandqtkey.cpp index a6fe2f52..76d91c79 100644 --- a/src/plugins/platforms/wayland_common/qwaylandqtkey.cpp +++ b/src/plugins/platforms/wayland_common/qwaylandqtkey.cpp @@ -44,6 +44,8 @@ #include "wayland-qtkey-extension-client-protocol.h" +QT_USE_NAMESPACE + QWaylandQtKeyExtension::QWaylandQtKeyExtension(QWaylandDisplay *display, uint32_t id) : m_display(display) { diff --git a/src/plugins/platforms/wayland_common/qwaylandqtkey.h b/src/plugins/platforms/wayland_common/qwaylandqtkey.h index 8f6dbd29..adcce613 100644 --- a/src/plugins/platforms/wayland_common/qwaylandqtkey.h +++ b/src/plugins/platforms/wayland_common/qwaylandqtkey.h @@ -46,6 +46,9 @@ #include <qpa/qwindowsysteminterface.h> class wl_qtkey_extension; + +QT_BEGIN_NAMESPACE + class QWaylandQtKeyExtension { public: @@ -71,4 +74,6 @@ private: uint32_t count); }; +QT_END_NAMESPACE + #endif // QWAYLANDQTKEY_H diff --git a/src/plugins/platforms/wayland_common/qwaylandscreen.cpp b/src/plugins/platforms/wayland_common/qwaylandscreen.cpp index 8689c712..3e706557 100644 --- a/src/plugins/platforms/wayland_common/qwaylandscreen.cpp +++ b/src/plugins/platforms/wayland_common/qwaylandscreen.cpp @@ -47,6 +47,8 @@ #include <qpa/qwindowsysteminterface.h> +QT_USE_NAMESPACE + QWaylandScreen::QWaylandScreen(QWaylandDisplay *waylandDisplay, struct wl_output *output) : QPlatformScreen() , mWaylandDisplay(waylandDisplay) diff --git a/src/plugins/platforms/wayland_common/qwaylandscreen.h b/src/plugins/platforms/wayland_common/qwaylandscreen.h index 28be6e8b..3d4b2948 100644 --- a/src/plugins/platforms/wayland_common/qwaylandscreen.h +++ b/src/plugins/platforms/wayland_common/qwaylandscreen.h @@ -44,6 +44,8 @@ #include <qpa/qplatformscreen.h> +QT_BEGIN_NAMESPACE + class QWaylandDisplay; class QWaylandCursor; class QWaylandExtendedOutput; @@ -91,4 +93,6 @@ private: QWaylandCursor *mWaylandCursor; }; +QT_END_NAMESPACE + #endif // QWAYLANDSCREEN_H diff --git a/src/plugins/platforms/wayland_common/qwaylandshell.cpp b/src/plugins/platforms/wayland_common/qwaylandshell.cpp index c82bf9ba..9c37235c 100644 --- a/src/plugins/platforms/wayland_common/qwaylandshell.cpp +++ b/src/plugins/platforms/wayland_common/qwaylandshell.cpp @@ -44,6 +44,8 @@ #include "qwaylandshellsurface.h" #include "qwaylandwindow.h" +QT_USE_NAMESPACE + QWaylandShell::QWaylandShell(QWaylandDisplay *display, uint32_t id, uint32_t version) : m_display(display) { diff --git a/src/plugins/platforms/wayland_common/qwaylandshell.h b/src/plugins/platforms/wayland_common/qwaylandshell.h index 16d0a08c..3c2014f6 100644 --- a/src/plugins/platforms/wayland_common/qwaylandshell.h +++ b/src/plugins/platforms/wayland_common/qwaylandshell.h @@ -44,6 +44,8 @@ #include "qwaylanddisplay.h" +QT_BEGIN_NAMESPACE + class QWaylandWindow; class QWaylandShellSurface; @@ -60,4 +62,6 @@ private: QWaylandDisplay *m_display; }; +QT_END_NAMESPACE + #endif // QWAYLANDSHELL_H diff --git a/src/plugins/platforms/wayland_common/qwaylandshellsurface.cpp b/src/plugins/platforms/wayland_common/qwaylandshellsurface.cpp index 53a44721..2d1442b4 100644 --- a/src/plugins/platforms/wayland_common/qwaylandshellsurface.cpp +++ b/src/plugins/platforms/wayland_common/qwaylandshellsurface.cpp @@ -49,6 +49,8 @@ #include <QtCore/QDebug> +QT_USE_NAMESPACE + QWaylandShellSurface::QWaylandShellSurface(struct wl_shell_surface *shell_surface, QWaylandWindow *window) : m_shell_surface(shell_surface) , m_window(window) diff --git a/src/plugins/platforms/wayland_common/qwaylandshellsurface.h b/src/plugins/platforms/wayland_common/qwaylandshellsurface.h index 8357ec24..0b88741c 100644 --- a/src/plugins/platforms/wayland_common/qwaylandshellsurface.h +++ b/src/plugins/platforms/wayland_common/qwaylandshellsurface.h @@ -46,6 +46,8 @@ #include <wayland-client.h> +QT_BEGIN_NAMESPACE + class QWaylandWindow; class QWaylandInputDevice; class QWindow; @@ -91,4 +93,6 @@ private: static const struct wl_shell_surface_listener m_shell_surface_listener; }; +QT_END_NAMESPACE + #endif // QWAYLANDSHELLSURFACE_H diff --git a/src/plugins/platforms/wayland_common/qwaylandshmdecoration.cpp b/src/plugins/platforms/wayland_common/qwaylandshmdecoration.cpp index 6c937309..24c05def 100644 --- a/src/plugins/platforms/wayland_common/qwaylandshmdecoration.cpp +++ b/src/plugins/platforms/wayland_common/qwaylandshmdecoration.cpp @@ -44,6 +44,8 @@ #include "qwaylandshmwindow.h" #include "qwaylandshmbackingstore.h" +QT_USE_NAMESPACE + QWaylandShmDecoration::QWaylandShmDecoration(QWaylandShmWindow *window) : QWaylandDecoration(window) { diff --git a/src/plugins/platforms/wayland_common/qwaylandshmdecoration.h b/src/plugins/platforms/wayland_common/qwaylandshmdecoration.h index 4ff0da3d..567e8755 100644 --- a/src/plugins/platforms/wayland_common/qwaylandshmdecoration.h +++ b/src/plugins/platforms/wayland_common/qwaylandshmdecoration.h @@ -44,6 +44,8 @@ #include "qwaylanddecoration.h" +QT_BEGIN_NAMESPACE + class QWaylandShmWindow; class QWaylandShmDecoration : public QWaylandDecoration @@ -56,4 +58,6 @@ public: }; +QT_END_NAMESPACE + #endif // QWAYLANDSHMDECORATION_H diff --git a/src/plugins/platforms/wayland_common/qwaylandshmwindow.cpp b/src/plugins/platforms/wayland_common/qwaylandshmwindow.cpp index b7ec9d28..ad2fd9a2 100644 --- a/src/plugins/platforms/wayland_common/qwaylandshmwindow.cpp +++ b/src/plugins/platforms/wayland_common/qwaylandshmwindow.cpp @@ -48,6 +48,8 @@ #include <QtCore/QDebug> +QT_USE_NAMESPACE + QWaylandShmWindow::QWaylandShmWindow(QWindow *window) : QWaylandWindow(window) , mBackingStore(0) diff --git a/src/plugins/platforms/wayland_common/qwaylandshmwindow.h b/src/plugins/platforms/wayland_common/qwaylandshmwindow.h index ef5e5db0..f28e1d50 100644 --- a/src/plugins/platforms/wayland_common/qwaylandshmwindow.h +++ b/src/plugins/platforms/wayland_common/qwaylandshmwindow.h @@ -45,6 +45,8 @@ #include "qwaylandwindow.h" #include <QtGui/QRegion> +QT_BEGIN_NAMESPACE + class QWaylandShmBackingStore; class QWaylandShmWindow : public QWaylandWindow @@ -71,4 +73,6 @@ inline QWaylandShmBackingStore *QWaylandShmWindow::backingStore() const return mBackingStore; } +QT_END_NAMESPACE + #endif // QWAYLANDSHMWINDOW_H diff --git a/src/plugins/platforms/wayland_common/qwaylandsubsurface.cpp b/src/plugins/platforms/wayland_common/qwaylandsubsurface.cpp index b92bddc9..0ec955a8 100644 --- a/src/plugins/platforms/wayland_common/qwaylandsubsurface.cpp +++ b/src/plugins/platforms/wayland_common/qwaylandsubsurface.cpp @@ -47,6 +47,8 @@ #include <QtCore/QDebug> +QT_USE_NAMESPACE + QWaylandSubSurfaceExtension::QWaylandSubSurfaceExtension(QWaylandDisplay *display, uint32_t id) { m_sub_surface_extension = static_cast<struct wl_sub_surface_extension *>( diff --git a/src/plugins/platforms/wayland_common/qwaylandsubsurface.h b/src/plugins/platforms/wayland_common/qwaylandsubsurface.h index 939b9392..e594050e 100644 --- a/src/plugins/platforms/wayland_common/qwaylandsubsurface.h +++ b/src/plugins/platforms/wayland_common/qwaylandsubsurface.h @@ -42,12 +42,16 @@ #ifndef QWAYLANDSUBSURFACE_H #define QWAYLANDSUBSURFACE_H +#include <wayland-client.h> + +#include <QtCore/qglobal.h> + +QT_BEGIN_NAMESPACE + class QWaylandDisplay; class QWaylandWindow; class QWaylandSubSurface; -#include <wayland-client.h> - class QWaylandSubSurfaceExtension { public: @@ -72,4 +76,6 @@ private: struct wl_sub_surface *m_sub_surface; }; +QT_END_NAMESPACE + #endif // QWAYLANDSUBSURFACE_H diff --git a/src/plugins/platforms/wayland_common/qwaylandtouch.cpp b/src/plugins/platforms/wayland_common/qwaylandtouch.cpp index 0c158730..26f57d57 100644 --- a/src/plugins/platforms/wayland_common/qwaylandtouch.cpp +++ b/src/plugins/platforms/wayland_common/qwaylandtouch.cpp @@ -44,6 +44,8 @@ #include "wayland-touch-extension-client-protocol.h" +QT_USE_NAMESPACE + QWaylandTouchExtension::QWaylandTouchExtension(QWaylandDisplay *display, uint32_t id) : mDisplay(display), mTouchDevice(0), diff --git a/src/plugins/platforms/wayland_common/qwaylandtouch.h b/src/plugins/platforms/wayland_common/qwaylandtouch.h index 919bfe87..9762af22 100644 --- a/src/plugins/platforms/wayland_common/qwaylandtouch.h +++ b/src/plugins/platforms/wayland_common/qwaylandtouch.h @@ -47,6 +47,8 @@ class wl_touch_extension; +QT_BEGIN_NAMESPACE + class QWaylandTouchExtension { public: @@ -96,4 +98,6 @@ private: QWaylandInputDevice *mInputDevice; }; +QT_END_NAMESPACE + #endif // QWAYLANDTOUCH_H diff --git a/src/plugins/platforms/wayland_common/qwaylandwindow.cpp b/src/plugins/platforms/wayland_common/qwaylandwindow.cpp index dc95aa93..be962ebf 100644 --- a/src/plugins/platforms/wayland_common/qwaylandwindow.cpp +++ b/src/plugins/platforms/wayland_common/qwaylandwindow.cpp @@ -63,6 +63,8 @@ #include <QtCore/QDebug> +QT_USE_NAMESPACE + QWaylandWindow::QWaylandWindow(QWindow *window) : QPlatformWindow(window) , mDisplay(QWaylandScreen::waylandScreenFromWindow(window)->display()) diff --git a/src/plugins/platforms/wayland_common/qwaylandwindow.h b/src/plugins/platforms/wayland_common/qwaylandwindow.h index a58e49db..39d2dcc6 100644 --- a/src/plugins/platforms/wayland_common/qwaylandwindow.h +++ b/src/plugins/platforms/wayland_common/qwaylandwindow.h @@ -49,6 +49,10 @@ #include "qwaylanddisplay.h" +struct wl_egl_window; + +QT_BEGIN_NAMESPACE + class QWaylandDisplay; class QWaylandBuffer; class QWaylandShellSurface; @@ -56,8 +60,6 @@ class QWaylandExtendedSurface; class QWaylandSubSurface; class QWaylandDecoration; -struct wl_egl_window; - class QWaylandWindow : public QPlatformWindow { public: @@ -171,5 +173,6 @@ inline QPoint QWaylandWindow::attachOffset() const return mOffset; } +QT_END_NAMESPACE #endif // QWAYLANDWINDOW_H diff --git a/src/plugins/platforms/wayland_common/windowmanager_integration/qwaylandwindowmanagerintegration.cpp b/src/plugins/platforms/wayland_common/windowmanager_integration/qwaylandwindowmanagerintegration.cpp index ba26b79a..68a7fdfa 100644 --- a/src/plugins/platforms/wayland_common/windowmanager_integration/qwaylandwindowmanagerintegration.cpp +++ b/src/plugins/platforms/wayland_common/windowmanager_integration/qwaylandwindowmanagerintegration.cpp @@ -55,6 +55,8 @@ #include <QDebug> +QT_USE_NAMESPACE + class QWaylandWindowManagerIntegrationPrivate { public: QWaylandWindowManagerIntegrationPrivate(QWaylandDisplay *waylandDisplay); diff --git a/src/plugins/platforms/wayland_common/windowmanager_integration/qwaylandwindowmanagerintegration.h b/src/plugins/platforms/wayland_common/windowmanager_integration/qwaylandwindowmanagerintegration.h index 2e1661cc..9145401d 100644 --- a/src/plugins/platforms/wayland_common/windowmanager_integration/qwaylandwindowmanagerintegration.h +++ b/src/plugins/platforms/wayland_common/windowmanager_integration/qwaylandwindowmanagerintegration.h @@ -49,6 +49,8 @@ #include "qwaylanddisplay.h" #include <qpa/qplatformservices.h> +QT_BEGIN_NAMESPACE + class QWaylandWindow; class QWaylandWindowManagerIntegrationPrivate; @@ -90,4 +92,6 @@ private: void openUrl_helper(const QUrl &url); }; +QT_END_NAMESPACE + #endif // QWAYLANDWINDOWMANAGERINTEGRATION_H diff --git a/src/plugins/platforms/xcomposite_share/qwaylandxcompositebuffer.cpp b/src/plugins/platforms/xcomposite_share/qwaylandxcompositebuffer.cpp index e14b6f53..55fe3fbe 100644 --- a/src/plugins/platforms/xcomposite_share/qwaylandxcompositebuffer.cpp +++ b/src/plugins/platforms/xcomposite_share/qwaylandxcompositebuffer.cpp @@ -44,6 +44,8 @@ #include "wayland-client.h" #include "wayland-xcomposite-client-protocol.h" +QT_USE_NAMESPACE + QWaylandXCompositeBuffer::QWaylandXCompositeBuffer(wl_xcomposite *xcomposite, uint32_t window, const QSize &size) :mSize(size) { diff --git a/src/plugins/platforms/xcomposite_share/qwaylandxcompositebuffer.h b/src/plugins/platforms/xcomposite_share/qwaylandxcompositebuffer.h index 5a0133d9..d621fa47 100644 --- a/src/plugins/platforms/xcomposite_share/qwaylandxcompositebuffer.h +++ b/src/plugins/platforms/xcomposite_share/qwaylandxcompositebuffer.h @@ -48,6 +48,8 @@ struct wl_xcomposite; struct wl_visual; +QT_BEGIN_NAMESPACE + class QWaylandXCompositeBuffer : public QWaylandBuffer { public: @@ -60,4 +62,6 @@ private: QSize mSize; }; +QT_END_NAMESPACE + #endif // QWAYLANDXCOMPOSITEBUFFER_H diff --git a/src/plugins/waylandcompositors/brcm-egl/brcm-egl.pro b/src/plugins/waylandcompositors/brcm-egl/brcm-egl.pro index 58568224..c397c613 100644 --- a/src/plugins/waylandcompositors/brcm-egl/brcm-egl.pro +++ b/src/plugins/waylandcompositors/brcm-egl/brcm-egl.pro @@ -1,7 +1,7 @@ PLUGIN_TYPE = waylandcompositors load(qt_plugin) -QT = compositor core-private gui-private +QT = compositor compositor-private core-private gui-private OTHER_FILES += wayland_egl.json diff --git a/src/plugins/waylandcompositors/brcm-egl/brcmbuffer.cpp b/src/plugins/waylandcompositors/brcm-egl/brcmbuffer.cpp index c9a71172..7f5c3893 100644 --- a/src/plugins/waylandcompositors/brcm-egl/brcmbuffer.cpp +++ b/src/plugins/waylandcompositors/brcm-egl/brcmbuffer.cpp @@ -45,7 +45,9 @@ #define EGL_EGLEXT_PROTOTYPES #include <EGL/eglext_brcm.h> -BrcmBuffer::BrcmBuffer(Wayland::Compositor *compositor, const QSize &size, EGLint *data, size_t count) +QT_USE_NAMESPACE + +BrcmBuffer::BrcmBuffer(QtWayland::Compositor *compositor, const QSize &size, EGLint *data, size_t count) : m_invertedY(false) , m_handle(count) { diff --git a/src/plugins/waylandcompositors/brcm-egl/brcmbuffer.h b/src/plugins/waylandcompositors/brcm-egl/brcmbuffer.h index a06469da..11f49d4a 100644 --- a/src/plugins/waylandcompositors/brcm-egl/brcmbuffer.h +++ b/src/plugins/waylandcompositors/brcm-egl/brcmbuffer.h @@ -41,18 +41,20 @@ #ifndef BRCMBUFFER_H #define BRCMBUFFER_H -#include "waylandobject.h" -#include <QtCompositor/wlcompositor.h> +#include <QtCompositor/qwaylandobject.h> +#include <QtCompositor/private/qwlcompositor_p.h> #include <QtCore/QSize> #include <QtCore/QVector> #include <EGL/egl.h> -class BrcmBuffer : public Wayland::Object<struct wl_buffer> +QT_BEGIN_NAMESPACE + +class BrcmBuffer : public QtWayland::Object<struct wl_buffer> { public: - BrcmBuffer(Wayland::Compositor *compositor, const QSize &size, EGLint *data, size_t count); + BrcmBuffer(QtWayland::Compositor *compositor, const QSize &size, EGLint *data, size_t count); ~BrcmBuffer(); static struct wl_buffer_interface buffer_interface; @@ -71,4 +73,6 @@ private: bool m_invertedY; }; +QT_END_NAMESPACE + #endif // BRCMBUFFER_H diff --git a/src/plugins/waylandcompositors/brcm-egl/brcmeglintegration.cpp b/src/plugins/waylandcompositors/brcm-egl/brcmeglintegration.cpp index 14699f8a..b2f26f02 100644 --- a/src/plugins/waylandcompositors/brcm-egl/brcmeglintegration.cpp +++ b/src/plugins/waylandcompositors/brcm-egl/brcmeglintegration.cpp @@ -40,8 +40,8 @@ #include "brcmeglintegration.h" #include "brcmbuffer.h" -#include <QtCompositor/wlsurface.h> -#include <QtCompositor/wlcompositor.h> +#include <QtCompositor/private/qwlsurface_p.h> +#include <QtCompositor/private/qwlcompositor_p.h> #include <QtCompositor/waylandsurface.h> #include <qpa/qplatformnativeinterface.h> #include <QtGui/QGuiApplication> @@ -60,7 +60,9 @@ #include "wayland-brcm-server-protocol.h" -GraphicsHardwareIntegration * GraphicsHardwareIntegration::createGraphicsHardwareIntegration(WaylandCompositor *compositor) +QT_USE_NAMESPACE + +QWaylandGraphicsHardwareIntegration * QWaylandGraphicsHardwareIntegration::createGraphicsHardwareIntegration(QWaylandCompositor *compositor) { return new BrcmEglIntegration(compositor); } @@ -81,12 +83,12 @@ public: }; BrcmEglIntegration::BrcmEglIntegration() - : GraphicsHardwareIntegration() + : QWaylandGraphicsHardwareIntegration() , d_ptr(new BrcmEglIntegrationPrivate) { } -void BrcmEglIntegration::initializeHardware(Wayland::Display *waylandDisplay) +void BrcmEglIntegration::initializeHardware(QtWayland::Display *waylandDisplay) { Q_D(BrcmEglIntegration); @@ -137,7 +139,7 @@ GLuint BrcmEglIntegration::createTextureFromBuffer(wl_buffer *buffer, QOpenGLCon return 0; } - BrcmBuffer *brcmBuffer = Wayland::wayland_cast<BrcmBuffer>(buffer); + BrcmBuffer *brcmBuffer = QtWayland::wayland_cast<BrcmBuffer>(buffer); if (!d->eglQueryGlobalImageBRCM(brcmBuffer->handle(), brcmBuffer->handle() + 2)) { qWarning("eglQueryGlobalImageBRCM failed!"); diff --git a/src/plugins/waylandcompositors/brcm-egl/brcmeglintegration.h b/src/plugins/waylandcompositors/brcm-egl/brcmeglintegration.h index 3fde839d..8ed7f07a 100644 --- a/src/plugins/waylandcompositors/brcm-egl/brcmeglintegration.h +++ b/src/plugins/waylandcompositors/brcm-egl/brcmeglintegration.h @@ -41,18 +41,20 @@ #ifndef BRCMEGLINTEGRATION_H #define BRCMEGLINTEGRATION_H -#include <QtCompositor/graphicshardwareintegration.h> +#include <QtCompositor/qwaylandgraphicshardwareintegration.h> #include <QtCore/QScopedPointer> +QT_BEGIN_NAMESPACE + class BrcmEglIntegrationPrivate; -class BrcmEglIntegration : public GraphicsHardwareIntegration +class BrcmEglIntegration : public QWaylandGraphicsHardwareIntegration { Q_DECLARE_PRIVATE(BrcmEglIntegration) public: BrcmEglIntegration(); - void initializeHardware(Wayland::Display *waylandDisplay); + void initializeHardware(QtWayland::Display *waylandDisplay); GLuint createTextureFromBuffer(wl_buffer *buffer, QOpenGLContext *context); bool isYInverted(struct wl_buffer *) const; @@ -71,5 +73,7 @@ private: QScopedPointer<BrcmEglIntegrationPrivate> d_ptr; }; +QT_END_NAMESPACE + #endif // BRCMEGLINTEGRATION_H diff --git a/src/plugins/waylandcompositors/brcm-egl/main.cpp b/src/plugins/waylandcompositors/brcm-egl/main.cpp index d742a2ee..0fecd2ec 100644 --- a/src/plugins/waylandcompositors/brcm-egl/main.cpp +++ b/src/plugins/waylandcompositors/brcm-egl/main.cpp @@ -39,16 +39,18 @@ ** ****************************************************************************/ -#include <QtCompositor/graphicshardwareintegrationplugin.h> +#include <QtCompositor/qwaylandgraphicshardwareintegrationplugin.h> #include "brcmeglintegration.h" -class QWaylandIntegrationPlugin : public GraphicsHardwareIntegrationPlugin +QT_BEGIN_NAMESPACE + +class QWaylandIntegrationPlugin : public QWaylandGraphicsHardwareIntegrationPlugin { Q_OBJECT - Q_PLUGIN_METADATA(IID "org.qt-project.Qt.Compositor.GraphicsHardwareIntegrationFactoryInterface.5.1" FILE "brcm-egl.json") + Q_PLUGIN_METADATA(IID "org.qt-project.Qt.Compositor.QWaylandGraphicsHardwareIntegrationFactoryInterface.5.1" FILE "brcm-egl.json") public: QStringList keys() const; - GraphicsHardwareIntegration *create(const QString&, const QStringList&); + QWaylandGraphicsHardwareIntegration *create(const QString&, const QStringList&); }; QStringList QWaylandIntegrationPlugin::keys() const @@ -58,7 +60,7 @@ QStringList QWaylandIntegrationPlugin::keys() const return list; } -GraphicsHardwareIntegration *QWaylandIntegrationPlugin::create(const QString& system, const QStringList& paramList) +QWaylandGraphicsHardwareIntegration *QWaylandIntegrationPlugin::create(const QString& system, const QStringList& paramList) { Q_UNUSED(paramList); if (system.toLower() == "wayland-brcm") @@ -67,4 +69,6 @@ GraphicsHardwareIntegration *QWaylandIntegrationPlugin::create(const QString& sy return 0; } +QT_END_NAMESPACE + #include "main.moc" diff --git a/src/plugins/waylandcompositors/wayland-egl/main.cpp b/src/plugins/waylandcompositors/wayland-egl/main.cpp index ee546dad..75a9fba2 100644 --- a/src/plugins/waylandcompositors/wayland-egl/main.cpp +++ b/src/plugins/waylandcompositors/wayland-egl/main.cpp @@ -39,16 +39,18 @@ ** ****************************************************************************/ -#include <QtCompositor/graphicshardwareintegrationplugin.h> +#include <QtCompositor/qwaylandgraphicshardwareintegrationplugin.h> #include "waylandeglintegration.h" -class QWaylandIntegrationPlugin : public GraphicsHardwareIntegrationPlugin +QT_BEGIN_NAMESPACE + +class QWaylandIntegrationPlugin : public QWaylandGraphicsHardwareIntegrationPlugin { Q_OBJECT - Q_PLUGIN_METADATA(IID "org.qt-project.Qt.Compositor.GraphicsHardwareIntegrationFactoryInterface.5.1" FILE "wayland-egl.json") + Q_PLUGIN_METADATA(IID "org.qt-project.Qt.Compositor.QWaylandGraphicsHardwareIntegrationFactoryInterface.5.1" FILE "wayland-egl.json") public: QStringList keys() const; - GraphicsHardwareIntegration *create(const QString&, const QStringList&); + QWaylandGraphicsHardwareIntegration *create(const QString&, const QStringList&); }; QStringList QWaylandIntegrationPlugin::keys() const @@ -58,7 +60,7 @@ QStringList QWaylandIntegrationPlugin::keys() const return list; } -GraphicsHardwareIntegration *QWaylandIntegrationPlugin::create(const QString& system, const QStringList& paramList) +QWaylandGraphicsHardwareIntegration *QWaylandIntegrationPlugin::create(const QString& system, const QStringList& paramList) { Q_UNUSED(paramList); if (system.toLower() == "wayland-egl") @@ -67,4 +69,6 @@ GraphicsHardwareIntegration *QWaylandIntegrationPlugin::create(const QString& sy return 0; } +QT_END_NAMESPACE + #include "main.moc" diff --git a/src/plugins/waylandcompositors/wayland-egl/wayland-egl.pro b/src/plugins/waylandcompositors/wayland-egl/wayland-egl.pro index 991bacee..cc980be3 100644 --- a/src/plugins/waylandcompositors/wayland-egl/wayland-egl.pro +++ b/src/plugins/waylandcompositors/wayland-egl/wayland-egl.pro @@ -1,7 +1,7 @@ PLUGIN_TYPE = waylandcompositors load(qt_plugin) -QT = compositor core-private gui-private +QT = compositor compositor-private core-private gui-private OTHER_FILES += wayland-egl.json diff --git a/src/plugins/waylandcompositors/wayland-egl/waylandeglintegration.cpp b/src/plugins/waylandcompositors/wayland-egl/waylandeglintegration.cpp index 728776bb..2a923cef 100644 --- a/src/plugins/waylandcompositors/wayland-egl/waylandeglintegration.cpp +++ b/src/plugins/waylandcompositors/wayland-egl/waylandeglintegration.cpp @@ -40,8 +40,8 @@ #include "waylandeglintegration.h" -#include <QtCompositor/wlcompositor.h> -#include <QtCompositor/wlsurface.h> +#include <QtCompositor/private/qwlcompositor_p.h> +#include <QtCompositor/private/qwlsurface_p.h> #include <qpa/qplatformnativeinterface.h> #include <QtGui/QGuiApplication> #include <QtGui/QOpenGLContext> @@ -72,6 +72,8 @@ typedef void (GL_APIENTRYP PFNGLEGLIMAGETARGETTEXTURE2DOESPROC) (GLenum target, typedef void (GL_APIENTRYP PFNGLEGLIMAGETARGETRENDERBUFFERSTORAGEOESPROC) (GLenum target, GLeglImageOES image); #endif +QT_USE_NAMESPACE + class WaylandEglIntegrationPrivate { public: @@ -103,12 +105,12 @@ public: }; WaylandEglIntegration::WaylandEglIntegration() - : GraphicsHardwareIntegration() + : QWaylandGraphicsHardwareIntegration() , d_ptr(new WaylandEglIntegrationPrivate) { } -void WaylandEglIntegration::initializeHardware(Wayland::Display *waylandDisplay) +void WaylandEglIntegration::initializeHardware(QtWayland::Display *waylandDisplay) { Q_D(WaylandEglIntegration); @@ -189,12 +191,12 @@ bool WaylandEglIntegration::isYInverted(struct wl_buffer *buffer) const #ifdef EGL_WL_request_client_buffer_format return eglGetBufferYInvertedWL(buffer); #else - return GraphicsHardwareIntegration::isYInverted(buffer); + return QWaylandGraphicsHardwareIntegration::isYInverted(buffer); #endif } -bool WaylandEglIntegration::setDirectRenderSurface(WaylandSurface *surface) +bool WaylandEglIntegration::setDirectRenderSurface(QWaylandSurface *surface) { Q_D(WaylandEglIntegration); diff --git a/src/plugins/waylandcompositors/wayland-egl/waylandeglintegration.h b/src/plugins/waylandcompositors/wayland-egl/waylandeglintegration.h index de5529e2..c22ff315 100644 --- a/src/plugins/waylandcompositors/wayland-egl/waylandeglintegration.h +++ b/src/plugins/waylandcompositors/wayland-egl/waylandeglintegration.h @@ -41,23 +41,25 @@ #ifndef WAYLANDEGLINTEGRATION_H #define WAYLANDEGLINTEGRATION_H -#include <QtCompositor/graphicshardwareintegration.h> +#include <QtCompositor/qwaylandgraphicshardwareintegration.h> #include <QtCore/QScopedPointer> +QT_BEGIN_NAMESPACE + class WaylandEglIntegrationPrivate; -class WaylandEglIntegration : public GraphicsHardwareIntegration +class WaylandEglIntegration : public QWaylandGraphicsHardwareIntegration { Q_DECLARE_PRIVATE(WaylandEglIntegration) public: WaylandEglIntegration(); - void initializeHardware(Wayland::Display *waylandDisplay); + void initializeHardware(QtWayland::Display *waylandDisplay); GLuint createTextureFromBuffer(wl_buffer *buffer, QOpenGLContext *context); bool isYInverted(struct wl_buffer *) const; - bool setDirectRenderSurface(WaylandSurface *); + bool setDirectRenderSurface(QWaylandSurface *); virtual void *lockNativeBuffer(struct wl_buffer *buffer, QOpenGLContext *context) const; virtual void unlockNativeBuffer(void *native_buffer, QOpenGLContext *context) const; @@ -67,5 +69,7 @@ private: QScopedPointer<WaylandEglIntegrationPrivate> d_ptr; }; +QT_END_NAMESPACE + #endif // WAYLANDEGLINTEGRATION_H diff --git a/src/plugins/waylandcompositors/xcomposite-egl/main.cpp b/src/plugins/waylandcompositors/xcomposite-egl/main.cpp index 6a913e27..3540d351 100644 --- a/src/plugins/waylandcompositors/xcomposite-egl/main.cpp +++ b/src/plugins/waylandcompositors/xcomposite-egl/main.cpp @@ -39,16 +39,18 @@ ** ****************************************************************************/ -#include <QtCompositor/graphicshardwareintegrationplugin.h> +#include <QtCompositor/qwaylandgraphicshardwareintegrationplugin.h> #include "xcompositeeglintegration.h" -class QWaylandIntegrationPlugin : public GraphicsHardwareIntegrationPlugin +QT_BEGIN_NAMESPACE + +class QWaylandIntegrationPlugin : public QWaylandGraphicsHardwareIntegrationPlugin { Q_OBJECT - Q_PLUGIN_METADATA(IID "org.qt-project.Qt.Compositor.GraphicsHardwareIntegrationFactoryInterface.5.1" FILE "xcomposite-egl.json") + Q_PLUGIN_METADATA(IID "org.qt-project.Qt.Compositor.QWaylandGraphicsHardwareIntegrationFactoryInterface.5.1" FILE "xcomposite-egl.json") public: QStringList keys() const; - GraphicsHardwareIntegration *create(const QString&, const QStringList&); + QWaylandGraphicsHardwareIntegration *create(const QString&, const QStringList&); }; QStringList QWaylandIntegrationPlugin::keys() const @@ -58,7 +60,7 @@ QStringList QWaylandIntegrationPlugin::keys() const return list; } -GraphicsHardwareIntegration *QWaylandIntegrationPlugin::create(const QString& system, const QStringList& paramList) +QWaylandGraphicsHardwareIntegration *QWaylandIntegrationPlugin::create(const QString& system, const QStringList& paramList) { Q_UNUSED(paramList); if (system.toLower() == "wayland-xcomposite") @@ -67,4 +69,6 @@ GraphicsHardwareIntegration *QWaylandIntegrationPlugin::create(const QString& sy return 0; } +QT_END_NAMESPACE + #include "main.moc" diff --git a/src/plugins/waylandcompositors/xcomposite-egl/xcomposite-egl.pro b/src/plugins/waylandcompositors/xcomposite-egl/xcomposite-egl.pro index e42d37a3..d463e6e8 100644 --- a/src/plugins/waylandcompositors/xcomposite-egl/xcomposite-egl.pro +++ b/src/plugins/waylandcompositors/xcomposite-egl/xcomposite-egl.pro @@ -1,7 +1,7 @@ PLUGIN_TYPE = waylandcompositors load(qt_plugin) -QT = compositor core-private gui-private +QT = compositor compositor-private core-private gui-private OTHER_FILES += xcomposite-egl.json diff --git a/src/plugins/waylandcompositors/xcomposite-egl/xcompositeeglintegration.cpp b/src/plugins/waylandcompositors/xcomposite-egl/xcompositeeglintegration.cpp index e403cc8e..0c291bb1 100644 --- a/src/plugins/waylandcompositors/xcomposite-egl/xcompositeeglintegration.cpp +++ b/src/plugins/waylandcompositors/xcomposite-egl/xcompositeeglintegration.cpp @@ -40,10 +40,10 @@ #include "xcompositeeglintegration.h" -#include "waylandobject.h" +#include <QtCompositor/qwaylandobject.h> #include "wayland-xcomposite-server-protocol.h" -#include <QtCompositor/wlcompositor.h> +#include <QtCompositor/private/qwlcompositor_p.h> #include <QtGui/QGuiApplication> #include <qpa/qplatformnativeinterface.h> #include <qpa/qplatformopenglcontext.h> @@ -54,6 +54,8 @@ #include <QtCore/QDebug> +QT_USE_NAMESPACE + QVector<EGLint> eglbuildSpec() { QVector<EGLint> spec; @@ -72,13 +74,13 @@ struct wl_xcomposite_interface XCompositeHandler::xcomposite_interface = { }; XCompositeEglIntegration::XCompositeEglIntegration() - : GraphicsHardwareIntegration() + : QWaylandGraphicsHardwareIntegration() , mDisplay(0) { } -void XCompositeEglIntegration::initializeHardware(Wayland::Display *waylandDisplay) +void XCompositeEglIntegration::initializeHardware(QtWayland::Display *waylandDisplay) { QPlatformNativeInterface *nativeInterface = QGuiApplication::platformNativeInterface(); if (nativeInterface) { @@ -98,7 +100,7 @@ void XCompositeEglIntegration::initializeHardware(Wayland::Display *waylandDispl GLuint XCompositeEglIntegration::createTextureFromBuffer(wl_buffer *buffer, QOpenGLContext *) { - XCompositeBuffer *compositorBuffer = Wayland::wayland_cast<XCompositeBuffer>(buffer); + XCompositeBuffer *compositorBuffer = QtWayland::wayland_cast<XCompositeBuffer>(buffer); Pixmap pixmap = XCompositeNameWindowPixmap(mDisplay, compositorBuffer->window()); QVector<EGLint> eglConfigSpec = eglbuildSpec(); @@ -141,6 +143,6 @@ GLuint XCompositeEglIntegration::createTextureFromBuffer(wl_buffer *buffer, QOpe bool XCompositeEglIntegration::isYInverted(wl_buffer *buffer) const { - XCompositeBuffer *compositorBuffer = Wayland::wayland_cast<XCompositeBuffer>(buffer); + XCompositeBuffer *compositorBuffer = QtWayland::wayland_cast<XCompositeBuffer>(buffer); return compositorBuffer->isYInverted(); } diff --git a/src/plugins/waylandcompositors/xcomposite-egl/xcompositeeglintegration.h b/src/plugins/waylandcompositors/xcomposite-egl/xcompositeeglintegration.h index 7bcbfc73..7a9ac449 100644 --- a/src/plugins/waylandcompositors/xcomposite-egl/xcompositeeglintegration.h +++ b/src/plugins/waylandcompositors/xcomposite-egl/xcompositeeglintegration.h @@ -41,18 +41,20 @@ #ifndef XCOMPOSITEEGLINTEGRATION_H #define XCOMPOSITEEGLINTEGRATION_H -#include <QtCompositor/graphicshardwareintegration.h> +#include <QtCompositor/qwaylandgraphicshardwareintegration.h> #include "xlibinclude.h" #include <EGL/egl.h> -class XCompositeEglIntegration : public GraphicsHardwareIntegration +QT_BEGIN_NAMESPACE + +class XCompositeEglIntegration : public QWaylandGraphicsHardwareIntegration { public: XCompositeEglIntegration(); - void initializeHardware(Wayland::Display *waylandDisplay); + void initializeHardware(QtWayland::Display *waylandDisplay); GLuint createTextureFromBuffer(struct wl_buffer *buffer, QOpenGLContext *context); bool isYInverted(wl_buffer *) const; @@ -63,4 +65,6 @@ private: int mScreen; }; +QT_END_NAMESPACE + #endif // XCOMPOSITEEGLINTEGRATION_H diff --git a/src/plugins/waylandcompositors/xcomposite-glx/main.cpp b/src/plugins/waylandcompositors/xcomposite-glx/main.cpp index dfd72716..fdc7037e 100644 --- a/src/plugins/waylandcompositors/xcomposite-glx/main.cpp +++ b/src/plugins/waylandcompositors/xcomposite-glx/main.cpp @@ -39,16 +39,18 @@ ** ****************************************************************************/ -#include <QtCompositor/graphicshardwareintegrationplugin.h> +#include <QtCompositor/qwaylandgraphicshardwareintegrationplugin.h> #include "xcompositeglxintegration.h" -class QWaylandIntegrationPlugin : public GraphicsHardwareIntegrationPlugin +QT_BEGIN_NAMESPACE + +class QWaylandIntegrationPlugin : public QWaylandGraphicsHardwareIntegrationPlugin { Q_OBJECT - Q_PLUGIN_METADATA(IID "org.qt-project.Qt.Compositor.GraphicsHardwareIntegrationFactoryInterface.5.1" FILE "xcomposite-glx.json") + Q_PLUGIN_METADATA(IID "org.qt-project.Qt.Compositor.QWaylandGraphicsHardwareIntegrationFactoryInterface.5.1" FILE "xcomposite-glx.json") public: QStringList keys() const; - GraphicsHardwareIntegration *create(const QString&, const QStringList&); + QWaylandGraphicsHardwareIntegration *create(const QString&, const QStringList&); }; QStringList QWaylandIntegrationPlugin::keys() const @@ -58,7 +60,7 @@ QStringList QWaylandIntegrationPlugin::keys() const return list; } -GraphicsHardwareIntegration *QWaylandIntegrationPlugin::create(const QString& system, const QStringList& paramList) +QWaylandGraphicsHardwareIntegration *QWaylandIntegrationPlugin::create(const QString& system, const QStringList& paramList) { Q_UNUSED(paramList); if (system.toLower() == "wayland-xcomposite") @@ -67,4 +69,6 @@ GraphicsHardwareIntegration *QWaylandIntegrationPlugin::create(const QString& sy return 0; } +QT_END_NAMESPACE + #include "main.moc" diff --git a/src/plugins/waylandcompositors/xcomposite-glx/xcomposite-glx.pro b/src/plugins/waylandcompositors/xcomposite-glx/xcomposite-glx.pro index c14a9f63..dc2d70de 100644 --- a/src/plugins/waylandcompositors/xcomposite-glx/xcomposite-glx.pro +++ b/src/plugins/waylandcompositors/xcomposite-glx/xcomposite-glx.pro @@ -1,7 +1,7 @@ PLUGIN_TYPE = waylandcompositors load(qt_plugin) -QT = compositor core-private gui-private +QT = compositor compositor-private core-private gui-private OTHER_FILES += xcomposite-glx.json diff --git a/src/plugins/waylandcompositors/xcomposite-glx/xcompositeglxintegration.cpp b/src/plugins/waylandcompositors/xcomposite-glx/xcompositeglxintegration.cpp index c6cc8a56..1ad8aa97 100644 --- a/src/plugins/waylandcompositors/xcomposite-glx/xcompositeglxintegration.cpp +++ b/src/plugins/waylandcompositors/xcomposite-glx/xcompositeglxintegration.cpp @@ -40,8 +40,8 @@ #include "xcompositeglxintegration.h" -#include "waylandobject.h" -#include <QtCompositor/wlcompositor.h> +#include <QtCompositor/qwaylandobject.h> +#include <QtCompositor/private/qwlcompositor_p.h> #include "wayland-xcomposite-server-protocol.h" #include <qpa/qplatformnativeinterface.h> @@ -54,6 +54,8 @@ #include <QtCore/QDebug> +QT_USE_NAMESPACE + QVector<int> qglx_buildSpec() { QVector<int> spec(48); @@ -75,7 +77,7 @@ struct wl_xcomposite_interface XCompositeHandler::xcomposite_interface = { }; XCompositeGLXIntegration::XCompositeGLXIntegration() - : GraphicsHardwareIntegration() + : QWaylandGraphicsHardwareIntegration() , mDisplay(0) , mHandler(0) { @@ -86,7 +88,7 @@ XCompositeGLXIntegration::~XCompositeGLXIntegration() delete mHandler; } -void XCompositeGLXIntegration::initializeHardware(Wayland::Display *waylandDisplay) +void XCompositeGLXIntegration::initializeHardware(QtWayland::Display *waylandDisplay) { QPlatformNativeInterface *nativeInterface = QGuiApplicationPrivate::platformIntegration()->nativeInterface(); if (nativeInterface) { @@ -118,7 +120,7 @@ void XCompositeGLXIntegration::initializeHardware(Wayland::Display *waylandDispl GLuint XCompositeGLXIntegration::createTextureFromBuffer(wl_buffer *buffer, QOpenGLContext *) { - XCompositeBuffer *compositorBuffer = Wayland::wayland_cast<XCompositeBuffer>(buffer); + XCompositeBuffer *compositorBuffer = QtWayland::wayland_cast<XCompositeBuffer>(buffer); Pixmap pixmap = XCompositeNameWindowPixmap(mDisplay, compositorBuffer->window()); QVector<int> glxConfigSpec = qglx_buildSpec(); @@ -151,6 +153,6 @@ GLuint XCompositeGLXIntegration::createTextureFromBuffer(wl_buffer *buffer, QOpe bool XCompositeGLXIntegration::isYInverted(wl_buffer *buffer) const { - XCompositeBuffer *compositorBuffer = Wayland::wayland_cast<XCompositeBuffer>(buffer); + XCompositeBuffer *compositorBuffer = QtWayland::wayland_cast<XCompositeBuffer>(buffer); return compositorBuffer->isYInverted(); } diff --git a/src/plugins/waylandcompositors/xcomposite-glx/xcompositeglxintegration.h b/src/plugins/waylandcompositors/xcomposite-glx/xcompositeglxintegration.h index c17e1ac9..8e4db393 100644 --- a/src/plugins/waylandcompositors/xcomposite-glx/xcompositeglxintegration.h +++ b/src/plugins/waylandcompositors/xcomposite-glx/xcompositeglxintegration.h @@ -41,7 +41,7 @@ #ifndef XCOMPOSITEGLXINTEGRATION_H #define XCOMPOSITEGLXINTEGRATION_H -#include <QtCompositor/graphicshardwareintegration.h> +#include <QtCompositor/qwaylandgraphicshardwareintegration.h> #include "xlibinclude.h" @@ -49,15 +49,17 @@ #include <GL/glx.h> #include <GL/glxext.h> +QT_BEGIN_NAMESPACE + class XCompositeHandler; -class XCompositeGLXIntegration : public GraphicsHardwareIntegration +class XCompositeGLXIntegration : public QWaylandGraphicsHardwareIntegration { public: XCompositeGLXIntegration(); ~XCompositeGLXIntegration(); - void initializeHardware(Wayland::Display *waylandDisplay); + void initializeHardware(QtWayland::Display *waylandDisplay); GLuint createTextureFromBuffer(struct wl_buffer *buffer, QOpenGLContext *context); bool isYInverted(wl_buffer *) const; @@ -71,4 +73,6 @@ private: XCompositeHandler *mHandler; }; +QT_END_NAMESPACE + #endif // XCOMPOSITEGLXINTEGRATION_H diff --git a/src/plugins/waylandcompositors/xcomposite_share/xcompositebuffer.cpp b/src/plugins/waylandcompositors/xcomposite_share/xcompositebuffer.cpp index 9e6c4e64..4644cf29 100644 --- a/src/plugins/waylandcompositors/xcomposite_share/xcompositebuffer.cpp +++ b/src/plugins/waylandcompositors/xcomposite_share/xcompositebuffer.cpp @@ -40,7 +40,9 @@ #include "xcompositebuffer.h" -XCompositeBuffer::XCompositeBuffer(Wayland::Compositor *compositor, Window window, const QSize &size) +QT_USE_NAMESPACE + +XCompositeBuffer::XCompositeBuffer(QtWayland::Compositor *compositor, Window window, const QSize &size) : mWindow(window) , mInvertedY(false) { diff --git a/src/plugins/waylandcompositors/xcomposite_share/xcompositebuffer.h b/src/plugins/waylandcompositors/xcomposite_share/xcompositebuffer.h index bc04ca0c..bbcfe2bd 100644 --- a/src/plugins/waylandcompositors/xcomposite_share/xcompositebuffer.h +++ b/src/plugins/waylandcompositors/xcomposite_share/xcompositebuffer.h @@ -41,8 +41,8 @@ #ifndef XCOMPOSITEBUFFER_H #define XCOMPOSITEBUFFER_H -#include "waylandobject.h" -#include <QtCompositor/wlcompositor.h> +#include <QtCompositor/qwaylandobject.h> +#include <private/qwlcompositor_p.h> #include <QtCore/QSize> @@ -53,10 +53,12 @@ #include <X11/X.h> -class XCompositeBuffer : public Wayland::Object<struct wl_buffer> +QT_BEGIN_NAMESPACE + +class XCompositeBuffer : public QtWayland::Object<struct wl_buffer> { public: - XCompositeBuffer(Wayland::Compositor *compositor, Window window, const QSize &size); + XCompositeBuffer(QtWayland::Compositor *compositor, Window window, const QSize &size); Window window(); @@ -73,4 +75,6 @@ private: struct wl_resource *buffer); }; +QT_END_NAMESPACE + #endif // XCOMPOSITORBUFFER_H diff --git a/src/plugins/waylandcompositors/xcomposite_share/xcompositehandler.cpp b/src/plugins/waylandcompositors/xcomposite_share/xcompositehandler.cpp index 7bb63e2b..73196315 100644 --- a/src/plugins/waylandcompositors/xcomposite_share/xcompositehandler.cpp +++ b/src/plugins/waylandcompositors/xcomposite_share/xcompositehandler.cpp @@ -45,7 +45,9 @@ #include "xcompositebuffer.h" #include <X11/extensions/Xcomposite.h> -XCompositeHandler::XCompositeHandler(Wayland::Compositor *compositor, Display *display, QWindow *window) +QT_USE_NAMESPACE + +XCompositeHandler::XCompositeHandler(QtWayland::Compositor *compositor, Display *display, QWindow *window) : mCompositor(compositor) , mwindow(window) , mDisplay(display) diff --git a/src/plugins/waylandcompositors/xcomposite_share/xcompositehandler.h b/src/plugins/waylandcompositors/xcomposite_share/xcompositehandler.h index 59f7ab1b..e85f3565 100644 --- a/src/plugins/waylandcompositors/xcomposite_share/xcompositehandler.h +++ b/src/plugins/waylandcompositors/xcomposite_share/xcompositehandler.h @@ -41,22 +41,24 @@ #ifndef XCOMPOSITEHANDLER_H #define XCOMPOSITEHANDLER_H -#include <QtCompositor/wlcompositor.h> -#include "waylandobject.h" +#include <QtCompositor/private/qwlcompositor_p.h> +#include <QtCompositor/qwaylandobject.h> #include "xlibinclude.h" -class XCompositeHandler : public Wayland::Object<struct wl_object> +QT_BEGIN_NAMESPACE + +class XCompositeHandler : public QtWayland::Object<struct wl_object> { public: - XCompositeHandler(Wayland::Compositor *compositor, Display *display, QWindow *window); + XCompositeHandler(QtWayland::Compositor *compositor, Display *display, QWindow *window); void createBuffer(struct wl_client *client, uint32_t id, Window window, const QSize &size); static void xcomposite_bind_func(struct wl_client *client, void *data, uint32_t version, uint32_t id); static struct wl_xcomposite_interface xcomposite_interface; private: - Wayland::Compositor *mCompositor; + QtWayland::Compositor *mCompositor; QWindow *mwindow; QWindow *mFakeRootWindow; Display *mDisplay; @@ -70,4 +72,6 @@ private: }; +QT_END_NAMESPACE + #endif // XCOMPOSITEHANDLER_H diff --git a/src/shared/qwaylandmimehelper.cpp b/src/shared/qwaylandmimehelper.cpp index ccc48ef2..d7e51144 100644 --- a/src/shared/qwaylandmimehelper.cpp +++ b/src/shared/qwaylandmimehelper.cpp @@ -46,6 +46,8 @@ #include <QBuffer> #include <QImageWriter> +QT_USE_NAMESPACE + QByteArray QWaylandMimeHelper::getByteArray(QMimeData *mimeData, const QString &mimeType) { QByteArray content; diff --git a/src/shared/qwaylandmimehelper.h b/src/shared/qwaylandmimehelper.h index f31685cd..539fc3ad 100644 --- a/src/shared/qwaylandmimehelper.h +++ b/src/shared/qwaylandmimehelper.h @@ -46,10 +46,14 @@ #include <QByteArray> #include <QMimeData> +QT_BEGIN_NAMESPACE + class QWaylandMimeHelper { public: static QByteArray getByteArray(QMimeData *mimeData, const QString &mimeType); }; +QT_END_NAMESPACE + #endif diff --git a/tests/auto/compositor/testcompositor.cpp b/tests/auto/compositor/testcompositor.cpp index c5758753..aa15a6ab 100644 --- a/tests/auto/compositor/testcompositor.cpp +++ b/tests/auto/compositor/testcompositor.cpp @@ -41,12 +41,12 @@ #include "testcompositor.h" -void TestCompositor::surfaceCreated(WaylandSurface *surface) +void TestCompositor::surfaceCreated(QWaylandSurface *surface) { surfaces << surface; } -void TestCompositor::surfaceAboutToBeDestroyed(WaylandSurface *surface) +void TestCompositor::surfaceAboutToBeDestroyed(QWaylandSurface *surface) { surfaces.removeOne(surface); } diff --git a/tests/auto/compositor/testcompositor.h b/tests/auto/compositor/testcompositor.h index 785024cd..4cb77aab 100644 --- a/tests/auto/compositor/testcompositor.h +++ b/tests/auto/compositor/testcompositor.h @@ -39,15 +39,15 @@ ** ****************************************************************************/ -#include "waylandcompositor.h" -#include "waylandsurface.h" +#include "qwaylandcompositor.h" +#include "qwaylandsurface.h" -class TestCompositor : public WaylandCompositor +class TestCompositor : public QWaylandCompositor { public: - void surfaceCreated(WaylandSurface *surface); - void surfaceAboutToBeDestroyed(WaylandSurface *surface); + void surfaceCreated(QWaylandSurface *surface); + void surfaceAboutToBeDestroyed(QWaylandSurface *surface); - QList<WaylandSurface *> surfaces; + QList<QWaylandSurface *> surfaces; }; diff --git a/tests/auto/compositor/tst_compositor.cpp b/tests/auto/compositor/tst_compositor.cpp index 65dd6e23..8656338e 100644 --- a/tests/auto/compositor/tst_compositor.cpp +++ b/tests/auto/compositor/tst_compositor.cpp @@ -78,7 +78,7 @@ void tst_WaylandCompositor::singleClient() QCOMPARE(ca, cb); - QList<WaylandSurface *> surfaces = compositor.surfacesForClient(ca); + QList<QWaylandSurface *> surfaces = compositor.surfacesForClient(ca); QCOMPARE(surfaces.size(), 2); QVERIFY((surfaces.at(0) == compositor.surfaces.at(0) && surfaces.at(1) == compositor.surfaces.at(1)) || (surfaces.at(0) == compositor.surfaces.at(1) && surfaces.at(1) == compositor.surfaces.at(0))); @@ -149,12 +149,12 @@ void tst_WaylandCompositor::mapSurface() wl_surface *surface = client.createSurface(); QTRY_COMPARE(compositor.surfaces.size(), 1); - WaylandSurface *waylandSurface = compositor.surfaces.at(0); + QWaylandSurface *waylandSurface = compositor.surfaces.at(0); QSignalSpy mappedSpy(waylandSurface, SIGNAL(mapped())); QCOMPARE(waylandSurface->size(), QSize()); - QCOMPARE(waylandSurface->type(), WaylandSurface::Invalid); + QCOMPARE(waylandSurface->type(), QWaylandSurface::Invalid); QSize size(256, 256); ShmBuffer buffer(size, client.shm); @@ -163,7 +163,7 @@ void tst_WaylandCompositor::mapSurface() wl_surface_damage(surface, 0, 0, size.width(), size.height()); QTRY_COMPARE(waylandSurface->size(), size); - QTRY_COMPARE(waylandSurface->type(), WaylandSurface::Shm); + QTRY_COMPARE(waylandSurface->type(), QWaylandSurface::Shm); QTRY_COMPARE(mappedSpy.count(), 1); wl_surface_destroy(surface); @@ -199,14 +199,14 @@ void tst_WaylandCompositor::frameCallback() int frameCounter = 0; QTRY_COMPARE(compositor.surfaces.size(), 1); - WaylandSurface *waylandSurface = compositor.surfaces.at(0); + QWaylandSurface *waylandSurface = compositor.surfaces.at(0); QSignalSpy damagedSpy(waylandSurface, SIGNAL(damaged(const QRect &))); for (int i = 0; i < 10; ++i) { registerFrameCallback(surface, &frameCounter); wl_surface_damage(surface, 0, 0, size.width(), size.height()); - QTRY_COMPARE(waylandSurface->type(), WaylandSurface::Shm); + QTRY_COMPARE(waylandSurface->type(), QWaylandSurface::Shm); QTRY_COMPARE(damagedSpy.count(), i + 1); QCOMPARE(waylandSurface->image(), buffer.image); |