| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2004, 2006, 2007, 2008 Apple Inc. All rights reserved. | 2 * Copyright (C) 2004, 2006, 2007, 2008 Apple Inc. All rights reserved. |
| 3 * Copyright (C) 2009 Holger Hans Peter Freyther | 3 * Copyright (C) 2009 Holger Hans Peter Freyther |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
| 7 * are met: | 7 * are met: |
| 8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
| (...skipping 25 matching lines...) Expand all Loading... |
| 36 | 36 |
| 37 #include "wtf/HashSet.h" | 37 #include "wtf/HashSet.h" |
| 38 | 38 |
| 39 namespace WebCore { | 39 namespace WebCore { |
| 40 | 40 |
| 41 class HostWindow; | 41 class HostWindow; |
| 42 class Scrollbar; | 42 class Scrollbar; |
| 43 | 43 |
| 44 class PLATFORM_EXPORT ScrollView : public Widget, public ScrollableArea { | 44 class PLATFORM_EXPORT ScrollView : public Widget, public ScrollableArea { |
| 45 public: | 45 public: |
| 46 ~ScrollView(); | 46 virtual ~ScrollView(); |
| 47 | 47 |
| 48 // ScrollableArea functions. | 48 // ScrollableArea functions. |
| 49 virtual int scrollSize(ScrollbarOrientation) const OVERRIDE; | 49 virtual int scrollSize(ScrollbarOrientation) const OVERRIDE; |
| 50 virtual void setScrollOffset(const IntPoint&) OVERRIDE; | 50 virtual void setScrollOffset(const IntPoint&) OVERRIDE; |
| 51 virtual bool isScrollCornerVisible() const OVERRIDE; | 51 virtual bool isScrollCornerVisible() const OVERRIDE; |
| 52 virtual void scrollbarStyleChanged(int newStyle, bool forceUpdate) OVERRIDE; | 52 virtual void scrollbarStyleChanged(int newStyle, bool forceUpdate) OVERRIDE; |
| 53 virtual bool userInputScrollable(ScrollbarOrientation) const OVERRIDE; | 53 virtual bool userInputScrollable(ScrollbarOrientation) const OVERRIDE; |
| 54 virtual bool shouldPlaceVerticalScrollbarOnLeft() const OVERRIDE; | 54 virtual bool shouldPlaceVerticalScrollbarOnLeft() const OVERRIDE; |
| 55 | 55 |
| 56 virtual void notifyPageThatContentAreaWillPaint() const; | 56 virtual void notifyPageThatContentAreaWillPaint() const; |
| (...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 196 // These functions are used to enable scrollbars to avoid window resizer con
trols that overlap the scroll view. This happens on Mac | 196 // These functions are used to enable scrollbars to avoid window resizer con
trols that overlap the scroll view. This happens on Mac |
| 197 // for example. | 197 // for example. |
| 198 virtual IntRect windowResizerRect() const { return IntRect(); } | 198 virtual IntRect windowResizerRect() const { return IntRect(); } |
| 199 bool containsScrollbarsAvoidingResizer() const; | 199 bool containsScrollbarsAvoidingResizer() const; |
| 200 void adjustScrollbarsAvoidingResizerCount(int overlapDelta); | 200 void adjustScrollbarsAvoidingResizerCount(int overlapDelta); |
| 201 void windowResizerRectChanged(); | 201 void windowResizerRectChanged(); |
| 202 | 202 |
| 203 virtual void setParent(Widget*) OVERRIDE; // Overridden to update the overla
pping scrollbar count. | 203 virtual void setParent(Widget*) OVERRIDE; // Overridden to update the overla
pping scrollbar count. |
| 204 | 204 |
| 205 // Called when our frame rect changes (or the rect/scroll position of an anc
estor changes). | 205 // Called when our frame rect changes (or the rect/scroll position of an anc
estor changes). |
| 206 virtual void frameRectsChanged(); | 206 virtual void frameRectsChanged() OVERRIDE; |
| 207 | 207 |
| 208 // Widget override to update our scrollbars and notify our contents of the r
esize. | 208 // Widget override to update our scrollbars and notify our contents of the r
esize. |
| 209 virtual void setFrameRect(const IntRect&); | 209 virtual void setFrameRect(const IntRect&) OVERRIDE; |
| 210 | 210 |
| 211 // Widget override to notify our contents of a cliprect change. | 211 // Widget override to notify our contents of a cliprect change. |
| 212 virtual void clipRectChanged() OVERRIDE; | 212 virtual void clipRectChanged() OVERRIDE; |
| 213 | 213 |
| 214 // For platforms that need to hit test scrollbars from within the engine's e
vent handlers (like Win32). | 214 // For platforms that need to hit test scrollbars from within the engine's e
vent handlers (like Win32). |
| 215 Scrollbar* scrollbarAtPoint(const IntPoint& windowPoint); | 215 Scrollbar* scrollbarAtPoint(const IntPoint& windowPoint); |
| 216 | 216 |
| 217 virtual IntPoint convertChildToSelf(const Widget* child, const IntPoint& poi
nt) const OVERRIDE | 217 virtual IntPoint convertChildToSelf(const Widget* child, const IntPoint& poi
nt) const OVERRIDE |
| 218 { | 218 { |
| 219 IntPoint newPoint = point; | 219 IntPoint newPoint = point; |
| (...skipping 22 matching lines...) Expand all Loading... |
| 242 virtual void setParentVisible(bool) OVERRIDE; | 242 virtual void setParentVisible(bool) OVERRIDE; |
| 243 | 243 |
| 244 // Pan scrolling. | 244 // Pan scrolling. |
| 245 static const int noPanScrollRadius = 15; | 245 static const int noPanScrollRadius = 15; |
| 246 void addPanScrollIcon(const IntPoint&); | 246 void addPanScrollIcon(const IntPoint&); |
| 247 void removePanScrollIcon(); | 247 void removePanScrollIcon(); |
| 248 void paintPanScrollIcon(GraphicsContext*); | 248 void paintPanScrollIcon(GraphicsContext*); |
| 249 | 249 |
| 250 virtual bool isPointInScrollbarCorner(const IntPoint&); | 250 virtual bool isPointInScrollbarCorner(const IntPoint&); |
| 251 virtual bool scrollbarCornerPresent() const; | 251 virtual bool scrollbarCornerPresent() const; |
| 252 virtual IntRect scrollCornerRect() const; | 252 virtual IntRect scrollCornerRect() const OVERRIDE; |
| 253 virtual void paintScrollCorner(GraphicsContext*, const IntRect& cornerRect); | 253 virtual void paintScrollCorner(GraphicsContext*, const IntRect& cornerRect); |
| 254 virtual void paintScrollbar(GraphicsContext*, Scrollbar*, const IntRect&); | 254 virtual void paintScrollbar(GraphicsContext*, Scrollbar*, const IntRect&); |
| 255 | 255 |
| 256 virtual IntRect convertFromScrollbarToContainingView(const Scrollbar*, const
IntRect&) const OVERRIDE; | 256 virtual IntRect convertFromScrollbarToContainingView(const Scrollbar*, const
IntRect&) const OVERRIDE; |
| 257 virtual IntRect convertFromContainingViewToScrollbar(const Scrollbar*, const
IntRect&) const OVERRIDE; | 257 virtual IntRect convertFromContainingViewToScrollbar(const Scrollbar*, const
IntRect&) const OVERRIDE; |
| 258 virtual IntPoint convertFromScrollbarToContainingView(const Scrollbar*, cons
t IntPoint&) const OVERRIDE; | 258 virtual IntPoint convertFromScrollbarToContainingView(const Scrollbar*, cons
t IntPoint&) const OVERRIDE; |
| 259 virtual IntPoint convertFromContainingViewToScrollbar(const Scrollbar*, cons
t IntPoint&) const OVERRIDE; | 259 virtual IntPoint convertFromContainingViewToScrollbar(const Scrollbar*, cons
t IntPoint&) const OVERRIDE; |
| 260 | 260 |
| 261 void calculateAndPaintOverhangAreas(GraphicsContext*, const IntRect& dirtyRe
ct); | 261 void calculateAndPaintOverhangAreas(GraphicsContext*, const IntRect& dirtyRe
ct); |
| 262 void calculateAndPaintOverhangBackground(GraphicsContext*, const IntRect& di
rtyRect); | 262 void calculateAndPaintOverhangBackground(GraphicsContext*, const IntRect& di
rtyRect); |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 331 | 331 |
| 332 IntRect rectToCopyOnScroll() const; | 332 IntRect rectToCopyOnScroll() const; |
| 333 | 333 |
| 334 // Called when the scroll position within this view changes. FrameView over
rides this to generate repaint invalidations. | 334 // Called when the scroll position within this view changes. FrameView over
rides this to generate repaint invalidations. |
| 335 virtual void repaintFixedElementsAfterScrolling() { } | 335 virtual void repaintFixedElementsAfterScrolling() { } |
| 336 virtual void updateFixedElementsAfterScrolling() { } | 336 virtual void updateFixedElementsAfterScrolling() { } |
| 337 | 337 |
| 338 void calculateOverhangAreasForPainting(IntRect& horizontalOverhangRect, IntR
ect& verticalOverhangRect); | 338 void calculateOverhangAreasForPainting(IntRect& horizontalOverhangRect, IntR
ect& verticalOverhangRect); |
| 339 void updateOverhangAreas(); | 339 void updateOverhangAreas(); |
| 340 | 340 |
| 341 int pageStep(ScrollbarOrientation) const; | 341 virtual int pageStep(ScrollbarOrientation) const OVERRIDE; |
| 342 }; // class ScrollView | 342 }; // class ScrollView |
| 343 | 343 |
| 344 DEFINE_TYPE_CASTS(ScrollView, Widget, widget, widget->isScrollView(), widget.isS
crollView()); | 344 DEFINE_TYPE_CASTS(ScrollView, Widget, widget, widget->isScrollView(), widget.isS
crollView()); |
| 345 | 345 |
| 346 } // namespace WebCore | 346 } // namespace WebCore |
| 347 | 347 |
| 348 #endif // ScrollView_h | 348 #endif // ScrollView_h |
| OLD | NEW |