summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeremy Katz <jeremy.katz@nokia.com>2009-11-16 15:12:52 (GMT)
committerJeremy Katz <jeremy.katz@nokia.com>2009-11-16 15:12:52 (GMT)
commit993b3831d3b2704f492c17313a210497b6f9bb5f (patch)
treeff3bc9adc4207888a80e47dfa97daa3bc06f5cb6
parent12bc7c80b94b5f3acbf87f268c4e68ba4bc89381 (diff)
downloadQt-993b3831d3b2704f492c17313a210497b6f9bb5f.zip
Qt-993b3831d3b2704f492c17313a210497b6f9bb5f.tar.gz
Qt-993b3831d3b2704f492c17313a210497b6f9bb5f.tar.bz2
moved top-level raise/lower from QGraphicsSystemScreen to QWindowSurface, testlite support
-rw-r--r--src/gui/kernel/qwidget_lite.cpp6
-rw-r--r--src/gui/painting/qgraphicssystem_p.h3
-rw-r--r--src/gui/painting/qwindowsurface_p.h3
-rw-r--r--src/plugins/graphicssystems/fb_base/fb_base.cpp10
-rw-r--r--src/plugins/graphicssystems/fb_base/fb_base.h4
-rw-r--r--src/plugins/graphicssystems/testlite/qwindowsurface_testlite.cpp11
-rw-r--r--src/plugins/graphicssystems/testlite/qwindowsurface_testlite.h2
7 files changed, 32 insertions, 7 deletions
diff --git a/src/gui/kernel/qwidget_lite.cpp b/src/gui/kernel/qwidget_lite.cpp
index d52d432..cd4fa18 100644
--- a/src/gui/kernel/qwidget_lite.cpp
+++ b/src/gui/kernel/qwidget_lite.cpp
@@ -423,8 +423,7 @@ void QWidgetPrivate::raise_sys()
Q_Q(QWidget);
if (q->isWindow()) {
QWindowSurface *surface = q->windowSurface();
- QGraphicsSystemScreen *screen = qt_screenForWidget(q);
- screen->raise(surface);
+ surface->raise();
}
}
@@ -434,8 +433,7 @@ void QWidgetPrivate::lower_sys()
if (q->isWindow()) {
Q_ASSERT(q->testAttribute(Qt::WA_WState_Created));
QWindowSurface *surface = q->windowSurface();
- QGraphicsSystemScreen *screen = qt_screenForWidget(q);
- screen->lower(surface);
+ surface->lower();
} else if (QWidget *p = q->parentWidget()) {
setDirtyOpaqueRegion();
p->d_func()->invalidateBuffer(effectiveRectFor(q->geometry()));
diff --git a/src/gui/painting/qgraphicssystem_p.h b/src/gui/painting/qgraphicssystem_p.h
index 5b5848e..ddba22d 100644
--- a/src/gui/painting/qgraphicssystem_p.h
+++ b/src/gui/painting/qgraphicssystem_p.h
@@ -75,9 +75,6 @@ public:
virtual QSize physicalSize() const = 0;
virtual void setDirty(QRect) { }
virtual void pointerEvent(QMouseEvent &) { }
-
- virtual void raise(QWindowSurface *) { qWarning("This plugin does not support raise()"); }
- virtual void lower(QWindowSurface *) { qWarning("This plugin does not support lower()"); }
};
#endif // Q_WS_LITE
diff --git a/src/gui/painting/qwindowsurface_p.h b/src/gui/painting/qwindowsurface_p.h
index 88cc8ba..5e95d80 100644
--- a/src/gui/painting/qwindowsurface_p.h
+++ b/src/gui/painting/qwindowsurface_p.h
@@ -94,6 +94,9 @@ public:
virtual Qt::WindowFlags setWindowFlags(Qt::WindowFlags type);
virtual Qt::WindowFlags windowFlags() const;
virtual WId winId() const;
+
+ virtual void raise() { qWarning("This plugin does not support raise()"); }
+ virtual void lower() { qWarning("This plugin does not support lower()"); }
#endif
bool hasStaticContentsSupport() const;
diff --git a/src/plugins/graphicssystems/fb_base/fb_base.cpp b/src/plugins/graphicssystems/fb_base/fb_base.cpp
index cb1b478..b992b15 100644
--- a/src/plugins/graphicssystems/fb_base/fb_base.cpp
+++ b/src/plugins/graphicssystems/fb_base/fb_base.cpp
@@ -97,6 +97,11 @@ void QGraphicsSystemFbScreen::removeWindowSurface(QGraphicsSystemFbWindowSurface
setDirty(surface->geometry());
}
+void QGraphicsSystemFbWindowSurface::raise()
+{
+ mScreen->raise(this);
+}
+
void QGraphicsSystemFbScreen::raise(QWindowSurface * surface)
{
QGraphicsSystemFbWindowSurface *s = static_cast<QGraphicsSystemFbWindowSurface *>(surface);
@@ -107,6 +112,11 @@ void QGraphicsSystemFbScreen::raise(QWindowSurface * surface)
setDirty(s->geometry());
}
+void QGraphicsSystemFbWindowSurface::lower()
+{
+ mScreen->lower(this);
+}
+
void QGraphicsSystemFbScreen::lower(QWindowSurface * surface)
{
QGraphicsSystemFbWindowSurface *s = static_cast<QGraphicsSystemFbWindowSurface *>(surface);
diff --git a/src/plugins/graphicssystems/fb_base/fb_base.h b/src/plugins/graphicssystems/fb_base/fb_base.h
index bd69443..83c3e06 100644
--- a/src/plugins/graphicssystems/fb_base/fb_base.h
+++ b/src/plugins/graphicssystems/fb_base/fb_base.h
@@ -32,6 +32,10 @@ public:
const QImage image() { return mImage; }
void setGeometry(const QRect &rect);
+
+ virtual void raise();
+ virtual void lower();
+
protected:
QGraphicsSystemFbScreen *mScreen;
QRect oldGeometry;
diff --git a/src/plugins/graphicssystems/testlite/qwindowsurface_testlite.cpp b/src/plugins/graphicssystems/testlite/qwindowsurface_testlite.cpp
index 9e24f55..be86cb5 100644
--- a/src/plugins/graphicssystems/testlite/qwindowsurface_testlite.cpp
+++ b/src/plugins/graphicssystems/testlite/qwindowsurface_testlite.cpp
@@ -578,4 +578,15 @@ WId QTestLiteWindowSurface::winId() const
return WId(0);
}
+void QTestLiteWindowSurface::raise()
+{
+ WId window = winId();
+ XRaiseWindow(mGraphicsSystem->xd->display, window);
+}
+
+void QTestLiteWindowSurface::lower()
+{
+ WId window = winId();
+ XLowerWindow(mGraphicsSystem->xd->display, window);
+}
QT_END_NAMESPACE
diff --git a/src/plugins/graphicssystems/testlite/qwindowsurface_testlite.h b/src/plugins/graphicssystems/testlite/qwindowsurface_testlite.h
index 59db81f..3603e93 100644
--- a/src/plugins/graphicssystems/testlite/qwindowsurface_testlite.h
+++ b/src/plugins/graphicssystems/testlite/qwindowsurface_testlite.h
@@ -79,6 +79,8 @@ public:
Qt::WindowFlags windowFlags() const;
void setVisible(bool visible);
WId winId() const;
+ void raise();
+ void lower();
private:
QTestLiteGraphicsSystem *mGraphicsSystem;