summaryrefslogtreecommitdiffstats
path: root/examples/wayland/minimal-cpp/compositor.h
diff options
context:
space:
mode:
authorPaul Olav Tvete <paul.tvete@qt.io>2018-03-01 15:12:02 +0100
committerPaul Olav Tvete <paul.tvete@qt.io>2018-03-21 11:36:00 +0000
commitd29cbc2a0604f1b9a35f480a63a2472ca9e54661 (patch)
tree6469dc2d16802345b6ac733130bbdba73726ec29 /examples/wayland/minimal-cpp/compositor.h
parent942958a870dd01ebe1f4b03b70d7dda1ed9f67ab (diff)
Make the minimal-cpp example a real compositor
Use the ivi-application protocol, since a compositor without a shell is not really a proper compositor. Use the IVI id to determine the position instead of generating a random position for each frame. Change-Id: I2ede824c656e4c2ef88117cf0f0b8d27ad80b6e2 Reviewed-by: Johan Helsing <johan.helsing@qt.io>
Diffstat (limited to 'examples/wayland/minimal-cpp/compositor.h')
-rw-r--r--examples/wayland/minimal-cpp/compositor.h10
1 files changed, 7 insertions, 3 deletions
diff --git a/examples/wayland/minimal-cpp/compositor.h b/examples/wayland/minimal-cpp/compositor.h
index 984deebdb..e804ac02f 100644
--- a/examples/wayland/minimal-cpp/compositor.h
+++ b/examples/wayland/minimal-cpp/compositor.h
@@ -59,17 +59,20 @@ QT_BEGIN_NAMESPACE
class Window;
class QOpenGLTexture;
+class QWaylandIviApplication;
+class QWaylandIviSurface;
class View : public QWaylandView
{
Q_OBJECT
public:
- View() {}
+ View(int iviId) : m_iviId(iviId) {}
QOpenGLTexture *getTexture();
- bool isCursor() const;
+ int iviId() const { return m_iviId; }
private:
friend class Compositor;
QOpenGLTexture *m_texture = nullptr;
+ int m_iviId;
};
class Compositor : public QWaylandCompositor
@@ -86,13 +89,14 @@ public:
void endRender();
private slots:
- void onSurfaceCreated(QWaylandSurface *surface);
+ void onIviSurfaceCreated(QWaylandIviSurface *iviSurface);
void onSurfaceDestroyed();
void triggerRender();
void viewSurfaceDestroyed();
private:
Window *m_window = nullptr;
+ QWaylandIviApplication *m_iviApplication = nullptr;
QList<View*> m_views;
};