directfb: Get the IDirectFBDisplayLayer through the QPlatformScreen

Change-Id: I1e8bacc2a5c39065f1c0667cda900730c5670066
Reviewed-by: Jørgen Lind <jorgen.lind@nokia.com>
This commit is contained in:
Holger Hans Peter Freyther 2011-11-21 14:59:26 +01:00 committed by Qt by Nokia
parent 13505b53b6
commit 426cda9089
4 changed files with 15 additions and 5 deletions

View File

@ -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();
}

View File

@ -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

View File

@ -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);
}

View File

@ -57,7 +57,6 @@ public:
void changeCursor(QCursor *cursor, QWindow *window);
private:
QDirectFBPointer<IDirectFBDisplayLayer> m_layer;
QScopedPointer<QPlatformCursorImage> m_image;
};