diff --git a/AppKit/CPScrollView.j b/AppKit/CPScrollView.j index 7c01b32b3..90a8c9b2a 100644 --- a/AppKit/CPScrollView.j +++ b/AppKit/CPScrollView.j @@ -33,6 +33,15 @@ #define SHOULD_SHOW_CORNER_VIEW() (_scrollerStyle === CPScrollerStyleLegacy && _verticalScroller && ![_verticalScroller isHidden]) +@protocol CPScrollViewDelegate + +@optional +- (void)scrollViewWillScroll:(CPScrollView)aScrollView; +- (void)scrollViewDidScroll:(CPScrollView)aScrollView; + +@end + + /*! @ignore */ var _isBrowserUsingOverlayScrollers = function() { @@ -98,35 +107,35 @@ var CPScrollerStyleGlobal = CPScrollerStyleOverlay, @implementation CPScrollView : CPView { - CPClipView _contentView; - CPClipView _headerClipView; - CPView _cornerView; - CPView _bottomCornerView; + CPClipView _contentView; + CPClipView _headerClipView; + CPView _cornerView; + CPView _bottomCornerView; - id _delegate; - CPTimer _scrollTimer; + id _delegate; + CPTimer _scrollTimer; - BOOL _hasVerticalScroller; - BOOL _hasHorizontalScroller; - BOOL _autohidesScrollers; + BOOL _hasVerticalScroller; + BOOL _hasHorizontalScroller; + BOOL _autohidesScrollers; - CPScroller _verticalScroller; - CPScroller _horizontalScroller; + CPScroller _verticalScroller; + CPScroller _horizontalScroller; - CPInteger _recursionCount; - CPInteger _implementedDelegateMethods; + CPInteger _recursionCount; + CPInteger _implementedDelegateMethods; - float _verticalLineScroll; - float _verticalPageScroll; - float _horizontalLineScroll; - float _horizontalPageScroll; + float _verticalLineScroll; + float _verticalPageScroll; + float _horizontalLineScroll; + float _horizontalPageScroll; - CPBorderType _borderType; + CPBorderType _borderType; - CPTimer _timerScrollersHide; + CPTimer _timerScrollersHide; - int _scrollerStyle; - int _scrollerKnobStyle; + int _scrollerStyle; + int _scrollerKnobStyle; } @@ -296,7 +305,7 @@ Notifies the delegate when the scroll view has finished scrolling. @endcode */ -- (void)setDelegate:(id)aDelegate +- (void)setDelegate:(id )aDelegate { if (aDelegate === _delegate) return; @@ -1014,7 +1023,8 @@ Notifies the delegate when the scroll view has finished scrolling. /* @ignore */ - (void)_respondToScrollWheelEventWithDeltaX:(float)deltaX deltaY:(float)deltaY { - var contentBounds = [_contentView bounds], + var documentFrame = [[self documentView] frame], + contentBounds = [_contentView bounds], contentFrame = [_contentView frame], enclosingScrollView = [self enclosingScrollView];