summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/wayland/qwaylandscreen.cpp
diff options
context:
space:
mode:
authorJørgen Lind <jorgen.lind@nokia.com>2011-01-25 16:01:21 (GMT)
committerJørgen Lind <jorgen.lind@nokia.com>2011-01-26 13:16:10 (GMT)
commitd36a3a6ebc17935371cfca2a9f22dcd683205b5b (patch)
treeca5cf1c79d99bab9594b8c6607469adcaa485854 /src/plugins/platforms/wayland/qwaylandscreen.cpp
parent2d65cd502fb5508426748d9ef7af4697051f1c45 (diff)
downloadQt-d36a3a6ebc17935371cfca2a9f22dcd683205b5b.zip
Qt-d36a3a6ebc17935371cfca2a9f22dcd683205b5b.tar.gz
Qt-d36a3a6ebc17935371cfca2a9f22dcd683205b5b.tar.bz2
Lighthouse: Wayland. Make the wayland integration closer to Lighthosue
Today there is a connection between QWidget and QPlatformScreen. So I added a accessor in QWaylandScreen to get the corresponding QWaylandDisplay. So now it should be possible to have different QWaylandDisplays. But also its possible to use the internal Lighthouse api closer in the wayland plugin if that should be of interest ;)
Diffstat (limited to 'src/plugins/platforms/wayland/qwaylandscreen.cpp')
-rw-r--r--src/plugins/platforms/wayland/qwaylandscreen.cpp44
1 files changed, 44 insertions, 0 deletions
diff --git a/src/plugins/platforms/wayland/qwaylandscreen.cpp b/src/plugins/platforms/wayland/qwaylandscreen.cpp
index 4a7e727..aa1083f 100644
--- a/src/plugins/platforms/wayland/qwaylandscreen.cpp
+++ b/src/plugins/platforms/wayland/qwaylandscreen.cpp
@@ -41,3 +41,47 @@
#include "qwaylandscreen.h"
+#include "qwaylanddisplay.h"
+#include "qwaylandcursor.h"
+
+QWaylandScreen::QWaylandScreen(QWaylandDisplay *waylandDisplay, struct wl_output *output, QRect geometry)
+ : QPlatformScreen()
+ , mWaylandDisplay(waylandDisplay)
+ , mOutput(output)
+ , mGeometry(geometry)
+ , mDepth(32)
+ , mFormat(QImage::Format_ARGB32_Premultiplied)
+ , mWaylandCursor(new QWaylandCursor(this))
+{
+}
+
+QWaylandScreen::~QWaylandScreen()
+{
+ delete mWaylandCursor;
+}
+
+QWaylandDisplay * QWaylandScreen::display() const
+{
+ return mWaylandDisplay;
+}
+
+QRect QWaylandScreen::geometry() const
+{
+ return mGeometry;
+}
+
+int QWaylandScreen::depth() const
+{
+ return mDepth;
+}
+
+QImage::Format QWaylandScreen::format() const
+{
+ return mFormat;
+}
+
+QWaylandScreen * QWaylandScreen::waylandScreenFromWidget(QWidget *widget)
+{
+ QPlatformScreen *platformScreen = QPlatformScreen::platformScreenForWidget(widget);
+ return static_cast<QWaylandScreen *>(platformScreen);
+}