| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2008, 2011 Apple Inc. All Rights Reserved. | 2 * Copyright (C) 2008, 2011 Apple Inc. All Rights Reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
| 8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
| 9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
| 10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
| (...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 168 | 168 |
| 169 // Let subclasses provide a way of asking for and servicing scroll | 169 // Let subclasses provide a way of asking for and servicing scroll |
| 170 // animations. | 170 // animations. |
| 171 virtual bool scheduleAnimation() { return false; } | 171 virtual bool scheduleAnimation() { return false; } |
| 172 void serviceScrollAnimations(); | 172 void serviceScrollAnimations(); |
| 173 | 173 |
| 174 virtual bool usesCompositedScrolling() const { return false; } | 174 virtual bool usesCompositedScrolling() const { return false; } |
| 175 | 175 |
| 176 virtual void reportMemoryUsage(MemoryObjectInfo*) const; | 176 virtual void reportMemoryUsage(MemoryObjectInfo*) const; |
| 177 | 177 |
| 178 // Convenience functions |
| 179 int scrollPosition(ScrollbarOrientation orientation) { return orientation ==
HorizontalScrollbar ? scrollPosition().x() : scrollPosition().y(); } |
| 180 int minimumScrollPosition(ScrollbarOrientation orientation) { return orienta
tion == HorizontalScrollbar ? minimumScrollPosition().x() : minimumScrollPositio
n().y(); } |
| 181 int maximumScrollPosition(ScrollbarOrientation orientation) { return orienta
tion == HorizontalScrollbar ? maximumScrollPosition().x() : maximumScrollPositio
n().y(); } |
| 182 int clampScrollPosition(ScrollbarOrientation orientation, int pos) { return
std::max(std::min(pos, maximumScrollPosition(orientation)), minimumScrollPositi
on(orientation)); } |
| 183 |
| 178 protected: | 184 protected: |
| 179 ScrollableArea(); | 185 ScrollableArea(); |
| 180 virtual ~ScrollableArea(); | 186 virtual ~ScrollableArea(); |
| 181 | 187 |
| 182 void setScrollOrigin(const IntPoint&); | 188 void setScrollOrigin(const IntPoint&); |
| 183 void resetScrollOriginChanged() { m_scrollOriginChanged = false; } | 189 void resetScrollOriginChanged() { m_scrollOriginChanged = false; } |
| 184 | 190 |
| 185 virtual void invalidateScrollbarRect(Scrollbar*, const IntRect&) = 0; | 191 virtual void invalidateScrollbarRect(Scrollbar*, const IntRect&) = 0; |
| 186 virtual void invalidateScrollCornerRect(const IntRect&) = 0; | 192 virtual void invalidateScrollCornerRect(const IntRect&) = 0; |
| 187 | 193 |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 230 // vertical-lr / ltr NO NO | 236 // vertical-lr / ltr NO NO |
| 231 // vertical-lr / rtl NO YES | 237 // vertical-lr / rtl NO YES |
| 232 // vertical-rl / ltr YES NO | 238 // vertical-rl / ltr YES NO |
| 233 // vertical-rl / rtl YES YES | 239 // vertical-rl / rtl YES YES |
| 234 IntPoint m_scrollOrigin; | 240 IntPoint m_scrollOrigin; |
| 235 }; | 241 }; |
| 236 | 242 |
| 237 } // namespace WebCore | 243 } // namespace WebCore |
| 238 | 244 |
| 239 #endif // ScrollableArea_h | 245 #endif // ScrollableArea_h |
| OLD | NEW |