1 #ifndef QWINDOWCOMPOSITOR_H
2 #define QWINDOWCOMPOSITOR_H
4 #include "waylandcompositor.h"
5 #include "waylandsurface.h"
6 #include "textureblitter.h"
7 #include "qopenglwindow.h"
9 #include <QtGui/private/qopengltexturecache_p.h>
11 #include <QOpenGLFunctions>
13 class QWindowCompositor : public QObject, public WaylandCompositor, protected QOpenGLFunctions
17 QWindowCompositor(QOpenGLWindow *window);
19 void surfaceDestroyed(QObject *object);
21 void surfaceDamaged(const QRect &rect);
25 void surfaceDamaged(WaylandSurface *surface, const QRect &rect);
26 void surfaceCreated(WaylandSurface *surface);
28 WaylandSurface* surfaceAt(const QPoint &point, QPoint *local = 0);
30 GLuint composeSurface(WaylandSurface *surface);
31 void paintChildren(WaylandSurface *surface, WaylandSurface *window);
34 bool eventFilter(QObject *obj, QEvent *event);
35 QPointF toSurface(WaylandSurface *surface, const QPointF &pos) const;
37 void changeCursor(const QImage &image, int hotspotX, int hotspotY);
40 QOpenGLWindow *m_window;
41 QImage m_backgroundImage;
42 GLuint m_backgroundTexture;
43 QList<WaylandSurface *> m_surfaces;
44 TextureBlitter *m_textureBlitter;
45 QOpenGLTextureCache *m_textureCache;
47 QTimer m_renderScheduler;
49 //Dragging windows around
50 WaylandSurface *m_draggingWindow;
51 bool m_dragKeyIsPressed;
56 #endif // QWINDOWCOMPOSITOR_H