Ignore:
Timestamp:
Aug 2, 2010, 9:27:30 PM (15 years ago)
Author:
Dmitry A. Kuminov
Message:

trunk: Merged in qt 4.6.3 sources from branches/vendor/nokia/qt.

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk

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

    r651 r769  
    5353#include "qdebug.h"
    5454#include "qimage.h"
     55
    5556#include "private/qkeymapper_p.h"
    5657#include "private/qfont_p.h"
     
    6465
    6566#include "apgwgnam.h" // For CApaWindowGroupName
    66 #include <MdaAudioTonePlayer.h>     // For CMdaAudioToneUtility
     67#include <layer.h>     // For CMdaAudioToneUtility
    6768
    6869#if defined(Q_WS_S60)
     
    7374# include <private/qs60mainapplication_p.h>
    7475# include <centralrepository.h>
     76
    7577#endif
    7678
     
    372374    if (S60->curWin == this)
    373375        S60->curWin = 0;
    374     if (!QApplicationPrivate::is_app_closing)
    375         setFocusSafely(false);
     376    if (!QApplicationPrivate::is_app_closing) {
     377        QT_TRY {
     378            setFocusSafely(false);
     379        } QT_CATCH(const std::exception&) {
     380            // ignore exceptions, nothing can be done
     381        }
     382    }
    376383    S60->appUi()->RemoveFromStack(this);
    377384    delete m_longTapDetector;
     
    401408{
    402409    QApplicationPrivate *d = QApplicationPrivate::instance();
     410
     411
     412
     413
     414
     415
    403416
    404417    QRect screenGeometry = qApp->desktop()->screenGeometry(qwidget);
    405418
    406     while (d->appAllTouchPoints.count() <= event->PointerNumber())
    407         d->appAllTouchPoints.append(QTouchEvent::TouchPoint(d->appAllTouchPoints.count()));
     419    QList<QTouchEvent::TouchPoint> points = d->appAllTouchPoints;
     420    while (points.count() <= event->PointerNumber())
     421        points.append(QTouchEvent::TouchPoint(points.count()));
    408422
    409423    Qt::TouchPointStates allStates = 0;
    410     for (int i = 0; i < d->appAllTouchPoints.count(); ++i) {
    411         QTouchEvent::TouchPoint &touchPoint = d->appAllTouchPoints[i];
     424    for (int i = 0; i < oints.count(); ++i) {
     425        QTouchEvent::TouchPoint &touchPoint = oints[i];
    412426
    413427        if (touchPoint.id() == event->PointerNumber()) {
     
    434448            touchPoint.setState(state);
    435449
    436             QPointF screenPos = QPointF(event->iPosition.iX, event->iPosition.iY);
     450            QPointF screenPos = );
    437451            touchPoint.setScreenPos(screenPos);
    438452            touchPoint.setNormalizedPos(QPointF(screenPos.x() / screenGeometry.width(),
    439453                                                screenPos.y() / screenGeometry.height()));
    440454
    441             touchPoint.setPressure(event->Pressure() / qreal(d->maxTouchPressure));
     455            touchPoint.setPressure();
    442456        } else if (touchPoint.state() != Qt::TouchPointReleased) {
    443457            // all other active touch points should be marked as stationary
     
    451465        // all touch points released
    452466        d->appAllTouchPoints.clear();
     467
     468
    453469    }
    454470
    455471    QApplicationPrivate::translateRawTouchEvent(qwidget,
    456472                                                QTouchEvent::TouchScreen,
    457                                                 d->appAllTouchPoints);
     473                                                oints);
    458474}
    459475#endif
     
    533549    sendMouseEvent(receiver, type, globalPos, button, modifiers);
    534550}
     551
     552
     553
     554
     555
     556
     557
     558
    535559
    536560void QSymbianControl::sendMouseEvent(
     
    598622                keyEvent.iCode);
    599623        int keyCode;
    600         if (s60Keysym >= 0x20 && s60Keysym < ENonCharacterKeyBase) {
     624        if (s60Keysym == EKeyNull){ //some key events have 0 in iCode, for them iScanCode should be used
     625            keyCode = qt_keymapper_private()->mapS60ScanCodesToQt(keyEvent.iScanCode);
     626        } else if (s60Keysym >= 0x20 && s60Keysym < ENonCharacterKeyBase) {
    601627            // Normal characters keys.
    602628            keyCode = s60Keysym;
     
    626652                QPoint pos = QCursor::pos();
    627653                TPointerEvent fakeEvent;
     654
    628655                TInt x = pos.x();
    629656                TInt y = pos.y();
    630657                if (type == EEventKeyUp) {
    631                     if (keyCode == Qt::Key_Select)
     658                    if (keyCode == Qt::Key_Select &&
     659                        (S60->virtualMousePressedKeys & QS60Data::Select))
    632660                        fakeEvent.iType = TPointerEvent::EButton1Up;
    633661                    S60->virtualMouseAccel = 1;
     
    678706                        // down messages for some keys. Therefore, make sure we have a clean slate
    679707                        // of pressed keys before starting a new button press.
    680                         if (S60->virtualMousePressedKeys != 0) {
    681                             S60->virtualMousePressedKeys |= QS60Data::Select;
     708                        if (S60->virtualMousePressedKeys & QS60Data::Select) {
    682709                            return EKeyWasConsumed;
    683710                        } else {
     
    702729                fakeEvent.iPosition = cpos;
    703730                fakeEvent.iParentPosition = epos;
    704                 HandlePointerEvent(fakeEvent);
     731                if(fakeEvent.iType != -1)
     732                    HandlePointerEvent(fakeEvent);
    705733                return EKeyWasConsumed;
    706734            }
     
    907935            if (!slowResize && tlwExtra)
    908936                tlwExtra->inTopLevelResize = false;
     937
     938
     939
    909940        }
    910941    }
     
    965996#ifdef Q_WS_S60
    966997        // If widget is fullscreen/minimized, hide status pane and button container otherwise show them.
    967         CEikStatusPane* statusPane = S60->statusPane();
    968         CEikButtonGroupContainer* buttonGroup = S60->buttonGroupContainer();
     998        CEikStatusPanestatusPane = S60->statusPane();
     999        CEikButtonGroupContainerbuttonGroup = S60->buttonGroupContainer();
    9691000        TBool visible = !(qwidget->windowState() & (Qt::WindowFullScreen | Qt::WindowMinimized));
    9701001        if (statusPane)
    9711002            statusPane->MakeVisible(visible);
    972         if (buttonGroup)
    973             buttonGroup->MakeVisible(visible);
     1003        if (buttonGroup) {
     1004            // Visibility
     1005            const TBool isFullscreen = qwidget->windowState() & Qt::WindowFullScreen;
     1006            const TBool cbaVisibilityHint = qwidget->windowFlags() & Qt::WindowSoftkeysVisibleHint;
     1007            buttonGroup->MakeVisible(visible || (isFullscreen && cbaVisibilityHint));
     1008        }
    9741009#endif
    9751010    } else if (QApplication::activeWindow() == qwidget->window()) {
    976         if (CCoeEnv::Static()->AppUi()->IsDisplayingMenuOrDialog()) {
     1011        if (CCoeEnv::Static()->AppUi()->IsDisplayingMenuOrDialog()) {
    9771012            QWidget *fw = QApplication::focusWidget();
    9781013            if (fw) {
     
    9891024}
    9901025
     1026
     1027
     1028
     1029
     1030
     1031
     1032
     1033
     1034
     1035
     1036
     1037
     1038
     1039
     1040
     1041
     1042
     1043
     1044
     1045
     1046
    9911047void QSymbianControl::HandleResourceChange(int resourceType)
    9921048{
    9931049    switch (resourceType) {
    9941050    case KInternalStatusPaneChange:
    995         if (qwidget->isFullScreen()) {
    996             SetExtentToWholeScreen();
    997         } else if (qwidget->isMaximized()) {
    998             TRect r = static_cast<CEikAppUi*>(S60->appUi())->ClientRect();
    999             SetExtent(r.iTl, r.Size());
    1000         }
     1051        handleClientAreaChange();
    10011052        if (IsFocused() && IsVisible()) {
    10021053            qwidget->d_func()->setWindowIcon_sys(true);
     
    10101061    case KEikDynamicLayoutVariantSwitch:
    10111062    {
    1012         if (qwidget->isFullScreen()) {
    1013             SetExtentToWholeScreen();
    1014         } else if (qwidget->isMaximized()) {
    1015             TRect r = static_cast<CEikAppUi*>(S60->appUi())->ClientRect();
    1016             SetExtent(r.iTl, r.Size());
    1017         }
     1063        handleClientAreaChange();
    10181064        break;
    10191065    }
     
    11461192#endif
    11471193        S60->wsSession().SetAutoFlush(ETrue);
     1194
     1195
     1196
     1197
    11481198
    11491199    S60->updateScreenSize();
     
    12091259
    12101260    S60->avkonComponentsSupportTransparency = false;
     1261
    12111262
    12121263#ifdef Q_WS_S60
     
    12241275        }
    12251276    }
    1226 #endif   
     1277#endif
    12271278
    12281279    if (touch) {
     
    13791430void QApplicationPrivate::openPopup(QWidget *popup)
    13801431{
     1432
     1433
     1434
    13811435    if (!QApplicationPrivate::popupWidgets)
    13821436        QApplicationPrivate::popupWidgets = new QWidgetList;
    13831437    QApplicationPrivate::popupWidgets->append(popup);
    1384 
    13851438
    13861439    // Cancel focus widget pointer capture and long tap timer
     
    14221475void QApplicationPrivate::closePopup(QWidget *popup)
    14231476{
     1477
     1478
     1479
    14241480    if (!QApplicationPrivate::popupWidgets)
    14251481        return;
     
    14451501              : q_func()->focusWidget();
    14461502          if (fw) {
     1503
     1504
     1505
    14471506              if (fw != q_func()->focusWidget()) {
    14481507                  fw->setFocus(Qt::PopupFocusReason);
     
    18701929{
    18711930#ifdef QT_SYMBIAN_SUPPORTS_ADVANCED_POINTER
     1931
     1932
    18721933    if (HAL::Get(HALData::EPointer3DMaxPressure, maxTouchPressure) != KErrNone)
    18731934        maxTouchPressure = KMaxTInt;
Note: See TracChangeset for help on using the changeset viewer.