Changeset 109451 in webkit
- Timestamp:
- Mar 1, 2012 3:36:21 PM (12 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 1 added
- 42 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r109450 r109451 1 2012-03-01 Peter Kotwicz <pkotwicz@google.com> 2 3 Decouple scrollbar painting from Scrollbar object 4 https://bugs.webkit.org/show_bug.cgi?id=78028 5 6 Reviewed by James Robinson. 7 8 Added interface ScrollbarThemeClient which Scrollbar inherits from. 9 This allows painting via ScrollbarTheme with a proxy to a Scrollbar 10 object. 11 12 * GNUmakefile.list.am: 13 * Target.pri: 14 * WebCore.gypi: 15 * WebCore.vcproj/WebCore.vcproj: 16 * WebCore.xcodeproj/project.pbxproj: 17 * platform/Scrollbar.cpp: 18 (WebCore::Scrollbar::scrollbarOverlayStyle): 19 (WebCore): 20 (WebCore::Scrollbar::getTickmarks): 21 (WebCore::Scrollbar::isScrollableAreaActive): 22 (WebCore::Scrollbar::isScrollViewScrollbar): 23 (WebCore::Scrollbar::setFrameRect): 24 * platform/Scrollbar.h: 25 (Scrollbar): 26 (WebCore::Scrollbar::x): 27 (WebCore::Scrollbar::y): 28 (WebCore::Scrollbar::width): 29 (WebCore::Scrollbar::height): 30 (WebCore::Scrollbar::size): 31 (WebCore::Scrollbar::location): 32 (WebCore::Scrollbar::parent): 33 (WebCore::Scrollbar::root): 34 (WebCore::Scrollbar::frameRect): 35 (WebCore::Scrollbar::invalidate): 36 (WebCore::Scrollbar::convertFromContainingWindow): 37 (WebCore::Scrollbar::isCustomScrollbar): 38 (WebCore::Scrollbar::orientation): 39 (WebCore::Scrollbar::value): 40 (WebCore::Scrollbar::currentPos): 41 (WebCore::Scrollbar::visibleSize): 42 (WebCore::Scrollbar::totalSize): 43 (WebCore::Scrollbar::maximum): 44 (WebCore::Scrollbar::controlSize): 45 (WebCore::Scrollbar::lineStep): 46 (WebCore::Scrollbar::pageStep): 47 (WebCore::Scrollbar::pressedPart): 48 (WebCore::Scrollbar::hoveredPart): 49 (WebCore::Scrollbar::styleChanged): 50 (WebCore::Scrollbar::enabled): 51 * platform/ScrollbarTheme.h: 52 (WebCore): 53 (WebCore::ScrollbarTheme::updateEnabledState): 54 (WebCore::ScrollbarTheme::paint): 55 (WebCore::ScrollbarTheme::hitTest): 56 (WebCore::ScrollbarTheme::updateScrollbarOverlayStyle): 57 (WebCore::ScrollbarTheme::invalidateParts): 58 (WebCore::ScrollbarTheme::invalidatePart): 59 (WebCore::ScrollbarTheme::shouldCenterOnThumb): 60 (WebCore::ScrollbarTheme::shouldSnapBackToDragOrigin): 61 (WebCore::ScrollbarTheme::shouldDragDocumentInsteadOfThumb): 62 (WebCore::ScrollbarTheme::thumbPosition): 63 (WebCore::ScrollbarTheme::thumbLength): 64 (WebCore::ScrollbarTheme::trackPosition): 65 (WebCore::ScrollbarTheme::trackLength): 66 (WebCore::ScrollbarTheme::registerScrollbar): 67 (WebCore::ScrollbarTheme::unregisterScrollbar): 68 * platform/ScrollbarThemeClient.h: Added. 69 (WebCore): 70 (ScrollbarThemeClient): 71 (WebCore::ScrollbarThemeClient::~ScrollbarThemeClient): 72 * platform/ScrollbarThemeComposite.cpp: 73 (WebCore::ScrollbarThemeComposite::paint): 74 (WebCore::ScrollbarThemeComposite::hitTest): 75 (WebCore::ScrollbarThemeComposite::invalidatePart): 76 (WebCore::ScrollbarThemeComposite::splitTrack): 77 (WebCore::usedTotalSize): 78 (WebCore::ScrollbarThemeComposite::thumbPosition): 79 (WebCore::ScrollbarThemeComposite::thumbLength): 80 (WebCore::ScrollbarThemeComposite::minimumThumbLength): 81 (WebCore::ScrollbarThemeComposite::trackPosition): 82 (WebCore::ScrollbarThemeComposite::trackLength): 83 * platform/ScrollbarThemeComposite.h: 84 (ScrollbarThemeComposite): 85 (WebCore::ScrollbarThemeComposite::paintScrollbarBackground): 86 (WebCore::ScrollbarThemeComposite::paintTrackBackground): 87 (WebCore::ScrollbarThemeComposite::paintTrackPiece): 88 (WebCore::ScrollbarThemeComposite::paintButton): 89 (WebCore::ScrollbarThemeComposite::paintThumb): 90 (WebCore::ScrollbarThemeComposite::paintTickmarks): 91 (WebCore::ScrollbarThemeComposite::constrainTrackRectToTrackPieces): 92 * platform/chromium/ScrollbarThemeChromium.cpp: 93 (WebCore::ScrollbarThemeChromium::hasThumb): 94 (WebCore::ScrollbarThemeChromium::backButtonRect): 95 (WebCore::ScrollbarThemeChromium::forwardButtonRect): 96 (WebCore::ScrollbarThemeChromium::trackRect): 97 (WebCore::ScrollbarThemeChromium::paintTrackBackground): 98 (WebCore::ScrollbarThemeChromium::paintTickmarks): 99 * platform/chromium/ScrollbarThemeChromium.h: 100 (WebCore::ScrollbarThemeChromium::hasButtons): 101 (ScrollbarThemeChromium): 102 * platform/chromium/ScrollbarThemeChromiumAndroid.cpp: 103 (WebCore::ScrollbarThemeChromiumAndroid::paintScrollbarBackground): 104 (WebCore::ScrollbarThemeChromiumAndroid::shouldCenterOnThumb): 105 (WebCore::ScrollbarThemeChromiumAndroid::buttonSize): 106 (WebCore::ScrollbarThemeChromiumAndroid::minimumThumbLength): 107 * platform/chromium/ScrollbarThemeChromiumAndroid.h: 108 (ScrollbarThemeChromiumAndroid): 109 * platform/chromium/ScrollbarThemeChromiumLinux.cpp: 110 (WebCore::ScrollbarThemeChromiumLinux::paintTrackPiece): 111 (WebCore::ScrollbarThemeChromiumLinux::paintButton): 112 (WebCore::ScrollbarThemeChromiumLinux::paintThumb): 113 (WebCore::ScrollbarThemeChromiumLinux::shouldCenterOnThumb): 114 (WebCore::ScrollbarThemeChromiumLinux::buttonSize): 115 (WebCore::ScrollbarThemeChromiumLinux::minimumThumbLength): 116 * platform/chromium/ScrollbarThemeChromiumLinux.h: 117 (ScrollbarThemeChromiumLinux): 118 * platform/chromium/ScrollbarThemeChromiumMac.h: 119 (ScrollbarThemeChromiumMac): 120 * platform/chromium/ScrollbarThemeChromiumMac.mm: 121 (WebCore::scrollbarStateToThemeState): 122 (WebCore::ScrollbarThemeChromiumMac::paint): 123 (WebCore::ScrollbarThemeChromiumMac::paintGivenTickmarks): 124 * platform/chromium/ScrollbarThemeChromiumWin.cpp: 125 (WebCore::ScrollbarThemeChromiumWin::shouldSnapBackToDragOrigin): 126 (WebCore::ScrollbarThemeChromiumWin::paintTrackPiece): 127 (WebCore::ScrollbarThemeChromiumWin::paintButton): 128 (WebCore::ScrollbarThemeChromiumWin::paintThumb): 129 (WebCore::ScrollbarThemeChromiumWin::getThemeState): 130 (WebCore::ScrollbarThemeChromiumWin::getThemeArrowState): 131 (WebCore::ScrollbarThemeChromiumWin::getClassicThemeState): 132 (WebCore::ScrollbarThemeChromiumWin::shouldCenterOnThumb): 133 (WebCore::ScrollbarThemeChromiumWin::buttonSize): 134 * platform/chromium/ScrollbarThemeChromiumWin.h: 135 (ScrollbarThemeChromiumWin): 136 * platform/efl/ScrollbarThemeEfl.cpp: 137 (WebCore::ScrollbarThemeEfl::registerScrollbar): 138 (WebCore::ScrollbarThemeEfl::unregisterScrollbar): 139 * platform/efl/ScrollbarThemeEfl.h: 140 (ScrollbarThemeEfl): 141 * platform/gtk/ScrollbarThemeGtk.cpp: 142 (WebCore): 143 (WebCore::ScrollbarThemeGtk::registerScrollbar): 144 (WebCore::ScrollbarThemeGtk::unregisterScrollbar): 145 (WebCore::ScrollbarThemeGtk::updateScrollbarsFrameThickness): 146 (WebCore::ScrollbarThemeGtk::hasThumb): 147 (WebCore::ScrollbarThemeGtk::backButtonRect): 148 (WebCore::ScrollbarThemeGtk::forwardButtonRect): 149 (WebCore::ScrollbarThemeGtk::trackRect): 150 (WebCore::ScrollbarThemeGtk::thumbRect): 151 (WebCore::ScrollbarThemeGtk::paint): 152 (WebCore::ScrollbarThemeGtk::shouldCenterOnThumb): 153 (WebCore::ScrollbarThemeGtk::buttonSize): 154 (WebCore::ScrollbarThemeGtk::minimumThumbLength): 155 * platform/gtk/ScrollbarThemeGtk.h: 156 (WebCore::ScrollbarThemeGtk::hasButtons): 157 (ScrollbarThemeGtk): 158 * platform/gtk/ScrollbarThemeGtk2.cpp: 159 (WebCore::getWidgetForScrollbar): 160 (WebCore::ScrollbarThemeGtk::paintTrackBackground): 161 (WebCore::ScrollbarThemeGtk::paintScrollbarBackground): 162 (WebCore::ScrollbarThemeGtk::paintThumb): 163 (WebCore::ScrollbarThemeGtk::paintButton): 164 * platform/gtk/ScrollbarThemeGtk3.cpp: 165 (WebCore::ScrollbarThemeGtk::paintTrackBackground): 166 (WebCore::ScrollbarThemeGtk::paintScrollbarBackground): 167 (WebCore::ScrollbarThemeGtk::paintThumb): 168 (WebCore::ScrollbarThemeGtk::paintButton): 169 * platform/mac/ScrollbarThemeMac.h: 170 (ScrollbarThemeMac): 171 * platform/mac/ScrollbarThemeMac.mm: 172 (WebCore): 173 (WebCore::ScrollbarThemeMac::registerScrollbar): 174 (WebCore::ScrollbarThemeMac::unregisterScrollbar): 175 (WebCore::ScrollbarThemeMac::setNewPainterForScrollbar): 176 (WebCore::ScrollbarThemeMac::painterForScrollbar): 177 (WebCore::ScrollbarThemeMac::updateScrollbarOverlayStyle): 178 (WebCore::ScrollbarThemeMac::hasButtons): 179 (WebCore::ScrollbarThemeMac::hasThumb): 180 (WebCore::ScrollbarThemeMac::backButtonRect): 181 (WebCore::ScrollbarThemeMac::forwardButtonRect): 182 (WebCore::ScrollbarThemeMac::trackRect): 183 (WebCore::ScrollbarThemeMac::minimumThumbLength): 184 (WebCore::ScrollbarThemeMac::shouldCenterOnThumb): 185 (WebCore::ScrollbarThemeMac::shouldDragDocumentInsteadOfThumb): 186 (WebCore::ScrollbarThemeMac::updateEnabledState): 187 (WebCore::ScrollbarThemeMac::paint): 188 * platform/mock/ScrollbarThemeMock.cpp: 189 (WebCore::ScrollbarThemeMock::trackRect): 190 (WebCore::ScrollbarThemeMock::paintTrackBackground): 191 (WebCore::ScrollbarThemeMock::paintThumb): 192 * platform/mock/ScrollbarThemeMock.h: 193 (WebCore::ScrollbarThemeMock::hasButtons): 194 (WebCore::ScrollbarThemeMock::hasThumb): 195 (WebCore::ScrollbarThemeMock::backButtonRect): 196 (WebCore::ScrollbarThemeMock::forwardButtonRect): 197 (ScrollbarThemeMock): 198 * platform/qt/ScrollbarThemeQt.cpp: 199 (WebCore::styleOptionSlider): 200 (WebCore::ScrollbarThemeQt::paint): 201 (WebCore::ScrollbarThemeQt::hitTest): 202 (WebCore::ScrollbarThemeQt::shouldCenterOnThumb): 203 (WebCore::ScrollbarThemeQt::invalidatePart): 204 (WebCore::ScrollbarThemeQt::thumbPosition): 205 (WebCore::ScrollbarThemeQt::thumbLength): 206 (WebCore::ScrollbarThemeQt::trackPosition): 207 (WebCore::ScrollbarThemeQt::trackLength): 208 * platform/qt/ScrollbarThemeQt.h: 209 (ScrollbarThemeQt): 210 * platform/win/ScrollbarThemeSafari.cpp: 211 (WebCore::ScrollbarThemeSafari::hasButtons): 212 (WebCore::ScrollbarThemeSafari::hasThumb): 213 (WebCore::ScrollbarThemeSafari::backButtonRect): 214 (WebCore::ScrollbarThemeSafari::forwardButtonRect): 215 (WebCore::ScrollbarThemeSafari::trackRect): 216 (WebCore::ScrollbarThemeSafari::minimumThumbLength): 217 (WebCore::ScrollbarThemeSafari::shouldCenterOnThumb): 218 (WebCore::ScrollbarThemeSafari::paintTrackBackground): 219 (WebCore::ScrollbarThemeSafari::paintButton): 220 (WebCore::ScrollbarThemeSafari::paintThumb): 221 * platform/win/ScrollbarThemeSafari.h: 222 (ScrollbarThemeSafari): 223 * platform/win/ScrollbarThemeWin.cpp: 224 (WebCore::ScrollbarThemeWin::hasThumb): 225 (WebCore::ScrollbarThemeWin::backButtonRect): 226 (WebCore::ScrollbarThemeWin::forwardButtonRect): 227 (WebCore::ScrollbarThemeWin::trackRect): 228 (WebCore::ScrollbarThemeWin::shouldCenterOnThumb): 229 (WebCore::ScrollbarThemeWin::shouldSnapBackToDragOrigin): 230 (WebCore::ScrollbarThemeWin::paintTrackBackground): 231 (WebCore::ScrollbarThemeWin::paintTrackPiece): 232 (WebCore::ScrollbarThemeWin::paintButton): 233 (WebCore::paintGripper): 234 (WebCore::ScrollbarThemeWin::paintThumb): 235 * platform/win/ScrollbarThemeWin.h: 236 (WebCore::ScrollbarThemeWin::hasButtons): 237 (ScrollbarThemeWin): 238 * platform/wx/ScrollbarThemeWx.cpp: 239 (WebCore::ScrollbarThemeWx::hasThumb): 240 (WebCore::ScrollbarThemeWx::minimumThumbLength): 241 (WebCore::ScrollbarThemeWx::buttonSize): 242 (WebCore::ScrollbarThemeWx::splitTrack): 243 (WebCore::ScrollbarThemeWx::backButtonRect): 244 (WebCore::ScrollbarThemeWx::forwardButtonRect): 245 (WebCore::ScrollbarThemeWx::trackRect): 246 (WebCore::ScrollbarThemeWx::paint): 247 * platform/wx/ScrollbarThemeWx.h: 248 (ScrollbarThemeWx): 249 (WebCore::ScrollbarThemeWx::hasButtons): 250 * rendering/RenderScrollbar.h: 251 (WebCore::toRenderScrollbar): 252 * rendering/RenderScrollbarTheme.cpp: 253 (WebCore::RenderScrollbarTheme::buttonSizesAlongTrackAxis): 254 (WebCore::RenderScrollbarTheme::hasButtons): 255 (WebCore::RenderScrollbarTheme::hasThumb): 256 (WebCore::RenderScrollbarTheme::minimumThumbLength): 257 (WebCore::RenderScrollbarTheme::backButtonRect): 258 (WebCore::RenderScrollbarTheme::forwardButtonRect): 259 (WebCore::RenderScrollbarTheme::trackRect): 260 (WebCore::RenderScrollbarTheme::constrainTrackRectToTrackPieces): 261 (WebCore::RenderScrollbarTheme::paintScrollbarBackground): 262 (WebCore::RenderScrollbarTheme::paintTrackBackground): 263 (WebCore::RenderScrollbarTheme::paintTrackPiece): 264 (WebCore::RenderScrollbarTheme::paintButton): 265 (WebCore::RenderScrollbarTheme::paintThumb): 266 * rendering/RenderScrollbarTheme.h: 267 (WebCore::RenderScrollbarTheme::shouldCenterOnThumb): 268 (WebCore::RenderScrollbarTheme::registerScrollbar): 269 (WebCore::RenderScrollbarTheme::unregisterScrollbar): 270 (RenderScrollbarTheme): 271 1 272 2012-03-01 Luke Macpherson <macpherson@chromium.org> 2 273 -
trunk/Source/WebCore/GNUmakefile.list.am
r109319 r109451 3331 3331 Source/WebCore/platform/Scrollbar.cpp \ 3332 3332 Source/WebCore/platform/Scrollbar.h \ 3333 Source/WebCore/platform/ScrollbarThemeClient.h \ 3333 3334 Source/WebCore/platform/ScrollbarThemeComposite.cpp \ 3334 3335 Source/WebCore/platform/ScrollbarThemeComposite.h \ -
trunk/Source/WebCore/Target.pri
r109346 r109451 2280 2280 platform/ScrollAnimator.h \ 2281 2281 platform/Scrollbar.h \ 2282 platform/ScrollbarThemeClient.h \ 2282 2283 platform/ScrollbarThemeComposite.h \ 2283 2284 platform/ScrollView.h \ -
trunk/Source/WebCore/WebCore.gypi
r109319 r109451 292 292 'platform/Scrollbar.h', 293 293 'platform/ScrollbarTheme.h', 294 'platform/ScrollbarThemeClient.h', 294 295 'platform/SearchPopupMenu.h', 295 296 'platform/SharedBuffer.h', -
trunk/Source/WebCore/WebCore.vcproj/WebCore.vcproj
r109319 r109451 27035 27035 </File> 27036 27036 <File 27037 RelativePath="..\platform\ScrollbarThemeClient.h" 27038 > 27039 </File> 27040 <File 27037 27041 RelativePath="..\platform\ScrollbarThemeComposite.cpp" 27038 27042 > -
trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj
r109319 r109451 5609 5609 C5E9B67710697E1300C7BB1A /* StorageEventDispatcher.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C5E9B67610697E1300C7BB1A /* StorageEventDispatcher.cpp */; }; 5610 5610 C5EBDD84105EDDEC0056816F /* StorageEventDispatcher.h in Headers */ = {isa = PBXBuildFile; fileRef = C5EBDD81105EDDEC0056816F /* StorageEventDispatcher.h */; }; 5611 C6B31B2E14F841FB0089F23F /* ScrollbarThemeClient.h in Headers */ = {isa = PBXBuildFile; fileRef = C691614714F6EBA70046375C /* ScrollbarThemeClient.h */; settings = {ATTRIBUTES = (Private, ); }; }; 5611 5612 C6D74AD509AA282E000B0A52 /* ModifySelectionListLevel.h in Headers */ = {isa = PBXBuildFile; fileRef = C6D74AD309AA282E000B0A52 /* ModifySelectionListLevel.h */; }; 5612 5613 C6D74AE409AA290A000B0A52 /* ModifySelectionListLevel.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C6D74AE309AA290A000B0A52 /* ModifySelectionListLevel.cpp */; }; … … 12601 12602 C5F765B414E1D414006C899B /* PasteboardStrategy.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PasteboardStrategy.h; sourceTree = "<group>"; }; 12602 12603 C5F765BA14E1ECF4006C899B /* PlatformPasteboardMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = PlatformPasteboardMac.mm; sourceTree = "<group>"; }; 12604 C691614714F6EBA70046375C /* ScrollbarThemeClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ScrollbarThemeClient.h; sourceTree = "<group>"; }; 12603 12605 C6D74AD309AA282E000B0A52 /* ModifySelectionListLevel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ModifySelectionListLevel.h; sourceTree = "<group>"; }; 12604 12606 C6D74AE309AA290A000B0A52 /* ModifySelectionListLevel.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ModifySelectionListLevel.cpp; sourceTree = "<group>"; }; … … 19940 19942 BC7B2AF80450824100A8000F /* Scrollbar.h */, 19941 19943 0FE71415142189FC00DB33BA /* ScrollbarTheme.cpp */, 19944 C691614714F6EBA70046375C /* ScrollbarThemeClient.h */, 19942 19945 BC8B854A0E7C7F5600AB6984 /* ScrollbarTheme.h */, 19943 19946 BC1402880E83680800319717 /* ScrollbarThemeComposite.cpp */, … … 23715 23718 BCAE1FA712939DB7004CB026 /* ScrollAnimatorMac.h in Headers */, 23716 23719 93F199B808245E59001E9ABC /* Scrollbar.h in Headers */, 23720 C6B31B2E14F841FB0089F23F /* ScrollbarThemeClient.h in Headers */, 23717 23721 BC8B854B0E7C7F5600AB6984 /* ScrollbarTheme.h in Headers */, 23718 23722 BC14028B0E83680800319717 /* ScrollbarThemeComposite.h in Headers */, -
trunk/Source/WebCore/platform/Scrollbar.cpp
r105006 r109451 113 113 } 114 114 115 ScrollbarOverlayStyle Scrollbar::scrollbarOverlayStyle() const 116 { 117 return m_scrollableArea ? ScrollbarOverlayStyleDefault : m_scrollableArea->scrollbarOverlayStyle(); 118 } 119 120 void Scrollbar::getTickmarks(Vector<IntRect>& tickmarks) const 121 { 122 if (m_scrollableArea) 123 m_scrollableArea->getTickmarks(tickmarks); 124 } 125 126 bool Scrollbar::isScrollableAreaActive() const 127 { 128 return m_scrollableArea && m_scrollableArea->isActive(); 129 } 130 131 bool Scrollbar::isScrollViewScrollbar() const 132 { 133 return parent() && parent()->isFrameView() && static_cast<FrameView*>(parent())->isScrollViewScrollbar(this); 134 } 135 115 136 void Scrollbar::offsetDidChange() 116 137 { … … 435 456 void Scrollbar::setFrameRect(const IntRect& rect) 436 457 { 437 // Get our window resizer rect and see if we overlap. 458 // Get our window resizer rect and see if we overlap. Adjust to avoid the overlap 438 459 // if necessary. 439 460 IntRect adjustedRect(rect); -
trunk/Source/WebCore/platform/Scrollbar.h
r108498 r109451 27 27 #define Scrollbar_h 28 28 29 #include "ScrollbarThemeClient.h" 29 30 #include "ScrollTypes.h" 30 31 #include "Timer.h" … … 41 42 class ScrollbarTheme; 42 43 43 class Scrollbar : public Widget { 44 class Scrollbar : public Widget, 45 public ScrollbarThemeClient { 46 44 47 public: 45 48 // 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. … … 48 51 virtual ~Scrollbar(); 49 52 53 // ScrollbarThemeClient implementation. 54 virtual int x() const { return Widget::x(); } 55 virtual int y() const { return Widget::y(); } 56 virtual int width() const { return Widget::width(); } 57 virtual int height() const { return Widget::height(); } 58 virtual IntSize size() const { return Widget::size(); } 59 virtual IntPoint location() const { return Widget::location(); } 60 61 virtual ScrollView* parent() const { return Widget::parent(); } 62 virtual ScrollView* root() const { return Widget::root(); } 63 64 virtual void setFrameRect(const IntRect&); 65 virtual IntRect frameRect() const { return Widget::frameRect(); } 66 67 virtual void invalidate() { Widget::invalidate(); } 68 virtual void invalidateRect(const IntRect&); 69 70 virtual ScrollbarOverlayStyle scrollbarOverlayStyle() const; 71 virtual void getTickmarks(Vector<IntRect>&) const; 72 virtual bool isScrollableAreaActive() const; 73 virtual bool isScrollViewScrollbar() const; 74 75 virtual IntPoint convertFromContainingWindow(const IntPoint& windowPoint) { return Widget::convertFromContainingWindow(windowPoint); } 76 77 virtual bool isCustomScrollbar() const { return false; } 78 virtual ScrollbarOrientation orientation() const { return m_orientation; } 79 80 virtual int value() const { return lroundf(m_currentPos); } 81 virtual float currentPos() const { return m_currentPos; } 82 virtual int visibleSize() const { return m_visibleSize; } 83 virtual int totalSize() const { return m_totalSize; } 84 virtual int maximum() const { return m_totalSize - m_visibleSize; } 85 virtual ScrollbarControlSize controlSize() const { return m_controlSize; } 86 87 virtual int lineStep() const { return m_lineStep; } 88 virtual int pageStep() const { return m_pageStep; } 89 90 virtual ScrollbarPart pressedPart() const { return m_pressedPart; } 91 virtual ScrollbarPart hoveredPart() const { return m_hoveredPart; } 92 93 virtual void styleChanged() { } 94 95 virtual bool enabled() const { return m_enabled; } 96 virtual void setEnabled(bool); 97 50 98 // Called by the ScrollableArea when the scroll offset changes. 51 99 void offsetDidChange(); … … 58 106 ScrollableArea* scrollableArea() const { return m_scrollableArea; } 59 107 60 virtual bool isCustomScrollbar() const { return false; }61 ScrollbarOrientation orientation() const { return m_orientation; }62 63 int value() const { return lroundf(m_currentPos); }64 float currentPos() const { return m_currentPos; }65 108 int pressedPos() const { return m_pressedPos; } 66 int visibleSize() const { return m_visibleSize; } 67 int totalSize() const { return m_totalSize; } 68 int maximum() const { return m_totalSize - m_visibleSize; } 69 ScrollbarControlSize controlSize() const { return m_controlSize; } 70 71 int lineStep() const { return m_lineStep; } 72 int pageStep() const { return m_pageStep; } 109 73 110 float pixelStep() const { return m_pixelStep; } 74 111 75 ScrollbarPart pressedPart() const { return m_pressedPart; }76 ScrollbarPart hoveredPart() const { return m_hoveredPart; }77 112 virtual void setHoveredPart(ScrollbarPart); 78 113 virtual void setPressedPart(ScrollbarPart); … … 81 116 void setProportion(int visibleSize, int totalSize); 82 117 void setPressedPos(int p) { m_pressedPos = p; } 83 118 84 119 virtual void paint(GraphicsContext*, const IntRect& damageRect); 85 86 bool enabled() const { return m_enabled; }87 virtual void setEnabled(bool e);88 120 89 121 virtual bool isOverlayScrollbar() const; … … 98 130 void mouseEntered(); 99 131 bool mouseExited(); 100 132 101 133 // Used by some platform scrollbars to know when they've been released from capture. 102 134 bool mouseUp(const PlatformMouseEvent&); … … 107 139 108 140 virtual void setParent(ScrollView*); 109 virtual void setFrameRect(const IntRect&); 110 111 virtual void invalidateRect(const IntRect&); 112 141 113 142 bool suppressInvalidation() const { return m_suppressInvalidation; } 114 143 void setSuppressInvalidation(bool s) { m_suppressInvalidation = s; } 115 144 116 virtual void styleChanged() { }117 118 145 virtual IntRect convertToContainingView(const IntRect&) const; 119 146 virtual IntRect convertFromContainingView(const IntRect&) const; 120 147 121 148 virtual IntPoint convertToContainingView(const IntPoint&) const; 122 149 virtual IntPoint convertFromContainingView(const IntPoint&) const; … … 161 188 Timer<Scrollbar> m_scrollTimer; 162 189 bool m_overlapsResizer; 163 190 164 191 bool m_suppressInvalidation; 165 192 -
trunk/Source/WebCore/platform/ScrollbarTheme.h
r107119 r109451 34 34 35 35 class PlatformMouseEvent; 36 class Scrollbar ;36 class ScrollbarThemeClient; 37 37 class ScrollView; 38 38 … … 47 47 virtual ~ScrollbarTheme() {}; 48 48 49 virtual void updateEnabledState(Scrollbar *) { };49 virtual void updateEnabledState(ScrollbarThemeClient*) { }; 50 50 51 virtual bool paint(Scrollbar *, GraphicsContext*, const IntRect& /*damageRect*/) { return false; }52 virtual ScrollbarPart hitTest(Scrollbar *, const PlatformMouseEvent&) { return NoPart; }51 virtual bool paint(ScrollbarThemeClient*, GraphicsContext*, const IntRect& /*damageRect*/) { return false; } 52 virtual ScrollbarPart hitTest(ScrollbarThemeClient*, const PlatformMouseEvent&) { return NoPart; } 53 53 54 54 virtual int scrollbarThickness(ScrollbarControlSize = RegularScrollbar) { return 0; } … … 58 58 virtual bool supportsControlTints() const { return false; } 59 59 virtual bool usesOverlayScrollbars() const { return false; } 60 virtual void updateScrollbarOverlayStyle(Scrollbar *) { }60 virtual void updateScrollbarOverlayStyle(ScrollbarThemeClient*) { } 61 61 62 62 virtual void themeChanged() {} … … 64 64 virtual bool invalidateOnMouseEnterExit() { return false; } 65 65 66 void invalidateParts(Scrollbar * scrollbar, ScrollbarControlPartMask mask)66 void invalidateParts(ScrollbarThemeClient* scrollbar, ScrollbarControlPartMask mask) 67 67 { 68 68 if (mask & BackButtonStartPart) … … 82 82 } 83 83 84 virtual void invalidatePart(Scrollbar *, ScrollbarPart) {}84 virtual void invalidatePart(ScrollbarThemeClient*, ScrollbarPart) { } 85 85 86 86 virtual void paintScrollCorner(ScrollView*, GraphicsContext* context, const IntRect& cornerRect) { defaultPaintScrollCorner(context, cornerRect); } … … 94 94 #endif 95 95 96 virtual bool shouldCenterOnThumb(Scrollbar *, const PlatformMouseEvent&) { return false; }97 virtual bool shouldSnapBackToDragOrigin(Scrollbar *, const PlatformMouseEvent&) { return false; }98 virtual bool shouldDragDocumentInsteadOfThumb(Scrollbar *, const PlatformMouseEvent&) { return false; }99 virtual int thumbPosition(Scrollbar *) { return 0; } // The position of the thumb relative to the track.100 virtual int thumbLength(Scrollbar *) { return 0; } // The length of the thumb along the axis of the scrollbar.101 virtual int trackPosition(Scrollbar *) { return 0; } // The position of the track relative to the scrollbar.102 virtual int trackLength(Scrollbar *) { return 0; } // The length of the track along the axis of the scrollbar.96 virtual bool shouldCenterOnThumb(ScrollbarThemeClient*, const PlatformMouseEvent&) { return false; } 97 virtual bool shouldSnapBackToDragOrigin(ScrollbarThemeClient*, const PlatformMouseEvent&) { return false; } 98 virtual bool shouldDragDocumentInsteadOfThumb(ScrollbarThemeClient*, const PlatformMouseEvent&) { return false; } 99 virtual int thumbPosition(ScrollbarThemeClient*) { return 0; } // The position of the thumb relative to the track. 100 virtual int thumbLength(ScrollbarThemeClient*) { return 0; } // The length of the thumb along the axis of the scrollbar. 101 virtual int trackPosition(ScrollbarThemeClient*) { return 0; } // The position of the track relative to the scrollbar. 102 virtual int trackLength(ScrollbarThemeClient*) { return 0; } // The length of the track along the axis of the scrollbar. 103 103 104 104 virtual int maxOverlapBetweenPages() { return std::numeric_limits<int>::max(); } … … 107 107 virtual double autoscrollTimerDelay() { return 0.05; } 108 108 109 virtual void registerScrollbar(Scrollbar *) {}110 virtual void unregisterScrollbar(Scrollbar *) {}109 virtual void registerScrollbar(ScrollbarThemeClient*) { } 110 virtual void unregisterScrollbar(ScrollbarThemeClient*) { } 111 111 112 112 virtual bool isMockTheme() const { return false; } -
trunk/Source/WebCore/platform/ScrollbarThemeComposite.cpp
r108541 r109451 34 34 #include "Page.h" 35 35 #include "PlatformMouseEvent.h" 36 #include "Scrollbar.h" 37 #include "ScrollableArea.h" 36 #include "ScrollbarThemeClient.h" 38 37 #include "Settings.h" 39 38 … … 42 41 namespace WebCore { 43 42 44 bool ScrollbarThemeComposite::paint(Scrollbar * scrollbar, GraphicsContext* graphicsContext, const IntRect& damageRect)43 bool ScrollbarThemeComposite::paint(ScrollbarThemeClient* scrollbar, GraphicsContext* graphicsContext, const IntRect& damageRect) 45 44 { 46 45 // Create the ScrollbarControlPartMask based on the damageRect … … 117 116 } 118 117 119 ScrollbarPart ScrollbarThemeComposite::hitTest(Scrollbar * scrollbar, const PlatformMouseEvent& evt)118 ScrollbarPart ScrollbarThemeComposite::hitTest(ScrollbarThemeClient* scrollbar, const PlatformMouseEvent& evt) 120 119 { 121 120 ScrollbarPart result = NoPart; … … 156 155 } 157 156 158 void ScrollbarThemeComposite::invalidatePart(Scrollbar * scrollbar, ScrollbarPart part)157 void ScrollbarThemeComposite::invalidatePart(ScrollbarThemeClient* scrollbar, ScrollbarPart part) 159 158 { 160 159 if (part == NoPart) … … 196 195 } 197 196 198 void ScrollbarThemeComposite::splitTrack(Scrollbar * scrollbar, const IntRect& unconstrainedTrackRect, IntRect& beforeThumbRect, IntRect& thumbRect, IntRect& afterThumbRect)197 void ScrollbarThemeComposite::splitTrack(ScrollbarThemeClient* scrollbar, const IntRect& unconstrainedTrackRect, IntRect& beforeThumbRect, IntRect& thumbRect, IntRect& afterThumbRect) 199 198 { 200 199 // This function won't even get called unless we're big enough to have some combination of these three rects where at least … … 216 215 // Returns the size represented by track taking into account scrolling past 217 216 // the end of the document. 218 static float usedTotalSize(Scrollbar * scrollbar)217 static float usedTotalSize(ScrollbarThemeClient* scrollbar) 219 218 { 220 219 float overhangAtStart = -scrollbar->currentPos(); … … 224 223 } 225 224 226 int ScrollbarThemeComposite::thumbPosition(Scrollbar * scrollbar)225 int ScrollbarThemeComposite::thumbPosition(ScrollbarThemeClient* scrollbar) 227 226 { 228 227 if (scrollbar->enabled()) { … … 237 236 } 238 237 239 int ScrollbarThemeComposite::thumbLength(Scrollbar * scrollbar)238 int ScrollbarThemeComposite::thumbLength(ScrollbarThemeClient* scrollbar) 240 239 { 241 240 if (!scrollbar->enabled()) … … 251 250 } 252 251 253 int ScrollbarThemeComposite::minimumThumbLength(Scrollbar * scrollbar)252 int ScrollbarThemeComposite::minimumThumbLength(ScrollbarThemeClient* scrollbar) 254 253 { 255 254 return scrollbarThickness(scrollbar->controlSize()); 256 255 } 257 256 258 int ScrollbarThemeComposite::trackPosition(Scrollbar * scrollbar)257 int ScrollbarThemeComposite::trackPosition(ScrollbarThemeClient* scrollbar) 259 258 { 260 259 IntRect constrainedTrackRect = constrainTrackRectToTrackPieces(scrollbar, trackRect(scrollbar)); … … 262 261 } 263 262 264 int ScrollbarThemeComposite::trackLength(Scrollbar * scrollbar)263 int ScrollbarThemeComposite::trackLength(ScrollbarThemeClient* scrollbar) 265 264 { 266 265 IntRect constrainedTrackRect = constrainTrackRectToTrackPieces(scrollbar, trackRect(scrollbar)); -
trunk/Source/WebCore/platform/ScrollbarThemeComposite.h
r95901 r109451 33 33 class ScrollbarThemeComposite : public ScrollbarTheme { 34 34 public: 35 virtual bool paint(Scrollbar *, GraphicsContext* context, const IntRect& damageRect);35 virtual bool paint(ScrollbarThemeClient*, GraphicsContext*, const IntRect& damageRect); 36 36 37 virtual ScrollbarPart hitTest(Scrollbar *, const PlatformMouseEvent&);37 virtual ScrollbarPart hitTest(ScrollbarThemeClient*, const PlatformMouseEvent&); 38 38 39 virtual void invalidatePart(Scrollbar *, ScrollbarPart);39 virtual void invalidatePart(ScrollbarThemeClient*, ScrollbarPart); 40 40 41 virtual int thumbPosition(Scrollbar *);42 virtual int thumbLength(Scrollbar *);43 virtual int trackPosition(Scrollbar *);44 virtual int trackLength(Scrollbar *);41 virtual int thumbPosition(ScrollbarThemeClient*); 42 virtual int thumbLength(ScrollbarThemeClient*); 43 virtual int trackPosition(ScrollbarThemeClient*); 44 virtual int trackLength(ScrollbarThemeClient*); 45 45 46 46 virtual void paintScrollCorner(ScrollView*, GraphicsContext*, const IntRect& cornerRect); … … 48 48 49 49 protected: 50 virtual bool hasButtons(Scrollbar *) = 0;51 virtual bool hasThumb(Scrollbar *) = 0;50 virtual bool hasButtons(ScrollbarThemeClient*) = 0; 51 virtual bool hasThumb(ScrollbarThemeClient*) = 0; 52 52 53 virtual IntRect backButtonRect(Scrollbar *, ScrollbarPart, bool painting = false) = 0;54 virtual IntRect forwardButtonRect(Scrollbar *, ScrollbarPart, bool painting = false) = 0;55 virtual IntRect trackRect(Scrollbar *, bool painting = false) = 0;53 virtual IntRect backButtonRect(ScrollbarThemeClient*, ScrollbarPart, bool painting = false) = 0; 54 virtual IntRect forwardButtonRect(ScrollbarThemeClient*, ScrollbarPart, bool painting = false) = 0; 55 virtual IntRect trackRect(ScrollbarThemeClient*, bool painting = false) = 0; 56 56 57 virtual void splitTrack(Scrollbar *, const IntRect& track, IntRect& startTrack, IntRect& thumb, IntRect& endTrack);57 virtual void splitTrack(ScrollbarThemeClient*, const IntRect& track, IntRect& startTrack, IntRect& thumb, IntRect& endTrack); 58 58 59 virtual int minimumThumbLength(Scrollbar *);59 virtual int minimumThumbLength(ScrollbarThemeClient*); 60 60 61 virtual void paintScrollbarBackground(GraphicsContext*, Scrollbar *) {}62 virtual void paintTrackBackground(GraphicsContext*, Scrollbar *, const IntRect&) {}63 virtual void paintTrackPiece(GraphicsContext*, Scrollbar *, const IntRect&, ScrollbarPart) {}64 virtual void paintButton(GraphicsContext*, Scrollbar *, const IntRect&, ScrollbarPart) {}65 virtual void paintThumb(GraphicsContext*, Scrollbar *, const IntRect&) {}66 virtual void paintTickmarks(GraphicsContext*, Scrollbar *, const IntRect&) {}61 virtual void paintScrollbarBackground(GraphicsContext*, ScrollbarThemeClient*) { } 62 virtual void paintTrackBackground(GraphicsContext*, ScrollbarThemeClient*, const IntRect&) { } 63 virtual void paintTrackPiece(GraphicsContext*, ScrollbarThemeClient*, const IntRect&, ScrollbarPart) { } 64 virtual void paintButton(GraphicsContext*, ScrollbarThemeClient*, const IntRect&, ScrollbarPart) { } 65 virtual void paintThumb(GraphicsContext*, ScrollbarThemeClient*, const IntRect&) { } 66 virtual void paintTickmarks(GraphicsContext*, ScrollbarThemeClient*, const IntRect&) { } 67 67 68 virtual IntRect constrainTrackRectToTrackPieces(Scrollbar *, const IntRect& rect) { return rect; }68 virtual IntRect constrainTrackRectToTrackPieces(ScrollbarThemeClient*, const IntRect& rect) { return rect; } 69 69 }; 70 70 -
trunk/Source/WebCore/platform/chromium/ScrollbarThemeChromium.cpp
r100070 r109451 40 40 namespace WebCore { 41 41 42 bool ScrollbarThemeChromium::hasThumb(Scrollbar * scrollbar)42 bool ScrollbarThemeChromium::hasThumb(ScrollbarThemeClient* scrollbar) 43 43 { 44 44 // This method is just called as a paint-time optimization to see if … … 47 47 } 48 48 49 IntRect ScrollbarThemeChromium::backButtonRect(Scrollbar * scrollbar, ScrollbarPart part, bool)49 IntRect ScrollbarThemeChromium::backButtonRect(ScrollbarThemeClient* scrollbar, ScrollbarPart part, bool) 50 50 { 51 51 // Windows and Linux just have single arrows. … … 57 57 } 58 58 59 IntRect ScrollbarThemeChromium::forwardButtonRect(Scrollbar * scrollbar, ScrollbarPart part, bool)59 IntRect ScrollbarThemeChromium::forwardButtonRect(ScrollbarThemeClient* scrollbar, ScrollbarPart part, bool) 60 60 { 61 61 // Windows and Linux just have single arrows. … … 75 75 } 76 76 77 IntRect ScrollbarThemeChromium::trackRect(Scrollbar * scrollbar, bool)77 IntRect ScrollbarThemeChromium::trackRect(ScrollbarThemeClient* scrollbar, bool) 78 78 { 79 79 IntSize bs = buttonSize(scrollbar); … … 93 93 } 94 94 95 void ScrollbarThemeChromium::paintTrackBackground(GraphicsContext* context, Scrollbar * scrollbar, const IntRect& rect)95 void ScrollbarThemeChromium::paintTrackBackground(GraphicsContext* context, ScrollbarThemeClient* scrollbar, const IntRect& rect) 96 96 { 97 97 // Just assume a forward track part. We only paint the track as a single piece when there is no thumb. … … 100 100 } 101 101 102 void ScrollbarThemeChromium::paintTickmarks(GraphicsContext* context, Scrollbar * scrollbar, const IntRect& rect)102 void ScrollbarThemeChromium::paintTickmarks(GraphicsContext* context, ScrollbarThemeClient* scrollbar, const IntRect& rect) 103 103 { 104 104 if (scrollbar->orientation() != VerticalScrollbar) … … 110 110 // Get the tickmarks for the frameview. 111 111 Vector<IntRect> tickmarks; 112 scrollbar-> scrollableArea()->getTickmarks(tickmarks);112 scrollbar->getTickmarks(tickmarks); 113 113 if (!tickmarks.size()) 114 114 return; -
trunk/Source/WebCore/platform/chromium/ScrollbarThemeChromium.h
r95901 r109451 42 42 class ScrollbarThemeChromium : public ScrollbarThemeComposite { 43 43 protected: 44 virtual bool hasButtons(Scrollbar *) { return true; }45 virtual bool hasThumb(Scrollbar *);44 virtual bool hasButtons(ScrollbarThemeClient*) { return true; } 45 virtual bool hasThumb(ScrollbarThemeClient*); 46 46 47 virtual IntRect backButtonRect(Scrollbar *, ScrollbarPart, bool painting = false);48 virtual IntRect forwardButtonRect(Scrollbar *, ScrollbarPart, bool painting = false);49 virtual IntRect trackRect(Scrollbar *, bool painting = false);47 virtual IntRect backButtonRect(ScrollbarThemeClient*, ScrollbarPart, bool painting = false); 48 virtual IntRect forwardButtonRect(ScrollbarThemeClient*, ScrollbarPart, bool painting = false); 49 virtual IntRect trackRect(ScrollbarThemeClient*, bool painting = false); 50 50 51 virtual void paintTrackBackground(GraphicsContext*, Scrollbar *, const IntRect&);52 virtual void paintTickmarks(GraphicsContext*, Scrollbar *, const IntRect&);51 virtual void paintTrackBackground(GraphicsContext*, ScrollbarThemeClient*, const IntRect&); 52 virtual void paintTickmarks(GraphicsContext*, ScrollbarThemeClient*, const IntRect&); 53 53 54 virtual IntSize buttonSize(Scrollbar *) = 0;54 virtual IntSize buttonSize(ScrollbarThemeClient*) = 0; 55 55 }; 56 56 } // namespace WebCore -
trunk/Source/WebCore/platform/chromium/ScrollbarThemeChromiumAndroid.cpp
r104139 r109451 58 58 } 59 59 60 void ScrollbarThemeChromiumAndroid::paintScrollbarBackground(GraphicsContext* context, Scrollbar * scrollbar)60 void ScrollbarThemeChromiumAndroid::paintScrollbarBackground(GraphicsContext* context, ScrollbarThemeClient* scrollbar) 61 61 { 62 62 // Paint black background in DumpRenderTree, otherwise the pixels in the scrollbar area depend … … 66 66 } 67 67 68 bool ScrollbarThemeChromiumAndroid::shouldCenterOnThumb(Scrollbar *, const PlatformMouseEvent& evt)68 bool ScrollbarThemeChromiumAndroid::shouldCenterOnThumb(ScrollbarThemeClient*, const PlatformMouseEvent& evt) 69 69 { 70 70 return true; 71 71 } 72 72 73 IntSize ScrollbarThemeChromiumAndroid::buttonSize(Scrollbar * scrollbar)73 IntSize ScrollbarThemeChromiumAndroid::buttonSize(ScrollbarThemeClient* scrollbar) 74 74 { 75 75 if (scrollbar->orientation() == VerticalScrollbar) … … 79 79 } 80 80 81 int ScrollbarThemeChromiumAndroid::minimumThumbLength(Scrollbar * scrollbar)81 int ScrollbarThemeChromiumAndroid::minimumThumbLength(ScrollbarThemeClient* scrollbar) 82 82 { 83 83 return 2 * scrollbarThickness(scrollbar->controlSize()); -
trunk/Source/WebCore/platform/chromium/ScrollbarThemeChromiumAndroid.h
r104139 r109451 36 36 37 37 protected: 38 virtual void paintScrollbarBackground(GraphicsContext*, Scrollbar *);39 virtual bool shouldCenterOnThumb(Scrollbar *, const PlatformMouseEvent&);40 virtual IntSize buttonSize(Scrollbar *);41 virtual int minimumThumbLength(Scrollbar *);38 virtual void paintScrollbarBackground(GraphicsContext*, ScrollbarThemeClient*); 39 virtual bool shouldCenterOnThumb(ScrollbarThemeClient*, const PlatformMouseEvent&); 40 virtual IntSize buttonSize(ScrollbarThemeClient*); 41 virtual int minimumThumbLength(ScrollbarThemeClient*); 42 42 }; 43 43 -
trunk/Source/WebCore/platform/chromium/ScrollbarThemeChromiumLinux.cpp
r100070 r109451 51 51 } 52 52 53 void ScrollbarThemeChromiumLinux::paintTrackPiece(GraphicsContext* gc, Scrollbar * scrollbar, const IntRect& rect, ScrollbarPart partType)53 void ScrollbarThemeChromiumLinux::paintTrackPiece(GraphicsContext* gc, ScrollbarThemeClient* scrollbar, const IntRect& rect, ScrollbarPart partType) 54 54 { 55 55 PlatformSupport::ThemePaintState state = scrollbar->hoveredPart() == partType ? PlatformSupport::StateHover : PlatformSupport::StateNormal; … … 68 68 } 69 69 70 void ScrollbarThemeChromiumLinux::paintButton(GraphicsContext* gc, Scrollbar * scrollbar, const IntRect& rect, ScrollbarPart part)70 void ScrollbarThemeChromiumLinux::paintButton(GraphicsContext* gc, ScrollbarThemeClient* scrollbar, const IntRect& rect, ScrollbarPart part) 71 71 { 72 72 PlatformSupport::ThemePart paintPart; … … 103 103 } 104 104 105 void ScrollbarThemeChromiumLinux::paintThumb(GraphicsContext* gc, Scrollbar * scrollbar, const IntRect& rect)105 void ScrollbarThemeChromiumLinux::paintThumb(GraphicsContext* gc, ScrollbarThemeClient* scrollbar, const IntRect& rect) 106 106 { 107 107 PlatformSupport::ThemePaintState state; … … 121 121 } 122 122 123 bool ScrollbarThemeChromiumLinux::shouldCenterOnThumb(Scrollbar *, const PlatformMouseEvent& evt)123 bool ScrollbarThemeChromiumLinux::shouldCenterOnThumb(ScrollbarThemeClient*, const PlatformMouseEvent& evt) 124 124 { 125 125 return (evt.shiftKey() && evt.button() == LeftButton) || (evt.button() == MiddleButton); 126 126 } 127 127 128 IntSize ScrollbarThemeChromiumLinux::buttonSize(Scrollbar * scrollbar)128 IntSize ScrollbarThemeChromiumLinux::buttonSize(ScrollbarThemeClient* scrollbar) 129 129 { 130 130 if (scrollbar->orientation() == VerticalScrollbar) { … … 138 138 } 139 139 140 int ScrollbarThemeChromiumLinux::minimumThumbLength(Scrollbar * scrollbar)140 int ScrollbarThemeChromiumLinux::minimumThumbLength(ScrollbarThemeClient* scrollbar) 141 141 { 142 142 if (scrollbar->orientation() == VerticalScrollbar) { -
trunk/Source/WebCore/platform/chromium/ScrollbarThemeChromiumLinux.h
r95901 r109451 40 40 41 41 protected: 42 virtual void paintTrackPiece(GraphicsContext*, Scrollbar *, const IntRect&, ScrollbarPart);43 virtual void paintButton(GraphicsContext*, Scrollbar *, const IntRect&, ScrollbarPart);44 virtual void paintThumb(GraphicsContext*, Scrollbar *, const IntRect&);45 virtual bool shouldCenterOnThumb(Scrollbar *, const PlatformMouseEvent&);46 virtual IntSize buttonSize(Scrollbar *);47 virtual int minimumThumbLength(Scrollbar *);42 virtual void paintTrackPiece(GraphicsContext*, ScrollbarThemeClient*, const IntRect&, ScrollbarPart); 43 virtual void paintButton(GraphicsContext*, ScrollbarThemeClient*, const IntRect&, ScrollbarPart); 44 virtual void paintThumb(GraphicsContext*, ScrollbarThemeClient*, const IntRect&); 45 virtual bool shouldCenterOnThumb(ScrollbarThemeClient*, const PlatformMouseEvent&); 46 virtual IntSize buttonSize(ScrollbarThemeClient*); 47 virtual int minimumThumbLength(ScrollbarThemeClient*); 48 48 }; 49 49 } // namespace WebCore -
trunk/Source/WebCore/platform/chromium/ScrollbarThemeChromiumMac.h
r103354 r109451 37 37 virtual ~ScrollbarThemeChromiumMac(); 38 38 39 virtual bool paint(Scrollbar *, GraphicsContext* context, const IntRect& damageRect);39 virtual bool paint(ScrollbarThemeClient*, GraphicsContext*, const IntRect& damageRect); 40 40 41 41 virtual void paintOverhangAreas(ScrollView*, GraphicsContext*, const IntRect& horizontalOverhangArea, const IntRect& verticalOverhangArea, const IntRect& dirtyRect); 42 42 43 43 private: 44 void paintGivenTickmarks(GraphicsContext*, Scrollbar *, const IntRect&, const Vector<IntRect>&);44 void paintGivenTickmarks(GraphicsContext*, ScrollbarThemeClient*, const IntRect&, const Vector<IntRect>&); 45 45 46 46 RefPtr<Pattern> m_overhangPattern; -
trunk/Source/WebCore/platform/chromium/ScrollbarThemeChromiumMac.mm
r103354 r109451 62 62 } 63 63 64 static PlatformSupport::ThemePaintState scrollbarStateToThemeState(Scrollbar * scrollbar)64 static PlatformSupport::ThemePaintState scrollbarStateToThemeState(ScrollbarThemeClient* scrollbar) 65 65 { 66 66 if (!scrollbar->enabled()) 67 67 return PlatformSupport::StateDisabled; 68 if (!scrollbar-> scrollableArea()->isActive())68 if (!scrollbar->isScrollableAreaActive()) 69 69 return PlatformSupport::StateInactive; 70 70 if (scrollbar->pressedPart() == ThumbPart) … … 95 95 // - drawing tickmarks 96 96 // - Skia specific changes 97 bool ScrollbarThemeChromiumMac::paint(Scrollbar * scrollbar, GraphicsContext* context, const IntRect& damageRect)97 bool ScrollbarThemeChromiumMac::paint(ScrollbarThemeClient* scrollbar, GraphicsContext* context, const IntRect& damageRect) 98 98 { 99 99 // Get the tickmarks for the frameview. 100 100 Vector<IntRect> tickmarks; 101 scrollbar-> scrollableArea()->getTickmarks(tickmarks);101 scrollbar->getTickmarks(tickmarks); 102 102 103 103 if (isScrollbarOverlayAPIAvailable()) { … … 189 189 trackInfo.enableState = kThemeTrackDisabled; 190 190 else 191 trackInfo.enableState = scrollbar-> scrollableArea()->isActive() ? kThemeTrackActive : kThemeTrackInactive;191 trackInfo.enableState = scrollbar->isScrollableAreaActive() ? kThemeTrackActive : kThemeTrackInactive; 192 192 193 193 if (!hasButtons(scrollbar)) … … 244 244 PlatformSupport::ThemePaintScrollbarInfo scrollbarInfo; 245 245 scrollbarInfo.orientation = scrollbar->orientation() == HorizontalScrollbar ? PlatformSupport::ScrollbarOrientationHorizontal : PlatformSupport::ScrollbarOrientationVertical; 246 scrollbarInfo.parent = scrollbar-> parent() && scrollbar->parent()->isFrameView() && static_cast<FrameView*>(scrollbar->parent())->isScrollViewScrollbar(scrollbar) ? PlatformSupport::ScrollbarParentScrollView : PlatformSupport::ScrollbarParentRenderLayer;246 scrollbarInfo.parent = scrollbar->isScrollViewScrollbar() ? PlatformSupport::ScrollbarParentScrollView : PlatformSupport::ScrollbarParentRenderLayer; 247 247 scrollbarInfo.maxValue = scrollbar->maximum(); 248 248 scrollbarInfo.currentValue = scrollbar->currentPos(); … … 264 264 } 265 265 266 void ScrollbarThemeChromiumMac::paintGivenTickmarks(GraphicsContext* context, Scrollbar * scrollbar, const IntRect& rect, const Vector<IntRect>& tickmarks)266 void ScrollbarThemeChromiumMac::paintGivenTickmarks(GraphicsContext* context, ScrollbarThemeClient* scrollbar, const IntRect& rect, const Vector<IntRect>& tickmarks) 267 267 { 268 268 if (scrollbar->orientation() != VerticalScrollbar) -
trunk/Source/WebCore/platform/chromium/ScrollbarThemeChromiumWin.cpp
r103297 r109451 74 74 } 75 75 76 bool ScrollbarThemeChromiumWin::shouldSnapBackToDragOrigin(Scrollbar * scrollbar, const PlatformMouseEvent& evt)76 bool ScrollbarThemeChromiumWin::shouldSnapBackToDragOrigin(ScrollbarThemeClient* scrollbar, const PlatformMouseEvent& evt) 77 77 { 78 78 // Find the rect within which we shouldn't snap, by expanding the track rect … … 92 92 } 93 93 94 void ScrollbarThemeChromiumWin::paintTrackPiece(GraphicsContext* gc, Scrollbar * scrollbar, const IntRect& rect, ScrollbarPart partType)94 void ScrollbarThemeChromiumWin::paintTrackPiece(GraphicsContext* gc, ScrollbarThemeClient* scrollbar, const IntRect& rect, ScrollbarPart partType) 95 95 { 96 96 bool horz = scrollbar->orientation() == HorizontalScrollbar; … … 114 114 } 115 115 116 void ScrollbarThemeChromiumWin::paintButton(GraphicsContext* gc, Scrollbar * scrollbar, const IntRect& rect, ScrollbarPart part)116 void ScrollbarThemeChromiumWin::paintButton(GraphicsContext* gc, ScrollbarThemeClient* scrollbar, const IntRect& rect, ScrollbarPart part) 117 117 { 118 118 bool horz = scrollbar->orientation() == HorizontalScrollbar; … … 132 132 } 133 133 134 void ScrollbarThemeChromiumWin::paintThumb(GraphicsContext* gc, Scrollbar * scrollbar, const IntRect& rect)134 void ScrollbarThemeChromiumWin::paintThumb(GraphicsContext* gc, ScrollbarThemeClient* scrollbar, const IntRect& rect) 135 135 { 136 136 bool horz = scrollbar->orientation() == HorizontalScrollbar; … … 153 153 } 154 154 155 int ScrollbarThemeChromiumWin::getThemeState(Scrollbar * scrollbar, ScrollbarPart part) const155 int ScrollbarThemeChromiumWin::getThemeState(ScrollbarThemeClient* scrollbar, ScrollbarPart part) const 156 156 { 157 157 // When dragging the thumb, draw thumb pressed and other segments normal … … 172 172 } 173 173 174 int ScrollbarThemeChromiumWin::getThemeArrowState(Scrollbar * scrollbar, ScrollbarPart part) const174 int ScrollbarThemeChromiumWin::getThemeArrowState(ScrollbarThemeClient* scrollbar, ScrollbarPart part) const 175 175 { 176 176 // We could take advantage of knowing the values in the state enum to write … … 222 222 } 223 223 224 int ScrollbarThemeChromiumWin::getClassicThemeState(Scrollbar * scrollbar, ScrollbarPart part) const224 int ScrollbarThemeChromiumWin::getClassicThemeState(ScrollbarThemeClient* scrollbar, ScrollbarPart part) const 225 225 { 226 226 // When dragging the thumb, draw the buttons normal even when hovered. … … 236 236 } 237 237 238 bool ScrollbarThemeChromiumWin::shouldCenterOnThumb(Scrollbar *, const PlatformMouseEvent& evt)238 bool ScrollbarThemeChromiumWin::shouldCenterOnThumb(ScrollbarThemeClient*, const PlatformMouseEvent& evt) 239 239 { 240 240 return evt.shiftKey() && evt.button() == LeftButton; 241 241 } 242 242 243 IntSize ScrollbarThemeChromiumWin::buttonSize(Scrollbar * scrollbar)243 IntSize ScrollbarThemeChromiumWin::buttonSize(ScrollbarThemeClient* scrollbar) 244 244 { 245 245 // Our desired rect is essentially thickness by thickness. -
trunk/Source/WebCore/platform/chromium/ScrollbarThemeChromiumWin.h
r95901 r109451 39 39 virtual int scrollbarThickness(ScrollbarControlSize); 40 40 virtual bool invalidateOnMouseEnterExit(); 41 virtual bool shouldSnapBackToDragOrigin(Scrollbar *, const PlatformMouseEvent&);41 virtual bool shouldSnapBackToDragOrigin(ScrollbarThemeClient*, const PlatformMouseEvent&); 42 42 43 43 protected: 44 virtual void paintTrackPiece(GraphicsContext*, Scrollbar *, const IntRect&, ScrollbarPart);45 virtual void paintButton(GraphicsContext*, Scrollbar *, const IntRect&, ScrollbarPart);46 virtual void paintThumb(GraphicsContext*, Scrollbar *, const IntRect&);47 virtual bool shouldCenterOnThumb(Scrollbar *, const PlatformMouseEvent&);48 virtual IntSize buttonSize(Scrollbar *);44 virtual void paintTrackPiece(GraphicsContext*, ScrollbarThemeClient*, const IntRect&, ScrollbarPart); 45 virtual void paintButton(GraphicsContext*, ScrollbarThemeClient*, const IntRect&, ScrollbarPart); 46 virtual void paintThumb(GraphicsContext*, ScrollbarThemeClient*, const IntRect&); 47 virtual bool shouldCenterOnThumb(ScrollbarThemeClient*, const PlatformMouseEvent&); 48 virtual IntSize buttonSize(ScrollbarThemeClient*); 49 49 50 50 private: 51 int getThemeState(Scrollbar *, ScrollbarPart) const;52 int getThemeArrowState(Scrollbar *, ScrollbarPart) const;53 int getClassicThemeState(Scrollbar *, ScrollbarPart) const;51 int getThemeState(ScrollbarThemeClient*, ScrollbarPart) const; 52 int getThemeArrowState(ScrollbarThemeClient*, ScrollbarPart) const; 53 int getClassicThemeState(ScrollbarThemeClient*, ScrollbarPart) const; 54 54 }; 55 55 } // namespace WebCore -
trunk/Source/WebCore/platform/efl/ScrollbarThemeEfl.cpp
r95901 r109451 50 50 } 51 51 52 void ScrollbarThemeEfl::registerScrollbar(Scrollbar * scrollbar)52 void ScrollbarThemeEfl::registerScrollbar(ScrollbarThemeClient* scrollbar) 53 53 { 54 54 } 55 55 56 void ScrollbarThemeEfl::unregisterScrollbar(Scrollbar * scrollbar)56 void ScrollbarThemeEfl::unregisterScrollbar(ScrollbarThemeClient* scrollbar) 57 57 { 58 58 } -
trunk/Source/WebCore/platform/efl/ScrollbarThemeEfl.h
r95901 r109451 40 40 virtual int scrollbarThickness(ScrollbarControlSize = RegularScrollbar); 41 41 42 virtual void registerScrollbar(Scrollbar * scrollbar);43 virtual void unregisterScrollbar(Scrollbar * scrollbar);42 virtual void registerScrollbar(ScrollbarThemeClient*); 43 virtual void unregisterScrollbar(ScrollbarThemeClient*); 44 44 }; 45 45 -
trunk/Source/WebCore/platform/gtk/ScrollbarThemeGtk.cpp
r105660 r109451 34 34 namespace WebCore { 35 35 36 static HashSet<Scrollbar *>* gScrollbars;36 static HashSet<ScrollbarThemeClient*>* gScrollbars; 37 37 38 38 ScrollbarTheme* ScrollbarTheme::nativeTheme() … … 46 46 } 47 47 48 void ScrollbarThemeGtk::registerScrollbar(Scrollbar * scrollbar)48 void ScrollbarThemeGtk::registerScrollbar(ScrollbarThemeClient* scrollbar) 49 49 { 50 50 if (!gScrollbars) 51 gScrollbars = new HashSet<Scrollbar *>;51 gScrollbars = new HashSet<ScrollbarThemeClient*>; 52 52 gScrollbars->add(scrollbar); 53 53 } 54 54 55 void ScrollbarThemeGtk::unregisterScrollbar(Scrollbar * scrollbar)55 void ScrollbarThemeGtk::unregisterScrollbar(ScrollbarThemeClient* scrollbar) 56 56 { 57 57 gScrollbars->remove(scrollbar); … … 70 70 // platform-independent scrollbar them code isn't yet smart enough to get 71 71 // this information when it paints. 72 HashSet<Scrollbar *>::iterator end = gScrollbars->end();73 for (HashSet<Scrollbar *>::iterator it = gScrollbars->begin(); it != end; ++it) {74 Scrollbar * scrollbar = (*it);72 HashSet<ScrollbarThemeClient*>::iterator end = gScrollbars->end(); 73 for (HashSet<ScrollbarThemeClient*>::iterator it = gScrollbars->begin(); it != end; ++it) { 74 ScrollbarThemeClient* scrollbar = (*it); 75 75 76 76 // Top-level scrollbar i.e. scrollbars who have a parent ScrollView … … 87 87 } 88 88 89 bool ScrollbarThemeGtk::hasThumb(Scrollbar * scrollbar)89 bool ScrollbarThemeGtk::hasThumb(ScrollbarThemeClient* scrollbar) 90 90 { 91 91 // This method is just called as a paint-time optimization to see if … … 94 94 } 95 95 96 IntRect ScrollbarThemeGtk::backButtonRect(Scrollbar * scrollbar, ScrollbarPart part, bool)96 IntRect ScrollbarThemeGtk::backButtonRect(ScrollbarThemeClient* scrollbar, ScrollbarPart part, bool) 97 97 { 98 98 if (part == BackButtonEndPart && !m_hasBackButtonEndPart) … … 115 115 } 116 116 117 IntRect ScrollbarThemeGtk::forwardButtonRect(Scrollbar * scrollbar, ScrollbarPart part, bool)117 IntRect ScrollbarThemeGtk::forwardButtonRect(ScrollbarThemeClient* scrollbar, ScrollbarPart part, bool) 118 118 { 119 119 if (part == ForwardButtonStartPart && !m_hasForwardButtonStartPart) … … 141 141 } 142 142 143 IntRect ScrollbarThemeGtk::trackRect(Scrollbar * scrollbar, bool)143 IntRect ScrollbarThemeGtk::trackRect(ScrollbarThemeClient* scrollbar, bool) 144 144 { 145 145 // The padding along the thumb movement axis includes the trough border … … 181 181 } 182 182 183 IntRect ScrollbarThemeGtk::thumbRect(Scrollbar * scrollbar, const IntRect& unconstrainedTrackRect)183 IntRect ScrollbarThemeGtk::thumbRect(ScrollbarThemeClient* scrollbar, const IntRect& unconstrainedTrackRect) 184 184 { 185 185 IntRect trackRect = constrainTrackRectToTrackPieces(scrollbar, unconstrainedTrackRect); … … 192 192 } 193 193 194 bool ScrollbarThemeGtk::paint(Scrollbar * scrollbar, GraphicsContext* graphicsContext, const IntRect& damageRect)194 bool ScrollbarThemeGtk::paint(ScrollbarThemeClient* scrollbar, GraphicsContext* graphicsContext, const IntRect& damageRect) 195 195 { 196 196 if (graphicsContext->paintingDisabled()) … … 261 261 } 262 262 263 bool ScrollbarThemeGtk::shouldCenterOnThumb(Scrollbar *, const PlatformMouseEvent& event)263 bool ScrollbarThemeGtk::shouldCenterOnThumb(ScrollbarThemeClient*, const PlatformMouseEvent& event) 264 264 { 265 265 return (event.shiftKey() && event.button() == LeftButton) || (event.button() == MiddleButton); … … 271 271 } 272 272 273 IntSize ScrollbarThemeGtk::buttonSize(Scrollbar * scrollbar)273 IntSize ScrollbarThemeGtk::buttonSize(ScrollbarThemeClient* scrollbar) 274 274 { 275 275 if (scrollbar->orientation() == VerticalScrollbar) … … 280 280 } 281 281 282 int ScrollbarThemeGtk::minimumThumbLength(Scrollbar * scrollbar)282 int ScrollbarThemeGtk::minimumThumbLength(ScrollbarThemeClient* scrollbar) 283 283 { 284 284 return m_minThumbLength; -
trunk/Source/WebCore/platform/gtk/ScrollbarThemeGtk.h
r105660 r109451 38 38 virtual ~ScrollbarThemeGtk(); 39 39 40 virtual bool hasButtons(Scrollbar *) { return true; }41 virtual bool hasThumb(Scrollbar *);42 virtual IntRect backButtonRect(Scrollbar *, ScrollbarPart, bool);43 virtual IntRect forwardButtonRect(Scrollbar *, ScrollbarPart, bool);44 virtual IntRect trackRect(Scrollbar *, bool);45 IntRect thumbRect(Scrollbar *, const IntRect& unconstrainedTrackRect);46 bool paint(Scrollbar *, GraphicsContext*, const IntRect& damageRect);47 void paintScrollbarBackground(GraphicsContext*, Scrollbar *);48 void paintTrackBackground(GraphicsContext*, Scrollbar *, const IntRect&);49 void paintThumb(GraphicsContext*, Scrollbar *, const IntRect&);50 virtual void paintButton(GraphicsContext*, Scrollbar *, const IntRect&, ScrollbarPart);51 virtual bool shouldCenterOnThumb(Scrollbar *, const PlatformMouseEvent&);40 virtual bool hasButtons(ScrollbarThemeClient*) { return true; } 41 virtual bool hasThumb(ScrollbarThemeClient*); 42 virtual IntRect backButtonRect(ScrollbarThemeClient*, ScrollbarPart, bool); 43 virtual IntRect forwardButtonRect(ScrollbarThemeClient*, ScrollbarPart, bool); 44 virtual IntRect trackRect(ScrollbarThemeClient*, bool); 45 IntRect thumbRect(ScrollbarThemeClient*, const IntRect& unconstrainedTrackRect); 46 bool paint(ScrollbarThemeClient*, GraphicsContext*, const IntRect& damageRect); 47 void paintScrollbarBackground(GraphicsContext*, ScrollbarThemeClient*); 48 void paintTrackBackground(GraphicsContext*, ScrollbarThemeClient*, const IntRect&); 49 void paintThumb(GraphicsContext*, ScrollbarThemeClient*, const IntRect&); 50 virtual void paintButton(GraphicsContext*, ScrollbarThemeClient*, const IntRect&, ScrollbarPart); 51 virtual bool shouldCenterOnThumb(ScrollbarThemeClient*, const PlatformMouseEvent&); 52 52 virtual int scrollbarThickness(ScrollbarControlSize); 53 virtual IntSize buttonSize(Scrollbar *);54 virtual int minimumThumbLength(Scrollbar *);53 virtual IntSize buttonSize(ScrollbarThemeClient*); 54 virtual int minimumThumbLength(ScrollbarThemeClient*); 55 55 56 56 // TODO: These are the default GTK+ values. At some point we should pull these from the theme itself. … … 59 59 void updateThemeProperties(); 60 60 void updateScrollbarsFrameThickness(); 61 void registerScrollbar(Scrollbar *);62 void unregisterScrollbar(Scrollbar *);61 void registerScrollbar(ScrollbarThemeClient*); 62 void unregisterScrollbar(ScrollbarThemeClient*); 63 63 64 64 protected: -
trunk/Source/WebCore/platform/gtk/ScrollbarThemeGtk2.cpp
r105660 r109451 67 67 } 68 68 69 static GtkWidget* getWidgetForScrollbar(Scrollbar * scrollbar)69 static GtkWidget* getWidgetForScrollbar(ScrollbarThemeClient* scrollbar) 70 70 { 71 71 RenderThemeGtk* theme = static_cast<RenderThemeGtk*>(RenderTheme::defaultTheme().get()); … … 73 73 } 74 74 75 void ScrollbarThemeGtk::paintTrackBackground(GraphicsContext* context, Scrollbar * scrollbar, const IntRect& rect)75 void ScrollbarThemeGtk::paintTrackBackground(GraphicsContext* context, ScrollbarThemeClient* scrollbar, const IntRect& rect) 76 76 { 77 77 // Paint the track background. If the trough-under-steppers property is true, this … … 88 88 } 89 89 90 void ScrollbarThemeGtk::paintScrollbarBackground(GraphicsContext* context, Scrollbar * scrollbar)90 void ScrollbarThemeGtk::paintScrollbarBackground(GraphicsContext* context, ScrollbarThemeClient* scrollbar) 91 91 { 92 92 IntRect fullScrollbarRect = IntRect(scrollbar->x(), scrollbar->y(), scrollbar->width(), scrollbar->height()); … … 97 97 } 98 98 99 void ScrollbarThemeGtk::paintThumb(GraphicsContext* context, Scrollbar * scrollbar, const IntRect& rect)99 void ScrollbarThemeGtk::paintThumb(GraphicsContext* context, ScrollbarThemeClient* scrollbar, const IntRect& rect) 100 100 { 101 101 GtkWidget* widget = getWidgetForScrollbar(scrollbar); … … 130 130 } 131 131 132 void ScrollbarThemeGtk::paintButton(GraphicsContext* context, Scrollbar * scrollbar, const IntRect& rect, ScrollbarPart part)132 void ScrollbarThemeGtk::paintButton(GraphicsContext* context, ScrollbarThemeClient* scrollbar, const IntRect& rect, ScrollbarPart part) 133 133 { 134 134 // The buttons will be disabled if the thumb is as the appropriate extreme. -
trunk/Source/WebCore/platform/gtk/ScrollbarThemeGtk3.cpp
r105660 r109451 73 73 } 74 74 75 void ScrollbarThemeGtk::paintTrackBackground(GraphicsContext* context, Scrollbar * scrollbar, const IntRect& rect)75 void ScrollbarThemeGtk::paintTrackBackground(GraphicsContext* context, ScrollbarThemeClient* scrollbar, const IntRect& rect) 76 76 { 77 77 // Paint the track background. If the trough-under-steppers property is true, this … … 95 95 } 96 96 97 void ScrollbarThemeGtk::paintScrollbarBackground(GraphicsContext* context, Scrollbar * scrollbar)97 void ScrollbarThemeGtk::paintScrollbarBackground(GraphicsContext* context, ScrollbarThemeClient* scrollbar) 98 98 { 99 99 gtk_style_context_save(m_context); … … 106 106 } 107 107 108 void ScrollbarThemeGtk::paintThumb(GraphicsContext* context, Scrollbar * scrollbar, const IntRect& rect)108 void ScrollbarThemeGtk::paintThumb(GraphicsContext* context, ScrollbarThemeClient* scrollbar, const IntRect& rect) 109 109 { 110 110 gtk_style_context_save(m_context); … … 127 127 } 128 128 129 void ScrollbarThemeGtk::paintButton(GraphicsContext* context, Scrollbar * scrollbar, const IntRect& rect, ScrollbarPart part)129 void ScrollbarThemeGtk::paintButton(GraphicsContext* context, ScrollbarThemeClient* scrollbar, const IntRect& rect, ScrollbarPart part) 130 130 { 131 131 gtk_style_context_save(m_context); -
trunk/Source/WebCore/platform/mac/ScrollbarThemeMac.h
r107119 r109451 40 40 void preferencesChanged(); 41 41 42 virtual void updateEnabledState(Scrollbar *);42 virtual void updateEnabledState(ScrollbarThemeClient*); 43 43 44 44 #if !PLATFORM(CHROMIUM) 45 virtual bool paint(Scrollbar *, GraphicsContext* context, const IntRect& damageRect);45 virtual bool paint(ScrollbarThemeClient*, GraphicsContext*, const IntRect& damageRect); 46 46 #endif 47 47 … … 50 50 virtual bool supportsControlTints() const { return true; } 51 51 virtual bool usesOverlayScrollbars() const; 52 virtual void updateScrollbarOverlayStyle(Scrollbar *);52 virtual void updateScrollbarOverlayStyle(ScrollbarThemeClient*); 53 53 54 54 virtual double initialAutoscrollTimerDelay(); … … 57 57 virtual ScrollbarButtonsPlacement buttonsPlacement() const; 58 58 59 virtual void registerScrollbar(Scrollbar *);60 virtual void unregisterScrollbar(Scrollbar *);59 virtual void registerScrollbar(ScrollbarThemeClient*); 60 virtual void unregisterScrollbar(ScrollbarThemeClient*); 61 61 62 void setNewPainterForScrollbar(Scrollbar *, ScrollbarPainter);63 ScrollbarPainter painterForScrollbar(Scrollbar *);62 void setNewPainterForScrollbar(ScrollbarThemeClient*, ScrollbarPainter); 63 ScrollbarPainter painterForScrollbar(ScrollbarThemeClient*); 64 64 65 65 static bool isCurrentlyDrawingIntoLayer(); … … 67 67 68 68 protected: 69 virtual bool hasButtons(Scrollbar *);70 virtual bool hasThumb(Scrollbar *);69 virtual bool hasButtons(ScrollbarThemeClient*); 70 virtual bool hasThumb(ScrollbarThemeClient*); 71 71 72 virtual IntRect backButtonRect(Scrollbar *, ScrollbarPart, bool painting = false);73 virtual IntRect forwardButtonRect(Scrollbar *, ScrollbarPart, bool painting = false);74 virtual IntRect trackRect(Scrollbar *, bool painting = false);72 virtual IntRect backButtonRect(ScrollbarThemeClient*, ScrollbarPart, bool painting = false); 73 virtual IntRect forwardButtonRect(ScrollbarThemeClient*, ScrollbarPart, bool painting = false); 74 virtual IntRect trackRect(ScrollbarThemeClient*, bool painting = false); 75 75 76 76 virtual int maxOverlapBetweenPages() { return 40; } 77 77 78 virtual int minimumThumbLength(Scrollbar *);78 virtual int minimumThumbLength(ScrollbarThemeClient*); 79 79 80 virtual bool shouldCenterOnThumb(Scrollbar *, const PlatformMouseEvent&);81 virtual bool shouldDragDocumentInsteadOfThumb(Scrollbar *, const PlatformMouseEvent&);80 virtual bool shouldCenterOnThumb(ScrollbarThemeClient*, const PlatformMouseEvent&); 81 virtual bool shouldDragDocumentInsteadOfThumb(ScrollbarThemeClient*, const PlatformMouseEvent&); 82 82 int scrollbarPartToHIPressedState(ScrollbarPart); 83 83 -
trunk/Source/WebCore/platform/mac/ScrollbarThemeMac.mm
r109016 r109451 51 51 namespace WebCore { 52 52 53 typedef HashMap<Scrollbar *, RetainPtr<ScrollbarPainter> > ScrollbarPainterMap;53 typedef HashMap<ScrollbarThemeClient*, RetainPtr<ScrollbarPainter> > ScrollbarPainterMap; 54 54 55 55 static ScrollbarPainterMap* scrollbarMap() … … 163 163 } 164 164 165 void ScrollbarThemeMac::registerScrollbar(Scrollbar * scrollbar)165 void ScrollbarThemeMac::registerScrollbar(ScrollbarThemeClient* scrollbar) 166 166 { 167 167 if (isScrollbarOverlayAPIAvailable()) { … … 176 176 } 177 177 178 void ScrollbarThemeMac::unregisterScrollbar(Scrollbar * scrollbar)178 void ScrollbarThemeMac::unregisterScrollbar(ScrollbarThemeClient* scrollbar) 179 179 { 180 180 scrollbarMap()->remove(scrollbar); 181 181 } 182 182 183 void ScrollbarThemeMac::setNewPainterForScrollbar(Scrollbar * scrollbar, ScrollbarPainter newPainter)183 void ScrollbarThemeMac::setNewPainterForScrollbar(ScrollbarThemeClient* scrollbar, ScrollbarPainter newPainter) 184 184 { 185 185 scrollbarMap()->set(scrollbar, newPainter); … … 188 188 } 189 189 190 ScrollbarPainter ScrollbarThemeMac::painterForScrollbar(Scrollbar * scrollbar)190 ScrollbarPainter ScrollbarThemeMac::painterForScrollbar(ScrollbarThemeClient* scrollbar) 191 191 { 192 192 return scrollbarMap()->get(scrollbar).get(); … … 249 249 } 250 250 251 void ScrollbarThemeMac::updateScrollbarOverlayStyle(Scrollbar * scrollbar)251 void ScrollbarThemeMac::updateScrollbarOverlayStyle(ScrollbarThemeClient* scrollbar) 252 252 { 253 253 ScrollbarPainter painter = painterForScrollbar(scrollbar); 254 switch (scrollbar->scroll ableArea()->scrollbarOverlayStyle()) {254 switch (scrollbar->scrollbarOverlayStyle()) { 255 255 case ScrollbarOverlayStyleDefault: 256 256 [painter setKnobStyle:NSScrollerKnobStyleDefault]; … … 280 280 } 281 281 282 bool ScrollbarThemeMac::hasButtons(Scrollbar * scrollbar)282 bool ScrollbarThemeMac::hasButtons(ScrollbarThemeClient* scrollbar) 283 283 { 284 284 return scrollbar->enabled() && buttonsPlacement() != ScrollbarButtonsNone … … 288 288 } 289 289 290 bool ScrollbarThemeMac::hasThumb(Scrollbar * scrollbar)290 bool ScrollbarThemeMac::hasThumb(ScrollbarThemeClient* scrollbar) 291 291 { 292 292 int minLengthForThumb; … … 320 320 } 321 321 322 IntRect ScrollbarThemeMac::backButtonRect(Scrollbar * scrollbar, ScrollbarPart part, bool painting)322 IntRect ScrollbarThemeMac::backButtonRect(ScrollbarThemeClient* scrollbar, ScrollbarPart part, bool painting) 323 323 { 324 324 IntRect result; … … 354 354 } 355 355 356 IntRect ScrollbarThemeMac::forwardButtonRect(Scrollbar * scrollbar, ScrollbarPart part, bool painting)356 IntRect ScrollbarThemeMac::forwardButtonRect(ScrollbarThemeClient* scrollbar, ScrollbarPart part, bool painting) 357 357 { 358 358 IntRect result; … … 394 394 } 395 395 396 IntRect ScrollbarThemeMac::trackRect(Scrollbar * scrollbar, bool painting)396 IntRect ScrollbarThemeMac::trackRect(ScrollbarThemeClient* scrollbar, bool painting) 397 397 { 398 398 if (painting || !hasButtons(scrollbar)) … … 431 431 } 432 432 433 int ScrollbarThemeMac::minimumThumbLength(Scrollbar * scrollbar)433 int ScrollbarThemeMac::minimumThumbLength(ScrollbarThemeClient* scrollbar) 434 434 { 435 435 if (isScrollbarOverlayAPIAvailable()) … … 439 439 } 440 440 441 bool ScrollbarThemeMac::shouldCenterOnThumb(Scrollbar *, const PlatformMouseEvent& evt)441 bool ScrollbarThemeMac::shouldCenterOnThumb(ScrollbarThemeClient*, const PlatformMouseEvent& evt) 442 442 { 443 443 if (evt.button() != LeftButton) … … 448 448 } 449 449 450 bool ScrollbarThemeMac::shouldDragDocumentInsteadOfThumb(Scrollbar *, const PlatformMouseEvent& event)450 bool ScrollbarThemeMac::shouldDragDocumentInsteadOfThumb(ScrollbarThemeClient*, const PlatformMouseEvent& event) 451 451 { 452 452 return event.altKey(); … … 471 471 } 472 472 473 void ScrollbarThemeMac::updateEnabledState(Scrollbar * scrollbar)473 void ScrollbarThemeMac::updateEnabledState(ScrollbarThemeClient* scrollbar) 474 474 { 475 475 if (isScrollbarOverlayAPIAvailable()) … … 500 500 501 501 #if !PLATFORM(CHROMIUM) 502 bool ScrollbarThemeMac::paint(Scrollbar * scrollbar, GraphicsContext* context, const IntRect& damageRect)502 bool ScrollbarThemeMac::paint(ScrollbarThemeClient* scrollbar, GraphicsContext* context, const IntRect& damageRect) 503 503 { 504 504 if (isScrollbarOverlayAPIAvailable()) { … … 571 571 trackInfo.enableState = kThemeTrackDisabled; 572 572 else 573 trackInfo.enableState = scrollbar-> scrollableArea()->isActive() ? kThemeTrackActive : kThemeTrackInactive;573 trackInfo.enableState = scrollbar->isScrollableAreaActive() ? kThemeTrackActive : kThemeTrackInactive; 574 574 575 575 if (hasThumb(scrollbar)) -
trunk/Source/WebCore/platform/mock/ScrollbarThemeMock.cpp
r104647 r109451 33 33 static int cScrollbarThickness[] = { 15, 11 }; 34 34 35 IntRect ScrollbarThemeMock::trackRect(Scrollbar * scrollbar, bool)35 IntRect ScrollbarThemeMock::trackRect(ScrollbarThemeClient* scrollbar, bool) 36 36 { 37 37 return scrollbar->frameRect(); … … 43 43 } 44 44 45 void ScrollbarThemeMock::paintTrackBackground(GraphicsContext* context, Scrollbar * scrollbar, const IntRect& trackRect)45 void ScrollbarThemeMock::paintTrackBackground(GraphicsContext* context, ScrollbarThemeClient* scrollbar, const IntRect& trackRect) 46 46 { 47 47 context->fillRect(trackRect, scrollbar->enabled() ? Color::lightGray : Color(0xFFE0E0E0), ColorSpaceDeviceRGB); 48 48 } 49 49 50 void ScrollbarThemeMock::paintThumb(GraphicsContext* context, Scrollbar * scrollbar, const IntRect& thumbRect)50 void ScrollbarThemeMock::paintThumb(GraphicsContext* context, ScrollbarThemeClient* scrollbar, const IntRect& thumbRect) 51 51 { 52 52 if (scrollbar->enabled()) -
trunk/Source/WebCore/platform/mock/ScrollbarThemeMock.h
r97227 r109451 37 37 38 38 protected: 39 virtual bool hasButtons(Scrollbar *) { return false; }40 virtual bool hasThumb(Scrollbar *) { return true; }39 virtual bool hasButtons(ScrollbarThemeClient*) { return false; } 40 virtual bool hasThumb(ScrollbarThemeClient*) { return true; } 41 41 42 virtual IntRect backButtonRect(Scrollbar *, ScrollbarPart, bool /*painting*/ = false) { return IntRect(); }43 virtual IntRect forwardButtonRect(Scrollbar *, ScrollbarPart, bool /*painting*/ = false) { return IntRect(); }44 virtual IntRect trackRect(Scrollbar *, bool painting = false);42 virtual IntRect backButtonRect(ScrollbarThemeClient*, ScrollbarPart, bool /*painting*/ = false) { return IntRect(); } 43 virtual IntRect forwardButtonRect(ScrollbarThemeClient*, ScrollbarPart, bool /*painting*/ = false) { return IntRect(); } 44 virtual IntRect trackRect(ScrollbarThemeClient*, bool painting = false); 45 45 46 virtual void paintTrackBackground(GraphicsContext*, Scrollbar *, const IntRect&);47 virtual void paintThumb(GraphicsContext*, Scrollbar *, const IntRect&);46 virtual void paintTrackBackground(GraphicsContext*, ScrollbarThemeClient*, const IntRect&); 47 virtual void paintThumb(GraphicsContext*, ScrollbarThemeClient*, const IntRect&); 48 48 49 49 private: -
trunk/Source/WebCore/platform/qt/ScrollbarThemeQt.cpp
r103297 r109451 113 113 } 114 114 115 static QStyleOptionSlider* styleOptionSlider(Scrollbar * scrollbar, QWidget* widget = 0)115 static QStyleOptionSlider* styleOptionSlider(ScrollbarThemeClient* scrollbar, QWidget* widget = 0) 116 116 { 117 117 static QStyleOptionSlider opt; … … 156 156 } 157 157 158 bool ScrollbarThemeQt::paint(Scrollbar * scrollbar, GraphicsContext* graphicsContext, const IntRect& damageRect)158 bool ScrollbarThemeQt::paint(ScrollbarThemeClient* scrollbar, GraphicsContext* graphicsContext, const IntRect& damageRect) 159 159 { 160 160 if (graphicsContext->updatingControlTints()) { … … 194 194 } 195 195 196 ScrollbarPart ScrollbarThemeQt::hitTest(Scrollbar * scrollbar, const PlatformMouseEvent& evt)196 ScrollbarPart ScrollbarThemeQt::hitTest(ScrollbarThemeClient* scrollbar, const PlatformMouseEvent& evt) 197 197 { 198 198 QStyleOptionSlider* opt = styleOptionSlider(scrollbar); … … 203 203 } 204 204 205 bool ScrollbarThemeQt::shouldCenterOnThumb(Scrollbar *, const PlatformMouseEvent& evt)205 bool ScrollbarThemeQt::shouldCenterOnThumb(ScrollbarThemeClient*, const PlatformMouseEvent& evt) 206 206 { 207 207 // Middle click centers slider thumb (if supported). … … 209 209 } 210 210 211 void ScrollbarThemeQt::invalidatePart(Scrollbar * scrollbar, ScrollbarPart)211 void ScrollbarThemeQt::invalidatePart(ScrollbarThemeClient* scrollbar, ScrollbarPart) 212 212 { 213 213 // FIXME: Do more precise invalidation. … … 225 225 } 226 226 227 int ScrollbarThemeQt::thumbPosition(Scrollbar * scrollbar)227 int ScrollbarThemeQt::thumbPosition(ScrollbarThemeClient* scrollbar) 228 228 { 229 229 if (scrollbar->enabled()) { … … 234 234 } 235 235 236 int ScrollbarThemeQt::thumbLength(Scrollbar * scrollbar)236 int ScrollbarThemeQt::thumbLength(ScrollbarThemeClient* scrollbar) 237 237 { 238 238 QStyleOptionSlider* opt = styleOptionSlider(scrollbar); … … 241 241 } 242 242 243 int ScrollbarThemeQt::trackPosition(Scrollbar * scrollbar)243 int ScrollbarThemeQt::trackPosition(ScrollbarThemeClient* scrollbar) 244 244 { 245 245 QStyleOptionSlider* opt = styleOptionSlider(scrollbar); … … 248 248 } 249 249 250 int ScrollbarThemeQt::trackLength(Scrollbar * scrollbar)250 int ScrollbarThemeQt::trackLength(ScrollbarThemeClient* scrollbar) 251 251 { 252 252 QStyleOptionSlider* opt = styleOptionSlider(scrollbar); -
trunk/Source/WebCore/platform/qt/ScrollbarThemeQt.h
r100087 r109451 41 41 virtual ~ScrollbarThemeQt(); 42 42 43 virtual bool paint(Scrollbar *, GraphicsContext*, const IntRect& damageRect);43 virtual bool paint(ScrollbarThemeClient*, GraphicsContext*, const IntRect& damageRect); 44 44 virtual void paintScrollCorner(ScrollView*, GraphicsContext*, const IntRect& cornerRect); 45 45 46 virtual ScrollbarPart hitTest(Scrollbar *, const PlatformMouseEvent&);46 virtual ScrollbarPart hitTest(ScrollbarThemeClient*, const PlatformMouseEvent&); 47 47 48 virtual bool shouldCenterOnThumb(Scrollbar *, const PlatformMouseEvent&);48 virtual bool shouldCenterOnThumb(ScrollbarThemeClient*, const PlatformMouseEvent&); 49 49 50 virtual void invalidatePart(Scrollbar *, ScrollbarPart);50 virtual void invalidatePart(ScrollbarThemeClient*, ScrollbarPart); 51 51 52 virtual int thumbPosition(Scrollbar *);53 virtual int thumbLength(Scrollbar *);54 virtual int trackPosition(Scrollbar *);55 virtual int trackLength(Scrollbar *);52 virtual int thumbPosition(ScrollbarThemeClient*); 53 virtual int thumbLength(ScrollbarThemeClient*); 54 virtual int trackPosition(ScrollbarThemeClient*); 55 virtual int trackLength(ScrollbarThemeClient*); 56 56 57 57 virtual int scrollbarThickness(ScrollbarControlSize = RegularScrollbar); -
trunk/Source/WebCore/platform/win/ScrollbarThemeSafari.cpp
r95901 r109451 105 105 } 106 106 107 bool ScrollbarThemeSafari::hasButtons(Scrollbar * scrollbar)107 bool ScrollbarThemeSafari::hasButtons(ScrollbarThemeClient* scrollbar) 108 108 { 109 109 return scrollbar->enabled() && (scrollbar->orientation() == HorizontalScrollbar ? … … 112 112 } 113 113 114 bool ScrollbarThemeSafari::hasThumb(Scrollbar * scrollbar)114 bool ScrollbarThemeSafari::hasThumb(ScrollbarThemeClient* scrollbar) 115 115 { 116 116 return scrollbar->enabled() && (scrollbar->orientation() == HorizontalScrollbar ? … … 135 135 } 136 136 137 IntRect ScrollbarThemeSafari::backButtonRect(Scrollbar * scrollbar, ScrollbarPart part, bool painting)137 IntRect ScrollbarThemeSafari::backButtonRect(ScrollbarThemeClient* scrollbar, ScrollbarPart part, bool painting) 138 138 { 139 139 IntRect result; … … 153 153 } 154 154 155 IntRect ScrollbarThemeSafari::forwardButtonRect(Scrollbar * scrollbar, ScrollbarPart part, bool painting)155 IntRect ScrollbarThemeSafari::forwardButtonRect(ScrollbarThemeClient* scrollbar, ScrollbarPart part, bool painting) 156 156 { 157 157 IntRect result; … … 182 182 } 183 183 184 IntRect ScrollbarThemeSafari::trackRect(Scrollbar * scrollbar, bool painting)184 IntRect ScrollbarThemeSafari::trackRect(ScrollbarThemeClient* scrollbar, bool painting) 185 185 { 186 186 if (painting || !hasButtons(scrollbar)) … … 194 194 } 195 195 196 int ScrollbarThemeSafari::minimumThumbLength(Scrollbar * scrollbar)196 int ScrollbarThemeSafari::minimumThumbLength(ScrollbarThemeClient* scrollbar) 197 197 { 198 198 return cThumbMinLength[scrollbar->controlSize()]; 199 199 } 200 200 201 bool ScrollbarThemeSafari::shouldCenterOnThumb(Scrollbar *, const PlatformMouseEvent& evt)201 bool ScrollbarThemeSafari::shouldCenterOnThumb(ScrollbarThemeClient*, const PlatformMouseEvent& evt) 202 202 { 203 203 return evt.shiftKey() && evt.button() == LeftButton; 204 204 } 205 205 206 void ScrollbarThemeSafari::paintTrackBackground(GraphicsContext* graphicsContext, Scrollbar * scrollbar, const IntRect& trackRect)206 void ScrollbarThemeSafari::paintTrackBackground(GraphicsContext* graphicsContext, ScrollbarThemeClient* scrollbar, const IntRect& trackRect) 207 207 { 208 208 if (!SafariThemeLibrary()) … … 210 210 NSControlSize size = scrollbar->controlSize() == SmallScrollbar ? NSSmallControlSize : NSRegularControlSize; 211 211 ThemeControlState state = 0; 212 if (scrollbar-> scrollableArea()->isActive())212 if (scrollbar->isScrollableAreaActive()) 213 213 state |= ActiveState; 214 214 if (hasButtons(scrollbar)) … … 217 217 } 218 218 219 void ScrollbarThemeSafari::paintButton(GraphicsContext* graphicsContext, Scrollbar * scrollbar, const IntRect& buttonRect, ScrollbarPart part)219 void ScrollbarThemeSafari::paintButton(GraphicsContext* graphicsContext, ScrollbarThemeClient* scrollbar, const IntRect& buttonRect, ScrollbarPart part) 220 220 { 221 221 if (!SafariThemeLibrary()) … … 223 223 NSControlSize size = scrollbar->controlSize() == SmallScrollbar ? NSSmallControlSize : NSRegularControlSize; 224 224 ThemeControlState state = 0; 225 if (scrollbar-> scrollableArea()->isActive())225 if (scrollbar->isScrollableAreaActive()) 226 226 state |= ActiveState; 227 227 if (hasButtons(scrollbar)) … … 237 237 } 238 238 239 void ScrollbarThemeSafari::paintThumb(GraphicsContext* graphicsContext, Scrollbar * scrollbar, const IntRect& thumbRect)239 void ScrollbarThemeSafari::paintThumb(GraphicsContext* graphicsContext, ScrollbarThemeClient* scrollbar, const IntRect& thumbRect) 240 240 { 241 241 if (!SafariThemeLibrary()) … … 243 243 NSControlSize size = scrollbar->controlSize() == SmallScrollbar ? NSSmallControlSize : NSRegularControlSize; 244 244 ThemeControlState state = 0; 245 if (scrollbar-> scrollableArea()->isActive())245 if (scrollbar->isScrollableAreaActive()) 246 246 state |= ActiveState; 247 247 if (hasThumb(scrollbar)) -
trunk/Source/WebCore/platform/win/ScrollbarThemeSafari.h
r95901 r109451 42 42 43 43 protected: 44 virtual bool hasButtons(Scrollbar *);45 virtual bool hasThumb(Scrollbar *);44 virtual bool hasButtons(ScrollbarThemeClient*); 45 virtual bool hasThumb(ScrollbarThemeClient*); 46 46 47 virtual IntRect backButtonRect(Scrollbar *, ScrollbarPart, bool painting = false);48 virtual IntRect forwardButtonRect(Scrollbar *, ScrollbarPart, bool painting = false);49 virtual IntRect trackRect(Scrollbar *, bool painting = false);47 virtual IntRect backButtonRect(ScrollbarThemeClient*, ScrollbarPart, bool painting = false); 48 virtual IntRect forwardButtonRect(ScrollbarThemeClient*, ScrollbarPart, bool painting = false); 49 virtual IntRect trackRect(ScrollbarThemeClient*, bool painting = false); 50 50 51 virtual int minimumThumbLength(Scrollbar *);51 virtual int minimumThumbLength(ScrollbarThemeClient*); 52 52 53 virtual bool shouldCenterOnThumb(Scrollbar *, const PlatformMouseEvent&);53 virtual bool shouldCenterOnThumb(ScrollbarThemeClient*, const PlatformMouseEvent&); 54 54 55 virtual void paintTrackBackground(GraphicsContext*, Scrollbar *, const IntRect&);56 virtual void paintButton(GraphicsContext*, Scrollbar *, const IntRect&, ScrollbarPart);57 virtual void paintThumb(GraphicsContext*, Scrollbar *, const IntRect&);55 virtual void paintTrackBackground(GraphicsContext*, ScrollbarThemeClient*, const IntRect&); 56 virtual void paintButton(GraphicsContext*, ScrollbarThemeClient*, const IntRect&, ScrollbarPart); 57 virtual void paintThumb(GraphicsContext*, ScrollbarThemeClient*, const IntRect&); 58 58 }; 59 59 -
trunk/Source/WebCore/platform/win/ScrollbarThemeWin.cpp
r103297 r109451 131 131 } 132 132 133 bool ScrollbarThemeWin::hasThumb(Scrollbar * scrollbar)133 bool ScrollbarThemeWin::hasThumb(ScrollbarThemeClient* scrollbar) 134 134 { 135 135 return thumbLength(scrollbar) > 0; 136 136 } 137 137 138 IntRect ScrollbarThemeWin::backButtonRect(Scrollbar * scrollbar, ScrollbarPart part, bool)138 IntRect ScrollbarThemeWin::backButtonRect(ScrollbarThemeClient* scrollbar, ScrollbarPart part, bool) 139 139 { 140 140 // Windows just has single arrows. … … 155 155 } 156 156 157 IntRect ScrollbarThemeWin::forwardButtonRect(Scrollbar * scrollbar, ScrollbarPart part, bool)157 IntRect ScrollbarThemeWin::forwardButtonRect(ScrollbarThemeClient* scrollbar, ScrollbarPart part, bool) 158 158 { 159 159 // Windows just has single arrows. … … 176 176 } 177 177 178 IntRect ScrollbarThemeWin::trackRect(Scrollbar * scrollbar, bool)178 IntRect ScrollbarThemeWin::trackRect(ScrollbarThemeClient* scrollbar, bool) 179 179 { 180 180 int thickness = scrollbarThickness(); … … 189 189 } 190 190 191 bool ScrollbarThemeWin::shouldCenterOnThumb(Scrollbar *, const PlatformMouseEvent& evt)191 bool ScrollbarThemeWin::shouldCenterOnThumb(ScrollbarThemeClient*, const PlatformMouseEvent& evt) 192 192 { 193 193 return evt.shiftKey() && evt.button() == LeftButton; 194 194 } 195 195 196 bool ScrollbarThemeWin::shouldSnapBackToDragOrigin(Scrollbar * scrollbar, const PlatformMouseEvent& evt)196 bool ScrollbarThemeWin::shouldSnapBackToDragOrigin(ScrollbarThemeClient* scrollbar, const PlatformMouseEvent& evt) 197 197 { 198 198 // Find the rect within which we shouldn't snap, by expanding the track rect … … 212 212 } 213 213 214 void ScrollbarThemeWin::paintTrackBackground(GraphicsContext* context, Scrollbar * scrollbar, const IntRect& rect)214 void ScrollbarThemeWin::paintTrackBackground(GraphicsContext* context, ScrollbarThemeClient* scrollbar, const IntRect& rect) 215 215 { 216 216 // Just assume a forward track part. We only paint the track as a single piece when there is no thumb. … … 219 219 } 220 220 221 void ScrollbarThemeWin::paintTrackPiece(GraphicsContext* context, Scrollbar * scrollbar, const IntRect& rect, ScrollbarPart partType)221 void ScrollbarThemeWin::paintTrackPiece(GraphicsContext* context, ScrollbarThemeClient* scrollbar, const IntRect& rect, ScrollbarPart partType) 222 222 { 223 223 checkAndInitScrollbarTheme(); … … 277 277 } 278 278 279 void ScrollbarThemeWin::paintButton(GraphicsContext* context, Scrollbar * scrollbar, const IntRect& rect, ScrollbarPart part)279 void ScrollbarThemeWin::paintButton(GraphicsContext* context, ScrollbarThemeClient* scrollbar, const IntRect& rect, ScrollbarPart part) 280 280 { 281 281 checkAndInitScrollbarTheme(); … … 340 340 } 341 341 342 static void paintGripper(Scrollbar * scrollbar, HDC hdc, const IntRect& rect)342 static void paintGripper(ScrollbarThemeClient* scrollbar, HDC hdc, const IntRect& rect) 343 343 { 344 344 if (!scrollbarTheme) … … 359 359 } 360 360 361 void ScrollbarThemeWin::paintThumb(GraphicsContext* context, Scrollbar * scrollbar, const IntRect& rect)361 void ScrollbarThemeWin::paintThumb(GraphicsContext* context, ScrollbarThemeClient* scrollbar, const IntRect& rect) 362 362 { 363 363 checkAndInitScrollbarTheme(); -
trunk/Source/WebCore/platform/win/ScrollbarThemeWin.h
r95901 r109451 43 43 44 44 protected: 45 virtual bool hasButtons(Scrollbar *) { return true; }46 virtual bool hasThumb(Scrollbar *);45 virtual bool hasButtons(ScrollbarThemeClient*) { return true; } 46 virtual bool hasThumb(ScrollbarThemeClient*); 47 47 48 virtual IntRect backButtonRect(Scrollbar *, ScrollbarPart, bool painting = false);49 virtual IntRect forwardButtonRect(Scrollbar *, ScrollbarPart, bool painting = false);50 virtual IntRect trackRect(Scrollbar *, bool painting = false);48 virtual IntRect backButtonRect(ScrollbarThemeClient*, ScrollbarPart, bool painting = false); 49 virtual IntRect forwardButtonRect(ScrollbarThemeClient*, ScrollbarPart, bool painting = false); 50 virtual IntRect trackRect(ScrollbarThemeClient*, bool painting = false); 51 51 52 virtual bool shouldCenterOnThumb(Scrollbar *, const PlatformMouseEvent&);53 virtual bool shouldSnapBackToDragOrigin(Scrollbar *, const PlatformMouseEvent&);52 virtual bool shouldCenterOnThumb(ScrollbarThemeClient*, const PlatformMouseEvent&); 53 virtual bool shouldSnapBackToDragOrigin(ScrollbarThemeClient*, const PlatformMouseEvent&); 54 54 55 virtual void paintTrackBackground(GraphicsContext*, Scrollbar *, const IntRect&);56 virtual void paintTrackPiece(GraphicsContext*, Scrollbar *, const IntRect&, ScrollbarPart);57 virtual void paintButton(GraphicsContext*, Scrollbar *, const IntRect&, ScrollbarPart);58 virtual void paintThumb(GraphicsContext*, Scrollbar *, const IntRect&);55 virtual void paintTrackBackground(GraphicsContext*, ScrollbarThemeClient*, const IntRect&); 56 virtual void paintTrackPiece(GraphicsContext*, ScrollbarThemeClient*, const IntRect&, ScrollbarPart); 57 virtual void paintButton(GraphicsContext*, ScrollbarThemeClient*, const IntRect&, ScrollbarPart); 58 virtual void paintThumb(GraphicsContext*, ScrollbarThemeClient*, const IntRect&); 59 59 }; 60 60 -
trunk/Source/WebCore/platform/wx/ScrollbarThemeWx.cpp
r96348 r109451 72 72 } 73 73 74 bool ScrollbarThemeWx::hasThumb(Scrollbar * scrollbar)74 bool ScrollbarThemeWx::hasThumb(ScrollbarThemeClient* scrollbar) 75 75 { 76 76 // This method is just called as a paint-time optimization to see if … … 79 79 } 80 80 81 int ScrollbarThemeWx::minimumThumbLength(Scrollbar * scrollbar)81 int ScrollbarThemeWx::minimumThumbLength(ScrollbarThemeClient* scrollbar) 82 82 { 83 83 return 20; 84 84 } 85 85 86 IntSize ScrollbarThemeWx::buttonSize(Scrollbar *)86 IntSize ScrollbarThemeWx::buttonSize(ScrollbarThemeClient*) 87 87 { 88 88 #ifdef __WXMAC__ … … 93 93 } 94 94 95 void ScrollbarThemeWx::splitTrack(Scrollbar * scrollbar, const IntRect& unconstrainedTrackRect, IntRect& beforeThumbRect, IntRect& thumbRect, IntRect& afterThumbRect)95 void ScrollbarThemeWx::splitTrack(ScrollbarThemeClient* scrollbar, const IntRect& unconstrainedTrackRect, IntRect& beforeThumbRect, IntRect& thumbRect, IntRect& afterThumbRect) 96 96 { 97 97 ScrollbarThemeComposite::splitTrack(scrollbar, unconstrainedTrackRect, beforeThumbRect, thumbRect, afterThumbRect); … … 110 110 } 111 111 112 IntRect ScrollbarThemeWx::backButtonRect(Scrollbar * scrollbar, ScrollbarPart part, bool)112 IntRect ScrollbarThemeWx::backButtonRect(ScrollbarThemeClient* scrollbar, ScrollbarPart part, bool) 113 113 { 114 114 // FIXME: Handling this case is needed when there are two sets of arrow buttons … … 131 131 } 132 132 133 IntRect ScrollbarThemeWx::forwardButtonRect(Scrollbar * scrollbar, ScrollbarPart part, bool)133 IntRect ScrollbarThemeWx::forwardButtonRect(ScrollbarThemeClient* scrollbar, ScrollbarPart part, bool) 134 134 { 135 135 // FIXME: Handling this case is needed when there are two sets of arrow buttons … … 156 156 } 157 157 158 IntRect ScrollbarThemeWx::trackRect(Scrollbar * scrollbar, bool)158 IntRect ScrollbarThemeWx::trackRect(ScrollbarThemeClient* scrollbar, bool) 159 159 { 160 160 IntSize bs = buttonSize(scrollbar); … … 180 180 } 181 181 182 bool ScrollbarThemeWx::paint(Scrollbar * scrollbar, GraphicsContext* context, const IntRect& rect)182 bool ScrollbarThemeWx::paint(ScrollbarThemeClient* scrollbar, GraphicsContext* context, const IntRect& rect) 183 183 { 184 184 wxOrientation orientation = (scrollbar->orientation() == HorizontalScrollbar) ? wxHORIZONTAL : wxVERTICAL; 185 185 int flags = 0; 186 if (scrollbar-> scrollableArea()->isActive())186 if (scrollbar->isScrollableAreaActive()) 187 187 flags |= wxCONTROL_FOCUSED; 188 188 -
trunk/Source/WebCore/platform/wx/ScrollbarThemeWx.h
r96348 r109451 36 36 virtual ~ScrollbarThemeWx(); 37 37 virtual int scrollbarThickness(ScrollbarControlSize = RegularScrollbar); 38 virtual bool paint(Scrollbar *, GraphicsContext*, const IntRect&);38 virtual bool paint(ScrollbarThemeClient*, GraphicsContext*, const IntRect&); 39 39 40 40 protected: 41 virtual bool hasButtons(Scrollbar *) { return true; }42 virtual bool hasThumb(Scrollbar *);41 virtual bool hasButtons(ScrollbarThemeClient*) { return true; } 42 virtual bool hasThumb(ScrollbarThemeClient*); 43 43 44 virtual IntSize buttonSize(Scrollbar *);44 virtual IntSize buttonSize(ScrollbarThemeClient*); 45 45 46 virtual IntRect backButtonRect(Scrollbar *, ScrollbarPart, bool painting = false);47 virtual IntRect forwardButtonRect(Scrollbar *, ScrollbarPart, bool painting = false);48 virtual IntRect trackRect(Scrollbar *, bool painting = false);46 virtual IntRect backButtonRect(ScrollbarThemeClient*, ScrollbarPart, bool painting = false); 47 virtual IntRect forwardButtonRect(ScrollbarThemeClient*, ScrollbarPart, bool painting = false); 48 virtual IntRect trackRect(ScrollbarThemeClient*, bool painting = false); 49 49 50 virtual void splitTrack(Scrollbar *, const IntRect& track, IntRect& startTrack, IntRect& thumb, IntRect& endTrack);50 virtual void splitTrack(ScrollbarThemeClient*, const IntRect& track, IntRect& startTrack, IntRect& thumb, IntRect& endTrack); 51 51 52 virtual int minimumThumbLength(Scrollbar *);52 virtual int minimumThumbLength(ScrollbarThemeClient*); 53 53 }; 54 54 -
trunk/Source/WebCore/rendering/RenderScrollbar.h
r95901 r109451 86 86 }; 87 87 88 inline RenderScrollbar* toRenderScrollbar(Scrollbar * scrollbar)88 inline RenderScrollbar* toRenderScrollbar(ScrollbarThemeClient* scrollbar) 89 89 { 90 90 ASSERT(!scrollbar || scrollbar->isCustomScrollbar()); -
trunk/Source/WebCore/rendering/RenderScrollbarTheme.cpp
r95901 r109451 27 27 #include "RenderScrollbarTheme.h" 28 28 #include "RenderScrollbar.h" 29 #include "ScrollbarThemeClient.h" 29 30 #include <wtf/StdLibExtras.h> 30 31 … … 37 38 } 38 39 39 void RenderScrollbarTheme::buttonSizesAlongTrackAxis(Scrollbar * scrollbar, int& beforeSize, int& afterSize)40 void RenderScrollbarTheme::buttonSizesAlongTrackAxis(ScrollbarThemeClient* scrollbar, int& beforeSize, int& afterSize) 40 41 { 41 42 IntRect firstButton = backButtonRect(scrollbar, BackButtonStartPart); … … 52 53 } 53 54 54 bool RenderScrollbarTheme::hasButtons(Scrollbar * scrollbar)55 bool RenderScrollbarTheme::hasButtons(ScrollbarThemeClient* scrollbar) 55 56 { 56 57 int startSize; … … 60 61 } 61 62 62 bool RenderScrollbarTheme::hasThumb(Scrollbar * scrollbar)63 bool RenderScrollbarTheme::hasThumb(ScrollbarThemeClient* scrollbar) 63 64 { 64 65 return trackLength(scrollbar) - thumbLength(scrollbar) >= 0; 65 66 } 66 67 67 int RenderScrollbarTheme::minimumThumbLength(Scrollbar * scrollbar)68 int RenderScrollbarTheme::minimumThumbLength(ScrollbarThemeClient* scrollbar) 68 69 { 69 70 return toRenderScrollbar(scrollbar)->minimumThumbLength(); 70 71 } 71 72 72 IntRect RenderScrollbarTheme::backButtonRect(Scrollbar * scrollbar, ScrollbarPart partType, bool)73 IntRect RenderScrollbarTheme::backButtonRect(ScrollbarThemeClient* scrollbar, ScrollbarPart partType, bool) 73 74 { 74 75 return toRenderScrollbar(scrollbar)->buttonRect(partType); 75 76 } 76 77 77 IntRect RenderScrollbarTheme::forwardButtonRect(Scrollbar * scrollbar, ScrollbarPart partType, bool)78 IntRect RenderScrollbarTheme::forwardButtonRect(ScrollbarThemeClient* scrollbar, ScrollbarPart partType, bool) 78 79 { 79 80 return toRenderScrollbar(scrollbar)->buttonRect(partType); 80 81 } 81 82 82 IntRect RenderScrollbarTheme::trackRect(Scrollbar * scrollbar, bool)83 IntRect RenderScrollbarTheme::trackRect(ScrollbarThemeClient* scrollbar, bool) 83 84 { 84 85 if (!hasButtons(scrollbar)) … … 92 93 } 93 94 94 IntRect RenderScrollbarTheme::constrainTrackRectToTrackPieces(Scrollbar * scrollbar, const IntRect& rect)95 IntRect RenderScrollbarTheme::constrainTrackRectToTrackPieces(ScrollbarThemeClient* scrollbar, const IntRect& rect) 95 96 { 96 97 IntRect backRect = toRenderScrollbar(scrollbar)->trackPieceRectWithMargins(BackTrackPart, rect); … … 113 114 } 114 115 115 void RenderScrollbarTheme::paintScrollbarBackground(GraphicsContext* context, Scrollbar * scrollbar)116 void RenderScrollbarTheme::paintScrollbarBackground(GraphicsContext* context, ScrollbarThemeClient* scrollbar) 116 117 { 117 118 toRenderScrollbar(scrollbar)->paintPart(context, ScrollbarBGPart, scrollbar->frameRect()); 118 119 } 119 120 120 void RenderScrollbarTheme::paintTrackBackground(GraphicsContext* context, Scrollbar * scrollbar, const IntRect& rect)121 void RenderScrollbarTheme::paintTrackBackground(GraphicsContext* context, ScrollbarThemeClient* scrollbar, const IntRect& rect) 121 122 { 122 123 toRenderScrollbar(scrollbar)->paintPart(context, TrackBGPart, rect); 123 124 } 124 125 125 void RenderScrollbarTheme::paintTrackPiece(GraphicsContext* context, Scrollbar * scrollbar, const IntRect& rect, ScrollbarPart part)126 void RenderScrollbarTheme::paintTrackPiece(GraphicsContext* context, ScrollbarThemeClient* scrollbar, const IntRect& rect, ScrollbarPart part) 126 127 { 127 128 toRenderScrollbar(scrollbar)->paintPart(context, part, rect); 128 129 } 129 130 130 void RenderScrollbarTheme::paintButton(GraphicsContext* context, Scrollbar * scrollbar, const IntRect& rect, ScrollbarPart part)131 void RenderScrollbarTheme::paintButton(GraphicsContext* context, ScrollbarThemeClient* scrollbar, const IntRect& rect, ScrollbarPart part) 131 132 { 132 133 toRenderScrollbar(scrollbar)->paintPart(context, part, rect); 133 134 } 134 135 135 void RenderScrollbarTheme::paintThumb(GraphicsContext* context, Scrollbar * scrollbar, const IntRect& rect)136 void RenderScrollbarTheme::paintThumb(GraphicsContext* context, ScrollbarThemeClient* scrollbar, const IntRect& rect) 136 137 { 137 138 toRenderScrollbar(scrollbar)->paintPart(context, ThumbPart, rect); -
trunk/Source/WebCore/rendering/RenderScrollbarTheme.h
r97227 r109451 47 47 virtual void paintScrollCorner(ScrollView*, GraphicsContext* context, const IntRect& cornerRect); 48 48 49 virtual bool shouldCenterOnThumb(Scrollbar * scrollbar, const PlatformMouseEvent& event) { return ScrollbarTheme::theme()->shouldCenterOnThumb(scrollbar, event); }49 virtual bool shouldCenterOnThumb(ScrollbarThemeClient* scrollbar, const PlatformMouseEvent& event) { return ScrollbarTheme::theme()->shouldCenterOnThumb(scrollbar, event); } 50 50 51 51 virtual double initialAutoscrollTimerDelay() { return ScrollbarTheme::theme()->initialAutoscrollTimerDelay(); } 52 52 virtual double autoscrollTimerDelay() { return ScrollbarTheme::theme()->autoscrollTimerDelay(); } 53 53 54 virtual void registerScrollbar(Scrollbar * scrollbar) { return ScrollbarTheme::theme()->registerScrollbar(scrollbar); }55 virtual void unregisterScrollbar(Scrollbar * scrollbar) { return ScrollbarTheme::theme()->unregisterScrollbar(scrollbar); }54 virtual void registerScrollbar(ScrollbarThemeClient* scrollbar) { return ScrollbarTheme::theme()->registerScrollbar(scrollbar); } 55 virtual void unregisterScrollbar(ScrollbarThemeClient* scrollbar) { return ScrollbarTheme::theme()->unregisterScrollbar(scrollbar); } 56 56 57 virtual int minimumThumbLength(Scrollbar *);57 virtual int minimumThumbLength(ScrollbarThemeClient*); 58 58 59 void buttonSizesAlongTrackAxis(Scrollbar * scrollbar, int& beforeSize, int& afterSize);59 void buttonSizesAlongTrackAxis(ScrollbarThemeClient*, int& beforeSize, int& afterSize); 60 60 61 61 static RenderScrollbarTheme* renderScrollbarTheme(); 62 62 63 63 protected: 64 virtual bool hasButtons(Scrollbar *);65 virtual bool hasThumb(Scrollbar *);64 virtual bool hasButtons(ScrollbarThemeClient*); 65 virtual bool hasThumb(ScrollbarThemeClient*); 66 66 67 virtual IntRect backButtonRect(Scrollbar *, ScrollbarPart, bool painting = false);68 virtual IntRect forwardButtonRect(Scrollbar *, ScrollbarPart, bool painting = false);69 virtual IntRect trackRect(Scrollbar *, bool painting = false);67 virtual IntRect backButtonRect(ScrollbarThemeClient*, ScrollbarPart, bool painting = false); 68 virtual IntRect forwardButtonRect(ScrollbarThemeClient*, ScrollbarPart, bool painting = false); 69 virtual IntRect trackRect(ScrollbarThemeClient*, bool painting = false); 70 70 71 virtual void paintScrollbarBackground(GraphicsContext*, Scrollbar *);72 virtual void paintTrackBackground(GraphicsContext*, Scrollbar *, const IntRect&);73 virtual void paintTrackPiece(GraphicsContext*, Scrollbar *, const IntRect&, ScrollbarPart);74 virtual void paintButton(GraphicsContext*, Scrollbar *, const IntRect&, ScrollbarPart);75 virtual void paintThumb(GraphicsContext*, Scrollbar *, const IntRect&);71 virtual void paintScrollbarBackground(GraphicsContext*, ScrollbarThemeClient*); 72 virtual void paintTrackBackground(GraphicsContext*, ScrollbarThemeClient*, const IntRect&); 73 virtual void paintTrackPiece(GraphicsContext*, ScrollbarThemeClient*, const IntRect&, ScrollbarPart); 74 virtual void paintButton(GraphicsContext*, ScrollbarThemeClient*, const IntRect&, ScrollbarPart); 75 virtual void paintThumb(GraphicsContext*, ScrollbarThemeClient*, const IntRect&); 76 76 77 virtual IntRect constrainTrackRectToTrackPieces(Scrollbar *, const IntRect&);77 virtual IntRect constrainTrackRectToTrackPieces(ScrollbarThemeClient*, const IntRect&); 78 78 }; 79 79
Note: See TracChangeset
for help on using the changeset viewer.