src/gui/kernel/qwidget_p.h
changeset 3 41300fa6a67c
parent 0 1918ee327afb
child 4 3b1da2848fc7
child 7 f7bc934e204c
child 18 2f34d5167611
--- a/src/gui/kernel/qwidget_p.h	Tue Jan 26 12:42:25 2010 +0200
+++ b/src/gui/kernel/qwidget_p.h	Tue Feb 02 00:43:10 2010 +0200
@@ -230,12 +230,42 @@
 #elif defined(Q_OS_SYMBIAN) // <----------------------------------------------------- Symbian
     uint activated : 1; // RWindowBase::Activated has been called
 
-    // If set, QSymbianControl::Draw does not blit this widget
-    // This is to allow, for use cases such as video, widgets which, from the Qt point
-    // of view, are just placeholders in the scene.  For these widgets, any necessary
-    // drawing to the UI framebuffer is done by the relevant Symbian subsystem.  For
-    // video rendering, this would be an MMF controller, or MDF post-processor.
-    uint disableBlit : 1;
+    /**
+     * Defines the behaviour of QSymbianControl::Draw.
+     */
+    enum NativePaintMode {
+        /**
+         * Normal drawing mode: blits the required region of the backing store
+         * via WSERV.
+         */
+        Blit,
+
+        /**
+         * Disable drawing for this widget.
+         */
+        Disable,
+
+        /**
+         * Paint zeros into the WSERV framebuffer, using BitGDI APIs.  For windows
+         * with an EColor16MU display mode, zero is written only into the R, G and B
+         * channels of the pixel.
+         */
+        ZeroFill,
+
+        Default = Blit
+    };
+
+    NativePaintMode nativePaintMode : 2;
+
+    /**
+     * If this bit is set, each native widget receives the signals from the
+     * Symbian control immediately before and immediately after draw ops are
+     * sent to the window server for this control:
+     *      void beginNativePaintEvent(const QRect &paintRect);
+     *      void endNativePaintEvent(const QRect &paintRect);
+     */
+    uint receiveNativePaintEvents : 1;
+
 #endif
 };
 
@@ -384,9 +414,10 @@
     void setOpaque(bool opaque);
     void updateIsTranslucent();
     bool paintOnScreen() const;
+#ifndef QT_NO_GRAPHICSEFFECT
     void invalidateGraphicsEffectsRecursively();
+#endif //QT_NO_GRAPHICSEFFECT
 
-    QRegion getOpaqueRegion() const;
     const QRegion &getOpaqueChildren() const;
     void setDirtyOpaqueRegion();
 
@@ -464,6 +495,12 @@
     void setLayoutItemMargins(QStyle::SubElement element, const QStyleOption *opt = 0);
 
     QInputContext *inputContext() const;
+    inline QWidget *effectiveFocusWidget() {
+        QWidget *w = q_func();
+        while (w->focusProxy())
+            w = w->focusProxy();
+        return w;
+    }
 
     void setModal_sys();
 
@@ -478,7 +515,7 @@
         QGraphicsProxyWidget *ancestorProxy = widget->d_func()->nearestGraphicsProxyWidget(widget);
         //It's embedded if it has an ancestor
         if (ancestorProxy) {
-            if (!bypassGraphicsProxyWidget(widget)) {
+            if (!bypassGraphicsProxyWidget(widget) && ancestorProxy->scene() != 0) {
                 // One view, let be smart and return the viewport rect then the popup is aligned
                 if (ancestorProxy->scene()->views().size() == 1) {
                     QGraphicsView *view = ancestorProxy->scene()->views().at(0);
@@ -531,8 +568,10 @@
 
     inline QRect effectiveRectFor(const QRect &rect) const
     {
+#ifndef QT_NO_GRAPHICSEFFECT
         if (graphicsEffect && graphicsEffect->isEnabled())
             return graphicsEffect->boundingRectFor(rect).toAlignedRect();
+#endif //QT_NO_GRAPHICSEFFECT
         return rect;
     }
 
@@ -631,7 +670,7 @@
 #ifndef QT_NO_ACTION
     QList<QAction*> actions;
 #endif
-    QMap<Qt::GestureType, Qt::GestureContext> gestureContext;
+    QMap<Qt::GestureType, Qt::GestureFlags> gestureContext;
 
     // Bit fields.
     uint high_attributes[3]; // the low ones are in QWidget::widget_attributes
@@ -775,6 +814,7 @@
     QPainter *painter;
 };
 
+#ifndef QT_NO_GRAPHICSEFFECT
 class QWidgetEffectSourcePrivate : public QGraphicsEffectSourcePrivate
 {
 public:
@@ -783,7 +823,7 @@
     {}
 
     inline void detach()
-    { m_widget->setGraphicsEffect(0); }
+    { m_widget->d_func()->graphicsEffect = 0; }
 
     inline const QGraphicsItem *graphicsItem() const
     { return 0; }
@@ -819,13 +859,15 @@
 
     QRectF boundingRect(Qt::CoordinateSystem system) const;
     void draw(QPainter *p);
-    QPixmap pixmap(Qt::CoordinateSystem system, QPoint *offset) const;
+    QPixmap pixmap(Qt::CoordinateSystem system, QPoint *offset,
+                   QGraphicsEffect::PixmapPadMode mode) const;
 
     QWidget *m_widget;
     QWidgetPaintContext *context;
     QTransform lastEffectTransform;
     bool updateDueToGraphicsEffect;
 };
+#endif //QT_NO_GRAPHICSEFFECT
 
 inline QWExtra *QWidgetPrivate::extraData() const
 {