OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2006 Apple Computer, Inc. All rights reserved. | 2 * Copyright (C) 2006 Apple Computer, 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 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
45 | 45 |
46 enum ScrollDirectionPhysical { ScrollUp, ScrollDown, ScrollLeft, ScrollRight }; | 46 enum ScrollDirectionPhysical { ScrollUp, ScrollDown, ScrollLeft, ScrollRight }; |
47 | 47 |
48 enum ScrollType { | 48 enum ScrollType { |
49 UserScroll, | 49 UserScroll, |
50 ProgrammaticScroll, | 50 ProgrammaticScroll, |
51 CompositorScroll, | 51 CompositorScroll, |
52 AnchoringScroll | 52 AnchoringScroll |
53 }; | 53 }; |
54 | 54 |
55 // Convert logical scroll direction to physical. Physical scroll directions are
unaffected. | 55 // Convert logical scroll direction to physical. Physical scroll directions are |
| 56 // unaffected. |
56 inline ScrollDirectionPhysical toPhysicalDirection(ScrollDirection direction, | 57 inline ScrollDirectionPhysical toPhysicalDirection(ScrollDirection direction, |
57 bool isVertical, | 58 bool isVertical, |
58 bool isFlipped) { | 59 bool isFlipped) { |
59 switch (direction) { | 60 switch (direction) { |
60 case ScrollBlockDirectionBackward: { | 61 case ScrollBlockDirectionBackward: { |
61 if (isVertical) { | 62 if (isVertical) { |
62 if (!isFlipped) | 63 if (!isFlipped) |
63 return ScrollUp; | 64 return ScrollUp; |
64 return ScrollDown; | 65 return ScrollDown; |
65 } | 66 } |
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
177 ScrollbarOverlayStyleDark, | 178 ScrollbarOverlayStyleDark, |
178 ScrollbarOverlayStyleLight | 179 ScrollbarOverlayStyleLight |
179 }; | 180 }; |
180 | 181 |
181 enum ScrollBehavior { | 182 enum ScrollBehavior { |
182 ScrollBehaviorAuto, | 183 ScrollBehaviorAuto, |
183 ScrollBehaviorInstant, | 184 ScrollBehaviorInstant, |
184 ScrollBehaviorSmooth, | 185 ScrollBehaviorSmooth, |
185 }; | 186 }; |
186 | 187 |
187 // The result of an attempt to scroll. If didScroll is true, then unusedScrollDe
lta gives | 188 // The result of an attempt to scroll. If didScroll is true, then |
188 // the amount of the scroll delta that was not consumed by scrolling. | 189 // unusedScrollDelta gives the amount of the scroll delta that was not consumed |
| 190 // by scrolling. |
189 struct ScrollResult { | 191 struct ScrollResult { |
190 STACK_ALLOCATED(); | 192 STACK_ALLOCATED(); |
191 explicit ScrollResult() | 193 explicit ScrollResult() |
192 : didScrollX(false), | 194 : didScrollX(false), |
193 didScrollY(false), | 195 didScrollY(false), |
194 unusedScrollDeltaX(0), | 196 unusedScrollDeltaX(0), |
195 unusedScrollDeltaY(0) {} | 197 unusedScrollDeltaY(0) {} |
196 ScrollResult(bool didScrollX, | 198 ScrollResult(bool didScrollX, |
197 bool didScrollY, | 199 bool didScrollY, |
198 float unusedScrollDeltaX, | 200 float unusedScrollDeltaX, |
(...skipping 24 matching lines...) Expand all Loading... |
223 | 225 |
224 return (dir == ScrollLeft || dir == ScrollRight) ? FloatSize(delta, 0) | 226 return (dir == ScrollLeft || dir == ScrollRight) ? FloatSize(delta, 0) |
225 : FloatSize(0, delta); | 227 : FloatSize(0, delta); |
226 } | 228 } |
227 | 229 |
228 typedef unsigned ScrollbarControlPartMask; | 230 typedef unsigned ScrollbarControlPartMask; |
229 | 231 |
230 } // namespace blink | 232 } // namespace blink |
231 | 233 |
232 #endif | 234 #endif |
OLD | NEW |