| 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 17 matching lines...) Expand all Loading... |
| 28 #define ScrollView_h | 28 #define ScrollView_h |
| 29 | 29 |
| 30 #include "platform/PlatformExport.h" | 30 #include "platform/PlatformExport.h" |
| 31 #include "platform/Widget.h" | 31 #include "platform/Widget.h" |
| 32 #include "platform/geometry/IntRect.h" | 32 #include "platform/geometry/IntRect.h" |
| 33 #include "platform/scroll/ScrollTypes.h" | 33 #include "platform/scroll/ScrollTypes.h" |
| 34 #include "platform/scroll/ScrollableArea.h" | 34 #include "platform/scroll/ScrollableArea.h" |
| 35 #include "platform/scroll/Scrollbar.h" | 35 #include "platform/scroll/Scrollbar.h" |
| 36 | 36 |
| 37 #include "wtf/HashSet.h" | 37 #include "wtf/HashSet.h" |
| 38 #include "wtf/TemporaryChange.h" |
| 38 | 39 |
| 39 namespace WebCore { | 40 namespace WebCore { |
| 40 | 41 |
| 41 class HostWindow; | 42 class HostWindow; |
| 42 class Scrollbar; | 43 class Scrollbar; |
| 43 | 44 |
| 44 class PLATFORM_EXPORT ScrollView : public Widget, public ScrollableArea { | 45 class PLATFORM_EXPORT ScrollView : public Widget, public ScrollableArea { |
| 45 public: | 46 public: |
| 46 virtual ~ScrollView(); | 47 virtual ~ScrollView(); |
| 47 | 48 |
| (...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 287 Incremental | 288 Incremental |
| 288 }; | 289 }; |
| 289 void computeScrollbarExistence(bool& newHasHorizontalScrollbar, bool& newHas
VerticalScrollbar, ComputeScrollbarExistenceOption = FirstPass) const; | 290 void computeScrollbarExistence(bool& newHasHorizontalScrollbar, bool& newHas
VerticalScrollbar, ComputeScrollbarExistenceOption = FirstPass) const; |
| 290 void updateScrollbarGeometry(); | 291 void updateScrollbarGeometry(); |
| 291 | 292 |
| 292 // Called to update the scrollbars to accurately reflect the state of the vi
ew. | 293 // Called to update the scrollbars to accurately reflect the state of the vi
ew. |
| 293 void updateScrollbars(const IntSize& desiredOffset); | 294 void updateScrollbars(const IntSize& desiredOffset); |
| 294 | 295 |
| 295 IntSize excludeScrollbars(const IntSize&) const; | 296 IntSize excludeScrollbars(const IntSize&) const; |
| 296 | 297 |
| 298 class InUpdateScrollbarsScope { |
| 299 public: |
| 300 explicit InUpdateScrollbarsScope(ScrollView* view) |
| 301 : m_scope(view->m_inUpdateScrollbars, true) |
| 302 { } |
| 303 private: |
| 304 TemporaryChange<bool> m_scope; |
| 305 }; |
| 306 |
| 297 private: | 307 private: |
| 298 bool adjustScrollbarExistence(ComputeScrollbarExistenceOption = FirstPass); | 308 bool adjustScrollbarExistence(ComputeScrollbarExistenceOption = FirstPass); |
| 299 | 309 |
| 300 RefPtr<Scrollbar> m_horizontalScrollbar; | 310 RefPtr<Scrollbar> m_horizontalScrollbar; |
| 301 RefPtr<Scrollbar> m_verticalScrollbar; | 311 RefPtr<Scrollbar> m_verticalScrollbar; |
| 302 ScrollbarMode m_horizontalScrollbarMode; | 312 ScrollbarMode m_horizontalScrollbarMode; |
| 303 ScrollbarMode m_verticalScrollbarMode; | 313 ScrollbarMode m_verticalScrollbarMode; |
| 304 | 314 |
| 305 bool m_horizontalScrollbarLock; | 315 bool m_horizontalScrollbarLock; |
| 306 bool m_verticalScrollbarLock; | 316 bool m_verticalScrollbarLock; |
| (...skipping 23 matching lines...) Expand all Loading... |
| 330 | 340 |
| 331 void calculateOverhangAreasForPainting(IntRect& horizontalOverhangRect, IntR
ect& verticalOverhangRect); | 341 void calculateOverhangAreasForPainting(IntRect& horizontalOverhangRect, IntR
ect& verticalOverhangRect); |
| 332 void updateOverhangAreas(); | 342 void updateOverhangAreas(); |
| 333 }; // class ScrollView | 343 }; // class ScrollView |
| 334 | 344 |
| 335 DEFINE_TYPE_CASTS(ScrollView, Widget, widget, widget->isScrollView(), widget.isS
crollView()); | 345 DEFINE_TYPE_CASTS(ScrollView, Widget, widget, widget->isScrollView(), widget.isS
crollView()); |
| 336 | 346 |
| 337 } // namespace WebCore | 347 } // namespace WebCore |
| 338 | 348 |
| 339 #endif // ScrollView_h | 349 #endif // ScrollView_h |
| OLD | NEW |