OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2009 Google Inc. All rights reserved. | 2 * Copyright (C) 2009 Google 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 are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
91 } | 91 } |
92 | 92 |
93 PlatformEvent::DispatchType toPlatformDispatchType(WebInputEvent::DispatchType t
ype) | 93 PlatformEvent::DispatchType toPlatformDispatchType(WebInputEvent::DispatchType t
ype) |
94 { | 94 { |
95 static_assert(PlatformEvent::DispatchType::Blocking == static_cast<PlatformE
vent::DispatchType>(WebInputEvent::DispatchType::Blocking), | 95 static_assert(PlatformEvent::DispatchType::Blocking == static_cast<PlatformE
vent::DispatchType>(WebInputEvent::DispatchType::Blocking), |
96 "Dispatch Types not equal"); | 96 "Dispatch Types not equal"); |
97 static_assert(PlatformEvent::DispatchType::EventNonBlocking == static_cast<P
latformEvent::DispatchType>(WebInputEvent::DispatchType::EventNonBlocking), | 97 static_assert(PlatformEvent::DispatchType::EventNonBlocking == static_cast<P
latformEvent::DispatchType>(WebInputEvent::DispatchType::EventNonBlocking), |
98 "Dispatch Types not equal"); | 98 "Dispatch Types not equal"); |
99 static_assert(PlatformEvent::DispatchType::ListenersNonBlockingPassive == st
atic_cast<PlatformEvent::DispatchType>(WebInputEvent::DispatchType::ListenersNon
BlockingPassive), | 99 static_assert(PlatformEvent::DispatchType::ListenersNonBlockingPassive == st
atic_cast<PlatformEvent::DispatchType>(WebInputEvent::DispatchType::ListenersNon
BlockingPassive), |
100 "Dispatch Types not equal"); | 100 "Dispatch Types not equal"); |
101 static_assert(PlatformEvent::DispatchType::ListenersForcedNonBlockingPassive
== static_cast<PlatformEvent::DispatchType>(WebInputEvent::DispatchType::Listen
ersForcedNonBlockingPassive), | 101 static_assert(PlatformEvent::DispatchType::ListenersForcedNonBlockingDueToFl
ing == static_cast<PlatformEvent::DispatchType>(WebInputEvent::DispatchType::Lis
tenersForcedNonBlockingDueToFling), |
102 "Dispatch Types not equal"); | 102 "Dispatch Types not equal"); |
103 | 103 |
104 return static_cast<PlatformEvent::DispatchType>(type); | 104 return static_cast<PlatformEvent::DispatchType>(type); |
105 } | 105 } |
106 | 106 |
107 unsigned toPlatformModifierFrom(WebMouseEvent::Button button) | 107 unsigned toPlatformModifierFrom(WebMouseEvent::Button button) |
108 { | 108 { |
109 if (button == WebMouseEvent::Button::NoButton) | 109 if (button == WebMouseEvent::Button::NoButton) |
110 return 0; | 110 return 0; |
111 | 111 |
(...skipping 364 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
476 m_rotationAngle = point.rotationAngle; | 476 m_rotationAngle = point.rotationAngle; |
477 } | 477 } |
478 | 478 |
479 PlatformTouchEventBuilder::PlatformTouchEventBuilder(Widget* widget, const WebTo
uchEvent& event) | 479 PlatformTouchEventBuilder::PlatformTouchEventBuilder(Widget* widget, const WebTo
uchEvent& event) |
480 { | 480 { |
481 m_type = toPlatformTouchEventType(event.type); | 481 m_type = toPlatformTouchEventType(event.type); |
482 m_modifiers = event.modifiers; | 482 m_modifiers = event.modifiers; |
483 m_timestamp = event.timeStampSeconds; | 483 m_timestamp = event.timeStampSeconds; |
484 m_causesScrollingIfUncanceled = event.movedBeyondSlopRegion; | 484 m_causesScrollingIfUncanceled = event.movedBeyondSlopRegion; |
485 m_dispatchedDuringFling = event.dispatchedDuringFling; | 485 m_dispatchedDuringFling = event.dispatchedDuringFling; |
| 486 m_touchStartOrFirstTouchMove = event.touchStartOrFirstTouchMove; |
486 | 487 |
487 for (unsigned i = 0; i < event.touchesLength; ++i) | 488 for (unsigned i = 0; i < event.touchesLength; ++i) |
488 m_touchPoints.append(PlatformTouchPointBuilder(widget, event.touches[i])
); | 489 m_touchPoints.append(PlatformTouchPointBuilder(widget, event.touches[i])
); |
489 | 490 |
490 m_dispatchType = toPlatformDispatchType(event.dispatchType); | 491 m_dispatchType = toPlatformDispatchType(event.dispatchType); |
491 m_uniqueTouchEventId = event.uniqueTouchEventId; | 492 m_uniqueTouchEventId = event.uniqueTouchEventId; |
492 } | 493 } |
493 | 494 |
494 static FloatPoint convertAbsoluteLocationForLayoutObjectFloat(const LayoutPoint&
location, const LayoutItem layoutItem) | 495 static FloatPoint convertAbsoluteLocationForLayoutObjectFloat(const LayoutPoint&
location, const LayoutItem layoutItem) |
495 { | 496 { |
(...skipping 322 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
818 break; | 819 break; |
819 case GestureSourceTouchscreen: | 820 case GestureSourceTouchscreen: |
820 sourceDevice = WebGestureDeviceTouchscreen; | 821 sourceDevice = WebGestureDeviceTouchscreen; |
821 break; | 822 break; |
822 case GestureSourceUninitialized: | 823 case GestureSourceUninitialized: |
823 NOTREACHED(); | 824 NOTREACHED(); |
824 } | 825 } |
825 } | 826 } |
826 | 827 |
827 } // namespace blink | 828 } // namespace blink |
OLD | NEW |