Ignore:
Timestamp:
May 5, 2011, 5:36:53 AM (14 years ago)
Author:
Dmitry A. Kuminov
Message:

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

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk

  • trunk/src/gui/kernel/qwidget_p.h

    r769 r846  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation (qt-info@nokia.com)
     
    115115class QStyle;
    116116
     117class Q_AUTOTEST_EXPORT QWidgetBackingStoreTracker
     118{
     119
     120public:
     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
     151private:
     152    Q_DISABLE_COPY(QWidgetBackingStoreTracker)
     153
     154private:
     155    QWidgetBackingStore* m_ptr;
     156    QSet<QWidget *> m_widgets;
     157};
     158
    117159struct QTLWExtra {
    118160    // *************************** Cross-platform variables *****************************
     
    121163    QIcon *icon; // widget icon
    122164    QPixmap *iconPixmap;
    123     QWidgetBackingStore *backingStore;
     165    QWidgetBackingStoreTracker backingStore;
    124166    QWindowSurface *windowSurface;
    125167    QPainter *sharedPainter;
     
    163205#endif
    164206#elif defined(Q_WS_WIN) // <--------------------------------------------------------- WIN
     207    uint hotkeyRegistered: 1; // Hot key from the STARTUPINFO has been registered.
    165208    HICON winIconBig; // internal big Windows icon
    166209    HICON winIconSmall; // internal small Windows icon
     
    174217    IconRef windowIcon; // the current window icon, if set with setWindowIcon_sys.
    175218    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
    176227#elif defined(Q_WS_QWS) // <--------------------------------------------------------- QWS
    177228#ifndef QT_NO_QWS_MANAGER
     
    180231#elif defined(Q_OS_SYMBIAN)
    181232    uint inExpose : 1; // Prevents drawing recursion
     233    uint nativeWindowTransparencyEnabled : 1; // Tracks native window transparency
    182234#elif defined(Q_WS_PM)
    183235    HWND fId;
     
    396448    void render_helper(QPainter *painter, const QPoint &targetOffset, const QRegion &sourceRegion,
    397449                       QWidget::RenderFlags renderFlags);
     450    void render(QPaintDevice *target, const QPoint &targetOffset, const QRegion &sourceRegion,
     451                QWidget::RenderFlags renderFlags, bool readyToRender);
    398452    void drawWidget(QPaintDevice *pdev, const QRegion &rgn, const QPoint &offset, int flags,
    399453                    QPainter *sharedPainter = 0, QWidgetBackingStore *backingStore = 0);
     
    502556    bool setMaximumSize_helper(int &maxw, int &maxh);
    503557    void setConstraints_sys();
     558    bool pointInsideRectAndMask(const QPoint &) const;
    504559    QWidget *childAt_helper(const QPoint &, bool) const;
     560    QWidget *childAtRecursiveHelper(const QPoint &p, bool, bool includeFrame = false) const;
    505561    void updateGeometry_helper(bool forceUpdate);
    506562
     
    508564    void setLayoutItemMargins(int left, int top, int right, int bottom);
    509565    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() {}
    510571
    511572    QInputContext *inputContext() const;
     
    685746    QList<QAction*> actions;
    686747#endif
     748#ifndef QT_NO_GESTURES
    687749    QMap<Qt::GestureType, Qt::GestureFlags> gestureContext;
     750#endif
    688751
    689752    // Bit fields.
    690     uint high_attributes[3]; // the low ones are in QWidget::widget_attributes
     753    uint high_attributes[4]; // the low ones are in QWidget::widget_attributes
    691754    QPalette::ColorRole fg_role : 8;
    692755    QPalette::ColorRole bg_role : 8;
     
    698761    uint isGLWidget : 1;
    699762    uint usesDoubleBufferedGLContext : 1;
     763#ifndef QT_NO_IM
     764    uint inheritsInputMethodHints : 1;
     765#endif
    700766
    701767    // *************************** Platform specific ************************************
     
    711777    void x11UpdateIsOpaque();
    712778    bool isBackgroundInherited() const;
     779    void updateX11AcceptFocus();
    713780#elif defined(Q_WS_PM) // <----------------------------------------------------------- PM
    714781    uint noPaintOnScreen : 1; // see qwidget_pm.cpp ::paintEngine()
     
    722789#elif defined(Q_WS_WIN) // <--------------------------------------------------------- WIN
    723790    uint noPaintOnScreen : 1; // see qwidget_win.cpp ::paintEngine()
     791#ifndef QT_NO_GESTURES
    724792    uint nativeGesturePanEnabled : 1;
    725 
     793#endif
    726794    bool shouldShowMaximizeButton();
    727795    void winUpdateIsOpaque();
     
    737805    // This is new stuff
    738806    uint needWindowChange : 1;
     807    uint hasAlienChildren : 1;
    739808
    740809    // Each wiget keeps a list of all its child and grandchild OpenGL widgets.
     
    783852    void finishCreateWindow_sys_Carbon(OSWindowRef windowRef);
    784853#else
     854    void setSubWindowStacking(bool set);
     855    void setWindowLevel();
    785856    void finishCreateWindow_sys_Cocoa(void * /*NSWindow * */ windowRef);
    786857    void syncCocoaMask();
    787858    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;
    788866#endif
    789867    void determineWindowClass();
     
    9231001}
    9241002
     1003inline 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
    9251010inline QWidgetBackingStore *QWidgetPrivate::maybeBackingStore() const
    9261011{
    9271012    Q_Q(const QWidget);
    9281013    QTLWExtra *x = q->window()->d_func()->maybeTopData();
    929     return x ? x->backingStore : 0;
     1014    return x ? x->backingStore.data() : 0;
    9301015}
    9311016
Note: See TracChangeset for help on using the changeset viewer.