diff options
author | Holger Hans Peter Freyther <holger@moiji-mobile.com> | 2011-11-21 14:59:26 +0100 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2011-11-24 12:11:04 +0100 |
commit | 426cda9089e69ee9a068554c040ac23eb50d8b97 (patch) | |
tree | 41116ecd226beac46ac155550b228b2120ee4ff4 /src | |
parent | 13505b53b6dd5f7f21e2086700b023c402d9f784 (diff) |
directfb: Get the IDirectFBDisplayLayer through the QPlatformScreen
Change-Id: I1e8bacc2a5c39065f1c0667cda900730c5670066
Reviewed-by: Jørgen Lind <jorgen.lind@nokia.com>
Diffstat (limited to 'src')
4 files changed, 15 insertions, 5 deletions
diff --git a/src/plugins/platforms/directfb/qdirectfbconvenience.cpp b/src/plugins/platforms/directfb/qdirectfbconvenience.cpp index 912e742dda..5f580b0473 100644 --- a/src/plugins/platforms/directfb/qdirectfbconvenience.cpp +++ b/src/plugins/platforms/directfb/qdirectfbconvenience.cpp @@ -386,3 +386,8 @@ QDirectFbScreen *toDfbScreen(QWindow *window) { return static_cast<QDirectFbScreen*>(window->screen()->handle()); } + +IDirectFBDisplayLayer *toDfbLayer(QPlatformScreen *screen) +{ + return static_cast<QDirectFbScreen*>(screen)->dfbLayer(); +} diff --git a/src/plugins/platforms/directfb/qdirectfbconvenience.h b/src/plugins/platforms/directfb/qdirectfbconvenience.h index 39409ac6bd..db73b0c247 100644 --- a/src/plugins/platforms/directfb/qdirectfbconvenience.h +++ b/src/plugins/platforms/directfb/qdirectfbconvenience.h @@ -51,6 +51,7 @@ class QDirectFbScreen; +class QPlatformScreen; class QDirectFbKeyMap: public QHash<DFBInputDeviceKeySymbol, Qt::Key> { @@ -111,5 +112,6 @@ public: // Helper conversions from internal to DFB types QDirectFbScreen *toDfbScreen(QWindow *window); +IDirectFBDisplayLayer *toDfbLayer(QPlatformScreen *screen); #endif // QDIRECTFBCONVENIENCE_H diff --git a/src/plugins/platforms/directfb/qdirectfbcursor.cpp b/src/plugins/platforms/directfb/qdirectfbcursor.cpp index 123d69c58e..8698f9ccf9 100644 --- a/src/plugins/platforms/directfb/qdirectfbcursor.cpp +++ b/src/plugins/platforms/directfb/qdirectfbcursor.cpp @@ -46,7 +46,6 @@ QDirectFBCursor::QDirectFBCursor(QPlatformScreen *screen) : QPlatformCursor(screen) { - QDirectFbConvenience::dfbInterface()->GetDisplayLayer(QDirectFbConvenience::dfbInterface(),DLID_PRIMARY, m_layer.outPtr()); m_image.reset(new QPlatformCursorImage(0, 0, 0, 0, 0, 0)); } @@ -69,11 +68,16 @@ void QDirectFBCursor::changeCursor(QCursor *cursor, QWindow *) map = cursor->pixmap(); } + DFBResult res; + IDirectFBDisplayLayer *layer = toDfbLayer(screen); IDirectFBSurface* surface(QDirectFbConvenience::dfbSurfaceForPlatformPixmap(map.handle())); - if (m_layer->SetCooperativeLevel(m_layer.data(), DLSCL_ADMINISTRATIVE) != DFB_OK) { + res = layer->SetCooperativeLevel(layer, DLSCL_ADMINISTRATIVE); + if (res != DFB_OK) { + DirectFBError("Failed to set DLSCL_ADMINISTRATIVE", res); return; } - m_layer->SetCursorShape(m_layer.data(), surface, xSpot, ySpot); - m_layer->SetCooperativeLevel(m_layer.data(), DLSCL_SHARED); + + layer->SetCursorShape(layer, surface, xSpot, ySpot); + layer->SetCooperativeLevel(layer, DLSCL_SHARED); } diff --git a/src/plugins/platforms/directfb/qdirectfbcursor.h b/src/plugins/platforms/directfb/qdirectfbcursor.h index b2c8f10b53..1a038cf456 100644 --- a/src/plugins/platforms/directfb/qdirectfbcursor.h +++ b/src/plugins/platforms/directfb/qdirectfbcursor.h @@ -57,7 +57,6 @@ public: void changeCursor(QCursor *cursor, QWindow *window); private: - QDirectFBPointer<IDirectFBDisplayLayer> m_layer; QScopedPointer<QPlatformCursorImage> m_image; }; |