| 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 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 152 IntPoint adjustScrollPositionWithinRange(const IntPoint&) const; | 152 IntPoint adjustScrollPositionWithinRange(const IntPoint&) const; |
| 153 int scrollX() const { return scrollPosition().x(); } | 153 int scrollX() const { return scrollPosition().x(); } |
| 154 int scrollY() const { return scrollPosition().y(); } | 154 int scrollY() const { return scrollPosition().y(); } |
| 155 | 155 |
| 156 virtual IntSize overhangAmount() const OVERRIDE; | 156 virtual IntSize overhangAmount() const OVERRIDE; |
| 157 | 157 |
| 158 void cacheCurrentScrollPosition() { m_cachedScrollPosition = scrollPosition(
); } | 158 void cacheCurrentScrollPosition() { m_cachedScrollPosition = scrollPosition(
); } |
| 159 IntPoint cachedScrollPosition() const { return m_cachedScrollPosition; } | 159 IntPoint cachedScrollPosition() const { return m_cachedScrollPosition; } |
| 160 | 160 |
| 161 // Functions for scrolling the view. | 161 // Functions for scrolling the view. |
| 162 virtual void setScrollPosition(const IntPoint&); | 162 virtual void setScrollPosition(const IntPoint&, ScrollBehavior = ScrollBehav
iorInstant); |
| 163 void scrollBy(const IntSize& s) { return setScrollPosition(scrollPosition()
+ s); } | 163 void scrollBy(const IntSize& s, ScrollBehavior behavior = ScrollBehaviorInst
ant) |
| 164 { |
| 165 return setScrollPosition(scrollPosition() + s, behavior); |
| 166 } |
| 164 | 167 |
| 165 bool scroll(ScrollDirection, ScrollGranularity); | 168 bool scroll(ScrollDirection, ScrollGranularity); |
| 166 | 169 |
| 167 // Scroll the actual contents of the view (either blitting or invalidating a
s needed). | 170 // Scroll the actual contents of the view (either blitting or invalidating a
s needed). |
| 168 void scrollContents(const IntSize& scrollDelta); | 171 void scrollContents(const IntSize& scrollDelta); |
| 169 | 172 |
| 170 // This gives us a means of blocking painting on our scrollbars until the fi
rst layout has occurred. | 173 // This gives us a means of blocking painting on our scrollbars until the fi
rst layout has occurred. |
| 171 void setScrollbarsSuppressed(bool suppressed, bool repaintOnUnsuppress = fal
se); | 174 void setScrollbarsSuppressed(bool suppressed, bool repaintOnUnsuppress = fal
se); |
| 172 bool scrollbarsSuppressed() const { return m_scrollbarsSuppressed; } | 175 bool scrollbarsSuppressed() const { return m_scrollbarsSuppressed; } |
| 173 | 176 |
| (...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 340 | 343 |
| 341 void calculateOverhangAreasForPainting(IntRect& horizontalOverhangRect, IntR
ect& verticalOverhangRect); | 344 void calculateOverhangAreasForPainting(IntRect& horizontalOverhangRect, IntR
ect& verticalOverhangRect); |
| 342 void updateOverhangAreas(); | 345 void updateOverhangAreas(); |
| 343 }; // class ScrollView | 346 }; // class ScrollView |
| 344 | 347 |
| 345 DEFINE_TYPE_CASTS(ScrollView, Widget, widget, widget->isScrollView(), widget.isS
crollView()); | 348 DEFINE_TYPE_CASTS(ScrollView, Widget, widget, widget->isScrollView(), widget.isS
crollView()); |
| 346 | 349 |
| 347 } // namespace WebCore | 350 } // namespace WebCore |
| 348 | 351 |
| 349 #endif // ScrollView_h | 352 #endif // ScrollView_h |
| OLD | NEW |