summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/eglfs/qeglfsscreen.h
diff options
context:
space:
mode:
authorLaszlo Agocs <laszlo.agocs@digia.com>2014-01-06 14:51:37 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-01-17 14:30:48 +0100
commit328f2f9c35f3cc5e7049a060a608c3f72876484a (patch)
tree984f0f52446b95da5d7240122dcfbec02b0933b5 /src/plugins/platforms/eglfs/qeglfsscreen.h
parent93154216ca7c7a46836716150fe70987d28d6f3c (diff)
eglfs: Move reusable functionality to eglconvenience
The cursor implementation is generic GL(ES) code that should be shared by all the present and future egl-based embedded platform plugins. Follow the pattern of QEGLPlatformContext and move this class into eglconvenience as QEGLPlatformCursor. Similarly, the common bits from the context implementation context are moved back to EGLPlatformContext. eglconvenience has now base classes for integration, screen, window, etc. too. By using these, eglfs becomes much smaller and cleaner. This also paves the way for creating new, separate EGL-based platform plugins for Android, embedded Linux, etc. Also added some documentation to each of the base classes. devicediscovery is now fixed to be usable on any platform. The implementation in this case is naturally a dummy one. This finally allows using it from anywhere without myriads of ugly ifdefs. Change-Id: I02946e360c04e02de7fe234a23a08320eff4ccf5 Reviewed-by: Jørgen Lind <jorgen.lind@digia.com>
Diffstat (limited to 'src/plugins/platforms/eglfs/qeglfsscreen.h')
-rw-r--r--src/plugins/platforms/eglfs/qeglfsscreen.h40
1 files changed, 18 insertions, 22 deletions
diff --git a/src/plugins/platforms/eglfs/qeglfsscreen.h b/src/plugins/platforms/eglfs/qeglfsscreen.h
index 11d66b7e0f..13f7cfddd8 100644
--- a/src/plugins/platforms/eglfs/qeglfsscreen.h
+++ b/src/plugins/platforms/eglfs/qeglfsscreen.h
@@ -42,7 +42,7 @@
#ifndef QEGLFSSCREEN_H
#define QEGLFSSCREEN_H
-#include <qpa/qplatformscreen.h>
+#include <QtPlatformSupport/private/qeglplatformscreen_p.h>
#include <QtCore/QTextStream>
@@ -50,52 +50,48 @@
QT_BEGIN_NAMESPACE
-class QEglFSCursor;
+class QEGLPlatformCursor;
class QEglFSWindow;
class QOpenGLContext;
-class QEglFSScreen : public QPlatformScreen
+class QEglFSScreen : public QEGLPlatformScreen
{
public:
QEglFSScreen(EGLDisplay display);
~QEglFSScreen();
- QRect geometry() const;
- int depth() const;
- QImage::Format format() const;
+ QRect geometry() const Q_DECL_OVERRIDE;
+ int depth() const Q_DECL_OVERRIDE;
+ QImage::Format format() const Q_DECL_OVERRIDE;
- QSizeF physicalSize() const;
- QDpi logicalDpi() const;
- Qt::ScreenOrientation nativeOrientation() const;
- Qt::ScreenOrientation orientation() const;
+ QSizeF physicalSize() const Q_DECL_OVERRIDE;
+ QDpi logicalDpi() const Q_DECL_OVERRIDE;
+ Qt::ScreenOrientation nativeOrientation() const Q_DECL_OVERRIDE;
+ Qt::ScreenOrientation orientation() const Q_DECL_OVERRIDE;
- QPlatformCursor *cursor() const;
+ QPlatformCursor *cursor() const Q_DECL_OVERRIDE;
- EGLDisplay display() const { return m_dpy; }
EGLSurface primarySurface() const { return m_surface; }
- QList<QEglFSWindow *> windows() const { return m_windows; }
- void addWindow(QEglFSWindow *window);
- void removeWindow(QEglFSWindow *window);
- void moveToTop(QEglFSWindow *window);
- void changeWindowIndex(QEglFSWindow *window, int newIdx);
- QEglFSWindow *rootWindow();
- QOpenGLContext *rootContext() { return m_rootContext; }
+ QEGLPlatformWindow *compositingWindow() Q_DECL_OVERRIDE { return m_rootWindow; }
+ QOpenGLContext *compositingContext() Q_DECL_OVERRIDE { return m_rootContext; }
+
+ void setRootWindow(QEGLPlatformWindow *window) { m_rootWindow = window; }
void setRootContext(QOpenGLContext *context) { m_rootContext = context; }
protected:
void setPrimarySurface(EGLSurface surface);
- virtual void topWindowChanged(QPlatformWindow *window);
private:
friend class QEglFSWindow;
EGLDisplay m_dpy;
EGLSurface m_surface;
- QEglFSCursor *m_cursor;
- QList<QEglFSWindow *> m_windows;
+ QEGLPlatformCursor *m_cursor;
+ QEGLPlatformWindow *m_rootWindow;
QOpenGLContext *m_rootContext;
};
QT_END_NAMESPACE
+
#endif // QEGLFSSCREEN_H