summaryrefslogtreecommitdiffstats
path: root/Source/WebCore/platform/Scrollbar.h
diff options
context:
space:
mode:
authorBen Murdoch <benm@google.com>2011-05-16 16:25:10 +0100
committerBen Murdoch <benm@google.com>2011-05-23 18:54:14 +0100
commitab9e7a118cf1ea2e3a93dce683b2ded3e7291ddb (patch)
treedb769fadd053248f85db67434a5b275224defef7 /Source/WebCore/platform/Scrollbar.h
parent52e2557aeb8477967e97fd24f20f8f407a10fa15 (diff)
downloadexternal_webkit-ab9e7a118cf1ea2e3a93dce683b2ded3e7291ddb.zip
external_webkit-ab9e7a118cf1ea2e3a93dce683b2ded3e7291ddb.tar.gz
external_webkit-ab9e7a118cf1ea2e3a93dce683b2ded3e7291ddb.tar.bz2
Merge WebKit at r76408: Initial merge by git.
Change-Id: I5b91decbd693ccbf5c1b8354b37cd68cc9a1ea53
Diffstat (limited to 'Source/WebCore/platform/Scrollbar.h')
-rw-r--r--Source/WebCore/platform/Scrollbar.h35
1 files changed, 14 insertions, 21 deletions
diff --git a/Source/WebCore/platform/Scrollbar.h b/Source/WebCore/platform/Scrollbar.h
index 69e94a1..5db191a 100644
--- a/Source/WebCore/platform/Scrollbar.h
+++ b/Source/WebCore/platform/Scrollbar.h
@@ -36,32 +36,30 @@ namespace WebCore {
class GraphicsContext;
class IntRect;
-class ScrollbarClient;
-class ScrollbarTheme;
class PlatformMouseEvent;
+class ScrollableArea;
+class ScrollbarTheme;
class Scrollbar : public Widget {
public:
- enum ScrollSource {
- FromScrollAnimator,
- NotFromScrollAnimator,
- };
+ // Must be implemented by platforms that can't simply use the Scrollbar base class. Right now the only platform that is not using the base class is GTK.
+ static PassRefPtr<Scrollbar> createNativeScrollbar(ScrollableArea*, ScrollbarOrientation orientation, ScrollbarControlSize size);
virtual ~Scrollbar();
- // Must be implemented by platforms that can't simply use the Scrollbar base class. Right now the only platform that is not using the base class is GTK.
- static PassRefPtr<Scrollbar> createNativeScrollbar(ScrollbarClient* client, ScrollbarOrientation orientation, ScrollbarControlSize size);
+ // Called by the ScrollableArea when the scroll offset changes.
+ void offsetDidChange();
static int pixelsPerLineStep() { return 40; }
static float minFractionToStepWhenPaging() { return 0.875f; }
static int maxOverlapBetweenPages();
- void setClient(ScrollbarClient* client) { m_client = client; }
- ScrollbarClient* client() const { return m_client; }
+ void disconnectFromScrollableArea() { m_scrollableArea = 0; }
+ ScrollableArea* scrollableArea() const { return m_scrollableArea; }
virtual bool isCustomScrollbar() const { return false; }
ScrollbarOrientation orientation() const { return m_orientation; }
-
+
int value() const { return lroundf(m_currentPos); }
float currentPos() const { return m_currentPos; }
int pressedPos() const { return m_pressedPos; }
@@ -73,18 +71,15 @@ public:
int lineStep() const { return m_lineStep; }
int pageStep() const { return m_pageStep; }
float pixelStep() const { return m_pixelStep; }
-
+
ScrollbarPart pressedPart() const { return m_pressedPart; }
ScrollbarPart hoveredPart() const { return m_hoveredPart; }
virtual void setHoveredPart(ScrollbarPart);
virtual void setPressedPart(ScrollbarPart);
void setSteps(int lineStep, int pageStep, int pixelsPerStep = 1);
- bool setValue(int, ScrollSource source);
void setProportion(int visibleSize, int totalSize);
void setPressedPos(int p) { m_pressedPos = p; }
-
- bool scroll(ScrollDirection, ScrollGranularity, float multiplier = 1);
virtual void paint(GraphicsContext*, const IntRect& damageRect);
@@ -130,7 +125,7 @@ public:
virtual IntPoint convertFromContainingView(const IntPoint&) const;
protected:
- Scrollbar(ScrollbarClient*, ScrollbarOrientation, ScrollbarControlSize, ScrollbarTheme* = 0);
+ Scrollbar(ScrollableArea*, ScrollbarOrientation, ScrollbarControlSize, ScrollbarTheme* = 0);
void updateThumb();
virtual void updateThumbPosition();
@@ -145,7 +140,7 @@ protected:
void moveThumb(int pos);
- ScrollbarClient* m_client;
+ ScrollableArea* m_scrollableArea;
ScrollbarOrientation m_orientation;
ScrollbarControlSize m_controlSize;
ScrollbarTheme* m_theme;
@@ -172,10 +167,8 @@ protected:
private:
virtual bool isScrollbar() const { return true; }
virtual AXObjectCache* axObjectCache() const;
-
- bool setCurrentPos(float pos, ScrollSource source);
};
-}
+} // namespace WebCore
-#endif
+#endif // Scrollbar_h