Ignore:
Timestamp:
Mar 8, 2010, 12:52:58 PM (15 years ago)
Author:
Dmitry A. Kuminov
Message:

trunk: Merged in qt 4.6.2 sources.

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk

  • trunk/src/gui/kernel/qapplication_s60.cpp

    r561 r651  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation (qt-info@nokia.com)
     
    7272# endif
    7373# include <private/qs60mainapplication_p.h>
     74# include <centralrepository.h>
    7475#endif
    7576
     
    808809void QSymbianControl::Draw(const TRect& controlRect) const
    809810{
     811    // Set flag to avoid calling DrawNow in window surface
     812    QWidget *window = qwidget->window();
     813    Q_ASSERT(window);
     814    QTLWExtra *topExtra = window->d_func()->maybeTopData();
     815    Q_ASSERT(topExtra);
     816    if (!topExtra->inExpose) {
     817        topExtra->inExpose = true;
     818        QRect exposeRect = qt_TRect2QRect(controlRect);
     819        qwidget->d_func()->syncBackingStore(exposeRect);
     820        topExtra->inExpose = false;
     821    }
     822
    810823    QWindowSurface *surface = qwidget->windowSurface();
    811824    QPaintEngine *engine = surface ? surface->paintDevice()->paintEngine() : NULL;
     
    856869            Q_ASSERT(false);
    857870        }
    858     } else {
    859         surface->flush(qwidget, QRegion(qt_TRect2QRect(backingStoreRect)), QPoint());
    860871    }
    861872
     
    917928        qwidget->data->crect = cr;
    918929        QTLWExtra *top = qwidget->d_func()->maybeTopData();
    919         if (top)
    920             top->normalGeometry = cr;
     930        if (top && (qwidget->windowState() & (~Qt::WindowActive)) == Qt::WindowNoState)
     931            top->normalGeometry.moveTopLeft(newPos);
    921932        if (qwidget->isVisible()) {
    922933            QMoveEvent e(newPos, oldPos);
     
    931942void QSymbianControl::FocusChanged(TDrawNow /* aDrawNow */)
    932943{
    933     if (m_ignoreFocusChanged)
     944    if (m_ignoreFocusChanged || (qwidget->windowType() & Qt::WindowType_Mask) == Qt::Desktop)
    934945        return;
    935946
     
    953964        qwidget->d_func()->setWindowTitle_sys(qwidget->windowTitle());
    954965#ifdef Q_WS_S60
    955         // If widget is fullscreen, hide status pane and button container
    956         // otherwise show them.
     966        // If widget is fullscreen/minimized, hide status pane and button container otherwise show them.
    957967        CEikStatusPane* statusPane = S60->statusPane();
    958968        CEikButtonGroupContainer* buttonGroup = S60->buttonGroupContainer();
    959         bool isFullscreen = qwidget->windowState() & Qt::WindowFullScreen;
    960         if (statusPane && (bool)statusPane->IsVisible() == isFullscreen)
    961             statusPane->MakeVisible(!isFullscreen);
    962         if (buttonGroup && (bool)buttonGroup->IsVisible() == isFullscreen)
    963             buttonGroup->MakeVisible(!isFullscreen);
     969        TBool visible = !(qwidget->windowState() & (Qt::WindowFullScreen | Qt::WindowMinimized));
     970        if (statusPane)
     971            statusPane->MakeVisible(visible);
     972        if (buttonGroup)
     973            buttonGroup->MakeVisible(visible);
    964974#endif
    965975    } else if (QApplication::activeWindow() == qwidget->window()) {
     
    11981208    }
    11991209
     1210    S60->avkonComponentsSupportTransparency = false;
     1211
     1212#ifdef Q_WS_S60
     1213    TUid KCRUidAvkon = { 0x101F876E };
     1214    TUint32 KAknAvkonTransparencyEnabled = 0x0000000D;
     1215
     1216    CRepository* repository = 0;
     1217    TRAP(err, repository = CRepository::NewL(KCRUidAvkon));
     1218
     1219    if(err == KErrNone) {
     1220        TInt value = 0;
     1221        err = repository->Get(KAknAvkonTransparencyEnabled, value);
     1222        if(err == KErrNone) {
     1223            S60->avkonComponentsSupportTransparency = (value==1) ? true : false;
     1224        }
     1225    }
     1226#endif   
     1227
    12001228    if (touch) {
    12011229        QApplicationPrivate::navigationMode = Qt::NavigationModeNone;
     
    15221550}
    15231551
     1552static inline bool callSymbianEventFilters(const QSymbianEvent *event)
     1553{
     1554    long unused;
     1555    return qApp->filterEvent(const_cast<QSymbianEvent *>(event), &unused);
     1556}
     1557
    15241558/*!
    15251559    \warning This function is only available on Symbian.
     
    15381572    QScopedLoopLevelCounter counter(d->threadData);
    15391573
     1574    if (d->eventDispatcher->filterEvent(const_cast<QSymbianEvent *>(event)))
     1575        return 1;
     1576
    15401577    QWidget *w = qApp ? qApp->focusWidget() : 0;
    15411578    if (w) {
     
    15501587    switch (event->type()) {
    15511588    case QSymbianEvent::WindowServerEvent:
    1552         return d->symbianProcessWsEvent(event->windowServerEvent());
     1589        return d->symbianProcessWsEvent(event);
    15531590    case QSymbianEvent::CommandEvent:
    1554         return d->symbianHandleCommand(event->command());
     1591        return d->symbianHandleCommand(event);
    15551592    case QSymbianEvent::ResourceChangeEvent:
    1556         return d->symbianResourceChange(event->resourceChangeType());
     1593        return d->symbianResourceChange(event);
    15571594    default:
    15581595        return -1;
     
    15601597}
    15611598
    1562 int QApplicationPrivate::symbianProcessWsEvent(const TWsEvent *event)
     1599int QApplicationPrivate::symbianProcessWsEvent(const QSymbianEvent *symbianEvent)
    15631600{
    15641601    // Qt event handling. Handle some events regardless of if the handle is in our
    15651602    // widget map or not.
     1603    const TWsEvent *event = symbianEvent->windowServerEvent();
    15661604    CCoeControl* control = reinterpret_cast<CCoeControl*>(event->Handle());
    15671605    const bool controlInMap = QWidgetPrivate::mapper && QWidgetPrivate::mapper->contains(control);
    15681606    switch (event->Type()) {
    15691607    case EEventPointerEnter:
    1570         if (controlInMap)
     1608        if (controlInMap) {
     1609            callSymbianEventFilters(symbianEvent);
    15711610            return 1; // Qt::Enter will be generated in HandlePointerL
     1611        }
    15721612        break;
    15731613    case EEventPointerExit:
    15741614        if (controlInMap) {
     1615            if (callSymbianEventFilters(symbianEvent))
     1616                return 1;
    15751617            if (S60) {
    15761618                // mouseEvent outside our window, send leave event to last focused widget
     
    15851627        break;
    15861628    case EEventScreenDeviceChanged:
     1629        if (callSymbianEventFilters(symbianEvent))
     1630            return 1;
    15871631        if (S60)
    15881632            S60->updateScreenSize();
     
    15971641    case EEventWindowVisibilityChanged:
    15981642        if (controlInMap) {
     1643            if (callSymbianEventFilters(symbianEvent))
     1644                return 1;
    15991645            const TWsVisibilityChangedEvent *visChangedEvent = event->VisibilityChanged();
    16001646            QWidget *w = QWidgetPrivate::mapper->value(control);
     
    16041650                delete w->d_func()->topData()->backingStore;
    16051651                w->d_func()->topData()->backingStore = 0;
     1652                // In order to ensure that any resources used by the window surface
     1653                // are immediately freed, we flush the WSERV command buffer.
     1654                S60->wsSession().Flush();
    16061655            } else if ((visChangedEvent->iFlags & TWsVisibilityChangedEvent::EPartiallyVisible)
    16071656                       && !w->d_func()->maybeBackingStore()) {
     
    16141663        break;
    16151664    case EEventFocusGained:
     1665        if (callSymbianEventFilters(symbianEvent))
     1666            return 1;
    16161667#ifndef QT_NO_CURSOR
    16171668        //re-enable mouse interaction
     
    16271678        break;
    16281679    case EEventFocusLost:
     1680        if (callSymbianEventFilters(symbianEvent))
     1681            return 1;
    16291682#ifndef QT_NO_CURSOR
    16301683        //disable mouse as may be moving to application that does not support it
     
    16781731  \sa s60EventFilter(), s60ProcessEvent()
    16791732*/
    1680 int QApplicationPrivate::symbianHandleCommand(int command)
     1733int QApplicationPrivate::symbianHandleCommand(const QSymbianEvent *symbianEvent)
    16811734{
    16821735    Q_Q(QApplication);
    16831736    int ret = 0;
     1737
     1738    if (callSymbianEventFilters(symbianEvent))
     1739        return 1;
     1740
     1741    int command = symbianEvent->command();
    16841742
    16851743    switch (command) {
     
    17221780  KAknsMessageSkinChange are handled.
    17231781 */
    1724 int QApplicationPrivate::symbianResourceChange(int type)
     1782int QApplicationPrivate::symbianResourceChange(const QSymbianEvent *symbianEvent)
    17251783{
    17261784    int ret = 0;
     1785
     1786    int type = symbianEvent->resourceChangeType();
    17271787
    17281788    switch (type) {
     
    17301790    case KEikDynamicLayoutVariantSwitch:
    17311791        {
     1792        if (callSymbianEventFilters(symbianEvent))
     1793            return 1;
    17321794        if (S60)
    17331795            S60->updateScreenSize();
     
    17541816#ifndef QT_NO_STYLE_S60
    17551817    case KAknsMessageSkinChange:
     1818        if (callSymbianEventFilters(symbianEvent))
     1819            return 1;
    17561820        if (QS60Style *s60Style = qobject_cast<QS60Style*>(QApplication::style())) {
    17571821            s60Style->d_func()->handleSkinChange();
Note: See TracChangeset for help on using the changeset viewer.