| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2010, 2011 Apple Inc. All rights reserved. | 2 * Copyright (C) 2010, 2011 Apple Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
| 8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
| 9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
| 10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
| (...skipping 22 matching lines...) Expand all Loading... |
| 33 #include "core/platform/graphics/IntRect.h" | 33 #include "core/platform/graphics/IntRect.h" |
| 34 #include "core/platform/mac/ScrollElasticityController.h" | 34 #include "core/platform/mac/ScrollElasticityController.h" |
| 35 #include "wtf/RetainPtr.h" | 35 #include "wtf/RetainPtr.h" |
| 36 | 36 |
| 37 OBJC_CLASS WebScrollAnimationHelperDelegate; | 37 OBJC_CLASS WebScrollAnimationHelperDelegate; |
| 38 OBJC_CLASS WebScrollbarPainterControllerDelegate; | 38 OBJC_CLASS WebScrollbarPainterControllerDelegate; |
| 39 OBJC_CLASS WebScrollbarPainterDelegate; | 39 OBJC_CLASS WebScrollbarPainterDelegate; |
| 40 | 40 |
| 41 typedef id ScrollbarPainterController; | 41 typedef id ScrollbarPainterController; |
| 42 | 42 |
| 43 #if !ENABLE(RUBBER_BANDING) | 43 #if !USE(RUBBER_BANDING) |
| 44 class ScrollElasticityControllerClient { }; | 44 class ScrollElasticityControllerClient { }; |
| 45 #endif | 45 #endif |
| 46 | 46 |
| 47 namespace WebCore { | 47 namespace WebCore { |
| 48 | 48 |
| 49 class Scrollbar; | 49 class Scrollbar; |
| 50 | 50 |
| 51 class ScrollAnimatorMac : public ScrollAnimator, private ScrollElasticityControl
lerClient { | 51 class ScrollAnimatorMac : public ScrollAnimator, private ScrollElasticityControl
lerClient { |
| 52 | 52 |
| 53 public: | 53 public: |
| (...skipping 27 matching lines...) Expand all Loading... |
| 81 void initialScrollbarPaintTimerFired(Timer<ScrollAnimatorMac>*); | 81 void initialScrollbarPaintTimerFired(Timer<ScrollAnimatorMac>*); |
| 82 Timer<ScrollAnimatorMac> m_initialScrollbarPaintTimer; | 82 Timer<ScrollAnimatorMac> m_initialScrollbarPaintTimer; |
| 83 | 83 |
| 84 void sendContentAreaScrolledTimerFired(Timer<ScrollAnimatorMac>*); | 84 void sendContentAreaScrolledTimerFired(Timer<ScrollAnimatorMac>*); |
| 85 Timer<ScrollAnimatorMac> m_sendContentAreaScrolledTimer; | 85 Timer<ScrollAnimatorMac> m_sendContentAreaScrolledTimer; |
| 86 FloatSize m_contentAreaScrolledTimerScrollDelta; | 86 FloatSize m_contentAreaScrolledTimerScrollDelta; |
| 87 | 87 |
| 88 virtual bool scroll(ScrollbarOrientation, ScrollGranularity, float step, flo
at multiplier); | 88 virtual bool scroll(ScrollbarOrientation, ScrollGranularity, float step, flo
at multiplier); |
| 89 virtual void scrollToOffsetWithoutAnimation(const FloatPoint&); | 89 virtual void scrollToOffsetWithoutAnimation(const FloatPoint&); |
| 90 | 90 |
| 91 #if ENABLE(RUBBER_BANDING) | 91 #if USE(RUBBER_BANDING) |
| 92 virtual bool handleWheelEvent(const PlatformWheelEvent&) OVERRIDE; | 92 virtual bool handleWheelEvent(const PlatformWheelEvent&) OVERRIDE; |
| 93 #endif | 93 #endif |
| 94 | 94 |
| 95 virtual void handleWheelEventPhase(PlatformWheelEventPhase) OVERRIDE; | 95 virtual void handleWheelEventPhase(PlatformWheelEventPhase) OVERRIDE; |
| 96 | 96 |
| 97 virtual void cancelAnimations(); | 97 virtual void cancelAnimations(); |
| 98 virtual void setIsActive(); | 98 virtual void setIsActive(); |
| 99 | 99 |
| 100 virtual void notifyPositionChanged(const FloatSize& delta); | 100 virtual void notifyPositionChanged(const FloatSize& delta); |
| 101 virtual void contentAreaWillPaint() const; | 101 virtual void contentAreaWillPaint() const; |
| (...skipping 21 matching lines...) Expand all Loading... |
| 123 virtual bool shouldScrollbarParticipateInHitTesting(Scrollbar*); | 123 virtual bool shouldScrollbarParticipateInHitTesting(Scrollbar*); |
| 124 | 124 |
| 125 virtual void notifyContentAreaScrolled(const FloatSize& delta) OVERRIDE; | 125 virtual void notifyContentAreaScrolled(const FloatSize& delta) OVERRIDE; |
| 126 | 126 |
| 127 FloatPoint adjustScrollPositionIfNecessary(const FloatPoint&) const; | 127 FloatPoint adjustScrollPositionIfNecessary(const FloatPoint&) const; |
| 128 | 128 |
| 129 void immediateScrollTo(const FloatPoint&); | 129 void immediateScrollTo(const FloatPoint&); |
| 130 | 130 |
| 131 virtual bool isRubberBandInProgress() const OVERRIDE; | 131 virtual bool isRubberBandInProgress() const OVERRIDE; |
| 132 | 132 |
| 133 #if ENABLE(RUBBER_BANDING) | 133 #if USE(RUBBER_BANDING) |
| 134 /// ScrollElasticityControllerClient member functions. | 134 /// ScrollElasticityControllerClient member functions. |
| 135 virtual IntSize stretchAmount() OVERRIDE; | 135 virtual IntSize stretchAmount() OVERRIDE; |
| 136 virtual bool allowsHorizontalStretching() OVERRIDE; | 136 virtual bool allowsHorizontalStretching() OVERRIDE; |
| 137 virtual bool allowsVerticalStretching() OVERRIDE; | 137 virtual bool allowsVerticalStretching() OVERRIDE; |
| 138 virtual bool pinnedInDirection(const FloatSize&) OVERRIDE; | 138 virtual bool pinnedInDirection(const FloatSize&) OVERRIDE; |
| 139 virtual bool canScrollHorizontally() OVERRIDE; | 139 virtual bool canScrollHorizontally() OVERRIDE; |
| 140 virtual bool canScrollVertically() OVERRIDE; | 140 virtual bool canScrollVertically() OVERRIDE; |
| 141 virtual bool shouldRubberBandInDirection(ScrollDirection) OVERRIDE; | 141 virtual bool shouldRubberBandInDirection(ScrollDirection) OVERRIDE; |
| 142 virtual WebCore::IntPoint absoluteScrollPosition() OVERRIDE; | 142 virtual WebCore::IntPoint absoluteScrollPosition() OVERRIDE; |
| 143 virtual void immediateScrollByWithoutContentEdgeConstraints(const FloatSize&
) OVERRIDE; | 143 virtual void immediateScrollByWithoutContentEdgeConstraints(const FloatSize&
) OVERRIDE; |
| 144 virtual void immediateScrollBy(const FloatSize&) OVERRIDE; | 144 virtual void immediateScrollBy(const FloatSize&) OVERRIDE; |
| 145 virtual void startSnapRubberbandTimer() OVERRIDE; | 145 virtual void startSnapRubberbandTimer() OVERRIDE; |
| 146 virtual void stopSnapRubberbandTimer() OVERRIDE; | 146 virtual void stopSnapRubberbandTimer() OVERRIDE; |
| 147 | 147 |
| 148 bool pinnedInDirection(float deltaX, float deltaY); | 148 bool pinnedInDirection(float deltaX, float deltaY); |
| 149 void snapRubberBandTimerFired(Timer<ScrollAnimatorMac>*); | 149 void snapRubberBandTimerFired(Timer<ScrollAnimatorMac>*); |
| 150 | 150 |
| 151 ScrollElasticityController m_scrollElasticityController; | 151 ScrollElasticityController m_scrollElasticityController; |
| 152 Timer<ScrollAnimatorMac> m_snapRubberBandTimer; | 152 Timer<ScrollAnimatorMac> m_snapRubberBandTimer; |
| 153 #endif | 153 #endif |
| 154 | 154 |
| 155 bool m_haveScrolledSincePageLoad; | 155 bool m_haveScrolledSincePageLoad; |
| 156 bool m_needsScrollerStyleUpdate; | 156 bool m_needsScrollerStyleUpdate; |
| 157 IntRect m_visibleScrollerThumbRect; | 157 IntRect m_visibleScrollerThumbRect; |
| 158 }; | 158 }; |
| 159 | 159 |
| 160 } // namespace WebCore | 160 } // namespace WebCore |
| 161 | 161 |
| 162 #endif // ScrollAnimatorMac_h | 162 #endif // ScrollAnimatorMac_h |
| OLD | NEW |