| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2003, 2009 Apple Inc. All rights reserved. | 2 * Copyright (C) 2003, 2009 Apple Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Portions are Copyright (C) 1998 Netscape Communications Corporation. | 4 * Portions are Copyright (C) 1998 Netscape Communications Corporation. |
| 5 * | 5 * |
| 6 * Other contributors: | 6 * Other contributors: |
| 7 * Robert O'Callahan <roc+@cs.cmu.edu> | 7 * Robert O'Callahan <roc+@cs.cmu.edu> |
| 8 * David Baron <dbaron@fas.harvard.edu> | 8 * David Baron <dbaron@fas.harvard.edu> |
| 9 * Christian Biesinger <cbiesinger@web.de> | 9 * Christian Biesinger <cbiesinger@web.de> |
| 10 * Randall Jesup <rjesup@wgate.com> | 10 * Randall Jesup <rjesup@wgate.com> |
| (...skipping 27 matching lines...) Expand all Loading... |
| 38 * deletingthe provisions above and replace them with the notice and | 38 * deletingthe provisions above and replace them with the notice and |
| 39 * other provisions required by the MPL or the GPL, as the case may be. | 39 * other provisions required by the MPL or the GPL, as the case may be. |
| 40 * If you do not delete the provisions above, a recipient may use your | 40 * If you do not delete the provisions above, a recipient may use your |
| 41 * version of this file under any of the LGPL, the MPL or the GPL. | 41 * version of this file under any of the LGPL, the MPL or the GPL. |
| 42 */ | 42 */ |
| 43 | 43 |
| 44 #ifndef ScrollAlignment_h | 44 #ifndef ScrollAlignment_h |
| 45 #define ScrollAlignment_h | 45 #define ScrollAlignment_h |
| 46 | 46 |
| 47 #include "core/CoreExport.h" | 47 #include "core/CoreExport.h" |
| 48 #include "wtf/Allocator.h" |
| 48 | 49 |
| 49 namespace blink { | 50 namespace blink { |
| 50 | 51 |
| 51 enum ScrollAlignmentBehavior { | 52 enum ScrollAlignmentBehavior { |
| 52 ScrollAlignmentNoScroll, | 53 ScrollAlignmentNoScroll, |
| 53 ScrollAlignmentCenter, | 54 ScrollAlignmentCenter, |
| 54 ScrollAlignmentTop, | 55 ScrollAlignmentTop, |
| 55 ScrollAlignmentBottom, | 56 ScrollAlignmentBottom, |
| 56 ScrollAlignmentLeft, | 57 ScrollAlignmentLeft, |
| 57 ScrollAlignmentRight, | 58 ScrollAlignmentRight, |
| 58 ScrollAlignmentClosestEdge | 59 ScrollAlignmentClosestEdge |
| 59 }; | 60 }; |
| 60 | 61 |
| 61 class LayoutRect; | 62 class LayoutRect; |
| 62 | 63 |
| 63 struct CORE_EXPORT ScrollAlignment { | 64 struct CORE_EXPORT ScrollAlignment { |
| 65 STACK_ALLOCATED(); |
| 64 static ScrollAlignmentBehavior getVisibleBehavior(const ScrollAlignment& s)
{ return s.m_rectVisible; } | 66 static ScrollAlignmentBehavior getVisibleBehavior(const ScrollAlignment& s)
{ return s.m_rectVisible; } |
| 65 static ScrollAlignmentBehavior getPartialBehavior(const ScrollAlignment& s)
{ return s.m_rectPartial; } | 67 static ScrollAlignmentBehavior getPartialBehavior(const ScrollAlignment& s)
{ return s.m_rectPartial; } |
| 66 static ScrollAlignmentBehavior getHiddenBehavior(const ScrollAlignment& s) {
return s.m_rectHidden; } | 68 static ScrollAlignmentBehavior getHiddenBehavior(const ScrollAlignment& s) {
return s.m_rectHidden; } |
| 67 | 69 |
| 68 // FIXME: This function should probably go somewhere else but where? | 70 // FIXME: This function should probably go somewhere else but where? |
| 69 static LayoutRect getRectToExpose(const LayoutRect& visibleRect, const Layou
tRect& exposeRect, const ScrollAlignment& alignX, const ScrollAlignment& alignY)
; | 71 static LayoutRect getRectToExpose(const LayoutRect& visibleRect, const Layou
tRect& exposeRect, const ScrollAlignment& alignX, const ScrollAlignment& alignY)
; |
| 70 | 72 |
| 71 static const ScrollAlignment alignCenterIfNeeded; | 73 static const ScrollAlignment alignCenterIfNeeded; |
| 72 static const ScrollAlignment alignToEdgeIfNeeded; | 74 static const ScrollAlignment alignToEdgeIfNeeded; |
| 73 static const ScrollAlignment alignCenterAlways; | 75 static const ScrollAlignment alignCenterAlways; |
| 74 static const ScrollAlignment alignTopAlways; | 76 static const ScrollAlignment alignTopAlways; |
| 75 static const ScrollAlignment alignBottomAlways; | 77 static const ScrollAlignment alignBottomAlways; |
| 76 | 78 |
| 77 ScrollAlignmentBehavior m_rectVisible; | 79 ScrollAlignmentBehavior m_rectVisible; |
| 78 ScrollAlignmentBehavior m_rectHidden; | 80 ScrollAlignmentBehavior m_rectHidden; |
| 79 ScrollAlignmentBehavior m_rectPartial; | 81 ScrollAlignmentBehavior m_rectPartial; |
| 80 }; | 82 }; |
| 81 | 83 |
| 82 | 84 |
| 83 } // namespace blink | 85 } // namespace blink |
| 84 | 86 |
| 85 #endif // ScrollAlignment_h | 87 #endif // ScrollAlignment_h |
| OLD | NEW |