Decouple scrollbar painting from Scrollbar object
authorjamesr@google.com <jamesr@google.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 1 Mar 2012 23:36:21 +0000 (23:36 +0000)
committerjamesr@google.com <jamesr@google.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 1 Mar 2012 23:36:21 +0000 (23:36 +0000)
https://bugs.webkit.org/show_bug.cgi?id=78028

Patch by Peter Kotwicz <pkotwicz@google.com> on 2012-03-01
Reviewed by James Robinson.

Added interface ScrollbarThemeClient which Scrollbar inherits from.
This allows painting via ScrollbarTheme with a proxy to a Scrollbar
object.

* GNUmakefile.list.am:
* Target.pri:
* WebCore.gypi:
* WebCore.vcproj/WebCore.vcproj:
* WebCore.xcodeproj/project.pbxproj:
* platform/Scrollbar.cpp:
(WebCore::Scrollbar::scrollbarOverlayStyle):
(WebCore):
(WebCore::Scrollbar::getTickmarks):
(WebCore::Scrollbar::isScrollableAreaActive):
(WebCore::Scrollbar::isScrollViewScrollbar):
(WebCore::Scrollbar::setFrameRect):
* platform/Scrollbar.h:
(Scrollbar):
(WebCore::Scrollbar::x):
(WebCore::Scrollbar::y):
(WebCore::Scrollbar::width):
(WebCore::Scrollbar::height):
(WebCore::Scrollbar::size):
(WebCore::Scrollbar::location):
(WebCore::Scrollbar::parent):
(WebCore::Scrollbar::root):
(WebCore::Scrollbar::frameRect):
(WebCore::Scrollbar::invalidate):
(WebCore::Scrollbar::convertFromContainingWindow):
(WebCore::Scrollbar::isCustomScrollbar):
(WebCore::Scrollbar::orientation):
(WebCore::Scrollbar::value):
(WebCore::Scrollbar::currentPos):
(WebCore::Scrollbar::visibleSize):
(WebCore::Scrollbar::totalSize):
(WebCore::Scrollbar::maximum):
(WebCore::Scrollbar::controlSize):
(WebCore::Scrollbar::lineStep):
(WebCore::Scrollbar::pageStep):
(WebCore::Scrollbar::pressedPart):
(WebCore::Scrollbar::hoveredPart):
(WebCore::Scrollbar::styleChanged):
(WebCore::Scrollbar::enabled):
* platform/ScrollbarTheme.h:
(WebCore):
(WebCore::ScrollbarTheme::updateEnabledState):
(WebCore::ScrollbarTheme::paint):
(WebCore::ScrollbarTheme::hitTest):
(WebCore::ScrollbarTheme::updateScrollbarOverlayStyle):
(WebCore::ScrollbarTheme::invalidateParts):
(WebCore::ScrollbarTheme::invalidatePart):
(WebCore::ScrollbarTheme::shouldCenterOnThumb):
(WebCore::ScrollbarTheme::shouldSnapBackToDragOrigin):
(WebCore::ScrollbarTheme::shouldDragDocumentInsteadOfThumb):
(WebCore::ScrollbarTheme::thumbPosition):
(WebCore::ScrollbarTheme::thumbLength):
(WebCore::ScrollbarTheme::trackPosition):
(WebCore::ScrollbarTheme::trackLength):
(WebCore::ScrollbarTheme::registerScrollbar):
(WebCore::ScrollbarTheme::unregisterScrollbar):
* platform/ScrollbarThemeClient.h: Added.
(WebCore):
(ScrollbarThemeClient):
(WebCore::ScrollbarThemeClient::~ScrollbarThemeClient):
* platform/ScrollbarThemeComposite.cpp:
(WebCore::ScrollbarThemeComposite::paint):
(WebCore::ScrollbarThemeComposite::hitTest):
(WebCore::ScrollbarThemeComposite::invalidatePart):
(WebCore::ScrollbarThemeComposite::splitTrack):
(WebCore::usedTotalSize):
(WebCore::ScrollbarThemeComposite::thumbPosition):
(WebCore::ScrollbarThemeComposite::thumbLength):
(WebCore::ScrollbarThemeComposite::minimumThumbLength):
(WebCore::ScrollbarThemeComposite::trackPosition):
(WebCore::ScrollbarThemeComposite::trackLength):
* platform/ScrollbarThemeComposite.h:
(ScrollbarThemeComposite):
(WebCore::ScrollbarThemeComposite::paintScrollbarBackground):
(WebCore::ScrollbarThemeComposite::paintTrackBackground):
(WebCore::ScrollbarThemeComposite::paintTrackPiece):
(WebCore::ScrollbarThemeComposite::paintButton):
(WebCore::ScrollbarThemeComposite::paintThumb):
(WebCore::ScrollbarThemeComposite::paintTickmarks):
(WebCore::ScrollbarThemeComposite::constrainTrackRectToTrackPieces):
* platform/chromium/ScrollbarThemeChromium.cpp:
(WebCore::ScrollbarThemeChromium::hasThumb):
(WebCore::ScrollbarThemeChromium::backButtonRect):
(WebCore::ScrollbarThemeChromium::forwardButtonRect):
(WebCore::ScrollbarThemeChromium::trackRect):
(WebCore::ScrollbarThemeChromium::paintTrackBackground):
(WebCore::ScrollbarThemeChromium::paintTickmarks):
* platform/chromium/ScrollbarThemeChromium.h:
(WebCore::ScrollbarThemeChromium::hasButtons):
(ScrollbarThemeChromium):
* platform/chromium/ScrollbarThemeChromiumAndroid.cpp:
(WebCore::ScrollbarThemeChromiumAndroid::paintScrollbarBackground):
(WebCore::ScrollbarThemeChromiumAndroid::shouldCenterOnThumb):
(WebCore::ScrollbarThemeChromiumAndroid::buttonSize):
(WebCore::ScrollbarThemeChromiumAndroid::minimumThumbLength):
* platform/chromium/ScrollbarThemeChromiumAndroid.h:
(ScrollbarThemeChromiumAndroid):
* platform/chromium/ScrollbarThemeChromiumLinux.cpp:
(WebCore::ScrollbarThemeChromiumLinux::paintTrackPiece):
(WebCore::ScrollbarThemeChromiumLinux::paintButton):
(WebCore::ScrollbarThemeChromiumLinux::paintThumb):
(WebCore::ScrollbarThemeChromiumLinux::shouldCenterOnThumb):
(WebCore::ScrollbarThemeChromiumLinux::buttonSize):
(WebCore::ScrollbarThemeChromiumLinux::minimumThumbLength):
* platform/chromium/ScrollbarThemeChromiumLinux.h:
(ScrollbarThemeChromiumLinux):
* platform/chromium/ScrollbarThemeChromiumMac.h:
(ScrollbarThemeChromiumMac):
* platform/chromium/ScrollbarThemeChromiumMac.mm:
(WebCore::scrollbarStateToThemeState):
(WebCore::ScrollbarThemeChromiumMac::paint):
(WebCore::ScrollbarThemeChromiumMac::paintGivenTickmarks):
* platform/chromium/ScrollbarThemeChromiumWin.cpp:
(WebCore::ScrollbarThemeChromiumWin::shouldSnapBackToDragOrigin):
(WebCore::ScrollbarThemeChromiumWin::paintTrackPiece):
(WebCore::ScrollbarThemeChromiumWin::paintButton):
(WebCore::ScrollbarThemeChromiumWin::paintThumb):
(WebCore::ScrollbarThemeChromiumWin::getThemeState):
(WebCore::ScrollbarThemeChromiumWin::getThemeArrowState):
(WebCore::ScrollbarThemeChromiumWin::getClassicThemeState):
(WebCore::ScrollbarThemeChromiumWin::shouldCenterOnThumb):
(WebCore::ScrollbarThemeChromiumWin::buttonSize):
* platform/chromium/ScrollbarThemeChromiumWin.h:
(ScrollbarThemeChromiumWin):
* platform/efl/ScrollbarThemeEfl.cpp:
(WebCore::ScrollbarThemeEfl::registerScrollbar):
(WebCore::ScrollbarThemeEfl::unregisterScrollbar):
* platform/efl/ScrollbarThemeEfl.h:
(ScrollbarThemeEfl):
* platform/gtk/ScrollbarThemeGtk.cpp:
(WebCore):
(WebCore::ScrollbarThemeGtk::registerScrollbar):
(WebCore::ScrollbarThemeGtk::unregisterScrollbar):
(WebCore::ScrollbarThemeGtk::updateScrollbarsFrameThickness):
(WebCore::ScrollbarThemeGtk::hasThumb):
(WebCore::ScrollbarThemeGtk::backButtonRect):
(WebCore::ScrollbarThemeGtk::forwardButtonRect):
(WebCore::ScrollbarThemeGtk::trackRect):
(WebCore::ScrollbarThemeGtk::thumbRect):
(WebCore::ScrollbarThemeGtk::paint):
(WebCore::ScrollbarThemeGtk::shouldCenterOnThumb):
(WebCore::ScrollbarThemeGtk::buttonSize):
(WebCore::ScrollbarThemeGtk::minimumThumbLength):
* platform/gtk/ScrollbarThemeGtk.h:
(WebCore::ScrollbarThemeGtk::hasButtons):
(ScrollbarThemeGtk):
* platform/gtk/ScrollbarThemeGtk2.cpp:
(WebCore::getWidgetForScrollbar):
(WebCore::ScrollbarThemeGtk::paintTrackBackground):
(WebCore::ScrollbarThemeGtk::paintScrollbarBackground):
(WebCore::ScrollbarThemeGtk::paintThumb):
(WebCore::ScrollbarThemeGtk::paintButton):
* platform/gtk/ScrollbarThemeGtk3.cpp:
(WebCore::ScrollbarThemeGtk::paintTrackBackground):
(WebCore::ScrollbarThemeGtk::paintScrollbarBackground):
(WebCore::ScrollbarThemeGtk::paintThumb):
(WebCore::ScrollbarThemeGtk::paintButton):
* platform/mac/ScrollbarThemeMac.h:
(ScrollbarThemeMac):
* platform/mac/ScrollbarThemeMac.mm:
(WebCore):
(WebCore::ScrollbarThemeMac::registerScrollbar):
(WebCore::ScrollbarThemeMac::unregisterScrollbar):
(WebCore::ScrollbarThemeMac::setNewPainterForScrollbar):
(WebCore::ScrollbarThemeMac::painterForScrollbar):
(WebCore::ScrollbarThemeMac::updateScrollbarOverlayStyle):
(WebCore::ScrollbarThemeMac::hasButtons):
(WebCore::ScrollbarThemeMac::hasThumb):
(WebCore::ScrollbarThemeMac::backButtonRect):
(WebCore::ScrollbarThemeMac::forwardButtonRect):
(WebCore::ScrollbarThemeMac::trackRect):
(WebCore::ScrollbarThemeMac::minimumThumbLength):
(WebCore::ScrollbarThemeMac::shouldCenterOnThumb):
(WebCore::ScrollbarThemeMac::shouldDragDocumentInsteadOfThumb):
(WebCore::ScrollbarThemeMac::updateEnabledState):
(WebCore::ScrollbarThemeMac::paint):
* platform/mock/ScrollbarThemeMock.cpp:
(WebCore::ScrollbarThemeMock::trackRect):
(WebCore::ScrollbarThemeMock::paintTrackBackground):
(WebCore::ScrollbarThemeMock::paintThumb):
* platform/mock/ScrollbarThemeMock.h:
(WebCore::ScrollbarThemeMock::hasButtons):
(WebCore::ScrollbarThemeMock::hasThumb):
(WebCore::ScrollbarThemeMock::backButtonRect):
(WebCore::ScrollbarThemeMock::forwardButtonRect):
(ScrollbarThemeMock):
* platform/qt/ScrollbarThemeQt.cpp:
(WebCore::styleOptionSlider):
(WebCore::ScrollbarThemeQt::paint):
(WebCore::ScrollbarThemeQt::hitTest):
(WebCore::ScrollbarThemeQt::shouldCenterOnThumb):
(WebCore::ScrollbarThemeQt::invalidatePart):
(WebCore::ScrollbarThemeQt::thumbPosition):
(WebCore::ScrollbarThemeQt::thumbLength):
(WebCore::ScrollbarThemeQt::trackPosition):
(WebCore::ScrollbarThemeQt::trackLength):
* platform/qt/ScrollbarThemeQt.h:
(ScrollbarThemeQt):
* platform/win/ScrollbarThemeSafari.cpp:
(WebCore::ScrollbarThemeSafari::hasButtons):
(WebCore::ScrollbarThemeSafari::hasThumb):
(WebCore::ScrollbarThemeSafari::backButtonRect):
(WebCore::ScrollbarThemeSafari::forwardButtonRect):
(WebCore::ScrollbarThemeSafari::trackRect):
(WebCore::ScrollbarThemeSafari::minimumThumbLength):
(WebCore::ScrollbarThemeSafari::shouldCenterOnThumb):
(WebCore::ScrollbarThemeSafari::paintTrackBackground):
(WebCore::ScrollbarThemeSafari::paintButton):
(WebCore::ScrollbarThemeSafari::paintThumb):
* platform/win/ScrollbarThemeSafari.h:
(ScrollbarThemeSafari):
* platform/win/ScrollbarThemeWin.cpp:
(WebCore::ScrollbarThemeWin::hasThumb):
(WebCore::ScrollbarThemeWin::backButtonRect):
(WebCore::ScrollbarThemeWin::forwardButtonRect):
(WebCore::ScrollbarThemeWin::trackRect):
(WebCore::ScrollbarThemeWin::shouldCenterOnThumb):
(WebCore::ScrollbarThemeWin::shouldSnapBackToDragOrigin):
(WebCore::ScrollbarThemeWin::paintTrackBackground):
(WebCore::ScrollbarThemeWin::paintTrackPiece):
(WebCore::ScrollbarThemeWin::paintButton):
(WebCore::paintGripper):
(WebCore::ScrollbarThemeWin::paintThumb):
* platform/win/ScrollbarThemeWin.h:
(WebCore::ScrollbarThemeWin::hasButtons):
(ScrollbarThemeWin):
* platform/wx/ScrollbarThemeWx.cpp:
(WebCore::ScrollbarThemeWx::hasThumb):
(WebCore::ScrollbarThemeWx::minimumThumbLength):
(WebCore::ScrollbarThemeWx::buttonSize):
(WebCore::ScrollbarThemeWx::splitTrack):
(WebCore::ScrollbarThemeWx::backButtonRect):
(WebCore::ScrollbarThemeWx::forwardButtonRect):
(WebCore::ScrollbarThemeWx::trackRect):
(WebCore::ScrollbarThemeWx::paint):
* platform/wx/ScrollbarThemeWx.h:
(ScrollbarThemeWx):
(WebCore::ScrollbarThemeWx::hasButtons):
* rendering/RenderScrollbar.h:
(WebCore::toRenderScrollbar):
* rendering/RenderScrollbarTheme.cpp:
(WebCore::RenderScrollbarTheme::buttonSizesAlongTrackAxis):
(WebCore::RenderScrollbarTheme::hasButtons):
(WebCore::RenderScrollbarTheme::hasThumb):
(WebCore::RenderScrollbarTheme::minimumThumbLength):
(WebCore::RenderScrollbarTheme::backButtonRect):
(WebCore::RenderScrollbarTheme::forwardButtonRect):
(WebCore::RenderScrollbarTheme::trackRect):
(WebCore::RenderScrollbarTheme::constrainTrackRectToTrackPieces):
(WebCore::RenderScrollbarTheme::paintScrollbarBackground):
(WebCore::RenderScrollbarTheme::paintTrackBackground):
(WebCore::RenderScrollbarTheme::paintTrackPiece):
(WebCore::RenderScrollbarTheme::paintButton):
(WebCore::RenderScrollbarTheme::paintThumb):
* rendering/RenderScrollbarTheme.h:
(WebCore::RenderScrollbarTheme::shouldCenterOnThumb):
(WebCore::RenderScrollbarTheme::registerScrollbar):
(WebCore::RenderScrollbarTheme::unregisterScrollbar):
(RenderScrollbarTheme):

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

43 files changed:
Source/WebCore/ChangeLog
Source/WebCore/GNUmakefile.list.am
Source/WebCore/Target.pri
Source/WebCore/WebCore.gypi
Source/WebCore/WebCore.vcproj/WebCore.vcproj
Source/WebCore/WebCore.xcodeproj/project.pbxproj
Source/WebCore/platform/Scrollbar.cpp
Source/WebCore/platform/Scrollbar.h
Source/WebCore/platform/ScrollbarTheme.h
Source/WebCore/platform/ScrollbarThemeClient.h [new file with mode: 0644]
Source/WebCore/platform/ScrollbarThemeComposite.cpp
Source/WebCore/platform/ScrollbarThemeComposite.h
Source/WebCore/platform/chromium/ScrollbarThemeChromium.cpp
Source/WebCore/platform/chromium/ScrollbarThemeChromium.h
Source/WebCore/platform/chromium/ScrollbarThemeChromiumAndroid.cpp
Source/WebCore/platform/chromium/ScrollbarThemeChromiumAndroid.h
Source/WebCore/platform/chromium/ScrollbarThemeChromiumLinux.cpp
Source/WebCore/platform/chromium/ScrollbarThemeChromiumLinux.h
Source/WebCore/platform/chromium/ScrollbarThemeChromiumMac.h
Source/WebCore/platform/chromium/ScrollbarThemeChromiumMac.mm
Source/WebCore/platform/chromium/ScrollbarThemeChromiumWin.cpp
Source/WebCore/platform/chromium/ScrollbarThemeChromiumWin.h
Source/WebCore/platform/efl/ScrollbarThemeEfl.cpp
Source/WebCore/platform/efl/ScrollbarThemeEfl.h
Source/WebCore/platform/gtk/ScrollbarThemeGtk.cpp
Source/WebCore/platform/gtk/ScrollbarThemeGtk.h
Source/WebCore/platform/gtk/ScrollbarThemeGtk2.cpp
Source/WebCore/platform/gtk/ScrollbarThemeGtk3.cpp
Source/WebCore/platform/mac/ScrollbarThemeMac.h
Source/WebCore/platform/mac/ScrollbarThemeMac.mm
Source/WebCore/platform/mock/ScrollbarThemeMock.cpp
Source/WebCore/platform/mock/ScrollbarThemeMock.h
Source/WebCore/platform/qt/ScrollbarThemeQt.cpp
Source/WebCore/platform/qt/ScrollbarThemeQt.h
Source/WebCore/platform/win/ScrollbarThemeSafari.cpp
Source/WebCore/platform/win/ScrollbarThemeSafari.h
Source/WebCore/platform/win/ScrollbarThemeWin.cpp
Source/WebCore/platform/win/ScrollbarThemeWin.h
Source/WebCore/platform/wx/ScrollbarThemeWx.cpp
Source/WebCore/platform/wx/ScrollbarThemeWx.h
Source/WebCore/rendering/RenderScrollbar.h
Source/WebCore/rendering/RenderScrollbarTheme.cpp
Source/WebCore/rendering/RenderScrollbarTheme.h

