Merge branch 'refactor'
[profile/ivi/qtwayland.git] / examples / qwindow-compositor / qwindowcompositor.h
1 #ifndef QWINDOWCOMPOSITOR_H
2 #define QWINDOWCOMPOSITOR_H
3
4 #include "waylandcompositor.h"
5 #include "waylandsurface.h"
6 #include "surfacerenderer.h"
7 #include "qopenglwindow.h"
8
9 #include <QObject>
10
11 class QWindowCompositor : public QObject, public WaylandCompositor
12 {
13     Q_OBJECT
14 public:
15     QWindowCompositor(QOpenGLWindow *window);
16 private slots:
17     void surfaceDestroyed(QObject *object);
18     void surfaceMapped(const QSize &size);
19     void surfaceDamaged(const QRect &rect);
20
21 protected:
22     void surfaceDamaged(WaylandSurface *surface, const QRect &rect);
23     void surfaceCreated(WaylandSurface *surface);
24
25     WaylandSurface* surfaceAt(const QPoint &point, QPoint *local = 0);
26
27     void render();
28
29 private:
30     QOpenGLWindow *m_window;
31     QImage m_backgroundImage;
32     GLuint m_backgroundTexture;
33     QList<WaylandSurface *> m_surfaces;
34     SurfaceRenderer *m_renderer;
35 };
36
37 #endif // QWINDOWCOMPOSITOR_H