Changeset 846 for trunk/src/gui/kernel/qwidget_p.h
- Timestamp:
- May 5, 2011, 5:36:53 AM (14 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk
- Property svn:mergeinfo changed
/branches/vendor/nokia/qt/4.7.2 (added) merged: 845 /branches/vendor/nokia/qt/current merged: 844 /branches/vendor/nokia/qt/4.6.3 removed
- Property svn:mergeinfo changed
-
trunk/src/gui/kernel/qwidget_p.h
r769 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) … … 115 115 class QStyle; 116 116 117 class Q_AUTOTEST_EXPORT QWidgetBackingStoreTracker 118 { 119 120 public: 121 QWidgetBackingStoreTracker(); 122 ~QWidgetBackingStoreTracker(); 123 124 void create(QWidget *tlw); 125 void destroy(); 126 127 void registerWidget(QWidget *w); 128 void unregisterWidget(QWidget *w); 129 void unregisterWidgetSubtree(QWidget *w); 130 131 inline QWidgetBackingStore* data() 132 { 133 return m_ptr; 134 } 135 136 inline QWidgetBackingStore* operator->() 137 { 138 return m_ptr; 139 } 140 141 inline QWidgetBackingStore& operator*() 142 { 143 return *m_ptr; 144 } 145 146 inline operator bool() const 147 { 148 return (0 != m_ptr); 149 } 150 151 private: 152 Q_DISABLE_COPY(QWidgetBackingStoreTracker) 153 154 private: 155 QWidgetBackingStore* m_ptr; 156 QSet<QWidget *> m_widgets; 157 }; 158 117 159 struct QTLWExtra { 118 160 // *************************** Cross-platform variables ***************************** … … 121 163 QIcon *icon; // widget icon 122 164 QPixmap *iconPixmap; 123 QWidgetBackingStore *backingStore;165 QWidgetBackingStoreTracker backingStore; 124 166 QWindowSurface *windowSurface; 125 167 QPainter *sharedPainter; … … 163 205 #endif 164 206 #elif defined(Q_WS_WIN) // <--------------------------------------------------------- WIN 207 uint hotkeyRegistered: 1; // Hot key from the STARTUPINFO has been registered. 165 208 HICON winIconBig; // internal big Windows icon 166 209 HICON winIconSmall; // internal small Windows icon … … 174 217 IconRef windowIcon; // the current window icon, if set with setWindowIcon_sys. 175 218 quint32 savedWindowAttributesFromMaximized; // Saved attributes from when the calling updateMaximizeButton_sys() 219 #ifdef QT_MAC_USE_COCOA 220 // This value is just to make sure we maximize and restore to the right location, yet we allow apps to be maximized and 221 // manually resized. 222 // The name is misleading, since this is set when maximizing the window. It is a hint to saveGeometry(..) to record the 223 // starting position as 0,0 instead of the normal starting position. 224 bool wasMaximized; 225 #endif // QT_MAC_USE_COCOA 226 176 227 #elif defined(Q_WS_QWS) // <--------------------------------------------------------- QWS 177 228 #ifndef QT_NO_QWS_MANAGER … … 180 231 #elif defined(Q_OS_SYMBIAN) 181 232 uint inExpose : 1; // Prevents drawing recursion 233 uint nativeWindowTransparencyEnabled : 1; // Tracks native window transparency 182 234 #elif defined(Q_WS_PM) 183 235 HWND fId; … … 396 448 void render_helper(QPainter *painter, const QPoint &targetOffset, const QRegion &sourceRegion, 397 449 QWidget::RenderFlags renderFlags); 450 void render(QPaintDevice *target, const QPoint &targetOffset, const QRegion &sourceRegion, 451 QWidget::RenderFlags renderFlags, bool readyToRender); 398 452 void drawWidget(QPaintDevice *pdev, const QRegion &rgn, const QPoint &offset, int flags, 399 453 QPainter *sharedPainter = 0, QWidgetBackingStore *backingStore = 0); … … 502 556 bool setMaximumSize_helper(int &maxw, int &maxh); 503 557 void setConstraints_sys(); 558 bool pointInsideRectAndMask(const QPoint &) const; 504 559 QWidget *childAt_helper(const QPoint &, bool) const; 560 QWidget *childAtRecursiveHelper(const QPoint &p, bool, bool includeFrame = false) const; 505 561 void updateGeometry_helper(bool forceUpdate); 506 562 … … 508 564 void setLayoutItemMargins(int left, int top, int right, int bottom); 509 565 void setLayoutItemMargins(QStyle::SubElement element, const QStyleOption *opt = 0); 566 567 // aboutToDestroy() is called just before the contents of 568 // QWidget::destroy() is executed. It's used to signal QWidget 569 // sub-classes that their internals are about to be released. 570 virtual void aboutToDestroy() {} 510 571 511 572 QInputContext *inputContext() const; … … 685 746 QList<QAction*> actions; 686 747 #endif 748 #ifndef QT_NO_GESTURES 687 749 QMap<Qt::GestureType, Qt::GestureFlags> gestureContext; 750 #endif 688 751 689 752 // Bit fields. 690 uint high_attributes[ 3]; // the low ones are in QWidget::widget_attributes753 uint high_attributes[4]; // the low ones are in QWidget::widget_attributes 691 754 QPalette::ColorRole fg_role : 8; 692 755 QPalette::ColorRole bg_role : 8; … … 698 761 uint isGLWidget : 1; 699 762 uint usesDoubleBufferedGLContext : 1; 763 #ifndef QT_NO_IM 764 uint inheritsInputMethodHints : 1; 765 #endif 700 766 701 767 // *************************** Platform specific ************************************ … … 711 777 void x11UpdateIsOpaque(); 712 778 bool isBackgroundInherited() const; 779 void updateX11AcceptFocus(); 713 780 #elif defined(Q_WS_PM) // <----------------------------------------------------------- PM 714 781 uint noPaintOnScreen : 1; // see qwidget_pm.cpp ::paintEngine() … … 722 789 #elif defined(Q_WS_WIN) // <--------------------------------------------------------- WIN 723 790 uint noPaintOnScreen : 1; // see qwidget_win.cpp ::paintEngine() 791 #ifndef QT_NO_GESTURES 724 792 uint nativeGesturePanEnabled : 1; 725 793 #endif 726 794 bool shouldShowMaximizeButton(); 727 795 void winUpdateIsOpaque(); … … 737 805 // This is new stuff 738 806 uint needWindowChange : 1; 807 uint hasAlienChildren : 1; 739 808 740 809 // Each wiget keeps a list of all its child and grandchild OpenGL widgets. … … 783 852 void finishCreateWindow_sys_Carbon(OSWindowRef windowRef); 784 853 #else 854 void setSubWindowStacking(bool set); 855 void setWindowLevel(); 785 856 void finishCreateWindow_sys_Cocoa(void * /*NSWindow * */ windowRef); 786 857 void syncCocoaMask(); 787 858 void finishCocoaMaskSetup(); 859 void syncUnifiedMode(); 860 // Did we add the drawRectOriginal method? 861 bool drawRectOriginalAdded; 862 // Is the original drawRect method available? 863 bool originalDrawMethod; 864 // Do we need to change the methods? 865 bool changeMethods; 788 866 #endif 789 867 void determineWindowClass(); … … 923 1001 } 924 1002 1003 inline bool QWidgetPrivate::pointInsideRectAndMask(const QPoint &p) const 1004 { 1005 Q_Q(const QWidget); 1006 return q->rect().contains(p) && (!extra || !extra->hasMask || q->testAttribute(Qt::WA_MouseNoMask) 1007 || extra->mask.contains(p)); 1008 } 1009 925 1010 inline QWidgetBackingStore *QWidgetPrivate::maybeBackingStore() const 926 1011 { 927 1012 Q_Q(const QWidget); 928 1013 QTLWExtra *x = q->window()->d_func()->maybeTopData(); 929 return x ? x->backingStore : 0;1014 return x ? x->backingStore.data() : 0; 930 1015 } 931 1016
Note:
See TracChangeset
for help on using the changeset viewer.