OLD | NEW |
(Empty) | |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef WebMouseWheelEvent_h |
| 6 #define WebMouseWheelEvent_h |
| 7 |
| 8 #include "WebInputEvent.h" |
| 9 |
| 10 namespace blink { |
| 11 |
| 12 // See WebInputEvent.h for details why this pack is here. |
| 13 #pragma pack(push, 4) |
| 14 |
| 15 // WebMouseWheelEvent --------------------------------------------------------- |
| 16 |
| 17 class WebMouseWheelEvent : public WebMouseEvent { |
| 18 public: |
| 19 enum Phase { |
| 20 PhaseNone = 0, |
| 21 PhaseBegan = 1 << 0, |
| 22 PhaseStationary = 1 << 1, |
| 23 PhaseChanged = 1 << 2, |
| 24 PhaseEnded = 1 << 3, |
| 25 PhaseCancelled = 1 << 4, |
| 26 PhaseMayBegin = 1 << 5, |
| 27 }; |
| 28 |
| 29 float deltaX; |
| 30 float deltaY; |
| 31 float wheelTicksX; |
| 32 float wheelTicksY; |
| 33 |
| 34 float accelerationRatioX; |
| 35 float accelerationRatioY; |
| 36 |
| 37 // This field exists to allow BrowserPlugin to mark MouseWheel events as |
| 38 // 'resent' to handle the case where an event is not consumed when first |
| 39 // encountered; it should be handled differently by the plugin when it is |
| 40 // sent for thesecond time. No code within Blink touches this, other than to |
| 41 // plumb it through event conversions. |
| 42 int resendingPluginId; |
| 43 |
| 44 Phase phase; |
| 45 Phase momentumPhase; |
| 46 |
| 47 bool scrollByPage; |
| 48 bool hasPreciseScrollingDeltas; |
| 49 |
| 50 RailsMode railsMode; |
| 51 |
| 52 // Whether the event is blocking, non-blocking, all event |
| 53 // listeners were passive or was forced to be non-blocking. |
| 54 DispatchType dispatchType; |
| 55 |
| 56 WebMouseWheelEvent() |
| 57 : WebMouseEvent(sizeof(WebMouseWheelEvent)), |
| 58 deltaX(0.0f), |
| 59 deltaY(0.0f), |
| 60 wheelTicksX(0.0f), |
| 61 wheelTicksY(0.0f), |
| 62 accelerationRatioX(1.0f), |
| 63 accelerationRatioY(1.0f), |
| 64 resendingPluginId(-1), |
| 65 phase(PhaseNone), |
| 66 momentumPhase(PhaseNone), |
| 67 scrollByPage(false), |
| 68 hasPreciseScrollingDeltas(false), |
| 69 railsMode(RailsModeFree), |
| 70 dispatchType(Blocking) {} |
| 71 }; |
| 72 #pragma pack(pop) |
| 73 |
| 74 } // namespace blink |
| 75 |
| 76 #endif // WebMouseWheelEvent_h |
OLD | NEW |