+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
#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
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;
};
--- /dev/null
+/*
+ * 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
#endif
#if USE(WK_SCROLLBAR_PAINTER)
-typedef struct __WKScrollbarPainterController *WKScrollbarPainterControllerRef;
+typedef id WKScrollbarPainterControllerRef;
#endif
namespace WebCore {
#include "ScrollAnimatorMac.h"
#include "FloatPoint.h"
+#include "NSScrollerImpDetails.h"
#include "PlatformGestureEvent.h"
#include "PlatformWheelEvent.h"
#include "ScrollView.h"
return NSZeroPoint;
WebCore::Scrollbar* scrollbar = 0;
- if (wkScrollbarPainterIsHorizontal((WKScrollbarPainterRef)scrollerImp))
+ if ([scrollerImp isHorizontal])
scrollbar = _animator->scrollableArea()->horizontalScrollbar();
else
scrollbar = _animator->scrollableArea()->verticalScrollbar();
if (!_animator)
return;
- wkSetScrollbarPainterControllerStyle((WKScrollbarPainterControllerRef)scrollerImpPair, newRecommendedScrollerStyle);
+ [scrollerImpPair setScrollerStyle:newRecommendedScrollerStyle];
_animator->updateScrollerStyle();
}
_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;
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())
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());
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];
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];
#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
}
{
#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
void ScrollAnimatorMac::notifyPositionChanged()
{
#if USE(WK_SCROLLBAR_PAINTER)
- wkContentAreaScrolled(m_scrollbarPainterController.get());
+ [m_scrollbarPainterController.get() contentAreaScrolled];
#endif
ScrollAnimator::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
}
{
#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
{
#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
{
#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
{
#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
}
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
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
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
#include "ScrollbarThemeComposite.h"
#if USE(WK_SCROLLBAR_PAINTER)
-typedef struct __WKScrollbarPainter *WKScrollbarPainterRef;
+typedef id WKScrollbarPainterRef;
#endif
namespace WebCore {
#include "ImageBuffer.h"
#include "LocalCurrentGraphicsContext.h"
+#include "NSScrollerImpDetails.h"
#include "PlatformMouseEvent.h"
#include "ScrollAnimatorMac.h"
#include "ScrollView.h"
{
#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);
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
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
{
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
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
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)
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(),
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);
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);
+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
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);
+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
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);
+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
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);