Source/WebCore: https://bugs.webkit.org/show_bug.cgi?id=66495
authorbdakin@apple.com <bdakin@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 19 Aug 2011 00:44:35 +0000 (00:44 +0000)
committerbdakin@apple.com <bdakin@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 19 Aug 2011 00:44:35 +0000 (00:44 +0000)
Lion-specific scroller SPIs can use forward declaration instead of
WebKitSystemInterface

Reviewed by Sam Weinig.

* WebCore.exp.in:
* WebCore.xcodeproj/project.pbxproj:
* platform/mac/NSScrollerImpDetails.h: Added.
* platform/mac/ScrollAnimatorMac.h:
* platform/mac/ScrollAnimatorMac.mm:
(-[ScrollbarPainterControllerDelegate scrollerImpPair:convertContentPoint:toScrollerImp:]):
(-[ScrollbarPainterControllerDelegate scrollerImpPair:updateScrollerStyleForNewRecommendedScrollerStyle:]):
(-[ScrollbarPartAnimation initWithScrollbarPainter:part:WebCore::scrollAnimator:WebCore::animateAlphaTo:duration:]):
(-[ScrollbarPartAnimation setCurrentProgress:]):
(-[ScrollbarPainterDelegate setUpAnimation:scrollerPainter:part:WebCore::animateAlphaTo:duration:]):
(-[ScrollbarPainterDelegate scrollerImp:animateKnobAlphaTo:duration:]):
(-[ScrollbarPainterDelegate scrollerImp:animateTrackAlphaTo:duration:]):
(WebCore::ScrollAnimatorMac::ScrollAnimatorMac):
(WebCore::ScrollAnimatorMac::~ScrollAnimatorMac):
(WebCore::ScrollAnimatorMac::notifyPositionChanged):
(WebCore::ScrollAnimatorMac::contentAreaWillPaint):
(WebCore::ScrollAnimatorMac::mouseEnteredContentArea):
(WebCore::ScrollAnimatorMac::mouseExitedContentArea):
(WebCore::ScrollAnimatorMac::mouseMovedInContentArea):
(WebCore::ScrollAnimatorMac::willStartLiveResize):
(WebCore::ScrollAnimatorMac::contentsResized):
(WebCore::ScrollAnimatorMac::willEndLiveResize):
(WebCore::ScrollAnimatorMac::contentAreaDidShow):
(WebCore::ScrollAnimatorMac::contentAreaDidHide):
(WebCore::ScrollAnimatorMac::didBeginScrollGesture):
(WebCore::ScrollAnimatorMac::didEndScrollGesture):
(WebCore::ScrollAnimatorMac::didAddVerticalScrollbar):
(WebCore::ScrollAnimatorMac::willRemoveVerticalScrollbar):
(WebCore::ScrollAnimatorMac::didAddHorizontalScrollbar):
(WebCore::ScrollAnimatorMac::willRemoveHorizontalScrollbar):
(WebCore::ScrollAnimatorMac::updateScrollerStyle):
(WebCore::ScrollAnimatorMac::initialScrollbarPaintTimerFired):
* platform/mac/ScrollbarThemeMac.h:
* platform/mac/ScrollbarThemeMac.mm:
(WebCore::ScrollbarThemeMac::registerScrollbar):
(WebCore::ScrollbarThemeMac::scrollbarThickness):
(WebCore::ScrollbarThemeMac::usesOverlayScrollbars):
(WebCore::ScrollbarThemeMac::updateScrollbarOverlayStyle):
(WebCore::ScrollbarThemeMac::hasThumb):
(WebCore::ScrollbarThemeMac::minimumThumbLength):
(WebCore::ScrollbarThemeMac::updateEnabledState):
(WebCore::scrollbarPainterPaint):
(WebCore::ScrollbarThemeMac::paint):
* platform/mac/WebCoreSystemInterface.h:
* platform/mac/WebCoreSystemInterface.mm:

Source/WebKit/mac: Reviewed by Sam Weinig.

https://bugs.webkit.org/show_bug.cgi?id=66495
Lion-specific scroller SPIs can use forward declaration instead of
WebKitSystemInterface

* WebCoreSupport/WebSystemInterface.mm:
(InitWebCoreSystemInterface):

Source/WebKit2: Reviewed by Sam Weinig.

https://bugs.webkit.org/show_bug.cgi?id=66495
Lion-specific scroller SPIs can use forward declaration instead of
WebKitSystemInterface

* WebProcess/WebCoreSupport/mac/WebSystemInterface.mm:
(InitWebCoreSystemInterface):

WebKitLibraries: Reviewed by Sam Weinig.

https://bugs.webkit.org/show_bug.cgi?id=66495
Lion-specific scroller SPIs can use forward declaration instead of
WebKitSystemInterface

* WebKitSystemInterface.h:
* libWebKitSystemInterfaceLeopard.a:
* libWebKitSystemInterfaceLion.a:
* libWebKitSystemInterfaceSnowLeopard.a:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@93377 268f45cc-cd09-0410-ab3c-d52691b4dbfc

19 files changed:
Source/WebCore/ChangeLog
Source/WebCore/WebCore.exp.in
Source/WebCore/WebCore.xcodeproj/project.pbxproj
Source/WebCore/platform/mac/NSScrollerImpDetails.h [new file with mode: 0644]
Source/WebCore/platform/mac/ScrollAnimatorMac.h
Source/WebCore/platform/mac/ScrollAnimatorMac.mm
Source/WebCore/platform/mac/ScrollbarThemeMac.h
Source/WebCore/platform/mac/ScrollbarThemeMac.mm
Source/WebCore/platform/mac/WebCoreSystemInterface.h
Source/WebCore/platform/mac/WebCoreSystemInterface.mm
Source/WebKit/mac/ChangeLog
Source/WebKit/mac/WebCoreSupport/WebSystemInterface.mm
Source/WebKit2/ChangeLog
Source/WebKit2/WebProcess/WebCoreSupport/mac/WebSystemInterface.mm
WebKitLibraries/ChangeLog
WebKitLibraries/WebKitSystemInterface.h
WebKitLibraries/libWebKitSystemInterfaceLeopard.a
WebKitLibraries/libWebKitSystemInterfaceLion.a
WebKitLibraries/libWebKitSystemInterfaceSnowLeopard.a

index a7a1710..4981d75 100644 (file)
@@ -1,3 +1,57 @@
+2011-08-18  Beth Dakin  <bdakin@apple.com>
+
+        https://bugs.webkit.org/show_bug.cgi?id=66495
+        Lion-specific scroller SPIs can use forward declaration instead of 
+        WebKitSystemInterface
+
+        Reviewed by Sam Weinig.
+
+        * WebCore.exp.in:
+        * WebCore.xcodeproj/project.pbxproj:
+        * platform/mac/NSScrollerImpDetails.h: Added.
+        * platform/mac/ScrollAnimatorMac.h:
+        * platform/mac/ScrollAnimatorMac.mm:
+        (-[ScrollbarPainterControllerDelegate scrollerImpPair:convertContentPoint:toScrollerImp:]):
+        (-[ScrollbarPainterControllerDelegate scrollerImpPair:updateScrollerStyleForNewRecommendedScrollerStyle:]):
+        (-[ScrollbarPartAnimation initWithScrollbarPainter:part:WebCore::scrollAnimator:WebCore::animateAlphaTo:duration:]):
+        (-[ScrollbarPartAnimation setCurrentProgress:]):
+        (-[ScrollbarPainterDelegate setUpAnimation:scrollerPainter:part:WebCore::animateAlphaTo:duration:]):
+        (-[ScrollbarPainterDelegate scrollerImp:animateKnobAlphaTo:duration:]):
+        (-[ScrollbarPainterDelegate scrollerImp:animateTrackAlphaTo:duration:]):
+        (WebCore::ScrollAnimatorMac::ScrollAnimatorMac):
+        (WebCore::ScrollAnimatorMac::~ScrollAnimatorMac):
+        (WebCore::ScrollAnimatorMac::notifyPositionChanged):
+        (WebCore::ScrollAnimatorMac::contentAreaWillPaint):
+        (WebCore::ScrollAnimatorMac::mouseEnteredContentArea):
+        (WebCore::ScrollAnimatorMac::mouseExitedContentArea):
+        (WebCore::ScrollAnimatorMac::mouseMovedInContentArea):
+        (WebCore::ScrollAnimatorMac::willStartLiveResize):
+        (WebCore::ScrollAnimatorMac::contentsResized):
+        (WebCore::ScrollAnimatorMac::willEndLiveResize):
+        (WebCore::ScrollAnimatorMac::contentAreaDidShow):
+        (WebCore::ScrollAnimatorMac::contentAreaDidHide):
+        (WebCore::ScrollAnimatorMac::didBeginScrollGesture):
+        (WebCore::ScrollAnimatorMac::didEndScrollGesture):
+        (WebCore::ScrollAnimatorMac::didAddVerticalScrollbar):
+        (WebCore::ScrollAnimatorMac::willRemoveVerticalScrollbar):
+        (WebCore::ScrollAnimatorMac::didAddHorizontalScrollbar):
+        (WebCore::ScrollAnimatorMac::willRemoveHorizontalScrollbar):
+        (WebCore::ScrollAnimatorMac::updateScrollerStyle):
+        (WebCore::ScrollAnimatorMac::initialScrollbarPaintTimerFired):
+        * platform/mac/ScrollbarThemeMac.h:
+        * platform/mac/ScrollbarThemeMac.mm:
+        (WebCore::ScrollbarThemeMac::registerScrollbar):
+        (WebCore::ScrollbarThemeMac::scrollbarThickness):
+        (WebCore::ScrollbarThemeMac::usesOverlayScrollbars):
+        (WebCore::ScrollbarThemeMac::updateScrollbarOverlayStyle):
+        (WebCore::ScrollbarThemeMac::hasThumb):
+        (WebCore::ScrollbarThemeMac::minimumThumbLength):
+        (WebCore::ScrollbarThemeMac::updateEnabledState):
+        (WebCore::scrollbarPainterPaint):
+        (WebCore::ScrollbarThemeMac::paint):
+        * platform/mac/WebCoreSystemInterface.h:
+        * platform/mac/WebCoreSystemInterface.mm:
+
 2011-08-18  Dan Bernstein  <mitz@apple.com>
 
         <rdar://problem/9973194> Fonts that specify a positive descender value are treated as having descenders ending above the baseline
