OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2001 Peter Kelly (pmk@post.com) | 2 * Copyright (C) 2001 Peter Kelly (pmk@post.com) |
3 * Copyright (C) 2001 Tobias Anton (anton@stud.fbi.fh-darmstadt.de) | 3 * Copyright (C) 2001 Tobias Anton (anton@stud.fbi.fh-darmstadt.de) |
4 * Copyright (C) 2006 Samuel Weinig (sam.weinig@gmail.com) | 4 * Copyright (C) 2006 Samuel Weinig (sam.weinig@gmail.com) |
5 * Copyright (C) 2003, 2004, 2005, 2006, 2008, 2010 Apple Inc. All rights reserv
ed. | 5 * Copyright (C) 2003, 2004, 2005, 2006, 2008, 2010 Apple Inc. All rights reserv
ed. |
6 * Copyright (C) 2013 Samsung Electronics. All rights reserved. | 6 * Copyright (C) 2013 Samsung Electronics. All rights reserved. |
7 * | 7 * |
8 * This library is free software; you can redistribute it and/or | 8 * This library is free software; you can redistribute it and/or |
9 * modify it under the terms of the GNU Library General Public | 9 * modify it under the terms of the GNU Library General Public |
10 * License as published by the Free Software Foundation; either | 10 * License as published by the Free Software Foundation; either |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
66 | 66 |
67 static PassRefPtrWillBeRawPtr<WheelEvent> create(const FloatPoint& wheelTick
s, | 67 static PassRefPtrWillBeRawPtr<WheelEvent> create(const FloatPoint& wheelTick
s, |
68 const FloatPoint& rawDelta, unsigned deltaMode, PassRefPtrWillBeRawPtr<A
bstractView> view, | 68 const FloatPoint& rawDelta, unsigned deltaMode, PassRefPtrWillBeRawPtr<A
bstractView> view, |
69 const IntPoint& screenLocation, const IntPoint& pageLocation, | 69 const IntPoint& screenLocation, const IntPoint& pageLocation, |
70 bool ctrlKey, bool altKey, bool shiftKey, bool metaKey) | 70 bool ctrlKey, bool altKey, bool shiftKey, bool metaKey) |
71 { | 71 { |
72 return adoptRefWillBeNoop(new WheelEvent(wheelTicks, rawDelta, deltaMode
, view, | 72 return adoptRefWillBeNoop(new WheelEvent(wheelTicks, rawDelta, deltaMode
, view, |
73 screenLocation, pageLocation, ctrlKey, altKey, shiftKey, metaKey)); | 73 screenLocation, pageLocation, ctrlKey, altKey, shiftKey, metaKey)); |
74 } | 74 } |
75 | 75 |
76 void initWheelEvent(int rawDeltaX, int rawDeltaY, PassRefPtrWillBeRawPtr<Abs
tractView>, | |
77 int screenX, int screenY, int pageX, int pageY, | |
78 bool ctrlKey, bool altKey, bool shiftKey, bool metaKey); | |
79 | |
80 void initWebKitWheelEvent(int rawDeltaX, int rawDeltaY, PassRefPtrWillBeRawP
tr<AbstractView>, | |
81 int screenX, int screenY, int pageX, int pageY, | |
82 bool ctrlKey, bool altKey, bool shiftKey, bool metaKey); | |
83 | |
84 double deltaX() const { return m_deltaX; } // Positive when scrolling right. | 76 double deltaX() const { return m_deltaX; } // Positive when scrolling right. |
85 double deltaY() const { return m_deltaY; } // Positive when scrolling down. | 77 double deltaY() const { return m_deltaY; } // Positive when scrolling down. |
86 double deltaZ() const { return m_deltaZ; } | 78 double deltaZ() const { return m_deltaZ; } |
87 int wheelDelta() const { return wheelDeltaY() ? wheelDeltaY() : wheelDeltaX(
); } // Deprecated. | 79 int wheelDelta() const { return wheelDeltaY() ? wheelDeltaY() : wheelDeltaX(
); } // Deprecated. |
88 int wheelDeltaX() const { return m_wheelDelta.x(); } // Deprecated, negative
when scrolling right. | 80 int wheelDeltaX() const { return m_wheelDelta.x(); } // Deprecated, negative
when scrolling right. |
89 int wheelDeltaY() const { return m_wheelDelta.y(); } // Deprecated, negative
when scrolling down. | 81 int wheelDeltaY() const { return m_wheelDelta.y(); } // Deprecated, negative
when scrolling down. |
90 unsigned deltaMode() const { return m_deltaMode; } | 82 unsigned deltaMode() const { return m_deltaMode; } |
91 float ticksX() const { return static_cast<float>(m_wheelDelta.x()) / TickMul
tiplier; } | 83 float ticksX() const { return static_cast<float>(m_wheelDelta.x()) / TickMul
tiplier; } |
92 float ticksY() const { return static_cast<float>(m_wheelDelta.y()) / TickMul
tiplier; } | 84 float ticksY() const { return static_cast<float>(m_wheelDelta.y()) / TickMul
tiplier; } |
93 | 85 |
(...skipping 26 matching lines...) Expand all Loading... |
120 static PassRefPtrWillBeRawPtr<WheelEventDispatchMediator> create(const Platf
ormWheelEvent&, PassRefPtrWillBeRawPtr<AbstractView>); | 112 static PassRefPtrWillBeRawPtr<WheelEventDispatchMediator> create(const Platf
ormWheelEvent&, PassRefPtrWillBeRawPtr<AbstractView>); |
121 private: | 113 private: |
122 WheelEventDispatchMediator(const PlatformWheelEvent&, PassRefPtrWillBeRawPtr
<AbstractView>); | 114 WheelEventDispatchMediator(const PlatformWheelEvent&, PassRefPtrWillBeRawPtr
<AbstractView>); |
123 WheelEvent* event() const; | 115 WheelEvent* event() const; |
124 virtual bool dispatchEvent(EventDispatcher*) const OVERRIDE; | 116 virtual bool dispatchEvent(EventDispatcher*) const OVERRIDE; |
125 }; | 117 }; |
126 | 118 |
127 } // namespace blink | 119 } // namespace blink |
128 | 120 |
129 #endif // WheelEvent_h | 121 #endif // WheelEvent_h |
OLD | NEW |