summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorFrans Englich <frans.englich@nokia.com>2009-09-24 16:33:32 (GMT)
committerFrans Englich <frans.englich@nokia.com>2009-09-24 16:33:32 (GMT)
commit9345d47c3945b61a27724508e8b3d0aaf7b57bcf (patch)
tree8bfb835d7753588390a614eaa85a6cb1eae1f446 /src
parent1062bbbcd6c30844d9ade10de80f27a3afd4dacf (diff)
downloadQt-9345d47c3945b61a27724508e8b3d0aaf7b57bcf.zip
Qt-9345d47c3945b61a27724508e8b3d0aaf7b57bcf.tar.gz
Qt-9345d47c3945b61a27724508e8b3d0aaf7b57bcf.tar.bz2
Revert all GUI changes from the MMF work.
We revert because they seem to create regressions in the QWidget auto test.
Diffstat (limited to 'src')
-rw-r--r--src/gui/gui.pro2
-rw-r--r--src/gui/kernel/qapplication_s60.cpp101
-rw-r--r--src/gui/kernel/qt_s60_p.h2
-rw-r--r--src/gui/kernel/qwidget_p.h13
-rw-r--r--src/gui/kernel/qwidget_s60.cpp426
5 files changed, 68 insertions, 476 deletions
diff --git a/src/gui/gui.pro b/src/gui/gui.pro
index 7c24002..83ac5fe 100644
--- a/src/gui/gui.pro
+++ b/src/gui/gui.pro
@@ -54,4 +54,4 @@ DEFINES += Q_INTERNAL_QAPP_SRC
symbian:TARGET.UID3=0x2001B2DD
# ro-section in gui can exceed default allocated space, so more rw-section little further
-symbian-sbsv2: MMP_RULES += "LINKEROPTION armcc --rw-base 0x800000"
+symbian-sbsv2: MMP_RULES += "LINKEROPTION armcc --rw-base 0x800000" \ No newline at end of file
diff --git a/src/gui/kernel/qapplication_s60.cpp b/src/gui/kernel/qapplication_s60.cpp
index e330057..a5d07fd 100644
--- a/src/gui/kernel/qapplication_s60.cpp
+++ b/src/gui/kernel/qapplication_s60.cpp
@@ -77,10 +77,6 @@
#include <hal.h>
#include <hal_data.h>
-#ifdef DEBUG_QSYMBIANCONTROL
-#include <QDebug>
-#endif
-
QT_BEGIN_NAMESPACE
#if defined(QT_DEBUG)
@@ -324,36 +320,13 @@ QSymbianControl::QSymbianControl(QWidget *w)
{
}
-void QSymbianControl::ConstructL(bool isWindowOwning, bool desktop)
+void QSymbianControl::ConstructL(bool topLevel, bool desktop)
{
if (!desktop)
{
- if (isWindowOwning or !qwidget->parentWidget())
+ if (topLevel) {
CreateWindowL(S60->windowGroup());
- else
- /**
- * TODO: in order to avoid creating windows for all ancestors of
- * this widget up to the root window, the parameter passed to
- * CreateWindowL should be
- * qwidget->parentWidget()->effectiveWinId(). However, if we do
- * this, then we need to take care of re-parenting when a window
- * is created for a widget between this one and the root window.
- */
- CreateWindowL(qwidget->parentWidget()->winId());
-
- // Necessary in order to be able to track the activation status of
- // the control's window
- qwidget->d_func()->createExtra();
-
-#ifdef DEBUG_QSYMBIANCONTROL
- qDebug() << "QSymbianControl::ConstructL [" << this
- << "] widget" << qwidget
- << "isWindowOwning" << isWindowOwning
- << "parentWidget" << qwidget->parentWidget()
- << "OwnsWindow" << OwnsWindow()
- << "Window.ClientHandle" << reinterpret_cast<const void*>(DrawableWindow()->ClientHandle())
- << "WindowGroupId" << DrawableWindow()->WindowGroupId();
-#endif
+ }
SetFocusing(true);
m_longTapDetector = QLongTapTimer::NewL(this);
@@ -721,57 +694,19 @@ TCoeInputCapabilities QSymbianControl::InputCapabilities() const
void QSymbianControl::Draw(const TRect& r) const
{
QWindowSurface *surface = qwidget->windowSurface();
- QPaintEngine *engine = surface ? surface->paintDevice()->paintEngine() : NULL;
-
-#ifdef DEBUG_QSYMBIANCONTROL
- qDebug() << "QSymbianControl::Draw [" << this << "]"
- << "rect " << r.iTl.iX << ',' << r.iTl.iY
- << '-' << r.iBr.iX << ',' << r.iBr.iY
- << "surface" << surface
- << "engine" << engine
- << "raster" << (engine ? engine->type() == QPaintEngine::Raster : false)
- << "opaque" << (qwidget->d_func()->isOpaque)
- << "disableBlit" << (qwidget->d_func()->extraData()->disableBlit);
-#endif
+ if (!surface)
+ return;
+ QPaintEngine *engine = surface->paintDevice()->paintEngine();
if (!engine)
return;
-
if (engine->type() == QPaintEngine::Raster) {
QS60WindowSurface *s60Surface = static_cast<QS60WindowSurface *>(qwidget->windowSurface());
CFbsBitmap *bitmap = s60Surface->symbianBitmap();
CWindowGc &gc = SystemGc();
-
- if(qwidget->d_func()->extraData()->disableBlit) {
-#ifdef DEBUG_QSYMBIANCONTROL
- const TDisplayMode displayMode = bitmap->DisplayMode();
- qDebug() << "QSymbianControl::Draw [" << this << "]"
- << "mode " << displayMode;
-
- const TUint32 *address = bitmap->DataAddress();
- const int bitmapWidth = bitmap->SizeInPixels().iWidth;
- const int bitmapHeight = bitmap->SizeInPixels().iHeight;
-
- for(int i=0; i<10 and i*10<bitmapWidth and i*10<bitmapHeight; ++i) {
- const int coord = i*10;
- const TUint32 *ptr = address + (coord * bitmapWidth) + coord;
- const TUint32 pixel = *ptr;
- qDebug() << " " << i*10 << " : " << ptr << pixel;
- }
-
- for(int i=0; i<10 and i*10<bitmapWidth and i*10<bitmapHeight; ++i) {
- TRgb color;
- bitmap->GetPixel(color, TPoint(i*10, i*10));
- qDebug() << " " << i*10 << " : " << color.Red() << color.Green() << color.Blue() << color.Alpha();
- }
-#endif
-
- if (qwidget->d_func()->isOpaque)
- gc.SetDrawMode(CGraphicsContext::EDrawModeWriteAlpha);
- }
- else
- gc.BitBlt(r.iTl, bitmap, r);
-
+ if (qwidget->d_func()->isOpaque)
+ gc.SetDrawMode(CGraphicsContext::EDrawModeWriteAlpha);
+ gc.BitBlt(r.iTl, bitmap, r);
} else {
surface->flush(qwidget, QRegion(qt_TRect2QRect(r)), QPoint());
}
@@ -784,12 +719,6 @@ void QSymbianControl::SizeChanged()
QSize oldSize = qwidget->size();
QSize newSize(Size().iWidth, Size().iHeight);
-#ifdef DEBUG_QSYMBIANCONTROL
- qDebug() << "QSymbianControl::SizeChanged [" << this << "]"
- << oldSize.width() << 'x' << oldSize.height()
- << "-" << newSize.width() << 'x' << newSize.height();
-#endif
-
if (oldSize != newSize) {
QRect cr = qwidget->geometry();
cr.setSize(newSize);
@@ -816,12 +745,6 @@ void QSymbianControl::PositionChanged()
QPoint oldPos = qwidget->geometry().topLeft();
QPoint newPos(Position().iX, Position().iY);
-#ifdef DEBUG_QSYMBIANCONTROL
- qDebug() << "QSymbianControl::SizeChanged [" << this << "]"
- << oldPos.x() << ',' << oldPos.y()
- << "-" << newPos.x() << ',' << newPos.y();
-#endif
-
if (oldPos != newPos) {
QRect cr = qwidget->geometry();
cr.moveTopLeft(newPos);
@@ -1201,14 +1124,14 @@ QWidget * QApplication::topLevelAt(QPoint const& point)
if (widget->geometry().adjusted(0,0,1,1).contains(point)) {
// At this point we know there is a Qt widget under the point.
// Now we need to make sure it is the top most in the z-order.
- RDrawableWindow *const window = widget->effectiveWinId()->DrawableWindow();
- int z = window->OrdinalPosition();
+ RDrawableWindow* rw = widget->d_func()->topData()->rwindow;
+ int z = rw->OrdinalPosition();
if (z < lowestZ) {
lowestZ = z;
found = widget;
}
}
- }
+ }
}
return found;
}
diff --git a/src/gui/kernel/qt_s60_p.h b/src/gui/kernel/qt_s60_p.h
index 2474d69..aa39f9d 100644
--- a/src/gui/kernel/qt_s60_p.h
+++ b/src/gui/kernel/qt_s60_p.h
@@ -139,7 +139,7 @@ public:
public:
QSymbianControl(QWidget *w);
- void ConstructL(bool isWindowOwning = false, bool desktop = false);
+ void ConstructL(bool topLevel = false, bool desktop = false);
~QSymbianControl();
void HandleResourceChange(int resourceType);
void HandlePointerEventL(const TPointerEvent& aPointerEvent);
diff --git a/src/gui/kernel/qwidget_p.h b/src/gui/kernel/qwidget_p.h
index d3cd724..5a9c48c 100644
--- a/src/gui/kernel/qwidget_p.h
+++ b/src/gui/kernel/qwidget_p.h
@@ -169,6 +169,9 @@ struct QTLWExtra {
#ifndef QT_NO_QWS_MANAGER
QWSManager *qwsManager;
#endif
+#elif defined(Q_OS_SYMBIAN) // <--------------------------------------------------------- SYMBIAN
+ uint activated : 1; // RWindowBase::Activated has been called
+ RDrawableWindow *rwindow;
#endif
};
@@ -221,15 +224,6 @@ struct QWExtra {
QImage maskBits;
CGImageRef imageMask;
#endif
-#elif defined(Q_OS_SYMBIAN) // <----------------------------------------------------- Symbian
- uint activated : 1; // RWindowBase::Activated has been called
-
- // If set, QSymbianControl::Draw does not blit this widget
- // This is to allow, for use cases such as video, widgets which, from the Qt point
- // of view, are just placeholders in the scene. For these widgets, any necessary
- // drawing to the UI framebuffer is done by the relevant Symbian subsystem. For
- // video rendering, this would be an MMF controller, or MDF post-processor.
- uint disableBlit : 1;
#endif
};
@@ -294,7 +288,6 @@ public:
void setMask_sys(const QRegion &);
#ifdef Q_OS_SYMBIAN
void handleSymbianDeferredFocusChanged();
- void setSoftKeys_sys(const QList<QAction*> &softkeys);
#endif
void raise_sys();
diff --git a/src/gui/kernel/qwidget_s60.cpp b/src/gui/kernel/qwidget_s60.cpp
index 3d67bc8..4fef020 100644
--- a/src/gui/kernel/qwidget_s60.cpp
+++ b/src/gui/kernel/qwidget_s60.cpp
@@ -56,10 +56,6 @@
#include <aknappui.h>
#endif
-#ifdef DEBUG_QWIDGET
-#include <QDebug>
-#endif
-
QT_BEGIN_NAMESPACE
extern bool qt_nograb();
@@ -82,225 +78,14 @@ static bool isEqual(const QList<QAction*>& a, const QList<QAction*>& b)
return true;
}
-void QWidgetPrivate::setWSGeometry(bool dontShow, const QRect &)
+void QWidgetPrivate::setWSGeometry(bool /* dontShow */, const QRect & /* rect */)
{
- // Note: based on x11 implementation
-
- static const int XCOORD_MAX = 16383;
- static const int WRECT_MAX = 16383;
-
- Q_Q(QWidget);
-
-#ifdef DEBUG_QWIDGET
- qDebug() << "QWidgetPrivate::setWSGeometry [" << this << "]"
- << "q" << q;
-#endif
-
- Q_ASSERT(q->testAttribute(Qt::WA_WState_Created));
-
- /*
- There are up to four different coordinate systems here:
- Qt coordinate system for this widget.
- Symbian coordinate system for this widget (relative to wrect).
- Qt coordinate system for parent
- Symbian coordinate system for parent (relative to parent's wrect).
- */
-
- QRect validRange(-XCOORD_MAX,-XCOORD_MAX, 2*XCOORD_MAX, 2*XCOORD_MAX);
- QRect wrectRange(-WRECT_MAX,-WRECT_MAX, 2*WRECT_MAX, 2*WRECT_MAX);
- QRect wrect;
- //xrect is the Symbian geometry of my widget. (starts out in parent's Qt coord sys, and ends up in parent's Symbian coord sys)
- QRect xrect = data.crect;
-
- const QWidget *const parent = q->parentWidget();
- QRect parentWRect = parent->data->wrect;
-
- if (parentWRect.isValid()) {
- // parent is clipped, and we have to clip to the same limit as parent
- if (!parentWRect.contains(xrect)) {
- xrect &= parentWRect;
- wrect = xrect;
- //translate from parent's to my Qt coord sys
- wrect.translate(-data.crect.topLeft());
- }
- //translate from parent's Qt coords to parent's X coords
- xrect.translate(-parentWRect.topLeft());
-
- } else {
- // parent is not clipped, we may or may not have to clip
-
- if (data.wrect.isValid() && QRect(QPoint(),data.crect.size()).contains(data.wrect)) {
- // This is where the main optimization is: we are already
- // clipped, and if our clip is still valid, we can just
- // move our window, and do not need to move or clip
- // children
-
- QRect vrect = xrect & parent->rect();
- vrect.translate(-data.crect.topLeft()); //the part of me that's visible through parent, in my Qt coords
- if (data.wrect.contains(vrect)) {
- xrect = data.wrect;
- xrect.translate(data.crect.topLeft());
- if (data.winid) {
-
-#ifdef DEBUG_QWIDGET
- qDebug() << "QWidgetPrivate::setWSGeometry [" << this << "] (1)"
- << "control" << data.winid
- << "SetExtent" << xrect.x() << ',' << xrect.y()
- << xrect.width() << 'x' << xrect.height();
-#endif
-
- data.winid->SetExtent(TPoint(xrect.x(), xrect.y()), TSize(xrect.width(), xrect.height()));
- data.winid->DrawNow();
- }
- return;
- }
- }
-
- if (!validRange.contains(xrect)) {
- // we are too big, and must clip
- xrect &=wrectRange;
- wrect = xrect;
- wrect.translate(-data.crect.topLeft());
- //parent's X coord system is equal to parent's Qt coord
- //sys, so we don't need to map xrect.
- }
-
- }
-
- // unmap if we are outside the valid window system coord system
- bool outsideRange = !xrect.isValid();
- bool mapWindow = false;
- if (q->testAttribute(Qt::WA_OutsideWSRange) != outsideRange) {
- q->setAttribute(Qt::WA_OutsideWSRange, outsideRange);
- if (outsideRange) {
- if (data.winid) {
-
-#ifdef DEBUG_QWIDGET
- qDebug() << "QWidgetPrivate::setWSGeometry [" << this << "] (2)"
- << "control" << data.winid
- << "SetVisible(EFalse)";
-#endif
-
- data.winid->DrawableWindow()->SetVisible(EFalse);
- }
- q->setAttribute(Qt::WA_Mapped, false);
- } else if (!q->isHidden()) {
- mapWindow = true;
- }
- }
-
- if (outsideRange)
- return;
-
- bool jump = (data.wrect != wrect);
- data.wrect = wrect;
-
-
- // and now recursively for all children...
- // ### can be optimized
- for (int i = 0; i < children.size(); ++i) {
- QObject *object = children.at(i);
- if (object->isWidgetType()) {
- QWidget *w = static_cast<QWidget *>(object);
- if (!w->isWindow() && w->testAttribute(Qt::WA_WState_Created)) {
-#ifdef DEBUG_QWIDGET
- qDebug() << "QWidgetPrivate::setWSGeometry [" << this << "] (3)"
- << "control" << data.winid
- << "child" << w->d_func();
-#endif
-
- w->d_func()->setWSGeometry(jump);
- }
- }
- }
-
- if (data.winid) {
- // move ourselves to the new position and map (if necessary) after
- // the movement. Rationale: moving unmapped windows is much faster
- // than moving mapped windows
- if (!parent->internalWinId())
- xrect.translate(parent->mapTo(q->nativeParentWidget(), QPoint(0, 0)));
-
-#ifdef DEBUG_QWIDGET
- qDebug() << "QWidgetPrivate::setWSGeometry [" << this << "] (4)"
- << "control" << data.winid
- << "SetExtent" << xrect.x() << ',' << xrect.y()
- << xrect.width() << 'x' << xrect.height();
-#endif
-
- data.winid->SetExtent(TPoint(xrect.x(), xrect.y()), TSize(xrect.width(), xrect.height()));
- if(!jump) {
-
-#ifdef DEBUG_QWIDGET
- qDebug() << "QWidgetPrivate::setWSGeometry [" << this << "] (5)"
- << "control" << data.winid
- << "DrawNow";
-#endif
-
- data.winid->DrawNow();
- }
- }
-
- //to avoid flicker, we have to show children after the helper widget has moved
- if (jump) {
- for (int i = 0; i < children.size(); ++i) {
- QObject *object = children.at(i);
- if (object->isWidgetType()) {
- QWidget *w = static_cast<QWidget *>(object);
- if (!w->testAttribute(Qt::WA_OutsideWSRange) && !w->testAttribute(Qt::WA_Mapped) && !w->isHidden()) {
- w->setAttribute(Qt::WA_Mapped);
- if (w->internalWinId()) {
-
-#ifdef DEBUG_QWIDGET
- qDebug() << "QWidgetPrivate::setWSGeometry [" << this << "] (6)"
- << "control" << data.winid
- << "SetVisible(ETrue)";
-#endif
-
- w->data->winid->DrawableWindow()->SetVisible(ETrue);
- }
- }
- }
- }
- }
-
- if (jump && data.winid) {
-
-#ifdef DEBUG_QWIDGET
- qDebug() << "QWidgetPrivate::setWSGeometry [" << this << "] (7)"
- << "control" << data.winid
- << "DrawNow" << wrect.width() << 'x' << wrect.height();
-#endif
-
- data.winid->DrawNow(TRect(0, 0, wrect.width(), wrect.height()));
- }
-
- if (mapWindow and !dontShow) {
- q->setAttribute(Qt::WA_Mapped);
- if (q->internalWinId()) {
-
-#ifdef DEBUG_QWIDGET
- qDebug() << "QWidgetPrivate::setWSGeometry [" << this << "] (8)"
- << "control" << data.winid
- << "SetVisible(ETrue)";
-#endif
-
- q->internalWinId()->DrawableWindow()->SetVisible(ETrue);
- }
- }
}
void QWidgetPrivate::setGeometry_sys(int x, int y, int w, int h, bool isMove)
{
Q_Q(QWidget);
-
-#ifdef DEBUG_QWIDGET
- qDebug() << "QWidgetPrivate::setGeometry_sys [" << this << "]"
- << "q" << q
- << x << ',' << y << w << 'x' << h << isMove;
-#endif
-
Q_ASSERT(q->testAttribute(Qt::WA_WState_Created));
if ((q->windowType() == Qt::Desktop))
@@ -334,25 +119,13 @@ void QWidgetPrivate::setGeometry_sys(int x, int y, int w, int h, bool isMove)
if (q->isWindow()) {
if (w == 0 || h == 0) {
q->setAttribute(Qt::WA_OutsideWSRange, true);
- if (q->isVisible() && q->testAttribute(Qt::WA_Mapped)) {
-
-#ifdef DEBUG_QWIDGET
- qDebug() << "QWidgetPrivate::setGeometry_sys [" << this << "] (1)"
- << "hide";
-#endif
-
+ if (q->isVisible() && q->testAttribute(Qt::WA_Mapped))
hide_sys();
- }
data.crect = QRect(x, y, w, h);
data.window_state &= ~Qt::WindowFullScreen;
} else if (q->isVisible() && q->testAttribute(Qt::WA_OutsideWSRange)) {
q->setAttribute(Qt::WA_OutsideWSRange, false);
-#ifdef DEBUG_QWIDGET
- qDebug() << "QWidgetPrivate::setGeometry_sys [" << this << "] (2)"
- << "SetRect, show";
-#endif
-
// put the window in its place and show it
q->internalWinId()->SetRect(TRect(TPoint(x, y), TSize(w, h)));
data.crect.setRect(x, y, w, h);
@@ -361,12 +134,6 @@ void QWidgetPrivate::setGeometry_sys(int x, int y, int w, int h, bool isMove)
} else {
QRect r = QRect(x, y, w, h);
data.crect = r;
-
-#ifdef DEBUG_QWIDGET
- qDebug() << "QWidgetPrivate::setGeometry_sys [" << this << "] (3)"
- << "SetRect";
-#endif
-
q->internalWinId()->SetRect(TRect(TPoint(x, y), TSize(w, h)));
topData()->normalGeometry = data.crect;
}
@@ -389,15 +156,8 @@ void QWidgetPrivate::setGeometry_sys(int x, int y, int w, int h, bool isMove)
if (inTopLevelResize)
tlwExtra->inTopLevelResize = true;
}
- if (q->testAttribute(Qt::WA_WState_Created)) {
-
-#ifdef DEBUG_QWIDGET
- qDebug() << "QWidgetPrivate::setGeometry_sys [" << this << "] (4)"
- << "setWSGeometry";
-#endif
-
+ if (q->testAttribute(Qt::WA_WState_Created))
setWSGeometry();
- }
}
if (q->isVisible()) {
@@ -442,19 +202,6 @@ void QWidgetPrivate::create_sys(WId window, bool /* initializeWindow */, bool de
bool desktop = (type == Qt::Desktop);
//bool tool = (type == Qt::Tool || type == Qt::Drawer);
-#ifdef DEBUG_QWIDGET
- qDebug() << "QWidgetPrivate::create_sys [" << this << "] "
- << "q" << q;
- qDebug() << "QWidgetPrivate::create_sys [" << this << "] "
- << "type" << type
- << "flags" << flags
- << "parent" << parentWidget
- << "topLevel" << topLevel
- << "popup" << popup
- << "dialog" << dialog
- << "desktop" << desktop;
-#endif
-
WId id = 0;
if (popup)
@@ -506,17 +253,18 @@ void QWidgetPrivate::create_sys(WId window, bool /* initializeWindow */, bool de
}
QT_TRAP_THROWING(control->ControlEnv()->AppUi()->AddToStackL(control, ECoeStackPriorityDefault, stackingFlags));
- RDrawableWindow *const drawableWindow = control->DrawableWindow();
+ QTLWExtra *topExtra = topData();
+ topExtra->rwindow = control->DrawableWindow();
// Request mouse move events.
- drawableWindow->PointerFilter(EPointerFilterEnterExit
+ topExtra->rwindow->PointerFilter(EPointerFilterEnterExit
| EPointerFilterMove | EPointerFilterDrag, 0);
- drawableWindow->EnableVisibilityChangeEvents();
+ topExtra->rwindow->EnableVisibilityChangeEvents();
if (!isOpaque) {
- RWindow *const window = static_cast<RWindow *>(drawableWindow);
- const TDisplayMode displayMode = static_cast<TDisplayMode>(window->SetRequiredDisplayMode(EColor16MA));
- if (window->SetTransparencyAlphaChannel() == KErrNone)
- window->SetBackgroundColor(TRgb(255, 255, 255, 0));
+ RWindow *rwindow = static_cast<RWindow*>(topExtra->rwindow);
+ TDisplayMode gotDM = (TDisplayMode)rwindow->SetRequiredDisplayMode(EColor16MA);
+ if (rwindow->SetTransparencyAlphaChannel() == KErrNone)
+ rwindow->SetBackgroundColor(TRgb(255, 255, 255, 0));
}
}
@@ -538,6 +286,9 @@ void QWidgetPrivate::create_sys(WId window, bool /* initializeWindow */, bool de
}
QT_TRAP_THROWING(control->ControlEnv()->AppUi()->AddToStackL(control, ECoeStackPriorityDefault, stackingFlags));
+ WId parentw = parentWidget->effectiveWinId();
+ QT_TRAP_THROWING(control->SetContainerWindowL(*parentw));
+
q->setAttribute(Qt::WA_WState_Created);
int x, y, w, h;
data.crect.getRect(&x, &y, &w, &h);
@@ -554,11 +305,6 @@ void QWidgetPrivate::create_sys(WId window, bool /* initializeWindow */, bool de
void QWidgetPrivate::show_sys()
{
Q_Q(QWidget);
-
-#ifdef DEBUG_QWIDGET
- qDebug() << "QWidgetPrivate::show_sys [" << this << "] "
- << "q" << q;
-#endif
if (q->testAttribute(Qt::WA_OutsideWSRange))
return;
@@ -572,31 +318,20 @@ void QWidgetPrivate::show_sys()
return;
}
- if (q->internalWinId()) {
-
+ if (q->isWindow() && q->internalWinId()) {
+
WId id = q->internalWinId();
- if (!extra->activated) {
-
-#ifdef DEBUG_QWIDGET
- qDebug() << "QWidgetPrivate::show_sys [" << this << "]"
- << "id" << id
- << "isWindow" << q->isWindow()
- << "ActivateL";
-#endif
-
+ if (!extra->topextra->activated) {
QT_TRAP_THROWING(id->ActivateL());
- extra->activated = 1;
+ extra->topextra->activated = 1;
}
id->MakeVisible(true);
-
- if(q->isWindow())
- id->SetFocus(true);
+ id->SetFocus(true);
// Force setting of the icon after window is made visible,
// this is needed even WA_SetWindowIcon is not set, as in that case we need
// to reset to the application level window icon
- if(q->isWindow())
- setWindowIcon_sys(true);
+ setWindowIcon_sys(true);
}
invalidateBuffer(q->rect());
@@ -605,25 +340,11 @@ void QWidgetPrivate::show_sys()
void QWidgetPrivate::hide_sys()
{
Q_Q(QWidget);
-
-#ifdef DEBUG_QWIDGET
- qDebug() << "QWidgetPrivate::hide_sys [" << this << "]"
- << "q" << q;
-#endif
-
Q_ASSERT(q->testAttribute(Qt::WA_WState_Created));
deactivateWidgetCleanup();
WId id = q->internalWinId();
-
- if (id) {
-
-#ifdef DEBUG_QWIDGET
- qDebug() << "QWidgetPrivate::show_sys [" << this << "]"
- << "id" << id
- << "MakeVisible(false)";
-#endif
-
- if(id->IsFocused()) // Avoid unnecessary calls to FocusChanged()
+ if (q->isWindow() && id) {
+ if (id->IsFocused()) // Avoid unnecessary calls to FocusChanged()
id->SetFocus(false);
id->MakeVisible(false);
if (QWidgetBackingStore *bs = maybeBackingStore())
@@ -647,13 +368,6 @@ void QWidgetPrivate::handleSymbianDeferredFocusChanged()
{
Q_Q(QWidget);
WId control = q->internalWinId();
-
-#ifdef DEBUG_QWIDGET
- qDebug() << "QWidgetPrivate::handleSymbianDeferredFocusChanged [" << this << "]"
- << "q" << q
- << "control" << control;
-#endif
-
if (!control) {
// This could happen if the widget was reparented, while the focuschange
// was in the event queue.
@@ -681,30 +395,21 @@ void QWidgetPrivate::handleSymbianDeferredFocusChanged()
void QWidgetPrivate::raise_sys()
{
Q_Q(QWidget);
-
-#ifdef DEBUG_QWIDGET
- qDebug() << "QWidgetPrivate::raise_sys [" << this << "]"
- << "q" << q;
-#endif
-
Q_ASSERT(q->testAttribute(Qt::WA_WState_Created));
- if (q->internalWinId())
- q->internalWinId()->DrawableWindow()->SetOrdinalPosition(0);
+ QTLWExtra *tlwExtra = maybeTopData();
+ if (q->internalWinId() && tlwExtra) {
+ tlwExtra->rwindow->SetOrdinalPosition(0);
+ }
}
void QWidgetPrivate::lower_sys()
{
Q_Q(QWidget);
-
-#ifdef DEBUG_QWIDGET
- qDebug() << "QWidgetPrivate::lower_sys [" << this << "]"
- << "q" << q;
-#endif
-
Q_ASSERT(q->testAttribute(Qt::WA_WState_Created));
- if (q->internalWinId())
- q->internalWinId()->DrawableWindow()->SetOrdinalPosition(-1);
-
+ QTLWExtra *tlwExtra = maybeTopData();
+ if (q->internalWinId() && tlwExtra) {
+ tlwExtra->rwindow->SetOrdinalPosition(-1);
+ }
if (!q->isWindow())
invalidateBuffer(q->rect());
}
@@ -718,13 +423,10 @@ void QWidgetPrivate::stackUnder_sys(QWidget* w)
{
Q_Q(QWidget);
Q_ASSERT(q->testAttribute(Qt::WA_WState_Created));
-
- if (q->internalWinId() && w->internalWinId()) {
- RDrawableWindow *const thisWindow = q->internalWinId()->DrawableWindow();
- RDrawableWindow *const otherWindow = w->internalWinId()->DrawableWindow();
- thisWindow->SetOrdinalPosition(otherWindow->OrdinalPosition() + 1);
- }
-
+ QTLWExtra *tlwExtra = maybeTopData();
+ QTLWExtra *tlwExtraSibling = w->d_func()->maybeTopData();
+ if (q->internalWinId() && tlwExtra && w->internalWinId() && tlwExtraSibling)
+ tlwExtra->rwindow->SetOrdinalPosition(tlwExtraSibling->rwindow->OrdinalPosition() + 1);
if (!q->isWindow() || !w->internalWinId())
invalidateBuffer(q->rect());
}
@@ -732,12 +434,6 @@ void QWidgetPrivate::stackUnder_sys(QWidget* w)
void QWidgetPrivate::reparentChildren()
{
Q_Q(QWidget);
-
-#ifdef DEBUG_QWIDGET
- qDebug() << "QWidgetPrivate::reparentChildren [" << this << "]"
- << "q" << q;
-#endif
-
QObjectList chlist = q->children();
for (int i = 0; i < chlist.size(); ++i) { // reparent children
QObject *obj = chlist.at(i);
@@ -768,14 +464,6 @@ void QWidgetPrivate::reparentChildren()
void QWidgetPrivate::setParent_sys(QWidget *parent, Qt::WindowFlags f)
{
Q_Q(QWidget);
-
-#ifdef DEBUG_QWIDGET
- qDebug() << "QWidgetPrivate::setParent_sys [" << this << "]"
- << "q" << q
- << "parent" << parent
- << "f" << f;
-#endif
-
bool wasCreated = q->testAttribute(Qt::WA_WState_Created);
if (q->isVisible() && q->parentWidget() && parent != q->parentWidget())
@@ -839,25 +527,23 @@ void QWidgetPrivate::s60UpdateIsOpaque()
{
Q_Q(QWidget);
-#ifdef DEBUG_QWIDGET
- qDebug() << "QWidgetPrivate::s60UpdateIsOpaque [" << this << "]"
- << "q" << q;
-#endif
-
if (!q->testAttribute(Qt::WA_WState_Created) || !q->testAttribute(Qt::WA_TranslucentBackground))
return;
if ((data.window_flags & Qt::FramelessWindowHint) == 0)
return;
- RWindow *const window = static_cast<RWindow *>(q->effectiveWinId()->DrawableWindow());
-
if (!isOpaque) {
- const TDisplayMode displayMode = static_cast<TDisplayMode>(window->SetRequiredDisplayMode(EColor16MA));
- if (window->SetTransparencyAlphaChannel() == KErrNone)
- window->SetBackgroundColor(TRgb(255, 255, 255, 0));
- } else
- window->SetTransparentRegion(TRegionFix<1>());
+ QTLWExtra *topExtra = topData();
+ RWindow *rwindow = static_cast<RWindow*>(topExtra->rwindow);
+ TDisplayMode gotDM = (TDisplayMode)rwindow->SetRequiredDisplayMode(EColor16MA);
+ if (rwindow->SetTransparencyAlphaChannel() == KErrNone)
+ rwindow->SetBackgroundColor(TRgb(255, 255, 255, 0));
+ } else {
+ QTLWExtra *topExtra = topData();
+ RWindow *rwindow = static_cast<RWindow*>(topExtra->rwindow);
+ rwindow->SetTransparentRegion(TRegionFix<1>());
+ }
}
CFbsBitmap* qt_pixmapToNativeBitmap(QPixmap pixmap, bool invert)
@@ -1033,8 +719,8 @@ void QWidgetPrivate::scroll_sys(int dx, int dy)
scrollRect(q->rect(), dx, dy);
} else {
Q_ASSERT(q->testAttribute(Qt::WA_WState_Created));
- RDrawableWindow *const window = q->internalWinId()->DrawableWindow();
- window->Scroll(TPoint(dx, dy));
+ RDrawableWindow* rw = topData()->rwindow;
+ rw->Scroll(TPoint(dx, dy));
}
}
@@ -1046,8 +732,8 @@ void QWidgetPrivate::scroll_sys(int dx, int dy, const QRect &r)
scrollRect(r, dx, dy);
} else {
Q_ASSERT(q->testAttribute(Qt::WA_WState_Created));
- RDrawableWindow *const window = q->internalWinId()->DrawableWindow();
- window->Scroll(TPoint(dx, dy), qt_QRect2TRect(r));
+ RDrawableWindow* rw = topData()->rwindow;
+ rw->Scroll(TPoint(dx, dy), qt_QRect2TRect(r));
}
}
@@ -1079,6 +765,8 @@ void QWidgetPrivate::registerDropSite(bool /* on */)
void QWidgetPrivate::createTLSysExtra()
{
extra->topextra->backingStore = 0;
+ extra->topextra->activated = 0;
+ extra->topextra->rwindow = 0;
}
void QWidgetPrivate::deleteTLSysExtra()
@@ -1089,8 +777,7 @@ void QWidgetPrivate::deleteTLSysExtra()
void QWidgetPrivate::createSysExtra()
{
- extra->activated = 0;
- extra->disableBlit = 0;
+
}
void QWidgetPrivate::deleteSysExtra()
@@ -1225,12 +912,6 @@ QPoint QWidget::mapFromGlobal(const QPoint &pos) const
void QWidget::setWindowState(Qt::WindowStates newstate)
{
Q_D(QWidget);
-
-#ifdef DEBUG_QWIDGET
- qDebug() << "QWidget::setWindowState [" << this << "]"
- << "newstate" << newstate;
-#endif
-
Qt::WindowStates oldstate = windowState();
if (oldstate == newstate)
return;
@@ -1478,11 +1159,6 @@ void QWidget::releaseMouse()
void QWidget::activateWindow()
{
Q_D(QWidget);
-
-#ifdef DEBUG_QWIDGET
- qDebug() << "QWidget::activateWindow [" << this << "]";
-#endif
-
QWidget *tlw = window();
if (tlw->isVisible()) {
window()->createWinId();