Changeset 651 for trunk/src/gui/kernel/qapplication_s60.cpp
- Timestamp:
- Mar 8, 2010, 12:52:58 PM (15 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk
- Property svn:mergeinfo changed
/branches/vendor/nokia/qt/4.6.2 (added) merged: 650 /branches/vendor/nokia/qt/current merged: 649 /branches/vendor/nokia/qt/4.6.1 removed
- Property svn:mergeinfo changed
-
trunk/src/gui/kernel/qapplication_s60.cpp
r561 r651 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 20 09Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) … … 72 72 # endif 73 73 # include <private/qs60mainapplication_p.h> 74 # include <centralrepository.h> 74 75 #endif 75 76 … … 808 809 void QSymbianControl::Draw(const TRect& controlRect) const 809 810 { 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 810 823 QWindowSurface *surface = qwidget->windowSurface(); 811 824 QPaintEngine *engine = surface ? surface->paintDevice()->paintEngine() : NULL; … … 856 869 Q_ASSERT(false); 857 870 } 858 } else {859 surface->flush(qwidget, QRegion(qt_TRect2QRect(backingStoreRect)), QPoint());860 871 } 861 872 … … 917 928 qwidget->data->crect = cr; 918 929 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); 921 932 if (qwidget->isVisible()) { 922 933 QMoveEvent e(newPos, oldPos); … … 931 942 void QSymbianControl::FocusChanged(TDrawNow /* aDrawNow */) 932 943 { 933 if (m_ignoreFocusChanged )944 if (m_ignoreFocusChanged || (qwidget->windowType() & Qt::WindowType_Mask) == Qt::Desktop) 934 945 return; 935 946 … … 953 964 qwidget->d_func()->setWindowTitle_sys(qwidget->windowTitle()); 954 965 #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. 957 967 CEikStatusPane* statusPane = S60->statusPane(); 958 968 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); 964 974 #endif 965 975 } else if (QApplication::activeWindow() == qwidget->window()) { … … 1198 1208 } 1199 1209 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 1200 1228 if (touch) { 1201 1229 QApplicationPrivate::navigationMode = Qt::NavigationModeNone; … … 1522 1550 } 1523 1551 1552 static inline bool callSymbianEventFilters(const QSymbianEvent *event) 1553 { 1554 long unused; 1555 return qApp->filterEvent(const_cast<QSymbianEvent *>(event), &unused); 1556 } 1557 1524 1558 /*! 1525 1559 \warning This function is only available on Symbian. … … 1538 1572 QScopedLoopLevelCounter counter(d->threadData); 1539 1573 1574 if (d->eventDispatcher->filterEvent(const_cast<QSymbianEvent *>(event))) 1575 return 1; 1576 1540 1577 QWidget *w = qApp ? qApp->focusWidget() : 0; 1541 1578 if (w) { … … 1550 1587 switch (event->type()) { 1551 1588 case QSymbianEvent::WindowServerEvent: 1552 return d->symbianProcessWsEvent(event ->windowServerEvent());1589 return d->symbianProcessWsEvent(event); 1553 1590 case QSymbianEvent::CommandEvent: 1554 return d->symbianHandleCommand(event ->command());1591 return d->symbianHandleCommand(event); 1555 1592 case QSymbianEvent::ResourceChangeEvent: 1556 return d->symbianResourceChange(event ->resourceChangeType());1593 return d->symbianResourceChange(event); 1557 1594 default: 1558 1595 return -1; … … 1560 1597 } 1561 1598 1562 int QApplicationPrivate::symbianProcessWsEvent(const TWsEvent *event)1599 int QApplicationPrivate::symbianProcessWsEvent(const QSymbianEvent *symbianEvent) 1563 1600 { 1564 1601 // Qt event handling. Handle some events regardless of if the handle is in our 1565 1602 // widget map or not. 1603 const TWsEvent *event = symbianEvent->windowServerEvent(); 1566 1604 CCoeControl* control = reinterpret_cast<CCoeControl*>(event->Handle()); 1567 1605 const bool controlInMap = QWidgetPrivate::mapper && QWidgetPrivate::mapper->contains(control); 1568 1606 switch (event->Type()) { 1569 1607 case EEventPointerEnter: 1570 if (controlInMap) 1608 if (controlInMap) { 1609 callSymbianEventFilters(symbianEvent); 1571 1610 return 1; // Qt::Enter will be generated in HandlePointerL 1611 } 1572 1612 break; 1573 1613 case EEventPointerExit: 1574 1614 if (controlInMap) { 1615 if (callSymbianEventFilters(symbianEvent)) 1616 return 1; 1575 1617 if (S60) { 1576 1618 // mouseEvent outside our window, send leave event to last focused widget … … 1585 1627 break; 1586 1628 case EEventScreenDeviceChanged: 1629 if (callSymbianEventFilters(symbianEvent)) 1630 return 1; 1587 1631 if (S60) 1588 1632 S60->updateScreenSize(); … … 1597 1641 case EEventWindowVisibilityChanged: 1598 1642 if (controlInMap) { 1643 if (callSymbianEventFilters(symbianEvent)) 1644 return 1; 1599 1645 const TWsVisibilityChangedEvent *visChangedEvent = event->VisibilityChanged(); 1600 1646 QWidget *w = QWidgetPrivate::mapper->value(control); … … 1604 1650 delete w->d_func()->topData()->backingStore; 1605 1651 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(); 1606 1655 } else if ((visChangedEvent->iFlags & TWsVisibilityChangedEvent::EPartiallyVisible) 1607 1656 && !w->d_func()->maybeBackingStore()) { … … 1614 1663 break; 1615 1664 case EEventFocusGained: 1665 if (callSymbianEventFilters(symbianEvent)) 1666 return 1; 1616 1667 #ifndef QT_NO_CURSOR 1617 1668 //re-enable mouse interaction … … 1627 1678 break; 1628 1679 case EEventFocusLost: 1680 if (callSymbianEventFilters(symbianEvent)) 1681 return 1; 1629 1682 #ifndef QT_NO_CURSOR 1630 1683 //disable mouse as may be moving to application that does not support it … … 1678 1731 \sa s60EventFilter(), s60ProcessEvent() 1679 1732 */ 1680 int QApplicationPrivate::symbianHandleCommand( int command)1733 int QApplicationPrivate::symbianHandleCommand(const QSymbianEvent *symbianEvent) 1681 1734 { 1682 1735 Q_Q(QApplication); 1683 1736 int ret = 0; 1737 1738 if (callSymbianEventFilters(symbianEvent)) 1739 return 1; 1740 1741 int command = symbianEvent->command(); 1684 1742 1685 1743 switch (command) { … … 1722 1780 KAknsMessageSkinChange are handled. 1723 1781 */ 1724 int QApplicationPrivate::symbianResourceChange( int type)1782 int QApplicationPrivate::symbianResourceChange(const QSymbianEvent *symbianEvent) 1725 1783 { 1726 1784 int ret = 0; 1785 1786 int type = symbianEvent->resourceChangeType(); 1727 1787 1728 1788 switch (type) { … … 1730 1790 case KEikDynamicLayoutVariantSwitch: 1731 1791 { 1792 if (callSymbianEventFilters(symbianEvent)) 1793 return 1; 1732 1794 if (S60) 1733 1795 S60->updateScreenSize(); … … 1754 1816 #ifndef QT_NO_STYLE_S60 1755 1817 case KAknsMessageSkinChange: 1818 if (callSymbianEventFilters(symbianEvent)) 1819 return 1; 1756 1820 if (QS60Style *s60Style = qobject_cast<QS60Style*>(QApplication::style())) { 1757 1821 s60Style->d_func()->handleSkinChange();
Note:
See TracChangeset
for help on using the changeset viewer.