summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPier Luigi Fiorini <pierluigi.fiorini@gmail.com>2015-07-26 10:32:33 +0200
committerPier Luigi Fiorini <pierluigi.fiorini@gmail.com>2015-07-29 08:23:32 +0000
commitd71f3e088275caa13d73d908deadbc45660a6ab9 (patch)
treef529ad13fa0b857612a64ff6e76a5e4c2893b480
parent2d981e7e9fc2d55b1615332db7571786438158f6 (diff)
downloadqtbase-d71f3e088275caa13d73d908deadbc45660a6ab9.tar.gz
Add power state to QPlatformScreen
Allows platform plugins to set the power state for each screen. Change-Id: I4164ca63cbae9fa2ab186dc84c8f704c33fd7c69 Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
-rw-r--r--src/gui/kernel/qplatformscreen.cpp18
-rw-r--r--src/gui/kernel/qplatformscreen.h10
2 files changed, 28 insertions, 0 deletions
diff --git a/src/gui/kernel/qplatformscreen.cpp b/src/gui/kernel/qplatformscreen.cpp
index edf546799f..9aab102de3 100644
--- a/src/gui/kernel/qplatformscreen.cpp
+++ b/src/gui/kernel/qplatformscreen.cpp
@@ -420,4 +420,22 @@ QPlatformScreen::SubpixelAntialiasingType QPlatformScreen::subpixelAntialiasingT
return static_cast<QPlatformScreen::SubpixelAntialiasingType>(type);
}
+/*!
+ Returns the current power state.
+
+ The default implementation always returns PowerStateOn.
+*/
+QPlatformScreen::PowerState QPlatformScreen::powerState() const
+{
+ return PowerStateOn;
+}
+
+/*!
+ Sets the power state for this screen.
+*/
+void QPlatformScreen::setPowerState(PowerState state)
+{
+ Q_UNUSED(state);
+}
+
QT_END_NAMESPACE
diff --git a/src/gui/kernel/qplatformscreen.h b/src/gui/kernel/qplatformscreen.h
index 551cb788c9..2e33107fc3 100644
--- a/src/gui/kernel/qplatformscreen.h
+++ b/src/gui/kernel/qplatformscreen.h
@@ -82,6 +82,13 @@ public:
Subpixel_VBGR
};
+ enum PowerState {
+ PowerStateOn,
+ PowerStateStandby,
+ PowerStateSuspend,
+ PowerStateOff
+ };
+
QPlatformScreen();
virtual ~QPlatformScreen();
@@ -117,6 +124,9 @@ public:
virtual QPlatformCursor *cursor() const;
virtual SubpixelAntialiasingType subpixelAntialiasingTypeHint() const;
+ virtual PowerState powerState() const;
+ virtual void setPowerState(PowerState state);
+
static int angleBetween(Qt::ScreenOrientation a, Qt::ScreenOrientation b);
static QTransform transformBetween(Qt::ScreenOrientation a, Qt::ScreenOrientation b, const QRect &target);
static QRect mapBetween(Qt::ScreenOrientation a, Qt::ScreenOrientation b, const QRect &rect);