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 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
65 | 65 |
66 // Functions for child manipulation and inspection. | 66 // Functions for child manipulation and inspection. |
67 const HashSet<RefPtr<Widget> >* children() const { return &m_children; } | 67 const HashSet<RefPtr<Widget> >* children() const { return &m_children; } |
68 virtual void addChild(PassRefPtr<Widget>); | 68 virtual void addChild(PassRefPtr<Widget>); |
69 virtual void removeChild(Widget*); | 69 virtual void removeChild(Widget*); |
70 | 70 |
71 // If the scroll view does not use a native widget, then it will have cross-
platform Scrollbars. These functions | 71 // If the scroll view does not use a native widget, then it will have cross-
platform Scrollbars. These functions |
72 // can be used to obtain those scrollbars. | 72 // can be used to obtain those scrollbars. |
73 virtual Scrollbar* horizontalScrollbar() const OVERRIDE { return m_horizonta
lScrollbar.get(); } | 73 virtual Scrollbar* horizontalScrollbar() const OVERRIDE { return m_horizonta
lScrollbar.get(); } |
74 virtual Scrollbar* verticalScrollbar() const OVERRIDE { return m_verticalScr
ollbar.get(); } | 74 virtual Scrollbar* verticalScrollbar() const OVERRIDE { return m_verticalScr
ollbar.get(); } |
75 bool isScrollViewScrollbar(const Widget* child) const { return horizontalScr
ollbar() == child || verticalScrollbar() == child; } | 75 virtual bool isScrollViewScrollbar(const Widget* child) const OVERRIDE { ret
urn horizontalScrollbar() == child || verticalScrollbar() == child; } |
76 | 76 |
77 void positionScrollbarLayers(); | 77 void positionScrollbarLayers(); |
78 | 78 |
79 // Functions for setting and retrieving the scrolling mode in each axis (hor
izontal/vertical). The mode has values of | 79 // Functions for setting and retrieving the scrolling mode in each axis (hor
izontal/vertical). The mode has values of |
80 // AlwaysOff, AlwaysOn, and Auto. AlwaysOff means never show a scrollbar, Al
waysOn means always show a scrollbar. | 80 // AlwaysOff, AlwaysOn, and Auto. AlwaysOff means never show a scrollbar, Al
waysOn means always show a scrollbar. |
81 // Auto means show a scrollbar only when one is needed. | 81 // Auto means show a scrollbar only when one is needed. |
82 // Note that for platforms with native widgets, these modes are considered a
dvisory. In other words the underlying native | 82 // Note that for platforms with native widgets, these modes are considered a
dvisory. In other words the underlying native |
83 // widget may choose not to honor the requested modes. | 83 // widget may choose not to honor the requested modes. |
84 void setScrollbarModes(ScrollbarMode horizontalMode, ScrollbarMode verticalM
ode, bool horizontalLock = false, bool verticalLock = false); | 84 void setScrollbarModes(ScrollbarMode horizontalMode, ScrollbarMode verticalM
ode, bool horizontalLock = false, bool verticalLock = false); |
85 void setHorizontalScrollbarMode(ScrollbarMode mode, bool lock = false) { set
ScrollbarModes(mode, verticalScrollbarMode(), lock, verticalScrollbarLock()); } | 85 void setHorizontalScrollbarMode(ScrollbarMode mode, bool lock = false) { set
ScrollbarModes(mode, verticalScrollbarMode(), lock, verticalScrollbarLock()); } |
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
280 // Subclassed by FrameView to check the writing-mode of the document. | 280 // Subclassed by FrameView to check the writing-mode of the document. |
281 virtual bool isVerticalDocument() const { return true; } | 281 virtual bool isVerticalDocument() const { return true; } |
282 virtual bool isFlippedDocument() const { return false; } | 282 virtual bool isFlippedDocument() const { return false; } |
283 | 283 |
284 enum ComputeScrollbarExistenceOption { | 284 enum ComputeScrollbarExistenceOption { |
285 FirstPass, | 285 FirstPass, |
286 Incremental | 286 Incremental |
287 }; | 287 }; |
288 void computeScrollbarExistence(bool& newHasHorizontalScrollbar, bool& newHas
VerticalScrollbar, const IntSize& docSize, ComputeScrollbarExistenceOption = Fir
stPass) const; | 288 void computeScrollbarExistence(bool& newHasHorizontalScrollbar, bool& newHas
VerticalScrollbar, const IntSize& docSize, ComputeScrollbarExistenceOption = Fir
stPass) const; |
289 void updateScrollbarGeometry(); | 289 void updateScrollbarGeometry(); |
| 290 IntRect adjustScrollbarRectForResizer(const IntRect&, Scrollbar*); |
290 | 291 |
291 // Called to update the scrollbars to accurately reflect the state of the vi
ew. | 292 // Called to update the scrollbars to accurately reflect the state of the vi
ew. |
292 void updateScrollbars(const IntSize& desiredOffset); | 293 void updateScrollbars(const IntSize& desiredOffset); |
293 | 294 |
294 IntSize excludeScrollbars(const IntSize&) const; | 295 IntSize excludeScrollbars(const IntSize&) const; |
295 | 296 |
296 class InUpdateScrollbarsScope { | 297 class InUpdateScrollbarsScope { |
297 public: | 298 public: |
298 explicit InUpdateScrollbarsScope(ScrollView* view) | 299 explicit InUpdateScrollbarsScope(ScrollView* view) |
299 : m_scope(view->m_inUpdateScrollbars, true) | 300 : m_scope(view->m_inUpdateScrollbars, true) |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
344 | 345 |
345 void calculateOverhangAreasForPainting(IntRect& horizontalOverhangRect, IntR
ect& verticalOverhangRect); | 346 void calculateOverhangAreasForPainting(IntRect& horizontalOverhangRect, IntR
ect& verticalOverhangRect); |
346 void updateOverhangAreas(); | 347 void updateOverhangAreas(); |
347 }; // class ScrollView | 348 }; // class ScrollView |
348 | 349 |
349 DEFINE_TYPE_CASTS(ScrollView, Widget, widget, widget->isScrollView(), widget.isS
crollView()); | 350 DEFINE_TYPE_CASTS(ScrollView, Widget, widget, widget->isScrollView(), widget.isS
crollView()); |
350 | 351 |
351 } // namespace blink | 352 } // namespace blink |
352 | 353 |
353 #endif // ScrollView_h | 354 #endif // ScrollView_h |
OLD | NEW |