index 48592b6..44e720b 100644 (file)
@@ -1462,47 +1462,12 @@ __ZN7WebCore20LogNotYetImplementedE
 #endif
 
 #if !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD)
-_wkContentAreaDidHide
-_wkContentAreaDidShow
-_wkContentAreaResized
-_wkContentAreaScrolled
-_wkContentAreaWillPaint
 _wkCopyDefaultSearchProviderDisplayName
 _wkCreateCTTypesetterWithUniCharProviderAndOptions
-_wkDidBeginScrollGesture
-_wkDidEndScrollGesture
+_wkRecommendedScrollerStyle
 _wkExecutableWasLinkedOnOrBeforeSnowLeopard
-_wkHorizontalScrollbarPainterForController
 _wkIOSurfaceContextCreate
 _wkIOSurfaceContextCreateImage
-_wkMakeScrollbarPainter
-_wkMakeScrollbarPainterController
-_wkMakeScrollbarReplacementPainter
-_wkMouseEnteredContentArea
-_wkMouseExitedContentArea
-_wkMouseMovedInContentArea
-_wkScrollbarMinimumThumbLength
-_wkScrollbarMinimumTotalLengthNeededForThumb
-_wkScrollbarPainterControllerStyle
-_wkScrollbarPainterForceFlashScrollers
-_wkScrollbarPainterIsHorizontal
-_wkScrollbarPainterKnobAlpha
-_wkScrollbarPainterKnobRect
-_wkScrollbarPainterPaint
-_wkScrollbarPainterSetDelegate
-_wkScrollbarPainterSetEnabled
-_wkScrollbarPainterSetOverlayState
-_wkScrollbarPainterTrackAlpha
-_wkScrollbarPainterUsesOverlayScrollers
-_wkSetScrollbarPainterKnobStyle
-_wkScrollbarThickness
-_wkSetPainterForPainterController
-_wkSetScrollbarPainterControllerStyle
-_wkSetScrollbarPainterKnobAlpha
-_wkSetScrollbarPainterTrackAlpha
-_wkVerticalScrollbarPainterForController
-_wkWillEndLiveResize
-_wkWillStartLiveResize
 _wkAVAssetResolvedURL
 _wkCursor
 #else
index 83957cd..c2f2412 100644 (file)
                934F713C0D5A6F1900018D69 /* ResourceErrorBase.h in Headers */ = {isa = PBXBuildFile; fileRef = 934F713B0D5A6F1900018D69 /* ResourceErrorBase.h */; settings = {ATTRIBUTES = (Private, ); }; };
                934F713E0D5A6F2800018D69 /* ResourceErrorBase.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 934F713D0D5A6F2800018D69 /* ResourceErrorBase.cpp */; };
                934FE9E50B5CA539003E4A73 /* FileChooser.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 934FE9E40B5CA539003E4A73 /* FileChooser.cpp */; };
+               93500F3213FDE3BE0099EC24 /* NSScrollerImpDetails.h in Headers */ = {isa = PBXBuildFile; fileRef = 93500F3113FDE3BE0099EC24 /* NSScrollerImpDetails.h */; };
                935207BE09BD410A00F2038D /* LocalizedStrings.h in Headers */ = {isa = PBXBuildFile; fileRef = 935207BD09BD410A00F2038D /* LocalizedStrings.h */; settings = {ATTRIBUTES = (Private, ); }; };
                9352084509BD43B900F2038D /* Language.mm in Sources */ = {isa = PBXBuildFile; fileRef = 9352084409BD43B900F2038D /* Language.mm */; };
                9352087709BD453400F2038D /* CookieJar.mm in Sources */ = {isa = PBXBuildFile; fileRef = 9352087609BD453400F2038D /* CookieJar.mm */; };
                934F713B0D5A6F1900018D69 /* ResourceErrorBase.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = ResourceErrorBase.h; sourceTree = "<group>"; };
                934F713D0D5A6F2800018D69 /* ResourceErrorBase.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = ResourceErrorBase.cpp; sourceTree = "<group>"; };
                934FE9E40B5CA539003E4A73 /* FileChooser.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = FileChooser.cpp; sourceTree = "<group>"; };
+               93500F3113FDE3BE0099EC24 /* NSScrollerImpDetails.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NSScrollerImpDetails.h; sourceTree = "<group>"; };
                935207BD09BD410A00F2038D /* LocalizedStrings.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LocalizedStrings.h; sourceTree = "<group>"; };
                9352084409BD43B900F2038D /* Language.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = Language.mm; sourceTree = "<group>"; };
                9352087609BD453400F2038D /* CookieJar.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = CookieJar.mm; sourceTree = "<group>"; };
                6582A14809999D6C00BEEB6D /* mac */ = {
                        isa = PBXGroup;
                        children = (
+                               93500F3113FDE3BE0099EC24 /* NSScrollerImpDetails.h */,
                                51E1ECAD0C91C54600DC255B /* AutodrainedPool.mm */,
                                65A640F00533BB1F0085E777 /* BlockExceptions.h */,
                                65F80697054D9F86008BF776 /* BlockExceptions.mm */,
                                FD6F252D13F5EF0E0065165F /* MediaElementAudioSourceNode.h in Headers */,
                                FD23A12613F5FA5900F67001 /* JSMediaElementAudioSourceNode.h in Headers */,
                                DF9AFD7213FC31D80015FEB7 /* MediaPlayerPrivateAVFoundationObjC.h in Headers */,
+                               93500F3213FDE3BE0099EC24 /* NSScrollerImpDetails.h in Headers */,
                        );
                        runOnlyForDeploymentPostprocessing = 0;
                };