index 3dc1509..5c80ec6 100644 (file)
@@ -1,3 +1,274 @@
+2012-03-01  Peter Kotwicz  <pkotwicz@google.com>
+
+        Decouple scrollbar painting from Scrollbar object
+        https://bugs.webkit.org/show_bug.cgi?id=78028
+
+        Reviewed by James Robinson.
+
+        Added interface ScrollbarThemeClient which Scrollbar inherits from.
+        This allows painting via ScrollbarTheme with a proxy to a Scrollbar
+        object.
+
+        * GNUmakefile.list.am:
+        * Target.pri:
+        * WebCore.gypi:
+        * WebCore.vcproj/WebCore.vcproj:
+        * WebCore.xcodeproj/project.pbxproj:
+        * platform/Scrollbar.cpp:
+        (WebCore::Scrollbar::scrollbarOverlayStyle):
+        (WebCore):
+        (WebCore::Scrollbar::getTickmarks):
+        (WebCore::Scrollbar::isScrollableAreaActive):
+        (WebCore::Scrollbar::isScrollViewScrollbar):
+        (WebCore::Scrollbar::setFrameRect):
+        * platform/Scrollbar.h:
+        (Scrollbar):
+        (WebCore::Scrollbar::x):
+        (WebCore::Scrollbar::y):
+        (WebCore::Scrollbar::width):
+        (WebCore::Scrollbar::height):
+        (WebCore::Scrollbar::size):
+        (WebCore::Scrollbar::location):
+        (WebCore::Scrollbar::parent):
+        (WebCore::Scrollbar::root):
+        (WebCore::Scrollbar::frameRect):
+        (WebCore::Scrollbar::invalidate):
+        (WebCore::Scrollbar::convertFromContainingWindow):
+        (WebCore::Scrollbar::isCustomScrollbar):
+        (WebCore::Scrollbar::orientation):
+        (WebCore::Scrollbar::value):
+        (WebCore::Scrollbar::currentPos):
+        (WebCore::Scrollbar::visibleSize):
+        (WebCore::Scrollbar::totalSize):
+        (WebCore::Scrollbar::maximum):
+        (WebCore::Scrollbar::controlSize):
+        (WebCore::Scrollbar::lineStep):
+        (WebCore::Scrollbar::pageStep):
+        (WebCore::Scrollbar::pressedPart):
+        (WebCore::Scrollbar::hoveredPart):
+        (WebCore::Scrollbar::styleChanged):
+        (WebCore::Scrollbar::enabled):
+        * platform/ScrollbarTheme.h:
+        (WebCore):
+        (WebCore::ScrollbarTheme::updateEnabledState):
+        (WebCore::ScrollbarTheme::paint):
+        (WebCore::ScrollbarTheme::hitTest):
+        (WebCore::ScrollbarTheme::updateScrollbarOverlayStyle):
+        (WebCore::ScrollbarTheme::invalidateParts):
+        (WebCore::ScrollbarTheme::invalidatePart):
+        (WebCore::ScrollbarTheme::shouldCenterOnThumb):
+        (WebCore::ScrollbarTheme::shouldSnapBackToDragOrigin):
+        (WebCore::ScrollbarTheme::shouldDragDocumentInsteadOfThumb):
+        (WebCore::ScrollbarTheme::thumbPosition):
+        (WebCore::ScrollbarTheme::thumbLength):
+        (WebCore::ScrollbarTheme::trackPosition):
+        (WebCore::ScrollbarTheme::trackLength):
+        (WebCore::ScrollbarTheme::registerScrollbar):
+        (WebCore::ScrollbarTheme::unregisterScrollbar):
+        * platform/ScrollbarThemeClient.h: Added.
+        (WebCore):
+        (ScrollbarThemeClient):
+        (WebCore::ScrollbarThemeClient::~ScrollbarThemeClient):
+        * platform/ScrollbarThemeComposite.cpp:
+        (WebCore::ScrollbarThemeComposite::paint):
+        (WebCore::ScrollbarThemeComposite::hitTest):
+        (WebCore::ScrollbarThemeComposite::invalidatePart):
+        (WebCore::ScrollbarThemeComposite::splitTrack):
+        (WebCore::usedTotalSize):
+        (WebCore::ScrollbarThemeComposite::thumbPosition):
+        (WebCore::ScrollbarThemeComposite::thumbLength):
+        (WebCore::ScrollbarThemeComposite::minimumThumbLength):
+        (WebCore::ScrollbarThemeComposite::trackPosition):
+        (WebCore::ScrollbarThemeComposite::trackLength):
+        * platform/ScrollbarThemeComposite.h:
+        (ScrollbarThemeComposite):
+        (WebCore::ScrollbarThemeComposite::paintScrollbarBackground):
+        (WebCore::ScrollbarThemeComposite::paintTrackBackground):
+        (WebCore::ScrollbarThemeComposite::paintTrackPiece):
+        (WebCore::ScrollbarThemeComposite::paintButton):
+        (WebCore::ScrollbarThemeComposite::paintThumb):
+        (WebCore::ScrollbarThemeComposite::paintTickmarks):
+        (WebCore::ScrollbarThemeComposite::constrainTrackRectToTrackPieces):
+        * platform/chromium/ScrollbarThemeChromium.cpp:
+        (WebCore::ScrollbarThemeChromium::hasThumb):
+        (WebCore::ScrollbarThemeChromium::backButtonRect):
+        (WebCore::ScrollbarThemeChromium::forwardButtonRect):
+        (WebCore::ScrollbarThemeChromium::trackRect):
+        (WebCore::ScrollbarThemeChromium::paintTrackBackground):
+        (WebCore::ScrollbarThemeChromium::paintTickmarks):
+        * platform/chromium/ScrollbarThemeChromium.h:
+        (WebCore::ScrollbarThemeChromium::hasButtons):
+        (ScrollbarThemeChromium):
+        * platform/chromium/ScrollbarThemeChromiumAndroid.cpp:
+        (WebCore::ScrollbarThemeChromiumAndroid::paintScrollbarBackground):
+        (WebCore::ScrollbarThemeChromiumAndroid::shouldCenterOnThumb):
+        (WebCore::ScrollbarThemeChromiumAndroid::buttonSize):
+        (WebCore::ScrollbarThemeChromiumAndroid::minimumThumbLength):
+        * platform/chromium/ScrollbarThemeChromiumAndroid.h:
+        (ScrollbarThemeChromiumAndroid):
+        * platform/chromium/ScrollbarThemeChromiumLinux.cpp:
+        (WebCore::ScrollbarThemeChromiumLinux::paintTrackPiece):
+        (WebCore::ScrollbarThemeChromiumLinux::paintButton):
+        (WebCore::ScrollbarThemeChromiumLinux::paintThumb):
+        (WebCore::ScrollbarThemeChromiumLinux::shouldCenterOnThumb):
+        (WebCore::ScrollbarThemeChromiumLinux::buttonSize):
+        (WebCore::ScrollbarThemeChromiumLinux::minimumThumbLength):
+        * platform/chromium/ScrollbarThemeChromiumLinux.h:
+        (ScrollbarThemeChromiumLinux):
+        * platform/chromium/ScrollbarThemeChromiumMac.h:
+        (ScrollbarThemeChromiumMac):
+        * platform/chromium/ScrollbarThemeChromiumMac.mm:
+        (WebCore::scrollbarStateToThemeState):
+        (WebCore::ScrollbarThemeChromiumMac::paint):
+        (WebCore::ScrollbarThemeChromiumMac::paintGivenTickmarks):
+        * platform/chromium/ScrollbarThemeChromiumWin.cpp:
+        (WebCore::ScrollbarThemeChromiumWin::shouldSnapBackToDragOrigin):
+        (WebCore::ScrollbarThemeChromiumWin::paintTrackPiece):
+        (WebCore::ScrollbarThemeChromiumWin::paintButton):
+        (WebCore::ScrollbarThemeChromiumWin::paintThumb):
+        (WebCore::ScrollbarThemeChromiumWin::getThemeState):
+        (WebCore::ScrollbarThemeChromiumWin::getThemeArrowState):
+        (WebCore::ScrollbarThemeChromiumWin::getClassicThemeState):
+        (WebCore::ScrollbarThemeChromiumWin::shouldCenterOnThumb):
+        (WebCore::ScrollbarThemeChromiumWin::buttonSize):
+        * platform/chromium/ScrollbarThemeChromiumWin.h:
+        (ScrollbarThemeChromiumWin):
+        * platform/efl/ScrollbarThemeEfl.cpp:
+        (WebCore::ScrollbarThemeEfl::registerScrollbar):
+        (WebCore::ScrollbarThemeEfl::unregisterScrollbar):
+        * platform/efl/ScrollbarThemeEfl.h:
+        (ScrollbarThemeEfl):
+        * platform/gtk/ScrollbarThemeGtk.cpp:
+        (WebCore):
+        (WebCore::ScrollbarThemeGtk::registerScrollbar):
+        (WebCore::ScrollbarThemeGtk::unregisterScrollbar):
+        (WebCore::ScrollbarThemeGtk::updateScrollbarsFrameThickness):
+        (WebCore::ScrollbarThemeGtk::hasThumb):
+        (WebCore::ScrollbarThemeGtk::backButtonRect):
+        (WebCore::ScrollbarThemeGtk::forwardButtonRect):
+        (WebCore::ScrollbarThemeGtk::trackRect):
+        (WebCore::ScrollbarThemeGtk::thumbRect):
+        (WebCore::ScrollbarThemeGtk::paint):
+        (WebCore::ScrollbarThemeGtk::shouldCenterOnThumb):
+        (WebCore::ScrollbarThemeGtk::buttonSize):
+        (WebCore::ScrollbarThemeGtk::minimumThumbLength):
+        * platform/gtk/ScrollbarThemeGtk.h:
+        (WebCore::ScrollbarThemeGtk::hasButtons):
+        (ScrollbarThemeGtk):
+        * platform/gtk/ScrollbarThemeGtk2.cpp:
+        (WebCore::getWidgetForScrollbar):
+        (WebCore::ScrollbarThemeGtk::paintTrackBackground):
+        (WebCore::ScrollbarThemeGtk::paintScrollbarBackground):
+        (WebCore::ScrollbarThemeGtk::paintThumb):
+        (WebCore::ScrollbarThemeGtk::paintButton):
+        * platform/gtk/ScrollbarThemeGtk3.cpp:
+        (WebCore::ScrollbarThemeGtk::paintTrackBackground):
+        (WebCore::ScrollbarThemeGtk::paintScrollbarBackground):
+        (WebCore::ScrollbarThemeGtk::paintThumb):
+        (WebCore::ScrollbarThemeGtk::paintButton):
+        * platform/mac/ScrollbarThemeMac.h:
+        (ScrollbarThemeMac):
+        * platform/mac/ScrollbarThemeMac.mm:
+        (WebCore):
+        (WebCore::ScrollbarThemeMac::registerScrollbar):
+        (WebCore::ScrollbarThemeMac::unregisterScrollbar):
+        (WebCore::ScrollbarThemeMac::setNewPainterForScrollbar):
+        (WebCore::ScrollbarThemeMac::painterForScrollbar):
+        (WebCore::ScrollbarThemeMac::updateScrollbarOverlayStyle):
+        (WebCore::ScrollbarThemeMac::hasButtons):
+        (WebCore::ScrollbarThemeMac::hasThumb):
+        (WebCore::ScrollbarThemeMac::backButtonRect):
+        (WebCore::ScrollbarThemeMac::forwardButtonRect):
+        (WebCore::ScrollbarThemeMac::trackRect):
+        (WebCore::ScrollbarThemeMac::minimumThumbLength):
+        (WebCore::ScrollbarThemeMac::shouldCenterOnThumb):
+        (WebCore::ScrollbarThemeMac::shouldDragDocumentInsteadOfThumb):
+        (WebCore::ScrollbarThemeMac::updateEnabledState):
+        (WebCore::ScrollbarThemeMac::paint):
+        * platform/mock/ScrollbarThemeMock.cpp:
+        (WebCore::ScrollbarThemeMock::trackRect):
+        (WebCore::ScrollbarThemeMock::paintTrackBackground):
+        (WebCore::ScrollbarThemeMock::paintThumb):
+        * platform/mock/ScrollbarThemeMock.h:
+        (WebCore::ScrollbarThemeMock::hasButtons):
+        (WebCore::ScrollbarThemeMock::hasThumb):
+        (WebCore::ScrollbarThemeMock::backButtonRect):
+        (WebCore::ScrollbarThemeMock::forwardButtonRect):
+        (ScrollbarThemeMock):
+        * platform/qt/ScrollbarThemeQt.cpp:
+        (WebCore::styleOptionSlider):
+        (WebCore::ScrollbarThemeQt::paint):
+        (WebCore::ScrollbarThemeQt::hitTest):
+        (WebCore::ScrollbarThemeQt::shouldCenterOnThumb):
+        (WebCore::ScrollbarThemeQt::invalidatePart):
+        (WebCore::ScrollbarThemeQt::thumbPosition):
+        (WebCore::ScrollbarThemeQt::thumbLength):
+        (WebCore::ScrollbarThemeQt::trackPosition):
+        (WebCore::ScrollbarThemeQt::trackLength):
+        * platform/qt/ScrollbarThemeQt.h:
+        (ScrollbarThemeQt):
+        * platform/win/ScrollbarThemeSafari.cpp:
+        (WebCore::ScrollbarThemeSafari::hasButtons):
+        (WebCore::ScrollbarThemeSafari::hasThumb):
+        (WebCore::ScrollbarThemeSafari::backButtonRect):
+        (WebCore::ScrollbarThemeSafari::forwardButtonRect):
+        (WebCore::ScrollbarThemeSafari::trackRect):
+        (WebCore::ScrollbarThemeSafari::minimumThumbLength):
+        (WebCore::ScrollbarThemeSafari::shouldCenterOnThumb):
+        (WebCore::ScrollbarThemeSafari::paintTrackBackground):
+        (WebCore::ScrollbarThemeSafari::paintButton):
+        (WebCore::ScrollbarThemeSafari::paintThumb):
+        * platform/win/ScrollbarThemeSafari.h:
+        (ScrollbarThemeSafari):
+        * platform/win/ScrollbarThemeWin.cpp:
+        (WebCore::ScrollbarThemeWin::hasThumb):
+        (WebCore::ScrollbarThemeWin::backButtonRect):
+        (WebCore::ScrollbarThemeWin::forwardButtonRect):
+        (WebCore::ScrollbarThemeWin::trackRect):
+        (WebCore::ScrollbarThemeWin::shouldCenterOnThumb):
+        (WebCore::ScrollbarThemeWin::shouldSnapBackToDragOrigin):
+        (WebCore::ScrollbarThemeWin::paintTrackBackground):
+        (WebCore::ScrollbarThemeWin::paintTrackPiece):
+        (WebCore::ScrollbarThemeWin::paintButton):
+        (WebCore::paintGripper):
+        (WebCore::ScrollbarThemeWin::paintThumb):
+        * platform/win/ScrollbarThemeWin.h:
+        (WebCore::ScrollbarThemeWin::hasButtons):
+        (ScrollbarThemeWin):
+        * platform/wx/ScrollbarThemeWx.cpp:
+        (WebCore::ScrollbarThemeWx::hasThumb):
+        (WebCore::ScrollbarThemeWx::minimumThumbLength):
+        (WebCore::ScrollbarThemeWx::buttonSize):
+        (WebCore::ScrollbarThemeWx::splitTrack):
+        (WebCore::ScrollbarThemeWx::backButtonRect):
+        (WebCore::ScrollbarThemeWx::forwardButtonRect):
+        (WebCore::ScrollbarThemeWx::trackRect):
+        (WebCore::ScrollbarThemeWx::paint):
+        * platform/wx/ScrollbarThemeWx.h:
+        (ScrollbarThemeWx):
+        (WebCore::ScrollbarThemeWx::hasButtons):
+        * rendering/RenderScrollbar.h:
+        (WebCore::toRenderScrollbar):
+        * rendering/RenderScrollbarTheme.cpp:
+        (WebCore::RenderScrollbarTheme::buttonSizesAlongTrackAxis):
+        (WebCore::RenderScrollbarTheme::hasButtons):
+        (WebCore::RenderScrollbarTheme::hasThumb):
+        (WebCore::RenderScrollbarTheme::minimumThumbLength):
+        (WebCore::RenderScrollbarTheme::backButtonRect):
+        (WebCore::RenderScrollbarTheme::forwardButtonRect):
+        (WebCore::RenderScrollbarTheme::trackRect):
+        (WebCore::RenderScrollbarTheme::constrainTrackRectToTrackPieces):
+        (WebCore::RenderScrollbarTheme::paintScrollbarBackground):
+        (WebCore::RenderScrollbarTheme::paintTrackBackground):
+        (WebCore::RenderScrollbarTheme::paintTrackPiece):
+        (WebCore::RenderScrollbarTheme::paintButton):
+        (WebCore::RenderScrollbarTheme::paintThumb):
+        * rendering/RenderScrollbarTheme.h:
+        (WebCore::RenderScrollbarTheme::shouldCenterOnThumb):
+        (WebCore::RenderScrollbarTheme::registerScrollbar):
+        (WebCore::RenderScrollbarTheme::unregisterScrollbar):
+        (RenderScrollbarTheme):
+
 2012-03-01  Luke Macpherson   <macpherson@chromium.org>
 
         Implement CSSPropertyImageRendering in CSSStyleApplyProperty.
index 2e62f14..61ce102 100644 (file)
@@ -3330,6 +3330,7 @@ webcore_sources += \
        Source/WebCore/platform/ScrollableArea.h \
        Source/WebCore/platform/Scrollbar.cpp \
        Source/WebCore/platform/Scrollbar.h \
+       Source/WebCore/platform/ScrollbarThemeClient.h \
        Source/WebCore/platform/ScrollbarThemeComposite.cpp \
        Source/WebCore/platform/ScrollbarThemeComposite.h \
        Source/WebCore/platform/ScrollbarTheme.cpp \
index ae2907c..13e104b 100644 (file)
@@ -2279,6 +2279,7 @@ HEADERS += \
     platform/ScrollableArea.h \
     platform/ScrollAnimator.h \
     platform/Scrollbar.h \
+    platform/ScrollbarThemeClient.h \
     platform/ScrollbarThemeComposite.h \
     platform/ScrollView.h \
     platform/SearchPopupMenu.h \
index 55fc6f2..4615578 100644 (file)
             'platform/ScrollableArea.h',
             'platform/Scrollbar.h',
             'platform/ScrollbarTheme.h',
+            'platform/ScrollbarThemeClient.h',
             'platform/SearchPopupMenu.h',
             'platform/SharedBuffer.h',
             'platform/SharedBufferChunkReader.h',
index 0b09472..6d9ceea 100755 (executable)
                                >
                        </File>
                        <File
+                               RelativePath="..\platform\ScrollbarThemeClient.h"
+                               >
+                       </File>
+                       <File
                                RelativePath="..\platform\ScrollbarThemeComposite.cpp"
                                >
                        </File>
index 7f91dc2..b80797b 100644 (file)
                C5D4AA7A116BAFB60069CA93 /* GlyphMetricsMap.h in Headers */ = {isa = PBXBuildFile; fileRef = C5D4AA78116BAFB60069CA93 /* GlyphMetricsMap.h */; settings = {ATTRIBUTES = (Private, ); }; };
                C5E9B67710697E1300C7BB1A /* StorageEventDispatcher.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C5E9B67610697E1300C7BB1A /* StorageEventDispatcher.cpp */; };
                C5EBDD84105EDDEC0056816F /* StorageEventDispatcher.h in Headers */ = {isa = PBXBuildFile; fileRef = C5EBDD81105EDDEC0056816F /* StorageEventDispatcher.h */; };
+               C6B31B2E14F841FB0089F23F /* ScrollbarThemeClient.h in Headers */ = {isa = PBXBuildFile; fileRef = C691614714F6EBA70046375C /* ScrollbarThemeClient.h */; settings = {ATTRIBUTES = (Private, ); }; };
                C6D74AD509AA282E000B0A52 /* ModifySelectionListLevel.h in Headers */ = {isa = PBXBuildFile; fileRef = C6D74AD309AA282E000B0A52 /* ModifySelectionListLevel.h */; };
                C6D74AE409AA290A000B0A52 /* ModifySelectionListLevel.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C6D74AE309AA290A000B0A52 /* ModifySelectionListLevel.cpp */; };
                C6F08FBC1430FE8F00685849 /* MutationRecord.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C6F08FB91430FE8F00685849 /* MutationRecord.cpp */; };
                C5EBDD81105EDDEC0056816F /* StorageEventDispatcher.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StorageEventDispatcher.h; sourceTree = "<group>"; };
                C5F765B414E1D414006C899B /* PasteboardStrategy.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PasteboardStrategy.h; sourceTree = "<group>"; };
                C5F765BA14E1ECF4006C899B /* PlatformPasteboardMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = PlatformPasteboardMac.mm; sourceTree = "<group>"; };
+               C691614714F6EBA70046375C /* ScrollbarThemeClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ScrollbarThemeClient.h; sourceTree = "<group>"; };
                C6D74AD309AA282E000B0A52 /* ModifySelectionListLevel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ModifySelectionListLevel.h; sourceTree = "<group>"; };
                C6D74AE309AA290A000B0A52 /* ModifySelectionListLevel.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ModifySelectionListLevel.cpp; sourceTree = "<group>"; };
                C6F08FB91430FE8F00685849 /* MutationRecord.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MutationRecord.cpp; sourceTree = "<group>"; };
                                BCAA90C20A7EBA60008B1229 /* Scrollbar.cpp */,
                                BC7B2AF80450824100A8000F /* Scrollbar.h */,
                                0FE71415142189FC00DB33BA /* ScrollbarTheme.cpp */,
