OSDN Git Service

Swap tiled page tiles on zoom
[android-x86/external-webkit.git] / Source / WebCore / platform / ScrollView.h
index 7df735a..558aee2 100644 (file)
@@ -62,6 +62,8 @@ public:
     virtual int scrollPosition(Scrollbar*) const;
     virtual void setScrollOffset(const IntPoint&);
     virtual void didCompleteRubberBand(const IntSize&) const;
+    virtual void notifyPageThatContentAreaWillPaint() const;
+    virtual bool isScrollCornerVisible() const;
 
     // NOTE: This should only be called by the overriden setScrollOffset from ScrollableArea.
     virtual void scrollTo(const IntSize& newOffset);
@@ -84,6 +86,8 @@ public:
     virtual Scrollbar* verticalScrollbar() const { return m_verticalScrollbar.get(); }
     bool isScrollViewScrollbar(const Widget* child) const { return horizontalScrollbar() == child || verticalScrollbar() == child; }
 
+    void positionScrollbarLayers();
+
     // Functions for setting and retrieving the scrolling mode in each axis (horizontal/vertical). The mode has values of
     // AlwaysOff, AlwaysOn, and Auto. AlwaysOff means never show a scrollbar, AlwaysOn means always show a scrollbar.
     // Auto means show a scrollbar only when one is needed.
@@ -180,13 +184,11 @@ public:
     int scrollX() const { return scrollPosition().x(); }
     int scrollY() const { return scrollPosition().y(); }
 
-    // Functions for querying the current scrolled position, negating the effects of overhang.
-    int scrollXForFixedPosition() const;
-    int scrollYForFixedPosition() const;
-    IntSize scrollOffsetForFixedPosition() const;
-
     IntSize overhangAmount() const;
 
+    void cacheCurrentScrollPosition() { m_cachedScrollPosition = scrollPosition(); }
+    IntPoint cachedScrollPosition() const { return m_cachedScrollPosition; }
+
     // Functions for scrolling the view.
     void setScrollPosition(const IntPoint&);
     void scrollBy(const IntSize& s) { return setScrollPosition(scrollPosition() + s); }
@@ -234,6 +236,7 @@ public:
     
     // Widget override to update our scrollbars and notify our contents of the resize.
     virtual void setFrameRect(const IntRect&);
+    virtual void setBoundsSize(const IntSize&);
 
     // For platforms that need to hit test scrollbars from within the engine's event handlers (like Win32).
     Scrollbar* scrollbarAtPoint(const IntPoint& windowPoint);
@@ -281,12 +284,17 @@ public:
 
     virtual bool isPointInScrollbarCorner(const IntPoint&);
     virtual bool scrollbarCornerPresent() const;
+    virtual IntRect scrollCornerRect() const;
+    virtual void paintScrollCorner(GraphicsContext*, const IntRect& cornerRect);
 
     virtual IntRect convertFromScrollbarToContainingView(const Scrollbar*, const IntRect&) const;
     virtual IntRect convertFromContainingViewToScrollbar(const Scrollbar*, const IntRect&) const;
     virtual IntPoint convertFromScrollbarToContainingView(const Scrollbar*, const IntPoint&) const;
     virtual IntPoint convertFromContainingViewToScrollbar(const Scrollbar*, const IntPoint&) const;
 
+    bool containsScrollableAreaWithOverlayScrollbars() const { return m_containsScrollableAreaWithOverlayScrollbars; }
+    void setContainsScrollableAreaWithOverlayScrollbars(bool contains) { m_containsScrollableAreaWithOverlayScrollbars = contains; }
+
 protected:
     ScrollView();
 
@@ -299,13 +307,15 @@ protected:
     virtual void contentsResized() = 0;
     virtual void visibleContentsResized() = 0;
 
+    IntSize boundsSize() const { return m_boundsSize; }
+    void setInitialBoundsSize(const IntSize&);
+
     // These functions are used to create/destroy scrollbars.
     void setHasHorizontalScrollbar(bool);
     void setHasVerticalScrollbar(bool);
 
-    IntRect scrollCornerRect() const;
     virtual void updateScrollCorner();
-    virtual void paintScrollCorner(GraphicsContext*, const IntRect& cornerRect);
+    virtual void invalidateScrollCornerRect(const IntRect&);
 
     // Scroll the content by blitting the pixels.
     virtual bool scrollContentsFastPath(const IntSize& scrollDelta, const IntRect& rectToScroll, const IntRect& clipRect);
@@ -338,6 +348,7 @@ private:
 
     IntRect m_actualVisibleContentRect;
     IntSize m_scrollOffset; // FIXME: Would rather store this as a position, but we will wait to make this change until more code is shared.
+    IntPoint m_cachedScrollPosition;
     IntSize m_fixedLayoutSize;
     IntSize m_contentsSize;
 
@@ -355,18 +366,9 @@ private:
     bool m_clipsRepaints;
     bool m_delegatesScrolling;
 
-    // There are 8 possible combinations of writing mode and direction.  Scroll origin will be non-zero in the x or y axis
-    // if there is any reversed direction or writing-mode.  The combinations are:
-    // writing-mode / direction     scrollOrigin.x() set    scrollOrigin.y() set
-    // horizontal-tb / ltr          NO                      NO
-    // horizontal-tb / rtl          YES                     NO
-    // horizontal-bt / ltr          NO                      YES
-    // horizontal-bt / rtl          YES                     YES
-    // vertical-lr / ltr            NO                      NO
-    // vertical-lr / rtl            NO                      YES
-    // vertical-rl / ltr            YES                     NO
-    // vertical-rl / rtl            YES                     YES
-    IntPoint m_scrollOrigin;
+    bool m_containsScrollableAreaWithOverlayScrollbars;
+
+    IntSize m_boundsSize;
 
     void init();
     void destroy();