summaryrefslogtreecommitdiffstats
path: root/src/plugins/gfxdrivers/directfb
diff options
context:
space:
mode:
authorAnders Bakken <anders.bakken@nokia.com>2009-09-15 18:28:07 (GMT)
committerAnders Bakken <anders.bakken@nokia.com>2009-09-15 18:46:10 (GMT)
commitd67d287c0fdff332cda673a18e0bb1617c3d2e17 (patch)
tree43e206cdbc8c9c28282e5fdc2b0b251d04e0fe87 /src/plugins/gfxdrivers/directfb
parent6b359f3bc3b87a7e5e2b971712ec8a4b8afccdc9 (diff)
downloadQt-d67d287c0fdff332cda673a18e0bb1617c3d2e17.zip
Qt-d67d287c0fdff332cda673a18e0bb1617c3d2e17.tar.gz
Qt-d67d287c0fdff332cda673a18e0bb1617c3d2e17.tar.bz2
Export a function for getting a IDirectFBWindow
This function is only exported when DirectFB is built into QtGui. Reviewed-by: Donald Carr <donald.carr@nokia.com>
Diffstat (limited to 'src/plugins/gfxdrivers/directfb')
-rw-r--r--src/plugins/gfxdrivers/directfb/qdirectfbscreen.cpp20
-rw-r--r--src/plugins/gfxdrivers/directfb/qdirectfbscreen.h5
-rw-r--r--src/plugins/gfxdrivers/directfb/qdirectfbwindowsurface.cpp12
-rw-r--r--src/plugins/gfxdrivers/directfb/qdirectfbwindowsurface.h3
4 files changed, 34 insertions, 6 deletions
diff --git a/src/plugins/gfxdrivers/directfb/qdirectfbscreen.cpp b/src/plugins/gfxdrivers/directfb/qdirectfbscreen.cpp
index 79a401c..0f7a6de 100644
--- a/src/plugins/gfxdrivers/directfb/qdirectfbscreen.cpp
+++ b/src/plugins/gfxdrivers/directfb/qdirectfbscreen.cpp
@@ -1652,6 +1652,19 @@ void QDirectFBScreen::waitIdle()
d_ptr->dfb->WaitIdle(d_ptr->dfb);
}
+#ifdef QT_DIRECTFB_WM
+IDirectFBWindow *QDirectFBScreen::windowForWidget(const QWidget *widget) const
+{
+ if (widget) {
+ const QWSWindowSurface *surface = static_cast<const QWSWindowSurface*>(widget->windowSurface());
+ if (surface && surface->key() == QLatin1String("directfb")) {
+ return static_cast<const QDirectFBWindowSurface*>(surface)->directFBWindow();
+ }
+ }
+ return 0;
+}
+#endif
+
IDirectFBSurface * QDirectFBScreen::surfaceForWidget(const QWidget *widget, QRect *rect) const
{
Q_ASSERT(widget);
@@ -1698,6 +1711,13 @@ Q_GUI_EXPORT IDirectFBSurface *qt_directfb_subsurface_for_widget(const QWidget *
return QDirectFBScreen::instance() ? QDirectFBScreen::instance()->subSurfaceForWidget(widget, area) : 0;
}
#endif
+#ifdef QT_DIRECTFB_WM
+Q_GUI_EXPORT IDirectFBWindow *qt_directfb_window_for_widget(const QWidget *widget)
+{
+ return QDirectFBScreen::instance() ? QDirectFBScreen::instance()->windowForWidget(widget) : 0;
+}
+
+#endif
#endif
QT_END_NAMESPACE
diff --git a/src/plugins/gfxdrivers/directfb/qdirectfbscreen.h b/src/plugins/gfxdrivers/directfb/qdirectfbscreen.h
index 79a01d3..febb2b2 100644
--- a/src/plugins/gfxdrivers/directfb/qdirectfbscreen.h
+++ b/src/plugins/gfxdrivers/directfb/qdirectfbscreen.h
@@ -174,9 +174,10 @@ public:
#ifdef QT_DIRECTFB_SUBSURFACE
IDirectFBSurface *subSurfaceForWidget(const QWidget *widget, const QRect &area = QRect()) const;
#endif
-
IDirectFB *dfb();
-#ifdef QT_NO_DIRECTFB_WM
+#ifdef QT_DIRECTFB_WM
+ IDirectFBWindow *windowForWidget(const QWidget *widget) const;
+#else
IDirectFBSurface *primarySurface();
#endif
#ifndef QT_NO_DIRECTFB_LAYER
diff --git a/src/plugins/gfxdrivers/directfb/qdirectfbwindowsurface.cpp b/src/plugins/gfxdrivers/directfb/qdirectfbwindowsurface.cpp
index ccbaf21..4cebc96 100644
--- a/src/plugins/gfxdrivers/directfb/qdirectfbwindowsurface.cpp
+++ b/src/plugins/gfxdrivers/directfb/qdirectfbwindowsurface.cpp
@@ -113,13 +113,17 @@ bool QDirectFBWindowSurface::isValid() const
#ifdef QT_DIRECTFB_WM
void QDirectFBWindowSurface::raise()
{
- if (dfbWindow) {
- dfbWindow->RaiseToTop(dfbWindow);
- } else if (sibling && (!sibling->sibling || sibling->dfbWindow)) {
- sibling->raise();
+ if (IDirectFBWindow *window = directFBWindow()) {
+ window->RaiseToTop(window);
}
}
+IDirectFBWindow *QDirectFBWindowSurface::directFBWindow() const
+{
+ return (dfbWindow ? dfbWindow : (sibling ? sibling->dfbWindow : 0));
+}
+
+
void QDirectFBWindowSurface::createWindow(const QRect &rect)
{
IDirectFBDisplayLayer *layer = screen->dfbDisplayLayer();
diff --git a/src/plugins/gfxdrivers/directfb/qdirectfbwindowsurface.h b/src/plugins/gfxdrivers/directfb/qdirectfbwindowsurface.h
index 036830a..0dd3a3b 100644
--- a/src/plugins/gfxdrivers/directfb/qdirectfbwindowsurface.h
+++ b/src/plugins/gfxdrivers/directfb/qdirectfbwindowsurface.h
@@ -93,6 +93,9 @@ public:
IDirectFBSurface *surfaceForWidget(const QWidget *widget, QRect *rect) const;
IDirectFBSurface *directFBSurface() const;
+#ifdef QT_DIRECTFB_WM
+ IDirectFBWindow *directFBWindow() const;
+#endif
private:
void updateFormat();
void releaseSurface();