diff --git a/Source/WebCore/platform/mac/NSScrollerImpDetails.h b/Source/WebCore/platform/mac/NSScrollerImpDetails.h
new file mode 100644 (file)
index 0000000..e7319aa
--- /dev/null
@@ -0,0 +1,82 @@
+/*
+ * Copyright (C) 2011 Apple Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
+ */
+
+#ifndef WebCore_NSScrollerImpDetails_h
+#define WebCore_NSScrollerImpDetails_h
+
+#include "config.h"
+
+#if USE(WK_SCROLLBAR_PAINTER)
+@interface NSObject (ScrollbarPainter)
++ (id)scrollerImpWithStyle:(NSScrollerStyle)newScrollerStyle controlSize:(NSControlSize)newControlSize horizontal:(BOOL)horizontal replacingScrollerImp:(id)previous;
+- (CGFloat)knobAlpha;
+- (void)setKnobAlpha:(CGFloat)knobAlpha;
+- (CGFloat)trackAlpha;
+- (void)setTrackAlpha:(CGFloat)trackAlpha;
+- (void)setEnabled:(BOOL)enabled;
+- (void)setBoundsSize:(NSSize)boundsSize;
+- (void)setDoubleValue:(double)doubleValue;
+- (void)setKnobProportion:(CGFloat)proportion;
+- (void)setKnobStyle:(NSScrollerKnobStyle)knobStyle;
+- (void)setDelegate:(id)delegate;
+- (BOOL)isHorizontal;
+- (CGFloat)trackWidth;
+- (CGFloat)trackBoxWidth;
+- (CGFloat)knobMinLength;
+- (CGFloat)trackOverlapEndInset;
+- (CGFloat)knobOverlapEndInset;
+- (CGFloat)trackEndInset;
+- (CGFloat)knobEndInset;
+- (NSRect)rectForPart:(NSScrollerPart)partCode;
+- (void)drawKnobSlotInRect:(NSRect)slotRect highlight:(BOOL)flag alpha:(CGFloat)alpha;
+- (void)drawKnob;
+@end
+
+@interface NSObject (ScrollbarPainterController)
+- (void)setDelegate:(id)delegate;
+- (void)hideOverlayScrollers;
+- (void)flashScrollers;
+- (id)horizontalScrollerImp;
+- (void)setHorizontalScrollerImp:(id)horizontal;
+- (id)verticalScrollerImp;
+- (void)setVerticalScrollerImp:(id)vertical;
+- (NSScrollerStyle)scrollerStyle;
+- (void)setScrollerStyle:(NSScrollerStyle)scrollerStyle;
+- (void)contentAreaScrolled;
+- (void)contentAreaWillDraw;
+- (void)mouseEnteredContentArea;
+- (void)mouseExitedContentArea;
+- (void)mouseMovedInContentArea;
+- (void)startLiveResize;
+- (void)contentAreaDidResize;
+- (void)endLiveResize;
+- (void)windowOrderedIn;
+- (void)windowOrderedOut;
+- (void)beginScrollGesture;
+- (void)endScrollGesture;
+@end
+#endif
+
+#endif
index 38d06f7..86fc71d 100644 (file)
@@ -48,7 +48,7 @@ class ScrollbarPainterDelegate;
 #endif
 
 #if USE(WK_SCROLLBAR_PAINTER)
-typedef struct __WKScrollbarPainterController *WKScrollbarPainterControllerRef;
+typedef id WKScrollbarPainterControllerRef;
 #endif
 
 namespace WebCore {
index a106e63..d43422e 100644 (file)
@@ -30,6 +30,7 @@
 #include "ScrollAnimatorMac.h"
 
 #include "FloatPoint.h"
+#include "NSScrollerImpDetails.h"
 #include "PlatformGestureEvent.h"
 #include "PlatformWheelEvent.h"
 #include "ScrollView.h"
@@ -208,7 +209,7 @@ static NSSize abs(NSSize size)
         return NSZeroPoint;
 
     WebCore::Scrollbar* scrollbar = 0;
-    if (wkScrollbarPainterIsHorizontal((WKScrollbarPainterRef)scrollerImp))
+    if ([scrollerImp isHorizontal])
         scrollbar = _animator->scrollableArea()->horizontalScrollbar();
     else 
         scrollbar = _animator->scrollableArea()->verticalScrollbar();
@@ -235,7 +236,7 @@ static NSSize abs(NSSize size)
     if (!_animator)
         return;
 
-    wkSetScrollbarPainterControllerStyle((WKScrollbarPainterControllerRef)scrollerImpPair, newRecommendedScrollerStyle);
+    [scrollerImpPair setScrollerStyle:newRecommendedScrollerStyle];
     _animator->updateScrollerStyle();
 }
 
@@ -263,7 +264,7 @@ static NSSize abs(NSSize size)
     _scrollerPainter = scrollerPainter;
     _part = part;
     _animator = scrollAnimator;
-    _initialAlpha = _part == WebCore::ThumbPart ? wkScrollbarPainterKnobAlpha(_scrollerPainter.get()) : wkScrollbarPainterTrackAlpha(_scrollerPainter.get());
+    _initialAlpha = _part == WebCore::ThumbPart ? [_scrollerPainter.get() knobAlpha] : [_scrollerPainter.get() trackAlpha];
     _newAlpha = newAlpha;
     
     return self;    
@@ -283,9 +284,9 @@ static NSSize abs(NSSize size)
         currentAlpha = progress;
     
     if (_part == WebCore::ThumbPart)
-        wkSetScrollbarPainterKnobAlpha(_scrollerPainter.get(), currentAlpha);
+        [_scrollerPainter.get() setKnobAlpha:currentAlpha];
     else
-        wkSetScrollbarPainterTrackAlpha(_scrollerPainter.get(), currentAlpha);
+        [_scrollerPainter.get() setTrackAlpha:currentAlpha];
 
     // Invalidate the scrollbars so that they paint the animation
     if (WebCore::Scrollbar* verticalScrollbar = _animator->scrollableArea()->verticalScrollbar())
@@ -381,9 +382,9 @@ static NSSize abs(NSSize size)
         scrollbarPartAnimation = nil;
     }
 
