summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/eglfs
diff options
context:
space:
mode:
authorPaul Olav Tvete <paul.tvete@digia.com>2013-09-13 13:11:45 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-09-20 12:02:58 +0200
commit74d2249e37ba8cdefba8d90345a620dc6adfa411 (patch)
tree99252bce8f4d058b6a03b9af2c6a5a9f4e432030 /src/plugins/platforms/eglfs
parentdd6b053b6c40feeca845b89af08d026d8d487426 (diff)
Android: handle inverted orientations
Add logic to detect InvertedPortrait and InvertedLandscape orientations and implement QPlatformScreen::nativeOrientation() for Android. Task-number: QTBUG-32144 Change-Id: I294506714ea0faa9eacd7a15e1cfc45342659964 Reviewed-by: BogDan Vatra <bogdan@kde.org>
Diffstat (limited to 'src/plugins/platforms/eglfs')
-rw-r--r--src/plugins/platforms/eglfs/qeglfshooks.h2
-rw-r--r--src/plugins/platforms/eglfs/qeglfshooks_stub.cpp10
-rw-r--r--src/plugins/platforms/eglfs/qeglfsscreen.cpp9
-rw-r--r--src/plugins/platforms/eglfs/qeglfsscreen.h2
4 files changed, 23 insertions, 0 deletions
diff --git a/src/plugins/platforms/eglfs/qeglfshooks.h b/src/plugins/platforms/eglfs/qeglfshooks.h
index 461ffa0f25..1cd1380994 100644
--- a/src/plugins/platforms/eglfs/qeglfshooks.h
+++ b/src/plugins/platforms/eglfs/qeglfshooks.h
@@ -63,6 +63,8 @@ public:
virtual QSizeF physicalScreenSize() const;
virtual QSize screenSize() const;
virtual QDpi logicalDpi() const;
+ virtual Qt::ScreenOrientation nativeOrientation() const;
+ virtual Qt::ScreenOrientation orientation() const;
virtual int screenDepth() const;
virtual QImage::Format screenFormat() const;
virtual QSurfaceFormat surfaceFormatFor(const QSurfaceFormat &inputFormat) const;
diff --git a/src/plugins/platforms/eglfs/qeglfshooks_stub.cpp b/src/plugins/platforms/eglfs/qeglfshooks_stub.cpp
index d04803d8e3..4dc0783d43 100644
--- a/src/plugins/platforms/eglfs/qeglfshooks_stub.cpp
+++ b/src/plugins/platforms/eglfs/qeglfshooks_stub.cpp
@@ -192,6 +192,16 @@ QDpi QEglFSHooks::logicalDpi() const
25.4 * s.height() / ps.height());
}
+Qt::ScreenOrientation QEglFSHooks::nativeOrientation() const
+{
+ return Qt::PrimaryOrientation;
+}
+
+Qt::ScreenOrientation QEglFSHooks::orientation() const
+{
+ return Qt::PrimaryOrientation;
+}
+
int QEglFSHooks::screenDepth() const
{
static int depth = qgetenv("QT_QPA_EGLFS_DEPTH").toInt();
diff --git a/src/plugins/platforms/eglfs/qeglfsscreen.cpp b/src/plugins/platforms/eglfs/qeglfsscreen.cpp
index 1fe8bcc11b..a726215e67 100644
--- a/src/plugins/platforms/eglfs/qeglfsscreen.cpp
+++ b/src/plugins/platforms/eglfs/qeglfsscreen.cpp
@@ -90,6 +90,15 @@ QDpi QEglFSScreen::logicalDpi() const
return QEglFSHooks::hooks()->logicalDpi();
}
+Qt::ScreenOrientation QEglFSScreen::nativeOrientation() const
+{
+ return QEglFSHooks::hooks()->nativeOrientation();
+}
+
+Qt::ScreenOrientation QEglFSScreen::orientation() const
+{
+ return QEglFSHooks::hooks()->orientation();
+}
QPlatformCursor *QEglFSScreen::cursor() const
{
diff --git a/src/plugins/platforms/eglfs/qeglfsscreen.h b/src/plugins/platforms/eglfs/qeglfsscreen.h
index b04c85797f..06cafa20c8 100644
--- a/src/plugins/platforms/eglfs/qeglfsscreen.h
+++ b/src/plugins/platforms/eglfs/qeglfsscreen.h
@@ -65,6 +65,8 @@ public:
QSizeF physicalSize() const;
QDpi logicalDpi() const;
+ Qt::ScreenOrientation nativeOrientation() const;
+ Qt::ScreenOrientation orientation() const;
QPlatformCursor *cursor() const;