+                               C691614714F6EBA70046375C /* ScrollbarThemeClient.h */,
                                BC8B854A0E7C7F5600AB6984 /* ScrollbarTheme.h */,
                                BC1402880E83680800319717 /* ScrollbarThemeComposite.cpp */,
                                BC1402890E83680800319717 /* ScrollbarThemeComposite.h */,
                                CA3BF67E10D99BAE00E6CE53 /* ScrollAnimator.h in Headers */,
                                BCAE1FA712939DB7004CB026 /* ScrollAnimatorMac.h in Headers */,
                                93F199B808245E59001E9ABC /* Scrollbar.h in Headers */,
+                               C6B31B2E14F841FB0089F23F /* ScrollbarThemeClient.h in Headers */,
                                BC8B854B0E7C7F5600AB6984 /* ScrollbarTheme.h in Headers */,
                                BC14028B0E83680800319717 /* ScrollbarThemeComposite.h in Headers */,
                                BC8B853E0E7C7F1100AB6984 /* ScrollbarThemeMac.h in Headers */,
index 3b9c195..dfd4649 100644 (file)
@@ -112,6 +112,27 @@ Scrollbar::~Scrollbar()
     m_theme->unregisterScrollbar(this);
 }
 
+ScrollbarOverlayStyle Scrollbar::scrollbarOverlayStyle() const
+{
+    return m_scrollableArea ? ScrollbarOverlayStyleDefault : m_scrollableArea->scrollbarOverlayStyle();
+}
+
+void Scrollbar::getTickmarks(Vector<IntRect>& tickmarks) const
+{
+    if (m_scrollableArea)
+        m_scrollableArea->getTickmarks(tickmarks);
+}
+
+bool Scrollbar::isScrollableAreaActive() const
+{
+    return m_scrollableArea && m_scrollableArea->isActive();
+}
+
+bool Scrollbar::isScrollViewScrollbar() const
+{
+    return parent() && parent()->isFrameView() && static_cast<FrameView*>(parent())->isScrollViewScrollbar(this);
+}
+
 void Scrollbar::offsetDidChange()
 {
     ASSERT(m_scrollableArea);
@@ -434,7 +455,7 @@ bool Scrollbar::mouseDown(const PlatformMouseEvent& evt)
 
 void Scrollbar::setFrameRect(const IntRect& rect)
 {
-    // Get our window resizer rect and see if we overlap.  Adjust to avoid the overlap
+    // Get our window resizer rect and see if we overlap. Adjust to avoid the overlap
     // if necessary.
     IntRect adjustedRect(rect);
     bool overlapsResizer = false;
index 39ac254..171413a 100644 (file)
@@ -26,6 +26,7 @@
 #ifndef Scrollbar_h
 #define Scrollbar_h
 
+#include "ScrollbarThemeClient.h"
 #include "ScrollTypes.h"
 #include "Timer.h"
 #include "Widget.h"
@@ -40,13 +41,60 @@ class PlatformMouseEvent;
 class ScrollableArea;
 class ScrollbarTheme;
 
-class Scrollbar : public Widget {
+class Scrollbar : public Widget,
+                  public ScrollbarThemeClient {
+
 public:
     // Must be implemented by platforms that can't simply use the Scrollbar base class.  Right now the only platform that is not using the base class is GTK.
     static PassRefPtr<Scrollbar> createNativeScrollbar(ScrollableArea*, ScrollbarOrientation orientation, ScrollbarControlSize size);
 
     virtual ~Scrollbar();
 
+    // ScrollbarThemeClient implementation.
+    virtual int x() const { return Widget::x(); }
+    virtual int y() const { return Widget::y(); }
+    virtual int width() const { return Widget::width(); }
+    virtual int height() const { return Widget::height(); }
+    virtual IntSize size() const { return Widget::size(); }
+    virtual IntPoint location() const { return Widget::location(); }
+
+    virtual ScrollView* parent() const { return Widget::parent(); }
+    virtual ScrollView* root() const { return Widget::root(); }
+
+    virtual void setFrameRect(const IntRect&);
+    virtual IntRect frameRect() const { return Widget::frameRect(); }
+
+    virtual void invalidate() { Widget::invalidate(); }
+    virtual void invalidateRect(const IntRect&);
+
+    virtual ScrollbarOverlayStyle scrollbarOverlayStyle() const;
+    virtual void getTickmarks(Vector<IntRect>&) const;
+    virtual bool isScrollableAreaActive() const;
+    virtual bool isScrollViewScrollbar() const;
+
+    virtual IntPoint convertFromContainingWindow(const IntPoint& windowPoint) { return Widget::convertFromContainingWindow(windowPoint); }
+
+    virtual bool isCustomScrollbar() const { return false; }
+    virtual ScrollbarOrientation orientation() const { return m_orientation; }
+
+    virtual int value() const { return lroundf(m_currentPos); }
+    virtual float currentPos() const { return m_currentPos; }
+    virtual int visibleSize() const { return m_visibleSize; }
+    virtual int totalSize() const { return m_totalSize; }
+    virtual int maximum() const { return m_totalSize - m_visibleSize; }
+    virtual ScrollbarControlSize controlSize() const { return m_controlSize; }
+
+    virtual int lineStep() const { return m_lineStep; }
+    virtual int pageStep() const { return m_pageStep; }
+
+    virtual ScrollbarPart pressedPart() const { return m_pressedPart; }
+    virtual ScrollbarPart hoveredPart() const { return m_hoveredPart; }
+
+    virtual void styleChanged() { }
+
+    virtual bool enabled() const { return m_enabled; }
+    virtual void setEnabled(bool);
+
     // Called by the ScrollableArea when the scroll offset changes.
     void offsetDidChange();
 
@@ -57,34 +105,18 @@ public:
     void disconnectFromScrollableArea() { m_scrollableArea = 0; }
     ScrollableArea* scrollableArea() const { return m_scrollableArea; }
 
-    virtual bool isCustomScrollbar() const { return false; }
-    ScrollbarOrientation orientation() const { return m_orientation; }
-
-    int value() const { return lroundf(m_currentPos); }
-    float currentPos() const { return m_currentPos; }
     int pressedPos() const { return m_pressedPos; }
-    int visibleSize() const { return m_visibleSize; }
-    int totalSize() const { return m_totalSize; }
-    int maximum() const { return m_totalSize - m_visibleSize; }        
-    ScrollbarControlSize controlSize() const { return m_controlSize; }
 
-    int lineStep() const { return m_lineStep; }
-    int pageStep() const { return m_pageStep; }
     float pixelStep() const { return m_pixelStep; }
 
-    ScrollbarPart pressedPart() const { return m_pressedPart; }
-    ScrollbarPart hoveredPart() const { return m_hoveredPart; }
     virtual void setHoveredPart(ScrollbarPart);
     virtual void setPressedPart(ScrollbarPart);
 
     void setSteps(int lineStep, int pageStep, int pixelsPerStep = 1);
     void setProportion(int visibleSize, int totalSize);
     void setPressedPos(int p) { m_pressedPos = p; }
-    
-    virtual void paint(GraphicsContext*, const IntRect& damageRect);
 
-    bool enabled() const { return m_enabled; }
-    virtual void setEnabled(bool e);
+    virtual void paint(GraphicsContext*, const IntRect& damageRect);
 
     virtual bool isOverlayScrollbar() const;
     bool shouldParticipateInHitTesting();
@@ -97,7 +129,7 @@ public:
     bool mouseMoved(const PlatformMouseEvent&);
     void mouseEntered();
     bool mouseExited();
-    
+
     // Used by some platform scrollbars to know when they've been released from capture.
     bool mouseUp(const PlatformMouseEvent&);
 
@@ -106,18 +138,13 @@ public:
     ScrollbarTheme* theme() const { return m_theme; }
 
     virtual void setParent(ScrollView*);
-    virtual void setFrameRect(const IntRect&);
 
-    virtual void invalidateRect(const IntRect&);
-    
     bool suppressInvalidation() const { return m_suppressInvalidation; }
     void setSuppressInvalidation(bool s) { m_suppressInvalidation = s; }
 
-    virtual void styleChanged() { }
-
     virtual IntRect convertToContainingView(const IntRect&) const;
     virtual IntRect convertFromContainingView(const IntRect&) const;
-    
+
     virtual IntPoint convertToContainingView(const IntPoint&) const;
     virtual IntPoint convertFromContainingView(const IntPoint&) const;
 
@@ -160,7 +187,7 @@ protected:
 
     Timer<Scrollbar> m_scrollTimer;
     bool m_overlapsResizer;
-    
+
     bool m_suppressInvalidation;
 
 private:
index 2a83d53..5fe45b1 100644 (file)
@@ -33,7 +33,7 @@
 namespace WebCore {
 
 class PlatformMouseEvent;
-class Scrollbar;
+class ScrollbarThemeClient;
 class ScrollView;
 
 #if USE(ACCELERATED_COMPOSITING) && ENABLE(RUBBER_BANDING)
@@ -46,10 +46,10 @@ public:
     ScrollbarTheme() { }
     virtual ~ScrollbarTheme() {};
 
-    virtual void updateEnabledState(Scrollbar*) { };
+    virtual void updateEnabledState(ScrollbarThemeClient*) { };
 
-    virtual bool paint(Scrollbar*, GraphicsContext*, const IntRect& /*damageRect*/) { return false; }
-    virtual ScrollbarPart hitTest(Scrollbar*, const PlatformMouseEvent&) { return NoPart; }
+    virtual bool paint(ScrollbarThemeClient*, GraphicsContext*, const IntRect& /*damageRect*/) { return false; }
+    virtual ScrollbarPart hitTest(ScrollbarThemeClient*, const PlatformMouseEvent&) { return NoPart; }
     
     virtual int scrollbarThickness(ScrollbarControlSize = RegularScrollbar) { return 0; }
 
@@ -57,13 +57,13 @@ public:
 
     virtual bool supportsControlTints() const { return false; }
     virtual bool usesOverlayScrollbars() const { return false; }
-    virtual void updateScrollbarOverlayStyle(Scrollbar*) { }
+    virtual void updateScrollbarOverlayStyle(ScrollbarThemeClient*) { }
 
     virtual void themeChanged() {}
     
     virtual bool invalidateOnMouseEnterExit() { return false; }
 
-    void invalidateParts(Scrollbar* scrollbar, ScrollbarControlPartMask mask)
+    void invalidateParts(ScrollbarThemeClient* scrollbar, ScrollbarControlPartMask mask)
     {
         if (mask & BackButtonStartPart)
             invalidatePart(scrollbar, BackButtonStartPart);
@@ -81,7 +81,7 @@ public:
             invalidatePart(scrollbar, ForwardButtonEndPart);
     }
 
-    virtual void invalidatePart(Scrollbar*, ScrollbarPart) {}
+    virtual void invalidatePart(ScrollbarThemeClient*, ScrollbarPart) { }
 
     virtual void paintScrollCorner(ScrollView*, GraphicsContext* context, const IntRect& cornerRect) { defaultPaintScrollCorner(context, cornerRect); }
     static void defaultPaintScrollCorner(GraphicsContext* context, const IntRect& cornerRect) { context->fillRect(cornerRect, Color::white, ColorSpaceDeviceRGB); }
@@ -93,21 +93,21 @@ public:
     virtual void setUpContentShadowLayer(GraphicsLayer*) { }
 #endif
 
-    virtual bool shouldCenterOnThumb(Scrollbar*, const PlatformMouseEvent&) { return false; }
-    virtual bool shouldSnapBackToDragOrigin(Scrollbar*, const PlatformMouseEvent&) { return false; }
-    virtual bool shouldDragDocumentInsteadOfThumb(Scrollbar*, const PlatformMouseEvent&) { return false; }
-    virtual int thumbPosition(Scrollbar*) { return 0; } // The position of the thumb relative to the track.
-    virtual int thumbLength(Scrollbar*) { return 0; } // The length of the thumb along the axis of the scrollbar.
-    virtual int trackPosition(Scrollbar*) { return 0; } // The position of the track relative to the scrollbar.
-    virtual int trackLength(Scrollbar*) { return 0; } // The length of the track along the axis of the scrollbar.
+    virtual bool shouldCenterOnThumb(ScrollbarThemeClient*, const PlatformMouseEvent&) { return false; }
+    virtual bool shouldSnapBackToDragOrigin(ScrollbarThemeClient*, const PlatformMouseEvent&) { return false; }
+    virtual bool shouldDragDocumentInsteadOfThumb(ScrollbarThemeClient*, const PlatformMouseEvent&) { return false; }
+    virtual int thumbPosition(ScrollbarThemeClient*) { return 0; } // The position of the thumb relative to the track.
+    virtual int thumbLength(ScrollbarThemeClient*) { return 0; } // The length of the thumb along the axis of the scrollbar.
+    virtual int trackPosition(ScrollbarThemeClient*) { return 0; } // The position of the track relative to the scrollbar.
+    virtual int trackLength(ScrollbarThemeClient*) { return 0; } // The length of the track along the axis of the scrollbar.
 
     virtual int maxOverlapBetweenPages() { return std::numeric_limits<int>::max(); }
 
     virtual double initialAutoscrollTimerDelay() { return 0.25; }
     virtual double autoscrollTimerDelay() { return 0.05; }
 
-    virtual void registerScrollbar(Scrollbar*) {}
-    virtual void unregisterScrollbar(Scrollbar*) {}
+    virtual void registerScrollbar(ScrollbarThemeClient*) { }
+    virtual void unregisterScrollbar(ScrollbarThemeClient*) { }
 
     virtual bool isMockTheme() const { return false; }
 
diff --git a/Source/WebCore/platform/ScrollbarThemeClient.h b/Source/WebCore/platform/ScrollbarThemeClient.h
new file mode 100644 (file)
index 0000000..871c52e
--- /dev/null
@@ -0,0 +1,92 @@
+/*
+ * Copyright (C) 2012 Google 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 AND ITS CONTRIBUTORS "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 OR ITS 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 ScrollbarThemeClient_h
+#define ScrollbarThemeClient_h
+
+#include "IntPoint.h"
+#include "IntRect.h"
+#include "IntSize.h"
+#include "ScrollTypes.h"
+#include <wtf/PassOwnPtr.h>
+#include <wtf/Vector.h>
+
+namespace WebCore {
+
+class ScrollView;
+
+class ScrollbarThemeClient {
+public:
+    virtual int x() const = 0;
+    virtual int y() const = 0;
+    virtual int width() const = 0;
+    virtual int height() const = 0;
+    virtual IntSize size() const = 0;
+    virtual IntPoint location() const = 0;
+
+    virtual ScrollView* parent() const = 0;
+    virtual ScrollView* root() const = 0;
+
+    virtual void setFrameRect(const IntRect&) = 0;
+    virtual IntRect frameRect() const = 0;
+
+    virtual void invalidate() = 0;
+    virtual void invalidateRect(const IntRect&) = 0;
+
+    virtual ScrollbarOverlayStyle scrollbarOverlayStyle() const = 0;
+    virtual void getTickmarks(Vector<IntRect>&) const = 0;
+    virtual bool isScrollableAreaActive() const = 0;
+    virtual bool isScrollViewScrollbar() const = 0;
+
+    virtual IntPoint convertFromContainingWindow(const IntPoint& windowPoint) = 0;
+
+    virtual bool isCustomScrollbar() const = 0;
+    virtual ScrollbarOrientation orientation() const = 0;
+
+    virtual int value() const = 0;
+    virtual float currentPos() const = 0;
+    virtual int visibleSize() const = 0;
+    virtual int totalSize() const = 0;
+    virtual int maximum() const = 0;
+    virtual ScrollbarControlSize controlSize() const = 0;
+
+    virtual int lineStep() const = 0;
+    virtual int pageStep() const = 0;
+
+    virtual ScrollbarPart pressedPart() const = 0;
+    virtual ScrollbarPart hoveredPart() const = 0;
+
+    virtual void styleChanged() = 0;
+
+    virtual bool enabled() const = 0;
+    virtual void setEnabled(bool) = 0;
+
+protected:
+    virtual ~ScrollbarThemeClient() { }
+};
+
+} // namespace WebCore
+
+#endif // ScollbarThemeClient_h
index 62fd5e5..9d83374 100644 (file)
 #include "GraphicsContext.h"
 #include "Page.h"
 #include "PlatformMouseEvent.h"
-#include "Scrollbar.h"
-#include "ScrollableArea.h"
+#include "ScrollbarThemeClient.h"
 #include "Settings.h"
 
 using namespace std;
 
 namespace WebCore {
 
-bool ScrollbarThemeComposite::paint(Scrollbar* scrollbar, GraphicsContext* graphicsContext, const IntRect& damageRect)
+bool ScrollbarThemeComposite::paint(ScrollbarThemeClient* scrollbar, GraphicsContext* graphicsContext, const IntRect& damageRect)
 {
     // Create the ScrollbarControlPartMask based on the damageRect
     ScrollbarControlPartMask scrollMask = NoPart;
@@ -116,7 +115,7 @@ bool ScrollbarThemeComposite::paint(Scrollbar* scrollbar, GraphicsContext* graph
     return true;
 }
 
-ScrollbarPart ScrollbarThemeComposite::hitTest(Scrollbar* scrollbar, const PlatformMouseEvent& evt)
+ScrollbarPart ScrollbarThemeComposite::hitTest(ScrollbarThemeClient* scrollbar, const PlatformMouseEvent& evt)
 {
     ScrollbarPart result = NoPart;
     if (!scrollbar->enabled())
@@ -155,7 +154,7 @@ ScrollbarPart ScrollbarThemeComposite::hitTest(Scrollbar* scrollbar, const Platf
     return result;
 }
 
-void ScrollbarThemeComposite::invalidatePart(Scrollbar* scrollbar, ScrollbarPart part)
+void ScrollbarThemeComposite::invalidatePart(ScrollbarThemeClient* scrollbar, ScrollbarPart part)
 {
     if (part == NoPart)
         return;
@@ -195,7 +194,7 @@ void ScrollbarThemeComposite::invalidatePart(Scrollbar* scrollbar, ScrollbarPart
     scrollbar->invalidateRect(result);
 }
 
-void ScrollbarThemeComposite::splitTrack(Scrollbar* scrollbar, const IntRect& unconstrainedTrackRect, IntRect& beforeThumbRect, IntRect& thumbRect, IntRect& afterThumbRect)
+void ScrollbarThemeComposite::splitTrack(ScrollbarThemeClient* scrollbar, const IntRect& unconstrainedTrackRect, IntRect& beforeThumbRect, IntRect& thumbRect, IntRect& afterThumbRect)
 {
     // This function won't even get called unless we're big enough to have some combination of these three rects where at least
     // one of them is non-empty.
@@ -215,7 +214,7 @@ void ScrollbarThemeComposite::splitTrack(Scrollbar* scrollbar, const IntRect& un
 
 // Returns the size represented by track taking into account scrolling past
 // the end of the document.
-static float usedTotalSize(Scrollbar* scrollbar)
+static float usedTotalSize(ScrollbarThemeClient* scrollbar)
 {
     float overhangAtStart = -scrollbar->currentPos();
     float overhangAtEnd = scrollbar->currentPos() + scrollbar->visibleSize() - scrollbar->totalSize();
@@ -223,7 +222,7 @@ static float usedTotalSize(Scrollbar* scrollbar)
     return scrollbar->totalSize() + overhang;
 }
 
-int ScrollbarThemeComposite::thumbPosition(Scrollbar* scrollbar)
+int ScrollbarThemeComposite::thumbPosition(ScrollbarThemeClient* scrollbar)
 {
     if (scrollbar->enabled()) {
         float size = usedTotalSize(scrollbar) - scrollbar->visibleSize();
@@ -236,7 +235,7 @@ int ScrollbarThemeComposite::thumbPosition(Scrollbar* scrollbar)
     return 0;
 }
 
-int ScrollbarThemeComposite::thumbLength(Scrollbar* scrollbar)
+int ScrollbarThemeComposite::thumbLength(ScrollbarThemeClient* scrollbar)
 {
     if (!scrollbar->enabled())
         return 0;
@@ -250,18 +249,18 @@ int ScrollbarThemeComposite::thumbLength(Scrollbar* scrollbar)
     return length;
 }
 
-int ScrollbarThemeComposite::minimumThumbLength(Scrollbar* scrollbar)
+int ScrollbarThemeComposite::minimumThumbLength(ScrollbarThemeClient* scrollbar)
 {
     return scrollbarThickness(scrollbar->controlSize());
 }
 
-int ScrollbarThemeComposite::trackPosition(Scrollbar* scrollbar)
+int ScrollbarThemeComposite::trackPosition(ScrollbarThemeClient* scrollbar)
 {
     IntRect constrainedTrackRect = constrainTrackRectToTrackPieces(scrollbar, trackRect(scrollbar));
     return (scrollbar->orientation() == HorizontalScrollbar) ? constrainedTrackRect.x() - scrollbar->x() : constrainedTrackRect.y() - scrollbar->y();
 }
 
-int ScrollbarThemeComposite::trackLength(Scrollbar* scrollbar)
+int ScrollbarThemeComposite::trackLength(ScrollbarThemeClient* scrollbar)
 {
     IntRect constrainedTrackRect = constrainTrackRectToTrackPieces(scrollbar, trackRect(scrollbar));
     return (scrollbar->orientation() == HorizontalScrollbar) ? constrainedTrackRect.width() : constrainedTrackRect.height();
index 11b3bd4..8f62913 100644 (file)
@@ -32,40 +32,40 @@ namespace WebCore {
 
 class ScrollbarThemeComposite : public ScrollbarTheme {
 public:
-    virtual bool paint(Scrollbar*, GraphicsContext* context, const IntRect& damageRect);
+    virtual bool paint(ScrollbarThemeClient*, GraphicsContext*, const IntRect& damageRect);
 
-    virtual ScrollbarPart hitTest(Scrollbar*, const PlatformMouseEvent&);
+    virtual ScrollbarPart hitTest(ScrollbarThemeClient*, const PlatformMouseEvent&);
 
-    virtual void invalidatePart(Scrollbar*, ScrollbarPart);
+    virtual void invalidatePart(ScrollbarThemeClient*, ScrollbarPart);
 
-    virtual int thumbPosition(Scrollbar*);
-    virtual int thumbLength(Scrollbar*);
-    virtual int trackPosition(Scrollbar*);
-    virtual int trackLength(Scrollbar*);
+    virtual int thumbPosition(ScrollbarThemeClient*);
+    virtual int thumbLength(ScrollbarThemeClient*);
+    virtual int trackPosition(ScrollbarThemeClient*);
+    virtual int trackLength(ScrollbarThemeClient*);
 
     virtual void paintScrollCorner(ScrollView*, GraphicsContext*, const IntRect& cornerRect);
     virtual void paintOverhangAreas(ScrollView*, GraphicsContext*, const IntRect& horizontalOverhangArea, const IntRect& verticalOverhangArea, const IntRect& dirtyRect);
 
 protected:
-    virtual bool hasButtons(Scrollbar*) = 0;
-    virtual bool hasThumb(Scrollbar*) = 0;
+    virtual bool hasButtons(ScrollbarThemeClient*) = 0;
+    virtual bool hasThumb(ScrollbarThemeClient*) = 0;
 
-    virtual IntRect backButtonRect(Scrollbar*, ScrollbarPart, bool painting = false) = 0;
-    virtual IntRect forwardButtonRect(Scrollbar*, ScrollbarPart, bool painting = false) = 0;
-    virtual IntRect trackRect(Scrollbar*, bool painting = false) = 0;
+    virtual IntRect backButtonRect(ScrollbarThemeClient*, ScrollbarPart, bool painting = false) = 0;
+    virtual IntRect forwardButtonRect(ScrollbarThemeClient*, ScrollbarPart, bool painting = false) = 0;
+    virtual IntRect trackRect(ScrollbarThemeClient*, bool painting = false) = 0;
 
-    virtual void splitTrack(Scrollbar*, const IntRect& track, IntRect& startTrack, IntRect& thumb, IntRect& endTrack);
+    virtual void splitTrack(ScrollbarThemeClient*, const IntRect& track, IntRect& startTrack, IntRect& thumb, IntRect& endTrack);
     
-    virtual int minimumThumbLength(Scrollbar*);
+    virtual int minimumThumbLength(ScrollbarThemeClient*);
 
-    virtual void paintScrollbarBackground(GraphicsContext*, Scrollbar*) {}
-    virtual void paintTrackBackground(GraphicsContext*, Scrollbar*, const IntRect&) {}
-    virtual void paintTrackPiece(GraphicsContext*, Scrollbar*, const IntRect&, ScrollbarPart) {}
-    virtual void paintButton(GraphicsContext*, Scrollbar*, const IntRect&, ScrollbarPart) {}
-    virtual void paintThumb(GraphicsContext*, Scrollbar*, const IntRect&) {}
-    virtual void paintTickmarks(GraphicsContext*, Scrollbar*, const IntRect&) {}
+    virtual void paintScrollbarBackground(GraphicsContext*, ScrollbarThemeClient*) { }
+    virtual void paintTrackBackground(GraphicsContext*, ScrollbarThemeClient*, const IntRect&) { }
+    virtual void paintTrackPiece(GraphicsContext*, ScrollbarThemeClient*, const IntRect&, ScrollbarPart) { }
+    virtual void paintButton(GraphicsContext*, ScrollbarThemeClient*, const IntRect&, ScrollbarPart) { }
+    virtual void paintThumb(GraphicsContext*, ScrollbarThemeClient*, const IntRect&) { }
+    virtual void paintTickmarks(GraphicsContext*, ScrollbarThemeClient*, const IntRect&) { }
 
-    virtual IntRect constrainTrackRectToTrackPieces(Scrollbar*, const IntRect& rect) { return rect; }
+    virtual IntRect constrainTrackRectToTrackPieces(ScrollbarThemeClient*, const IntRect& rect) { return rect; }
 };
 
 }
index f8cb281..682d82d 100644 (file)
 
 namespace WebCore {
 
-bool ScrollbarThemeChromium::hasThumb(Scrollbar* scrollbar)
+bool ScrollbarThemeChromium::hasThumb(ScrollbarThemeClient* scrollbar)
 {
     // This method is just called as a paint-time optimization to see if
     // painting the thumb can be skipped.  We don't have to be exact here.
     return thumbLength(scrollbar) > 0;
 }
 
-IntRect ScrollbarThemeChromium::backButtonRect(Scrollbar* scrollbar, ScrollbarPart part, bool)
+IntRect ScrollbarThemeChromium::backButtonRect(ScrollbarThemeClient* scrollbar, ScrollbarPart part, bool)
 {
     // Windows and Linux just have single arrows.
     if (part == BackButtonEndPart)
@@ -56,7 +56,7 @@ IntRect ScrollbarThemeChromium::backButtonRect(Scrollbar* scrollbar, ScrollbarPa
     return IntRect(scrollbar->x(), scrollbar->y(), size.width(), size.height());
 }
 
-IntRect ScrollbarThemeChromium::forwardButtonRect(Scrollbar* scrollbar, ScrollbarPart part, bool)
+IntRect ScrollbarThemeChromium::forwardButtonRect(ScrollbarThemeClient* scrollbar, ScrollbarPart part, bool)
 {
     // Windows and Linux just have single arrows.
     if (part == ForwardButtonStartPart)
@@ -74,7 +74,7 @@ IntRect ScrollbarThemeChromium::forwardButtonRect(Scrollbar* scrollbar, Scrollba
     return IntRect(x, y, size.width(), size.height());
 }
 
-IntRect ScrollbarThemeChromium::trackRect(Scrollbar* scrollbar, bool)
+IntRect ScrollbarThemeChromium::trackRect(ScrollbarThemeClient* scrollbar, bool)
 {
     IntSize bs = buttonSize(scrollbar);
     // The buttons at the top and bottom of the scrollbar are square, so the
@@ -92,14 +92,14 @@ IntRect ScrollbarThemeChromium::trackRect(Scrollbar* scrollbar, bool)
     return IntRect(scrollbar->x(), scrollbar->y() + bs.height(), thickness, scrollbar->height() - 2 * bs.height());
 }
 
-void ScrollbarThemeChromium::paintTrackBackground(GraphicsContext* context, Scrollbar* scrollbar, const IntRect& rect)
+void ScrollbarThemeChromium::paintTrackBackground(GraphicsContext* context, ScrollbarThemeClient* scrollbar, const IntRect& rect)
 {
     // Just assume a forward track part.  We only paint the track as a single piece when there is no thumb.
     if (!hasThumb(scrollbar))
         paintTrackPiece(context, scrollbar, rect, ForwardTrackPart);
 }
 
-void ScrollbarThemeChromium::paintTickmarks(GraphicsContext* context, Scrollbar* scrollbar, const IntRect& rect)
+void ScrollbarThemeChromium::paintTickmarks(GraphicsContext* context, ScrollbarThemeClient* scrollbar, const IntRect& rect)
 {
     if (scrollbar->orientation() != VerticalScrollbar)
         return;
@@ -109,7 +109,7 @@ void ScrollbarThemeChromium::paintTickmarks(GraphicsContext* context, Scrollbar*
 
     // Get the tickmarks for the frameview.
     Vector<IntRect> tickmarks;
-    scrollbar->scrollableArea()->getTickmarks(tickmarks);
+    scrollbar->getTickmarks(tickmarks);
     if (!tickmarks.size())
         return;
 
index 1178125..cf671dd 100644 (file)
@@ -41,17 +41,17 @@ namespace WebCore {
     // Windows and Linux.
     class ScrollbarThemeChromium : public ScrollbarThemeComposite {
     protected:
-        virtual bool hasButtons(Scrollbar*) { return true; }
-        virtual bool hasThumb(Scrollbar*);
+        virtual bool hasButtons(ScrollbarThemeClient*) { return true; }
+        virtual bool hasThumb(ScrollbarThemeClient*);
 
-        virtual IntRect backButtonRect(Scrollbar*, ScrollbarPart, bool painting = false);
-        virtual IntRect forwardButtonRect(Scrollbar*, ScrollbarPart, bool painting = false);
-        virtual IntRect trackRect(Scrollbar*, bool painting = false);
+        virtual IntRect backButtonRect(ScrollbarThemeClient*, ScrollbarPart, bool painting = false);
+        virtual IntRect forwardButtonRect(ScrollbarThemeClient*, ScrollbarPart, bool painting = false);
+        virtual IntRect trackRect(ScrollbarThemeClient*, bool painting = false);
 
-        virtual void paintTrackBackground(GraphicsContext*, Scrollbar*, const IntRect&);
-        virtual void paintTickmarks(GraphicsContext*, Scrollbar*, const IntRect&);
+        virtual void paintTrackBackground(GraphicsContext*, ScrollbarThemeClient*, const IntRect&);
+        virtual void paintTickmarks(GraphicsContext*, ScrollbarThemeClient*, const IntRect&);
 
-        virtual IntSize buttonSize(Scrollbar*) = 0;
+        virtual IntSize buttonSize(ScrollbarThemeClient*) = 0;
     };
 } // namespace WebCore
 
index 1dbefa6..e1e55a1 100644 (file)
@@ -57,7 +57,7 @@ int ScrollbarThemeChromiumAndroid::scrollbarThickness(ScrollbarControlSize contr
     return scrollbarThicknessValue;
 }
 
-void ScrollbarThemeChromiumAndroid::paintScrollbarBackground(GraphicsContext* context, Scrollbar* scrollbar)
+void ScrollbarThemeChromiumAndroid::paintScrollbarBackground(GraphicsContext* context, ScrollbarThemeClient* scrollbar)
 {
     // Paint black background in DumpRenderTree, otherwise the pixels in the scrollbar area depend
     // on their previous state, which makes the dumped result undetermined.
@@ -65,12 +65,12 @@ void ScrollbarThemeChromiumAndroid::paintScrollbarBackground(GraphicsContext* co
         context->fillRect(scrollbar->frameRect(), Color::black, ColorSpaceDeviceRGB);
 }
 
-bool ScrollbarThemeChromiumAndroid::shouldCenterOnThumb(Scrollbar*, const PlatformMouseEvent& evt)
+bool ScrollbarThemeChromiumAndroid::shouldCenterOnThumb(ScrollbarThemeClient*, const PlatformMouseEvent& evt)
 {
     return true;
 }
 
-IntSize ScrollbarThemeChromiumAndroid::buttonSize(Scrollbar* scrollbar)
+IntSize ScrollbarThemeChromiumAndroid::buttonSize(ScrollbarThemeClient* scrollbar)
 {
     if (scrollbar->orientation() == VerticalScrollbar)
         return IntSize(scrollbarThicknessValue, buttonLength);
@@ -78,7 +78,7 @@ IntSize ScrollbarThemeChromiumAndroid::buttonSize(Scrollbar* scrollbar)
     return IntSize(buttonLength, scrollbarThicknessValue);
 }
 
-int ScrollbarThemeChromiumAndroid::minimumThumbLength(Scrollbar* scrollbar)
+int ScrollbarThemeChromiumAndroid::minimumThumbLength(ScrollbarThemeClient* scrollbar)
 {
     return 2 * scrollbarThickness(scrollbar->controlSize());
 }
index f07c901..f3db80e 100644 (file)
@@ -35,10 +35,10 @@ public:
     virtual int scrollbarThickness(ScrollbarControlSize);
 
 protected:
-    virtual void paintScrollbarBackground(GraphicsContext*, Scrollbar*);
-    virtual bool shouldCenterOnThumb(Scrollbar*, const PlatformMouseEvent&);
-    virtual IntSize buttonSize(Scrollbar*);
-    virtual int minimumThumbLength(Scrollbar*);
+    virtual void paintScrollbarBackground(GraphicsContext*, ScrollbarThemeClient*);
+    virtual bool shouldCenterOnThumb(ScrollbarThemeClient*, const PlatformMouseEvent&);
+    virtual IntSize buttonSize(ScrollbarThemeClient*);
+    virtual int minimumThumbLength(ScrollbarThemeClient*);
 };
 
 } // namespace WebCore
index ec68407..6b4dafc 100644 (file)
@@ -50,7 +50,7 @@ int ScrollbarThemeChromiumLinux::scrollbarThickness(ScrollbarControlSize control
     return scrollbarSize.width();
 }
 
-void ScrollbarThemeChromiumLinux::paintTrackPiece(GraphicsContext* gc, Scrollbar* scrollbar, const IntRect& rect, ScrollbarPart partType)
+void ScrollbarThemeChromiumLinux::paintTrackPiece(GraphicsContext* gc, ScrollbarThemeClient* scrollbar, const IntRect& rect, ScrollbarPart partType)
 {
     PlatformSupport::ThemePaintState state = scrollbar->hoveredPart() == partType ? PlatformSupport::StateHover : PlatformSupport::StateNormal;
     IntRect alignRect = trackRect(scrollbar, false);
@@ -67,7 +67,7 @@ void ScrollbarThemeChromiumLinux::paintTrackPiece(GraphicsContext* gc, Scrollbar
         &extraParams);
 }
 
-void ScrollbarThemeChromiumLinux::paintButton(GraphicsContext* gc, Scrollbar* scrollbar, const IntRect& rect, ScrollbarPart part)
+void ScrollbarThemeChromiumLinux::paintButton(GraphicsContext* gc, ScrollbarThemeClient* scrollbar, const IntRect& rect, ScrollbarPart part)
 {
     PlatformSupport::ThemePart paintPart;
     PlatformSupport::ThemePaintState state = PlatformSupport::StateNormal;
@@ -102,7 +102,7 @@ void ScrollbarThemeChromiumLinux::paintButton(GraphicsContext* gc, Scrollbar* sc
     PlatformSupport::paintThemePart(gc, paintPart, state, rect, 0);
 }
 
-void ScrollbarThemeChromiumLinux::paintThumb(GraphicsContext* gc, Scrollbar* scrollbar, const IntRect& rect)
+void ScrollbarThemeChromiumLinux::paintThumb(GraphicsContext* gc, ScrollbarThemeClient* scrollbar, const IntRect& rect)
 {
     PlatformSupport::ThemePaintState state;
 
@@ -120,12 +120,12 @@ void ScrollbarThemeChromiumLinux::paintThumb(GraphicsContext* gc, Scrollbar* scr
         0);
 }
 
-bool ScrollbarThemeChromiumLinux::shouldCenterOnThumb(Scrollbar*, const PlatformMouseEvent& evt)
+bool ScrollbarThemeChromiumLinux::shouldCenterOnThumb(ScrollbarThemeClient*, const PlatformMouseEvent& evt)
 {
     return (evt.shiftKey() && evt.button() == LeftButton) || (evt.button() == MiddleButton);
 }
 
-IntSize ScrollbarThemeChromiumLinux::buttonSize(Scrollbar* scrollbar)
+IntSize ScrollbarThemeChromiumLinux::buttonSize(ScrollbarThemeClient* scrollbar)
 {
     if (scrollbar->orientation() == VerticalScrollbar) {
         IntSize size = PlatformSupport::getThemePartSize(PlatformSupport::PartScrollbarUpArrow);
@@ -137,7 +137,7 @@ IntSize ScrollbarThemeChromiumLinux::buttonSize(Scrollbar* scrollbar)
     return IntSize(scrollbar->width() < 2 * size.width() ? scrollbar->width() / 2 : size.width(), size.height());
 }
 
-int ScrollbarThemeChromiumLinux::minimumThumbLength(Scrollbar* scrollbar)
+int ScrollbarThemeChromiumLinux::minimumThumbLength(ScrollbarThemeClient* scrollbar)
 {
     if (scrollbar->orientation() == VerticalScrollbar) {
         IntSize size = PlatformSupport::getThemePartSize(PlatformSupport::PartScrollbarVerticalThumb);
index 8e802e7..330d03f 100644 (file)
@@ -39,12 +39,12 @@ namespace WebCore {
         virtual int scrollbarThickness(ScrollbarControlSize);
 
     protected:
-        virtual void paintTrackPiece(GraphicsContext*, Scrollbar*, const IntRect&, ScrollbarPart);
-        virtual void paintButton(GraphicsContext*, Scrollbar*, const IntRect&, ScrollbarPart);
-        virtual void paintThumb(GraphicsContext*, Scrollbar*, const IntRect&);
-        virtual bool shouldCenterOnThumb(Scrollbar*, const PlatformMouseEvent&);
-        virtual IntSize buttonSize(Scrollbar*);
-        virtual int minimumThumbLength(Scrollbar*);
+        virtual void paintTrackPiece(GraphicsContext*, ScrollbarThemeClient*, const IntRect&, ScrollbarPart);
+        virtual void paintButton(GraphicsContext*, ScrollbarThemeClient*, const IntRect&, ScrollbarPart);
+        virtual void paintThumb(GraphicsContext*, ScrollbarThemeClient*, const IntRect&);
+        virtual bool shouldCenterOnThumb(ScrollbarThemeClient*, const PlatformMouseEvent&);
+        virtual IntSize buttonSize(ScrollbarThemeClient*);
+        virtual int minimumThumbLength(ScrollbarThemeClient*);
     };
 } // namespace WebCore
 
index 41a198e..19346e7 100644 (file)
@@ -36,12 +36,12 @@ public:
     ScrollbarThemeChromiumMac();
     virtual ~ScrollbarThemeChromiumMac();
 
-    virtual bool paint(Scrollbar*, GraphicsContext* context, const IntRect& damageRect);
+    virtual bool paint(ScrollbarThemeClient*, GraphicsContext*, const IntRect& damageRect);
 
     virtual void paintOverhangAreas(ScrollView*, GraphicsContext*, const IntRect& horizontalOverhangArea, const IntRect& verticalOverhangArea, const IntRect& dirtyRect);
     
 private:
-    void paintGivenTickmarks(GraphicsContext*, Scrollbar*, const IntRect&, const Vector<IntRect>&);
+    void paintGivenTickmarks(GraphicsContext*, ScrollbarThemeClient*, const IntRect&, const Vector<IntRect>&);
 
     RefPtr<Pattern> m_overhangPattern;
 };
index 459a58b..d02b421 100644 (file)
@@ -61,11 +61,11 @@ ScrollbarThemeChromiumMac::~ScrollbarThemeChromiumMac()
 {
 }
 
-static PlatformSupport::ThemePaintState scrollbarStateToThemeState(Scrollbar* scrollbar)
+static PlatformSupport::ThemePaintState scrollbarStateToThemeState(ScrollbarThemeClient* scrollbar)
 {
     if (!scrollbar->enabled())
         return PlatformSupport::StateDisabled;
-    if (!scrollbar->scrollableArea()->isActive())
+    if (!scrollbar->isScrollableAreaActive())
         return PlatformSupport::StateInactive;
     if (scrollbar->pressedPart() == ThumbPart)
         return PlatformSupport::StatePressed;
@@ -94,11 +94,11 @@ static void scrollbarPainterPaintTrack(ScrollbarPainter scrollbarPainter, bool e
 //     - drawing using PlatformSupport functions
 //     - drawing tickmarks
 //     - Skia specific changes
-bool ScrollbarThemeChromiumMac::paint(Scrollbar* scrollbar, GraphicsContext* context, const IntRect& damageRect)
+bool ScrollbarThemeChromiumMac::paint(ScrollbarThemeClient* scrollbar, GraphicsContext* context, const IntRect& damageRect)
 {
     // Get the tickmarks for the frameview.
     Vector<IntRect> tickmarks;
-    scrollbar->scrollableArea()->getTickmarks(tickmarks);
+    scrollbar->getTickmarks(tickmarks);
 
     if (isScrollbarOverlayAPIAvailable()) {
         float value = 0;
@@ -188,7 +188,7 @@ bool ScrollbarThemeChromiumMac::paint(Scrollbar* scrollbar, GraphicsContext* con
     if (!scrollbar->enabled())
         trackInfo.enableState = kThemeTrackDisabled;
     else
-        trackInfo.enableState = scrollbar->scrollableArea()->isActive() ? kThemeTrackActive : kThemeTrackInactive;
+        trackInfo.enableState = scrollbar->isScrollableAreaActive() ? kThemeTrackActive : kThemeTrackInactive;
 
     if (!hasButtons(scrollbar))
         trackInfo.enableState = kThemeTrackNothingToScroll;
@@ -243,7 +243,7 @@ bool ScrollbarThemeChromiumMac::paint(Scrollbar* scrollbar, GraphicsContext* con
     if (hasThumb(scrollbar)) {
         PlatformSupport::ThemePaintScrollbarInfo scrollbarInfo;
         scrollbarInfo.orientation = scrollbar->orientation() == HorizontalScrollbar ? PlatformSupport::ScrollbarOrientationHorizontal : PlatformSupport::ScrollbarOrientationVertical;
-        scrollbarInfo.parent = scrollbar->parent() && scrollbar->parent()->isFrameView() && static_cast<FrameView*>(scrollbar->parent())->isScrollViewScrollbar(scrollbar) ? PlatformSupport::ScrollbarParentScrollView : PlatformSupport::ScrollbarParentRenderLayer;
+        scrollbarInfo.parent = scrollbar->isScrollViewScrollbar() ? PlatformSupport::ScrollbarParentScrollView : PlatformSupport::ScrollbarParentRenderLayer;
         scrollbarInfo.maxValue = scrollbar->maximum();
         scrollbarInfo.currentValue = scrollbar->currentPos();
         scrollbarInfo.visibleSize = scrollbar->visibleSize();
@@ -263,7 +263,7 @@ bool ScrollbarThemeChromiumMac::paint(Scrollbar* scrollbar, GraphicsContext* con
     return true;
 }
 
-void ScrollbarThemeChromiumMac::paintGivenTickmarks(GraphicsContext* context, Scrollbar* scrollbar, const IntRect& rect, const Vector<IntRect>& tickmarks)
+void ScrollbarThemeChromiumMac::paintGivenTickmarks(GraphicsContext* context, ScrollbarThemeClient* scrollbar, const IntRect& rect, const Vector<IntRect>& tickmarks)
 {
     if (scrollbar->orientation() != VerticalScrollbar)
         return;
index f435839..a081983 100644 (file)
@@ -73,7 +73,7 @@ bool ScrollbarThemeChromiumWin::invalidateOnMouseEnterExit()
     return windowsVersion() >= WindowsVista;
 }
 
-bool ScrollbarThemeChromiumWin::shouldSnapBackToDragOrigin(Scrollbar* scrollbar, const PlatformMouseEvent& evt)
+bool ScrollbarThemeChromiumWin::shouldSnapBackToDragOrigin(ScrollbarThemeClient* scrollbar, const PlatformMouseEvent& evt)
 {
     // Find the rect within which we shouldn't snap, by expanding the track rect
     // in both dimensions.
@@ -91,7 +91,7 @@ bool ScrollbarThemeChromiumWin::shouldSnapBackToDragOrigin(Scrollbar* scrollbar,
     return !rect.contains(mousePosition);
 }
 
-void ScrollbarThemeChromiumWin::paintTrackPiece(GraphicsContext* gc, Scrollbar* scrollbar, const IntRect& rect, ScrollbarPart partType)
+void ScrollbarThemeChromiumWin::paintTrackPiece(GraphicsContext* gc, ScrollbarThemeClient* scrollbar, const IntRect& rect, ScrollbarPart partType)
 {
     bool horz = scrollbar->orientation() == HorizontalScrollbar;
 
@@ -113,7 +113,7 @@ void ScrollbarThemeChromiumWin::paintTrackPiece(GraphicsContext* gc, Scrollbar*
         alignRect);
 }
 
-void ScrollbarThemeChromiumWin::paintButton(GraphicsContext* gc, Scrollbar* scrollbar, const IntRect& rect, ScrollbarPart part)
+void ScrollbarThemeChromiumWin::paintButton(GraphicsContext* gc, ScrollbarThemeClient* scrollbar, const IntRect& rect, ScrollbarPart part)
 {
     bool horz = scrollbar->orientation() == HorizontalScrollbar;
 
@@ -131,7 +131,7 @@ void ScrollbarThemeChromiumWin::paintButton(GraphicsContext* gc, Scrollbar* scro
         rect);
 }
 
-void ScrollbarThemeChromiumWin::paintThumb(GraphicsContext* gc, Scrollbar* scrollbar, const IntRect& rect)
+void ScrollbarThemeChromiumWin::paintThumb(GraphicsContext* gc, ScrollbarThemeClient* scrollbar, const IntRect& rect)
 {
     bool horz = scrollbar->orientation() == HorizontalScrollbar;
 
@@ -152,7 +152,7 @@ void ScrollbarThemeChromiumWin::paintThumb(GraphicsContext* gc, Scrollbar* scrol
         rect);
 }
 
-int ScrollbarThemeChromiumWin::getThemeState(Scrollbar* scrollbar, ScrollbarPart part) const
+int ScrollbarThemeChromiumWin::getThemeState(ScrollbarThemeClient* scrollbar, ScrollbarPart part) const
 {
     // When dragging the thumb, draw thumb pressed and other segments normal
     // regardless of where the cursor actually is.  See also four places in
@@ -171,7 +171,7 @@ int ScrollbarThemeChromiumWin::getThemeState(Scrollbar* scrollbar, ScrollbarPart
     return (scrollbar->pressedPart() == part) ? SCRBS_PRESSED : SCRBS_NORMAL;
 }
 
-int ScrollbarThemeChromiumWin::getThemeArrowState(Scrollbar* scrollbar, ScrollbarPart part) const
+int ScrollbarThemeChromiumWin::getThemeArrowState(ScrollbarThemeClient* scrollbar, ScrollbarPart part) const
 {
     // We could take advantage of knowing the values in the state enum to write
     // some simpler code, but treating the state enum as a black box seems
@@ -221,7 +221,7 @@ int ScrollbarThemeChromiumWin::getThemeArrowState(Scrollbar* scrollbar, Scrollba
     return (scrollbar->pressedPart() == part) ? ABS_DOWNPRESSED : ABS_DOWNNORMAL;
 }
 
-int ScrollbarThemeChromiumWin::getClassicThemeState(Scrollbar* scrollbar, ScrollbarPart part) const
+int ScrollbarThemeChromiumWin::getClassicThemeState(ScrollbarThemeClient* scrollbar, ScrollbarPart part) const
 {
     // When dragging the thumb, draw the buttons normal even when hovered.
     if (scrollbar->pressedPart() == ThumbPart)
@@ -235,12 +235,12 @@ int ScrollbarThemeChromiumWin::getClassicThemeState(Scrollbar* scrollbar, Scroll
     return (scrollbar->pressedPart() == part) ? (DFCS_PUSHED | DFCS_FLAT) : 0;
 }
 
-bool ScrollbarThemeChromiumWin::shouldCenterOnThumb(Scrollbar*, const PlatformMouseEvent& evt)
+bool ScrollbarThemeChromiumWin::shouldCenterOnThumb(ScrollbarThemeClient*, const PlatformMouseEvent& evt)
 {
     return evt.shiftKey() && evt.button() == LeftButton;
 }
 
-IntSize ScrollbarThemeChromiumWin::buttonSize(Scrollbar* scrollbar)
+IntSize ScrollbarThemeChromiumWin::buttonSize(ScrollbarThemeClient* scrollbar)
 {
     // Our desired rect is essentially thickness by thickness.
 
index 69cfa13..ac8881f 100644 (file)
@@ -38,19 +38,19 @@ namespace WebCore {
     public:
         virtual int scrollbarThickness(ScrollbarControlSize);
         virtual bool invalidateOnMouseEnterExit();
-        virtual bool shouldSnapBackToDragOrigin(Scrollbar*, const PlatformMouseEvent&);
+        virtual bool shouldSnapBackToDragOrigin(ScrollbarThemeClient*, const PlatformMouseEvent&);
 
     protected:
-        virtual void paintTrackPiece(GraphicsContext*, Scrollbar*, const IntRect&, ScrollbarPart);
-        virtual void paintButton(GraphicsContext*, Scrollbar*, const IntRect&, ScrollbarPart);
-        virtual void paintThumb(GraphicsContext*, Scrollbar*, const IntRect&);
-        virtual bool shouldCenterOnThumb(Scrollbar*, const PlatformMouseEvent&);
-        virtual IntSize buttonSize(Scrollbar*);
+        virtual void paintTrackPiece(GraphicsContext*, ScrollbarThemeClient*, const IntRect&, ScrollbarPart);
+        virtual void paintButton(GraphicsContext*, ScrollbarThemeClient*, const IntRect&, ScrollbarPart);
+        virtual void paintThumb(GraphicsContext*, ScrollbarThemeClient*, const IntRect&);
+        virtual bool shouldCenterOnThumb(ScrollbarThemeClient*, const PlatformMouseEvent&);
+        virtual IntSize buttonSize(ScrollbarThemeClient*);
 
     private:
-        int getThemeState(Scrollbar*, ScrollbarPart) const;
-        int getThemeArrowState(Scrollbar*, ScrollbarPart) const;
-        int getClassicThemeState(Scrollbar*, ScrollbarPart) const;
+        int getThemeState(ScrollbarThemeClient*, ScrollbarPart) const;
+        int getThemeArrowState(ScrollbarThemeClient*, ScrollbarPart) const;
+        int getClassicThemeState(ScrollbarThemeClient*, ScrollbarPart) const;
     };
 } // namespace WebCore
 
index 62df005..240b501 100644 (file)
@@ -49,11 +49,11 @@ int ScrollbarThemeEfl::scrollbarThickness(ScrollbarControlSize controlSize)
     return 0; // we paint on top
 }
 
-void ScrollbarThemeEfl::registerScrollbar(Scrollbar* scrollbar)
+void ScrollbarThemeEfl::registerScrollbar(ScrollbarThemeClient* scrollbar)
 {
 }
 
-void ScrollbarThemeEfl::unregisterScrollbar(Scrollbar* scrollbar)
+void ScrollbarThemeEfl::unregisterScrollbar(ScrollbarThemeClient* scrollbar)
 {
 }
 
index 0fe1688..28c163e 100644 (file)
@@ -39,8 +39,8 @@ public:
 
     virtual int scrollbarThickness(ScrollbarControlSize = RegularScrollbar);
 
-    virtual void registerScrollbar(Scrollbar* scrollbar);
-    virtual void unregisterScrollbar(Scrollbar* scrollbar);
+    virtual void registerScrollbar(ScrollbarThemeClient*);
+    virtual void unregisterScrollbar(ScrollbarThemeClient*);
 };
 
 }
index e99364f..94e3fd7 100644 (file)
@@ -33,7 +33,7 @@
 
 namespace WebCore {
 
-static HashSet<Scrollbar*>* gScrollbars;
+static HashSet<ScrollbarThemeClient*>* gScrollbars;
 
 ScrollbarTheme* ScrollbarTheme::nativeTheme()
 {
@@ -45,14 +45,14 @@ ScrollbarThemeGtk::~ScrollbarThemeGtk()
 {
 }
 
-void ScrollbarThemeGtk::registerScrollbar(Scrollbar* scrollbar)
+void ScrollbarThemeGtk::registerScrollbar(ScrollbarThemeClient* scrollbar)
 {
     if (!gScrollbars)
-        gScrollbars = new HashSet<Scrollbar*>;
+        gScrollbars = new HashSet<ScrollbarThemeClient*>;
     gScrollbars->add(scrollbar);
 }
 
-void ScrollbarThemeGtk::unregisterScrollbar(Scrollbar* scrollbar)
+void ScrollbarThemeGtk::unregisterScrollbar(ScrollbarThemeClient* scrollbar)
 {
     gScrollbars->remove(scrollbar);
     if (gScrollbars->isEmpty()) {
@@ -69,9 +69,9 @@ void ScrollbarThemeGtk::updateScrollbarsFrameThickness()
     // Update the thickness of every interior frame scrollbar widget. The
     // platform-independent scrollbar them code isn't yet smart enough to get
     // this information when it paints.
-    HashSet<Scrollbar*>::iterator end = gScrollbars->end();
-    for (HashSet<Scrollbar*>::iterator it = gScrollbars->begin(); it != end; ++it) {
-        Scrollbar* scrollbar = (*it);
+    HashSet<ScrollbarThemeClient*>::iterator end = gScrollbars->end();
+    for (HashSet<ScrollbarThemeClient*>::iterator it = gScrollbars->begin(); it != end; ++it) {
+        ScrollbarThemeClient* scrollbar = (*it);
 
         // Top-level scrollbar i.e. scrollbars who have a parent ScrollView
         // with no parent are native, and thus do not need to be resized.
@@ -86,14 +86,14 @@ void ScrollbarThemeGtk::updateScrollbarsFrameThickness()
     }
 }
 
-bool ScrollbarThemeGtk::hasThumb(Scrollbar* scrollbar)
+bool ScrollbarThemeGtk::hasThumb(ScrollbarThemeClient* scrollbar)
 {
     // This method is just called as a paint-time optimization to see if
     // painting the thumb can be skipped.  We don't have to be exact here.
     return thumbLength(scrollbar) > 0;
 }
 
-IntRect ScrollbarThemeGtk::backButtonRect(Scrollbar* scrollbar, ScrollbarPart part, bool)
+IntRect ScrollbarThemeGtk::backButtonRect(ScrollbarThemeClient* scrollbar, ScrollbarPart part, bool)
 {
     if (part == BackButtonEndPart && !m_hasBackButtonEndPart)
         return IntRect();
@@ -114,7 +114,7 @@ IntRect ScrollbarThemeGtk::backButtonRect(Scrollbar* scrollbar, ScrollbarPart pa
     return IntRect(x, scrollbar->y() + scrollbar->height() - m_troughBorderWidth - (2 * size.height()), size.width(), size.height());
 }
 
-IntRect ScrollbarThemeGtk::forwardButtonRect(Scrollbar* scrollbar, ScrollbarPart part, bool)
+IntRect ScrollbarThemeGtk::forwardButtonRect(ScrollbarThemeClient* scrollbar, ScrollbarPart part, bool)
 {
     if (part == ForwardButtonStartPart && !m_hasForwardButtonStartPart)
         return IntRect();
@@ -140,7 +140,7 @@ IntRect ScrollbarThemeGtk::forwardButtonRect(Scrollbar* scrollbar, ScrollbarPart
     return IntRect(x, scrollbar->y() + m_troughBorderWidth + size.height(), size.width(), size.height());
 }
 
-IntRect ScrollbarThemeGtk::trackRect(Scrollbar* scrollbar, bool)
+IntRect ScrollbarThemeGtk::trackRect(ScrollbarThemeClient* scrollbar, bool)
 {
     // The padding along the thumb movement axis includes the trough border
     // plus the size of stepper spacing (the space between the stepper and
@@ -180,7 +180,7 @@ IntRect ScrollbarThemeGtk::trackRect(Scrollbar* scrollbar, bool)
                    thickness, scrollbar->height() - (2 * movementAxisPadding) - buttonsWidth);
 }
 
-IntRect ScrollbarThemeGtk::thumbRect(Scrollbar* scrollbar, const IntRect& unconstrainedTrackRect)
+IntRect ScrollbarThemeGtk::thumbRect(ScrollbarThemeClient* scrollbar, const IntRect& unconstrainedTrackRect)
 {
     IntRect trackRect = constrainTrackRectToTrackPieces(scrollbar, unconstrainedTrackRect);
     int thumbPos = thumbPosition(scrollbar);
@@ -191,7 +191,7 @@ IntRect ScrollbarThemeGtk::thumbRect(Scrollbar* scrollbar, const IntRect& uncons
     return IntRect(trackRect.x() + (trackRect.width() - m_thumbFatness) / 2, trackRect.y() + thumbPos, m_thumbFatness, thumbLength(scrollbar));
 }
 
-bool ScrollbarThemeGtk::paint(Scrollbar* scrollbar, GraphicsContext* graphicsContext, const IntRect& damageRect)
+bool ScrollbarThemeGtk::paint(ScrollbarThemeClient* scrollbar, GraphicsContext* graphicsContext, const IntRect& damageRect)
 {
     if (graphicsContext->paintingDisabled())
         return false;
@@ -260,7 +260,7 @@ bool ScrollbarThemeGtk::paint(Scrollbar* scrollbar, GraphicsContext* graphicsCon
     return true;
 }
 
-bool ScrollbarThemeGtk::shouldCenterOnThumb(Scrollbar*, const PlatformMouseEvent& event)
+bool ScrollbarThemeGtk::shouldCenterOnThumb(ScrollbarThemeClient*, const PlatformMouseEvent& event)
 {
     return (event.shiftKey() && event.button() == LeftButton) || (event.button() == MiddleButton);
 }
@@ -270,7 +270,7 @@ int ScrollbarThemeGtk::scrollbarThickness(ScrollbarControlSize)
     return m_thumbFatness + (m_troughBorderWidth * 2);
 }
 
-IntSize ScrollbarThemeGtk::buttonSize(Scrollbar* scrollbar)
+IntSize ScrollbarThemeGtk::buttonSize(ScrollbarThemeClient* scrollbar)
 {
     if (scrollbar->orientation() == VerticalScrollbar)
         return IntSize(m_thumbFatness, m_stepperSize);
@@ -279,7 +279,7 @@ IntSize ScrollbarThemeGtk::buttonSize(Scrollbar* scrollbar)
     return IntSize(m_stepperSize, m_thumbFatness);
 }
 
-int ScrollbarThemeGtk::minimumThumbLength(Scrollbar* scrollbar)
+int ScrollbarThemeGtk::minimumThumbLength(ScrollbarThemeClient* scrollbar)
 {
     return m_minThumbLength;
 }
index 45e093b..e73df28 100644 (file)
@@ -37,29 +37,29 @@ public:
     ScrollbarThemeGtk();
     virtual ~ScrollbarThemeGtk();
 
-    virtual bool hasButtons(Scrollbar*) { return true; }
-    virtual bool hasThumb(Scrollbar*);
-    virtual IntRect backButtonRect(Scrollbar*, ScrollbarPart, bool);
-    virtual IntRect forwardButtonRect(Scrollbar*, ScrollbarPart, bool);
-    virtual IntRect trackRect(Scrollbar*, bool);
-    IntRect thumbRect(Scrollbar*, const IntRect& unconstrainedTrackRect);
-    bool paint(Scrollbar*, GraphicsContext*, const IntRect& damageRect);
-    void paintScrollbarBackground(GraphicsContext*, Scrollbar*);
-    void paintTrackBackground(GraphicsContext*, Scrollbar*, const IntRect&);
-    void paintThumb(GraphicsContext*, Scrollbar*, const IntRect&);
-    virtual void paintButton(GraphicsContext*, Scrollbar*, const IntRect&, ScrollbarPart);
-    virtual bool shouldCenterOnThumb(Scrollbar*, const PlatformMouseEvent&);
+    virtual bool hasButtons(ScrollbarThemeClient*) { return true; }
+    virtual bool hasThumb(ScrollbarThemeClient*);
+    virtual IntRect backButtonRect(ScrollbarThemeClient*, ScrollbarPart, bool);
+    virtual IntRect forwardButtonRect(ScrollbarThemeClient*, ScrollbarPart, bool);
+    virtual IntRect trackRect(ScrollbarThemeClient*, bool);
+    IntRect thumbRect(ScrollbarThemeClient*, const IntRect& unconstrainedTrackRect);
+    bool paint(ScrollbarThemeClient*, GraphicsContext*, const IntRect& damageRect);
+    void paintScrollbarBackground(GraphicsContext*, ScrollbarThemeClient*);
+    void paintTrackBackground(GraphicsContext*, ScrollbarThemeClient*, const IntRect&);
+    void paintThumb(GraphicsContext*, ScrollbarThemeClient*, const IntRect&);
+    virtual void paintButton(GraphicsContext*, ScrollbarThemeClient*, const IntRect&, ScrollbarPart);
+    virtual bool shouldCenterOnThumb(ScrollbarThemeClient*, const PlatformMouseEvent&);
     virtual int scrollbarThickness(ScrollbarControlSize);
-    virtual IntSize buttonSize(Scrollbar*);
-    virtual int minimumThumbLength(Scrollbar*);
+    virtual IntSize buttonSize(ScrollbarThemeClient*);
+    virtual int minimumThumbLength(ScrollbarThemeClient*);
 
     // TODO: These are the default GTK+ values. At some point we should pull these from the theme itself.
     virtual double initialAutoscrollTimerDelay() { return 0.20; }
     virtual double autoscrollTimerDelay() { return 0.02; }
     void updateThemeProperties();
     void updateScrollbarsFrameThickness();
-    void registerScrollbar(Scrollbar*);
-    void unregisterScrollbar(Scrollbar*);
+    void registerScrollbar(ScrollbarThemeClient*);
+    void unregisterScrollbar(ScrollbarThemeClient*);
 
 protected:
 #ifndef GTK_API_VERSION_2
index 729bd12..866bb8a 100644 (file)
@@ -66,13 +66,13 @@ void ScrollbarThemeGtk::updateThemeProperties()
     updateScrollbarsFrameThickness();
 }
 
-static GtkWidget* getWidgetForScrollbar(Scrollbar* scrollbar)
+static GtkWidget* getWidgetForScrollbar(ScrollbarThemeClient* scrollbar)
 {
     RenderThemeGtk* theme = static_cast<RenderThemeGtk*>(RenderTheme::defaultTheme().get());
     return scrollbar->orientation() == VerticalScrollbar ? theme->gtkVScrollbar() : theme->gtkHScrollbar();
 }
 
-void ScrollbarThemeGtk::paintTrackBackground(GraphicsContext* context, Scrollbar* scrollbar, const IntRect& rect)
+void ScrollbarThemeGtk::paintTrackBackground(GraphicsContext* context, ScrollbarThemeClient* scrollbar, const IntRect& rect)
 {
     // Paint the track background. If the trough-under-steppers property is true, this
     // should be the full size of the scrollbar, but if is false, it should only be the
@@ -87,7 +87,7 @@ void ScrollbarThemeGtk::paintTrackBackground(GraphicsContext* context, Scrollbar
                               GTK_STATE_ACTIVE, GTK_SHADOW_IN, "trough");
 }
 
-void ScrollbarThemeGtk::paintScrollbarBackground(GraphicsContext* context, Scrollbar* scrollbar)
+void ScrollbarThemeGtk::paintScrollbarBackground(GraphicsContext* context, ScrollbarThemeClient* scrollbar)
 {
     IntRect fullScrollbarRect = IntRect(scrollbar->x(), scrollbar->y(), scrollbar->width(), scrollbar->height());
 
@@ -96,7 +96,7 @@ void ScrollbarThemeGtk::paintScrollbarBackground(GraphicsContext* context, Scrol
                               GTK_STATE_NORMAL, GTK_SHADOW_IN, "scrolled_window");
 }
 
-void ScrollbarThemeGtk::paintThumb(GraphicsContext* context, Scrollbar* scrollbar, const IntRect& rect)
+void ScrollbarThemeGtk::paintThumb(GraphicsContext* context, ScrollbarThemeClient* scrollbar, const IntRect& rect)
 {
     GtkWidget* widget = getWidgetForScrollbar(scrollbar);
     gboolean activateSlider;
@@ -129,7 +129,7 @@ void ScrollbarThemeGtk::paintThumb(GraphicsContext* context, Scrollbar* scrollba
     widgetContext.gtkPaintSlider(sliderRect, widget, stateType, shadowType, "slider", orientation);
 }
 
-void ScrollbarThemeGtk::paintButton(GraphicsContext* context, Scrollbar* scrollbar, const IntRect& rect, ScrollbarPart part)
+void ScrollbarThemeGtk::paintButton(GraphicsContext* context, ScrollbarThemeClient* scrollbar, const IntRect& rect, ScrollbarPart part)
 {
     // The buttons will be disabled if the thumb is as the appropriate extreme.
     GtkShadowType shadowType = GTK_SHADOW_OUT;
index 4c33e66..9749c54 100644 (file)
@@ -72,7 +72,7 @@ static void applyScrollbarStyleContextClasses(GtkStyleContext* context, Scrollba
     gtk_style_context_add_class(context, orientation == VerticalScrollbar ?  GTK_STYLE_CLASS_VERTICAL : GTK_STYLE_CLASS_HORIZONTAL);
 }
 
-void ScrollbarThemeGtk::paintTrackBackground(GraphicsContext* context, Scrollbar* scrollbar, const IntRect& rect)
+void ScrollbarThemeGtk::paintTrackBackground(GraphicsContext* context, ScrollbarThemeClient* scrollbar, const IntRect& rect)
 {
     // Paint the track background. If the trough-under-steppers property is true, this
     // should be the full size of the scrollbar, but if is false, it should only be the
@@ -94,7 +94,7 @@ void ScrollbarThemeGtk::paintTrackBackground(GraphicsContext* context, Scrollbar
     gtk_style_context_restore(m_context);
 }
 
-void ScrollbarThemeGtk::paintScrollbarBackground(GraphicsContext* context, Scrollbar* scrollbar)
+void ScrollbarThemeGtk::paintScrollbarBackground(GraphicsContext* context, ScrollbarThemeClient* scrollbar)
 {
     gtk_style_context_save(m_context);
 
@@ -105,7 +105,7 @@ void ScrollbarThemeGtk::paintScrollbarBackground(GraphicsContext* context, Scrol
     gtk_style_context_restore(m_context);
 }
 
-void ScrollbarThemeGtk::paintThumb(GraphicsContext* context, Scrollbar* scrollbar, const IntRect& rect)
+void ScrollbarThemeGtk::paintThumb(GraphicsContext* context, ScrollbarThemeClient* scrollbar, const IntRect& rect)
 {
     gtk_style_context_save(m_context);
 
@@ -126,7 +126,7 @@ void ScrollbarThemeGtk::paintThumb(GraphicsContext* context, Scrollbar* scrollba
     gtk_style_context_restore(m_context);
 }
 
-void ScrollbarThemeGtk::paintButton(GraphicsContext* context, Scrollbar* scrollbar, const IntRect& rect, ScrollbarPart part)
+void ScrollbarThemeGtk::paintButton(GraphicsContext* context, ScrollbarThemeClient* scrollbar, const IntRect& rect, ScrollbarPart part)
 {
     gtk_style_context_save(m_context);
 
index 13d44c2..d14da6d 100644 (file)
@@ -39,46 +39,46 @@ public:
 
     void preferencesChanged();
 
-    virtual void updateEnabledState(Scrollbar*);
+    virtual void updateEnabledState(ScrollbarThemeClient*);
 
 #if !PLATFORM(CHROMIUM)
-    virtual bool paint(Scrollbar*, GraphicsContext* context, const IntRect& damageRect);
+    virtual bool paint(ScrollbarThemeClient*, GraphicsContext*, const IntRect& damageRect);
 #endif
 
     virtual int scrollbarThickness(ScrollbarControlSize = RegularScrollbar);
     
     virtual bool supportsControlTints() const { return true; }
     virtual bool usesOverlayScrollbars() const;
-    virtual void updateScrollbarOverlayStyle(Scrollbar*);
+    virtual void updateScrollbarOverlayStyle(ScrollbarThemeClient*);
 
     virtual double initialAutoscrollTimerDelay();
     virtual double autoscrollTimerDelay();
 
     virtual ScrollbarButtonsPlacement buttonsPlacement() const;
 
-    virtual void registerScrollbar(Scrollbar*);
-    virtual void unregisterScrollbar(Scrollbar*);
+    virtual void registerScrollbar(ScrollbarThemeClient*);
+    virtual void unregisterScrollbar(ScrollbarThemeClient*);
 
-    void setNewPainterForScrollbar(Scrollbar*, ScrollbarPainter);
-    ScrollbarPainter painterForScrollbar(Scrollbar*);
+    void setNewPainterForScrollbar(ScrollbarThemeClient*, ScrollbarPainter);
+    ScrollbarPainter painterForScrollbar(ScrollbarThemeClient*);
 
     static bool isCurrentlyDrawingIntoLayer();
     static void setIsCurrentlyDrawingIntoLayer(bool);
 
 protected:
-    virtual bool hasButtons(Scrollbar*);
-    virtual bool hasThumb(Scrollbar*);
+    virtual bool hasButtons(ScrollbarThemeClient*);
+    virtual bool hasThumb(ScrollbarThemeClient*);
 
-    virtual IntRect backButtonRect(Scrollbar*, ScrollbarPart, bool painting = false);
-    virtual IntRect forwardButtonRect(Scrollbar*, ScrollbarPart, bool painting = false);
-    virtual IntRect trackRect(Scrollbar*, bool painting = false);
+    virtual IntRect backButtonRect(ScrollbarThemeClient*, ScrollbarPart, bool painting = false);
+    virtual IntRect forwardButtonRect(ScrollbarThemeClient*, ScrollbarPart, bool painting = false);
+    virtual IntRect trackRect(ScrollbarThemeClient*, bool painting = false);
 
     virtual int maxOverlapBetweenPages() { return 40; }
 
-    virtual int minimumThumbLength(Scrollbar*);
+    virtual int minimumThumbLength(ScrollbarThemeClient*);
     
-    virtual bool shouldCenterOnThumb(Scrollbar*, const PlatformMouseEvent&);
-    virtual bool shouldDragDocumentInsteadOfThumb(Scrollbar*, const PlatformMouseEvent&);
+    virtual bool shouldCenterOnThumb(ScrollbarThemeClient*, const PlatformMouseEvent&);
+    virtual bool shouldDragDocumentInsteadOfThumb(ScrollbarThemeClient*, const PlatformMouseEvent&);
     int scrollbarPartToHIPressedState(ScrollbarPart);
 
 #if !PLATFORM(CHROMIUM) && USE(ACCELERATED_COMPOSITING) && ENABLE(RUBBER_BANDING)
index ee28fb2..e47468b 100644 (file)
@@ -50,7 +50,7 @@ using namespace WebCore;
 
 namespace WebCore {
 
-typedef HashMap<Scrollbar*, RetainPtr<ScrollbarPainter> > ScrollbarPainterMap;
+typedef HashMap<ScrollbarThemeClient*, RetainPtr<ScrollbarPainter> > ScrollbarPainterMap;
 
 static ScrollbarPainterMap* scrollbarMap()
 {
@@ -162,7 +162,7 @@ static void updateArrowPlacement()
     }
 }
 
-void ScrollbarThemeMac::registerScrollbar(Scrollbar* scrollbar)
+void ScrollbarThemeMac::registerScrollbar(ScrollbarThemeClient* scrollbar)
 {
     if (isScrollbarOverlayAPIAvailable()) {
         bool isHorizontal = scrollbar->orientation() == HorizontalScrollbar;
@@ -175,19 +175,19 @@ void ScrollbarThemeMac::registerScrollbar(Scrollbar* scrollbar)
     }
 }
 
-void ScrollbarThemeMac::unregisterScrollbar(Scrollbar* scrollbar)
+void ScrollbarThemeMac::unregisterScrollbar(ScrollbarThemeClient* scrollbar)
 {
     scrollbarMap()->remove(scrollbar);
 }
 
-void ScrollbarThemeMac::setNewPainterForScrollbar(Scrollbar* scrollbar, ScrollbarPainter newPainter)
+void ScrollbarThemeMac::setNewPainterForScrollbar(ScrollbarThemeClient* scrollbar, ScrollbarPainter newPainter)
 {
     scrollbarMap()->set(scrollbar, newPainter);
     updateEnabledState(scrollbar);
     updateScrollbarOverlayStyle(scrollbar);
 }
 
-ScrollbarPainter ScrollbarThemeMac::painterForScrollbar(Scrollbar* scrollbar)
+ScrollbarPainter ScrollbarThemeMac::painterForScrollbar(ScrollbarThemeClient* scrollbar)
 {
     return scrollbarMap()->get(scrollbar).get();
 }
@@ -248,10 +248,10 @@ bool ScrollbarThemeMac::usesOverlayScrollbars() const
         return false;
 }
 
-void ScrollbarThemeMac::updateScrollbarOverlayStyle(Scrollbar* scrollbar)
+void ScrollbarThemeMac::updateScrollbarOverlayStyle(ScrollbarThemeClient* scrollbar)
 {
     ScrollbarPainter painter = painterForScrollbar(scrollbar);
-    switch (scrollbar->scrollableArea()->scrollbarOverlayStyle()) {
+    switch (scrollbar->scrollbarOverlayStyle()) {
     case ScrollbarOverlayStyleDefault:
         [painter setKnobStyle:NSScrollerKnobStyleDefault];
         break;
@@ -279,7 +279,7 @@ ScrollbarButtonsPlacement ScrollbarThemeMac::buttonsPlacement() const
     return gButtonPlacement;
 }
 
-bool ScrollbarThemeMac::hasButtons(Scrollbar* scrollbar)
+bool ScrollbarThemeMac::hasButtons(ScrollbarThemeClient* scrollbar)
 {
     return scrollbar->enabled() && buttonsPlacement() != ScrollbarButtonsNone
              && (scrollbar->orientation() == HorizontalScrollbar
@@ -287,7 +287,7 @@ bool ScrollbarThemeMac::hasButtons(Scrollbar* scrollbar)
              : scrollbar->height()) >= 2 * (cRealButtonLength[scrollbar->controlSize()] - cButtonHitInset[scrollbar->controlSize()]);
 }
 
-bool ScrollbarThemeMac::hasThumb(Scrollbar* scrollbar)
+bool ScrollbarThemeMac::hasThumb(ScrollbarThemeClient* scrollbar)
 {
     int minLengthForThumb;
     if (isScrollbarOverlayAPIAvailable()) {
@@ -319,7 +319,7 @@ static IntRect buttonRepaintRect(const IntRect& buttonRect, ScrollbarOrientation
     return paintRect;
 }
 
-IntRect ScrollbarThemeMac::backButtonRect(Scrollbar* scrollbar, ScrollbarPart part, bool painting)
+IntRect ScrollbarThemeMac::backButtonRect(ScrollbarThemeClient* scrollbar, ScrollbarPart part, bool painting)
 {
     IntRect result;
     
@@ -353,7 +353,7 @@ IntRect ScrollbarThemeMac::backButtonRect(Scrollbar* scrollbar, ScrollbarPart pa
     return result;
 }
 
-IntRect ScrollbarThemeMac::forwardButtonRect(Scrollbar* scrollbar, ScrollbarPart part, bool painting)
+IntRect ScrollbarThemeMac::forwardButtonRect(ScrollbarThemeClient* scrollbar, ScrollbarPart part, bool painting)
 {
     IntRect result;
     
@@ -393,7 +393,7 @@ IntRect ScrollbarThemeMac::forwardButtonRect(Scrollbar* scrollbar, ScrollbarPart
     return result;
 }
 
-IntRect ScrollbarThemeMac::trackRect(Scrollbar* scrollbar, bool painting)
+IntRect ScrollbarThemeMac::trackRect(ScrollbarThemeClient* scrollbar, bool painting)
 {
     if (painting || !hasButtons(scrollbar))
         return scrollbar->frameRect();
@@ -430,7 +430,7 @@ IntRect ScrollbarThemeMac::trackRect(Scrollbar* scrollbar, bool painting)
     return IntRect(scrollbar->x(), scrollbar->y() + startWidth, thickness, scrollbar->height() - totalWidth);
 }
 
-int ScrollbarThemeMac::minimumThumbLength(Scrollbar* scrollbar)
+int ScrollbarThemeMac::minimumThumbLength(ScrollbarThemeClient* scrollbar)
 {
     if (isScrollbarOverlayAPIAvailable())
         return [scrollbarMap()->get(scrollbar).get() knobMinLength];
@@ -438,7 +438,7 @@ int ScrollbarThemeMac::minimumThumbLength(Scrollbar* scrollbar)
         return cThumbMinLength[scrollbar->controlSize()];
 }
 
-bool ScrollbarThemeMac::shouldCenterOnThumb(Scrollbar*, const PlatformMouseEvent& evt)
+bool ScrollbarThemeMac::shouldCenterOnThumb(ScrollbarThemeClient*, const PlatformMouseEvent& evt)
 {
     if (evt.button() != LeftButton)
         return false;
@@ -447,7 +447,7 @@ bool ScrollbarThemeMac::shouldCenterOnThumb(Scrollbar*, const PlatformMouseEvent
     return evt.altKey();
 }
 
-bool ScrollbarThemeMac::shouldDragDocumentInsteadOfThumb(Scrollbar*, const PlatformMouseEvent& event)
+bool ScrollbarThemeMac::shouldDragDocumentInsteadOfThumb(ScrollbarThemeClient*, const PlatformMouseEvent& event)
 {
     return event.altKey();
 }
@@ -470,7 +470,7 @@ int ScrollbarThemeMac::scrollbarPartToHIPressedState(ScrollbarPart part)
     }
 }
 
-void ScrollbarThemeMac::updateEnabledState(Scrollbar* scrollbar)
+void ScrollbarThemeMac::updateEnabledState(ScrollbarThemeClient* scrollbar)
 {
     if (isScrollbarOverlayAPIAvailable())
         [scrollbarMap()->get(scrollbar).get() setEnabled:scrollbar->enabled()];
@@ -499,7 +499,7 @@ static void scrollbarPainterPaint(ScrollbarPainter scrollbarPainter, bool enable
 }
 
 #if !PLATFORM(CHROMIUM)
-bool ScrollbarThemeMac::paint(Scrollbar* scrollbar, GraphicsContext* context, const IntRect& damageRect)
+bool ScrollbarThemeMac::paint(ScrollbarThemeClient* scrollbar, GraphicsContext* context, const IntRect& damageRect)
 {
     if (isScrollbarOverlayAPIAvailable()) {
         float value = 0;
@@ -570,7 +570,7 @@ bool ScrollbarThemeMac::paint(Scrollbar* scrollbar, GraphicsContext* context, co
     if (!scrollbar->enabled())
         trackInfo.enableState = kThemeTrackDisabled;
     else
-        trackInfo.enableState = scrollbar->scrollableArea()->isActive() ? kThemeTrackActive : kThemeTrackInactive;
+        trackInfo.enableState = scrollbar->isScrollableAreaActive() ? kThemeTrackActive : kThemeTrackInactive;
 
     if (hasThumb(scrollbar))
         trackInfo.attributes |= kThemeTrackShowThumb;
index 5d2bc3e..6de91cc 100644 (file)
@@ -32,7 +32,7 @@ namespace WebCore {
 
 static int cScrollbarThickness[] = { 15, 11 };
 
-IntRect ScrollbarThemeMock::trackRect(Scrollbar* scrollbar, bool)
+IntRect ScrollbarThemeMock::trackRect(ScrollbarThemeClient* scrollbar, bool)
 {
     return scrollbar->frameRect();
 }
@@ -42,12 +42,12 @@ int ScrollbarThemeMock::scrollbarThickness(ScrollbarControlSize controlSize)
     return cScrollbarThickness[controlSize];
 }
 
-void ScrollbarThemeMock::paintTrackBackground(GraphicsContext* context, Scrollbar* scrollbar, const IntRect& trackRect)
+void ScrollbarThemeMock::paintTrackBackground(GraphicsContext* context, ScrollbarThemeClient* scrollbar, const IntRect& trackRect)
 {
     context->fillRect(trackRect, scrollbar->enabled() ? Color::lightGray : Color(0xFFE0E0E0), ColorSpaceDeviceRGB);
 }
 
-void ScrollbarThemeMock::paintThumb(GraphicsContext* context, Scrollbar* scrollbar, const IntRect& thumbRect)
+void ScrollbarThemeMock::paintThumb(GraphicsContext* context, ScrollbarThemeClient* scrollbar, const IntRect& thumbRect)
 {
     if (scrollbar->enabled())
         context->fillRect(thumbRect, Color::darkGray, ColorSpaceDeviceRGB);
index e254842..6333841 100644 (file)
@@ -36,15 +36,15 @@ public:
     virtual int scrollbarThickness(ScrollbarControlSize = RegularScrollbar);
 
 protected:
-    virtual bool hasButtons(Scrollbar*) { return false; }
-    virtual bool hasThumb(Scrollbar*) { return true; }
+    virtual bool hasButtons(ScrollbarThemeClient*) { return false; }
+    virtual bool hasThumb(ScrollbarThemeClient*) { return true; }
 
-    virtual IntRect backButtonRect(Scrollbar*, ScrollbarPart, bool /*painting*/ = false) { return IntRect(); }
-    virtual IntRect forwardButtonRect(Scrollbar*, ScrollbarPart, bool /*painting*/ = false) { return IntRect(); }
-    virtual IntRect trackRect(Scrollbar*, bool painting = false);
+    virtual IntRect backButtonRect(ScrollbarThemeClient*, ScrollbarPart, bool /*painting*/ = false) { return IntRect(); }
+    virtual IntRect forwardButtonRect(ScrollbarThemeClient*, ScrollbarPart, bool /*painting*/ = false) { return IntRect(); }
+    virtual IntRect trackRect(ScrollbarThemeClient*, bool painting = false);
     
-    virtual void paintTrackBackground(GraphicsContext*, Scrollbar*, const IntRect&);
-    virtual void paintThumb(GraphicsContext*, Scrollbar*, const IntRect&);
+    virtual void paintTrackBackground(GraphicsContext*, ScrollbarThemeClient*, const IntRect&);
+    virtual void paintThumb(GraphicsContext*, ScrollbarThemeClient*, const IntRect&);
     
 private:
     virtual bool isMockTheme() const { return true; }
index e3243ec..d4b58b1 100644 (file)
@@ -112,7 +112,7 @@ static ScrollbarPart scrollbarPart(const QStyle::SubControl& sc)
     return NoPart;
 }
 
-static QStyleOptionSlider* styleOptionSlider(Scrollbar* scrollbar, QWidget* widget = 0)
+static QStyleOptionSlider* styleOptionSlider(ScrollbarThemeClient* scrollbar, QWidget* widget = 0)
 {
     static QStyleOptionSlider opt;
     if (widget)
@@ -155,7 +155,7 @@ static QStyleOptionSlider* styleOptionSlider(Scrollbar* scrollbar, QWidget* widg
     return &opt;
 }
 
-bool ScrollbarThemeQt::paint(Scrollbar* scrollbar, GraphicsContext* graphicsContext, const IntRect& damageRect)
+bool ScrollbarThemeQt::paint(ScrollbarThemeClient* scrollbar, GraphicsContext* graphicsContext, const IntRect& damageRect)
 {
     if (graphicsContext->updatingControlTints()) {
        scrollbar->invalidateRect(damageRect);
@@ -193,7 +193,7 @@ bool ScrollbarThemeQt::paint(Scrollbar* scrollbar, GraphicsContext* graphicsCont
     return true;
 }
 
-ScrollbarPart ScrollbarThemeQt::hitTest(Scrollbar* scrollbar, const PlatformMouseEvent& evt)
+ScrollbarPart ScrollbarThemeQt::hitTest(ScrollbarThemeClient* scrollbar, const PlatformMouseEvent& evt)
 {
     QStyleOptionSlider* opt = styleOptionSlider(scrollbar);
     const QPoint pos = scrollbar->convertFromContainingWindow(evt.position());
@@ -202,13 +202,13 @@ ScrollbarPart ScrollbarThemeQt::hitTest(Scrollbar* scrollbar, const PlatformMous
     return scrollbarPart(sc);
 }
 
-bool ScrollbarThemeQt::shouldCenterOnThumb(Scrollbar*, const PlatformMouseEvent& evt)
+bool ScrollbarThemeQt::shouldCenterOnThumb(ScrollbarThemeClient*, const PlatformMouseEvent& evt)
 {
     // Middle click centers slider thumb (if supported).
     return style()->styleHint(QStyle::SH_ScrollBar_MiddleClickAbsolutePosition) && evt.button() == MiddleButton;
 }
 
-void ScrollbarThemeQt::invalidatePart(Scrollbar* scrollbar, ScrollbarPart)
+void ScrollbarThemeQt::invalidatePart(ScrollbarThemeClient* scrollbar, ScrollbarPart)
 {
     // FIXME: Do more precise invalidation.
     scrollbar->invalidate();
@@ -224,7 +224,7 @@ int ScrollbarThemeQt::scrollbarThickness(ScrollbarControlSize controlSize)
     return style()->pixelMetric(QStyle::PM_ScrollBarExtent, &o, 0);
 }
 
-int ScrollbarThemeQt::thumbPosition(Scrollbar* scrollbar)
+int ScrollbarThemeQt::thumbPosition(ScrollbarThemeClient* scrollbar)
 {
     if (scrollbar->enabled()) {
         float pos = (float)scrollbar->currentPos() * (trackLength(scrollbar) - thumbLength(scrollbar)) / scrollbar->maximum();
@@ -233,21 +233,21 @@ int ScrollbarThemeQt::thumbPosition(Scrollbar* scrollbar)
     return 0;
 }
 
-int ScrollbarThemeQt::thumbLength(Scrollbar* scrollbar)
+int ScrollbarThemeQt::thumbLength(ScrollbarThemeClient* scrollbar)
 {
     QStyleOptionSlider* opt = styleOptionSlider(scrollbar);
     IntRect thumb = style()->subControlRect(QStyle::CC_ScrollBar, opt, QStyle::SC_ScrollBarSlider, 0);
     return scrollbar->orientation() == HorizontalScrollbar ? thumb.width() : thumb.height();
 }
 
-int ScrollbarThemeQt::trackPosition(Scrollbar* scrollbar)
+int ScrollbarThemeQt::trackPosition(ScrollbarThemeClient* scrollbar)
 {
     QStyleOptionSlider* opt = styleOptionSlider(scrollbar);
     IntRect track = style()->subControlRect(QStyle::CC_ScrollBar, opt, QStyle::SC_ScrollBarGroove, 0);
     return scrollbar->orientation() == HorizontalScrollbar ? track.x() - scrollbar->x() : track.y() - scrollbar->y();
 }
 
-int ScrollbarThemeQt::trackLength(Scrollbar* scrollbar)
+int ScrollbarThemeQt::trackLength(ScrollbarThemeClient* scrollbar)
 {
     QStyleOptionSlider* opt = styleOptionSlider(scrollbar);
     IntRect track = style()->subControlRect(QStyle::CC_ScrollBar, opt, QStyle::SC_ScrollBarGroove, 0);
index cf4882d..0337bf8 100644 (file)
@@ -40,19 +40,19 @@ class ScrollbarThemeQt : public ScrollbarTheme {
 public:
     virtual ~ScrollbarThemeQt();
 
-    virtual bool paint(Scrollbar*, GraphicsContext*, const IntRect& damageRect);
+    virtual bool paint(ScrollbarThemeClient*, GraphicsContext*, const IntRect& damageRect);
     virtual void paintScrollCorner(ScrollView*, GraphicsContext*, const IntRect& cornerRect);
 
-    virtual ScrollbarPart hitTest(Scrollbar*, const PlatformMouseEvent&);
+    virtual ScrollbarPart hitTest(ScrollbarThemeClient*, const PlatformMouseEvent&);
 
-    virtual bool shouldCenterOnThumb(Scrollbar*, const PlatformMouseEvent&);
+    virtual bool shouldCenterOnThumb(ScrollbarThemeClient*, const PlatformMouseEvent&);
 
-    virtual void invalidatePart(Scrollbar*, ScrollbarPart);
+    virtual void invalidatePart(ScrollbarThemeClient*, ScrollbarPart);
 
-    virtual int thumbPosition(Scrollbar*);
-    virtual int thumbLength(Scrollbar*);
-    virtual int trackPosition(Scrollbar*);
-    virtual int trackLength(Scrollbar*);
+    virtual int thumbPosition(ScrollbarThemeClient*);
+    virtual int thumbLength(ScrollbarThemeClient*);
+    virtual int trackPosition(ScrollbarThemeClient*);
+    virtual int trackLength(ScrollbarThemeClient*);
 
     virtual int scrollbarThickness(ScrollbarControlSize = RegularScrollbar);
 
index 343bbb2..1cc5385 100644 (file)
@@ -104,14 +104,14 @@ int ScrollbarThemeSafari::scrollbarThickness(ScrollbarControlSize controlSize)
     return cScrollbarThickness[controlSize];
 }
 
-bool ScrollbarThemeSafari::hasButtons(Scrollbar* scrollbar)
+bool ScrollbarThemeSafari::hasButtons(ScrollbarThemeClient* scrollbar)
 {
     return scrollbar->enabled() && (scrollbar->orientation() == HorizontalScrollbar ? 
              scrollbar->width() : 
              scrollbar->height()) >= 2 * (cRealButtonLength[scrollbar->controlSize()] - cButtonHitInset[scrollbar->controlSize()]);
 }
 
-bool ScrollbarThemeSafari::hasThumb(Scrollbar* scrollbar)
+bool ScrollbarThemeSafari::hasThumb(ScrollbarThemeClient* scrollbar)
 {
     return scrollbar->enabled() && (scrollbar->orientation() == HorizontalScrollbar ? 
              scrollbar->width() : 
@@ -134,7 +134,7 @@ static IntRect buttonRepaintRect(const IntRect& buttonRect, ScrollbarOrientation
     return paintRect;
 }
 
-IntRect ScrollbarThemeSafari::backButtonRect(Scrollbar* scrollbar, ScrollbarPart part, bool painting)
+IntRect ScrollbarThemeSafari::backButtonRect(ScrollbarThemeClient* scrollbar, ScrollbarPart part, bool painting)
 {
     IntRect result;
 
@@ -152,7 +152,7 @@ IntRect ScrollbarThemeSafari::backButtonRect(Scrollbar* scrollbar, ScrollbarPart
     return result;
 }
 
-IntRect ScrollbarThemeSafari::forwardButtonRect(Scrollbar* scrollbar, ScrollbarPart part, bool painting)
+IntRect ScrollbarThemeSafari::forwardButtonRect(ScrollbarThemeClient* scrollbar, ScrollbarPart part, bool painting)
 {
     IntRect result;
     
@@ -181,7 +181,7 @@ static IntRect trackRepaintRect(const IntRect& trackRect, ScrollbarOrientation o
     return paintRect;
 }
 
-IntRect ScrollbarThemeSafari::trackRect(Scrollbar* scrollbar, bool painting)
+IntRect ScrollbarThemeSafari::trackRect(ScrollbarThemeClient* scrollbar, bool painting)
 {
     if (painting || !hasButtons(scrollbar))
         return scrollbar->frameRect();
@@ -193,36 +193,36 @@ IntRect ScrollbarThemeSafari::trackRect(Scrollbar* scrollbar, bool painting)
     return IntRect(scrollbar->x(), scrollbar->y() + cButtonLength[scrollbar->controlSize()], thickness, scrollbar->height() - 2 * cButtonLength[scrollbar->controlSize()]);
 }
 
-int ScrollbarThemeSafari::minimumThumbLength(Scrollbar* scrollbar)
+int ScrollbarThemeSafari::minimumThumbLength(ScrollbarThemeClient* scrollbar)
 {
     return cThumbMinLength[scrollbar->controlSize()];
 }
 
-bool ScrollbarThemeSafari::shouldCenterOnThumb(Scrollbar*, const PlatformMouseEvent& evt)
+bool ScrollbarThemeSafari::shouldCenterOnThumb(ScrollbarThemeClient*, const PlatformMouseEvent& evt)
 {
     return evt.shiftKey() && evt.button() == LeftButton;
 }
 
-void ScrollbarThemeSafari::paintTrackBackground(GraphicsContext* graphicsContext, Scrollbar* scrollbar, const IntRect& trackRect)
+void ScrollbarThemeSafari::paintTrackBackground(GraphicsContext* graphicsContext, ScrollbarThemeClient* scrollbar, const IntRect& trackRect)
 {
     if (!SafariThemeLibrary())
         return;
     NSControlSize size = scrollbar->controlSize() == SmallScrollbar ? NSSmallControlSize : NSRegularControlSize;
     ThemeControlState state = 0;
-    if (scrollbar->scrollableArea()->isActive())
+    if (scrollbar->isScrollableAreaActive())
         state |= ActiveState;
     if (hasButtons(scrollbar))
         state |= EnabledState;
     paintThemePart(scrollbar->orientation() == VerticalScrollbar ? VScrollTrackPart : HScrollTrackPart, graphicsContext->platformContext(), trackRect, size, state); 
 }
 
-void ScrollbarThemeSafari::paintButton(GraphicsContext* graphicsContext, Scrollbar* scrollbar, const IntRect& buttonRect, ScrollbarPart part)
+void ScrollbarThemeSafari::paintButton(GraphicsContext* graphicsContext, ScrollbarThemeClient* scrollbar, const IntRect& buttonRect, ScrollbarPart part)
 {
     if (!SafariThemeLibrary())
         return;
     NSControlSize size = scrollbar->controlSize() == SmallScrollbar ? NSSmallControlSize : NSRegularControlSize;
     ThemeControlState state = 0;
-    if (scrollbar->scrollableArea()->isActive())
+    if (scrollbar->isScrollableAreaActive())
         state |= ActiveState;
     if (hasButtons(scrollbar))
         state |= EnabledState;
@@ -236,13 +236,13 @@ void ScrollbarThemeSafari::paintButton(GraphicsContext* graphicsContext, Scrollb
                        buttonRect, size, state);
 }
 
-void ScrollbarThemeSafari::paintThumb(GraphicsContext* graphicsContext, Scrollbar* scrollbar, const IntRect& thumbRect)
+void ScrollbarThemeSafari::paintThumb(GraphicsContext* graphicsContext, ScrollbarThemeClient* scrollbar, const IntRect& thumbRect)
 {
     if (!SafariThemeLibrary())
         return;
     NSControlSize size = scrollbar->controlSize() == SmallScrollbar ? NSSmallControlSize : NSRegularControlSize;
     ThemeControlState state = 0;
-    if (scrollbar->scrollableArea()->isActive())
+    if (scrollbar->isScrollableAreaActive())
         state |= ActiveState;
     if (hasThumb(scrollbar))
         state |= EnabledState;
index f039379..f427b19 100644 (file)
@@ -41,20 +41,20 @@ public:
     virtual bool supportsControlTints() const { return true; }
 
 protected:
-    virtual bool hasButtons(Scrollbar*);
-    virtual bool hasThumb(Scrollbar*);
+    virtual bool hasButtons(ScrollbarThemeClient*);
+    virtual bool hasThumb(ScrollbarThemeClient*);
 
-    virtual IntRect backButtonRect(Scrollbar*, ScrollbarPart, bool painting = false);
-    virtual IntRect forwardButtonRect(Scrollbar*, ScrollbarPart, bool painting = false);
-    virtual IntRect trackRect(Scrollbar*, bool painting = false);
+    virtual IntRect backButtonRect(ScrollbarThemeClient*, ScrollbarPart, bool painting = false);
+    virtual IntRect forwardButtonRect(ScrollbarThemeClient*, ScrollbarPart, bool painting = false);
+    virtual IntRect trackRect(ScrollbarThemeClient*, bool painting = false);
 
-    virtual int minimumThumbLength(Scrollbar*);
+    virtual int minimumThumbLength(ScrollbarThemeClient*);
     
-    virtual bool shouldCenterOnThumb(Scrollbar*, const PlatformMouseEvent&);
+    virtual bool shouldCenterOnThumb(ScrollbarThemeClient*, const PlatformMouseEvent&);
 
-    virtual void paintTrackBackground(GraphicsContext*, Scrollbar*, const IntRect&);
-    virtual void paintButton(GraphicsContext*, Scrollbar*, const IntRect&, ScrollbarPart);
-    virtual void paintThumb(GraphicsContext*, Scrollbar*, const IntRect&);
+    virtual void paintTrackBackground(GraphicsContext*, ScrollbarThemeClient*, const IntRect&);
+    virtual void paintButton(GraphicsContext*, ScrollbarThemeClient*, const IntRect&, ScrollbarPart);
+    virtual void paintThumb(GraphicsContext*, ScrollbarThemeClient*, const IntRect&);
 };
 
 }
index d363410..5644297 100644 (file)
@@ -130,12 +130,12 @@ bool ScrollbarThemeWin::invalidateOnMouseEnterExit()
     return runningVista;
 }
 
-bool ScrollbarThemeWin::hasThumb(Scrollbar* scrollbar)
+bool ScrollbarThemeWin::hasThumb(ScrollbarThemeClient* scrollbar)
 {
     return thumbLength(scrollbar) > 0;
 }
 
-IntRect ScrollbarThemeWin::backButtonRect(Scrollbar* scrollbar, ScrollbarPart part, bool)
+IntRect ScrollbarThemeWin::backButtonRect(ScrollbarThemeClient* scrollbar, ScrollbarPart part, bool)
 {
     // Windows just has single arrows.
     if (part == BackButtonEndPart)
@@ -154,7 +154,7 @@ IntRect ScrollbarThemeWin::backButtonRect(Scrollbar* scrollbar, ScrollbarPart pa
                    thickness, scrollbar->height() < 2 * thickness ? scrollbar->height() / 2 : thickness);
 }
 
-IntRect ScrollbarThemeWin::forwardButtonRect(Scrollbar* scrollbar, ScrollbarPart part, bool)
+IntRect ScrollbarThemeWin::forwardButtonRect(ScrollbarThemeClient* scrollbar, ScrollbarPart part, bool)
 {
     // Windows just has single arrows.
     if (part == ForwardButtonStartPart)
@@ -175,7 +175,7 @@ IntRect ScrollbarThemeWin::forwardButtonRect(Scrollbar* scrollbar, ScrollbarPart
     return IntRect(scrollbar->x(), scrollbar->y() + scrollbar->height() - h, thickness, h);
 }
 
-IntRect ScrollbarThemeWin::trackRect(Scrollbar* scrollbar, bool)
+IntRect ScrollbarThemeWin::trackRect(ScrollbarThemeClient* scrollbar, bool)
 {
     int thickness = scrollbarThickness();
     if (scrollbar->orientation() == HorizontalScrollbar) {
@@ -188,12 +188,12 @@ IntRect ScrollbarThemeWin::trackRect(Scrollbar* scrollbar, bool)
     return IntRect(scrollbar->x(), scrollbar->y() + thickness, thickness, scrollbar->height() - 2 * thickness);
 }
 
-bool ScrollbarThemeWin::shouldCenterOnThumb(Scrollbar*, const PlatformMouseEvent& evt)
+bool ScrollbarThemeWin::shouldCenterOnThumb(ScrollbarThemeClient*, const PlatformMouseEvent& evt)
 {
     return evt.shiftKey() && evt.button() == LeftButton;
 }
 
-bool ScrollbarThemeWin::shouldSnapBackToDragOrigin(Scrollbar* scrollbar, const PlatformMouseEvent& evt)
+bool ScrollbarThemeWin::shouldSnapBackToDragOrigin(ScrollbarThemeClient* scrollbar, const PlatformMouseEvent& evt)
 {
     // Find the rect within which we shouldn't snap, by expanding the track rect
     // in both dimensions.
@@ -211,14 +211,14 @@ bool ScrollbarThemeWin::shouldSnapBackToDragOrigin(Scrollbar* scrollbar, const P
     return !rect.contains(mousePosition);
 }
 
-void ScrollbarThemeWin::paintTrackBackground(GraphicsContext* context, Scrollbar* scrollbar, const IntRect& rect)
+void ScrollbarThemeWin::paintTrackBackground(GraphicsContext* context, ScrollbarThemeClient* scrollbar, const IntRect& rect)
 {
     // Just assume a forward track part.  We only paint the track as a single piece when there is no thumb.
     if (!hasThumb(scrollbar))
         paintTrackPiece(context, scrollbar, rect, ForwardTrackPart);
 }
 
-void ScrollbarThemeWin::paintTrackPiece(GraphicsContext* context, Scrollbar* scrollbar, const IntRect& rect, ScrollbarPart partType)
+void ScrollbarThemeWin::paintTrackPiece(GraphicsContext* context, ScrollbarThemeClient* scrollbar, const IntRect& rect, ScrollbarPart partType)
 {
     checkAndInitScrollbarTheme();
 
@@ -276,7 +276,7 @@ void ScrollbarThemeWin::paintTrackPiece(GraphicsContext* context, Scrollbar* scr
 #endif
 }
 
-void ScrollbarThemeWin::paintButton(GraphicsContext* context, Scrollbar* scrollbar, const IntRect& rect, ScrollbarPart part)
+void ScrollbarThemeWin::paintButton(GraphicsContext* context, ScrollbarThemeClient* scrollbar, const IntRect& rect, ScrollbarPart part)
 {
     checkAndInitScrollbarTheme();
 
@@ -339,7 +339,7 @@ static IntRect gripperRect(int thickness, const IntRect& thumbRect)
                    gripperThickness, gripperThickness);
 }
 
-static void paintGripper(Scrollbar* scrollbar, HDC hdc, const IntRect& rect)
+static void paintGripper(ScrollbarThemeClient* scrollbar, HDC hdc, const IntRect& rect)
 {
     if (!scrollbarTheme)
         return;  // Classic look has no gripper.
@@ -358,7 +358,7 @@ static void paintGripper(Scrollbar* scrollbar, HDC hdc, const IntRect& rect)
     DrawThemeBackground(scrollbarTheme, hdc, scrollbar->orientation() == HorizontalScrollbar ? SP_GRIPPERHOR : SP_GRIPPERVERT, state, &themeRect, 0);
 }
 
-void ScrollbarThemeWin::paintThumb(GraphicsContext* context, Scrollbar* scrollbar, const IntRect& rect)
+void ScrollbarThemeWin::paintThumb(GraphicsContext* context, ScrollbarThemeClient* scrollbar, const IntRect& rect)
 {
     checkAndInitScrollbarTheme();
 
index cd2f176..870240c 100644 (file)
@@ -42,20 +42,20 @@ public:
     virtual bool invalidateOnMouseEnterExit();
 
 protected:
-    virtual bool hasButtons(Scrollbar*) { return true; }
-    virtual bool hasThumb(Scrollbar*);
+    virtual bool hasButtons(ScrollbarThemeClient*) { return true; }
+    virtual bool hasThumb(ScrollbarThemeClient*);
 
-    virtual IntRect backButtonRect(Scrollbar*, ScrollbarPart, bool painting = false);
-    virtual IntRect forwardButtonRect(Scrollbar*, ScrollbarPart, bool painting = false);
-    virtual IntRect trackRect(Scrollbar*, bool painting = false);
+    virtual IntRect backButtonRect(ScrollbarThemeClient*, ScrollbarPart, bool painting = false);
+    virtual IntRect forwardButtonRect(ScrollbarThemeClient*, ScrollbarPart, bool painting = false);
+    virtual IntRect trackRect(ScrollbarThemeClient*, bool painting = false);
 
-    virtual bool shouldCenterOnThumb(Scrollbar*, const PlatformMouseEvent&);
-    virtual bool shouldSnapBackToDragOrigin(Scrollbar*, const PlatformMouseEvent&);
+    virtual bool shouldCenterOnThumb(ScrollbarThemeClient*, const PlatformMouseEvent&);
+    virtual bool shouldSnapBackToDragOrigin(ScrollbarThemeClient*, const PlatformMouseEvent&);
 
-    virtual void paintTrackBackground(GraphicsContext*, Scrollbar*, const IntRect&);
-    virtual void paintTrackPiece(GraphicsContext*, Scrollbar*, const IntRect&, ScrollbarPart);
-    virtual void paintButton(GraphicsContext*, Scrollbar*, const IntRect&, ScrollbarPart);
-    virtual void paintThumb(GraphicsContext*, Scrollbar*, const IntRect&);
+    virtual void paintTrackBackground(GraphicsContext*, ScrollbarThemeClient*, const IntRect&);
+    virtual void paintTrackPiece(GraphicsContext*, ScrollbarThemeClient*, const IntRect&, ScrollbarPart);
+    virtual void paintButton(GraphicsContext*, ScrollbarThemeClient*, const IntRect&, ScrollbarPart);
+    virtual void paintThumb(GraphicsContext*, ScrollbarThemeClient*, const IntRect&);
 };
 
 }
index c924978..badf315 100644 (file)
@@ -71,19 +71,19 @@ int ScrollbarThemeWx::scrollbarThickness(ScrollbarControlSize size)
     return thickness;
 }
 
-bool ScrollbarThemeWx::hasThumb(Scrollbar* scrollbar)
+bool ScrollbarThemeWx::hasThumb(ScrollbarThemeClient* scrollbar)
 {
     // This method is just called as a paint-time optimization to see if
     // painting the thumb can be skipped.  We don't have to be exact here.
     return thumbLength(scrollbar) > 0;
 }
 
-int ScrollbarThemeWx::minimumThumbLength(Scrollbar* scrollbar)
+int ScrollbarThemeWx::minimumThumbLength(ScrollbarThemeClient* scrollbar)
 {
     return 20;
 }
 
-IntSize ScrollbarThemeWx::buttonSize(Scrollbar*) 
+IntSize ScrollbarThemeWx::buttonSize(ScrollbarThemeClient*) 
 {
 #ifdef __WXMAC__
     return IntSize(20,20);
@@ -92,7 +92,7 @@ IntSize ScrollbarThemeWx::buttonSize(Scrollbar*)
 #endif
 }
 
-void ScrollbarThemeWx::splitTrack(Scrollbar* scrollbar, const IntRect& unconstrainedTrackRect, IntRect& beforeThumbRect, IntRect& thumbRect, IntRect& afterThumbRect)
+void ScrollbarThemeWx::splitTrack(ScrollbarThemeClient* scrollbar, const IntRect& unconstrainedTrackRect, IntRect& beforeThumbRect, IntRect& thumbRect, IntRect& afterThumbRect)
 {
     ScrollbarThemeComposite::splitTrack(scrollbar, unconstrainedTrackRect, beforeThumbRect, thumbRect, afterThumbRect);
 #ifdef __WXMAC__
@@ -109,7 +109,7 @@ void ScrollbarThemeWx::splitTrack(Scrollbar* scrollbar, const IntRect& unconstra
 #endif
 }
 
-IntRect ScrollbarThemeWx::backButtonRect(Scrollbar* scrollbar, ScrollbarPart part, bool)
+IntRect ScrollbarThemeWx::backButtonRect(ScrollbarThemeClient* scrollbar, ScrollbarPart part, bool)
 {
     // FIXME: Handling this case is needed when there are two sets of arrow buttons
     // on Mac, one at the top and one at the bottom.
@@ -130,7 +130,7 @@ IntRect ScrollbarThemeWx::backButtonRect(Scrollbar* scrollbar, ScrollbarPart par
     return IntRect(x, y, size.width(), size.height());
 }
 
-IntRect ScrollbarThemeWx::forwardButtonRect(Scrollbar* scrollbar, ScrollbarPart part, bool)
+IntRect ScrollbarThemeWx::forwardButtonRect(ScrollbarThemeClient* scrollbar, ScrollbarPart part, bool)
 {
     // FIXME: Handling this case is needed when there are two sets of arrow buttons
     // on Mac, one at the top and one at the bottom.
@@ -155,7 +155,7 @@ IntRect ScrollbarThemeWx::forwardButtonRect(Scrollbar* scrollbar, ScrollbarPart
     return IntRect(x, y, size.width(), size.height());
 }
 
-IntRect ScrollbarThemeWx::trackRect(Scrollbar* scrollbar, bool)
+IntRect ScrollbarThemeWx::trackRect(ScrollbarThemeClient* scrollbar, bool)
 {
     IntSize bs = buttonSize(scrollbar);
     int trackStart = 0;
@@ -179,11 +179,11 @@ IntRect ScrollbarThemeWx::trackRect(Scrollbar* scrollbar, bool)
     return IntRect(scrollbar->x(), scrollbar->y() + trackStart, thickness, scrollbar->height() - 2 * bs.height());
 }
 
-bool ScrollbarThemeWx::paint(Scrollbar* scrollbar, GraphicsContext* context, const IntRect& rect)
+bool ScrollbarThemeWx::paint(ScrollbarThemeClient* scrollbar, GraphicsContext* context, const IntRect& rect)
 {
     wxOrientation orientation = (scrollbar->orientation() == HorizontalScrollbar) ? wxHORIZONTAL : wxVERTICAL;
     int flags = 0;
-    if (scrollbar->scrollableArea()->isActive())
+    if (scrollbar->isScrollableAreaActive())
         flags |= wxCONTROL_FOCUSED;
     
     if (!scrollbar->enabled())
index 75ab175..372aaf9 100644 (file)
@@ -35,21 +35,21 @@ class ScrollbarThemeWx : public ScrollbarThemeComposite {
 public:
     virtual ~ScrollbarThemeWx();
     virtual int scrollbarThickness(ScrollbarControlSize = RegularScrollbar);
-    virtual bool paint(Scrollbar*, GraphicsContext*, const IntRect&);
+    virtual bool paint(ScrollbarThemeClient*, GraphicsContext*, const IntRect&);
     
 protected:
-    virtual bool hasButtons(Scrollbar*) { return true; }
-    virtual bool hasThumb(Scrollbar*);
+    virtual bool hasButtons(ScrollbarThemeClient*) { return true; }
+    virtual bool hasThumb(ScrollbarThemeClient*);
 
-    virtual IntSize buttonSize(Scrollbar*);
+    virtual IntSize buttonSize(ScrollbarThemeClient*);
 
-    virtual IntRect backButtonRect(Scrollbar*, ScrollbarPart, bool painting = false);
-    virtual IntRect forwardButtonRect(Scrollbar*, ScrollbarPart, bool painting = false);
-    virtual IntRect trackRect(Scrollbar*, bool painting = false);
+    virtual IntRect backButtonRect(ScrollbarThemeClient*, ScrollbarPart, bool painting = false);
+    virtual IntRect forwardButtonRect(ScrollbarThemeClient*, ScrollbarPart, bool painting = false);
+    virtual IntRect trackRect(ScrollbarThemeClient*, bool painting = false);
 
-    virtual void splitTrack(Scrollbar*, const IntRect& track, IntRect& startTrack, IntRect& thumb, IntRect& endTrack);
+    virtual void splitTrack(ScrollbarThemeClient*, const IntRect& track, IntRect& startTrack, IntRect& thumb, IntRect& endTrack);
     
-    virtual int minimumThumbLength(Scrollbar*);
+    virtual int minimumThumbLength(ScrollbarThemeClient*);
 };
 
 }
index 810c98f..7fe2fac 100644 (file)
@@ -85,7 +85,7 @@ private:
     HashMap<unsigned, RenderScrollbarPart*> m_parts;
 };
 
-inline RenderScrollbar* toRenderScrollbar(Scrollbar* scrollbar)
+inline RenderScrollbar* toRenderScrollbar(ScrollbarThemeClient* scrollbar)
 {
     ASSERT(!scrollbar || scrollbar->isCustomScrollbar());
     return static_cast<RenderScrollbar*>(scrollbar);
index 87309d4..44e2aa6 100644 (file)
@@ -26,6 +26,7 @@
 #include "config.h"
 #include "RenderScrollbarTheme.h"
 #include "RenderScrollbar.h"
+#include "ScrollbarThemeClient.h"
 #include <wtf/StdLibExtras.h>
 
 namespace WebCore {
@@ -36,7 +37,7 @@ RenderScrollbarTheme* RenderScrollbarTheme::renderScrollbarTheme()
     return &theme;
 }
 
-void RenderScrollbarTheme::buttonSizesAlongTrackAxis(Scrollbar* scrollbar, int& beforeSize, int& afterSize)
+void RenderScrollbarTheme::buttonSizesAlongTrackAxis(ScrollbarThemeClient* scrollbar, int& beforeSize, int& afterSize)
 {
     IntRect firstButton = backButtonRect(scrollbar, BackButtonStartPart);
     IntRect secondButton = forwardButtonRect(scrollbar, ForwardButtonStartPart);
@@ -51,7 +52,7 @@ void RenderScrollbarTheme::buttonSizesAlongTrackAxis(Scrollbar* scrollbar, int&
     }
 }
 
-bool RenderScrollbarTheme::hasButtons(Scrollbar* scrollbar)
+bool RenderScrollbarTheme::hasButtons(ScrollbarThemeClient* scrollbar)
 {
     int startSize;
     int endSize;
@@ -59,27 +60,27 @@ bool RenderScrollbarTheme::hasButtons(Scrollbar* scrollbar)
     return (startSize + endSize) <= (scrollbar->orientation() == HorizontalScrollbar ? scrollbar->width() : scrollbar->height());
 }
 
-bool RenderScrollbarTheme::hasThumb(Scrollbar* scrollbar)
+bool RenderScrollbarTheme::hasThumb(ScrollbarThemeClient* scrollbar)
 {
     return trackLength(scrollbar) - thumbLength(scrollbar) >= 0;
 }
 
-int RenderScrollbarTheme::minimumThumbLength(Scrollbar* scrollbar)
+int RenderScrollbarTheme::minimumThumbLength(ScrollbarThemeClient* scrollbar)
 {
     return toRenderScrollbar(scrollbar)->minimumThumbLength();
 }
 
-IntRect RenderScrollbarTheme::backButtonRect(Scrollbar* scrollbar, ScrollbarPart partType, bool)
+IntRect RenderScrollbarTheme::backButtonRect(ScrollbarThemeClient* scrollbar, ScrollbarPart partType, bool)
 {
     return toRenderScrollbar(scrollbar)->buttonRect(partType);
 }
 
-IntRect RenderScrollbarTheme::forwardButtonRect(Scrollbar* scrollbar, ScrollbarPart partType, bool)
+IntRect RenderScrollbarTheme::forwardButtonRect(ScrollbarThemeClient* scrollbar, ScrollbarPart partType, bool)
 {
     return toRenderScrollbar(scrollbar)->buttonRect(partType);
 }
 
-IntRect RenderScrollbarTheme::trackRect(Scrollbar* scrollbar, bool)
+IntRect RenderScrollbarTheme::trackRect(ScrollbarThemeClient* scrollbar, bool)
 {
     if (!hasButtons(scrollbar))
         return scrollbar->frameRect();
@@ -91,7 +92,7 @@ IntRect RenderScrollbarTheme::trackRect(Scrollbar* scrollbar, bool)
     return toRenderScrollbar(scrollbar)->trackRect(startLength, endLength);
 }
 
-IntRect RenderScrollbarTheme::constrainTrackRectToTrackPieces(Scrollbar* scrollbar, const IntRect& rect)
+IntRect RenderScrollbarTheme::constrainTrackRectToTrackPieces(ScrollbarThemeClient* scrollbar, const IntRect& rect)
 { 
     IntRect backRect = toRenderScrollbar(scrollbar)->trackPieceRectWithMargins(BackTrackPart, rect);
     IntRect forwardRect = toRenderScrollbar(scrollbar)->trackPieceRectWithMargins(ForwardTrackPart, rect);
@@ -112,27 +113,27 @@ void RenderScrollbarTheme::paintScrollCorner(ScrollView*, GraphicsContext* conte
     context->fillRect(cornerRect, Color::white, ColorSpaceDeviceRGB);
 }
 
-void RenderScrollbarTheme::paintScrollbarBackground(GraphicsContext* context, Scrollbar* scrollbar)
+void RenderScrollbarTheme::paintScrollbarBackground(GraphicsContext* context, ScrollbarThemeClient* scrollbar)
 {
     toRenderScrollbar(scrollbar)->paintPart(context, ScrollbarBGPart, scrollbar->frameRect());
 }
 
-void RenderScrollbarTheme::paintTrackBackground(GraphicsContext* context, Scrollbar* scrollbar, const IntRect& rect)
+void RenderScrollbarTheme::paintTrackBackground(GraphicsContext* context, ScrollbarThemeClient* scrollbar, const IntRect& rect)
 {
     toRenderScrollbar(scrollbar)->paintPart(context, TrackBGPart, rect);
 }
 
-void RenderScrollbarTheme::paintTrackPiece(GraphicsContext* context, Scrollbar* scrollbar, const IntRect& rect, ScrollbarPart part)
+void RenderScrollbarTheme::paintTrackPiece(GraphicsContext* context, ScrollbarThemeClient* scrollbar, const IntRect& rect, ScrollbarPart part)
 {
     toRenderScrollbar(scrollbar)->paintPart(context, part, rect);
 }
 
-void RenderScrollbarTheme::paintButton(GraphicsContext* context, Scrollbar* scrollbar, const IntRect& rect, ScrollbarPart part)
+void RenderScrollbarTheme::paintButton(GraphicsContext* context, ScrollbarThemeClient* scrollbar, const IntRect& rect, ScrollbarPart part)
 {
     toRenderScrollbar(scrollbar)->paintPart(context, part, rect);
 }
 
-void RenderScrollbarTheme::paintThumb(GraphicsContext* context, Scrollbar* scrollbar, const IntRect& rect)
+void RenderScrollbarTheme::paintThumb(GraphicsContext* context, ScrollbarThemeClient* scrollbar, const IntRect& rect)
 {
     toRenderScrollbar(scrollbar)->paintPart(context, ThumbPart, rect);
 }
index 70c24a5..9cef394 100644 (file)
@@ -46,35 +46,35 @@ public:
 
     virtual void paintScrollCorner(ScrollView*, GraphicsContext* context, const IntRect& cornerRect);
 
-    virtual bool shouldCenterOnThumb(Scrollbar* scrollbar, const PlatformMouseEvent& event) { return ScrollbarTheme::theme()->shouldCenterOnThumb(scrollbar, event); }
+    virtual bool shouldCenterOnThumb(ScrollbarThemeClient* scrollbar, const PlatformMouseEvent& event) { return ScrollbarTheme::theme()->shouldCenterOnThumb(scrollbar, event); }
     
     virtual double initialAutoscrollTimerDelay() { return ScrollbarTheme::theme()->initialAutoscrollTimerDelay(); }
     virtual double autoscrollTimerDelay() { return ScrollbarTheme::theme()->autoscrollTimerDelay(); }
 
-    virtual void registerScrollbar(Scrollbar* scrollbar) { return ScrollbarTheme::theme()->registerScrollbar(scrollbar); }
-    virtual void unregisterScrollbar(Scrollbar* scrollbar) { return ScrollbarTheme::theme()->unregisterScrollbar(scrollbar); }
+    virtual void registerScrollbar(ScrollbarThemeClient* scrollbar) { return ScrollbarTheme::theme()->registerScrollbar(scrollbar); }
+    virtual void unregisterScrollbar(ScrollbarThemeClient* scrollbar) { return ScrollbarTheme::theme()->unregisterScrollbar(scrollbar); }
 
-    virtual int minimumThumbLength(Scrollbar*);
+    virtual int minimumThumbLength(ScrollbarThemeClient*);
 
-    void buttonSizesAlongTrackAxis(Scrollbar* scrollbar, int& beforeSize, int& afterSize);
+    void buttonSizesAlongTrackAxis(ScrollbarThemeClient*, int& beforeSize, int& afterSize);
     
     static RenderScrollbarTheme* renderScrollbarTheme();
 
 protected:
-    virtual bool hasButtons(Scrollbar*);
-    virtual bool hasThumb(Scrollbar*);
+    virtual bool hasButtons(ScrollbarThemeClient*);
+    virtual bool hasThumb(ScrollbarThemeClient*);
 
-    virtual IntRect backButtonRect(Scrollbar*, ScrollbarPart, bool painting = false);
-    virtual IntRect forwardButtonRect(Scrollbar*, ScrollbarPart, bool painting = false);
-    virtual IntRect trackRect(Scrollbar*, bool painting = false);
+    virtual IntRect backButtonRect(ScrollbarThemeClient*, ScrollbarPart, bool painting = false);
+    virtual IntRect forwardButtonRect(ScrollbarThemeClient*, ScrollbarPart, bool painting = false);
+    virtual IntRect trackRect(ScrollbarThemeClient*, bool painting = false);
     
-    virtual void paintScrollbarBackground(GraphicsContext*, Scrollbar*);    
-    virtual void paintTrackBackground(GraphicsContext*, Scrollbar*, const IntRect&);
-    virtual void paintTrackPiece(GraphicsContext*, Scrollbar*, const IntRect&, ScrollbarPart);
-    virtual void paintButton(GraphicsContext*, Scrollbar*, const IntRect&, ScrollbarPart);
-    virtual void paintThumb(GraphicsContext*, Scrollbar*, const IntRect&);
+    virtual void paintScrollbarBackground(GraphicsContext*, ScrollbarThemeClient*);
+    virtual void paintTrackBackground(GraphicsContext*, ScrollbarThemeClient*, const IntRect&);
+    virtual void paintTrackPiece(GraphicsContext*, ScrollbarThemeClient*, const IntRect&, ScrollbarPart);
+    virtual void paintButton(GraphicsContext*, ScrollbarThemeClient*, const IntRect&, ScrollbarPart);
+    virtual void paintThumb(GraphicsContext*, ScrollbarThemeClient*, const IntRect&);
 
-    virtual IntRect constrainTrackRectToTrackPieces(Scrollbar*, const IntRect&);
+    virtual IntRect constrainTrackRectToTrackPieces(ScrollbarThemeClient*, const IntRect&);
 };
 
 } // namespace WebCore