OLD | NEW |
(Empty) | |
| 1 // Copyright 2017 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 WebPointerEvent_h |
| 6 #define WebPointerEvent_h |
| 7 |
| 8 #include "WebInputEvent.h" |
| 9 #include "WebPointerProperties.h" |
| 10 #include "WebTouchEvent.h" |
| 11 |
| 12 namespace blink { |
| 13 |
| 14 // See WebInputEvent.h for details why this pack is here. |
| 15 #pragma pack(push, 4) |
| 16 |
| 17 // WebPointerEvent |
| 18 // This is a WIP and currently used only in Blink and only for touch. |
| 19 // TODO(nzolghadr): We should unify the fields in this class into |
| 20 // WebPointerProperties and not have pointertype specific attributes here. |
| 21 // -------------------------------------------------------------- |
| 22 |
| 23 class WebPointerEvent : public WebInputEvent, public WebPointerProperties { |
| 24 public: |
| 25 WebPointerEvent() |
| 26 : WebInputEvent(sizeof(WebPointerEvent)), WebPointerProperties(0) {} |
| 27 BLINK_PLATFORM_EXPORT WebPointerEvent(const WebTouchEvent&, |
| 28 const WebTouchPoint&); |
| 29 |
| 30 float width; |
| 31 float height; |
| 32 |
| 33 // ------------ Touch Point Specific ------------ |
| 34 |
| 35 float rotation_angle; |
| 36 |
| 37 // ------------ Touch Event Specific ------------ |
| 38 |
| 39 // Whether the event is blocking, non-blocking, all event |
| 40 // listeners were passive or was forced to be non-blocking. |
| 41 DispatchType dispatch_type; |
| 42 |
| 43 // For a single touch, this is true after the touch-point has moved beyond |
| 44 // the platform slop region. For a multitouch, this is true after any |
| 45 // touch-point has moved (by whatever amount). |
| 46 bool moved_beyond_slop_region; |
| 47 |
| 48 // Whether this touch event is a touchstart or a first touchmove event per |
| 49 // scroll. |
| 50 bool touch_start_or_first_touch_move; |
| 51 |
| 52 #if INSIDE_BLINK |
| 53 bool IsCancelable() const { return dispatch_type == kBlocking; } |
| 54 |
| 55 BLINK_PLATFORM_EXPORT WebPointerEvent WebPointerEventInRootFrame() const; |
| 56 |
| 57 #endif |
| 58 }; |
| 59 |
| 60 #pragma pack(pop) |
| 61 |
| 62 } // namespace blink |
| 63 |
| 64 #endif // WebMouseEvent_h |
OLD | NEW |