summaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
authorAndy Nichols <andy.nichols@digia.com>2013-02-05 12:22:17 +0100
committerAndy Nichols <andy.nichols@digia.com>2013-02-08 12:34:56 +0100
commit1b39d072c2601d39354fe83dff8b1e5c05095aaf (patch)
tree4b38960a1bcef0de376dc5441ec6372e41341801 /examples
parent2e0efd201aa75121f4dd4049598f4d120811d784 (diff)
Qt-ify the QtCompositor module
Currently the QtCompositor library and API do not follow the Qt API naming conventions. This commit intends to fix these inconsistencies. filenames start with q headers containing private API's end in _p public API classes begin with Q use the qt namespace macros where necessary Wayland namespace is now QtWayland wayland_wrapper classes are now private API's It's important to make these changes not just for stylistic reasons, but also because when qmake builds the module in checks for these conventions to determine how to deploy the include files. Change-Id: I8bfadeceda92a0f52cb73c704551da75540e7587 Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com>
Diffstat (limited to 'examples')
-rw-r--r--examples/qml-compositor/main.cpp34
-rw-r--r--examples/qwidget-compositor/main.cpp56
-rw-r--r--examples/qwindow-compositor/qwindowcompositor.cpp62
-rw-r--r--examples/qwindow-compositor/qwindowcompositor.h28
4 files changed, 90 insertions, 90 deletions
diff --git a/examples/qml-compositor/main.cpp b/examples/qml-compositor/main.cpp
index fdaf4657c..d481a2522 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 12160a909..0c115166c 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 4b543eab6..09522ae20 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 6f2c8d3d2..7ad2faf60 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;