-    if (part == WebCore::ThumbPart && !wkScrollbarPainterIsHorizontal(scrollerPainter)) {
+    if (part == WebCore::ThumbPart && ![scrollerPainter isHorizontal]) {
         if (newAlpha == 1) {
-            IntRect thumbRect = IntRect(wkScrollbarPainterKnobRect(scrollerPainter));
+            IntRect thumbRect = IntRect([scrollerPainter rectForPart:NSScrollerKnob]);
             _animator->setVisibleScrollerThumbRect(thumbRect);
         } else
             _animator->setVisibleScrollerThumbRect(IntRect());
@@ -407,7 +408,7 @@ static NSSize abs(NSSize size)
         return;
 
     WKScrollbarPainterRef scrollerPainter = (WKScrollbarPainterRef)scrollerImp;
-    if (wkScrollbarPainterIsHorizontal(scrollerPainter))
+    if ([scrollerImp isHorizontal])
         [self setUpAnimation:_horizontalKnobAnimation scrollerPainter:scrollerPainter part:WebCore::ThumbPart animateAlphaTo:newKnobAlpha duration:duration];
     else
         [self setUpAnimation:_verticalKnobAnimation scrollerPainter:scrollerPainter part:WebCore::ThumbPart animateAlphaTo:newKnobAlpha duration:duration];
@@ -419,7 +420,7 @@ static NSSize abs(NSSize size)
         return;
 
     WKScrollbarPainterRef scrollerPainter = (WKScrollbarPainterRef)scrollerImp;
-    if (wkScrollbarPainterIsHorizontal(scrollerPainter))
+    if ([scrollerImp isHorizontal])
         [self setUpAnimation:_horizontalTrackAnimation scrollerPainter:scrollerPainter part:WebCore::BackTrackPart animateAlphaTo:newTrackAlpha duration:duration];
     else
         [self setUpAnimation:_verticalTrackAnimation scrollerPainter:scrollerPainter part:WebCore::BackTrackPart animateAlphaTo:newTrackAlpha duration:duration];
@@ -473,7 +474,10 @@ ScrollAnimatorMac::ScrollAnimatorMac(ScrollableArea* scrollableArea)
 
 #if USE(WK_SCROLLBAR_PAINTER)
     m_scrollbarPainterControllerDelegate.adoptNS([[ScrollbarPainterControllerDelegate alloc] initWithScrollAnimator:this]);
-    m_scrollbarPainterController = wkMakeScrollbarPainterController(m_scrollbarPainterControllerDelegate.get());
+    m_scrollbarPainterController = [[[NSClassFromString(@"NSScrollerImpPair") alloc] init] autorelease];
+    [m_scrollbarPainterController.get() setDelegate:m_scrollbarPainterControllerDelegate.get()];
+    [m_scrollbarPainterController.get() setScrollerStyle:wkRecommendedScrollerStyle()];
+
     m_scrollbarPainterDelegate.adoptNS([[ScrollbarPainterDelegate alloc] initWithScrollAnimator:this]);
 #endif
 }
@@ -482,7 +486,7 @@ ScrollAnimatorMac::~ScrollAnimatorMac()
 {
 #if USE(WK_SCROLLBAR_PAINTER)
     [m_scrollbarPainterControllerDelegate.get() scrollAnimatorDestroyed];
-    [(id)m_scrollbarPainterController.get() setDelegate:nil];
+    [m_scrollbarPainterController.get() setDelegate:nil];
     [m_scrollbarPainterDelegate.get() scrollAnimatorDestroyed];
     [m_scrollAnimationHelperDelegate.get() scrollAnimatorDestroyed];
 #endif
@@ -597,7 +601,7 @@ void ScrollAnimatorMac::immediateScrollToPointForScrollAnimation(const FloatPoin
 void ScrollAnimatorMac::notifyPositionChanged()
 {
 #if USE(WK_SCROLLBAR_PAINTER)
-    wkContentAreaScrolled(m_scrollbarPainterController.get());
+    [m_scrollbarPainterController.get() contentAreaScrolled];
 #endif
     ScrollAnimator::notifyPositionChanged();
 }
@@ -605,77 +609,77 @@ void ScrollAnimatorMac::notifyPositionChanged()
 void ScrollAnimatorMac::contentAreaWillPaint() const
 {
 #if USE(WK_SCROLLBAR_PAINTER)
-    wkContentAreaWillPaint(m_scrollbarPainterController.get());
+    [m_scrollbarPainterController.get() contentAreaWillDraw];
 #endif
 }
 
 void ScrollAnimatorMac::mouseEnteredContentArea() const
 {
 #if USE(WK_SCROLLBAR_PAINTER)
-    wkMouseEnteredContentArea(m_scrollbarPainterController.get());
+    [m_scrollbarPainterController.get() mouseEnteredContentArea];
 #endif
 }
 
 void ScrollAnimatorMac::mouseExitedContentArea() const
 {
 #if USE(WK_SCROLLBAR_PAINTER)
-    wkMouseExitedContentArea(m_scrollbarPainterController.get());
+    [m_scrollbarPainterController.get() mouseExitedContentArea];
 #endif
 }
 
 void ScrollAnimatorMac::mouseMovedInContentArea() const
 {
 #if USE(WK_SCROLLBAR_PAINTER)
-    wkMouseMovedInContentArea(m_scrollbarPainterController.get());
+    [m_scrollbarPainterController.get() mouseMovedInContentArea];
 #endif
 }
 
 void ScrollAnimatorMac::willStartLiveResize()
 {
 #if USE(WK_SCROLLBAR_PAINTER)
-    wkWillStartLiveResize(m_scrollbarPainterController.get());
+    [m_scrollbarPainterController.get() startLiveResize];
 #endif
 }
 
 void ScrollAnimatorMac::contentsResized() const
 {
 #if USE(WK_SCROLLBAR_PAINTER)
-    wkContentAreaResized(m_scrollbarPainterController.get());
+    [m_scrollbarPainterController.get() contentAreaDidResize];
 #endif
 }
 
 void ScrollAnimatorMac::willEndLiveResize()
 {
 #if USE(WK_SCROLLBAR_PAINTER)
-    wkWillEndLiveResize(m_scrollbarPainterController.get());
+    [m_scrollbarPainterController.get() endLiveResize];
 #endif
 }
 
 void ScrollAnimatorMac::contentAreaDidShow() const
 {
 #if USE(WK_SCROLLBAR_PAINTER)
-    wkContentAreaDidShow(m_scrollbarPainterController.get());
+    [m_scrollbarPainterController.get() windowOrderedIn];
 #endif
 }
 
 void ScrollAnimatorMac::contentAreaDidHide() const
 {
 #if USE(WK_SCROLLBAR_PAINTER)
-    wkContentAreaDidHide(m_scrollbarPainterController.get());
+    [m_scrollbarPainterController.get() windowOrderedOut];
 #endif
 }
 
 void ScrollAnimatorMac::didBeginScrollGesture() const
 {
 #if USE(WK_SCROLLBAR_PAINTER)
-    wkDidBeginScrollGesture(m_scrollbarPainterController.get());
+    [m_scrollbarPainterController.get() beginScrollGesture];
 #endif
 }
 
 void ScrollAnimatorMac::didEndScrollGesture() const
 {
 #if USE(WK_SCROLLBAR_PAINTER)
-    wkDidEndScrollGesture(m_scrollbarPainterController.get());
+    [m_scrollbarPainterController.get() endScrollGesture];
 #endif
 }
 
@@ -683,10 +687,10 @@ void ScrollAnimatorMac::didAddVerticalScrollbar(Scrollbar* scrollbar)
 {
 #if USE(WK_SCROLLBAR_PAINTER)
     WKScrollbarPainterRef painter = static_cast<WebCore::ScrollbarThemeMac*>(WebCore::ScrollbarTheme::nativeTheme())->painterForScrollbar(scrollbar);
-    wkScrollbarPainterSetDelegate(painter, m_scrollbarPainterDelegate.get());
-    wkSetPainterForPainterController(m_scrollbarPainterController.get(), painter, false);
+    [painter setDelegate:m_scrollbarPainterDelegate.get()];
+    [m_scrollbarPainterController.get() setVerticalScrollerImp:painter];
     if (scrollableArea()->inLiveResize())
-        wkSetScrollbarPainterKnobAlpha(painter, 1);
+        [painter setKnobAlpha:1];
 #else
     UNUSED_PARAM(scrollbar);
 #endif
@@ -696,8 +700,8 @@ void ScrollAnimatorMac::willRemoveVerticalScrollbar(Scrollbar* scrollbar)
 {
 #if USE(WK_SCROLLBAR_PAINTER)
     WKScrollbarPainterRef painter = static_cast<WebCore::ScrollbarThemeMac*>(WebCore::ScrollbarTheme::nativeTheme())->painterForScrollbar(scrollbar);
-    wkScrollbarPainterSetDelegate(painter, nil);
-    wkSetPainterForPainterController(m_scrollbarPainterController.get(), nil, false);
+    [painter setDelegate:nil];
+    [m_scrollbarPainterController.get() setVerticalScrollerImp:nil];
 #else
     UNUSED_PARAM(scrollbar);
 #endif
@@ -707,10 +711,10 @@ void ScrollAnimatorMac::didAddHorizontalScrollbar(Scrollbar* scrollbar)
 {
 #if USE(WK_SCROLLBAR_PAINTER)
     WKScrollbarPainterRef painter = static_cast<WebCore::ScrollbarThemeMac*>(WebCore::ScrollbarTheme::nativeTheme())->painterForScrollbar(scrollbar);
-    wkScrollbarPainterSetDelegate(painter, m_scrollbarPainterDelegate.get());
-    wkSetPainterForPainterController(m_scrollbarPainterController.get(), painter, true);
+    [painter setDelegate:m_scrollbarPainterDelegate.get()];
+    [m_scrollbarPainterController.get() setHorizontalScrollerImp:painter];
     if (scrollableArea()->inLiveResize())
-        wkSetScrollbarPainterKnobAlpha(painter, 1);
+        [painter setKnobAlpha:1];
 #else
     UNUSED_PARAM(scrollbar);
 #endif
@@ -720,8 +724,8 @@ void ScrollAnimatorMac::willRemoveHorizontalScrollbar(Scrollbar* scrollbar)
 {
 #if USE(WK_SCROLLBAR_PAINTER)
     WKScrollbarPainterRef painter = static_cast<WebCore::ScrollbarThemeMac*>(WebCore::ScrollbarTheme::nativeTheme())->painterForScrollbar(scrollbar);
-    wkScrollbarPainterSetDelegate(painter, nil);
-    wkSetPainterForPainterController(m_scrollbarPainterController.get(), nil, true);
+    [painter setDelegate:nil];
+    [m_scrollbarPainterController.get() setHorizontalScrollerImp:nil];
 #else
     UNUSED_PARAM(scrollbar);
 #endif
@@ -1233,18 +1237,18 @@ void ScrollAnimatorMac::updateScrollerStyle()
     }
 
     ScrollbarThemeMac* macTheme = (ScrollbarThemeMac*)ScrollbarTheme::nativeTheme();
-    int newStyle = wkScrollbarPainterControllerStyle(m_scrollbarPainterController.get());
+    NSScrollerStyle newStyle = [m_scrollbarPainterController.get() scrollerStyle];
 
     if (Scrollbar* verticalScrollbar = scrollableArea()->verticalScrollbar()) {
         verticalScrollbar->invalidate();
 
-        WKScrollbarPainterRef oldVerticalPainter = wkVerticalScrollbarPainterForController(m_scrollbarPainterController.get());
-        WKScrollbarPainterRef newVerticalPainter = wkMakeScrollbarReplacementPainter(oldVerticalPainter,
-                                                                                     newStyle,
-                                                                                     verticalScrollbar->controlSize(),
-                                                                                     false);
+        WKScrollbarPainterRef oldVerticalPainter = [m_scrollbarPainterController.get() verticalScrollerImp];
+        WKScrollbarPainterRef newVerticalPainter = [NSClassFromString(@"NSScrollerImp") scrollerImpWithStyle:newStyle 
+                                                                                    controlSize:(NSControlSize)verticalScrollbar->controlSize() 
+                                                                                    horizontal:NO 
+                                                                                    replacingScrollerImp:oldVerticalPainter];
         macTheme->setNewPainterForScrollbar(verticalScrollbar, newVerticalPainter);
-        wkSetPainterForPainterController(m_scrollbarPainterController.get(), newVerticalPainter, false);
+        [m_scrollbarPainterController.get() setVerticalScrollerImp:newVerticalPainter];
 
         // The different scrollbar styles have different thicknesses, so we must re-set the 
         // frameRect to the new thickness, and the re-layout below will ensure the position
@@ -1256,13 +1260,13 @@ void ScrollAnimatorMac::updateScrollerStyle()
     if (Scrollbar* horizontalScrollbar = scrollableArea()->horizontalScrollbar()) {
         horizontalScrollbar->invalidate();
 
-        WKScrollbarPainterRef oldHorizontalPainter = wkHorizontalScrollbarPainterForController(m_scrollbarPainterController.get());
-        WKScrollbarPainterRef newHorizontalPainter = wkMakeScrollbarReplacementPainter(oldHorizontalPainter,
-                                                                                       newStyle,
-                                                                                       horizontalScrollbar->controlSize(),
-                                                                                       true);
+        WKScrollbarPainterRef oldHorizontalPainter = [m_scrollbarPainterController.get() horizontalScrollerImp];
+        WKScrollbarPainterRef newHorizontalPainter = [NSClassFromString(@"NSScrollerImp") scrollerImpWithStyle:newStyle 
+                                                                                    controlSize:(NSControlSize)horizontalScrollbar->controlSize() 
+                                                                                    horizontal:YES 
+                                                                                    replacingScrollerImp:oldHorizontalPainter];
         macTheme->setNewPainterForScrollbar(horizontalScrollbar, newHorizontalPainter);
-        wkSetPainterForPainterController(m_scrollbarPainterController.get(), newHorizontalPainter, true);
+        [m_scrollbarPainterController.get() setVerticalScrollerImp:newHorizontalPainter];
 
         // The different scrollbar styles have different thicknesses, so we must re-set the 
         // frameRect to the new thickness, and the re-layout below will ensure the position
@@ -1296,7 +1300,10 @@ void ScrollAnimatorMac::stopScrollbarPaintTimer()
 
 void ScrollAnimatorMac::initialScrollbarPaintTimerFired(Timer<ScrollAnimatorMac>*)
 {
-    wkScrollbarPainterForceFlashScrollers(m_scrollbarPainterController.get());
+    // To force the scrollbars to flash, we have to call hide first. Otherwise, the ScrollbarPainterController
+    // might think that the scrollbars are already showing and bail early.
+    [m_scrollbarPainterController.get() hideOverlayScrollers];
+    [m_scrollbarPainterController.get() flashScrollers];
 }
 #endif
 
index baf13a7..befee91 100644 (file)
@@ -29,7 +29,7 @@
 #include "ScrollbarThemeComposite.h"
 
 #if USE(WK_SCROLLBAR_PAINTER)
-typedef struct __WKScrollbarPainter *WKScrollbarPainterRef;
+typedef id WKScrollbarPainterRef;
 #endif
 
 namespace WebCore {
index 9476d74..269c412 100644 (file)
@@ -28,6 +28,7 @@
 
 #include "ImageBuffer.h"
 #include "LocalCurrentGraphicsContext.h"
+#include "NSScrollerImpDetails.h"
 #include "PlatformMouseEvent.h"
 #include "ScrollAnimatorMac.h"
 #include "ScrollView.h"
@@ -158,7 +159,7 @@ void ScrollbarThemeMac::registerScrollbar(Scrollbar* scrollbar)
 {
 #if USE(WK_SCROLLBAR_PAINTER)
     bool isHorizontal = scrollbar->orientation() == HorizontalScrollbar;
-    WKScrollbarPainterRef scrollbarPainter = wkMakeScrollbarPainter(scrollbar->controlSize(), isHorizontal);
+    WKScrollbarPainterRef scrollbarPainter = [NSClassFromString(@"NSScrollerImp") scrollerImpWithStyle:wkRecommendedScrollerStyle() controlSize:(NSControlSize)scrollbar->controlSize() horizontal:isHorizontal replacingScrollerImp:nil];
     scrollbarMap()->add(scrollbar, scrollbarPainter);
     updateEnabledState(scrollbar);
     updateScrollbarOverlayStyle(scrollbar);
@@ -213,7 +214,8 @@ void ScrollbarThemeMac::preferencesChanged()
 int ScrollbarThemeMac::scrollbarThickness(ScrollbarControlSize controlSize)
 {
 #if USE(WK_SCROLLBAR_PAINTER)
-    return wkScrollbarThickness(controlSize);
+    WKScrollbarPainterRef scrollbarPainter = (WKScrollbarPainterRef)[NSClassFromString(@"NSScrollerImp") scrollerImpWithStyle:wkRecommendedScrollerStyle() controlSize:controlSize horizontal:NO replacingScrollerImp:nil];
+    return [scrollbarPainter trackBoxWidth];
 #else
     return cScrollbarThickness[controlSize];
 #endif
@@ -222,30 +224,27 @@ int ScrollbarThemeMac::scrollbarThickness(ScrollbarControlSize controlSize)
 bool ScrollbarThemeMac::usesOverlayScrollbars() const
 {
 #if USE(WK_SCROLLBAR_PAINTER)
-    return wkScrollbarPainterUsesOverlayScrollers();
+    return wkRecommendedScrollerStyle() == NSScrollerStyleOverlay;
 #else
     return false;
 #endif
 }
 
-#if USE(WK_SCROLLBAR_PAINTER)
-static inline wkScrollerKnobStyle toScrollbarPainterKnobStyle(ScrollbarOverlayStyle style)
+void ScrollbarThemeMac::updateScrollbarOverlayStyle(Scrollbar* scrollbar)
 {
-    switch (style) {
+#if USE(WK_SCROLLBAR_PAINTER)
+    WKScrollbarPainterRef painter = painterForScrollbar(scrollbar);
+    switch (scrollbar->scrollableArea()->scrollbarOverlayStyle()) {
+    case ScrollbarOverlayStyleDefault:
+        [painter setKnobStyle:NSScrollerKnobStyleDefault];
+        break;
     case ScrollbarOverlayStyleDark:
-        return wkScrollerKnobStyleDark;
+        [painter setKnobStyle:NSScrollerKnobStyleDark];
+        break;
     case ScrollbarOverlayStyleLight:
-        return wkScrollerKnobStyleLight;
-    default:
-        return wkScrollerKnobStyleDefault;
+        [painter setKnobStyle:NSScrollerKnobStyleLight];
+        break;
     }
-}
-#endif
-
-void ScrollbarThemeMac::updateScrollbarOverlayStyle(Scrollbar* scrollbar)
-{
-#if USE(WK_SCROLLBAR_PAINTER)
-    wkSetScrollbarPainterKnobStyle(painterForScrollbar(scrollbar), toScrollbarPainterKnobStyle(scrollbar->scrollableArea()->scrollbarOverlayStyle()));
 #else
     UNUSED_PARAM(scrollbar);
 #endif
@@ -278,7 +277,9 @@ bool ScrollbarThemeMac::hasThumb(Scrollbar* scrollbar)
 {
     int minLengthForThumb;
 #if USE(WK_SCROLLBAR_PAINTER)
-    minLengthForThumb = wkScrollbarMinimumTotalLengthNeededForThumb(scrollbarMap()->get(scrollbar).get());
+    WKScrollbarPainterRef painter = scrollbarMap()->get(scrollbar).get();
+    minLengthForThumb = [painter knobMinLength] + [painter trackOverlapEndInset] + [painter knobOverlapEndInset]
+        + 2 * ([painter trackEndInset] + [painter knobEndInset]);
 #else
     minLengthForThumb = 2 * cButtonInset[scrollbar->controlSize()] + cThumbMinLength[scrollbar->controlSize()] + 1;
 #endif
@@ -419,7 +420,7 @@ IntRect ScrollbarThemeMac::trackRect(Scrollbar* scrollbar, bool painting)
 int ScrollbarThemeMac::minimumThumbLength(Scrollbar* scrollbar)
 {
 #if USE(WK_SCROLLBAR_PAINTER)
-    return wkScrollbarMinimumThumbLength(scrollbarMap()->get(scrollbar).get());
+    return [scrollbarMap()->get(scrollbar).get() knobMinLength];
 #else
     return cThumbMinLength[scrollbar->controlSize()];
 #endif
@@ -460,12 +461,36 @@ static int scrollbarPartToHIPressedState(ScrollbarPart part)
 void ScrollbarThemeMac::updateEnabledState(Scrollbar* scrollbar)
 {
 #if USE(WK_SCROLLBAR_PAINTER)
-    wkScrollbarPainterSetEnabled(scrollbarMap()->get(scrollbar).get(), scrollbar->enabled());
+    [scrollbarMap()->get(scrollbar).get() setEnabled:scrollbar->enabled()];
 #else
     UNUSED_PARAM(scrollbar);
 #endif
 }
 
+#if USE(WK_SCROLLBAR_PAINTER)
+static void scrollbarPainterPaint(WKScrollbarPainterRef scrollbarPainter, bool enabled, double value, CGFloat proportion, CGRect frameRect)
+{
+    [scrollbarPainter setEnabled:enabled];
+    [scrollbarPainter setBoundsSize: NSSizeFromCGSize(frameRect.size)];
+    [scrollbarPainter setDoubleValue:value];
+    [scrollbarPainter setKnobProportion:proportion];
+
+    // The scrollbar's frameRect includes a side inset for overlay scrollers, so we have to use the 
+    // trackWidth for drawKnobSlotInRect
+    NSRect trackRect;
+    if ([scrollbarPainter isHorizontal])
+        trackRect = NSMakeRect(0, 0, frameRect.size.width, [scrollbarPainter trackWidth]);
+    else
+        trackRect = NSMakeRect(0, 0, [scrollbarPainter trackWidth], frameRect.size.height);
+    [scrollbarPainter drawKnobSlotInRect:trackRect highlight:NO];
+
+    // If the scrollbar is not enabled, then there is nothing to scroll to, and we shouldn't
+    // call drawKnob.
+    if (enabled)
+        [scrollbarPainter drawKnob];
+}
+#endif
+
 bool ScrollbarThemeMac::paint(Scrollbar* scrollbar, GraphicsContext* context, const IntRect& damageRect)
 {
 #if USE(WK_SCROLLBAR_PAINTER)
@@ -496,7 +521,7 @@ bool ScrollbarThemeMac::paint(Scrollbar* scrollbar, GraphicsContext* context, co
     context->clip(damageRect);
     context->translate(scrollbar->frameRect().x(), scrollbar->frameRect().y());
     LocalCurrentGraphicsContext localContext(context);
-    wkScrollbarPainterPaint(scrollbarMap()->get(scrollbar).get(),
+    scrollbarPainterPaint(scrollbarMap()->get(scrollbar).get(),
                             scrollbar->enabled(),
                             value,
                             (static_cast<CGFloat>(scrollbar->visibleSize()) - overhang) / scrollbar->totalSize(),
index fa3d73f..06ad364 100644 (file)
@@ -250,54 +250,7 @@ extern CTTypesetterRef (*wkCreateCTTypesetterWithUniCharProviderAndOptions)(cons
 extern CGContextRef (*wkIOSurfaceContextCreate)(IOSurfaceRef surface, unsigned width, unsigned height, CGColorSpaceRef colorSpace);
 extern CGImageRef (*wkIOSurfaceContextCreateImage)(CGContextRef context);
 
-typedef struct __WKScrollbarPainter *WKScrollbarPainterRef;
-typedef struct __WKScrollbarPainterController *WKScrollbarPainterControllerRef;
-
-extern WKScrollbarPainterRef (*wkMakeScrollbarPainter)(int controlSize, bool isHorizontal);
-extern WKScrollbarPainterRef (*wkMakeScrollbarReplacementPainter)(WKScrollbarPainterRef oldPainter, int newStyle, int controlSize, bool isHorizontal);
-extern void (*wkScrollbarPainterSetDelegate)(WKScrollbarPainterRef, id scrollbarPainterDelegate);
-extern void (*wkScrollbarPainterSetEnabled)(WKScrollbarPainterRef, bool enabled);
-extern void (*wkScrollbarPainterPaint)(WKScrollbarPainterRef, bool enabled, double value, CGFloat proportion, CGRect frameRect);
-extern void (*wkScrollbarPainterForceFlashScrollers)(WKScrollbarPainterControllerRef);
-extern int (*wkScrollbarThickness)(int controlSize);
-extern int (*wkScrollbarMinimumThumbLength)(WKScrollbarPainterRef);
-extern int (*wkScrollbarMinimumTotalLengthNeededForThumb)(WKScrollbarPainterRef);
-extern CGFloat (*wkScrollbarPainterKnobAlpha)(WKScrollbarPainterRef);
-extern void (*wkSetScrollbarPainterKnobAlpha)(WKScrollbarPainterRef, CGFloat);
-extern CGFloat (*wkScrollbarPainterTrackAlpha)(WKScrollbarPainterRef);
-extern void (*wkSetScrollbarPainterTrackAlpha)(WKScrollbarPainterRef, CGFloat);
-extern bool (*wkScrollbarPainterIsHorizontal)(WKScrollbarPainterRef);
-extern CGRect (*wkScrollbarPainterKnobRect)(WKScrollbarPainterRef);
-extern void (*wkScrollbarPainterSetOverlayState)(WKScrollbarPainterRef, int overlayScrollerState);
-
-enum {
-    wkScrollerKnobStyleDefault = 0,
-    wkScrollerKnobStyleDark = 1,
-    wkScrollerKnobStyleLight = 2
-};
-typedef uint32 wkScrollerKnobStyle;
-extern void (*wkSetScrollbarPainterKnobStyle)(WKScrollbarPainterRef, wkScrollerKnobStyle);
-    
-extern WKScrollbarPainterControllerRef (*wkMakeScrollbarPainterController)(id painterControllerDelegate);
-extern void (*wkSetPainterForPainterController)(WKScrollbarPainterControllerRef, WKScrollbarPainterRef, bool isHorizontal);
-extern WKScrollbarPainterRef (*wkVerticalScrollbarPainterForController)(WKScrollbarPainterControllerRef);
-extern WKScrollbarPainterRef (*wkHorizontalScrollbarPainterForController)(WKScrollbarPainterControllerRef);
-extern int (*wkScrollbarPainterControllerStyle)(WKScrollbarPainterControllerRef);
-extern void (*wkSetScrollbarPainterControllerStyle)(WKScrollbarPainterControllerRef, int newStyle);
-extern void (*wkContentAreaScrolled)(WKScrollbarPainterControllerRef);
-extern void (*wkContentAreaWillPaint)(WKScrollbarPainterControllerRef);
-extern void (*wkMouseEnteredContentArea)(WKScrollbarPainterControllerRef);
-extern void (*wkMouseExitedContentArea)(WKScrollbarPainterControllerRef);
-extern void (*wkMouseMovedInContentArea)(WKScrollbarPainterControllerRef);
-extern void (*wkWillStartLiveResize)(WKScrollbarPainterControllerRef);
-extern void (*wkContentAreaResized)(WKScrollbarPainterControllerRef);
-extern void (*wkWillEndLiveResize)(WKScrollbarPainterControllerRef);
-extern void (*wkContentAreaDidShow)(WKScrollbarPainterControllerRef);
-extern void (*wkContentAreaDidHide)(WKScrollbarPainterControllerRef);
-extern void (*wkDidBeginScrollGesture)(WKScrollbarPainterControllerRef);
-extern void (*wkDidEndScrollGesture)(WKScrollbarPainterControllerRef);
-
-extern bool (*wkScrollbarPainterUsesOverlayScrollers)(void);
+extern int (*wkRecommendedScrollerStyle)(void);
 
 extern bool (*wkExecutableWasLinkedOnOrBeforeSnowLeopard)(void);
 
index 57f6430..5b6720f 100644 (file)
@@ -133,44 +133,7 @@ CTTypesetterRef (*wkCreateCTTypesetterWithUniCharProviderAndOptions)(const UniCh
 CGContextRef (*wkIOSurfaceContextCreate)(IOSurfaceRef surface, unsigned width, unsigned height, CGColorSpaceRef colorSpace);
 CGImageRef (*wkIOSurfaceContextCreateImage)(CGContextRef context);
 
-WKScrollbarPainterRef (*wkMakeScrollbarPainter)(int controlSize, bool isHorizontal);
-WKScrollbarPainterRef (*wkMakeScrollbarReplacementPainter)(WKScrollbarPainterRef oldPainter, int newStyle, int controlSize, bool isHorizontal);
-void (*wkScrollbarPainterSetDelegate)(WKScrollbarPainterRef, id scrollbarPainterDelegate);
-void (*wkScrollbarPainterSetEnabled)(WKScrollbarPainterRef, bool enabled);
-void (*wkScrollbarPainterPaint)(WKScrollbarPainterRef, bool enabled, double value, CGFloat proportion, CGRect frameRect);
-void (*wkScrollbarPainterForceFlashScrollers)(WKScrollbarPainterControllerRef);
-int (*wkScrollbarThickness)(int controlSize);
-int (*wkScrollbarMinimumThumbLength)(WKScrollbarPainterRef);
-int (*wkScrollbarMinimumTotalLengthNeededForThumb)(WKScrollbarPainterRef);
-CGFloat (*wkScrollbarPainterKnobAlpha)(WKScrollbarPainterRef);
-void (*wkSetScrollbarPainterKnobAlpha)(WKScrollbarPainterRef, CGFloat);
-CGFloat (*wkScrollbarPainterTrackAlpha)(WKScrollbarPainterRef);
-void (*wkSetScrollbarPainterTrackAlpha)(WKScrollbarPainterRef, CGFloat);
-bool (*wkScrollbarPainterIsHorizontal)(WKScrollbarPainterRef);
-CGRect (*wkScrollbarPainterKnobRect)(WKScrollbarPainterRef);
-void (*wkScrollbarPainterSetOverlayState)(WKScrollbarPainterRef, int overlayScrollerState);
-void (*wkSetScrollbarPainterKnobStyle)(WKScrollbarPainterRef, wkScrollerKnobStyle);
-
-WKScrollbarPainterControllerRef (*wkMakeScrollbarPainterController)(id painterControllerDelegate);
-void (*wkSetPainterForPainterController)(WKScrollbarPainterControllerRef, WKScrollbarPainterRef, bool isHorizontal);
-WKScrollbarPainterRef (*wkVerticalScrollbarPainterForController)(WKScrollbarPainterControllerRef);
-WKScrollbarPainterRef (*wkHorizontalScrollbarPainterForController)(WKScrollbarPainterControllerRef);
-int (*wkScrollbarPainterControllerStyle)(WKScrollbarPainterControllerRef);
-void (*wkSetScrollbarPainterControllerStyle)(WKScrollbarPainterControllerRef, int newStyle);
-void (*wkContentAreaScrolled)(WKScrollbarPainterControllerRef);
-void (*wkContentAreaWillPaint)(WKScrollbarPainterControllerRef);
-void (*wkMouseEnteredContentArea)(WKScrollbarPainterControllerRef);
-void (*wkMouseExitedContentArea)(WKScrollbarPainterControllerRef);
-void (*wkMouseMovedInContentArea)(WKScrollbarPainterControllerRef);
-void (*wkWillStartLiveResize)(WKScrollbarPainterControllerRef);
-void (*wkContentAreaResized)(WKScrollbarPainterControllerRef);
-void (*wkWillEndLiveResize)(WKScrollbarPainterControllerRef);
-void (*wkContentAreaDidShow)(WKScrollbarPainterControllerRef);
-void (*wkContentAreaDidHide)(WKScrollbarPainterControllerRef);
-void (*wkDidBeginScrollGesture)(WKScrollbarPainterControllerRef);
-void (*wkDidEndScrollGesture)(WKScrollbarPainterControllerRef);
-
-bool (*wkScrollbarPainterUsesOverlayScrollers)(void);
+int (*wkRecommendedScrollerStyle)(void);
 
 bool (*wkExecutableWasLinkedOnOrBeforeSnowLeopard)(void);
 
index 8694af8..572fa7e 100644 (file)
@@ -1,3 +1,14 @@
+2011-08-18  Beth Dakin  <bdakin@apple.com>
+
+        Reviewed by Sam Weinig.
+
+        https://bugs.webkit.org/show_bug.cgi?id=66495
+        Lion-specific scroller SPIs can use forward declaration instead of 
+        WebKitSystemInterface
+
+        * WebCoreSupport/WebSystemInterface.mm:
+        (InitWebCoreSystemInterface):
+
 2011-08-18  Anders Carlsson  <andersca@apple.com>
 
         More C++0x libc++ build fixes
index 729bfac..10be9b3 100644 (file)
@@ -122,42 +122,7 @@ void InitWebCoreSystemInterface(void)
     INIT(IOSurfaceContextCreate);
     INIT(IOSurfaceContextCreateImage);
     INIT(CreateCTTypesetterWithUniCharProviderAndOptions);
-    INIT(MakeScrollbarPainter);
-    INIT(ScrollbarPainterSetDelegate);
-    INIT(ScrollbarPainterSetEnabled);
-    INIT(ScrollbarPainterPaint);
-    INIT(ScrollbarPainterForceFlashScrollers);
-    INIT(ScrollbarThickness);
-    INIT(ScrollbarMinimumThumbLength);
-    INIT(ScrollbarMinimumTotalLengthNeededForThumb);
-    INIT(ScrollbarPainterKnobAlpha);
-    INIT(SetScrollbarPainterKnobAlpha);
-    INIT(ScrollbarPainterTrackAlpha);
-    INIT(SetScrollbarPainterTrackAlpha);
-    INIT(ScrollbarPainterIsHorizontal);
-    INIT(ScrollbarPainterKnobRect);
-    INIT(ScrollbarPainterSetOverlayState);
-    INIT(SetScrollbarPainterKnobStyle);
-    INIT(MakeScrollbarPainterController);
-    INIT(MakeScrollbarReplacementPainter);
-    INIT(SetPainterForPainterController);
-    INIT(VerticalScrollbarPainterForController);
-    INIT(HorizontalScrollbarPainterForController);
-    INIT(ScrollbarPainterControllerStyle);
-    INIT(SetScrollbarPainterControllerStyle);
-    INIT(ContentAreaScrolled);
-    INIT(ContentAreaWillPaint);
-    INIT(MouseEnteredContentArea);
-    INIT(MouseExitedContentArea);
-    INIT(MouseMovedInContentArea);
-    INIT(WillStartLiveResize);
-    INIT(ContentAreaResized);
-    INIT(WillEndLiveResize);
-    INIT(ContentAreaDidShow);
-    INIT(ContentAreaDidHide);
-    INIT(DidBeginScrollGesture);
-    INIT(DidEndScrollGesture);
-    INIT(ScrollbarPainterUsesOverlayScrollers);
+    INIT(RecommendedScrollerStyle);
     INIT(ExecutableWasLinkedOnOrBeforeSnowLeopard);
     INIT(CopyDefaultSearchProviderDisplayName);
     INIT(AVAssetResolvedURL);
index 5f56649..5e08044 100644 (file)
@@ -1,3 +1,14 @@
+2011-08-18  Beth Dakin  <bdakin@apple.com>
+
+        Reviewed by Sam Weinig.
+
+        https://bugs.webkit.org/show_bug.cgi?id=66495
+        Lion-specific scroller SPIs can use forward declaration instead of 
+        WebKitSystemInterface
+
+        * WebProcess/WebCoreSupport/mac/WebSystemInterface.mm:
+        (InitWebCoreSystemInterface):
+
 2011-08-18  Darin Adler  <darin@apple.com>
 
         Made some code even more private to a particular file and class
index 1a85929..3296dc9 100644 (file)
@@ -113,42 +113,7 @@ void InitWebCoreSystemInterface(void)
         INIT(IOSurfaceContextCreate);
         INIT(IOSurfaceContextCreateImage);
         INIT(CreateCTTypesetterWithUniCharProviderAndOptions);
-        INIT(MakeScrollbarPainter);
-        INIT(ScrollbarPainterSetDelegate);
-        INIT(ScrollbarPainterSetEnabled);
-        INIT(ScrollbarPainterPaint);
-        INIT(ScrollbarPainterForceFlashScrollers);
-        INIT(ScrollbarThickness);
-        INIT(ScrollbarMinimumThumbLength);
-        INIT(ScrollbarMinimumTotalLengthNeededForThumb);
-        INIT(ScrollbarPainterKnobAlpha);
-        INIT(SetScrollbarPainterKnobAlpha);
-        INIT(ScrollbarPainterTrackAlpha);
-        INIT(SetScrollbarPainterTrackAlpha);
-        INIT(ScrollbarPainterIsHorizontal);
-        INIT(ScrollbarPainterKnobRect);
-        INIT(ScrollbarPainterSetOverlayState);
-        INIT(SetScrollbarPainterKnobStyle);
-        INIT(MakeScrollbarPainterController);
-        INIT(MakeScrollbarReplacementPainter);
-        INIT(SetPainterForPainterController);
-        INIT(VerticalScrollbarPainterForController);
-        INIT(HorizontalScrollbarPainterForController);
-        INIT(ScrollbarPainterControllerStyle);
-        INIT(SetScrollbarPainterControllerStyle);
-        INIT(ContentAreaScrolled);
-        INIT(ContentAreaWillPaint);
-        INIT(MouseEnteredContentArea);
-        INIT(MouseExitedContentArea);
-        INIT(MouseMovedInContentArea);
-        INIT(WillStartLiveResize);
-        INIT(ContentAreaResized);
-        INIT(WillEndLiveResize);
-        INIT(ContentAreaDidShow);
-        INIT(ContentAreaDidHide);
-        INIT(DidBeginScrollGesture);
-        INIT(DidEndScrollGesture);
-        INIT(ScrollbarPainterUsesOverlayScrollers);
+        INIT(RecommendedScrollerStyle);
         INIT(ExecutableWasLinkedOnOrBeforeSnowLeopard);
         INIT(CopyDefaultSearchProviderDisplayName);
         INIT(AVAssetResolvedURL);
index 543dcee..6a9de17 100644 (file)
@@ -1,3 +1,16 @@
+2011-08-18  Beth Dakin  <bdakin@apple.com>
+
+        Reviewed by Sam Weinig.
+
+        https://bugs.webkit.org/show_bug.cgi?id=66495
+        Lion-specific scroller SPIs can use forward declaration instead of 
+        WebKitSystemInterface
+
+        * WebKitSystemInterface.h:
+        * libWebKitSystemInterfaceLeopard.a:
+        * libWebKitSystemInterfaceLion.a:
+        * libWebKitSystemInterfaceSnowLeopard.a:
+
 2011-07-28  Dan Bernstein  <mitz@apple.com>
 
         WebKitSystemInterface support for
index 9f03302..f14c81b 100644 (file)
@@ -419,57 +419,7 @@ bool WKSandboxExtensionInvalidate(WKSandboxExtensionRef sandboxExtension);
 const char* WKSandboxExtensionGetSerializedFormat(WKSandboxExtensionRef sandboxExtension, size_t* length);
 WKSandboxExtensionRef WKSandboxExtensionCreateFromSerializedFormat(const char* serializationFormat, size_t length);
 
-typedef struct __WKScrollbarPainter *WKScrollbarPainterRef;
-typedef struct __WKScrollbarPainterController *WKScrollbarPainterControllerRef;
-
-WKScrollbarPainterRef WKMakeScrollbarPainter(int controlSize, bool isHorizontal);
-WKScrollbarPainterRef WKMakeScrollbarReplacementPainter(WKScrollbarPainterRef oldPainter, int newStyle, int controlSize, bool isHorizontal);
-void WKScrollbarPainterSetDelegate(WKScrollbarPainterRef, id scrollbarPainterDelegate);
-void WKScrollbarPainterSetEnabled(WKScrollbarPainterRef scrollbarPainter, bool enabled);
-void WKScrollbarPainterPaint(WKScrollbarPainterRef, bool enabled, double value, CGFloat proportion, CGRect frameRect);
-void WKScrollbarPainterForceFlashScrollers(WKScrollbarPainterControllerRef);
-int WKScrollbarThickness(int controlSize);
-int WKScrollbarMinimumThumbLength(WKScrollbarPainterRef);
-int WKScrollbarMinimumTotalLengthNeededForThumb(WKScrollbarPainterRef);
-CGFloat WKScrollbarPainterKnobAlpha(WKScrollbarPainterRef);
-void WKSetScrollbarPainterKnobAlpha(WKScrollbarPainterRef, CGFloat);
-CGFloat WKScrollbarPainterTrackAlpha(WKScrollbarPainterRef);
-void WKSetScrollbarPainterTrackAlpha(WKScrollbarPainterRef, CGFloat);
-bool WKScrollbarPainterIsHorizontal(WKScrollbarPainterRef);
-CGRect WKScrollbarPainterKnobRect(WKScrollbarPainterRef);
-void WKScrollbarPainterSetOverlayState(WKScrollbarPainterRef, int overlayScrollerState);
-
-// The wk* to WK* renaming does not apply to enums. The way to
-// circumvent this is to define the enum anonymously twice using
-// the two prefixes. (See WebCoreSystemInterface.h)
-enum {
-    WKScrollerKnobStyleDefault = 0,
-    WKScrollerKnobStyleDark = 1,
-    WKScrollerKnobStyleLight = 2
-};
-typedef uint32 WKScrollerKnobStyle;
-void WKSetScrollbarPainterKnobStyle(WKScrollbarPainterRef, WKScrollerKnobStyle);
-
-WKScrollbarPainterControllerRef WKMakeScrollbarPainterController(id painterControllerDelegate);
-void WKSetPainterForPainterController(WKScrollbarPainterControllerRef, WKScrollbarPainterRef, bool isHorizontal);
-WKScrollbarPainterRef WKVerticalScrollbarPainterForController(WKScrollbarPainterControllerRef);
-WKScrollbarPainterRef WKHorizontalScrollbarPainterForController(WKScrollbarPainterControllerRef);
-int WKScrollbarPainterControllerStyle(WKScrollbarPainterControllerRef);
-void WKSetScrollbarPainterControllerStyle(WKScrollbarPainterControllerRef, int newStyle);
-void WKContentAreaScrolled(WKScrollbarPainterControllerRef);
-void WKContentAreaWillPaint(WKScrollbarPainterControllerRef);
-void WKMouseEnteredContentArea(WKScrollbarPainterControllerRef);
-void WKMouseExitedContentArea(WKScrollbarPainterControllerRef);
-void WKMouseMovedInContentArea(WKScrollbarPainterControllerRef);
-void WKWillStartLiveResize(WKScrollbarPainterControllerRef);
-void WKContentAreaResized(WKScrollbarPainterControllerRef);
-void WKWillEndLiveResize(WKScrollbarPainterControllerRef);
-void WKContentAreaDidShow(WKScrollbarPainterControllerRef);
-void WKContentAreaDidHide(WKScrollbarPainterControllerRef);
-void WKDidBeginScrollGesture(WKScrollbarPainterControllerRef);
-void WKDidEndScrollGesture(WKScrollbarPainterControllerRef);
-
-bool WKScrollbarPainterUsesOverlayScrollers(void);
+int WKRecommendedScrollerStyle(void);
 
 bool WKExecutableWasLinkedOnOrBeforeSnowLeopard(void);
 
index 7aae6c4..57c997c 100644 (file)
Binary files a/WebKitLibraries/libWebKitSystemInterfaceLeopard.a and b/WebKitLibraries/libWebKitSystemInterfaceLeopard.a differ
index 34c7277..345860c 100644 (file)
Binary files a/WebKitLibraries/libWebKitSystemInterfaceLion.a and b/WebKitLibraries/libWebKitSystemInterfaceLion.a differ
index cabb624..957d67a 100644 (file)
Binary files a/WebKitLibraries/libWebKitSystemInterfaceSnowLeopard.a and b/WebKitLibraries/libWebKitSystemInterfaceSnowLeopard.a differ